diff --git a/.gn b/.gn index 2f343e0..16c1c38d 100644 --- a/.gn +++ b/.gn
@@ -139,7 +139,65 @@ # These are the list of GN files that run exec_script. This whitelist exists # to force additional review for new uses of exec_script, which is strongly -# discouraged except for gypi_to_gn calls. +# discouraged. +# +# GYPI_TO_GN +# +# Most of these entries are for gypi_to_gn calls. We should not be adding new +# calls to this script in the build (see //build/gypi_to_gn.py for detailed +# advice). The only time you should be editing this list for gypi_to_gn +# purposes is when moving an existing call to a different place. +# +# PLEASE READ +# +# You should almost never need to add new exec_script calls. exec_script is +# slow, especially on Windows, and can cause confusing effects. Although +# individually each call isn't slow or necessarily very confusing, at the scale +# of our repo things get out of hand quickly. By strongly pushing back on all +# additions, we keep the build fast and clean. If you think you need to add a +# new call, please consider: +# +# - Do not use a script to check for the existance of a file or directory to +# enable a different mode. Instead, use GN build args to enable or disable +# functionality and set options. An example is checking for a file in the +# src-internal repo to see if the corresponding src-internal feature should +# be enabled. There are several things that can go wrong with this: +# +# - It's mysterious what causes some things to happen. Although in many cases +# such behavior can be conveniently automatic, GN optimizes for explicit +# and obvious behavior so people can more easily diagnose problems. +# +# - The user can't enable a mode for one build and not another. With GN build +# args, the user can choose the exact configuration of multiple builds +# using one checkout. But implicitly basing flags on the state of the +# checkout, this functionality is broken. +# +# - It's easy to get stale files. If for example the user edits the gclient +# to stop checking out src-internal (or any other optional thing), it's +# easy to end up with stale files still mysteriously triggering build +# conditions that are no longer appropriate (yes, this happens in real +# life). +# +# - Do not use a script to iterate files in a directory (glob): +# +# - This has the same "stale file" problem as the above discussion. Various +# operations can leave untracked files in the source tree which can cause +# surprising effects. +# +# - It becomes impossible to use "git grep" to find where a certain file is +# referenced. This operation is very common and people really do get +# confused when things aren't listed. +# +# - It's easy to screw up. One common case is a build-time script that packs +# up a directory. The author notices that the script isn't re-run when the +# directory is updated, so adds a glob so all the files are listed as +# inputs. This seems to work great... until a file is deleted. When a +# file is deleted, all the inputs the glob lists will still be up-to-date +# and no command-lines will have been changed. The action will not be +# re-run and the build will be broken. It is possible to get this correct +# using glob, and it's possible to mess it up without glob, but globs make +# this situation much easier to create. if the build always lists the +# files and passes them to a script, it will always be correct. exec_script_whitelist = [ "//android_webview/BUILD.gn", "//ash/BUILD.gn",
diff --git a/BUILD.gn b/BUILD.gn index 88fc91a..02d1edd 100644 --- a/BUILD.gn +++ b/BUILD.gn
@@ -208,7 +208,6 @@ "//ui/display:display_unittests", "//ui/events:events_unittests", "//ui/gl:gl_unittests", - "//ui/latency_info:latency_info_unittests", "//ui/touch_selection:ui_touch_selection_unittests", "//url/ipc:url_ipc_unittests", ]
diff --git a/DEPS b/DEPS index 296612b0..f2ed7382 100644 --- a/DEPS +++ b/DEPS
@@ -39,11 +39,11 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling Skia # and whatever else without interference from each other. - 'skia_revision': 'bde57ed11b8a6bd6da6043189e000c58bf146422', + 'skia_revision': 'b800248c73c75b02ab808c5bdb53e19e6abc3adc', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling V8 # and whatever else without interference from each other. - 'v8_revision': '35f367373553f4ecc260aec67c1cee8f0020b0f2', + 'v8_revision': '0d3888a14530bfae7f76268e18e386016cf0ff40', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling swarming_client # and whatever else without interference from each other. @@ -59,7 +59,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling PDFium # and whatever else without interference from each other. - 'pdfium_revision': '2ba3dc72f73f8e6cdd0423d02a12528096c2d90a', + 'pdfium_revision': 'e3bbfa29b9d38dbbb77c12692eba3c40a7fb2870', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling openmax_dl # and whatever else without interference from each other. @@ -83,7 +83,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling NaCl # and whatever else without interference from each other. - 'nacl_revision': '44a5a1eee2ce76d15bb0169472b177f61497040d', + 'nacl_revision': 'f640889e8f9f0347fcccc8842aeb0b6fbed1cdd3', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling dEQP # and whatever else without interference from each other. @@ -96,7 +96,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': '7ea5228763e4cd9d39e4c39c14d4ad1fdb5bc4ac', + 'catapult_revision': 'a39f24c16d2f1b5d5a3b3c623b9857cbc5e02b98', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling libFuzzer # and whatever else without interference from each other. @@ -380,7 +380,7 @@ # For Linux and Chromium OS. 'src/third_party/cros_system_api': - Var('chromium_git') + '/chromiumos/platform/system_api.git' + '@' + '4b936110e07abfa7b582e15af36d805bef25318b', + Var('chromium_git') + '/chromiumos/platform/system_api.git' + '@' + 'a887ad7e1a3058bb4f0c8a0e90e498c24ca32d80', # Note that this is different from Android's freetype repo. 'src/third_party/freetype2/src': @@ -391,7 +391,7 @@ # Build tools for Chrome OS. Note: This depends on third_party/pyelftools. 'src/third_party/chromite': - Var('chromium_git') + '/chromiumos/chromite.git' + '@' + '9bb353c06c398f670e8a33db1eba74760ac3a6d6', + Var('chromium_git') + '/chromiumos/chromite.git' + '@' + 'c16821a44240a0be862f9756fa8c5e210e890b66', # Dependency of chromite.git and skia. 'src/third_party/pyelftools':
diff --git a/PRESUBMIT.py b/PRESUBMIT.py index ca87ae7d..4421f2e 100644 --- a/PRESUBMIT.py +++ b/PRESUBMIT.py
@@ -187,10 +187,19 @@ ), ), ( + 'skia::RefPtr', + ( + 'The use of skia::RefPtr is prohibited. ', + 'Please use sk_sp<> instead.' + ), + True, + (), + ), + ( 'SkRefPtr', ( 'The use of SkRefPtr is prohibited. ', - 'Please use skia::RefPtr instead.' + 'Please use sk_sp<> instead.' ), True, (), @@ -199,7 +208,7 @@ 'SkAutoRef', ( 'The indirect use of SkRefPtr via SkAutoRef is prohibited. ', - 'Please use skia::RefPtr instead.' + 'Please use sk_sp<> instead.' ), True, (), @@ -208,7 +217,7 @@ 'SkAutoTUnref', ( 'The use of SkAutoTUnref is dangerous because it implicitly ', - 'converts to a raw pointer. Please use skia::RefPtr instead.' + 'converts to a raw pointer. Please use sk_sp<> instead.' ), True, (), @@ -218,7 +227,7 @@ ( 'The indirect use of SkAutoTUnref through SkAutoUnref is dangerous ', 'because it implicitly converts to a raw pointer. ', - 'Please use skia::RefPtr instead.' + 'Please use sk_sp<> instead.' ), True, (),
diff --git a/WATCHLISTS b/WATCHLISTS index e6bd49f..0d0b147d 100644 --- a/WATCHLISTS +++ b/WATCHLISTS
@@ -365,6 +365,9 @@ 'extension': { 'filepath': 'extension', }, + 'feedback_ui': { + 'filepath': 'chrome/browser/resources/(md_)?feedback/' + }, 'fileapi': { 'filepath': 'file_system/|' \ 'fileapi/' @@ -605,7 +608,8 @@ }, 'offline_pages': { 'filepath': 'components/offline_pages/'\ - '|chrome/browser/android/offline_pages/' + '|chrome/browser/android/offline_pages/'\ + '|chrome/android/java/src/org/chromium/chrome/browser/offlinepages/' }, 'omnibox': { 'filepath': 'chrome/browser/autocomplete/'\ @@ -1421,6 +1425,7 @@ 'events': ['tdresser+watch@chromium.org'], 'extension': ['chromium-apps-reviews@chromium.org', 'extensions-reviews@chromium.org'], + 'feedback_ui': ['apacible+watch@chromium.org'], 'fileapi': ['kinuko+fileapi@chromium.org', 'nhiroki@chromium.org', 'tzik@chromium.org'], @@ -1495,7 +1500,8 @@ 'pedrosimonetti+watch@chromium.org'], 'ntp_snippets': ['mcwilliams+watch@chromium.org', 'dgn+watch@chromium.org'], - 'offline_pages': ['dimich+watch@chromium.org'], + 'offline_pages': ['dimich+watch@chromium.org', + 'fgorski+watch@chromium.org'], 'omnibox': ['suzhe@chromium.org'], 'options': ['dbeam+watch-options@chromium.org', 'michaelpg+watch-options@chromium.org'],
diff --git a/android_webview/glue/java/src/com/android/webview/chromium/DrawGLFunctor.java b/android_webview/glue/java/src/com/android/webview/chromium/DrawGLFunctor.java index 597313b..c618b1a 100644 --- a/android_webview/glue/java/src/com/android/webview/chromium/DrawGLFunctor.java +++ b/android_webview/glue/java/src/com/android/webview/chromium/DrawGLFunctor.java
@@ -16,8 +16,7 @@ * Simple Java abstraction and wrapper for the native DrawGLFunctor flow. * An instance of this class can be constructed, bound to a single view context (i.e. AwContennts) * and then drawn and detached from the view tree any number of times (using requestDrawGL and - * detach respectively). Then when finished with, it can be explicitly released by calling - * destroy() or will clean itself up as required via finalizer / CleanupReference. + * detach respectively). */ class DrawGLFunctor { private static final String TAG = DrawGLFunctor.class.getSimpleName(); @@ -36,17 +35,6 @@ mWebViewDelegate = webViewDelegate; } - public void destroy() { - detach(); - if (mCleanupReference != null) { - mCleanupReference.cleanupNow(); - mCleanupReference = null; - mDestroyRunnable = null; - mWebViewDelegate = null; - mContainerView = null; - } - } - public void detach() { if (mWebViewDelegate != null && mContainerView != null) { mWebViewDelegate.detachDrawGlFunctor(mContainerView, mNativeDrawGLFunctor);
diff --git a/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java b/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java index 49bc09a..830425c7 100644 --- a/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java +++ b/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java
@@ -461,10 +461,6 @@ mContentsClientAdapter.setDownloadListener(null); mAwContents.destroy(); - if (mGLfunctor != null) { - mGLfunctor.destroy(); - mGLfunctor = null; - } } @Override
diff --git a/android_webview/java/src/org/chromium/android_webview/AwContents.java b/android_webview/java/src/org/chromium/android_webview/AwContents.java index 98935fb..e932149 100644 --- a/android_webview/java/src/org/chromium/android_webview/AwContents.java +++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java
@@ -322,18 +322,17 @@ // Hold onto a reference to the window (via its wrapper), so that it is not destroyed // until we are done here. private final WindowAndroidWrapper mWindowAndroid; - private final Runnable mAwGLFunctorDestroyRunnable; + private final Object mAwGLFunctorNativeLifetimeObject; private DestroyRunnable(long nativeAwContents, WindowAndroidWrapper windowAndroid, AwGLFunctor awGLFunctor) { mNativeAwContents = nativeAwContents; mWindowAndroid = windowAndroid; - mAwGLFunctorDestroyRunnable = awGLFunctor.getDestroyRunnable(); + mAwGLFunctorNativeLifetimeObject = awGLFunctor.getNativeLifetimeObject(); } @Override public void run() { nativeDestroy(mNativeAwContents); - mAwGLFunctorDestroyRunnable.run(); } }
diff --git a/android_webview/java/src/org/chromium/android_webview/AwGLFunctor.java b/android_webview/java/src/org/chromium/android_webview/AwGLFunctor.java index 4f37589..e43b840 100644 --- a/android_webview/java/src/org/chromium/android_webview/AwGLFunctor.java +++ b/android_webview/java/src/org/chromium/android_webview/AwGLFunctor.java
@@ -9,6 +9,7 @@ import org.chromium.base.annotations.CalledByNative; import org.chromium.base.annotations.JNINamespace; +import org.chromium.content.common.CleanupReference; /** * Manages state associated with the Android render thread and the draw functor @@ -33,6 +34,7 @@ private final long mNativeAwGLFunctor; private final DestroyRunnable mDestroyRunnable; + private final CleanupReference mCleanupReference; private final AwContents.NativeGLDelegate mNativeGLDelegate; private final ViewGroup mContainerView; private final Runnable mFunctorReleasedCallback; @@ -40,6 +42,7 @@ public AwGLFunctor(AwContents.NativeGLDelegate nativeGLDelegate, ViewGroup containerView) { mNativeAwGLFunctor = nativeCreate(this); mDestroyRunnable = new DestroyRunnable(mNativeAwGLFunctor); + mCleanupReference = new CleanupReference(mDestroyRunnable, mDestroyRunnable); mNativeGLDelegate = nativeGLDelegate; mContainerView = containerView; if (mNativeGLDelegate.supportsDrawGLFunctorReleasedCallback()) { @@ -63,7 +66,7 @@ return mNativeAwGLFunctor; } - public Runnable getDestroyRunnable() { + public Object getNativeLifetimeObject() { return mDestroyRunnable; }
diff --git a/android_webview/native/aw_autofill_client.cc b/android_webview/native/aw_autofill_client.cc index a9e3a96..370d042 100644 --- a/android_webview/native/aw_autofill_client.cc +++ b/android_webview/native/aw_autofill_client.cc
@@ -217,6 +217,7 @@ void AwAutofillClient::ShowUnmaskPrompt( const autofill::CreditCard& card, + UnmaskCardReason reason, base::WeakPtr<autofill::CardUnmaskDelegate> delegate) { NOTIMPLEMENTED(); }
diff --git a/android_webview/native/aw_autofill_client.h b/android_webview/native/aw_autofill_client.h index 09a92773..94fd5cc 100644 --- a/android_webview/native/aw_autofill_client.h +++ b/android_webview/native/aw_autofill_client.h
@@ -70,6 +70,7 @@ void ShowAutofillSettings() override; void ShowUnmaskPrompt( const autofill::CreditCard& card, + UnmaskCardReason reason, base::WeakPtr<autofill::CardUnmaskDelegate> delegate) override; void OnUnmaskVerificationResult(PaymentsRpcResult result) override; void ConfirmSaveCreditCardLocally(const autofill::CreditCard& card,
diff --git a/ash/accelerators/accelerator_controller_unittest.cc b/ash/accelerators/accelerator_controller_unittest.cc index a755e3b..00625c5 100644 --- a/ash/accelerators/accelerator_controller_unittest.cc +++ b/ash/accelerators/accelerator_controller_unittest.cc
@@ -23,6 +23,7 @@ #include "ash/test/test_shell_delegate.h" #include "ash/test/test_volume_control_delegate.h" #include "ash/volume_control_delegate.h" +#include "ash/wm/common/window_positioning_utils.h" #include "ash/wm/common/wm_event.h" #include "ash/wm/lock_state_controller.h" #include "ash/wm/panels/panel_layout_manager.h" @@ -450,13 +451,13 @@ { GetController()->PerformActionIfEnabled(WINDOW_CYCLE_SNAP_DOCK_LEFT); gfx::Rect expected_bounds = wm::GetDefaultLeftSnappedWindowBoundsInParent( - window.get()); + wm::WmWindowAura::Get(window.get())); EXPECT_EQ(expected_bounds.ToString(), window->bounds().ToString()); } { GetController()->PerformActionIfEnabled(WINDOW_CYCLE_SNAP_DOCK_RIGHT); gfx::Rect expected_bounds = wm::GetDefaultRightSnappedWindowBoundsInParent( - window.get()); + wm::WmWindowAura::Get(window.get())); EXPECT_EQ(expected_bounds.ToString(), window->bounds().ToString()); } { @@ -505,7 +506,7 @@ GetController()->PerformActionIfEnabled(WINDOW_CYCLE_SNAP_DOCK_LEFT); gfx::Rect normal_bounds = window1_state->GetRestoreBoundsInParent(); gfx::Rect expected_bounds = wm::GetDefaultLeftSnappedWindowBoundsInParent( - window1.get()); + wm::WmWindowAura::Get(window1.get())); EXPECT_EQ(expected_bounds.ToString(), window1->bounds().ToString()); EXPECT_TRUE(window1_state->IsSnapped()); GetController()->PerformActionIfEnabled(WINDOW_CYCLE_SNAP_DOCK_LEFT); @@ -527,8 +528,8 @@ GetController()->PerformActionIfEnabled(WINDOW_CYCLE_SNAP_DOCK_RIGHT); gfx::Rect normal_bounds = window1_state->GetRestoreBoundsInParent(); - gfx::Rect expected_bounds = - wm::GetDefaultRightSnappedWindowBoundsInParent(window1.get()); + gfx::Rect expected_bounds = wm::GetDefaultRightSnappedWindowBoundsInParent( + wm::WmWindowAura::Get(window1.get())); EXPECT_EQ(expected_bounds.ToString(), window1->bounds().ToString()); EXPECT_TRUE(window1_state->IsSnapped()); GetController()->PerformActionIfEnabled(WINDOW_CYCLE_SNAP_DOCK_RIGHT); @@ -549,10 +550,10 @@ window1_state->Activate(); GetController()->PerformActionIfEnabled(WINDOW_CYCLE_SNAP_DOCK_LEFT); - gfx::Rect expected_bounds = - wm::GetDefaultLeftSnappedWindowBoundsInParent(window1.get()); - gfx::Rect expected_bounds2 = - wm::GetDefaultRightSnappedWindowBoundsInParent(window1.get()); + gfx::Rect expected_bounds = wm::GetDefaultLeftSnappedWindowBoundsInParent( + wm::WmWindowAura::Get(window1.get())); + gfx::Rect expected_bounds2 = wm::GetDefaultRightSnappedWindowBoundsInParent( + wm::WmWindowAura::Get(window1.get())); EXPECT_EQ(expected_bounds.ToString(), window1->bounds().ToString()); EXPECT_TRUE(window1_state->IsSnapped()); GetController()->PerformActionIfEnabled(WINDOW_CYCLE_SNAP_DOCK_LEFT); @@ -621,8 +622,8 @@ gfx::Rect window_restore_bounds2 = window->bounds(); GetController()->PerformActionIfEnabled(WINDOW_CYCLE_SNAP_DOCK_LEFT); - gfx::Rect expected_bounds = - wm::GetDefaultLeftSnappedWindowBoundsInParent(window.get()); + gfx::Rect expected_bounds = wm::GetDefaultLeftSnappedWindowBoundsInParent( + wm::WmWindowAura::Get(window.get())); gfx::Rect window_restore_bounds = window_state->GetRestoreBoundsInScreen(); EXPECT_NE(expected_bounds.ToString(), window->bounds().ToString());
diff --git a/ash/accelerators/accelerator_delegate.h b/ash/accelerators/accelerator_delegate.h index 611db0ed..778210d 100644 --- a/ash/accelerators/accelerator_delegate.h +++ b/ash/accelerators/accelerator_delegate.h
@@ -13,7 +13,7 @@ namespace ash { class ASH_EXPORT AcceleratorDelegate - : NON_EXPORTED_BASE(public wm::AcceleratorDelegate) { + : NON_EXPORTED_BASE(public ::wm::AcceleratorDelegate) { public: AcceleratorDelegate(); ~AcceleratorDelegate() override;
diff --git a/ash/ash.gyp b/ash/ash.gyp index e2caf98..5e7caf48 100644 --- a/ash/ash.gyp +++ b/ash/ash.gyp
@@ -527,14 +527,24 @@ 'wm/ash_native_cursor_manager.h', 'wm/aura/aura_layout_manager_adapter.cc', 'wm/aura/aura_layout_manager_adapter.h', + 'wm/aura/wm_globals_aura.cc', + 'wm/aura/wm_globals_aura.h', 'wm/aura/wm_root_window_controller_aura.cc', 'wm/aura/wm_root_window_controller_aura.h', 'wm/aura/wm_window_aura.cc', 'wm/aura/wm_window_aura.h', 'wm/boot_splash_screen_chromeos.cc', 'wm/boot_splash_screen_chromeos.h', + 'wm/common/window_animation_types.h', + 'wm/common/window_parenting_utils.cc', + 'wm/common/window_parenting_utils.h', + 'wm/common/window_positioning_utils.cc', + 'wm/common/window_positioning_utils.h', + 'wm/common/window_state_util.cc', + 'wm/common/window_state_util.h', 'wm/common/wm_event.cc', 'wm/common/wm_event.h', + 'wm/common/wm_globals.h', 'wm/common/wm_layout_manager.h', 'wm/common/wm_root_window_controller.h', 'wm/common/wm_screen_util.cc', @@ -545,6 +555,7 @@ 'wm/common/wm_window_observer.h', 'wm/common/wm_window_property.h', 'wm/common/workspace/workspace_layout_manager_delegate.h', + 'wm/common/workspace/workspace_types.h', 'wm/coordinate_conversion.cc', 'wm/coordinate_conversion.h', 'wm/cursor_manager_chromeos.cc', @@ -677,8 +688,6 @@ 'wm/window_state_delegate.cc', 'wm/window_state_delegate.h', 'wm/window_state_observer.h', - 'wm/window_state_util.cc', - 'wm/window_state_util.h', 'wm/window_util.cc', 'wm/window_util.h', 'wm/workspace/magnetism_matcher.cc', @@ -694,7 +703,6 @@ 'wm/workspace/workspace_layout_manager.cc', 'wm/workspace/workspace_layout_manager.h', 'wm/workspace/workspace_layout_manager_backdrop_delegate.h', - 'wm/workspace/workspace_types.h', 'wm/workspace/workspace_window_resizer.cc', 'wm/workspace/workspace_window_resizer.h', 'wm/workspace_controller.cc',
diff --git a/ash/default_user_wallpaper_delegate.cc b/ash/default_user_wallpaper_delegate.cc index c6a5587e..f42ac71 100644 --- a/ash/default_user_wallpaper_delegate.cc +++ b/ash/default_user_wallpaper_delegate.cc
@@ -11,7 +11,7 @@ namespace ash { int DefaultUserWallpaperDelegate::GetAnimationType() { - return wm::WINDOW_VISIBILITY_ANIMATION_TYPE_FADE; + return ::wm::WINDOW_VISIBILITY_ANIMATION_TYPE_FADE; } int DefaultUserWallpaperDelegate::GetAnimationDurationOverride() {
diff --git a/ash/desktop_background/desktop_background_view.cc b/ash/desktop_background/desktop_background_view.cc index 1a915a2..57ead51 100644 --- a/ash/desktop_background/desktop_background_view.cc +++ b/ash/desktop_background/desktop_background_view.cc
@@ -221,8 +221,8 @@ desktop_widget->SetContentsView( new LayerControlView(new DesktopBackgroundView())); int animation_type = wallpaper_delegate->GetAnimationType(); - wm::SetWindowVisibilityAnimationType( - desktop_widget->GetNativeView(), animation_type); + ::wm::SetWindowVisibilityAnimationType(desktop_widget->GetNativeView(), + animation_type); RootWindowController* root_window_controller = GetRootWindowController(root_window); @@ -235,18 +235,18 @@ if (wallpaper_delegate->ShouldShowInitialAnimation() || root_window_controller->animating_wallpaper_controller() || Shell::GetInstance()->session_state_delegate()->NumberOfLoggedInUsers()) { - wm::SetWindowVisibilityAnimationTransition( - desktop_widget->GetNativeView(), wm::ANIMATE_SHOW); + ::wm::SetWindowVisibilityAnimationTransition( + desktop_widget->GetNativeView(), ::wm::ANIMATE_SHOW); int duration_override = wallpaper_delegate->GetAnimationDurationOverride(); if (duration_override) { - wm::SetWindowVisibilityAnimationDuration( + ::wm::SetWindowVisibilityAnimationDuration( desktop_widget->GetNativeView(), base::TimeDelta::FromMilliseconds(duration_override)); } } else { // Disable animation if transition to login screen from an empty background. - wm::SetWindowVisibilityAnimationTransition( - desktop_widget->GetNativeView(), wm::ANIMATE_NONE); + ::wm::SetWindowVisibilityAnimationTransition( + desktop_widget->GetNativeView(), ::wm::ANIMATE_NONE); } desktop_widget->SetBounds(params.parent->bounds());
diff --git a/ash/display/display_change_observer_chromeos.cc b/ash/display/display_change_observer_chromeos.cc index 8e92ff0..a9303c0e 100644 --- a/ash/display/display_change_observer_chromeos.cc +++ b/ash/display/display_change_observer_chromeos.cc
@@ -265,6 +265,7 @@ Shell::GetInstance() ->display_configurator() ->GetAvailableColorCalibrationProfiles(id)); + new_info.set_maximum_cursor_size(state->maximum_cursor_size()); } AssociateTouchscreens(
diff --git a/ash/display/display_info.cc b/ash/display/display_info.cc index 74efc87..e510362 100644 --- a/ash/display/display_info.cc +++ b/ash/display/display_info.cc
@@ -21,7 +21,7 @@ #if defined(OS_WIN) #include "ui/aura/window_tree_host.h" -#include "ui/gfx/win/dpi.h" +#include "ui/display/win/dpi.h" #endif namespace ash { @@ -171,7 +171,7 @@ float device_scale_factor = 1.0f; if (!GetDisplayBounds(main_spec, &bounds_in_native, &device_scale_factor)) { #if defined(OS_WIN) - device_scale_factor = gfx::GetDPIScale(); + device_scale_factor = display::win::GetDPIScale(); #endif } @@ -305,6 +305,7 @@ is_aspect_preserving_scaling_ = native_info.is_aspect_preserving_scaling_; display_modes_ = native_info.display_modes_; available_color_profiles_ = native_info.available_color_profiles_; + maximum_cursor_size_ = native_info.maximum_cursor_size_; // Rotation, ui_scale, color_profile and overscan are given by preference, // or unit tests. Don't copy if this native_info came from
diff --git a/ash/display/display_info.h b/ash/display/display_info.h index fadd5241..d8bf1917a 100644 --- a/ash/display/display_info.h +++ b/ash/display/display_info.h
@@ -246,6 +246,12 @@ is_aspect_preserving_scaling_ = value; } + // Maximum cursor size in native pixels. + const gfx::Size& maximum_cursor_size() const { return maximum_cursor_size_; } + void set_maximum_cursor_size(const gfx::Size& size) { + maximum_cursor_size_ = size; + } + // Returns a string representation of the DisplayInfo, excluding display // modes. std::string ToString() const; @@ -315,6 +321,9 @@ // The list of available variations for the color calibration. std::vector<ui::ColorCalibrationProfile> available_color_profiles_; + // Maximum cursor size. + gfx::Size maximum_cursor_size_; + // If you add a new member, you need to update Copy(). };
diff --git a/ash/display/display_manager.cc b/ash/display/display_manager.cc index 1fa84cb4..4c882f0 100644 --- a/ash/display/display_manager.cc +++ b/ash/display/display_manager.cc
@@ -1259,6 +1259,7 @@ device_scale_factor, gfx::Rect(bounds_in_native.size())); new_display.set_rotation(display_info.GetActiveRotation()); new_display.set_touch_support(display_info.touch_support()); + new_display.set_maximum_cursor_size(display_info.maximum_cursor_size()); return new_display; } @@ -1274,6 +1275,7 @@ 1.0f, gfx::Rect(origin, gfx::ScaleToFlooredSize( display_info.size_in_pixel(), scale))); new_display.set_touch_support(display_info.touch_support()); + new_display.set_maximum_cursor_size(display_info.maximum_cursor_size()); return new_display; }
diff --git a/ash/frame/caption_buttons/frame_size_button.cc b/ash/frame/caption_buttons/frame_size_button.cc index 0ae229f..7426c57 100644 --- a/ash/frame/caption_buttons/frame_size_button.cc +++ b/ash/frame/caption_buttons/frame_size_button.cc
@@ -7,6 +7,8 @@ #include "ash/metrics/user_metrics_recorder.h" #include "ash/screen_util.h" #include "ash/shell.h" +#include "ash/wm/aura/wm_window_aura.h" +#include "ash/wm/common/window_positioning_utils.h" #include "ash/wm/common/wm_event.h" #include "ash/wm/window_state.h" #include "ash/wm/window_state_aura.h" @@ -223,11 +225,14 @@ if (!phantom_window_controller_.get()) { phantom_window_controller_.reset(new PhantomWindowController(window)); } - gfx::Rect phantom_bounds_in_parent = (snap_type_ == SNAP_LEFT) ? - wm::GetDefaultLeftSnappedWindowBoundsInParent(window) : - wm::GetDefaultRightSnappedWindowBoundsInParent(window); + gfx::Rect phantom_bounds_in_parent = + (snap_type_ == SNAP_LEFT) + ? wm::GetDefaultLeftSnappedWindowBoundsInParent( + wm::WmWindowAura::Get(window)) + : wm::GetDefaultRightSnappedWindowBoundsInParent( + wm::WmWindowAura::Get(window)); phantom_window_controller_->Show(ScreenUtil::ConvertRectToScreen( - window->parent(), phantom_bounds_in_parent)); + window->parent(), phantom_bounds_in_parent)); } else { phantom_window_controller_.reset(); }
diff --git a/ash/magnifier/magnification_controller.cc b/ash/magnifier/magnification_controller.cc index f602058..052d606 100644 --- a/ash/magnifier/magnification_controller.cc +++ b/ash/magnifier/magnification_controller.cc
@@ -817,7 +817,7 @@ caret_point_ = caret_bounds.CenterPoint(); // |caret_point_| in |root_window_| coordinates. - wm::ConvertPointFromScreen(root_window_, &caret_point_); + ::wm::ConvertPointFromScreen(root_window_, &caret_point_); // If the feature for centering the text input focus is disabled, the // magnifier window will be moved to follow the focus with a panning margin.
diff --git a/ash/magnifier/magnification_controller_unittest.cc b/ash/magnifier/magnification_controller_unittest.cc index 3f8e049..4df32b7 100644 --- a/ash/magnifier/magnification_controller_unittest.cc +++ b/ash/magnifier/magnification_controller_unittest.cc
@@ -124,7 +124,7 @@ // Convert origin to screen coordinates. views::View::ConvertPointToScreen(text_input_view_, &origin); // Convert origin to root_window_ coordinates. - wm::ConvertPointFromScreen(GetRootWindow(), &origin); + ::wm::ConvertPointFromScreen(GetRootWindow(), &origin); return gfx::Rect(origin.x(), origin.y(), bounds.width(), bounds.height()); } @@ -133,7 +133,7 @@ gfx::Rect caret_bounds = GetInputMethod()->GetTextInputClient()->GetCaretBounds(); gfx::Point origin = caret_bounds.origin(); - wm::ConvertPointFromScreen(GetRootWindow(), &origin); + ::wm::ConvertPointFromScreen(GetRootWindow(), &origin); return gfx::Rect( origin.x(), origin.y(), caret_bounds.width(), caret_bounds.height()); }
diff --git a/ash/resources/BUILD.gn b/ash/resources/BUILD.gn index 399ad6f2..3640ffe 100644 --- a/ash/resources/BUILD.gn +++ b/ash/resources/BUILD.gn
@@ -31,11 +31,15 @@ ] if (percent == "100") { - sources += [ "$root_gen_dir/ui/resources/webui_resources.pak" ] + sources += [ + "$root_gen_dir/content/content_resources.pak", + "$root_gen_dir/ui/resources/webui_resources.pak", + ] } deps = [ "//ash/resources", + "//content:resources", "//ui/resources", ]
diff --git a/ash/root_window_controller.cc b/ash/root_window_controller.cc index 0f99806..12d433c 100644 --- a/ash/root_window_controller.cc +++ b/ash/root_window_controller.cc
@@ -33,6 +33,7 @@ #include "ash/touch/touch_hud_projection.h" #include "ash/touch/touch_observer_hud.h" #include "ash/wm/always_on_top_controller.h" +#include "ash/wm/aura/wm_window_aura.h" #include "ash/wm/common/workspace/workspace_layout_manager_delegate.h" #include "ash/wm/dock/docked_window_layout_manager.h" #include "ash/wm/lock_layout_manager.h" @@ -134,7 +135,7 @@ new_parent->id() != kShellWindowId_DockedContainer; gfx::Rect local_bounds; if (update_bounds) { - local_bounds = state->aura_window()->bounds(); + local_bounds = wm::WmWindowAura::GetAuraWindow(state->window())->bounds(); MoveOriginRelativeToSize(src_size, dst_size, &local_bounds); }
diff --git a/ash/rotator/screen_rotation_animator.cc b/ash/rotator/screen_rotation_animator.cc index 28dd343b..1725dac9 100644 --- a/ash/rotator/screen_rotation_animator.cc +++ b/ash/rotator/screen_rotation_animator.cc
@@ -169,7 +169,7 @@ const gfx::Tween::Type tween_type = gfx::Tween::FAST_OUT_LINEAR_IN; std::unique_ptr<ui::LayerTreeOwner> old_layer_tree = - wm::RecreateLayers(root_window); + ::wm::RecreateLayers(root_window); // Add the cloned layer tree in to the root, so it will be rendered. root_window->layer()->Add(old_layer_tree->root());
diff --git a/ash/shelf/shelf_layout_manager.cc b/ash/shelf/shelf_layout_manager.cc index d37901b8..88be2c20 100644 --- a/ash/shelf/shelf_layout_manager.cc +++ b/ash/shelf/shelf_layout_manager.cc
@@ -279,9 +279,10 @@ } else { // TODO(zelidrag): Verify shelf drag animation still shows on the device // when we are in SHELF_AUTO_HIDE_ALWAYS_HIDDEN. - WorkspaceWindowState window_state(workspace_controller_->GetWindowState()); + wm::WorkspaceWindowState window_state( + workspace_controller_->GetWindowState()); switch (window_state) { - case WORKSPACE_WINDOW_STATE_FULL_SCREEN: { + case wm::WORKSPACE_WINDOW_STATE_FULL_SCREEN: { const aura::Window* fullscreen_window = GetRootWindowController( root_window_)->GetWindowForFullscreenMode(); if (fullscreen_window && wm::GetWindowState(fullscreen_window)-> @@ -295,15 +296,15 @@ break; } - case WORKSPACE_WINDOW_STATE_MAXIMIZED: + case wm::WORKSPACE_WINDOW_STATE_MAXIMIZED: SetState(CalculateShelfVisibility()); break; - case WORKSPACE_WINDOW_STATE_WINDOW_OVERLAPS_SHELF: - case WORKSPACE_WINDOW_STATE_DEFAULT: + case wm::WORKSPACE_WINDOW_STATE_WINDOW_OVERLAPS_SHELF: + case wm::WORKSPACE_WINDOW_STATE_DEFAULT: SetState(CalculateShelfVisibility()); - SetWindowOverlapsShelf(window_state == - WORKSPACE_WINDOW_STATE_WINDOW_OVERLAPS_SHELF); + SetWindowOverlapsShelf( + window_state == wm::WORKSPACE_WINDOW_STATE_WINDOW_OVERLAPS_SHELF); break; } } @@ -516,8 +517,9 @@ State state; state.visibility_state = visibility_state; state.auto_hide_state = CalculateAutoHideState(visibility_state); - state.window_state = workspace_controller_ ? - workspace_controller_->GetWindowState() : WORKSPACE_WINDOW_STATE_DEFAULT; + state.window_state = workspace_controller_ + ? workspace_controller_->GetWindowState() + : wm::WORKSPACE_WINDOW_STATE_DEFAULT; // Preserve the log in screen states. state.is_adding_user_screen = state_.is_adding_user_screen; state.is_screen_locked = state_.is_screen_locked; @@ -557,7 +559,7 @@ // - Going from an auto hidden shelf in maximized mode to a visible shelf in // maximized mode. if (state.visibility_state == SHELF_VISIBLE && - state.window_state == WORKSPACE_WINDOW_STATE_MAXIMIZED && + state.window_state == wm::WORKSPACE_WINDOW_STATE_MAXIMIZED && old_state.visibility_state != SHELF_VISIBLE) { change_type = BACKGROUND_CHANGE_IMMEDIATE; } else { @@ -579,9 +581,9 @@ UpdateShelfBackground(change_type); } - shelf_->SetDimsShelf( - state.visibility_state == SHELF_VISIBLE && - state.window_state == WORKSPACE_WINDOW_STATE_MAXIMIZED); + shelf_->SetDimsShelf(state.visibility_state == SHELF_VISIBLE && + state.window_state == + wm::WORKSPACE_WINDOW_STATE_MAXIMIZED); TargetBounds target_bounds; CalculateTargetBounds(state_, &target_bounds); @@ -875,7 +877,7 @@ ShelfBackgroundType ShelfLayoutManager::GetShelfBackgroundType() const { if (state_.visibility_state != SHELF_AUTO_HIDE && - state_.window_state == WORKSPACE_WINDOW_STATE_MAXIMIZED) { + state_.window_state == wm::WORKSPACE_WINDOW_STATE_MAXIMIZED) { return SHELF_BACKGROUND_MAXIMIZED; }
diff --git a/ash/shelf/shelf_layout_manager.h b/ash/shelf/shelf_layout_manager.h index 3689d017..a08531e 100644 --- a/ash/shelf/shelf_layout_manager.h +++ b/ash/shelf/shelf_layout_manager.h
@@ -16,9 +16,9 @@ #include "ash/shell_observer.h" #include "ash/snap_to_pixel_layout_manager.h" #include "ash/system/status_area_widget.h" +#include "ash/wm/common/workspace/workspace_types.h" #include "ash/wm/dock/docked_window_layout_manager_observer.h" #include "ash/wm/lock_state_observer.h" -#include "ash/wm/workspace/workspace_types.h" #include "base/compiler_specific.h" #include "base/gtest_prod_util.h" #include "base/logging.h" @@ -238,11 +238,12 @@ }; struct State { - State() : visibility_state(SHELF_VISIBLE), - auto_hide_state(SHELF_AUTO_HIDE_HIDDEN), - window_state(WORKSPACE_WINDOW_STATE_DEFAULT), - is_screen_locked(false), - is_adding_user_screen(false) {} + State() + : visibility_state(SHELF_VISIBLE), + auto_hide_state(SHELF_AUTO_HIDE_HIDDEN), + window_state(wm::WORKSPACE_WINDOW_STATE_DEFAULT), + is_screen_locked(false), + is_adding_user_screen(false) {} // Returns true if the two states are considered equal. As // |auto_hide_state| only matters if |visibility_state| is @@ -259,7 +260,7 @@ ShelfVisibilityState visibility_state; ShelfAutoHideState auto_hide_state; - WorkspaceWindowState window_state; + wm::WorkspaceWindowState window_state; bool is_screen_locked; bool is_adding_user_screen; };
diff --git a/ash/shelf/shelf_tooltip_manager.cc b/ash/shelf/shelf_tooltip_manager.cc index 7a9b70d..e5f521a2 100644 --- a/ash/shelf/shelf_tooltip_manager.cc +++ b/ash/shelf/shelf_tooltip_manager.cc
@@ -138,7 +138,8 @@ if (bubble_) { // Cancel the hiding animation to hide the old bubble immediately. gfx::NativeView native_view = bubble_->GetWidget()->GetNativeView(); - wm::SetWindowVisibilityAnimationTransition(native_view, wm::ANIMATE_NONE); + ::wm::SetWindowVisibilityAnimationTransition(native_view, + ::wm::ANIMATE_NONE); Close(); } @@ -153,9 +154,9 @@ base::string16 text = shelf_view_->GetTitleForView(view); bubble_ = new ShelfTooltipBubble(view, arrow, text); gfx::NativeView native_view = bubble_->GetWidget()->GetNativeView(); - wm::SetWindowVisibilityAnimationType( - native_view, wm::WINDOW_VISIBILITY_ANIMATION_TYPE_VERTICAL); - wm::SetWindowVisibilityAnimationTransition(native_view, wm::ANIMATE_HIDE); + ::wm::SetWindowVisibilityAnimationType( + native_view, ::wm::WINDOW_VISIBILITY_ANIMATION_TYPE_VERTICAL); + ::wm::SetWindowVisibilityAnimationTransition(native_view, ::wm::ANIMATE_HIDE); bubble_->GetWidget()->Show(); }
diff --git a/ash/shell.cc b/ash/shell.cc index 24397967..d559221 100644 --- a/ash/shell.cc +++ b/ash/shell.cc
@@ -59,6 +59,7 @@ #include "ash/utility/partial_screenshot_controller.h" #include "ash/wm/ash_focus_rules.h" #include "ash/wm/ash_native_cursor_manager.h" +#include "ash/wm/aura/wm_globals_aura.h" #include "ash/wm/coordinate_conversion.h" #include "ash/wm/event_client_impl.h" #include "ash/wm/lock_state_controller.h" @@ -640,7 +641,6 @@ scoped_target_root_window_(nullptr), delegate_(delegate), shelf_model_(new ShelfModel), - window_positioner_(new WindowPositioner), activation_client_(nullptr), #if defined(OS_CHROMEOS) display_configurator_(new ui::DisplayConfigurator()), @@ -852,6 +852,10 @@ void Shell::Init(const ShellInitParams& init_params) { in_mus_ = init_params.in_mus; + + wm_globals_.reset(new wm::WmGlobalsAura); + window_positioner_.reset(new WindowPositioner(wm_globals_.get())); + if (!in_mus_) { native_cursor_manager_ = new AshNativeCursorManager; #if defined(OS_CHROMEOS)
diff --git a/ash/shell.h b/ash/shell.h index 58e5566..ad61d18 100644 --- a/ash/shell.h +++ b/ash/shell.h
@@ -166,6 +166,10 @@ class ShellTestApi; } +namespace wm { +class WmGlobalsAura; +} + // Shell is a singleton object that presents the Shell API and implements the // RootWindow's delegate interface. // @@ -642,6 +646,8 @@ // when the screen is initially created. static bool initially_hide_cursor_; + std::unique_ptr<wm::WmGlobalsAura> wm_globals_; + // When no explicit target display/RootWindow is given, new windows are // created on |scoped_target_root_window_| , unless NULL in // which case they are created on |target_root_window_|. @@ -695,6 +701,7 @@ std::unique_ptr<aura::client::FocusClient> focus_client_; aura::client::ActivationClient* activation_client_; + std::unique_ptr<PartialScreenshotController> partial_screenshot_controller_; std::unique_ptr<MouseCursorEventFilter> mouse_cursor_filter_;
diff --git a/ash/shell/content/client/shell_browser_main_parts.cc b/ash/shell/content/client/shell_browser_main_parts.cc index 6cb215e..09fa992 100644 --- a/ash/shell/content/client/shell_browser_main_parts.cc +++ b/ash/shell/content/client/shell_browser_main_parts.cc
@@ -100,7 +100,7 @@ } void ShellBrowserMainParts::ToolkitInitialized() { - wm_state_.reset(new wm::WMState); + wm_state_.reset(new ::wm::WMState); } void ShellBrowserMainParts::PreMainMessageLoopRun() {
diff --git a/ash/shell/toplevel_window.cc b/ash/shell/toplevel_window.cc index 09fbb5d..6af929e0 100644 --- a/ash/shell/toplevel_window.cc +++ b/ash/shell/toplevel_window.cc
@@ -84,9 +84,8 @@ // Initial default bounds. bounds->SetRect(10, 150, 300, 300); } - ash::WindowPositioner::GetBoundsAndShowStateForNewWindow( - gfx::Screen::GetScreen(), NULL, is_saved_bounds, *show_state, bounds, - show_state); + WindowPositioner::GetBoundsAndShowStateForNewWindow( + nullptr, is_saved_bounds, *show_state, bounds, show_state); return true; }
diff --git a/ash/shell/window_type_launcher.cc b/ash/shell/window_type_launcher.cc index 5b113d8..ce5949c4 100644 --- a/ash/shell/window_type_launcher.cc +++ b/ash/shell/window_type_launcher.cc
@@ -177,8 +177,7 @@ Shell::GetPrimaryRootWindow(), gfx::Rect(120, 150, 300, 410)); widget->GetNativeView()->SetName("WindowTypeLauncher"); - wm::SetShadowType(widget->GetNativeView(), - wm::SHADOW_TYPE_RECTANGULAR); + ::wm::SetShadowType(widget->GetNativeView(), ::wm::SHADOW_TYPE_RECTANGULAR); widget->Show(); }
diff --git a/ash/strings/ash_strings_am.xtb b/ash/strings/ash_strings_am.xtb index 5bdcb1cb..7fc2e8c4 100644 --- a/ash/strings/ash_strings_am.xtb +++ b/ash/strings/ash_strings_am.xtb
@@ -207,6 +207,7 @@ <translation id="7510334386202674593">Ctrl+Shift+L</translation> <translation id="7561014039265304140"><ph name="DISPLAY_NAME" /> <ph name="SPECIFIED_RESOLUTION" />ን አይደግፍም። ጥራቱ ወደ <ph name="FALLBACK_RESOLUTION" /> ተቀይሯል</translation> <translation id="7573962313813535744">ትክል ሁነታ</translation> +<translation id="7580671184200851182">ተመሳሳዩን ኦዲዮ በሁሉም ድምፅ ማጉያዎች በኩል አጫውት (ሞኖ ኦዲዮ)</translation> <translation id="7593891976182323525">Search ወይም Shift</translation> <translation id="7649070708921625228">እገዛ</translation> <translation id="7692480393933218409">የተገናኙ የUSB-C መሣሪያዎችን ኃይል በመሙላት ላይ</translation>
diff --git a/ash/strings/ash_strings_ar.xtb b/ash/strings/ash_strings_ar.xtb index 3f952ce..2595cf4 100644 --- a/ash/strings/ash_strings_ar.xtb +++ b/ash/strings/ash_strings_ar.xtb
@@ -204,6 +204,7 @@ <translation id="7510334386202674593">Ctrl+Shift+L</translation> <translation id="7561014039265304140"><ph name="DISPLAY_NAME" /> غير متوافق مع <ph name="SPECIFIED_RESOLUTION" />. تم تغيير الدقة إلى <ph name="FALLBACK_RESOLUTION" /></translation> <translation id="7573962313813535744">وضع الإرساء</translation> +<translation id="7580671184200851182">تشغيل نفس الصوت عبر جميع مكبرات الصوت (صوت أحادي)</translation> <translation id="7593891976182323525">مفتاح البحث أو Shift</translation> <translation id="7649070708921625228">مساعدة</translation> <translation id="7692480393933218409">جارٍ شحن أجهزة USB-C المتصلة</translation>
diff --git a/ash/strings/ash_strings_en-GB.xtb b/ash/strings/ash_strings_en-GB.xtb index 556b57b..0cad707 100644 --- a/ash/strings/ash_strings_en-GB.xtb +++ b/ash/strings/ash_strings_en-GB.xtb
@@ -207,6 +207,7 @@ <translation id="7510334386202674593">Ctrl+Shift+L</translation> <translation id="7561014039265304140"><ph name="DISPLAY_NAME" /> doesn't support <ph name="SPECIFIED_RESOLUTION" />. The resolution was changed to <ph name="FALLBACK_RESOLUTION" /></translation> <translation id="7573962313813535744">Docked mode</translation> +<translation id="7580671184200851182">Play the same audio through all speakers (mono audio)</translation> <translation id="7593891976182323525">Search or Shift</translation> <translation id="7649070708921625228">Help</translation> <translation id="7692480393933218409">Charging connected USB-C devices</translation>
diff --git a/ash/strings/ash_strings_hu.xtb b/ash/strings/ash_strings_hu.xtb index c8af720b..90b031b 100644 --- a/ash/strings/ash_strings_hu.xtb +++ b/ash/strings/ash_strings_hu.xtb
@@ -207,6 +207,7 @@ <translation id="7510334386202674593">Ctrl+Shift+L</translation> <translation id="7561014039265304140">A(z) <ph name="DISPLAY_NAME" /> nem támogatja a következő felbontást: <ph name="SPECIFIED_RESOLUTION" />. A felbontás megváltozott erre: <ph name="FALLBACK_RESOLUTION" /></translation> <translation id="7573962313813535744">Dokkolt mód</translation> +<translation id="7580671184200851182">Azonos hang lejátszása mindegyik hangszórón (monó hang)</translation> <translation id="7593891976182323525">Keresés vagy Shift</translation> <translation id="7649070708921625228">Súgó</translation> <translation id="7692480393933218409">C típusú USB-vel kompatibilis eszközök töltése</translation>
diff --git a/ash/strings/ash_strings_iw.xtb b/ash/strings/ash_strings_iw.xtb index 1a22e9c2..5baadb8 100644 --- a/ash/strings/ash_strings_iw.xtb +++ b/ash/strings/ash_strings_iw.xtb
@@ -206,6 +206,7 @@ <translation id="7510334386202674593">Ctrl+Shift+L</translation> <translation id="7561014039265304140"><ph name="DISPLAY_NAME" /> אינו תומך ב-<ph name="SPECIFIED_RESOLUTION" />. הרזולוציה שונתה ל-<ph name="FALLBACK_RESOLUTION" /></translation> <translation id="7573962313813535744">מצב מעוגן</translation> +<translation id="7580671184200851182">השמע את אותו אודיו מכל הרמקולים (אודיו מונו)</translation> <translation id="7593891976182323525">חיפוש או Shift</translation> <translation id="7649070708921625228">עזרה</translation> <translation id="7692480393933218409">טעינת מכשירים מחוברים עם יציאת USB-C</translation>
diff --git a/ash/strings/ash_strings_ms.xtb b/ash/strings/ash_strings_ms.xtb index 3d9e7de..d6a8cff4e 100644 --- a/ash/strings/ash_strings_ms.xtb +++ b/ash/strings/ash_strings_ms.xtb
@@ -206,6 +206,7 @@ <translation id="7510334386202674593">Ctrl+Shift+L</translation> <translation id="7561014039265304140"><ph name="DISPLAY_NAME" /> tidak menyokong <ph name="SPECIFIED_RESOLUTION" />. Resolusi telah ditukar kepada <ph name="FALLBACK_RESOLUTION" /></translation> <translation id="7573962313813535744">Mod dok</translation> +<translation id="7580671184200851182">Mainkan audio yang sama melalui semua pembesar suara (audio mono)</translation> <translation id="7593891976182323525">Search atau Shift</translation> <translation id="7649070708921625228">Bantuan</translation> <translation id="7692480393933218409">Mengecas peranti USB-C yang disambungkan</translation>
diff --git a/ash/strings/ash_strings_nl.xtb b/ash/strings/ash_strings_nl.xtb index 425219f..a3894e4 100644 --- a/ash/strings/ash_strings_nl.xtb +++ b/ash/strings/ash_strings_nl.xtb
@@ -40,7 +40,7 @@ <translation id="2127372758936585790">Laag-vermogen-lader</translation> <translation id="2204305834655267233">Netwerkinfo</translation> <translation id="2208323208084708176">Samengestelde desktopmodus</translation> -<translation id="225680501294068881">Scannen naar apparaten...</translation> +<translation id="225680501294068881">Zoeken naar apparaten...</translation> <translation id="2268130516524549846">Bluetooth uitgeschakeld</translation> <translation id="2268813581635650749">Alle gebruikers uitloggen</translation> <translation id="2297568595583585744">Statussysteemvak</translation>
diff --git a/ash/strings/ash_strings_pt-BR.xtb b/ash/strings/ash_strings_pt-BR.xtb index a8dc256..20a7bf63 100644 --- a/ash/strings/ash_strings_pt-BR.xtb +++ b/ash/strings/ash_strings_pt-BR.xtb
@@ -206,6 +206,7 @@ <translation id="7510334386202674593">Ctrl+Shift+L</translation> <translation id="7561014039265304140"><ph name="DISPLAY_NAME" /> não suporta <ph name="SPECIFIED_RESOLUTION" />. A resolução foi alterada para <ph name="FALLBACK_RESOLUTION" /></translation> <translation id="7573962313813535744">Modo ancorado</translation> +<translation id="7580671184200851182">Reproduzir o mesmo áudio pelos alto-falantes (áudio mono)</translation> <translation id="7593891976182323525">Pesquisar ou Shift</translation> <translation id="7649070708921625228">Ajuda</translation> <translation id="7692480393933218409">Carregando dispositivos USB-C conectados</translation>
diff --git a/ash/strings/ash_strings_pt-PT.xtb b/ash/strings/ash_strings_pt-PT.xtb index 89f1f3a..d9b834a 100644 --- a/ash/strings/ash_strings_pt-PT.xtb +++ b/ash/strings/ash_strings_pt-PT.xtb
@@ -207,6 +207,7 @@ <translation id="7510334386202674593">Ctrl+Shift+L</translation> <translation id="7561014039265304140"><ph name="DISPLAY_NAME" /> não suporta <ph name="SPECIFIED_RESOLUTION" />. A resolução foi alterada para <ph name="FALLBACK_RESOLUTION" /></translation> <translation id="7573962313813535744">Modo ancorado</translation> +<translation id="7580671184200851182">Reproduzir o mesmo áudio em todas as colunas (áudio mono)</translation> <translation id="7593891976182323525">Pesquisar ou Shift</translation> <translation id="7649070708921625228">Ajuda</translation> <translation id="7692480393933218409">A carregar os dispositivos USB-C ligados</translation>
diff --git a/ash/strings/ash_strings_ru.xtb b/ash/strings/ash_strings_ru.xtb index 3b1f056..1377ff4b 100644 --- a/ash/strings/ash_strings_ru.xtb +++ b/ash/strings/ash_strings_ru.xtb
@@ -206,6 +206,7 @@ <translation id="7510334386202674593">Ctrl + Shift + L</translation> <translation id="7561014039265304140">Дисплей <ph name="DISPLAY_NAME" /> не поддерживает разрешение <ph name="SPECIFIED_RESOLUTION" />. Будет использовано разрешение <ph name="FALLBACK_RESOLUTION" />.</translation> <translation id="7573962313813535744">Закрепленный режим</translation> +<translation id="7580671184200851182">Воспроизводить одно и то же аудио через все динамики (моноаудио)</translation> <translation id="7593891976182323525">Search или Shift</translation> <translation id="7649070708921625228">Справка</translation> <translation id="7692480393933218409">Подключенные устройства USB-C заряжаются</translation>
diff --git a/ash/strings/ash_strings_sk.xtb b/ash/strings/ash_strings_sk.xtb index 5abfc4f..caa9c97 100644 --- a/ash/strings/ash_strings_sk.xtb +++ b/ash/strings/ash_strings_sk.xtb
@@ -207,6 +207,7 @@ <translation id="7510334386202674593">Ctrl+Shift+L</translation> <translation id="7561014039265304140">Obrazovka <ph name="DISPLAY_NAME" /> nepodporuje rozlíšenie <ph name="SPECIFIED_RESOLUTION" />. Rozlíšenie bolo zmenené na <ph name="FALLBACK_RESOLUTION" /></translation> <translation id="7573962313813535744">Režim v doku</translation> +<translation id="7580671184200851182">Prehrávajte rovnaký zvuk zo všetkých reproduktorov (monofónny zvuk)</translation> <translation id="7593891976182323525">Hľadať alebo Shift</translation> <translation id="7649070708921625228">Pomocník</translation> <translation id="7692480393933218409">Nabíjajú sa pripojené zariadenia USB-C</translation>
diff --git a/ash/strings/ash_strings_sw.xtb b/ash/strings/ash_strings_sw.xtb index c79e9cda..0786c33 100644 --- a/ash/strings/ash_strings_sw.xtb +++ b/ash/strings/ash_strings_sw.xtb
@@ -206,6 +206,7 @@ <translation id="7510334386202674593">Ctrl+Shift+L</translation> <translation id="7561014039265304140"><ph name="DISPLAY_NAME" /> haitumiki kwa <ph name="SPECIFIED_RESOLUTION" />. Ubora ulibadilishwa hadi <ph name="FALLBACK_RESOLUTION" /></translation> <translation id="7573962313813535744">Hali ya kituo</translation> +<translation id="7580671184200851182">Cheza sauti moja kupitia spika zote (sauti ya mono)</translation> <translation id="7593891976182323525">Utafutaji au Hama</translation> <translation id="7649070708921625228">Usaidizi</translation> <translation id="7692480393933218409">Kinachaji vifaa vilivyounganishwa vya USB-C</translation>
diff --git a/ash/strings/ash_strings_uk.xtb b/ash/strings/ash_strings_uk.xtb index 30504e0..aa92b64 100644 --- a/ash/strings/ash_strings_uk.xtb +++ b/ash/strings/ash_strings_uk.xtb
@@ -207,6 +207,7 @@ <translation id="7510334386202674593">Ctrl+Shift+L</translation> <translation id="7561014039265304140">Екран <ph name="DISPLAY_NAME" /> не підтримує роздільну здатність <ph name="SPECIFIED_RESOLUTION" />. Роздільну здатність змінено на <ph name="FALLBACK_RESOLUTION" /></translation> <translation id="7573962313813535744">Режим док-станції</translation> +<translation id="7580671184200851182">Відтворювати один аудіозапис на всіх динаміках (монофонічне аудіо)</translation> <translation id="7593891976182323525">Клавіша пошуку або Shift</translation> <translation id="7649070708921625228">Довідка</translation> <translation id="7692480393933218409">Заряджає пристрої, під’єднанї до порту USB-C</translation>
diff --git a/ash/system/toast/toast_overlay.cc b/ash/system/toast/toast_overlay.cc index 3a59e81..deaba0e 100644 --- a/ash/system/toast/toast_overlay.cc +++ b/ash/system/toast/toast_overlay.cc
@@ -189,9 +189,9 @@ overlay_widget_->GetNativeView()->SetName("ToastOverlay"); gfx::NativeWindow native_view = overlay_widget_->GetNativeView(); - wm::SetWindowVisibilityAnimationType( - native_view, wm::WINDOW_VISIBILITY_ANIMATION_TYPE_VERTICAL); - wm::SetWindowVisibilityAnimationDuration( + ::wm::SetWindowVisibilityAnimationType( + native_view, ::wm::WINDOW_VISIBILITY_ANIMATION_TYPE_VERTICAL); + ::wm::SetWindowVisibilityAnimationDuration( native_view, base::TimeDelta::FromMilliseconds(kSlideAnimationDurationMs)); }
diff --git a/ash/system/tray/tray_background_view.cc b/ash/system/tray/tray_background_view.cc index 0997d77..c904f6a 100644 --- a/ash/system/tray/tray_background_view.cc +++ b/ash/system/tray/tray_background_view.cc
@@ -460,13 +460,12 @@ void TrayBackgroundView::InitializeBubbleAnimations( views::Widget* bubble_widget) { - wm::SetWindowVisibilityAnimationType( + ::wm::SetWindowVisibilityAnimationType( bubble_widget->GetNativeWindow(), - wm::WINDOW_VISIBILITY_ANIMATION_TYPE_FADE); - wm::SetWindowVisibilityAnimationTransition( - bubble_widget->GetNativeWindow(), - wm::ANIMATE_HIDE); - wm::SetWindowVisibilityAnimationDuration( + ::wm::WINDOW_VISIBILITY_ANIMATION_TYPE_FADE); + ::wm::SetWindowVisibilityAnimationTransition(bubble_widget->GetNativeWindow(), + ::wm::ANIMATE_HIDE); + ::wm::SetWindowVisibilityAnimationDuration( bubble_widget->GetNativeWindow(), base::TimeDelta::FromMilliseconds(kAnimationDurationForPopupMs)); }
diff --git a/ash/system/tray/tray_bubble_wrapper.cc b/ash/system/tray/tray_bubble_wrapper.cc index 3576f6c..6b6eb4b 100644 --- a/ash/system/tray/tray_bubble_wrapper.cc +++ b/ash/system/tray/tray_bubble_wrapper.cc
@@ -19,7 +19,7 @@ views::TrayBubbleView* bubble_view) : tray_(tray), bubble_view_(bubble_view) { - bubble_widget_ = views::BubbleDelegateView::CreateBubble(bubble_view_); + bubble_widget_ = views::BubbleDialogDelegateView::CreateBubble(bubble_view_); bubble_widget_->AddObserver(this); tray_->InitializeBubbleAnimations(bubble_widget_);
diff --git a/ash/system/user/user_view.cc b/ash/system/user/user_view.cc index 36f484a..312d5a3cb 100644 --- a/ash/system/user/user_view.cc +++ b/ash/system/user/user_view.cc
@@ -437,7 +437,7 @@ add_menu_option_->Init(params); add_menu_option_->SetOpacity(0xFF); add_menu_option_->GetNativeWindow()->set_owned_by_parent(false); - SetShadowType(add_menu_option_->GetNativeView(), wm::SHADOW_TYPE_NONE); + SetShadowType(add_menu_option_->GetNativeView(), ::wm::SHADOW_TYPE_NONE); // Position it below our user card. gfx::Rect bounds = user_card_view_->GetBoundsInScreen();
diff --git a/ash/test/ash_test_helper.cc b/ash/test/ash_test_helper.cc index 4ed02de..1e73995 100644 --- a/ash/test/ash_test_helper.cc +++ b/ash/test/ash_test_helper.cc
@@ -118,7 +118,7 @@ // Reset the global state for the cursor manager. This includes the // last cursor visibility state, etc. - wm::CursorManager::ResetCursorVisibilityStateForTest(); + ::wm::CursorManager::ResetCursorVisibilityStateForTest(); // ContentTestSuiteBase might have already initialized // MaterialDesignController in unit_tests suite. @@ -176,7 +176,7 @@ ui::ShutdownInputMethodForTesting(); zero_duration_mode_.reset(); - CHECK(!wm::ScopedCaptureClient::IsActive()); + CHECK(!::wm::ScopedCaptureClient::IsActive()); views_delegate_.reset(); }
diff --git a/ash/test/cursor_manager_test_api.cc b/ash/test/cursor_manager_test_api.cc index a8bffe8b..dfc43bb 100644 --- a/ash/test/cursor_manager_test_api.cc +++ b/ash/test/cursor_manager_test_api.cc
@@ -14,10 +14,8 @@ namespace ash { namespace test { -CursorManagerTestApi::CursorManagerTestApi( - wm::CursorManager* cursor_manager) - : cursor_manager_(cursor_manager) { -} +CursorManagerTestApi::CursorManagerTestApi(::wm::CursorManager* cursor_manager) + : cursor_manager_(cursor_manager) {} CursorManagerTestApi::~CursorManagerTestApi() { }
diff --git a/ash/wm/aura/wm_globals_aura.cc b/ash/wm/aura/wm_globals_aura.cc new file mode 100644 index 0000000..f308d936 --- /dev/null +++ b/ash/wm/aura/wm_globals_aura.cc
@@ -0,0 +1,82 @@ +// 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 "ash/wm/aura/wm_globals_aura.h" + +#include "ash/display/window_tree_host_manager.h" +#include "ash/session/session_state_delegate.h" +#include "ash/shell.h" +#include "ash/shell_delegate.h" +#include "ash/wm/aura/wm_window_aura.h" +#include "ash/wm/mru_window_tracker.h" +#include "ash/wm/window_util.h" +#include "ui/wm/public/activation_client.h" + +namespace ash { +namespace wm { +namespace { + +WmGlobalsAura* instance_ = nullptr; + +} // namespace + +// static +WmGlobals* WmGlobals::Get() { + return instance_; +} + +WmGlobalsAura::WmGlobalsAura() { + DCHECK(!instance_); + instance_ = this; +} + +WmGlobalsAura::~WmGlobalsAura() { + instance_ = nullptr; +} + +// static +WmGlobalsAura* WmGlobalsAura::Get() { + if (!instance_) + new WmGlobalsAura; + return instance_; +} + +WmWindow* WmGlobalsAura::GetActiveWindow() { + return WmWindowAura::Get(wm::GetActiveWindow()); +} + +WmWindow* WmGlobalsAura::GetRootWindowForDisplayId(int64_t display_id) { + return WmWindowAura::Get(Shell::GetInstance() + ->window_tree_host_manager() + ->GetRootWindowForDisplayId(display_id)); +} + +WmWindow* WmGlobalsAura::GetRootWindowForNewWindows() { + return WmWindowAura::Get(Shell::GetTargetRootWindow()); +} + +std::vector<WmWindow*> WmGlobalsAura::GetMruWindowListIgnoreModals() { + const std::vector<aura::Window*> windows = ash::Shell::GetInstance() + ->mru_window_tracker() + ->BuildWindowListIgnoreModal(); + std::vector<WmWindow*> wm_windows(windows.size()); + for (size_t i = 0; i < windows.size(); ++i) + wm_windows[i] = WmWindowAura::Get(windows[i]); + return wm_windows; +} + +bool WmGlobalsAura::IsForceMaximizeOnFirstRun() { + return Shell::GetInstance()->delegate()->IsForceMaximizeOnFirstRun(); +} + +std::vector<WmWindow*> WmGlobalsAura::GetAllRootWindows() { + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); + std::vector<WmWindow*> wm_windows(root_windows.size()); + for (size_t i = 0; i < root_windows.size(); ++i) + wm_windows[i] = WmWindowAura::Get(root_windows[i]); + return wm_windows; +} + +} // namespace wm +} // namespace ash
diff --git a/ash/wm/aura/wm_globals_aura.h b/ash/wm/aura/wm_globals_aura.h new file mode 100644 index 0000000..d2195df --- /dev/null +++ b/ash/wm/aura/wm_globals_aura.h
@@ -0,0 +1,39 @@ +// 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 ASH_WM_AURA_WM_GLOBALS_AURA_H_ +#define ASH_WM_AURA_WM_GLOBALS_AURA_H_ + +#include <set> + +#include "ash/ash_export.h" +#include "ash/wm/common/wm_globals.h" +#include "base/macros.h" + +namespace ash { +namespace wm { + +class ASH_EXPORT WmGlobalsAura : public WmGlobals { + public: + WmGlobalsAura(); + ~WmGlobalsAura() override; + + static WmGlobalsAura* Get(); + + // WmGlobals: + WmWindow* GetActiveWindow() override; + WmWindow* GetRootWindowForDisplayId(int64_t display_id) override; + WmWindow* GetRootWindowForNewWindows() override; + std::vector<WmWindow*> GetMruWindowListIgnoreModals() override; + bool IsForceMaximizeOnFirstRun() override; + std::vector<WmWindow*> GetAllRootWindows() override; + + private: + DISALLOW_COPY_AND_ASSIGN(WmGlobalsAura); +}; + +} // namespace wm +} // namespace ash + +#endif // ASH_WM_AURA_WM_GLOBALS_AURA_H_
diff --git a/ash/wm/aura/wm_root_window_controller_aura.cc b/ash/wm/aura/wm_root_window_controller_aura.cc index a8ed4cf..8129875 100644 --- a/ash/wm/aura/wm_root_window_controller_aura.cc +++ b/ash/wm/aura/wm_root_window_controller_aura.cc
@@ -5,6 +5,8 @@ #include "ash/wm/aura/wm_root_window_controller_aura.h" #include "ash/root_window_controller.h" +#include "ash/wm/aura/wm_globals_aura.h" +#include "ash/wm/workspace_controller.h" #include "ui/aura/window.h" #include "ui/aura/window_property.h" @@ -52,5 +54,13 @@ return root_window_controller_->shelf() != nullptr; } +WmGlobals* WmRootWindowControllerAura::GetGlobals() { + return WmGlobalsAura::Get(); +} + +WorkspaceWindowState WmRootWindowControllerAura::GetWorkspaceWindowState() { + return root_window_controller_->workspace_controller()->GetWindowState(); +} + } // namespace wm } // namespace ash
diff --git a/ash/wm/aura/wm_root_window_controller_aura.h b/ash/wm/aura/wm_root_window_controller_aura.h index 9b2e95a..1b22850 100644 --- a/ash/wm/aura/wm_root_window_controller_aura.h +++ b/ash/wm/aura/wm_root_window_controller_aura.h
@@ -33,6 +33,8 @@ // WmRootWindowController: bool HasShelf() override; + WmGlobals* GetGlobals() override; + WorkspaceWindowState GetWorkspaceWindowState() override; private: RootWindowController* root_window_controller_;
diff --git a/ash/wm/aura/wm_window_aura.cc b/ash/wm/aura/wm_window_aura.cc index e04ded5f..9dcb68b 100644 --- a/ash/wm/aura/wm_window_aura.cc +++ b/ash/wm/aura/wm_window_aura.cc
@@ -5,6 +5,7 @@ #include "ash/wm/aura/wm_window_aura.h" #include "ash/screen_util.h" +#include "ash/wm/aura/wm_globals_aura.h" #include "ash/wm/aura/wm_root_window_controller_aura.h" #include "ash/wm/common/wm_window_observer.h" #include "ash/wm/common/wm_window_property.h" @@ -93,6 +94,10 @@ return root ? WmRootWindowControllerAura::Get(root) : nullptr; } +WmGlobals* WmWindowAura::GetGlobals() const { + return WmGlobalsAura::Get(); +} + int WmWindowAura::GetShellWindowId() { return window_->id(); } @@ -177,7 +182,7 @@ return false; } -WindowState* WmWindowAura::GetWindowState() { +const WindowState* WmWindowAura::GetWindowState() const { return ash::wm::GetWindowState(window_); } @@ -185,6 +190,10 @@ return Get(window_->GetToplevelWindow()); } +void WmWindowAura::AddChild(WmWindow* window) { + window_->AddChild(GetAuraWindow(window)); +} + WmWindow* WmWindowAura::GetParent() { return Get(window_->parent()); } @@ -193,10 +202,39 @@ return Get(::wm::GetTransientParent(window_)); } +std::vector<WmWindow*> WmWindowAura::GetTransientChildren() { + const std::vector<aura::Window*> aura_windows( + ::wm::GetTransientChildren(window_)); + std::vector<WmWindow*> wm_windows(aura_windows.size()); + for (size_t i = 0; i < aura_windows.size(); ++i) + wm_windows[i] = Get(aura_windows[i]); + return wm_windows; +} + +void WmWindowAura::SetVisibilityAnimationType(int type) { + ::wm::SetWindowVisibilityAnimationType(window_, type); +} + +void WmWindowAura::Animate(::wm::WindowAnimationType type) { + ::wm::AnimateWindow(window_, type); +} + void WmWindowAura::SetBounds(const gfx::Rect& bounds) { window_->SetBounds(bounds); } +void WmWindowAura::SetBoundsWithTransitionDelay(const gfx::Rect& bounds, + base::TimeDelta delta) { + if (::wm::WindowAnimationsDisabled(window_)) { + window_->SetBounds(bounds); + return; + } + + ui::ScopedLayerAnimationSettings settings(window_->layer()->GetAnimator()); + settings.SetTransitionDuration(delta); + window_->SetBounds(bounds); +} + void WmWindowAura::SetBoundsDirect(const gfx::Rect& bounds) { BoundsSetter().SetBounds(window_, bounds); SnapWindowToPixelBoundary(window_); @@ -289,6 +327,10 @@ return window_->GetProperty(aura::client::kShowStateKey); } +void WmWindowAura::SetRestoreShowState(ui::WindowShowState show_state) { + window_->SetProperty(aura::client::kRestoreShowStateKey, show_state); +} + void WmWindowAura::SetCapture() { window_->SetCapture(); }
diff --git a/ash/wm/aura/wm_window_aura.h b/ash/wm/aura/wm_window_aura.h index 3ebde89..c714fee 100644 --- a/ash/wm/aura/wm_window_aura.h +++ b/ash/wm/aura/wm_window_aura.h
@@ -36,6 +36,7 @@ // WmWindow: const WmWindow* GetRootWindow() const override; WmRootWindowController* GetRootWindowController() override; + WmGlobals* GetGlobals() const override; int GetShellWindowId() override; WmWindow* GetChildByShellWindowId(int id) override; ui::wm::WindowType GetType() const override; @@ -54,11 +55,17 @@ bool GetTargetVisibility() const override; bool IsVisible() const override; bool GetBoolProperty(WmWindowProperty key) override; - WindowState* GetWindowState() override; + const WindowState* GetWindowState() const override; WmWindow* GetToplevelWindow() override; + void AddChild(WmWindow* window) override; WmWindow* GetParent() override; WmWindow* GetTransientParent() override; + std::vector<WmWindow*> GetTransientChildren() override; + void SetVisibilityAnimationType(int type) override; + void Animate(::wm::WindowAnimationType type) override; void SetBounds(const gfx::Rect& bounds) override; + void SetBoundsWithTransitionDelay(const gfx::Rect& bounds, + base::TimeDelta delta) override; void SetBoundsDirect(const gfx::Rect& bounds) override; void SetBoundsDirectAnimated(const gfx::Rect& bounds) override; void SetBoundsDirectCrossFade(const gfx::Rect& bounds) override; @@ -74,6 +81,7 @@ bool Contains(const WmWindow* other) const override; void SetShowState(ui::WindowShowState show_state) override; ui::WindowShowState GetShowState() const override; + void SetRestoreShowState(ui::WindowShowState show_state) override; void SetCapture() override; bool HasCapture() override; void ReleaseCapture() override;
diff --git a/ash/wm/common/window_animation_types.h b/ash/wm/common/window_animation_types.h new file mode 100644 index 0000000..a75e2bc --- /dev/null +++ b/ash/wm/common/window_animation_types.h
@@ -0,0 +1,27 @@ +// 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 ASH_WM_COMMON_WINDOW_ANIMATION_TYPES_H_ +#define ASH_WM_COMMON_WINDOW_ANIMATION_TYPES_H_ + +#include "ash/ash_export.h" +#include "ui/wm/core/window_animations.h" + +namespace ash { +namespace wm { + +// An extension of the window animations provided by CoreWm. These are +// Ash-specific only. +enum WindowVisibilityAnimationType { + // Window scale/rotates down to its launcher icon. + WINDOW_VISIBILITY_ANIMATION_TYPE_MINIMIZE = + ::wm::WINDOW_VISIBILITY_ANIMATION_MAX, + // Fade in/out using brightness and grayscale web filters. + WINDOW_VISIBILITY_ANIMATION_TYPE_BRIGHTNESS_GRAYSCALE +}; + +} // namespace wm +} // namespace ash + +#endif // ASH_WM_COMMON_WINDOW_ANIMATION_TYPES_H_
diff --git a/ash/wm/common/window_parenting_utils.cc b/ash/wm/common/window_parenting_utils.cc new file mode 100644 index 0000000..1e31fc4 --- /dev/null +++ b/ash/wm/common/window_parenting_utils.cc
@@ -0,0 +1,28 @@ +// 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 "ash/wm/common/window_parenting_utils.h" + +#include "ash/wm/common/wm_window.h" + +namespace ash { +namespace wm { + +void ReparentChildWithTransientChildren(WmWindow* child, + WmWindow* old_parent, + WmWindow* new_parent) { + if (child->GetParent() == old_parent) + new_parent->AddChild(child); + ReparentTransientChildrenOfChild(child, old_parent, new_parent); +} + +void ReparentTransientChildrenOfChild(WmWindow* child, + WmWindow* old_parent, + WmWindow* new_parent) { + for (WmWindow* transient_child : child->GetTransientChildren()) + ReparentChildWithTransientChildren(transient_child, old_parent, new_parent); +} + +} // namespace wm +} // namespace ash
diff --git a/ash/wm/common/window_parenting_utils.h b/ash/wm/common/window_parenting_utils.h new file mode 100644 index 0000000..0e0ce3c4 --- /dev/null +++ b/ash/wm/common/window_parenting_utils.h
@@ -0,0 +1,31 @@ +// 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 ASH_WM_COMMON_WINDOW_PARENTING_UTILS_H_ +#define ASH_WM_COMMON_WINDOW_PARENTING_UTILS_H_ + +#include "ash/ash_export.h" + +namespace ash { +namespace wm { + +class WmWindow; + +// Changes the parent of a |child| and all its transient children that are +// themselves children of |old_parent| to |new_parent|. +void ReparentChildWithTransientChildren(WmWindow* child, + WmWindow* old_parent, + WmWindow* new_parent); + +// Changes the parent of all transient children of a |child| to |new_parent|. +// Does not change parent of the transient children that are not themselves +// children of |old_parent|. +void ReparentTransientChildrenOfChild(WmWindow* child, + WmWindow* old_parent, + WmWindow* new_parent); + +} // namespace wm +} // namespace ash + +#endif // ASH_WM_COMMON_WINDOW_PARENTING_UTILS_H_
diff --git a/ash/wm/common/window_positioning_utils.cc b/ash/wm/common/window_positioning_utils.cc new file mode 100644 index 0000000..a1105ea4 --- /dev/null +++ b/ash/wm/common/window_positioning_utils.cc
@@ -0,0 +1,81 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "ash/wm/common/window_positioning_utils.h" + +#include <algorithm> + +#include "ash/wm/common/wm_screen_util.h" +#include "ash/wm/common/wm_window.h" +#include "ui/gfx/geometry/rect.h" +#include "ui/gfx/geometry/size.h" + +namespace ash { +namespace wm { + +namespace { + +// Returns the default width of a snapped window. +int GetDefaultSnappedWindowWidth(WmWindow* window) { + const float kSnappedWidthWorkspaceRatio = 0.5f; + + int work_area_width = GetDisplayWorkAreaBoundsInParent(window).width(); + int min_width = window->GetMinimumSize().width(); + int ideal_width = + static_cast<int>(work_area_width * kSnappedWidthWorkspaceRatio); + return std::min(work_area_width, std::max(ideal_width, min_width)); +} + +} // namespace + +void AdjustBoundsSmallerThan(const gfx::Size& max_size, gfx::Rect* bounds) { + bounds->set_width(std::min(bounds->width(), max_size.width())); + bounds->set_height(std::min(bounds->height(), max_size.height())); +} + +void AdjustBoundsToEnsureWindowVisibility(const gfx::Rect& visible_area, + int min_width, + int min_height, + gfx::Rect* bounds) { + AdjustBoundsSmallerThan(visible_area.size(), bounds); + + min_width = std::min(min_width, visible_area.width()); + min_height = std::min(min_height, visible_area.height()); + + if (bounds->right() < visible_area.x() + min_width) { + bounds->set_x(visible_area.x() + min_width - bounds->width()); + } else if (bounds->x() > visible_area.right() - min_width) { + bounds->set_x(visible_area.right() - min_width); + } + if (bounds->bottom() < visible_area.y() + min_height) { + bounds->set_y(visible_area.y() + min_height - bounds->height()); + } else if (bounds->y() > visible_area.bottom() - min_height) { + bounds->set_y(visible_area.bottom() - min_height); + } + if (bounds->y() < visible_area.y()) + bounds->set_y(visible_area.y()); +} + +void AdjustBoundsToEnsureMinimumWindowVisibility(const gfx::Rect& visible_area, + gfx::Rect* bounds) { + AdjustBoundsToEnsureWindowVisibility(visible_area, kMinimumOnScreenArea, + kMinimumOnScreenArea, bounds); +} + +gfx::Rect GetDefaultLeftSnappedWindowBoundsInParent(wm::WmWindow* window) { + gfx::Rect work_area_in_parent(GetDisplayWorkAreaBoundsInParent(window)); + return gfx::Rect(work_area_in_parent.x(), work_area_in_parent.y(), + GetDefaultSnappedWindowWidth(window), + work_area_in_parent.height()); +} + +gfx::Rect GetDefaultRightSnappedWindowBoundsInParent(wm::WmWindow* window) { + gfx::Rect work_area_in_parent(GetDisplayWorkAreaBoundsInParent(window)); + int width = GetDefaultSnappedWindowWidth(window); + return gfx::Rect(work_area_in_parent.right() - width, work_area_in_parent.y(), + width, work_area_in_parent.height()); +} + +} // namespace wm +} // namespace ash
diff --git a/ash/wm/common/window_positioning_utils.h b/ash/wm/common/window_positioning_utils.h new file mode 100644 index 0000000..b0ad135 --- /dev/null +++ b/ash/wm/common/window_positioning_utils.h
@@ -0,0 +1,56 @@ +// 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 ASH_WM_COMMON_WINDOW_POSITIONING_UTILS_H_ +#define ASH_WM_COMMON_WINDOW_POSITIONING_UTILS_H_ + +#include "ash/ash_export.h" + +namespace gfx { +class Rect; +class Size; +} + +namespace ash { +namespace wm { + +class WmWindow; + +// We force at least this many DIPs for any window on the screen. +const int kMinimumOnScreenArea = 25; + +// Adjusts |bounds| so that the size does not exceed |max_size|. +ASH_EXPORT void AdjustBoundsSmallerThan(const gfx::Size& max_size, + gfx::Rect* bounds); + +// Move the given bounds inside the given |visible_area| in parent coordinates, +// including a safety margin given by |min_width| and |min_height|. +// This also ensures that the top of the bounds is visible. +ASH_EXPORT void AdjustBoundsToEnsureWindowVisibility( + const gfx::Rect& visible_area, + int min_width, + int min_height, + gfx::Rect* bounds); + +// Move the given bounds inside the given |visible_area| in parent coordinates, +// including a safety margin given by |kMinimumOnScreenArea|. +// This also ensures that the top of the bounds is visible. +ASH_EXPORT void AdjustBoundsToEnsureMinimumWindowVisibility( + const gfx::Rect& visible_area, + gfx::Rect* bounds); + +// Returns the bounds of a left snapped window with default width in parent +// coordinates. +ASH_EXPORT gfx::Rect GetDefaultLeftSnappedWindowBoundsInParent( + WmWindow* window); + +// Returns the bounds of a right snapped window with default width in parent +// coordinates. +ASH_EXPORT gfx::Rect GetDefaultRightSnappedWindowBoundsInParent( + WmWindow* window); + +} // namespace wm +} // namespace ash + +#endif // ASH_WM_COMMON_WINDOW_POSITIONING_UTILS_H_
diff --git a/ash/wm/window_state_util.cc b/ash/wm/common/window_state_util.cc similarity index 95% rename from ash/wm/window_state_util.cc rename to ash/wm/common/window_state_util.cc index 36d8744..feb019d 100644 --- a/ash/wm/window_state_util.cc +++ b/ash/wm/common/window_state_util.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ash/wm/window_state_util.h" +#include "ash/wm/common/window_state_util.h" #include "ash/wm/window_state.h" #include "ash/wm/window_state_delegate.h"
diff --git a/ash/wm/window_state_util.h b/ash/wm/common/window_state_util.h similarity index 76% rename from ash/wm/window_state_util.h rename to ash/wm/common/window_state_util.h index 48d3cb6..215121e 100644 --- a/ash/wm/window_state_util.h +++ b/ash/wm/common/window_state_util.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef ASH_WM_WINDOW_STATE_UTIL_H_ -#define ASH_WM_WINDOW_STATE_UTIL_H_ +#ifndef ASH_WM_COMMON_WINDOW_STATE_UTIL_H_ +#define ASH_WM_COMMON_WINDOW_STATE_UTIL_H_ namespace ash { namespace wm { @@ -16,4 +16,4 @@ } // namespace wm } // namespace ash -#endif // ASH_WM_WINDOW_STATE_UTIL_H_ +#endif // ASH_WM_COMMON_WINDOW_STATE_UTIL_H_
diff --git a/ash/wm/common/wm_globals.h b/ash/wm/common/wm_globals.h new file mode 100644 index 0000000..9343281d --- /dev/null +++ b/ash/wm/common/wm_globals.h
@@ -0,0 +1,56 @@ +// 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 ASH_WM_COMMON_WM_GLOBALS_H_ +#define ASH_WM_COMMON_WM_GLOBALS_H_ + +#include <stdint.h> + +#include <vector> + +#include "ash/ash_export.h" + +namespace gfx { +class Rect; +} + +namespace ash { +namespace wm { + +class WmWindow; + +// Used for accessing global state. +class ASH_EXPORT WmGlobals { + public: + virtual ~WmGlobals() {} + + // This is necessary for a handful of places that is difficult to plumb + // through context. + static WmGlobals* Get(); + + virtual WmWindow* GetActiveWindow() = 0; + + // Returns the root window for the specified display. + virtual WmWindow* GetRootWindowForDisplayId(int64_t display_id) = 0; + + // Returns the root window that newly created windows should be added to. + // NOTE: this returns the root, newly created window should be added to the + // appropriate container in the returned window. + virtual WmWindow* GetRootWindowForNewWindows() = 0; + + // returns the list of more recently used windows excluding modals. + virtual std::vector<WmWindow*> GetMruWindowListIgnoreModals() = 0; + + // Returns true if the first window shown on first run should be + // unconditionally maximized, overriding the heuristic that normally chooses + // the window size. + virtual bool IsForceMaximizeOnFirstRun() = 0; + + virtual std::vector<WmWindow*> GetAllRootWindows() = 0; +}; + +} // namespace wm +} // namespace ash + +#endif // ASH_WM_COMMON_WM_GLOBALS_H_
diff --git a/ash/wm/common/wm_root_window_controller.h b/ash/wm/common/wm_root_window_controller.h index 358611a..a2b06dd 100644 --- a/ash/wm/common/wm_root_window_controller.h +++ b/ash/wm/common/wm_root_window_controller.h
@@ -6,10 +6,12 @@ #define ASH_WM_COMMON_WM_ROOT_CONTROLLER_H_ #include "ash/ash_export.h" +#include "ash/wm/common/workspace/workspace_types.h" namespace ash { namespace wm { +class WmGlobals; class WmWindow; class ASH_EXPORT WmRootWindowController { @@ -17,6 +19,10 @@ virtual ~WmRootWindowController() {} virtual bool HasShelf() = 0; + + virtual WmGlobals* GetGlobals() = 0; + + virtual WorkspaceWindowState GetWorkspaceWindowState() = 0; }; } // namespace wm
diff --git a/ash/wm/common/wm_window.h b/ash/wm/common/wm_window.h index 09bd1c00..c829406 100644 --- a/ash/wm/common/wm_window.h +++ b/ash/wm/common/wm_window.h
@@ -8,7 +8,9 @@ #include <vector> #include "ash/ash_export.h" +#include "base/time/time.h" #include "ui/base/ui_base_types.h" +#include "ui/wm/core/window_animations.h" #include "ui/wm/public/window_types.h" namespace gfx { @@ -26,6 +28,7 @@ namespace wm { class WMEvent; +class WmGlobals; class WmRootWindowController; class WmWindowObserver; enum class WmWindowProperty; @@ -43,6 +46,9 @@ virtual const WmWindow* GetRootWindow() const = 0; virtual WmRootWindowController* GetRootWindowController() = 0; + // TODO(sky): fix constness. + virtual WmGlobals* GetGlobals() const = 0; + virtual int GetShellWindowId() = 0; virtual WmWindow* GetChildByShellWindowId(int id) = 0; @@ -75,15 +81,28 @@ virtual bool GetBoolProperty(WmWindowProperty key) = 0; - virtual WindowState* GetWindowState() = 0; + WindowState* GetWindowState() { + return const_cast<WindowState*>( + const_cast<const WmWindow*>(this)->GetWindowState()); + } + virtual const WindowState* GetWindowState() const = 0; virtual WmWindow* GetToplevelWindow() = 0; + virtual void AddChild(WmWindow* window) = 0; + virtual WmWindow* GetParent() = 0; virtual WmWindow* GetTransientParent() = 0; + virtual std::vector<WmWindow*> GetTransientChildren() = 0; + + // |type| is WindowVisibilityAnimationType. Has to be an int to match aura. + virtual void SetVisibilityAnimationType(int type) = 0; + virtual void Animate(::wm::WindowAnimationType type) = 0; virtual void SetBounds(const gfx::Rect& bounds) = 0; + virtual void SetBoundsWithTransitionDelay(const gfx::Rect& bounds, + base::TimeDelta delta) = 0; // Sets the bounds in such a way that LayoutManagers are circumvented. virtual void SetBoundsDirect(const gfx::Rect& bounds) = 0; virtual void SetBoundsDirectAnimated(const gfx::Rect& bounds) = 0; @@ -105,6 +124,8 @@ virtual void SetShowState(ui::WindowShowState show_state) = 0; virtual ui::WindowShowState GetShowState() const = 0; + virtual void SetRestoreShowState(ui::WindowShowState show_state) = 0; + virtual void SetCapture() = 0; virtual bool HasCapture() = 0; virtual void ReleaseCapture() = 0;
diff --git a/ash/wm/workspace/workspace_types.h b/ash/wm/common/workspace/workspace_types.h similarity index 76% rename from ash/wm/workspace/workspace_types.h rename to ash/wm/common/workspace/workspace_types.h index 9572a32..dadd70f1 100644 --- a/ash/wm/workspace/workspace_types.h +++ b/ash/wm/common/workspace/workspace_types.h
@@ -2,10 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef ASH_WM_WORKSPACE_WORKSPACE_TYPES_H_ -#define ASH_WM_WORKSPACE_WORKSPACE_TYPES_H_ +#ifndef ASH_WM_COMMON_WORKSPACE_WORKSPACE_TYPES_H_ +#define ASH_WM_COMMON_WORKSPACE_WORKSPACE_TYPES_H_ namespace ash { +namespace wm { // Enumeration of the possible window states. enum WorkspaceWindowState { @@ -22,6 +23,7 @@ WORKSPACE_WINDOW_STATE_DEFAULT, }; +} // namespace wm } // namespace ash -#endif // ASH_WM_WORKSPACE_WORKSPACE_TYPES_H_ +#endif // ASH_WM_COMMON_WORKSPACE_WORKSPACE_TYPES_H_
diff --git a/ash/wm/default_state.cc b/ash/wm/default_state.cc index 769dcb1..902db7e 100644 --- a/ash/wm/default_state.cc +++ b/ash/wm/default_state.cc
@@ -4,26 +4,23 @@ #include "ash/wm/default_state.h" -#include "ash/display/window_tree_host_manager.h" -#include "ash/root_window_controller.h" -#include "ash/screen_util.h" -#include "ash/shell.h" #include "ash/shell_window_ids.h" +#include "ash/wm/aura/wm_window_aura.h" +#include "ash/wm/common/window_animation_types.h" +#include "ash/wm/common/window_parenting_utils.h" +#include "ash/wm/common/window_positioning_utils.h" +#include "ash/wm/common/window_state_util.h" #include "ash/wm/common/wm_event.h" -#include "ash/wm/coordinate_conversion.h" +#include "ash/wm/common/wm_globals.h" +#include "ash/wm/common/wm_root_window_controller.h" +#include "ash/wm/common/wm_screen_util.h" #include "ash/wm/dock/docked_window_layout_manager.h" -#include "ash/wm/window_animations.h" #include "ash/wm/window_state.h" #include "ash/wm/window_state_delegate.h" -#include "ash/wm/window_state_util.h" -#include "ash/wm/window_util.h" -#include "ash/wm/workspace/workspace_window_resizer.h" -#include "ash/wm/workspace_controller.h" -#include "ui/aura/client/aura_constants.h" #include "ui/aura/window.h" -#include "ui/aura/window_delegate.h" #include "ui/gfx/display.h" #include "ui/gfx/geometry/rect.h" +#include "ui/gfx/screen.h" namespace ash { namespace wm { @@ -55,36 +52,33 @@ // work area information like WindowResizer does for the // last window location. gfx::Rect display_area = - gfx::Screen::GetScreen() - ->GetDisplayNearestWindow(window_state->aura_window()) - .bounds(); + window_state->window()->GetDisplayNearestWindow().bounds(); if (!display_area.Intersects(restore_bounds)) { const gfx::Display& display = gfx::Screen::GetScreen()->GetDisplayMatching(restore_bounds); - WindowTreeHostManager* window_tree_host_manager = - Shell::GetInstance()->window_tree_host_manager(); - aura::Window* new_root = - window_tree_host_manager->GetRootWindowForDisplayId(display.id()); - if (new_root != window_state->aura_window()->GetRootWindow()) { - aura::Window* new_container = Shell::GetContainer( - new_root, window_state->aura_window()->parent()->id()); - new_container->AddChild(window_state->aura_window()); + WmGlobals* globals = window_state->window()->GetGlobals(); + WmWindow* new_root = globals->GetRootWindowForDisplayId(display.id()); + if (new_root != window_state->window()->GetRootWindow()) { + WmWindow* new_container = new_root->GetChildByShellWindowId( + window_state->window()->GetParent()->GetShellWindowId()); + new_container->AddChild(window_state->window()); } } } -DockedWindowLayoutManager* GetDockedWindowLayoutManager() { - aura::Window* active_window = ash::wm::GetActiveWindow(); - if (active_window) { - aura::Window* dock_container = Shell::GetContainer( - active_window->GetRootWindow(), kShellWindowId_DockedContainer); - DockedWindowLayoutManager* dock_layout = +DockedWindowLayoutManager* GetDockedWindowLayoutManager(WmGlobals* globals) { + WmWindow* active_window = globals->GetActiveWindow(); + if (!active_window) + return nullptr; + + WmWindow* dock_container = + active_window->GetRootWindow()->GetChildByShellWindowId( + kShellWindowId_DockedContainer); + DockedWindowLayoutManager* dock_layout = static_cast<DockedWindowLayoutManager*>( - dock_container->layout_manager()); - return dock_layout; - } - return NULL; + WmWindowAura::GetAuraWindow(dock_container)->layout_manager()); + return dock_layout; } class ScopedPreferredAlignmentResetter { @@ -124,7 +118,8 @@ }; void CycleSnapDock(WindowState* window_state, WMEventType event) { - DockedWindowLayoutManager* dock_layout = GetDockedWindowLayoutManager(); + DockedWindowLayoutManager* dock_layout = + GetDockedWindowLayoutManager(window_state->window()->GetGlobals()); wm::WindowStateType desired_snap_state = event == WM_EVENT_CYCLE_SNAP_DOCK_LEFT ? wm::WINDOW_STATE_TYPE_LEFT_SNAPPED : wm::WINDOW_STATE_TYPE_RIGHT_SNAPPED; @@ -139,7 +134,7 @@ current_dock_alignment != desired_dock_alignment)) { if (window_state->CanSnap() && window_state->GetStateType() != desired_snap_state && - window_state->aura_window()->type() != ui::wm::WINDOW_TYPE_PANEL) { + window_state->window()->GetType() != ui::wm::WINDOW_TYPE_PANEL) { const wm::WMEvent event(desired_snap_state == wm::WINDOW_STATE_TYPE_LEFT_SNAPPED ? wm::WM_EVENT_SNAP_LEFT : wm::WM_EVENT_SNAP_RIGHT); @@ -169,8 +164,7 @@ window_state->Restore(); return; } - ::wm::AnimateWindow(window_state->aura_window(), - ::wm::WINDOW_ANIMATION_TYPE_BOUNCE); + window_state->window()->Animate(::wm::WINDOW_ANIMATION_TYPE_BOUNCE); } } // namespace @@ -263,8 +257,7 @@ // If the display has changed while in the another mode, // we need to let windows know the change. gfx::Display current_display = - gfx::Screen::GetScreen()->GetDisplayNearestWindow( - window_state->aura_window()); + window_state->window()->GetDisplayNearestWindow(); if (stored_display_state_.bounds() != current_display.bounds()) { const WMEvent event(wm::WM_EVENT_DISPLAY_BOUNDS_CHANGED); window_state->OnWMEvent(&event); @@ -276,22 +269,20 @@ void DefaultState::DetachState(WindowState* window_state) { stored_window_state_ = window_state; - aura::Window* window = window_state->aura_window(); - stored_bounds_ = window->bounds(); + stored_bounds_ = window_state->window()->GetBounds(); stored_restore_bounds_ = window_state->HasRestoreBounds() ? window_state->GetRestoreBoundsInParent() : gfx::Rect(); // Remember the display state so that in case of the display change // while in the other mode, we can perform necessary action to // restore the window state to the proper state for the current // display. - stored_display_state_ = gfx::Screen::GetScreen()->GetDisplayNearestWindow( - window_state->aura_window()); + stored_display_state_ = window_state->window()->GetDisplayNearestWindow(); } // static bool DefaultState::ProcessCompoundEvents(WindowState* window_state, const WMEvent* event) { - aura::Window* window = window_state->aura_window(); + WmWindow* window = window_state->window(); switch (event->type()) { case WM_EVENT_TOGGLE_MAXIMIZE_CAPTION: @@ -316,27 +307,25 @@ } return true; case WM_EVENT_TOGGLE_VERTICAL_MAXIMIZE: { - gfx::Rect work_area = - ScreenUtil::GetDisplayWorkAreaBoundsInParent(window); + gfx::Rect work_area = GetDisplayWorkAreaBoundsInParent(window); // Maximize vertically if: // - The window does not have a max height defined. // - The window has the normal state type. Snapped windows are excluded // because they are already maximized vertically and reverting to the // restored bounds looks weird. - if (window->delegate()->GetMaximumSize().height() != 0 || + if (window->GetMaximumSize().height() != 0 || !window_state->IsNormalStateType()) { return true; } if (window_state->HasRestoreBounds() && - (window->bounds().height() == work_area.height() && - window->bounds().y() == work_area.y())) { + (window->GetBounds().height() == work_area.height() && + window->GetBounds().y() == work_area.y())) { window_state->SetAndClearRestoreBounds(); } else { window_state->SaveCurrentBoundsForRestore(); - window->SetBounds(gfx::Rect(window->bounds().x(), - work_area.y(), - window->bounds().width(), + window->SetBounds(gfx::Rect(window->GetBounds().x(), work_area.y(), + window->GetBounds().width(), work_area.height())); } return true; @@ -345,24 +334,21 @@ // Maximize horizontally if: // - The window does not have a max width defined. // - The window is snapped or has the normal state type. - if (window->delegate()->GetMaximumSize().width() != 0) + if (window->GetMaximumSize().width() != 0) return true; if (!window_state->IsNormalOrSnapped()) return true; - gfx::Rect work_area = - ScreenUtil::GetDisplayWorkAreaBoundsInParent(window); + gfx::Rect work_area = GetDisplayWorkAreaBoundsInParent(window); if (window_state->IsNormalStateType() && window_state->HasRestoreBounds() && - (window->bounds().width() == work_area.width() && - window->bounds().x() == work_area.x())) { + (window->GetBounds().width() == work_area.width() && + window->GetBounds().x() == work_area.x())) { window_state->SetAndClearRestoreBounds(); } else { - gfx::Rect new_bounds(work_area.x(), - window->bounds().y(), - work_area.width(), - window->bounds().height()); + gfx::Rect new_bounds(work_area.x(), window->GetBounds().y(), + work_area.width(), window->GetBounds().height()); - gfx::Rect restore_bounds = window->bounds(); + gfx::Rect restore_bounds = window->GetBounds(); if (window_state->IsSnapped()) { window_state->SetRestoreBoundsInParent(new_bounds); window_state->Restore(); @@ -420,8 +406,8 @@ return true; } - aura::Window* window = window_state->aura_window(); - gfx::Rect bounds = window->bounds(); + WmWindow* window = window_state->window(); + gfx::Rect bounds = window->GetBounds(); // Don't adjust window bounds if the bounds are empty as this // happens when a new views::Widget is created. @@ -439,13 +425,13 @@ // be further shrunk by the docked area. The logic ensures 30% // visibility which should be enough to see where the window gets // moved. - gfx::Rect display_area = ScreenUtil::GetDisplayBoundsInParent(window); - int min_width = bounds.width() * kMinimumPercentOnScreenArea; - int min_height = bounds.height() * kMinimumPercentOnScreenArea; - AdjustBoundsToEnsureWindowVisibility( - display_area, min_width, min_height, &bounds); + gfx::Rect display_area = GetDisplayBoundsInParent(window); + int min_width = bounds.width() * wm::kMinimumPercentOnScreenArea; + int min_height = bounds.height() * wm::kMinimumPercentOnScreenArea; + wm::AdjustBoundsToEnsureWindowVisibility(display_area, min_width, + min_height, &bounds); window_state->AdjustSnappedBounds(&bounds); - if (window->bounds() != bounds) + if (window->GetBounds() != bounds) window_state->SetBoundsConstrained(bounds); return true; } @@ -455,14 +441,13 @@ return true; } gfx::Rect work_area_in_parent = - ScreenUtil::GetDisplayWorkAreaBoundsInParent( - window_state->aura_window()); - gfx::Rect bounds = window_state->aura_window()->bounds(); + GetDisplayWorkAreaBoundsInParent(window_state->window()); + gfx::Rect bounds = window_state->window()->GetBounds(); // When display bounds has changed, make sure the entire window is fully // visible. bounds.AdjustToFit(work_area_in_parent); window_state->AdjustSnappedBounds(&bounds); - if (window_state->aura_window()->bounds() != bounds) + if (window_state->window()->GetBounds() != bounds) window_state->SetBoundsDirectAnimated(bounds); return true; } @@ -470,9 +455,9 @@ // Don't resize the maximized window when the desktop is covered // by fullscreen window. crbug.com/504299. bool in_fullscreen = - RootWindowController::ForWindow(window_state->aura_window()) - ->workspace_controller() - ->GetWindowState() == WORKSPACE_WINDOW_STATE_FULL_SCREEN; + window_state->window() + ->GetRootWindowController() + ->GetWorkspaceWindowState() == WORKSPACE_WINDOW_STATE_FULL_SCREEN; if (in_fullscreen && window_state->IsMaximized()) return true; @@ -481,12 +466,12 @@ return true; } gfx::Rect work_area_in_parent = - ScreenUtil::GetDisplayWorkAreaBoundsInParent( - window_state->aura_window()); - gfx::Rect bounds = window_state->aura_window()->bounds(); - AdjustBoundsToEnsureMinimumWindowVisibility(work_area_in_parent, &bounds); + GetDisplayWorkAreaBoundsInParent(window_state->window()); + gfx::Rect bounds = window_state->window()->GetBounds(); + wm::AdjustBoundsToEnsureMinimumWindowVisibility(work_area_in_parent, + &bounds); window_state->AdjustSnappedBounds(&bounds); - if (window_state->aura_window()->bounds() != bounds) + if (window_state->window()->GetBounds() != bounds) window_state->SetBoundsDirectAnimated(bounds); return true; } @@ -516,13 +501,13 @@ bool DefaultState::SetMaximizedOrFullscreenBounds(WindowState* window_state) { DCHECK(!window_state->is_dragged()); if (window_state->IsMaximized()) { - window_state->SetBoundsDirect(ScreenUtil::GetMaximizedWindowBoundsInParent( - window_state->aura_window())); + window_state->SetBoundsDirect( + GetMaximizedWindowBoundsInParent(window_state->window())); return true; } if (window_state->IsFullscreen()) { window_state->SetBoundsDirect( - ScreenUtil::GetDisplayBoundsInParent(window_state->aura_window())); + GetDisplayBoundsInParent(window_state->window())); return true; } return false; @@ -537,10 +522,9 @@ window_state->SetBoundsDirect(event->requested_bounds()); } else if (window_state->IsSnapped()) { gfx::Rect work_area_in_parent = - ScreenUtil::GetDisplayWorkAreaBoundsInParent( - window_state->aura_window()); + GetDisplayWorkAreaBoundsInParent(window_state->window()); gfx::Rect child_bounds(event->requested_bounds()); - AdjustBoundsSmallerThan(work_area_in_parent.size(), &child_bounds); + wm::AdjustBoundsSmallerThan(work_area_in_parent.size(), &child_bounds); window_state->AdjustSnappedBounds(&child_bounds); window_state->SetBoundsDirect(child_bounds); } else if (!SetMaximizedOrFullscreenBounds(window_state)) { @@ -560,7 +544,7 @@ window_state->UpdateWindowShowStateFromStateType(); window_state->NotifyPreStateTypeChange(previous_state_type); - if (window_state->aura_window()->parent()) { + if (window_state->window()->GetParent()) { if (!window_state->HasRestoreBounds() && (previous_state_type == WINDOW_STATE_TYPE_DEFAULT || previous_state_type == WINDOW_STATE_TYPE_NORMAL) && @@ -634,23 +618,24 @@ void DefaultState::UpdateBoundsFromState(WindowState* window_state, WindowStateType previous_state_type) { - aura::Window* window = window_state->aura_window(); + WmWindow* window = window_state->window(); gfx::Rect bounds_in_parent; switch (state_type_) { case WINDOW_STATE_TYPE_LEFT_SNAPPED: case WINDOW_STATE_TYPE_RIGHT_SNAPPED: - bounds_in_parent = state_type_ == WINDOW_STATE_TYPE_LEFT_SNAPPED ? - GetDefaultLeftSnappedWindowBoundsInParent(window_state->window()) : - GetDefaultRightSnappedWindowBoundsInParent(window_state->window()); + bounds_in_parent = + state_type_ == WINDOW_STATE_TYPE_LEFT_SNAPPED + ? GetDefaultLeftSnappedWindowBoundsInParent(window) + : GetDefaultRightSnappedWindowBoundsInParent(window); break; case WINDOW_STATE_TYPE_DOCKED: { - if (window->parent()->id() != kShellWindowId_DockedContainer) { - aura::Window* docked_container = Shell::GetContainer( - window->GetRootWindow(), - kShellWindowId_DockedContainer); - wm::ReparentChildWithTransientChildren(window, - window->parent(), - docked_container); + if (window->GetParent()->GetShellWindowId() != + kShellWindowId_DockedContainer) { + WmWindow* docked_container = + window->GetRootWindow()->GetChildByShellWindowId( + kShellWindowId_DockedContainer); + ReparentChildWithTransientChildren(window, window->GetParent(), + docked_container); } // Return early because we don't want to update the bounds of the // window below; as the bounds are managed by the dock layout. @@ -658,9 +643,7 @@ } case WINDOW_STATE_TYPE_DEFAULT: case WINDOW_STATE_TYPE_NORMAL: { - gfx::Rect work_area_in_parent = - ScreenUtil::GetDisplayWorkAreaBoundsInParent( - window_state->aura_window()); + gfx::Rect work_area_in_parent = GetDisplayWorkAreaBoundsInParent(window); if (window_state->HasRestoreBounds()) { bounds_in_parent = window_state->GetRestoreBoundsInParent(); // Check if the |window|'s restored size is bigger than the working area @@ -674,19 +657,19 @@ kMaximizedWindowInset, kMaximizedWindowInset); } } else { - bounds_in_parent = window->bounds(); + bounds_in_parent = window->GetBounds(); } // Make sure that part of the window is always visible. - AdjustBoundsToEnsureMinimumWindowVisibility( - work_area_in_parent, &bounds_in_parent); + wm::AdjustBoundsToEnsureMinimumWindowVisibility(work_area_in_parent, + &bounds_in_parent); break; } case WINDOW_STATE_TYPE_MAXIMIZED: - bounds_in_parent = ScreenUtil::GetMaximizedWindowBoundsInParent(window); + bounds_in_parent = GetMaximizedWindowBoundsInParent(window); break; case WINDOW_STATE_TYPE_FULLSCREEN: - bounds_in_parent = ScreenUtil::GetDisplayBoundsInParent(window); + bounds_in_parent = GetDisplayBoundsInParent(window); break; case WINDOW_STATE_TYPE_DOCKED_MINIMIZED: @@ -716,23 +699,21 @@ if (window_state->IsMinimized()) { // Save the previous show state so that we can correctly restore it. - window_state->aura_window()->SetProperty( - aura::client::kRestoreShowStateKey, - ToWindowShowState(previous_state_type)); - ::wm::SetWindowVisibilityAnimationType( - window_state->aura_window(), WINDOW_VISIBILITY_ANIMATION_TYPE_MINIMIZE); + window->SetRestoreShowState(ToWindowShowState(previous_state_type)); + window->SetVisibilityAnimationType( + WINDOW_VISIBILITY_ANIMATION_TYPE_MINIMIZE); // Hide the window. - window_state->window()->Hide(); + window->Hide(); // Activate another window. if (window_state->IsActive()) window_state->Deactivate(); - } else if ((window_state->window()->GetTargetVisibility() || + } else if ((window->GetTargetVisibility() || IsMinimizedWindowState(previous_state_type)) && - !window_state->aura_window()->layer()->visible()) { + !window->GetLayer()->visible()) { // The layer may be hidden if the window was previously minimized. Make // sure it's visible. - window_state->window()->Show(); + window->Show(); if (IsMinimizedWindowState(previous_state_type) && !window_state->IsMaximizedOrFullscreen()) { window_state->set_unminimize_to_restore_bounds(false); @@ -744,20 +725,18 @@ void DefaultState::CenterWindow(WindowState* window_state) { if (!window_state->IsNormalOrSnapped()) return; - aura::Window* window = window_state->aura_window(); + WmWindow* window = window_state->window(); if (window_state->IsSnapped()) { - gfx::Rect center_in_screen = - gfx::Screen::GetScreen()->GetDisplayNearestWindow(window).work_area(); - gfx::Size size = window_state->HasRestoreBounds() ? - window_state->GetRestoreBoundsInScreen().size() : - window->bounds().size(); + gfx::Rect center_in_screen = window->GetDisplayNearestWindow().work_area(); + gfx::Size size = window_state->HasRestoreBounds() + ? window_state->GetRestoreBoundsInScreen().size() + : window->GetBounds().size(); center_in_screen.ClampToCenteredSize(size); window_state->SetRestoreBoundsInScreen(center_in_screen); window_state->Restore(); } else { - gfx::Rect center_in_parent = - ScreenUtil::GetDisplayWorkAreaBoundsInParent(window); - center_in_parent.ClampToCenteredSize(window->bounds().size()); + gfx::Rect center_in_parent = GetDisplayWorkAreaBoundsInParent(window); + center_in_parent.ClampToCenteredSize(window->GetBounds().size()); window_state->SetBoundsDirectAnimated(center_in_parent); } // Centering window is treated as if a user moved and resized the window.
diff --git a/ash/wm/dock/docked_window_layout_manager.cc b/ash/wm/dock/docked_window_layout_manager.cc index 69840776..6d318ae 100644 --- a/ash/wm/dock/docked_window_layout_manager.cc +++ b/ash/wm/dock/docked_window_layout_manager.cc
@@ -13,6 +13,8 @@ #include "ash/shelf/shelf_widget.h" #include "ash/shell.h" #include "ash/shell_window_ids.h" +#include "ash/wm/common/window_animation_types.h" +#include "ash/wm/common/window_parenting_utils.h" #include "ash/wm/coordinate_conversion.h" #include "ash/wm/window_animations.h" #include "ash/wm/window_properties.h" @@ -244,8 +246,11 @@ gfx::Rect previous_bounds = window->bounds(); aura::Window* old_parent = window->parent(); aura::client::ParentWindowWithContext(window, window, gfx::Rect()); - if (window->parent() != old_parent) - wm::ReparentTransientChildrenOfChild(window, old_parent, window->parent()); + if (window->parent() != old_parent) { + wm::ReparentTransientChildrenOfChild( + wm::WmWindowAura::Get(window), wm::WmWindowAura::Get(old_parent), + wm::WmWindowAura::Get(window->parent())); + } // Start maximize or fullscreen (affecting packaged apps) animation from // previous window bounds. window->layer()->SetBounds(previous_bounds); @@ -296,11 +301,20 @@ return target_height; } +} // namespace + +struct DockedWindowLayoutManager::WindowWithHeight { + explicit WindowWithHeight(aura::Window* window) + : window(window), height(window->bounds().height()) {} + aura::Window* window; + int height; +}; + // A functor used to sort the windows in order of their minimum height. -struct CompareMinimumHeight { - bool operator()(WindowWithHeight win1, WindowWithHeight win2) { - return GetWindowHeightCloseTo(win1.window(), 0) < - GetWindowHeightCloseTo(win2.window(), 0); +struct DockedWindowLayoutManager::CompareMinimumHeight { + bool operator()(const WindowWithHeight& win1, const WindowWithHeight& win2) { + return GetWindowHeightCloseTo(win1.window, 0) < + GetWindowHeightCloseTo(win2.window, 0); } }; @@ -309,7 +323,7 @@ // of the next. Its value can be positive (gap) or negative (overlap). // Half of |delta| is used as a transition point at which windows could ideally // swap positions. -struct CompareWindowPos { +struct DockedWindowLayoutManager::CompareWindowPos { CompareWindowPos(aura::Window* dragged_window, aura::Window* docked_container, float delta) @@ -317,18 +331,18 @@ docked_container_(docked_container), delta_(delta / 2) {} - bool operator()(WindowWithHeight window_with_height1, - WindowWithHeight window_with_height2) { + bool operator()(const WindowWithHeight& window_with_height1, + const WindowWithHeight& window_with_height2) { // Use target coordinates since animations may be active when windows are // reordered. - aura::Window* win1(window_with_height1.window()); - aura::Window* win2(window_with_height2.window()); + aura::Window* win1(window_with_height1.window); + aura::Window* win2(window_with_height2.window); gfx::Rect win1_bounds = ScreenUtil::ConvertRectToScreen( docked_container_, win1->GetTargetBounds()); gfx::Rect win2_bounds = ScreenUtil::ConvertRectToScreen( docked_container_, win2->GetTargetBounds()); - win1_bounds.set_height(window_with_height1.height_); - win2_bounds.set_height(window_with_height2.height_); + win1_bounds.set_height(window_with_height1.height); + win2_bounds.set_height(window_with_height2.height); // If one of the windows is the |dragged_window_| attempt to make an // earlier swap between the windows than just based on their centers. // This is possible if the dragged window is at least as tall as the other @@ -370,8 +384,6 @@ float delta_; }; -} // namespace - //////////////////////////////////////////////////////////////////////////////// // A class that observes shelf for bounds changes. class DockedWindowLayoutManager::ShelfWindowObserver : public WindowObserver { @@ -425,7 +437,7 @@ shelf_(nullptr), workspace_controller_(workspace_controller), in_fullscreen_(workspace_controller_->GetWindowState() == - WORKSPACE_WINDOW_STATE_FULL_SCREEN), + wm::WORKSPACE_WINDOW_STATE_FULL_SCREEN), docked_width_(0), alignment_(DOCKED_ALIGNMENT_NONE), preferred_alignment_(DOCKED_ALIGNMENT_NONE), @@ -785,7 +797,7 @@ return; // Entering fullscreen mode (including immersive) hides docked windows. in_fullscreen_ = workspace_controller_->GetWindowState() == - WORKSPACE_WINDOW_STATE_FULL_SCREEN; + wm::WORKSPACE_WINDOW_STATE_FULL_SCREEN; { // prevent Relayout from getting called multiple times during this base::AutoReset<bool> auto_reset_in_layout(&in_layout_, true); @@ -885,7 +897,7 @@ ::wm::SetWindowVisibilityAnimationDuration( window, base::TimeDelta::FromMilliseconds(kFadeDurationMs)); } else if (wm::GetWindowState(window)->IsMinimized()) { - animation_type = WINDOW_VISIBILITY_ANIMATION_TYPE_MINIMIZE; + animation_type = wm::WINDOW_VISIBILITY_ANIMATION_TYPE_MINIMIZE; } ::wm::SetWindowVisibilityAnimationType(window, animation_type); } @@ -1147,10 +1159,10 @@ for (std::vector<WindowWithHeight>::reverse_iterator iter = visible_windows->rbegin(); iter != visible_windows->rend(); ++iter) { - iter->height_ = GetWindowHeightCloseTo( - iter->window(), + iter->height = GetWindowHeightCloseTo( + iter->window, (available_room + gap_height) / remaining_windows - gap_height); - available_room -= (iter->height_ + gap_height); + available_room -= (iter->height + gap_height); remaining_windows--; } return available_room + gap_height; @@ -1167,7 +1179,7 @@ for (std::vector<WindowWithHeight>::const_iterator iter = visible_windows.begin(); iter != visible_windows.end(); ++iter) { - const aura::Window* window = iter->window(); + const aura::Window* window = iter->window; int min_window_width = window->bounds().width(); int max_window_width = min_window_width; if (!wm::GetWindowState(window)->bounds_changed_by_user()) { @@ -1203,7 +1215,7 @@ int new_width = ideal_docked_width; if (visible_windows->empty() || (visible_windows->size() == 1 && - (*visible_windows)[0].window() == dragged_window_)) { + (*visible_windows)[0].window == dragged_window_)) { new_width = 0; } UpdateDockedWidth(new_width); @@ -1214,7 +1226,7 @@ dock_container_, delta)); for (std::vector<WindowWithHeight>::iterator iter = visible_windows->begin(); iter != visible_windows->end(); ++iter) { - aura::Window* window = iter->window(); + aura::Window* window = iter->window; gfx::Rect bounds = ScreenUtil::ConvertRectToScreen( dock_container_, window->GetTargetBounds()); // A window is extended or shrunk to be as close as possible to the ideal @@ -1232,7 +1244,7 @@ alignment = GetEdgeNearestWindow(window); // Fan out windows evenly distributing the overlap or remaining free space. - bounds.set_height(iter->height_); + bounds.set_height(iter->height); bounds.set_y(std::max(work_area.y(), std::min(work_area.bottom() - bounds.height(), static_cast<int>(y_pos + 0.5))));
diff --git a/ash/wm/dock/docked_window_layout_manager.h b/ash/wm/dock/docked_window_layout_manager.h index e89be0d8..dc0c3e01 100644 --- a/ash/wm/dock/docked_window_layout_manager.h +++ b/ash/wm/dock/docked_window_layout_manager.h
@@ -42,16 +42,6 @@ class Shelf; class WorkspaceController; -struct WindowWithHeight { - explicit WindowWithHeight(aura::Window* window) : - window_(window), - height_(window->bounds().height()) { } - aura::Window* window() { return window_; } - const aura::Window* window() const { return window_; } - aura::Window* window_; - int height_; -}; - // DockedWindowLayoutManager is responsible for organizing windows when they are // docked to the side of a screen. It is associated with a specific container // window (i.e. kShellWindowId_DockContainer) and controls the layout of any @@ -178,7 +168,11 @@ aura::Window* lost_active) override; private: + struct CompareMinimumHeight; + struct CompareWindowPos; class ShelfWindowObserver; + struct WindowWithHeight; + friend class DockedWindowLayoutManagerTest; friend class DockedWindowResizerTest;
diff --git a/ash/wm/dock/docked_window_resizer.cc b/ash/wm/dock/docked_window_resizer.cc index 3de281e..974d448 100644 --- a/ash/wm/dock/docked_window_resizer.cc +++ b/ash/wm/dock/docked_window_resizer.cc
@@ -12,6 +12,8 @@ #include "ash/shelf/shelf_widget.h" #include "ash/shell.h" #include "ash/shell_window_ids.h" +#include "ash/wm/aura/wm_window_aura.h" +#include "ash/wm/common/window_parenting_utils.h" #include "ash/wm/common/wm_event.h" #include "ash/wm/dock/docked_window_layout_manager.h" #include "ash/wm/window_state.h" @@ -210,9 +212,10 @@ aura::Window* docked_container = Shell::GetContainer( GetTarget()->GetRootWindow(), kShellWindowId_DockedContainer); - wm::ReparentChildWithTransientChildren(GetTarget(), - GetTarget()->parent(), - docked_container); + ReparentChildWithTransientChildren( + ash::wm::WmWindowAura::Get(GetTarget()), + ash::wm::WmWindowAura::Get(GetTarget()->parent()), + ash::wm::WmWindowAura::Get(docked_container)); if (!resizer) return; } @@ -286,9 +289,10 @@ if ((is_resized || !is_attached_panel) && is_docked_ != (window->parent() == dock_container)) { if (is_docked_) { - wm::ReparentChildWithTransientChildren(window, - window->parent(), - dock_container); + wm::ReparentChildWithTransientChildren( + wm::WmWindowAura::Get(window), + wm::WmWindowAura::Get(window->parent()), + wm::WmWindowAura::Get(dock_container)); action = DOCKED_ACTION_DOCK; } else if (window->parent()->id() == kShellWindowId_DockedContainer) { // Reparent the window back to workspace. @@ -302,9 +306,10 @@ aura::Window* previous_parent = window->parent(); aura::client::ParentWindowWithContext(window, window, near_last_location); if (window->parent() != previous_parent) { - wm::ReparentTransientChildrenOfChild(window, - previous_parent, - window->parent()); + wm::ReparentTransientChildrenOfChild( + ash::wm::WmWindowAura::Get(window), + ash::wm::WmWindowAura::Get(previous_parent), + ash::wm::WmWindowAura::Get(window->parent())); } action = was_docked_ ? DOCKED_ACTION_UNDOCK : DOCKED_ACTION_NONE; }
diff --git a/ash/wm/drag_window_resizer.cc b/ash/wm/drag_window_resizer.cc index 0145fbb..e882cb8 100644 --- a/ash/wm/drag_window_resizer.cc +++ b/ash/wm/drag_window_resizer.cc
@@ -7,6 +7,7 @@ #include "ash/display/mouse_cursor_event_filter.h" #include "ash/screen_util.h" #include "ash/shell.h" +#include "ash/wm/common/window_positioning_utils.h" #include "ash/wm/coordinate_conversion.h" #include "ash/wm/drag_window_controller.h" #include "ash/wm/window_state.h"
diff --git a/ash/wm/drag_window_resizer_unittest.cc b/ash/wm/drag_window_resizer_unittest.cc index 686c88f..638b0b9 100644 --- a/ash/wm/drag_window_resizer_unittest.cc +++ b/ash/wm/drag_window_resizer_unittest.cc
@@ -13,6 +13,7 @@ #include "ash/test/ash_test_base.h" #include "ash/test/cursor_manager_test_api.h" #include "ash/test/display_manager_test_api.h" +#include "ash/wm/common/window_positioning_utils.h" #include "ash/wm/drag_window_controller.h" #include "ash/wm/window_util.h" #include "base/strings/string_number_conversions.h" @@ -211,7 +212,7 @@ // root window's bounds. EXPECT_EQ(root_windows[1], window_->GetRootWindow()); // Window origin should be adjusted for minimum visibility (25px). - int expected_x = -50 + kMinimumOnScreenArea; + int expected_x = -50 + wm::kMinimumOnScreenArea; EXPECT_EQ(base::IntToString(expected_x) + ",10 50x60", window_->bounds().ToString());
diff --git a/ash/wm/lock_window_state.cc b/ash/wm/lock_window_state.cc index 1ebd6bc9..c14c1ca 100644 --- a/ash/wm/lock_window_state.cc +++ b/ash/wm/lock_window_state.cc
@@ -9,13 +9,14 @@ #include "ash/display/display_manager.h" #include "ash/screen_util.h" #include "ash/shell.h" +#include "ash/wm/common/window_animation_types.h" +#include "ash/wm/common/window_state_util.h" #include "ash/wm/common/wm_event.h" #include "ash/wm/lock_layout_manager.h" #include "ash/wm/window_animations.h" #include "ash/wm/window_state.h" #include "ash/wm/window_state_aura.h" #include "ash/wm/window_state_delegate.h" -#include "ash/wm/window_state_util.h" #include "ash/wm/window_util.h" #include "ui/aura/window.h" #include "ui/aura/window_delegate.h" @@ -134,7 +135,8 @@ current_state_type_ = target_state; ::wm::SetWindowVisibilityAnimationType( - window_state->aura_window(), WINDOW_VISIBILITY_ANIMATION_TYPE_MINIMIZE); + window_state->aura_window(), + wm::WINDOW_VISIBILITY_ANIMATION_TYPE_MINIMIZE); window_state->window()->Hide(); if (window_state->IsActive()) window_state->Deactivate();
diff --git a/ash/wm/maximize_mode/maximize_mode_window_state.cc b/ash/wm/maximize_mode/maximize_mode_window_state.cc index 997ec63..34a962d0 100644 --- a/ash/wm/maximize_mode/maximize_mode_window_state.cc +++ b/ash/wm/maximize_mode/maximize_mode_window_state.cc
@@ -9,6 +9,8 @@ #include "ash/screen_util.h" #include "ash/shell.h" #include "ash/shell_window_ids.h" +#include "ash/wm/common/window_animation_types.h" +#include "ash/wm/common/window_state_util.h" #include "ash/wm/common/wm_event.h" #include "ash/wm/coordinate_conversion.h" #include "ash/wm/maximize_mode/maximize_mode_window_manager.h" @@ -16,7 +18,6 @@ #include "ash/wm/window_properties.h" #include "ash/wm/window_state_aura.h" #include "ash/wm/window_state_delegate.h" -#include "ash/wm/window_state_util.h" #include "ash/wm/window_util.h" #include "ash/wm/workspace/workspace_window_resizer.h" #include "ui/aura/client/aura_constants.h" @@ -256,7 +257,8 @@ current_state_type_ = target_state; ::wm::SetWindowVisibilityAnimationType( - window_state->aura_window(), WINDOW_VISIBILITY_ANIMATION_TYPE_MINIMIZE); + window_state->aura_window(), + wm::WINDOW_VISIBILITY_ANIMATION_TYPE_MINIMIZE); window_state->window()->Hide(); if (window_state->IsActive()) window_state->Deactivate();
diff --git a/ash/wm/panels/panel_layout_manager.cc b/ash/wm/panels/panel_layout_manager.cc index 3fb4738b..e316b30 100644 --- a/ash/wm/panels/panel_layout_manager.cc +++ b/ash/wm/panels/panel_layout_manager.cc
@@ -16,6 +16,9 @@ #include "ash/shelf/shelf_widget.h" #include "ash/shell.h" #include "ash/shell_window_ids.h" +#include "ash/wm/aura/wm_window_aura.h" +#include "ash/wm/common/window_animation_types.h" +#include "ash/wm/common/window_parenting_utils.h" #include "ash/wm/overview/window_selector_controller.h" #include "ash/wm/window_animations.h" #include "ash/wm/window_state.h" @@ -349,7 +352,9 @@ aura::Window* old_parent = child->parent(); aura::client::ParentWindowWithContext( child, child, child->GetRootWindow()->GetBoundsInScreen()); - wm::ReparentTransientChildrenOfChild(child, old_parent, child->parent()); + wm::ReparentTransientChildrenOfChild( + wm::WmWindowAura::Get(child), wm::WmWindowAura::Get(old_parent), + wm::WmWindowAura::Get(child->parent())); DCHECK(child->parent()->id() != kShellWindowId_PanelContainer); return; } @@ -561,7 +566,7 @@ void PanelLayoutManager::MinimizePanel(aura::Window* panel) { ::wm::SetWindowVisibilityAnimationType( - panel, WINDOW_VISIBILITY_ANIMATION_TYPE_MINIMIZE); + panel, wm::WINDOW_VISIBILITY_ANIMATION_TYPE_MINIMIZE); ui::Layer* layer = panel->layer(); ui::ScopedLayerAnimationSettings panel_slide_settings(layer->GetAnimator()); panel_slide_settings.SetPreemptionStrategy(
diff --git a/ash/wm/panels/panel_window_resizer.cc b/ash/wm/panels/panel_window_resizer.cc index b5c44bc..987c0c7 100644 --- a/ash/wm/panels/panel_window_resizer.cc +++ b/ash/wm/panels/panel_window_resizer.cc
@@ -11,6 +11,7 @@ #include "ash/shelf/shelf_widget.h" #include "ash/shell.h" #include "ash/shell_window_ids.h" +#include "ash/wm/common/window_parenting_utils.h" #include "ash/wm/panels/panel_layout_manager.h" #include "ash/wm/window_state.h" #include "ash/wm/window_util.h" @@ -181,7 +182,10 @@ aura::Window* old_parent = target->parent(); aura::client::ParentWindowWithContext( target, target_root, target_root->GetBoundsInScreen()); - wm::ReparentTransientChildrenOfChild(target, old_parent, target->parent()); + ash::wm::ReparentTransientChildrenOfChild( + ash::wm::WmWindowAura::Get(target), + ash::wm::WmWindowAura::Get(old_parent), + ash::wm::WmWindowAura::Get(target->parent())); } } @@ -197,7 +201,10 @@ aura::Window* old_parent = target->parent(); aura::client::ParentWindowWithContext( target, target_root, gfx::Rect(last_location_, gfx::Size())); - wm::ReparentTransientChildrenOfChild(target, old_parent, target->parent()); + ash::wm::ReparentTransientChildrenOfChild( + ash::wm::WmWindowAura::Get(target), + ash::wm::WmWindowAura::Get(old_parent), + ash::wm::WmWindowAura::Get(target->parent())); } // If we started the drag in one root window and moved into another root
diff --git a/ash/wm/system_gesture_event_filter_unittest.cc b/ash/wm/system_gesture_event_filter_unittest.cc index d8d6d58a..902154d 100644 --- a/ash/wm/system_gesture_event_filter_unittest.cc +++ b/ash/wm/system_gesture_event_filter_unittest.cc
@@ -16,10 +16,11 @@ #include "ash/test/display_manager_test_api.h" #include "ash/test/shell_test_api.h" #include "ash/test/test_shelf_delegate.h" +#include "ash/wm/aura/wm_window_aura.h" +#include "ash/wm/common/window_positioning_utils.h" #include "ash/wm/gestures/long_press_affordance_handler.h" #include "ash/wm/window_state.h" #include "ash/wm/window_state_aura.h" -#include "ash/wm/window_util.h" #include "base/time/time.h" #include "base/timer/timer.h" #include "ui/aura/env.h" @@ -485,8 +486,9 @@ generator.GestureMultiFingerScroll( kTouchPoints, points, 120, kSteps, drag_x, 0); - EXPECT_EQ(wm::GetDefaultLeftSnappedWindowBoundsInParent( - toplevel_window).ToString(), + EXPECT_EQ(ash::wm::GetDefaultLeftSnappedWindowBoundsInParent( + ash::wm::WmWindowAura::Get(toplevel_window)) + .ToString(), toplevel_window->bounds().ToString()); } @@ -514,7 +516,8 @@ generator.GestureMultiFingerScroll( kTouchPoints, points, 120, kSteps, drag_x, 0); EXPECT_EQ(wm::GetDefaultRightSnappedWindowBoundsInParent( - toplevel_window).ToString(), + wm::WmWindowAura::Get(toplevel_window)) + .ToString(), toplevel_window->bounds().ToString()); }
diff --git a/ash/wm/window_animations.cc b/ash/wm/window_animations.cc index 58417ec..68221758 100644 --- a/ash/wm/window_animations.cc +++ b/ash/wm/window_animations.cc
@@ -13,6 +13,7 @@ #include "ash/shelf/shelf.h" #include "ash/shelf/shelf_layout_manager.h" #include "ash/shelf/shelf_widget.h" +#include "ash/wm/common/window_animation_types.h" #include "ash/wm/window_util.h" #include "ash/wm/workspace_controller.h" #include "base/command_line.h" @@ -227,10 +228,10 @@ } switch (::wm::GetWindowVisibilityAnimationType(window)) { - case WINDOW_VISIBILITY_ANIMATION_TYPE_MINIMIZE: + case wm::WINDOW_VISIBILITY_ANIMATION_TYPE_MINIMIZE: AnimateShowWindow_Minimize(window); return true; - case WINDOW_VISIBILITY_ANIMATION_TYPE_BRIGHTNESS_GRAYSCALE: + case wm::WINDOW_VISIBILITY_ANIMATION_TYPE_BRIGHTNESS_GRAYSCALE: AnimateShowWindow_BrightnessGrayscale(window); return true; default: @@ -246,10 +247,10 @@ } switch (::wm::GetWindowVisibilityAnimationType(window)) { - case WINDOW_VISIBILITY_ANIMATION_TYPE_MINIMIZE: + case wm::WINDOW_VISIBILITY_ANIMATION_TYPE_MINIMIZE: AnimateHideWindow_Minimize(window); return true; - case WINDOW_VISIBILITY_ANIMATION_TYPE_BRIGHTNESS_GRAYSCALE: + case wm::WINDOW_VISIBILITY_ANIMATION_TYPE_BRIGHTNESS_GRAYSCALE: AnimateHideWindow_BrightnessGrayscale(window); return true; default:
diff --git a/ash/wm/window_animations.h b/ash/wm/window_animations.h index 2e5d24b..114086d 100644 --- a/ash/wm/window_animations.h +++ b/ash/wm/window_animations.h
@@ -26,16 +26,6 @@ // with desktop Chrome, see ui/views/corewm/window_animations.h. namespace ash { -// An extension of the window animations provided by CoreWm. These should be -// Ash-specific only. -enum WindowVisibilityAnimationType { - // Window scale/rotates down to its launcher icon. - WINDOW_VISIBILITY_ANIMATION_TYPE_MINIMIZE = - ::wm::WINDOW_VISIBILITY_ANIMATION_MAX, - // Fade in/out using brightness and grayscale web filters. - WINDOW_VISIBILITY_ANIMATION_TYPE_BRIGHTNESS_GRAYSCALE -}; - // Direction for ash-specific window animations used in workspaces and // lock/unlock animations. enum LayerScaleAnimationDirection {
diff --git a/ash/wm/window_animations_unittest.cc b/ash/wm/window_animations_unittest.cc index d96dd28..3af7aee4 100644 --- a/ash/wm/window_animations_unittest.cc +++ b/ash/wm/window_animations_unittest.cc
@@ -6,6 +6,7 @@ #include "ash/shell_window_ids.h" #include "ash/test/ash_test_base.h" +#include "ash/wm/common/window_animation_types.h" #include "ash/wm/window_state.h" #include "ash/wm/window_state_aura.h" #include "ash/wm/workspace_controller.h" @@ -71,8 +72,7 @@ // Hiding. ::wm::SetWindowVisibilityAnimationType( - window.get(), - WINDOW_VISIBILITY_ANIMATION_TYPE_BRIGHTNESS_GRAYSCALE); + window.get(), wm::WINDOW_VISIBILITY_ANIMATION_TYPE_BRIGHTNESS_GRAYSCALE); AnimateOnChildWindowVisibilityChanged(window.get(), false); EXPECT_EQ(0.0f, window->layer()->GetTargetOpacity()); EXPECT_FALSE(window->layer()->GetTargetVisibility()); @@ -80,8 +80,7 @@ // Showing. ::wm::SetWindowVisibilityAnimationType( - window.get(), - WINDOW_VISIBILITY_ANIMATION_TYPE_BRIGHTNESS_GRAYSCALE); + window.get(), wm::WINDOW_VISIBILITY_ANIMATION_TYPE_BRIGHTNESS_GRAYSCALE); AnimateOnChildWindowVisibilityChanged(window.get(), true); EXPECT_EQ(0.0f, window->layer()->GetTargetBrightness()); EXPECT_EQ(0.0f, window->layer()->GetTargetGrayscale());
diff --git a/ash/wm/window_positioner.cc b/ash/wm/window_positioner.cc index 1c705fd..1b295499 100644 --- a/ash/wm/window_positioner.cc +++ b/ash/wm/window_positioner.cc
@@ -4,23 +4,14 @@ #include "ash/wm/window_positioner.h" -#include "ash/screen_util.h" -#include "ash/shell.h" -#include "ash/shell_delegate.h" -#include "ash/shell_window_ids.h" -#include "ash/wm/mru_window_tracker.h" -#include "ash/wm/window_resizer.h" +#include "ash/wm/common/window_positioning_utils.h" +#include "ash/wm/common/wm_globals.h" +#include "ash/wm/common/wm_screen_util.h" +#include "ash/wm/common/wm_window.h" #include "ash/wm/window_state.h" -#include "ash/wm/window_state_aura.h" -#include "ash/wm/window_util.h" -#include "ui/aura/window.h" -#include "ui/aura/window_delegate.h" -#include "ui/aura/window_event_dispatcher.h" #include "ui/compositor/layer.h" -#include "ui/compositor/scoped_layer_animation_settings.h" +#include "ui/gfx/geometry/insets.h" #include "ui/gfx/screen.h" -#include "ui/wm/core/window_animations.h" -#include "ui/wm/core/window_util.h" namespace ash { @@ -54,10 +45,10 @@ static bool maximize_first_window = false; // Check if any management should be performed (with a given |window|). -bool UseAutoWindowManager(const aura::Window* window) { +bool UseAutoWindowManager(const wm::WmWindow* window) { if (disable_auto_positioning) return false; - const wm::WindowState* window_state = wm::GetWindowState(window); + const wm::WindowState* window_state = window->GetWindowState(); return !window_state->is_dragged() && window_state->window_position_managed(); } @@ -65,33 +56,16 @@ // state is not minimized/maximized/fullscreen/the user has changed // its size by hand already. It furthermore checks for the // WindowIsManaged status. -bool WindowPositionCanBeManaged(const aura::Window* window) { +bool WindowPositionCanBeManaged(const wm::WmWindow* window) { if (disable_auto_positioning) return false; - const wm::WindowState* window_state = wm::GetWindowState(window); + const wm::WindowState* window_state = window->GetWindowState(); return window_state->window_position_managed() && !window_state->IsMinimized() && !window_state->IsMaximized() && !window_state->IsFullscreen() && !window_state->bounds_changed_by_user(); } -// Get the work area for a given |window| in parent coordinates. -gfx::Rect GetWorkAreaForWindowInParent(aura::Window* window) { -#if defined(OS_WIN) - // On Win 8, the host window can't be resized, so - // use window's bounds instead. - // TODO(oshima): Emulate host window resize on win8. - gfx::Rect work_area = gfx::Rect(window->parent()->bounds().size()); - work_area.Inset( - gfx::Screen::GetScreen() - ->GetDisplayMatching(window->parent()->GetBoundsInScreen()) - .GetWorkAreaInsets()); - return work_area; -#else - return ScreenUtil::GetDisplayWorkAreaBoundsInParent(window); -#endif -} - // Move the given |bounds| on the available |work_area| in the direction // indicated by |move_right|. If |move_right| is true, the rectangle gets moved // to the right edge, otherwise to the left one. @@ -115,16 +89,14 @@ // Move a |window| to new |bounds|. Animate if desired by user. // Moves the transient children of the |window| as well by the same |offset| as // the parent |window|. -void SetBoundsAndOffsetTransientChildren(aura::Window* window, +void SetBoundsAndOffsetTransientChildren(wm::WmWindow* window, const gfx::Rect& bounds, const gfx::Rect& work_area, const gfx::Vector2d& offset) { - aura::Window::Windows transient_children = - ::wm::GetTransientChildren(window); - for (aura::Window::Windows::iterator iter = transient_children.begin(); - iter != transient_children.end(); ++iter) { - aura::Window* transient_child = *iter; - gfx::Rect child_bounds = transient_child->bounds(); + std::vector<wm::WmWindow*> transient_children = + window->GetTransientChildren(); + for (wm::WmWindow* transient_child : transient_children) { + gfx::Rect child_bounds = transient_child->GetBounds(); gfx::Rect new_child_bounds = child_bounds + offset; if ((child_bounds.x() <= work_area.x() && new_child_bounds.x() <= work_area.x()) || @@ -140,20 +112,13 @@ new_child_bounds, work_area, offset); } - if (::wm::WindowAnimationsDisabled(window)) { - window->SetBounds(bounds); - return; - } - - ui::ScopedLayerAnimationSettings settings(window->layer()->GetAnimator()); - settings.SetTransitionDuration( - base::TimeDelta::FromMilliseconds(kWindowAutoMoveDurationMS)); - window->SetBounds(bounds); + window->SetBoundsWithTransitionDelay( + bounds, base::TimeDelta::FromMilliseconds(kWindowAutoMoveDurationMS)); } // Move a |window| to new |bounds|. Animate if desired by user. // Note: The function will do nothing if the bounds did not change. -void SetBoundsAnimated(aura::Window* window, +void SetBoundsAnimated(wm::WmWindow* window, const gfx::Rect& bounds, const gfx::Rect& work_area) { gfx::Rect old_bounds = window->GetTargetBounds(); @@ -165,14 +130,14 @@ // Move |window| into the center of the screen - or restore it to the previous // position. -void AutoPlaceSingleWindow(aura::Window* window, bool animated) { - gfx::Rect work_area = GetWorkAreaForWindowInParent(window); - gfx::Rect bounds = window->bounds(); +void AutoPlaceSingleWindow(wm::WmWindow* window, bool animated) { + gfx::Rect work_area = GetDisplayWorkAreaBoundsInParent(window); + gfx::Rect bounds = window->GetBounds(); const gfx::Rect* user_defined_area = - wm::GetWindowState(window)->pre_auto_manage_window_bounds(); + window->GetWindowState()->pre_auto_manage_window_bounds(); if (user_defined_area) { bounds = *user_defined_area; - ash::wm::AdjustBoundsToEnsureMinimumWindowVisibility(work_area, &bounds); + wm::AdjustBoundsToEnsureMinimumWindowVisibility(work_area, &bounds); } else { // Center the window (only in x). bounds.set_x(work_area.x() + (work_area.width() - bounds.width()) / 2); @@ -185,42 +150,41 @@ } // Get the first open (non minimized) window which is on the screen defined. -aura::Window* GetReferenceWindow(const aura::Window* root_window, - const aura::Window* exclude, - bool *single_window) { +wm::WmWindow* GetReferenceWindow(const wm::WmWindow* root_window, + const wm::WmWindow* exclude, + bool* single_window) { if (single_window) *single_window = true; // Get the active window. - aura::Window* active = ash::wm::GetActiveWindow(); + wm::WmWindow* active = root_window->GetGlobals()->GetActiveWindow(); if (active && active->GetRootWindow() != root_window) active = NULL; // Get a list of all windows. - const std::vector<aura::Window*> windows = ash::Shell::GetInstance()-> - mru_window_tracker()->BuildWindowListIgnoreModal(); + const std::vector<wm::WmWindow*> windows = + root_window->GetGlobals()->GetMruWindowListIgnoreModals(); if (windows.empty()) - return NULL; + return nullptr; - aura::Window::Windows::const_iterator iter = windows.begin(); + int index = 0; // Find the index of the current active window. if (active) - iter = std::find(windows.begin(), windows.end(), active); - - int index = (iter == windows.end()) ? 0 : (iter - windows.begin()); + index = std::find(windows.begin(), windows.end(), active) - windows.begin(); // Scan the cycle list backwards to see which is the second topmost window // (and so on). Note that we might cycle a few indices twice if there is no // suitable window. However - since the list is fairly small this should be // very fast anyways. - aura::Window* found = NULL; + wm::WmWindow* found = nullptr; for (int i = index + windows.size(); i >= 0; i--) { - aura::Window* window = windows[i % windows.size()]; - while (::wm::GetTransientParent(window)) - window = ::wm::GetTransientParent(window); - if (window != exclude && window->type() == ui::wm::WINDOW_TYPE_NORMAL && - window->GetRootWindow() == root_window && window->TargetVisibility() && - wm::GetWindowState(window)->window_position_managed()) { + wm::WmWindow* window = windows[i % windows.size()]; + while (window->GetTransientParent()) + window = window->GetTransientParent(); + if (window != exclude && window->GetType() == ui::wm::WINDOW_TYPE_NORMAL && + window->GetRootWindow() == root_window && + window->GetTargetVisibility() && + window->GetWindowState()->window_position_managed()) { if (found && found != window) { // no need to check !single_window because the function must have // been already returned in the "if (!single_window)" below. @@ -245,24 +209,23 @@ // static void WindowPositioner::GetBoundsAndShowStateForNewWindow( - const gfx::Screen* screen, - const aura::Window* new_window, + const wm::WmWindow* new_window, bool is_saved_bounds, ui::WindowShowState show_state_in, gfx::Rect* bounds_in_out, ui::WindowShowState* show_state_out) { // Always open new window in the target display. - aura::Window* target = Shell::GetTargetRootWindow(); + wm::WmWindow* target = wm::WmGlobals::Get()->GetRootWindowForNewWindows(); - aura::Window* top_window = GetReferenceWindow(target, NULL, NULL); + wm::WmWindow* top_window = GetReferenceWindow(target, nullptr, nullptr); // Our window should not have any impact if we are already on top. if (top_window == new_window) - top_window = NULL; + top_window = nullptr; // If there is no valid other window we take and adjust the passed coordinates // and show state. if (!top_window) { - gfx::Rect work_area = screen->GetDisplayNearestWindow(target).work_area(); + gfx::Rect work_area = target->GetDisplayNearestWindow().work_area(); bounds_in_out->AdjustToFit(work_area); // Use adjusted saved bounds, if there is one. @@ -271,14 +234,14 @@ if (show_state_in == ui::SHOW_STATE_DEFAULT) { const bool maximize_first_window_on_first_run = - Shell::GetInstance()->delegate()->IsForceMaximizeOnFirstRun(); + target->GetGlobals()->IsForceMaximizeOnFirstRun(); // We want to always open maximized on "small screens" or when policy // tells us to. const bool set_maximized = maximize_first_window || ((work_area.width() <= GetForceMaximizedWidthLimit() || maximize_first_window_on_first_run) && - (!new_window || !wm::GetWindowState(new_window)->IsFullscreen())); + (!new_window || !new_window->GetWindowState()->IsFullscreen())); if (set_maximized) *show_state_out = ui::SHOW_STATE_MAXIMIZED; @@ -286,7 +249,7 @@ return; } - wm::WindowState* top_window_state = wm::GetWindowState(top_window); + wm::WindowState* top_window_state = top_window->GetWindowState(); bool maximized = top_window_state->IsMaximized(); // We ignore the saved show state, but look instead for the top level // window's show state. @@ -306,7 +269,7 @@ gfx::Vector2d(kMinimumWindowOffset, kMinimumWindowOffset); } if (is_saved_bounds || has_restore_bounds) { - gfx::Rect work_area = screen->GetDisplayNearestWindow(target).work_area(); + gfx::Rect work_area = target->GetDisplayNearestWindow().work_area(); bounds_in_out->AdjustToFit(work_area); // Use adjusted saved bounds or restore bounds, if there is one. return; @@ -320,12 +283,12 @@ // static void WindowPositioner::RearrangeVisibleWindowOnHideOrRemove( - const aura::Window* removed_window) { + const wm::WmWindow* removed_window) { if (!UseAutoWindowManager(removed_window)) return; // Find a single open browser window. bool single_window; - aura::Window* other_shown_window = GetReferenceWindow( + wm::WmWindow* other_shown_window = GetReferenceWindow( removed_window->GetRootWindow(), removed_window, &single_window); if (!other_shown_window || !single_window || !WindowPositionCanBeManaged(other_shown_window)) @@ -342,20 +305,19 @@ // static void WindowPositioner::RearrangeVisibleWindowOnShow( - aura::Window* added_window) { - wm::WindowState* added_window_state = wm::GetWindowState(added_window); - if (!added_window->TargetVisibility()) + wm::WmWindow* added_window) { + wm::WindowState* added_window_state = added_window->GetWindowState(); + if (!added_window->GetTargetVisibility()) return; if (!UseAutoWindowManager(added_window) || added_window_state->bounds_changed_by_user()) { if (added_window_state->minimum_visibility()) { // Guarantee minimum visibility within the work area. - gfx::Rect work_area = GetWorkAreaForWindowInParent(added_window); - gfx::Rect bounds = added_window->bounds(); + gfx::Rect work_area = GetDisplayWorkAreaBoundsInParent(added_window); + gfx::Rect bounds = added_window->GetBounds(); gfx::Rect new_bounds = bounds; - ash::wm::AdjustBoundsToEnsureMinimumWindowVisibility(work_area, - &new_bounds); + wm::AdjustBoundsToEnsureMinimumWindowVisibility(work_area, &new_bounds); if (new_bounds != bounds) added_window->SetBounds(new_bounds); } @@ -363,7 +325,7 @@ } // Find a single open managed window. bool single_window; - aura::Window* other_shown_window = GetReferenceWindow( + wm::WmWindow* other_shown_window = GetReferenceWindow( added_window->GetRootWindow(), added_window, &single_window); if (!other_shown_window) { @@ -376,8 +338,8 @@ return; } - gfx::Rect other_bounds = other_shown_window->bounds(); - gfx::Rect work_area = GetWorkAreaForWindowInParent(added_window); + gfx::Rect other_bounds = other_shown_window->GetBounds(); + gfx::Rect work_area = GetDisplayWorkAreaBoundsInParent(added_window); bool move_other_right = other_bounds.CenterPoint().x() > work_area.x() + work_area.width() / 2; @@ -386,8 +348,7 @@ // When going from one to two windows both windows loose their // "positioned by user" flags. added_window_state->set_bounds_changed_by_user(false); - wm::WindowState* other_window_state = - wm::GetWindowState(other_shown_window); + wm::WindowState* other_window_state = other_shown_window->GetWindowState(); other_window_state->set_bounds_changed_by_user(false); if (WindowPositionCanBeManaged(other_shown_window)) { @@ -405,21 +366,21 @@ // Remember the current location of the window if it's new and push // it also to the opposite location if needed. Since it is just // being shown, we do not need to animate it. - gfx::Rect added_bounds = added_window->bounds(); + gfx::Rect added_bounds = added_window->GetBounds(); if (!added_window_state->pre_auto_manage_window_bounds()) added_window_state->SetPreAutoManageWindowBounds(added_bounds); if (MoveRectToOneSide(work_area, !move_other_right, &added_bounds)) added_window->SetBounds(added_bounds); } -WindowPositioner::WindowPositioner() - : pop_position_offset_increment_x(0), +WindowPositioner::WindowPositioner(wm::WmGlobals* globals) + : globals_(globals), + pop_position_offset_increment_x(0), pop_position_offset_increment_y(0), popup_position_offset_from_screen_corner_x(0), popup_position_offset_from_screen_corner_y(0), last_popup_position_x_(0), - last_popup_position_y_(0) { -} + last_popup_position_y_(0) {} WindowPositioner::~WindowPositioner() { } @@ -459,12 +420,10 @@ pop_position_offset_increment_y = grid; // We handle the Multi monitor support by retrieving the active window's // work area. - aura::Window* window = wm::GetActiveWindow(); + wm::WmWindow* window = globals_->GetActiveWindow(); const gfx::Rect work_area = window && window->IsVisible() - ? gfx::Screen::GetScreen() - ->GetDisplayNearestWindow(window) - .work_area() + ? window->GetDisplayNearestWindow().work_area() : gfx::Screen::GetScreen()->GetPrimaryDisplay().work_area(); // Only try to reposition the popup when it is not spanning the entire // screen. @@ -521,22 +480,22 @@ const gfx::Rect& old_pos, const gfx::Rect& work_area, int grid) { - const std::vector<aura::Window*> windows = ash::Shell::GetInstance()-> - mru_window_tracker()->BuildWindowListIgnoreModal(); + const std::vector<wm::WmWindow*> windows = + globals_->GetMruWindowListIgnoreModals(); std::vector<const gfx::Rect*> regions; // Process the window list and check if we can bail immediately. for (size_t i = 0; i < windows.size(); i++) { // We only include opaque and visible windows. - if (windows[i] && windows[i]->IsVisible() && windows[i]->layer() && - (!windows[i]->transparent() || - windows[i]->layer()->GetTargetOpacity() == 1.0)) { - wm::WindowState* window_state = wm::GetWindowState(windows[i]); + if (windows[i] && windows[i]->IsVisible() && windows[i]->GetLayer() && + (windows[i]->GetLayer()->fills_bounds_opaquely() || + windows[i]->GetLayer()->GetTargetOpacity() == 1.0)) { + wm::WindowState* window_state = windows[i]->GetWindowState(); // When any window is maximized we cannot find any free space. if (window_state->IsMaximizedOrFullscreen()) return gfx::Rect(0, 0, 0, 0); if (window_state->IsNormalOrSnapped()) - regions.push_back(&windows[i]->bounds()); + regions.push_back(&windows[i]->GetBounds()); } }
diff --git a/ash/wm/window_positioner.h b/ash/wm/window_positioner.h index ad66a7b4..a4da8df 100644 --- a/ash/wm/window_positioner.h +++ b/ash/wm/window_positioner.h
@@ -8,20 +8,17 @@ #include "ash/ash_export.h" #include "base/macros.h" #include "ui/base/ui_base_types.h" -#include "ui/gfx/geometry/rect.h" - -namespace aura { -class Window; -class RootWindow; -} namespace gfx { class Display; class Rect; -class Screen; } namespace ash { +namespace wm { +class WmGlobals; +class WmWindow; +} namespace test { class WindowPositionerTest; @@ -50,8 +47,7 @@ // |is_saved_bounds| indicates the |bounds_in_out| is the saved // bounds. static void GetBoundsAndShowStateForNewWindow( - const gfx::Screen* screen, - const aura::Window* new_window, + const wm::WmWindow* new_window, bool is_saved_bounds, ui::WindowShowState show_state_in, gfx::Rect* bounds_in_out, @@ -64,7 +60,7 @@ // automated desktop location management can be performed and // rearrange accordingly. static void RearrangeVisibleWindowOnHideOrRemove( - const aura::Window* removed_window); + const wm::WmWindow* removed_window); // Turn the automatic positioning logic temporarily off. Returns the previous // state. @@ -73,9 +69,9 @@ // Check if after insertion or showing of the given |added_window| // an automated desktop location management can be performed and // rearrange accordingly. - static void RearrangeVisibleWindowOnShow(aura::Window* added_window); + static void RearrangeVisibleWindowOnShow(wm::WmWindow* added_window); - WindowPositioner(); + explicit WindowPositioner(wm::WmGlobals* globals); ~WindowPositioner(); // Find a suitable screen position for a popup window and return it. The @@ -110,6 +106,8 @@ // Constant exposed for unittest. static const int kMinimumWindowOffset; + wm::WmGlobals* globals_; + // The offset in X and Y for the next popup which opens. int pop_position_offset_increment_x; int pop_position_offset_increment_y;
diff --git a/ash/wm/window_positioner_unittest.cc b/ash/wm/window_positioner_unittest.cc index 942cd30..705f0112 100644 --- a/ash/wm/window_positioner_unittest.cc +++ b/ash/wm/window_positioner_unittest.cc
@@ -180,8 +180,7 @@ delegate->SetForceMaximizeOnFirstRun(true); WindowPositioner::GetBoundsAndShowStateForNewWindow( - gfx::Screen::GetScreen(), nullptr, false, ui::SHOW_STATE_DEFAULT, - &bounds_in_out, &show_state_out); + nullptr, false, ui::SHOW_STATE_DEFAULT, &bounds_in_out, &show_state_out); EXPECT_EQ(show_state_out, ui::SHOW_STATE_MAXIMIZED); } @@ -200,8 +199,7 @@ delegate->SetForceMaximizeOnFirstRun(true); WindowPositioner::GetBoundsAndShowStateForNewWindow( - gfx::Screen::GetScreen(), nullptr, false, ui::SHOW_STATE_DEFAULT, - &bounds_in_out, &show_state_out); + nullptr, false, ui::SHOW_STATE_DEFAULT, &bounds_in_out, &show_state_out); EXPECT_EQ(show_state_out, ui::SHOW_STATE_MAXIMIZED); }
diff --git a/ash/wm/window_resizer.cc b/ash/wm/window_resizer.cc index f6ea1c0..c0f2ca59 100644 --- a/ash/wm/window_resizer.cc +++ b/ash/wm/window_resizer.cc
@@ -7,6 +7,7 @@ #include "ash/screen_util.h" #include "ash/shell.h" #include "ash/shell_window_ids.h" +#include "ash/wm/common/window_positioning_utils.h" #include "ash/wm/coordinate_conversion.h" #include "ash/wm/dock/docked_window_layout_manager.h" #include "ash/wm/window_state.h" @@ -151,22 +152,24 @@ work_area); if (details().size_change_direction & kBoundsChangeDirection_Horizontal) { if (IsRightEdge(details().window_component) && - new_bounds.right() < work_area.x() + kMinimumOnScreenArea) { - int delta = work_area.x() + kMinimumOnScreenArea - new_bounds.right(); + new_bounds.right() < work_area.x() + wm::kMinimumOnScreenArea) { + int delta = + work_area.x() + wm::kMinimumOnScreenArea - new_bounds.right(); new_bounds.set_width(new_bounds.width() + delta); - } else if (new_bounds.x() > work_area.right() - kMinimumOnScreenArea) { - int width = new_bounds.right() - work_area.right() + - kMinimumOnScreenArea; - new_bounds.set_x(work_area.right() - kMinimumOnScreenArea); + } else if (new_bounds.x() > + work_area.right() - wm::kMinimumOnScreenArea) { + int width = + new_bounds.right() - work_area.right() + wm::kMinimumOnScreenArea; + new_bounds.set_x(work_area.right() - wm::kMinimumOnScreenArea); new_bounds.set_width(width); } } if (details().size_change_direction & kBoundsChangeDirection_Vertical) { if (!IsBottomEdge(details().window_component) && - new_bounds.y() > work_area.bottom() - kMinimumOnScreenArea) { - int height = new_bounds.bottom() - work_area.bottom() + - kMinimumOnScreenArea; - new_bounds.set_y(work_area.bottom() - kMinimumOnScreenArea); + new_bounds.y() > work_area.bottom() - wm::kMinimumOnScreenArea) { + int height = + new_bounds.bottom() - work_area.bottom() + wm::kMinimumOnScreenArea; + new_bounds.set_y(work_area.bottom() - wm::kMinimumOnScreenArea); new_bounds.set_height(height); } else if (details().window_component == HTBOTTOM || details().window_component == HTBOTTOMRIGHT || @@ -218,7 +221,7 @@ gfx::Rect screen_work_area = display.work_area(); screen_work_area.Union(dock_layout->docked_bounds()); - screen_work_area.Inset(kMinimumOnScreenArea, 0); + screen_work_area.Inset(wm::kMinimumOnScreenArea, 0); gfx::Rect new_bounds_in_screen = ScreenUtil::ConvertRectToScreen(parent, new_bounds); if (!screen_work_area.Intersects(new_bounds_in_screen)) {
diff --git a/ash/wm/window_state.cc b/ash/wm/window_state.cc index 30ed753..149adbc 100644 --- a/ash/wm/window_state.cc +++ b/ash/wm/window_state.cc
@@ -10,6 +10,7 @@ #include "ash/root_window_controller.h" #include "ash/screen_util.h" #include "ash/shell_window_ids.h" +#include "ash/wm/common/window_positioning_utils.h" #include "ash/wm/common/wm_event.h" #include "ash/wm/common/wm_screen_util.h" #include "ash/wm/default_state.h"
diff --git a/ash/wm/window_util.cc b/ash/wm/window_util.cc index 7a29d24..c8e5f76 100644 --- a/ash/wm/window_util.cc +++ b/ash/wm/window_util.cc
@@ -34,25 +34,6 @@ namespace ash { namespace wm { -namespace { - -// Returns the default width of a snapped window. -int GetDefaultSnappedWindowWidth(wm::WmWindow* window) { - const float kSnappedWidthWorkspaceRatio = 0.5f; - - int work_area_width = GetDisplayWorkAreaBoundsInParent(window).width(); - int min_width = window->GetMinimumSize().width(); - int ideal_width = - static_cast<int>(work_area_width * kSnappedWidthWorkspaceRatio); - return std::min(work_area_width, std::max(ideal_width, min_width)); -} - -int GetDefaultSnappedWindowWidth(aura::Window* window) { - return GetDefaultSnappedWindowWidth(WmWindowAura::Get(window)); -} - -} // namespace - // TODO(beng): replace many of these functions with the corewm versions. void ActivateWindow(aura::Window* window) { ::wm::ActivateWindow(window); @@ -92,73 +73,6 @@ wm::GetWindowState(window)->OnWMEvent(&event); } -gfx::Rect GetDefaultLeftSnappedWindowBoundsInParent(wm::WmWindow* window) { - gfx::Rect work_area_in_parent(GetDisplayWorkAreaBoundsInParent(window)); - return gfx::Rect(work_area_in_parent.x(), work_area_in_parent.y(), - GetDefaultSnappedWindowWidth(window), - work_area_in_parent.height()); -} - -gfx::Rect GetDefaultRightSnappedWindowBoundsInParent(wm::WmWindow* window) { - gfx::Rect work_area_in_parent(GetDisplayWorkAreaBoundsInParent(window)); - int width = GetDefaultSnappedWindowWidth(window); - return gfx::Rect(work_area_in_parent.right() - width, work_area_in_parent.y(), - width, work_area_in_parent.height()); -} - -gfx::Rect GetDefaultLeftSnappedWindowBoundsInParent(aura::Window* window) { - gfx::Rect work_area_in_parent(ScreenUtil::GetDisplayWorkAreaBoundsInParent( - window)); - return gfx::Rect(work_area_in_parent.x(), - work_area_in_parent.y(), - GetDefaultSnappedWindowWidth(window), - work_area_in_parent.height()); -} - -gfx::Rect GetDefaultRightSnappedWindowBoundsInParent(aura::Window* window) { - gfx::Rect work_area_in_parent(ScreenUtil::GetDisplayWorkAreaBoundsInParent( - window)); - int width = GetDefaultSnappedWindowWidth(window); - return gfx::Rect(work_area_in_parent.right() - width, - work_area_in_parent.y(), - width, - work_area_in_parent.height()); -} - -void AdjustBoundsSmallerThan(const gfx::Size& max_size, gfx::Rect* bounds) { - bounds->set_width(std::min(bounds->width(), max_size.width())); - bounds->set_height(std::min(bounds->height(), max_size.height())); -} - -void AdjustBoundsToEnsureMinimumWindowVisibility(const gfx::Rect& visible_area, - gfx::Rect* bounds) { - AdjustBoundsToEnsureWindowVisibility( - visible_area, kMinimumOnScreenArea, kMinimumOnScreenArea, bounds); -} - -void AdjustBoundsToEnsureWindowVisibility(const gfx::Rect& visible_area, - int min_width, - int min_height, - gfx::Rect* bounds) { - AdjustBoundsSmallerThan(visible_area.size(), bounds); - - min_width = std::min(min_width, visible_area.width()); - min_height = std::min(min_height, visible_area.height()); - - if (bounds->right() < visible_area.x() + min_width) { - bounds->set_x(visible_area.x() + min_width - bounds->width()); - } else if (bounds->x() > visible_area.right() - min_width) { - bounds->set_x(visible_area.right() - min_width); - } - if (bounds->bottom() < visible_area.y() + min_height) { - bounds->set_y(visible_area.y() + min_height - bounds->height()); - } else if (bounds->y() > visible_area.bottom() - min_height) { - bounds->set_y(visible_area.bottom() - min_height); - } - if (bounds->y() < visible_area.y()) - bounds->set_y(visible_area.y()); -} - bool MoveWindowToEventRoot(aura::Window* window, const ui::Event& event) { views::View* target = static_cast<views::View*>(event.target()); if (!target) @@ -174,27 +88,6 @@ return true; } -void ReparentChildWithTransientChildren(aura::Window* child, - aura::Window* old_parent, - aura::Window* new_parent) { - if (child->parent() == old_parent) - new_parent->AddChild(child); - ReparentTransientChildrenOfChild(child, old_parent, new_parent); -} - -void ReparentTransientChildrenOfChild(aura::Window* child, - aura::Window* old_parent, - aura::Window* new_parent) { - for (size_t i = 0; - i < ::wm::GetTransientChildren(child).size(); - ++i) { - ReparentChildWithTransientChildren( - ::wm::GetTransientChildren(child)[i], - old_parent, - new_parent); - } -} - void SnapWindowToPixelBoundary(aura::Window* window) { aura::Window* snapped_ancestor = window->parent(); while (snapped_ancestor) {
diff --git a/ash/wm/window_util.h b/ash/wm/window_util.h index d8f861bf..a43f4a0 100644 --- a/ash/wm/window_util.h +++ b/ash/wm/window_util.h
@@ -24,9 +24,6 @@ } namespace ash { -// We force at least this many DIPs for any window on the screen. -const int kMinimumOnScreenArea = 25; - namespace wm { class WmWindow; @@ -54,59 +51,11 @@ // Moves the window to the center of the display. ASH_EXPORT void CenterWindow(aura::Window* window); -ASH_EXPORT gfx::Rect GetDefaultLeftSnappedWindowBoundsInParent( - wm::WmWindow* window); -ASH_EXPORT gfx::Rect GetDefaultRightSnappedWindowBoundsInParent( - wm::WmWindow* window); - -// Returns the bounds of a left snapped window with default width in parent -// coordinates. -ASH_EXPORT gfx::Rect GetDefaultLeftSnappedWindowBoundsInParent( - aura::Window* window); - -// Returns the bounds of a right snapped window with default width in parent -// coordinates. -ASH_EXPORT gfx::Rect GetDefaultRightSnappedWindowBoundsInParent( - aura::Window* window); - -// Adjusts |bounds| so that the size does not exceed |max_size|. -ASH_EXPORT void AdjustBoundsSmallerThan(const gfx::Size& max_size, - gfx::Rect* bounds); - -// Move the given bounds inside the given |visible_area| in parent coordinates, -// including a safety margin given by |kMinimumOnScreenArea|. -// This also ensures that the top of the bounds is visible. -ASH_EXPORT void AdjustBoundsToEnsureMinimumWindowVisibility( - const gfx::Rect& visible_area, - gfx::Rect* bounds); - -// Move the given bounds inside the given |visible_area| in parent coordinates, -// including a safety margin given by |min_width| and |min_height|. -// This also ensures that the top of the bounds is visible. -ASH_EXPORT void AdjustBoundsToEnsureWindowVisibility( - const gfx::Rect& visible_area, - int min_width, - int min_height, - gfx::Rect* bounds); - // Moves |window| to the root window where the |event| occured if it is not // already in the same root window. Returns true if |window| was moved. ASH_EXPORT bool MoveWindowToEventRoot(aura::Window* window, const ui::Event& event); -// Changes the parent of a |child| and all its transient children that are -// themselves children of |old_parent| to |new_parent|. -void ReparentChildWithTransientChildren(aura::Window* child, - aura::Window* old_parent, - aura::Window* new_parent); - -// Changes the parent of all transient children of a |child| to |new_parent|. -// Does not change parent of the transient children that are not themselves -// children of |old_parent|. -void ReparentTransientChildrenOfChild(aura::Window* child, - aura::Window* old_parent, - aura::Window* new_parent); - // Snap the window's layer to physical pixel boundary. void SnapWindowToPixelBoundary(aura::Window* window);
diff --git a/ash/wm/window_util_unittest.cc b/ash/wm/window_util_unittest.cc index 07bf22df..f4dc7ec 100644 --- a/ash/wm/window_util_unittest.cc +++ b/ash/wm/window_util_unittest.cc
@@ -6,6 +6,7 @@ #include "ash/screen_util.h" #include "ash/test/ash_test_base.h" +#include "ash/wm/common/window_positioning_utils.h" #include "ash/wm/window_state.h" #include "ash/wm/window_state_aura.h" #include "ui/aura/window.h"
diff --git a/ash/wm/workspace/workspace_layout_manager.cc b/ash/wm/workspace/workspace_layout_manager.cc index 873d685..3e4199c 100644 --- a/ash/wm/workspace/workspace_layout_manager.cc +++ b/ash/wm/workspace/workspace_layout_manager.cc
@@ -11,6 +11,7 @@ #include "ash/session/session_state_delegate.h" #include "ash/shell.h" #include "ash/wm/always_on_top_controller.h" +#include "ash/wm/aura/wm_window_aura.h" #include "ash/wm/common/wm_event.h" #include "ash/wm/common/workspace/workspace_layout_manager_delegate.h" #include "ash/wm/window_animations.h" @@ -86,7 +87,7 @@ UpdateFullscreenState(); if (backdrop_delegate_) backdrop_delegate_->OnWindowAddedToLayout(child); - WindowPositioner::RearrangeVisibleWindowOnShow(child); + WindowPositioner::RearrangeVisibleWindowOnShow(wm::WmWindowAura::Get(child)); } void WorkspaceLayoutManager::OnWillRemoveWindowFromLayout(Window* child) { @@ -94,8 +95,10 @@ child->RemoveObserver(this); wm::GetWindowState(child)->RemoveObserver(this); - if (child->TargetVisibility()) - WindowPositioner::RearrangeVisibleWindowOnHideOrRemove(child); + if (child->TargetVisibility()) { + WindowPositioner::RearrangeVisibleWindowOnHideOrRemove( + wm::WmWindowAura::Get(child)); + } } void WorkspaceLayoutManager::OnWindowRemovedFromLayout(Window* child) { @@ -112,10 +115,13 @@ if (visible && window_state->IsMinimized()) window_state->Unminimize(); - if (child->TargetVisibility()) - WindowPositioner::RearrangeVisibleWindowOnShow(child); - else - WindowPositioner::RearrangeVisibleWindowOnHideOrRemove(child); + if (child->TargetVisibility()) { + WindowPositioner::RearrangeVisibleWindowOnShow( + wm::WmWindowAura::Get(child)); + } else { + WindowPositioner::RearrangeVisibleWindowOnHideOrRemove( + wm::WmWindowAura::Get(child)); + } UpdateFullscreenState(); UpdateShelfVisibility(); if (backdrop_delegate_)
diff --git a/ash/wm/workspace/workspace_window_resizer.cc b/ash/wm/workspace/workspace_window_resizer.cc index ed20fb55..16151b8 100644 --- a/ash/wm/workspace/workspace_window_resizer.cc +++ b/ash/wm/workspace/workspace_window_resizer.cc
@@ -15,6 +15,7 @@ #include "ash/screen_util.h" #include "ash/shell.h" #include "ash/shell_window_ids.h" +#include "ash/wm/common/window_positioning_utils.h" #include "ash/wm/common/wm_event.h" #include "ash/wm/default_window_resizer.h" #include "ash/wm/dock/docked_window_layout_manager.h" @@ -966,9 +967,11 @@ phantom_bounds = ScreenUtil::ConvertRectFromScreen( GetTarget()->parent(), dock_layout_->dragged_bounds()); } else { - phantom_bounds = (snap_type_ == SNAP_LEFT) ? - wm::GetDefaultLeftSnappedWindowBoundsInParent(GetTarget()) : - wm::GetDefaultRightSnappedWindowBoundsInParent(GetTarget()); + phantom_bounds = (snap_type_ == SNAP_LEFT) + ? wm::GetDefaultLeftSnappedWindowBoundsInParent( + wm::WmWindowAura::Get(GetTarget())) + : wm::GetDefaultRightSnappedWindowBoundsInParent( + wm::WmWindowAura::Get(GetTarget())); } if (!snap_phantom_window_controller_) {
diff --git a/ash/wm/workspace/workspace_window_resizer_unittest.cc b/ash/wm/workspace/workspace_window_resizer_unittest.cc index 40e86a5f..aac414a 100644 --- a/ash/wm/workspace/workspace_window_resizer_unittest.cc +++ b/ash/wm/workspace/workspace_window_resizer_unittest.cc
@@ -12,6 +12,7 @@ #include "ash/shell_window_ids.h" #include "ash/test/ash_test_base.h" #include "ash/test/display_manager_test_api.h" +#include "ash/wm/common/window_positioning_utils.h" #include "ash/wm/common/wm_event.h" #include "ash/wm/window_state.h" #include "ash/wm/window_state_aura.h" @@ -565,7 +566,8 @@ { gfx::Rect expected_bounds_in_parent( - wm::GetDefaultLeftSnappedWindowBoundsInParent(window_.get())); + wm::GetDefaultLeftSnappedWindowBoundsInParent( + wm::WmWindowAura::Get(window_.get()))); std::unique_ptr<WindowResizer> resizer( CreateResizerForTest(window_.get(), gfx::Point(), HTCAPTION)); @@ -582,7 +584,8 @@ // Try the same with the right side. { gfx::Rect expected_bounds_in_parent( - wm::GetDefaultRightSnappedWindowBoundsInParent(window_.get())); + wm::GetDefaultRightSnappedWindowBoundsInParent( + wm::WmWindowAura::Get(window_.get()))); std::unique_ptr<WindowResizer> resizer( CreateResizerForTest(window_.get(), gfx::Point(), HTCAPTION)); @@ -916,8 +919,8 @@ ASSERT_TRUE(resizer.get()); resizer->Drag(CalculateDragPoint(*resizer, -window_width, 0), 0); EXPECT_EQ(base::IntToString(window_x) + ",100 " + - base::IntToString(kMinimumOnScreenArea - window_x) + - "x380", window_->bounds().ToString()); + base::IntToString(wm::kMinimumOnScreenArea - window_x) + "x380", + window_->bounds().ToString()); } TEST_F(WorkspaceWindowResizerTest, ResizeWindowOutsideRightWorkArea) { @@ -933,11 +936,11 @@ CreateResizerForTest(window_.get(), gfx::Point(window_x, 0), HTLEFT)); ASSERT_TRUE(resizer.get()); resizer->Drag(CalculateDragPoint(*resizer, window_width, 0), 0); - EXPECT_EQ(base::IntToString(right - kMinimumOnScreenArea) + - ",100 " + - base::IntToString(window_width - pixels_to_right_border + - kMinimumOnScreenArea) + - "x380", window_->bounds().ToString()); + EXPECT_EQ(base::IntToString(right - wm::kMinimumOnScreenArea) + ",100 " + + base::IntToString(window_width - pixels_to_right_border + + wm::kMinimumOnScreenArea) + + "x380", + window_->bounds().ToString()); } TEST_F(WorkspaceWindowResizerTest, ResizeWindowOutsideBottomWorkArea) { @@ -952,11 +955,10 @@ window_.get(), gfx::Point(0, bottom - delta_to_bottom), HTTOP)); ASSERT_TRUE(resizer.get()); resizer->Drag(CalculateDragPoint(*resizer, 0, bottom), 0); - EXPECT_EQ("100," + - base::IntToString(bottom - kMinimumOnScreenArea) + - " 300x" + - base::IntToString(height - (delta_to_bottom - - kMinimumOnScreenArea)), + EXPECT_EQ("100," + base::IntToString(bottom - wm::kMinimumOnScreenArea) + + " 300x" + + base::IntToString(height - + (delta_to_bottom - wm::kMinimumOnScreenArea)), window_->bounds().ToString()); } @@ -977,10 +979,9 @@ CreateResizerForTest(window_.get(), gfx::Point(window_x, 0), HTCAPTION)); ASSERT_TRUE(resizer.get()); resizer->Drag(CalculateDragPoint(*resizer, window_width, 0), 0); - EXPECT_EQ(base::IntToString(right - kMinimumOnScreenArea) + - ",100 " + - base::IntToString(window_width) + - "x380", window_->bounds().ToString()); + EXPECT_EQ(base::IntToString(right - wm::kMinimumOnScreenArea) + ",100 " + + base::IntToString(window_width) + "x380", + window_->bounds().ToString()); if (!SupportsMultipleDisplays()) return;
diff --git a/ash/wm/workspace_controller.cc b/ash/wm/workspace_controller.cc index 76a9c596..7f8fc58 100644 --- a/ash/wm/workspace_controller.cc +++ b/ash/wm/workspace_controller.cc
@@ -62,14 +62,14 @@ viewport_->RemovePreTargetHandler(event_handler_.get()); } -WorkspaceWindowState WorkspaceController::GetWindowState() const { +wm::WorkspaceWindowState WorkspaceController::GetWindowState() const { if (!shelf_) - return WORKSPACE_WINDOW_STATE_DEFAULT; + return wm::WORKSPACE_WINDOW_STATE_DEFAULT; const aura::Window* topmost_fullscreen_window = GetRootWindowController( viewport_->GetRootWindow())->GetWindowForFullscreenMode(); if (topmost_fullscreen_window && !wm::GetWindowState(topmost_fullscreen_window)->ignored_by_shelf()) { - return WORKSPACE_WINDOW_STATE_FULL_SCREEN; + return wm::WORKSPACE_WINDOW_STATE_FULL_SCREEN; } // These are the container ids of containers which may contain windows that @@ -91,7 +91,7 @@ if (!layer->GetTargetVisibility()) continue; if (window_state->IsMaximized()) - return WORKSPACE_WINDOW_STATE_MAXIMIZED; + return wm::WORKSPACE_WINDOW_STATE_MAXIMIZED; if (!window_overlaps_launcher && ((*i)->bounds().Intersects(shelf_bounds))) { window_overlaps_launcher = true; @@ -99,9 +99,9 @@ } } - return (window_overlaps_launcher || IsDockedAreaVisible(shelf_)) ? - WORKSPACE_WINDOW_STATE_WINDOW_OVERLAPS_SHELF : - WORKSPACE_WINDOW_STATE_DEFAULT; + return (window_overlaps_launcher || IsDockedAreaVisible(shelf_)) + ? wm::WORKSPACE_WINDOW_STATE_WINDOW_OVERLAPS_SHELF + : wm::WORKSPACE_WINDOW_STATE_DEFAULT; } void WorkspaceController::SetShelf(ShelfLayoutManager* shelf) {
diff --git a/ash/wm/workspace_controller.h b/ash/wm/workspace_controller.h index e34e111..92045828 100644 --- a/ash/wm/workspace_controller.h +++ b/ash/wm/workspace_controller.h
@@ -8,7 +8,7 @@ #include <memory> #include "ash/ash_export.h" -#include "ash/wm/workspace/workspace_types.h" +#include "ash/wm/common/workspace/workspace_types.h" #include "base/macros.h" namespace aura { @@ -36,7 +36,7 @@ virtual ~WorkspaceController(); // Returns the current window state. - WorkspaceWindowState GetWindowState() const; + wm::WorkspaceWindowState GetWindowState() const; void SetShelf(ShelfLayoutManager* shelf);
diff --git a/base/BUILD.gn b/base/BUILD.gn index 9d53e79..bb35c9c0 100644 --- a/base/BUILD.gn +++ b/base/BUILD.gn
@@ -559,6 +559,7 @@ "numerics/safe_math_impl.h", "observer_list.h", "observer_list_threadsafe.h", + "optional.h", "os_compat_android.cc", "os_compat_android.h", "os_compat_nacl.cc", @@ -760,6 +761,8 @@ "task_runner.cc", "task_runner.h", "task_runner_util.h", + "task_scheduler/delayed_task_manager.cc", + "task_scheduler/delayed_task_manager.h", "task_scheduler/priority_queue.cc", "task_scheduler/priority_queue.h", "task_scheduler/scheduler_lock.h", @@ -1636,7 +1639,27 @@ bundle_data("base_unittests_bundle_data") { testonly = true sources = [ - "test/data", + "test/data/file_util/binary_file.bin", + "test/data/file_util/binary_file_diff.bin", + "test/data/file_util/binary_file_same.bin", + "test/data/file_util/blank_line.txt", + "test/data/file_util/blank_line_crlf.txt", + "test/data/file_util/crlf.txt", + "test/data/file_util/different.txt", + "test/data/file_util/different_first.txt", + "test/data/file_util/different_last.txt", + "test/data/file_util/empty1.txt", + "test/data/file_util/empty2.txt", + "test/data/file_util/first1.txt", + "test/data/file_util/first2.txt", + "test/data/file_util/original.txt", + "test/data/file_util/same.txt", + "test/data/file_util/same_length.txt", + "test/data/file_util/shortened.txt", + "test/data/json/bom_feff.json", + "test/data/serializer_nested_test.json", + "test/data/serializer_test.json", + "test/data/serializer_test_nowhitespace.json", ] outputs = [ "{{bundle_resources_dir}}/" + @@ -1772,6 +1795,7 @@ "native_library_unittest.cc", "numerics/safe_numerics_unittest.cc", "observer_list_unittest.cc", + "optional_unittest.cc", "os_compat_android_unittest.cc", "path_service_unittest.cc", "pickle_unittest.cc", @@ -1821,6 +1845,7 @@ "system_monitor/system_monitor_unittest.cc", "task/cancelable_task_tracker_unittest.cc", "task_runner_util_unittest.cc", + "task_scheduler/delayed_task_manager_unittest.cc", "task_scheduler/priority_queue_unittest.cc", "task_scheduler/scheduler_lock_unittest.cc", "task_scheduler/scheduler_thread_pool_unittest.cc",
diff --git a/base/android/build_info.cc b/base/android/build_info.cc index 5fa6c6c..351a0a8 100644 --- a/base/android/build_info.cc +++ b/base/android/build_info.cc
@@ -18,13 +18,6 @@ // We are leaking these strings. const char* StrDupJString(const base::android::JavaRef<jstring>& java_string) { - // Some of the Java methods on BuildInfo can return null - // (https://crbug.com/601081), which can't be represented as a std::string, so - // use an empty string instead. - // TODO(bauerb): Do this only for methods that can legitimately return null. - if (java_string.is_null()) - return ""; - std::string str = ConvertJavaStringToUTF8(java_string); return strdup(str.c_str()); }
diff --git a/base/android/java/src/org/chromium/base/BuildInfo.java b/base/android/java/src/org/chromium/base/BuildInfo.java index 3922154..012f305f 100644 --- a/base/android/java/src/org/chromium/base/BuildInfo.java +++ b/base/android/java/src/org/chromium/base/BuildInfo.java
@@ -90,7 +90,10 @@ try { PackageManager pm = context.getPackageManager(); PackageInfo pi = pm.getPackageInfo(context.getPackageName(), 0); - msg = pi.versionName; + msg = ""; + if (pi.versionName != null) { + msg = pi.versionName; + } } catch (NameNotFoundException e) { Log.d(TAG, msg); }
diff --git a/base/base.gyp b/base/base.gyp index 7441722..2c72435 100644 --- a/base/base.gyp +++ b/base/base.gyp
@@ -496,6 +496,7 @@ 'native_library_unittest.cc', 'numerics/safe_numerics_unittest.cc', 'observer_list_unittest.cc', + 'optional_unittest.cc', 'os_compat_android_unittest.cc', 'path_service_unittest.cc', 'pickle_unittest.cc', @@ -545,6 +546,7 @@ 'system_monitor/system_monitor_unittest.cc', 'task/cancelable_task_tracker_unittest.cc', 'task_runner_util_unittest.cc', + 'task_scheduler/delayed_task_manager_unittest.cc', 'task_scheduler/priority_queue_unittest.cc', 'task_scheduler/scheduler_lock_unittest.cc', 'task_scheduler/scheduler_thread_pool_unittest.cc',
diff --git a/base/base.gypi b/base/base.gypi index a01db57..b105fc86 100644 --- a/base/base.gypi +++ b/base/base.gypi
@@ -446,6 +446,7 @@ 'numerics/safe_math_impl.h', 'observer_list.h', 'observer_list_threadsafe.h', + 'optional.h', 'os_compat_android.cc', 'os_compat_android.h', 'os_compat_nacl.cc', @@ -637,6 +638,8 @@ 'task_runner.cc', 'task_runner.h', 'task_runner_util.h', + 'task_scheduler/delayed_task_manager.cc', + 'task_scheduler/delayed_task_manager.h', 'task_scheduler/priority_queue.cc', 'task_scheduler/priority_queue.h', 'task_scheduler/scheduler_lock.h',
diff --git a/base/memory/ref_counted.h b/base/memory/ref_counted.h index e7395148..0c0e0afd7 100644 --- a/base/memory/ref_counted.h +++ b/base/memory/ref_counted.h
@@ -7,6 +7,7 @@ #include <cassert> #include <iosfwd> +#include <type_traits> #include "base/atomic_ref_count.h" #include "base/base_export.h" @@ -283,7 +284,9 @@ } // Copy conversion constructor. - template <typename U> + template <typename U, + typename = typename std::enable_if< + std::is_convertible<U*, T*>::value>::type> scoped_refptr(const scoped_refptr<U>& r) : ptr_(r.get()) { if (ptr_) AddRef(ptr_); @@ -294,7 +297,9 @@ scoped_refptr(scoped_refptr&& r) : ptr_(r.get()) { r.ptr_ = nullptr; } // Move conversion constructor. - template <typename U> + template <typename U, + typename = typename std::enable_if< + std::is_convertible<U*, T*>::value>::type> scoped_refptr(scoped_refptr<U>&& r) : ptr_(r.get()) { r.ptr_ = nullptr; }
diff --git a/base/memory/ref_counted_unittest.cc b/base/memory/ref_counted_unittest.cc index 3f56b4a..54f62cf 100644 --- a/base/memory/ref_counted_unittest.cc +++ b/base/memory/ref_counted_unittest.cc
@@ -105,6 +105,22 @@ int ScopedRefPtrCountDerived::constructor_count_ = 0; int ScopedRefPtrCountDerived::destructor_count_ = 0; +class Other : public base::RefCounted<Other> { + private: + friend class base::RefCounted<Other>; + + ~Other() {} +}; + +scoped_refptr<Other> Overloaded(scoped_refptr<Other> other) { + return other; +} + +scoped_refptr<SelfAssign> Overloaded(scoped_refptr<SelfAssign> self_assign) { + return self_assign; +} + + } // end namespace TEST(RefCountedUnitTest, TestSelfAssignment) { @@ -461,3 +477,21 @@ EXPECT_EQ(1, ScopedRefPtrCountDerived::destructor_count()); } +TEST(RefCountedUnitTest, TestOverloadResolutionCopy) { + scoped_refptr<Derived> derived(new Derived); + scoped_refptr<SelfAssign> expected(derived); + EXPECT_EQ(expected, Overloaded(derived)); + + scoped_refptr<Other> other(new Other); + EXPECT_EQ(other, Overloaded(other)); +} + +TEST(RefCountedUnitTest, TestOverloadResolutionMove) { + scoped_refptr<Derived> derived(new Derived); + scoped_refptr<SelfAssign> expected(derived); + EXPECT_EQ(expected, Overloaded(std::move(derived))); + + scoped_refptr<Other> other(new Other); + scoped_refptr<Other> other2(other); + EXPECT_EQ(other2, Overloaded(std::move(other))); +}
diff --git a/base/metrics/sparse_histogram.h b/base/metrics/sparse_histogram.h index da373a2..c072371 100644 --- a/base/metrics/sparse_histogram.h +++ b/base/metrics/sparse_histogram.h
@@ -59,7 +59,8 @@ // new one. static HistogramBase* FactoryGet(const std::string& name, int32_t flags); - // Create a histogram using data in persistent storage. + // Create a histogram using data in persistent storage. The allocator must + // live longer than the created sparse histogram. static std::unique_ptr<HistogramBase> PersistentCreate( PersistentHistogramAllocator* allocator, const std::string& name,
diff --git a/base/metrics/statistics_recorder.cc b/base/metrics/statistics_recorder.cc index f0bb914..4eecddad 100644 --- a/base/metrics/statistics_recorder.cc +++ b/base/metrics/statistics_recorder.cc
@@ -315,13 +315,25 @@ // static StatisticsRecorder::HistogramIterator StatisticsRecorder::begin( bool include_persistent) { + DCHECK(histograms_); ImportGlobalPersistentHistograms(); - return HistogramIterator(histograms_->begin(), include_persistent); + + HistogramMap::iterator iter_begin; + { + base::AutoLock auto_lock(*lock_); + iter_begin = histograms_->begin(); + } + return HistogramIterator(iter_begin, include_persistent); } // static StatisticsRecorder::HistogramIterator StatisticsRecorder::end() { - return HistogramIterator(histograms_->end(), true); + HistogramMap::iterator iter_end; + { + base::AutoLock auto_lock(*lock_); + iter_end = histograms_->end(); + } + return HistogramIterator(iter_end, true); } // static
diff --git a/base/optional.h b/base/optional.h new file mode 100644 index 0000000..5ae427f --- /dev/null +++ b/base/optional.h
@@ -0,0 +1,427 @@ +// 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 BASE_OPTIONAL_H_ +#define BASE_OPTIONAL_H_ + +#include <type_traits> + +#include "base/logging.h" +#include "base/memory/aligned_memory.h" + +namespace base { + +// Specification: +// http://en.cppreference.com/w/cpp/utility/optional/in_place_t +struct in_place_t {}; + +// Specification: +// http://en.cppreference.com/w/cpp/utility/optional/nullopt_t +struct nullopt_t { + constexpr explicit nullopt_t(int) {} +}; + +// Specification: +// http://en.cppreference.com/w/cpp/utility/optional/in_place +constexpr in_place_t in_place = {}; + +// Specification: +// http://en.cppreference.com/w/cpp/utility/optional/nullopt +constexpr nullopt_t nullopt(0); + +// base::Optional is a Chromium version of the C++17 optional class: +// std::optional documentation: +// http://en.cppreference.com/w/cpp/utility/optional +// Chromium documentation: +// https://chromium.googlesource.com/chromium/src/+/master/docs/optional.md +// +// These are the differences between the specification and the implementation: +// - The constructor and emplace method using initializer_list are not +// implemented because 'initializer_list' is banned from Chromium. +// - Constructors do not use 'constexpr' as it is a C++14 extension. +// - 'constexpr' might be missing in some places for reasons specified locally. +// - No exceptions are thrown, because they are banned from Chromium. +// - All the non-members are in the 'base' namespace instead of 'std'. +template <typename T> +class Optional { + public: + constexpr Optional() = default; + Optional(base::nullopt_t) : Optional() {} + + Optional(const Optional& other) { + if (!other.is_null_) + Init(other.value()); + } + + Optional(Optional&& other) { + if (!other.is_null_) + Init(std::move(other.value())); + } + + Optional(const T& value) { Init(value); } + + Optional(T&& value) { Init(std::move(value)); } + + template <class... Args> + explicit Optional(base::in_place_t, Args&&... args) { + emplace(std::forward<Args>(args)...); + } + + ~Optional() { + // TODO(mlamouri): use is_trivially_destructible<T>::value when possible. + FreeIfNeeded(); + } + + Optional& operator=(base::nullopt_t) { + FreeIfNeeded(); + return *this; + } + + Optional& operator=(const Optional& other) { + if (other.is_null_) { + FreeIfNeeded(); + return *this; + } + + InitOrAssign(other.value()); + return *this; + } + + Optional& operator=(Optional&& other) { + if (other.is_null_) { + FreeIfNeeded(); + return *this; + } + + InitOrAssign(std::move(other.value())); + return *this; + } + + template <class U> + typename std::enable_if<std::is_same<std::decay<U>, T>::value, + Optional&>::type + operator=(U&& value) { + InitOrAssign(std::forward<U>(value)); + return *this; + } + + // TODO(mlamouri): can't use 'constexpr' with DCHECK. + const T* operator->() const { + DCHECK(!is_null_); + return &value(); + } + + // TODO(mlamouri): using 'constexpr' here breaks compiler that assume it was + // meant to be 'constexpr const'. + T* operator->() { + DCHECK(!is_null_); + return &value(); + } + + constexpr const T& operator*() const& { return value(); } + + // TODO(mlamouri): using 'constexpr' here breaks compiler that assume it was + // meant to be 'constexpr const'. + T& operator*() & { return value(); } + + constexpr const T&& operator*() const&& { return std::move(value()); } + + // TODO(mlamouri): using 'constexpr' here breaks compiler that assume it was + // meant to be 'constexpr const'. + T&& operator*() && { return std::move(value()); } + + constexpr explicit operator bool() const { return !is_null_; } + + // TODO(mlamouri): using 'constexpr' here breaks compiler that assume it was + // meant to be 'constexpr const'. + T& value() & { + DCHECK(!is_null_); + return *buffer_.template data_as<T>(); + } + + // TODO(mlamouri): can't use 'constexpr' with DCHECK. + const T& value() const& { + DCHECK(!is_null_); + return *buffer_.template data_as<T>(); + } + + // TODO(mlamouri): using 'constexpr' here breaks compiler that assume it was + // meant to be 'constexpr const'. + T&& value() && { + DCHECK(!is_null_); + return std::move(*buffer_.template data_as<T>()); + } + + // TODO(mlamouri): can't use 'constexpr' with DCHECK. + const T&& value() const&& { + DCHECK(!is_null_); + return std::move(*buffer_.template data_as<T>()); + } + + template <class U> + constexpr T value_or(U&& default_value) const& { + // TODO(mlamouri): add the following assert when possible: + // static_assert(std::is_copy_constructible<T>::value, + // "T must be copy constructible"); + static_assert(std::is_convertible<U, T>::value, + "U must be convertible to T"); + return is_null_ ? static_cast<T>(std::forward<U>(default_value)) : value(); + } + + template <class U> + T value_or(U&& default_value) && { + // TODO(mlamouri): add the following assert when possible: + // static_assert(std::is_move_constructible<T>::value, + // "T must be move constructible"); + static_assert(std::is_convertible<U, T>::value, + "U must be convertible to T"); + return is_null_ ? static_cast<T>(std::forward<U>(default_value)) + : std::move(value()); + } + + void swap(Optional& other) { + if (is_null_ && other.is_null_) + return; + + if (is_null_ != other.is_null_) { + if (is_null_) { + Init(std::move(*other.buffer_.template data_as<T>())); + other.FreeIfNeeded(); + } else { + other.Init(std::move(*buffer_.template data_as<T>())); + FreeIfNeeded(); + } + return; + } + + DCHECK(!is_null_ && !other.is_null_); + using std::swap; + swap(**this, *other); + } + + template <class... Args> + void emplace(Args&&... args) { + FreeIfNeeded(); + Init(std::forward<Args>(args)...); + } + + private: + void Init(const T& value) { + DCHECK(is_null_); + new (buffer_.template data_as<T>()) T(value); + is_null_ = false; + } + + void Init(T&& value) { + DCHECK(is_null_); + new (buffer_.template data_as<T>()) T(std::move(value)); + is_null_ = false; + } + + template <class... Args> + void Init(Args&&... args) { + DCHECK(is_null_); + new (buffer_.template data_as<T>()) T(std::forward<Args>(args)...); + is_null_ = false; + } + + void InitOrAssign(const T& value) { + if (is_null_) + Init(value); + else + *buffer_.template data_as<T>() = value; + } + + void InitOrAssign(T&& value) { + if (is_null_) + Init(std::move(value)); + else + *buffer_.template data_as<T>() = std::move(value); + } + + void FreeIfNeeded() { + if (is_null_) + return; + buffer_.template data_as<T>()->~T(); + is_null_ = true; + } + + bool is_null_ = true; + base::AlignedMemory<sizeof(T), ALIGNOF(T)> buffer_; +}; + +template <class T> +constexpr bool operator==(const Optional<T>& lhs, const Optional<T>& rhs) { + return !!lhs != !!rhs ? false : lhs == nullopt || (*lhs == *rhs); +} + +template <class T> +constexpr bool operator!=(const Optional<T>& lhs, const Optional<T>& rhs) { + return !(lhs == rhs); +} + +template <class T> +constexpr bool operator<(const Optional<T>& lhs, const Optional<T>& rhs) { + return rhs == nullopt ? false : (lhs == nullopt ? true : *lhs < *rhs); +} + +template <class T> +constexpr bool operator<=(const Optional<T>& lhs, const Optional<T>& rhs) { + return !(rhs < lhs); +} + +template <class T> +constexpr bool operator>(const Optional<T>& lhs, const Optional<T>& rhs) { + return rhs < lhs; +} + +template <class T> +constexpr bool operator>=(const Optional<T>& lhs, const Optional<T>& rhs) { + return !(lhs < rhs); +} + +template <class T> +constexpr bool operator==(const Optional<T>& opt, base::nullopt_t) { + return !opt; +} + +template <class T> +constexpr bool operator==(base::nullopt_t, const Optional<T>& opt) { + return !opt; +} + +template <class T> +constexpr bool operator!=(const Optional<T>& opt, base::nullopt_t) { + return !!opt; +} + +template <class T> +constexpr bool operator!=(base::nullopt_t, const Optional<T>& opt) { + return !!opt; +} + +template <class T> +constexpr bool operator<(const Optional<T>& opt, base::nullopt_t) { + return false; +} + +template <class T> +constexpr bool operator<(base::nullopt_t, const Optional<T>& opt) { + return !!opt; +} + +template <class T> +constexpr bool operator<=(const Optional<T>& opt, base::nullopt_t) { + return !opt; +} + +template <class T> +constexpr bool operator<=(base::nullopt_t, const Optional<T>& opt) { + return true; +} + +template <class T> +constexpr bool operator>(const Optional<T>& opt, base::nullopt_t) { + return !!opt; +} + +template <class T> +constexpr bool operator>(base::nullopt_t, const Optional<T>& opt) { + return false; +} + +template <class T> +constexpr bool operator>=(const Optional<T>& opt, base::nullopt_t) { + return true; +} + +template <class T> +constexpr bool operator>=(base::nullopt_t, const Optional<T>& opt) { + return !opt; +} + +template <class T> +constexpr bool operator==(const Optional<T>& opt, const T& value) { + return opt != nullopt ? *opt == value : false; +} + +template <class T> +constexpr bool operator==(const T& value, const Optional<T>& opt) { + return opt == value; +} + +template <class T> +constexpr bool operator!=(const Optional<T>& opt, const T& value) { + return !(opt == value); +} + +template <class T> +constexpr bool operator!=(const T& value, const Optional<T>& opt) { + return !(opt == value); +} + +template <class T> +constexpr bool operator<(const Optional<T>& opt, const T& value) { + return opt != nullopt ? *opt < value : true; +} + +template <class T> +constexpr bool operator<(const T& value, const Optional<T>& opt) { + return opt != nullopt ? value < *opt : false; +} + +template <class T> +constexpr bool operator<=(const Optional<T>& opt, const T& value) { + return !(opt > value); +} + +template <class T> +constexpr bool operator<=(const T& value, const Optional<T>& opt) { + return !(value > opt); +} + +template <class T> +constexpr bool operator>(const Optional<T>& opt, const T& value) { + return value < opt; +} + +template <class T> +constexpr bool operator>(const T& value, const Optional<T>& opt) { + return opt < value; +} + +template <class T> +constexpr bool operator>=(const Optional<T>& opt, const T& value) { + return !(opt < value); +} + +template <class T> +constexpr bool operator>=(const T& value, const Optional<T>& opt) { + return !(value < opt); +} + +template <class T> +constexpr Optional<typename std::decay<T>::type> make_optional(T&& value) { + return Optional<typename std::decay<T>::type>(std::forward<T>(value)); +} + +template <class T> +void swap(Optional<T>& lhs, Optional<T>& rhs) { + lhs.swap(rhs); +} + +} // namespace base + +namespace std { + +template <class T> +struct hash<base::Optional<T>> { + size_t operator()(const base::Optional<T>& opt) const { + return opt == base::nullopt ? 0 : std::hash<T>()(*opt); + } +}; + +} // namespace std + +#endif // BASE_OPTIONAL_H_
diff --git a/base/optional_unittest.cc b/base/optional_unittest.cc new file mode 100644 index 0000000..812acf2d --- /dev/null +++ b/base/optional_unittest.cc
@@ -0,0 +1,1224 @@ +// 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 "base/optional.h" + +#include <set> + +#include "testing/gtest/include/gtest/gtest.h" + +namespace base { + +namespace { + +// Object used to test complex object with Optional<T> in addition of the move +// semantics. +class TestObject { + public: + enum class State { + DEFAULT_CONSTRUCTED, + VALUE_CONSTRUCTED, + COPY_CONSTRUCTED, + MOVE_CONSTRUCTED, + MOVED_FROM, + }; + + TestObject() : foo_(0), bar_(0.0), state_(State::DEFAULT_CONSTRUCTED) {} + + TestObject(int foo, double bar) + : foo_(foo), bar_(bar), state_(State::VALUE_CONSTRUCTED) {} + + TestObject(const TestObject& other) + : foo_(other.foo_), bar_(other.bar_), state_(State::COPY_CONSTRUCTED) {} + + TestObject(TestObject&& other) + : foo_(std::move(other.foo_)), + bar_(std::move(other.bar_)), + state_(State::MOVE_CONSTRUCTED) { + other.state_ = State::MOVED_FROM; + } + + TestObject& operator=(const TestObject& other) { + foo_ = other.foo_; + bar_ = other.bar_; + state_ = State::COPY_CONSTRUCTED; + return *this; + } + + bool operator==(const TestObject& other) const { + return foo_ == other.foo_ && bar_ == other.bar_; + } + + int foo() const { return foo_; } + State state() const { return state_; } + + private: + int foo_; + double bar_; + State state_; +}; + +} // anonymous namespace + +TEST(OptionalTest, DefaultConstructor) { + { + Optional<float> o; + EXPECT_FALSE(o); + } + + { + Optional<std::string> o; + EXPECT_FALSE(o); + } + + { + Optional<TestObject> o; + EXPECT_FALSE(o); + } +} + +TEST(OptionalTest, CopyConstructor) { + { + Optional<float> first(0.1f); + Optional<float> other(first); + + EXPECT_TRUE(other); + EXPECT_EQ(other.value(), 0.1f); + EXPECT_EQ(first, other); + } + + { + Optional<std::string> first("foo"); + Optional<std::string> other(first); + + EXPECT_TRUE(other); + EXPECT_EQ(other.value(), "foo"); + EXPECT_EQ(first, other); + } + + { + Optional<TestObject> first(TestObject(3, 0.1)); + Optional<TestObject> other(first); + + EXPECT_TRUE(!!other); + EXPECT_TRUE(other.value() == TestObject(3, 0.1)); + EXPECT_TRUE(first == other); + } +} + +TEST(OptionalTest, ValueConstructor) { + { + Optional<float> o(0.1f); + EXPECT_TRUE(o); + EXPECT_EQ(o.value(), 0.1f); + } + + { + Optional<std::string> o("foo"); + EXPECT_TRUE(o); + EXPECT_EQ(o.value(), "foo"); + } + + { + Optional<TestObject> o(TestObject(3, 0.1)); + EXPECT_TRUE(!!o); + EXPECT_TRUE(o.value() == TestObject(3, 0.1)); + } +} + +TEST(OptionalTest, MoveConstructor) { + { + Optional<float> first(0.1f); + Optional<float> second(std::move(first)); + + EXPECT_TRUE(second); + EXPECT_EQ(second.value(), 0.1f); + + EXPECT_TRUE(first); + } + + { + Optional<std::string> first("foo"); + Optional<std::string> second(std::move(first)); + + EXPECT_TRUE(second); + EXPECT_EQ("foo", second.value()); + + EXPECT_TRUE(first); + } + + { + Optional<TestObject> first(TestObject(3, 0.1)); + Optional<TestObject> second(std::move(first)); + + EXPECT_TRUE(!!second); + EXPECT_EQ(TestObject::State::MOVE_CONSTRUCTED, second->state()); + EXPECT_TRUE(TestObject(3, 0.1) == second.value()); + + EXPECT_TRUE(!!first); + EXPECT_EQ(TestObject::State::MOVED_FROM, first->state()); + } +} + +TEST(OptionalTest, MoveValueConstructor) { + { + Optional<float> first(0.1f); + Optional<float> second(std::move(first.value())); + + EXPECT_TRUE(second); + EXPECT_EQ(second.value(), 0.1f); + + EXPECT_TRUE(first); + } + + { + Optional<std::string> first("foo"); + Optional<std::string> second(std::move(first.value())); + + EXPECT_TRUE(second); + EXPECT_EQ("foo", second.value()); + + EXPECT_TRUE(first); + } + + { + Optional<TestObject> first(TestObject(3, 0.1)); + Optional<TestObject> second(std::move(first.value())); + + EXPECT_TRUE(!!second); + EXPECT_EQ(TestObject::State::MOVE_CONSTRUCTED, second->state()); + EXPECT_TRUE(TestObject(3, 0.1) == second.value()); + + EXPECT_TRUE(!!first); + EXPECT_EQ(TestObject::State::MOVED_FROM, first->state()); + } +} + +TEST(OptionalTest, ConstructorForwardArguments) { + { + Optional<float> a(base::in_place, 0.1f); + EXPECT_TRUE(a); + EXPECT_EQ(0.1f, a.value()); + } + + { + Optional<std::string> a(base::in_place, "foo"); + EXPECT_TRUE(a); + EXPECT_EQ("foo", a.value()); + } + + { + Optional<TestObject> a(base::in_place, 0, 0.1); + EXPECT_TRUE(!!a); + EXPECT_TRUE(TestObject(0, 0.1) == a.value()); + } +} + +TEST(OptionalTest, AssignValue) { + { + Optional<float> a; + EXPECT_FALSE(a); + a = 0.1f; + EXPECT_TRUE(a); + + Optional<float> b(0.1f); + EXPECT_TRUE(a == b); + } + + { + Optional<std::string> a; + EXPECT_FALSE(a); + a = std::string("foo"); + EXPECT_TRUE(a); + + Optional<std::string> b(std::string("foo")); + EXPECT_EQ(a, b); + } + + { + Optional<TestObject> a; + EXPECT_FALSE(!!a); + a = TestObject(3, 0.1); + EXPECT_TRUE(!!a); + + Optional<TestObject> b(TestObject(3, 0.1)); + EXPECT_TRUE(a == b); + } +} + +TEST(OptionalTest, AssignObject) { + { + Optional<float> a; + Optional<float> b(0.1f); + a = b; + + EXPECT_TRUE(a); + EXPECT_EQ(a.value(), 0.1f); + EXPECT_EQ(a, b); + } + + { + Optional<std::string> a; + Optional<std::string> b("foo"); + a = b; + + EXPECT_TRUE(a); + EXPECT_EQ(a.value(), "foo"); + EXPECT_EQ(a, b); + } + + { + Optional<TestObject> a; + Optional<TestObject> b(TestObject(3, 0.1)); + a = b; + + EXPECT_TRUE(!!a); + EXPECT_TRUE(a.value() == TestObject(3, 0.1)); + EXPECT_TRUE(a == b); + } +} + +TEST(OptionalTest, AssignObject_rvalue) { + { + Optional<float> a; + Optional<float> b(0.1f); + a = std::move(b); + + EXPECT_TRUE(a); + EXPECT_TRUE(b); + EXPECT_EQ(0.1f, a.value()); + } + + { + Optional<std::string> a; + Optional<std::string> b("foo"); + a = std::move(b); + + EXPECT_TRUE(a); + EXPECT_TRUE(b); + EXPECT_EQ("foo", a.value()); + } + + { + Optional<TestObject> a; + Optional<TestObject> b(TestObject(3, 0.1)); + a = std::move(b); + + EXPECT_TRUE(!!a); + EXPECT_TRUE(!!b); + EXPECT_TRUE(TestObject(3, 0.1) == a.value()); + + EXPECT_EQ(TestObject::State::MOVE_CONSTRUCTED, a->state()); + EXPECT_EQ(TestObject::State::MOVED_FROM, b->state()); + } +} + +TEST(OptionalTest, AssignNull) { + { + Optional<float> a(0.1f); + Optional<float> b(0.2f); + a = base::nullopt; + b = base::nullopt; + EXPECT_EQ(a, b); + } + + { + Optional<std::string> a("foo"); + Optional<std::string> b("bar"); + a = base::nullopt; + b = base::nullopt; + EXPECT_EQ(a, b); + } + + { + Optional<TestObject> a(TestObject(3, 0.1)); + Optional<TestObject> b(TestObject(4, 1.0)); + a = base::nullopt; + b = base::nullopt; + EXPECT_TRUE(a == b); + } +} + +TEST(OptionalTest, OperatorStar) { + { + Optional<float> a(0.1f); + EXPECT_EQ(a.value(), *a); + } + + { + Optional<std::string> a("foo"); + EXPECT_EQ(a.value(), *a); + } + + { + Optional<TestObject> a(TestObject(3, 0.1)); + EXPECT_EQ(a.value(), *a); + } +} + +TEST(OptionalTest, OperatorStar_rvalue) { + EXPECT_EQ(0.1f, *Optional<float>(0.1f)); + EXPECT_EQ(std::string("foo"), *Optional<std::string>("foo")); + EXPECT_TRUE(TestObject(3, 0.1) == *Optional<TestObject>(TestObject(3, 0.1))); +} + +TEST(OptionalTest, OperatorArrow) { + Optional<TestObject> a(TestObject(3, 0.1)); + EXPECT_EQ(a->foo(), 3); +} + +TEST(OptionalTest, Value_rvalue) { + EXPECT_EQ(0.1f, Optional<float>(0.1f).value()); + EXPECT_EQ(std::string("foo"), Optional<std::string>("foo").value()); + EXPECT_TRUE(TestObject(3, 0.1) == + Optional<TestObject>(TestObject(3, 0.1)).value()); +} + +TEST(OptionalTest, ValueOr) { + { + Optional<float> a; + EXPECT_EQ(0.0f, a.value_or(0.0f)); + + a = 0.1f; + EXPECT_EQ(0.1f, a.value_or(0.0f)); + + a = base::nullopt; + EXPECT_EQ(0.0f, a.value_or(0.0f)); + } + + { + Optional<std::string> a; + EXPECT_EQ("bar", a.value_or("bar")); + + a = std::string("foo"); + EXPECT_EQ(std::string("foo"), a.value_or("bar")); + + a = base::nullopt; + EXPECT_EQ(std::string("bar"), a.value_or("bar")); + } + + { + Optional<TestObject> a; + EXPECT_TRUE(a.value_or(TestObject(1, 0.3)) == TestObject(1, 0.3)); + + a = TestObject(3, 0.1); + EXPECT_TRUE(a.value_or(TestObject(1, 0.3)) == TestObject(3, 0.1)); + + a = base::nullopt; + EXPECT_TRUE(a.value_or(TestObject(1, 0.3)) == TestObject(1, 0.3)); + } +} + +TEST(OptionalTest, Swap_bothNoValue) { + Optional<TestObject> a, b; + a.swap(b); + + EXPECT_FALSE(a); + EXPECT_FALSE(b); + EXPECT_TRUE(TestObject(42, 0.42) == a.value_or(TestObject(42, 0.42))); + EXPECT_TRUE(TestObject(42, 0.42) == b.value_or(TestObject(42, 0.42))); +} + +TEST(OptionalTest, Swap_inHasValue) { + Optional<TestObject> a(TestObject(1, 0.3)); + Optional<TestObject> b; + a.swap(b); + + EXPECT_FALSE(a); + + EXPECT_TRUE(!!b); + EXPECT_TRUE(TestObject(42, 0.42) == a.value_or(TestObject(42, 0.42))); + EXPECT_TRUE(TestObject(1, 0.3) == b.value_or(TestObject(42, 0.42))); +} + +TEST(OptionalTest, Swap_outHasValue) { + Optional<TestObject> a; + Optional<TestObject> b(TestObject(1, 0.3)); + a.swap(b); + + EXPECT_TRUE(!!a); + EXPECT_FALSE(!!b); + EXPECT_TRUE(TestObject(1, 0.3) == a.value_or(TestObject(42, 0.42))); + EXPECT_TRUE(TestObject(42, 0.42) == b.value_or(TestObject(42, 0.42))); +} + +TEST(OptionalTest, Swap_bothValue) { + Optional<TestObject> a(TestObject(0, 0.1)); + Optional<TestObject> b(TestObject(1, 0.3)); + a.swap(b); + + EXPECT_TRUE(!!a); + EXPECT_TRUE(!!b); + EXPECT_TRUE(TestObject(1, 0.3) == a.value_or(TestObject(42, 0.42))); + EXPECT_TRUE(TestObject(0, 0.1) == b.value_or(TestObject(42, 0.42))); +} + +TEST(OptionalTest, Emplace) { + { + Optional<float> a(0.1f); + a.emplace(0.3f); + + EXPECT_TRUE(a); + EXPECT_EQ(0.3f, a.value()); + } + + { + Optional<std::string> a("foo"); + a.emplace("bar"); + + EXPECT_TRUE(a); + EXPECT_EQ("bar", a.value()); + } + + { + Optional<TestObject> a(TestObject(0, 0.1)); + a.emplace(TestObject(1, 0.2)); + + EXPECT_TRUE(!!a); + EXPECT_TRUE(TestObject(1, 0.2) == a.value()); + } +} + +TEST(OptionalTest, Equals_TwoEmpty) { + Optional<int> a; + Optional<int> b; + + EXPECT_TRUE(a == b); +} + +TEST(OptionalTest, Equals_TwoEquals) { + Optional<int> a(1); + Optional<int> b(1); + + EXPECT_TRUE(a == b); +} + +TEST(OptionalTest, Equals_OneEmpty) { + Optional<int> a; + Optional<int> b(1); + + EXPECT_FALSE(a == b); +} + +TEST(OptionalTest, Equals_TwoDifferent) { + Optional<int> a(0); + Optional<int> b(1); + + EXPECT_FALSE(a == b); +} + +TEST(OptionalTest, NotEquals_TwoEmpty) { + Optional<int> a; + Optional<int> b; + + EXPECT_FALSE(a != b); +} + +TEST(OptionalTest, NotEquals_TwoEquals) { + Optional<int> a(1); + Optional<int> b(1); + + EXPECT_FALSE(a != b); +} + +TEST(OptionalTest, NotEquals_OneEmpty) { + Optional<int> a; + Optional<int> b(1); + + EXPECT_TRUE(a != b); +} + +TEST(OptionalTest, NotEquals_TwoDifferent) { + Optional<int> a(0); + Optional<int> b(1); + + EXPECT_TRUE(a != b); +} + +TEST(OptionalTest, Less_LeftEmpty) { + Optional<int> l; + Optional<int> r(1); + + EXPECT_TRUE(l < r); +} + +TEST(OptionalTest, Less_RightEmpty) { + Optional<int> l(1); + Optional<int> r; + + EXPECT_FALSE(l < r); +} + +TEST(OptionalTest, Less_BothEmpty) { + Optional<int> l; + Optional<int> r; + + EXPECT_FALSE(l < r); +} + +TEST(OptionalTest, Less_BothValues) { + { + Optional<int> l(1); + Optional<int> r(2); + + EXPECT_TRUE(l < r); + } + { + Optional<int> l(2); + Optional<int> r(1); + + EXPECT_FALSE(l < r); + } + { + Optional<int> l(1); + Optional<int> r(1); + + EXPECT_FALSE(l < r); + } +} + +TEST(OptionalTest, LessEq_LeftEmpty) { + Optional<int> l; + Optional<int> r(1); + + EXPECT_TRUE(l <= r); +} + +TEST(OptionalTest, LessEq_RightEmpty) { + Optional<int> l(1); + Optional<int> r; + + EXPECT_FALSE(l <= r); +} + +TEST(OptionalTest, LessEq_BothEmpty) { + Optional<int> l; + Optional<int> r; + + EXPECT_TRUE(l <= r); +} + +TEST(OptionalTest, LessEq_BothValues) { + { + Optional<int> l(1); + Optional<int> r(2); + + EXPECT_TRUE(l <= r); + } + { + Optional<int> l(2); + Optional<int> r(1); + + EXPECT_FALSE(l <= r); + } + { + Optional<int> l(1); + Optional<int> r(1); + + EXPECT_TRUE(l <= r); + } +} + +TEST(OptionalTest, Greater_BothEmpty) { + Optional<int> l; + Optional<int> r; + + EXPECT_FALSE(l > r); +} + +TEST(OptionalTest, Greater_LeftEmpty) { + Optional<int> l; + Optional<int> r(1); + + EXPECT_FALSE(l > r); +} + +TEST(OptionalTest, Greater_RightEmpty) { + Optional<int> l(1); + Optional<int> r; + + EXPECT_TRUE(l > r); +} + +TEST(OptionalTest, Greater_BothValue) { + { + Optional<int> l(1); + Optional<int> r(2); + + EXPECT_FALSE(l > r); + } + { + Optional<int> l(2); + Optional<int> r(1); + + EXPECT_TRUE(l > r); + } + { + Optional<int> l(1); + Optional<int> r(1); + + EXPECT_FALSE(l > r); + } +} + +TEST(OptionalTest, GreaterEq_BothEmpty) { + Optional<int> l; + Optional<int> r; + + EXPECT_TRUE(l >= r); +} + +TEST(OptionalTest, GreaterEq_LeftEmpty) { + Optional<int> l; + Optional<int> r(1); + + EXPECT_FALSE(l >= r); +} + +TEST(OptionalTest, GreaterEq_RightEmpty) { + Optional<int> l(1); + Optional<int> r; + + EXPECT_TRUE(l >= r); +} + +TEST(OptionalTest, GreaterEq_BothValue) { + { + Optional<int> l(1); + Optional<int> r(2); + + EXPECT_FALSE(l >= r); + } + { + Optional<int> l(2); + Optional<int> r(1); + + EXPECT_TRUE(l >= r); + } + { + Optional<int> l(1); + Optional<int> r(1); + + EXPECT_TRUE(l >= r); + } +} + +TEST(OptionalTest, OptNullEq) { + { + Optional<int> opt; + EXPECT_TRUE(opt == base::nullopt); + } + { + Optional<int> opt(1); + EXPECT_FALSE(opt == base::nullopt); + } +} + +TEST(OptionalTest, NullOptEq) { + { + Optional<int> opt; + EXPECT_TRUE(base::nullopt == opt); + } + { + Optional<int> opt(1); + EXPECT_FALSE(base::nullopt == opt); + } +} + +TEST(OptionalTest, OptNullNotEq) { + { + Optional<int> opt; + EXPECT_FALSE(opt != base::nullopt); + } + { + Optional<int> opt(1); + EXPECT_TRUE(opt != base::nullopt); + } +} + +TEST(OptionalTest, NullOptNotEq) { + { + Optional<int> opt; + EXPECT_FALSE(base::nullopt != opt); + } + { + Optional<int> opt(1); + EXPECT_TRUE(base::nullopt != opt); + } +} + +TEST(OptionalTest, OptNullLower) { + { + Optional<int> opt; + EXPECT_FALSE(opt < base::nullopt); + } + { + Optional<int> opt(1); + EXPECT_FALSE(opt < base::nullopt); + } +} + +TEST(OptionalTest, NullOptLower) { + { + Optional<int> opt; + EXPECT_FALSE(base::nullopt < opt); + } + { + Optional<int> opt(1); + EXPECT_TRUE(base::nullopt < opt); + } +} + +TEST(OptionalTest, OptNullLowerEq) { + { + Optional<int> opt; + EXPECT_TRUE(opt <= base::nullopt); + } + { + Optional<int> opt(1); + EXPECT_FALSE(opt <= base::nullopt); + } +} + +TEST(OptionalTest, NullOptLowerEq) { + { + Optional<int> opt; + EXPECT_TRUE(base::nullopt <= opt); + } + { + Optional<int> opt(1); + EXPECT_TRUE(base::nullopt <= opt); + } +} + +TEST(OptionalTest, OptNullGreater) { + { + Optional<int> opt; + EXPECT_FALSE(opt > base::nullopt); + } + { + Optional<int> opt(1); + EXPECT_TRUE(opt > base::nullopt); + } +} + +TEST(OptionalTest, NullOptGreater) { + { + Optional<int> opt; + EXPECT_FALSE(base::nullopt > opt); + } + { + Optional<int> opt(1); + EXPECT_FALSE(base::nullopt > opt); + } +} + +TEST(OptionalTest, OptNullGreaterEq) { + { + Optional<int> opt; + EXPECT_TRUE(opt >= base::nullopt); + } + { + Optional<int> opt(1); + EXPECT_TRUE(opt >= base::nullopt); + } +} + +TEST(OptionalTest, NullOptGreaterEq) { + { + Optional<int> opt; + EXPECT_TRUE(base::nullopt >= opt); + } + { + Optional<int> opt(1); + EXPECT_FALSE(base::nullopt >= opt); + } +} + +TEST(OptionalTest, ValueEq_Empty) { + Optional<int> opt; + EXPECT_FALSE(opt == 1); +} + +TEST(OptionalTest, ValueEq_NotEmpty) { + { + Optional<int> opt(0); + EXPECT_FALSE(opt == 1); + } + { + Optional<int> opt(1); + EXPECT_TRUE(opt == 1); + } +} + +TEST(OptionalTest, EqValue_Empty) { + Optional<int> opt; + EXPECT_FALSE(1 == opt); +} + +TEST(OptionalTest, EqValue_NotEmpty) { + { + Optional<int> opt(0); + EXPECT_FALSE(1 == opt); + } + { + Optional<int> opt(1); + EXPECT_TRUE(1 == opt); + } +} + +TEST(OptionalTest, ValueNotEq_Empty) { + Optional<int> opt; + EXPECT_TRUE(opt != 1); +} + +TEST(OptionalTest, ValueNotEq_NotEmpty) { + { + Optional<int> opt(0); + EXPECT_TRUE(opt != 1); + } + { + Optional<int> opt(1); + EXPECT_FALSE(opt != 1); + } +} + +TEST(OptionalTest, NotEqValue_Empty) { + Optional<int> opt; + EXPECT_TRUE(1 != opt); +} + +TEST(OptionalTest, NotEqValue_NotEmpty) { + { + Optional<int> opt(0); + EXPECT_TRUE(1 != opt); + } + { + Optional<int> opt(1); + EXPECT_FALSE(1 != opt); + } +} + +TEST(OptionalTest, ValueLess_Empty) { + Optional<int> opt; + EXPECT_TRUE(opt < 1); +} + +TEST(OptionalTest, ValueLess_NotEmpty) { + { + Optional<int> opt(0); + EXPECT_TRUE(opt < 1); + } + { + Optional<int> opt(1); + EXPECT_FALSE(opt < 1); + } + { + Optional<int> opt(2); + EXPECT_FALSE(opt < 1); + } +} + +TEST(OptionalTest, LessValue_Empty) { + Optional<int> opt; + EXPECT_FALSE(1 < opt); +} + +TEST(OptionalTest, LessValue_NotEmpty) { + { + Optional<int> opt(0); + EXPECT_FALSE(1 < opt); + } + { + Optional<int> opt(1); + EXPECT_FALSE(1 < opt); + } + { + Optional<int> opt(2); + EXPECT_TRUE(1 < opt); + } +} + +TEST(OptionalTest, ValueLessEq_Empty) { + Optional<int> opt; + EXPECT_TRUE(opt <= 1); +} + +TEST(OptionalTest, ValueLessEq_NotEmpty) { + { + Optional<int> opt(0); + EXPECT_TRUE(opt <= 1); + } + { + Optional<int> opt(1); + EXPECT_TRUE(opt <= 1); + } + { + Optional<int> opt(2); + EXPECT_FALSE(opt <= 1); + } +} + +TEST(OptionalTest, LessEqValue_Empty) { + Optional<int> opt; + EXPECT_FALSE(1 <= opt); +} + +TEST(OptionalTest, LessEqValue_NotEmpty) { + { + Optional<int> opt(0); + EXPECT_FALSE(1 <= opt); + } + { + Optional<int> opt(1); + EXPECT_TRUE(1 <= opt); + } + { + Optional<int> opt(2); + EXPECT_TRUE(1 <= opt); + } +} + +TEST(OptionalTest, ValueGreater_Empty) { + Optional<int> opt; + EXPECT_FALSE(opt > 1); +} + +TEST(OptionalTest, ValueGreater_NotEmpty) { + { + Optional<int> opt(0); + EXPECT_FALSE(opt > 1); + } + { + Optional<int> opt(1); + EXPECT_FALSE(opt > 1); + } + { + Optional<int> opt(2); + EXPECT_TRUE(opt > 1); + } +} + +TEST(OptionalTest, GreaterValue_Empty) { + Optional<int> opt; + EXPECT_TRUE(1 > opt); +} + +TEST(OptionalTest, GreaterValue_NotEmpty) { + { + Optional<int> opt(0); + EXPECT_TRUE(1 > opt); + } + { + Optional<int> opt(1); + EXPECT_FALSE(1 > opt); + } + { + Optional<int> opt(2); + EXPECT_FALSE(1 > opt); + } +} + +TEST(OptionalTest, ValueGreaterEq_Empty) { + Optional<int> opt; + EXPECT_FALSE(opt >= 1); +} + +TEST(OptionalTest, ValueGreaterEq_NotEmpty) { + { + Optional<int> opt(0); + EXPECT_FALSE(opt >= 1); + } + { + Optional<int> opt(1); + EXPECT_TRUE(opt >= 1); + } + { + Optional<int> opt(2); + EXPECT_TRUE(opt >= 1); + } +} + +TEST(OptionalTest, GreaterEqValue_Empty) { + Optional<int> opt; + EXPECT_TRUE(1 >= opt); +} + +TEST(OptionalTest, GreaterEqValue_NotEmpty) { + { + Optional<int> opt(0); + EXPECT_TRUE(1 >= opt); + } + { + Optional<int> opt(1); + EXPECT_TRUE(1 >= opt); + } + { + Optional<int> opt(2); + EXPECT_FALSE(1 >= opt); + } +} + +TEST(OptionalTest, NotEquals) { + { + Optional<float> a(0.1f); + Optional<float> b(0.2f); + EXPECT_NE(a, b); + } + + { + Optional<std::string> a("foo"); + Optional<std::string> b("bar"); + EXPECT_NE(a, b); + } + + { + Optional<TestObject> a(TestObject(3, 0.1)); + Optional<TestObject> b(TestObject(4, 1.0)); + EXPECT_TRUE(a != b); + } +} + +TEST(OptionalTest, NotEqualsNull) { + { + Optional<float> a(0.1f); + Optional<float> b(0.1f); + b = base::nullopt; + EXPECT_NE(a, b); + } + + { + Optional<std::string> a("foo"); + Optional<std::string> b("foo"); + b = base::nullopt; + EXPECT_NE(a, b); + } + + { + Optional<TestObject> a(TestObject(3, 0.1)); + Optional<TestObject> b(TestObject(3, 0.1)); + b = base::nullopt; + EXPECT_TRUE(a != b); + } +} + +TEST(OptionalTest, MakeOptional) { + { + Optional<float> o = base::make_optional(32.f); + EXPECT_TRUE(o); + EXPECT_EQ(32.f, *o); + + float value = 3.f; + o = base::make_optional(std::move(value)); + EXPECT_TRUE(o); + EXPECT_EQ(3.f, *o); + } + + { + Optional<std::string> o = base::make_optional(std::string("foo")); + EXPECT_TRUE(o); + EXPECT_EQ("foo", *o); + + std::string value = "bar"; + o = base::make_optional(std::move(value)); + EXPECT_TRUE(o); + EXPECT_EQ(std::string("bar"), *o); + } + + { + Optional<TestObject> o = base::make_optional(TestObject(3, 0.1)); + EXPECT_TRUE(!!o); + EXPECT_TRUE(TestObject(3, 0.1) == *o); + + TestObject value = TestObject(0, 0.42); + o = base::make_optional(std::move(value)); + EXPECT_TRUE(!!o); + EXPECT_TRUE(TestObject(0, 0.42) == *o); + EXPECT_EQ(TestObject::State::MOVED_FROM, value.state()); + EXPECT_EQ(TestObject::State::COPY_CONSTRUCTED, o->state()); + + EXPECT_EQ(TestObject::State::MOVE_CONSTRUCTED, + base::make_optional(std::move(value))->state()); + } +} + +TEST(OptionalTest, NonMemberSwap_bothNoValue) { + Optional<TestObject> a, b; + base::swap(a, b); + + EXPECT_FALSE(!!a); + EXPECT_FALSE(!!b); + EXPECT_TRUE(TestObject(42, 0.42) == a.value_or(TestObject(42, 0.42))); + EXPECT_TRUE(TestObject(42, 0.42) == b.value_or(TestObject(42, 0.42))); +} + +TEST(OptionalTest, NonMemberSwap_inHasValue) { + Optional<TestObject> a(TestObject(1, 0.3)); + Optional<TestObject> b; + base::swap(a, b); + + EXPECT_FALSE(!!a); + EXPECT_TRUE(!!b); + EXPECT_TRUE(TestObject(42, 0.42) == a.value_or(TestObject(42, 0.42))); + EXPECT_TRUE(TestObject(1, 0.3) == b.value_or(TestObject(42, 0.42))); +} + +TEST(OptionalTest, NonMemberSwap_outHasValue) { + Optional<TestObject> a; + Optional<TestObject> b(TestObject(1, 0.3)); + base::swap(a, b); + + EXPECT_TRUE(!!a); + EXPECT_FALSE(!!b); + EXPECT_TRUE(TestObject(1, 0.3) == a.value_or(TestObject(42, 0.42))); + EXPECT_TRUE(TestObject(42, 0.42) == b.value_or(TestObject(42, 0.42))); +} + +TEST(OptionalTest, NonMemberSwap_bothValue) { + Optional<TestObject> a(TestObject(0, 0.1)); + Optional<TestObject> b(TestObject(1, 0.3)); + base::swap(a, b); + + EXPECT_TRUE(!!a); + EXPECT_TRUE(!!b); + EXPECT_TRUE(TestObject(1, 0.3) == a.value_or(TestObject(42, 0.42))); + EXPECT_TRUE(TestObject(0, 0.1) == b.value_or(TestObject(42, 0.42))); +} + +TEST(OptionalTest, Hash_OptionalReflectsInternal) { + { + std::hash<int> int_hash; + std::hash<Optional<int>> opt_int_hash; + + EXPECT_EQ(int_hash(1), opt_int_hash(Optional<int>(1))); + } + + { + std::hash<std::string> str_hash; + std::hash<Optional<std::string>> opt_str_hash; + + EXPECT_EQ(str_hash(std::string("foobar")), + opt_str_hash(Optional<std::string>(std::string("foobar")))); + } +} + +TEST(OptionalTest, Hash_NullOptEqualsNullOpt) { + std::hash<Optional<int>> opt_int_hash; + std::hash<Optional<std::string>> opt_str_hash; + + EXPECT_EQ(opt_str_hash(Optional<std::string>()), + opt_int_hash(Optional<int>())); +} + +TEST(OptionalTest, Hash_UseInSet) { + std::set<Optional<int>> setOptInt; + + EXPECT_EQ(setOptInt.end(), setOptInt.find(42)); + + setOptInt.insert(Optional<int>(3)); + EXPECT_EQ(setOptInt.end(), setOptInt.find(42)); + EXPECT_NE(setOptInt.end(), setOptInt.find(3)); +} + +} // namespace base
diff --git a/base/task_scheduler/delayed_task_manager.cc b/base/task_scheduler/delayed_task_manager.cc new file mode 100644 index 0000000..1b27829 --- /dev/null +++ b/base/task_scheduler/delayed_task_manager.cc
@@ -0,0 +1,148 @@ +// 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 "base/task_scheduler/delayed_task_manager.h" + +#include <utility> + +#include "base/logging.h" +#include "base/task_scheduler/scheduler_task_executor.h" + +namespace base { +namespace internal { + +struct DelayedTaskManager::DelayedTask { + DelayedTask(std::unique_ptr<Task> task, + scoped_refptr<Sequence> sequence, + SchedulerTaskExecutor* executor, + uint64_t index) + : task(std::move(task)), + sequence(std::move(sequence)), + executor(executor), + index(index) {} + + DelayedTask(DelayedTask&& other) = default; + + ~DelayedTask() = default; + + DelayedTask& operator=(DelayedTask&& other) = default; + + // |task| will be posted to |executor| as part of |sequence| when it becomes + // ripe for execution. + std::unique_ptr<Task> task; + scoped_refptr<Sequence> sequence; + SchedulerTaskExecutor* executor; + + // Ensures that tasks that have the same |delayed_run_time| are sorted + // according to the order in which they were added to the DelayedTaskManager. + uint64_t index; + + private: + DISALLOW_COPY_AND_ASSIGN(DelayedTask); +}; + +DelayedTaskManager::DelayedTaskManager( + const Closure& on_delayed_run_time_updated) + : on_delayed_run_time_updated_(on_delayed_run_time_updated) { + DCHECK(!on_delayed_run_time_updated_.is_null()); +} + +DelayedTaskManager::~DelayedTaskManager() = default; + +void DelayedTaskManager::AddDelayedTask(std::unique_ptr<Task> task, + scoped_refptr<Sequence> sequence, + SchedulerTaskExecutor* executor) { + DCHECK(task); + DCHECK(sequence); + DCHECK(executor); + + const TimeTicks new_task_delayed_run_time = task->delayed_run_time; + TimeTicks current_delayed_run_time; + + { + AutoSchedulerLock auto_lock(lock_); + + if (!delayed_tasks_.empty()) + current_delayed_run_time = delayed_tasks_.top().task->delayed_run_time; + + delayed_tasks_.emplace(std::move(task), std::move(sequence), executor, + ++delayed_task_index_); + } + + if (current_delayed_run_time.is_null() || + new_task_delayed_run_time < current_delayed_run_time) { + on_delayed_run_time_updated_.Run(); + } +} + +void DelayedTaskManager::PostReadyTasks() { + const TimeTicks now = Now(); + + // Move delayed tasks that are ready for execution into |ready_tasks|. Don't + // post them right away to avoid imposing an unecessary lock dependency on + // PostTaskNowHelper. + std::vector<DelayedTask> ready_tasks; + + { + AutoSchedulerLock auto_lock(lock_); + while (!delayed_tasks_.empty() && + delayed_tasks_.top().task->delayed_run_time <= now) { + // The const_cast for std::move is okay since we're immediately popping + // the task from |delayed_tasks_|. See DelayedTaskComparator::operator() + // for minor debug-check implications. + ready_tasks.push_back( + std::move(const_cast<DelayedTask&>(delayed_tasks_.top()))); + delayed_tasks_.pop(); + } + } + + // Post delayed tasks that are ready for execution. + for (auto& delayed_task : ready_tasks) { + delayed_task.executor->PostTaskWithSequence( + std::move(delayed_task.task), std::move(delayed_task.sequence)); + } +} + +TimeTicks DelayedTaskManager::GetDelayedRunTime() const { + AutoSchedulerLock auto_lock(lock_); + + if (delayed_tasks_.empty()) + return TimeTicks(); + + return delayed_tasks_.top().task->delayed_run_time; +} + +// In std::priority_queue, the largest element is on top. Therefore, this +// comparator returns true if the delayed run time of |right| is earlier than +// the delayed run time of |left|. +bool DelayedTaskManager::DelayedTaskComparator::operator()( + const DelayedTask& left, + const DelayedTask& right) const { +#ifndef NDEBUG + // Due to STL consistency checks in Windows and const_cast'ing right before + // popping the DelayedTask, a null task can be passed to this comparator in + // Debug builds. To satisfy these consistency checks, this comparator + // considers null tasks to be the larger than anything. + DCHECK(left.task || right.task); + if (!left.task) + return false; + if (!right.task) + return true; +#else + DCHECK(left.task); + DCHECK(right.task); +#endif // NDEBUG + if (left.task->delayed_run_time > right.task->delayed_run_time) + return true; + if (left.task->delayed_run_time < right.task->delayed_run_time) + return false; + return left.index > right.index; +} + +TimeTicks DelayedTaskManager::Now() const { + return TimeTicks::Now(); +} + +} // namespace internal +} // namespace base
diff --git a/base/task_scheduler/delayed_task_manager.h b/base/task_scheduler/delayed_task_manager.h new file mode 100644 index 0000000..f098659 --- /dev/null +++ b/base/task_scheduler/delayed_task_manager.h
@@ -0,0 +1,87 @@ +// 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 BASE_TASK_SCHEDULER_DELAYED_TASK_MANAGER_H_ +#define BASE_TASK_SCHEDULER_DELAYED_TASK_MANAGER_H_ + +#include <stdint.h> + +#include <memory> +#include <queue> +#include <vector> + +#include "base/base_export.h" +#include "base/callback.h" +#include "base/macros.h" +#include "base/memory/ref_counted.h" +#include "base/task_scheduler/scheduler_lock.h" +#include "base/task_scheduler/sequence.h" +#include "base/task_scheduler/task.h" +#include "base/time/time.h" + +namespace base { +namespace internal { + +class SchedulerTaskExecutor; + +// A DelayedTaskManager holds delayed Tasks until they become ripe for +// execution. When they become ripe for execution, it posts them to their +// associated Sequence and SchedulerTaskExecutor. This class is thread-safe. +class BASE_EXPORT DelayedTaskManager { + public: + // |on_delayed_run_time_updated| is invoked when the delayed run time is + // updated as a result of adding a delayed task to the manager. + explicit DelayedTaskManager(const Closure& on_delayed_run_time_updated); + ~DelayedTaskManager(); + + // Adds |task| to a queue of delayed tasks. The task will be posted to + // |executor| as part of |sequence| the first time that PostReadyTasks() is + // called while Now() is passed |task->delayed_run_time|. + // + // TODO(robliao): Find a concrete way to manage |executor|'s memory. It is + // never deleted in production, but it is better not to spread this assumption + // throughout the scheduler. + void AddDelayedTask(std::unique_ptr<Task> task, + scoped_refptr<Sequence> sequence, + SchedulerTaskExecutor* executor); + + // Posts delayed tasks that are ripe for execution. + // TODO(robliao): Call this from a service thread. + void PostReadyTasks(); + + // Returns the next time at which a delayed task will become ripe for + // execution, or a null TimeTicks if there are no pending delayed tasks. + TimeTicks GetDelayedRunTime() const; + + private: + struct DelayedTask; + struct DelayedTaskComparator { + bool operator()(const DelayedTask& left, const DelayedTask& right) const; + }; + + // Returns the current time. Can be overridden for tests. + virtual TimeTicks Now() const; + + const Closure on_delayed_run_time_updated_; + + // Synchronizes access to all members below. + mutable SchedulerLock lock_; + + // Priority queue of delayed tasks. The delayed task with the smallest + // |task->delayed_run_time| is in front of the priority queue. + using DelayedTaskQueue = std::priority_queue<DelayedTask, + std::vector<DelayedTask>, + DelayedTaskComparator>; + DelayedTaskQueue delayed_tasks_; + + // The index to assign to the next delayed task added to the manager. + uint64_t delayed_task_index_ = 0; + + DISALLOW_COPY_AND_ASSIGN(DelayedTaskManager); +}; + +} // namespace internal +} // namespace base + +#endif // BASE_TASK_SCHEDULER_DELAYED_TASK_MANAGER_H_
diff --git a/base/task_scheduler/delayed_task_manager_unittest.cc b/base/task_scheduler/delayed_task_manager_unittest.cc new file mode 100644 index 0000000..9f3fa757 --- /dev/null +++ b/base/task_scheduler/delayed_task_manager_unittest.cc
@@ -0,0 +1,214 @@ +// 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 "base/task_scheduler/delayed_task_manager.h" + +#include <memory> +#include <utility> + +#include "base/bind.h" +#include "base/bind_helpers.h" +#include "base/memory/ref_counted.h" +#include "base/task_scheduler/scheduler_lock.h" +#include "base/task_scheduler/scheduler_task_executor.h" +#include "base/task_scheduler/sequence.h" +#include "base/task_scheduler/task.h" +#include "base/time/time.h" +#include "testing/gmock/include/gmock/gmock.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace base { +namespace internal { +namespace { + +class TestDelayedTaskManager : public DelayedTaskManager { + public: + TestDelayedTaskManager() + : DelayedTaskManager( + Bind(&TestDelayedTaskManager::OnDelayedRunTimeUpdated, + Unretained(this))) {} + + void SetCurrentTime(TimeTicks now) { now_ = now; } + + // DelayedTaskManager: + TimeTicks Now() const override { return now_; } + + MOCK_METHOD0(OnDelayedRunTimeUpdated, void()); + + private: + TimeTicks now_ = TimeTicks::Now(); + + DISALLOW_COPY_AND_ASSIGN(TestDelayedTaskManager); +}; + +class MockSchedulerTaskExecutor : public SchedulerTaskExecutor { + public: + void PostTaskWithSequence(std::unique_ptr<Task> task, + scoped_refptr<Sequence> sequence) override { + PostTaskWithSequenceMock(task.get(), sequence.get()); + } + + MOCK_METHOD2(PostTaskWithSequenceMock, void(const Task*, const Sequence*)); +}; + +// Verify that GetDelayedRunTime() returns a null TimeTicks when there are +// no pending delayed tasks. +TEST(TaskSchedulerDelayedTaskManagerTest, + GetDelayedRunTimeNoPendingDelayedTasks) { + TestDelayedTaskManager manager; + EXPECT_EQ(TimeTicks(), manager.GetDelayedRunTime()); +} + +// Verify that a delayed task isn't posted before it is ripe for execution. +TEST(TaskSchedulerDelayedTaskManagerTest, PostReadyTaskBeforeDelayedRunTime) { + testing::StrictMock<TestDelayedTaskManager> manager; + + std::unique_ptr<Task> task( + new Task(FROM_HERE, Bind(&DoNothing), TaskTraits(), + manager.Now() + TimeDelta::FromSeconds(1))); + const Task* task_raw = task.get(); + scoped_refptr<Sequence> sequence(new Sequence); + testing::StrictMock<MockSchedulerTaskExecutor> executor; + + // Add |task| to the DelayedTaskManager. + EXPECT_CALL(manager, OnDelayedRunTimeUpdated()); + manager.AddDelayedTask(std::move(task), sequence, &executor); + testing::Mock::VerifyAndClear(&manager); + EXPECT_EQ(task_raw->delayed_run_time, manager.GetDelayedRunTime()); + + // Ask the DelayedTaskManager to post tasks that are ripe for execution. Don't + // expect any call to the mock method of |executor|. + manager.PostReadyTasks(); + + // The delayed run time shouldn't have changed. + EXPECT_EQ(task_raw->delayed_run_time, manager.GetDelayedRunTime()); +} + +// Verify that a delayed task is posted when PostReadyTasks() is called with the +// current time equal to the task's delayed run time. +TEST(TaskSchedulerDelayedTaskManagerTest, PostReadyTasksAtDelayedRunTime) { + testing::StrictMock<TestDelayedTaskManager> manager; + + std::unique_ptr<Task> task( + new Task(FROM_HERE, Bind(&DoNothing), TaskTraits(), + manager.Now() + TimeDelta::FromSeconds(1))); + const Task* task_raw = task.get(); + scoped_refptr<Sequence> sequence(new Sequence); + testing::StrictMock<MockSchedulerTaskExecutor> executor; + + // Add |task| to the DelayedTaskManager. + EXPECT_CALL(manager, OnDelayedRunTimeUpdated()); + manager.AddDelayedTask(std::move(task), sequence, &executor); + testing::Mock::VerifyAndClear(&manager); + EXPECT_EQ(task_raw->delayed_run_time, manager.GetDelayedRunTime()); + + // Fast-forward time to |task_raw|'s delayed run time. + manager.SetCurrentTime(task_raw->delayed_run_time); + + // Ask the DelayedTaskManager to post tasks that are ripe for execution. + EXPECT_CALL(executor, PostTaskWithSequenceMock(task_raw, sequence.get())); + manager.PostReadyTasks(); + testing::Mock::VerifyAndClear(&manager); + EXPECT_EQ(TimeTicks(), manager.GetDelayedRunTime()); +} + +// Verify that a delayed task is posted when PostReadyTasks() is called with the +// current time greater than the task's delayed run time. +TEST(TaskSchedulerDelayedTaskManagerTest, PostReadyTasksAfterDelayedRunTime) { + testing::StrictMock<TestDelayedTaskManager> manager; + + std::unique_ptr<Task> task( + new Task(FROM_HERE, Bind(&DoNothing), TaskTraits(), + manager.Now() + TimeDelta::FromSeconds(1))); + const Task* task_raw = task.get(); + scoped_refptr<Sequence> sequence(new Sequence); + testing::StrictMock<MockSchedulerTaskExecutor> executor; + + // Add |task| to the DelayedTaskManager. + EXPECT_CALL(manager, OnDelayedRunTimeUpdated()); + manager.AddDelayedTask(std::move(task), sequence, &executor); + testing::Mock::VerifyAndClear(&manager); + EXPECT_EQ(task_raw->delayed_run_time, manager.GetDelayedRunTime()); + + // Fast-forward time to |task_raw|'s delayed run time. + manager.SetCurrentTime(task_raw->delayed_run_time + + TimeDelta::FromSeconds(10)); + + // Ask the DelayedTaskManager to post tasks that are ripe for execution. + EXPECT_CALL(executor, PostTaskWithSequenceMock(task_raw, sequence.get())); + manager.PostReadyTasks(); + testing::Mock::VerifyAndClear(&manager); + EXPECT_EQ(TimeTicks(), manager.GetDelayedRunTime()); +} + +// Verify that when multiple tasks are added to a DelayedTaskManager, they are +// posted when they become ripe for execution. +TEST(TaskSchedulerDelayedTaskManagerTest, AddAndPostReadyTasks) { + testing::StrictMock<TestDelayedTaskManager> manager; + + scoped_refptr<Sequence> sequence(new Sequence); + testing::StrictMock<MockSchedulerTaskExecutor> executor; + + std::unique_ptr<Task> task_a( + new Task(FROM_HERE, Bind(&DoNothing), TaskTraits(), + manager.Now() + TimeDelta::FromSeconds(2))); + const Task* task_a_raw = task_a.get(); + + std::unique_ptr<Task> task_b( + new Task(FROM_HERE, Bind(&DoNothing), TaskTraits(), + manager.Now() + TimeDelta::FromSeconds(2))); + const Task* task_b_raw = task_b.get(); + + std::unique_ptr<Task> task_c( + new Task(FROM_HERE, Bind(&DoNothing), TaskTraits(), + manager.Now() + TimeDelta::FromSeconds(1))); + const Task* task_c_raw = task_c.get(); + + // Add |task_a| to the DelayedTaskManager. The delayed run time should be + // updated to |task_a|'s delayed run time. + EXPECT_CALL(manager, OnDelayedRunTimeUpdated()); + manager.AddDelayedTask(std::move(task_a), sequence, &executor); + testing::Mock::VerifyAndClear(&manager); + EXPECT_EQ(task_a_raw->delayed_run_time, manager.GetDelayedRunTime()); + + // Add |task_b| to the DelayedTaskManager. The delayed run time shouldn't + // change. + manager.AddDelayedTask(std::move(task_b), sequence, &executor); + testing::Mock::VerifyAndClear(&manager); + EXPECT_EQ(task_a_raw->delayed_run_time, manager.GetDelayedRunTime()); + + // Add |task_c| to the DelayedTaskManager. The delayed run time should be + // updated to |task_c|'s delayed run time. + EXPECT_CALL(manager, OnDelayedRunTimeUpdated()); + manager.AddDelayedTask(std::move(task_c), sequence, &executor); + testing::Mock::VerifyAndClear(&manager); + EXPECT_EQ(task_c_raw->delayed_run_time, manager.GetDelayedRunTime()); + + // Fast-forward time to |task_c_raw|'s delayed run time. + manager.SetCurrentTime(task_c_raw->delayed_run_time); + + // Ask the DelayedTaskManager to post tasks that are ripe for execution. + // |task_c_raw| should be posted and the delayed run time should become + // |task_a_raw|'s delayed run time. + EXPECT_CALL(executor, PostTaskWithSequenceMock(task_c_raw, sequence.get())); + manager.PostReadyTasks(); + testing::Mock::VerifyAndClear(&executor); + EXPECT_EQ(task_a_raw->delayed_run_time, manager.GetDelayedRunTime()); + + // Fast-forward time to |task_a_raw|'s delayed run time. + manager.SetCurrentTime(task_a_raw->delayed_run_time); + + // Ask the DelayedTaskManager to post tasks that are ripe for execution. + // |task_a_raw| and |task_b_raw| should be posted and the delayed run time + // should become a null TimeTicks. + EXPECT_CALL(executor, PostTaskWithSequenceMock(task_a_raw, sequence.get())); + EXPECT_CALL(executor, PostTaskWithSequenceMock(task_b_raw, sequence.get())); + manager.PostReadyTasks(); + testing::Mock::VerifyAndClear(&executor); + EXPECT_EQ(TimeTicks(), manager.GetDelayedRunTime()); +} + +} // namespace +} // namespace internal +} // namespace base
diff --git a/base/task_scheduler/priority_queue.cc b/base/task_scheduler/priority_queue.cc index 2cd8980a..05a90b22 100644 --- a/base/task_scheduler/priority_queue.cc +++ b/base/task_scheduler/priority_queue.cc
@@ -20,9 +20,6 @@ const SequenceSortKey& sort_key) : sequence(std::move(sequence)), sort_key(sort_key) {} -PriorityQueue::SequenceAndSortKey::SequenceAndSortKey( - const SequenceAndSortKey& other) = default; - PriorityQueue::SequenceAndSortKey::~SequenceAndSortKey() = default; PriorityQueue::Transaction::Transaction(PriorityQueue* outer_queue)
diff --git a/base/task_scheduler/priority_queue.h b/base/task_scheduler/priority_queue.h index 8676c93..8e0a532 100644 --- a/base/task_scheduler/priority_queue.h +++ b/base/task_scheduler/priority_queue.h
@@ -32,9 +32,6 @@ // Constructs a SequenceAndSortKey with the given |sequence| and |sort_key|. SequenceAndSortKey(scoped_refptr<Sequence> sequence, const SequenceSortKey& sort_key); - - SequenceAndSortKey(const SequenceAndSortKey& other); - ~SequenceAndSortKey(); // Returns true if this is a null SequenceAndSortKey. @@ -42,6 +39,9 @@ const scoped_refptr<Sequence> sequence; const SequenceSortKey sort_key; + + private: + DISALLOW_COPY_AND_ASSIGN(SequenceAndSortKey); }; // A Transaction can perform multiple operations atomically on a
diff --git a/base/task_scheduler/scheduler_thread_pool.cc b/base/task_scheduler/scheduler_thread_pool.cc index c43b1d7..a6ee6ba 100644 --- a/base/task_scheduler/scheduler_thread_pool.cc +++ b/base/task_scheduler/scheduler_thread_pool.cc
@@ -31,18 +31,25 @@ // long as |executor| is alive. // TODO(robliao): Find a concrete way to manage |executor|'s memory. SchedulerParallelTaskRunner(const TaskTraits& traits, + SchedulerTaskExecutor* executor, TaskTracker* task_tracker, - SchedulerTaskExecutor* executor) - : traits_(traits), task_tracker_(task_tracker), executor_(executor) {} + DelayedTaskManager* delayed_task_manager) + : traits_(traits), + executor_(executor), + task_tracker_(task_tracker), + delayed_task_manager_(delayed_task_manager) {} // TaskRunner: bool PostDelayedTask(const tracked_objects::Location& from_here, const Closure& closure, TimeDelta delay) override { // Post the task as part of a one-off single-task Sequence. - return PostTaskToExecutor(from_here, closure, traits_, delay, - make_scoped_refptr(new Sequence), executor_, - task_tracker_); + return PostTaskToExecutor( + WrapUnique( + new Task(from_here, closure, traits_, + delay.is_zero() ? TimeTicks() : TimeTicks::Now() + delay)), + make_scoped_refptr(new Sequence), executor_, task_tracker_, + delayed_task_manager_); } bool RunsTasksOnCurrentThread() const override { @@ -53,8 +60,9 @@ ~SchedulerParallelTaskRunner() override = default; const TaskTraits traits_; - TaskTracker* const task_tracker_; SchedulerTaskExecutor* const executor_; + TaskTracker* const task_tracker_; + DelayedTaskManager* const delayed_task_manager_; DISALLOW_COPY_AND_ASSIGN(SchedulerParallelTaskRunner); }; @@ -66,17 +74,24 @@ // long as |executor| is alive. // TODO(robliao): Find a concrete way to manage |executor|'s memory. SchedulerSequencedTaskRunner(const TaskTraits& traits, + SchedulerTaskExecutor* executor, TaskTracker* task_tracker, - SchedulerTaskExecutor* executor) - : traits_(traits), task_tracker_(task_tracker), executor_(executor) {} + DelayedTaskManager* delayed_task_manager) + : traits_(traits), + executor_(executor), + task_tracker_(task_tracker), + delayed_task_manager_(delayed_task_manager) {} // SequencedTaskRunner: bool PostDelayedTask(const tracked_objects::Location& from_here, const Closure& closure, TimeDelta delay) override { // Post the task as part of |sequence|. - return PostTaskToExecutor(from_here, closure, traits_, delay, sequence_, - executor_, task_tracker_); + return PostTaskToExecutor( + WrapUnique( + new Task(from_here, closure, traits_, + delay.is_zero() ? TimeTicks() : TimeTicks::Now() + delay)), + sequence_, executor_, task_tracker_, delayed_task_manager_); } bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, @@ -97,8 +112,9 @@ const scoped_refptr<Sequence> sequence_ = new Sequence; const TaskTraits traits_; - TaskTracker* const task_tracker_; SchedulerTaskExecutor* const executor_; + TaskTracker* const task_tracker_; + DelayedTaskManager* const delayed_task_manager_; DISALLOW_COPY_AND_ASSIGN(SchedulerSequencedTaskRunner); }; @@ -136,9 +152,10 @@ ThreadPriority thread_priority, size_t max_threads, const EnqueueSequenceCallback& enqueue_sequence_callback, - TaskTracker* task_tracker) { - std::unique_ptr<SchedulerThreadPool> thread_pool( - new SchedulerThreadPool(enqueue_sequence_callback, task_tracker)); + TaskTracker* task_tracker, + DelayedTaskManager* delayed_task_manager) { + std::unique_ptr<SchedulerThreadPool> thread_pool(new SchedulerThreadPool( + enqueue_sequence_callback, task_tracker, delayed_task_manager)); if (thread_pool->Initialize(thread_priority, max_threads)) return thread_pool; return nullptr; @@ -149,12 +166,12 @@ ExecutionMode execution_mode) { switch (execution_mode) { case ExecutionMode::PARALLEL: - return make_scoped_refptr( - new SchedulerParallelTaskRunner(traits, task_tracker_, this)); + return make_scoped_refptr(new SchedulerParallelTaskRunner( + traits, this, task_tracker_, delayed_task_manager_)); case ExecutionMode::SEQUENCED: - return make_scoped_refptr( - new SchedulerSequencedTaskRunner(traits, task_tracker_, this)); + return make_scoped_refptr(new SchedulerSequencedTaskRunner( + traits, this, task_tracker_, delayed_task_manager_)); case ExecutionMode::SINGLE_THREADED: // TODO(fdoray): Support SINGLE_THREADED TaskRunners. @@ -233,7 +250,7 @@ SchedulerWorkerThread* worker_thread) { std::unique_ptr<PriorityQueue::Transaction> transaction( outer_->shared_priority_queue_.BeginTransaction()); - const auto sequence_and_sort_key = transaction->Peek(); + const auto& sequence_and_sort_key = transaction->Peek(); if (sequence_and_sort_key.is_null()) { // |transaction| is kept alive while |worker_thread| is added to @@ -252,8 +269,9 @@ return nullptr; } + scoped_refptr<Sequence> sequence = sequence_and_sort_key.sequence; transaction->Pop(); - return sequence_and_sort_key.sequence; + return sequence; } void SchedulerThreadPool::SchedulerWorkerThreadDelegateImpl::EnqueueSequence( @@ -263,7 +281,8 @@ SchedulerThreadPool::SchedulerThreadPool( const EnqueueSequenceCallback& enqueue_sequence_callback, - TaskTracker* task_tracker) + TaskTracker* task_tracker, + DelayedTaskManager* delayed_task_manager) : idle_worker_threads_stack_lock_(shared_priority_queue_.container_lock()), idle_worker_threads_stack_cv_for_testing_( idle_worker_threads_stack_lock_.CreateConditionVariable()), @@ -271,8 +290,10 @@ worker_thread_delegate_( new SchedulerWorkerThreadDelegateImpl(this, enqueue_sequence_callback)), - task_tracker_(task_tracker) { + task_tracker_(task_tracker), + delayed_task_manager_(delayed_task_manager) { DCHECK(task_tracker_); + DCHECK(delayed_task_manager_); } bool SchedulerThreadPool::Initialize(ThreadPriority thread_priority,
diff --git a/base/task_scheduler/scheduler_thread_pool.h b/base/task_scheduler/scheduler_thread_pool.h index f7919df..75c8a329 100644 --- a/base/task_scheduler/scheduler_thread_pool.h +++ b/base/task_scheduler/scheduler_thread_pool.h
@@ -29,6 +29,7 @@ namespace base { namespace internal { +class DelayedTaskManager; struct SequenceSortKey; class TaskTracker; @@ -47,13 +48,15 @@ // Creates a SchedulerThreadPool with up to |max_threads| threads of priority // |thread_priority|. |enqueue_sequence_callback| will be invoked after a // thread of this thread pool tries to run a Task. |task_tracker| is used to - // handle shutdown behavior of Tasks. Returns nullptr on failure to create a - // thread pool with at least one thread. + // handle shutdown behavior of Tasks. |delayed_task_manager| handles Tasks + // posted with a delay. Returns nullptr on failure to create a thread pool + // with at least one thread. static std::unique_ptr<SchedulerThreadPool> CreateThreadPool( ThreadPriority thread_priority, size_t max_threads, const EnqueueSequenceCallback& enqueue_sequence_callback, - TaskTracker* task_tracker); + TaskTracker* task_tracker, + DelayedTaskManager* delayed_task_manager); // Returns a TaskRunner whose PostTask invocations will result in scheduling // Tasks with |traits| and |execution_mode| in this thread pool. @@ -83,7 +86,8 @@ class SchedulerWorkerThreadDelegateImpl; SchedulerThreadPool(const EnqueueSequenceCallback& enqueue_sequence_callback, - TaskTracker* task_tracker); + TaskTracker* task_tracker, + DelayedTaskManager* delayed_task_manager); bool Initialize(ThreadPriority thread_priority, size_t max_threads); @@ -124,6 +128,7 @@ std::unique_ptr<SchedulerWorkerThread::Delegate> worker_thread_delegate_; TaskTracker* const task_tracker_; + DelayedTaskManager* const delayed_task_manager_; DISALLOW_COPY_AND_ASSIGN(SchedulerThreadPool); };
diff --git a/base/task_scheduler/scheduler_thread_pool_unittest.cc b/base/task_scheduler/scheduler_thread_pool_unittest.cc index 462c5b9..7e1ec5c 100644 --- a/base/task_scheduler/scheduler_thread_pool_unittest.cc +++ b/base/task_scheduler/scheduler_thread_pool_unittest.cc
@@ -19,6 +19,7 @@ #include "base/synchronization/lock.h" #include "base/synchronization/waitable_event.h" #include "base/task_runner.h" +#include "base/task_scheduler/delayed_task_manager.h" #include "base/task_scheduler/sequence.h" #include "base/task_scheduler/sequence_sort_key.h" #include "base/task_scheduler/task_tracker.h" @@ -37,14 +38,14 @@ class TaskSchedulerThreadPoolTest : public testing::TestWithParam<ExecutionMode> { protected: - TaskSchedulerThreadPoolTest() = default; + TaskSchedulerThreadPoolTest() : delayed_task_manager_(Bind(&DoNothing)) {} void SetUp() override { thread_pool_ = SchedulerThreadPool::CreateThreadPool( ThreadPriority::NORMAL, kNumThreadsInThreadPool, Bind(&TaskSchedulerThreadPoolTest::EnqueueSequenceCallback, Unretained(this)), - &task_tracker_); + &task_tracker_, &delayed_task_manager_); ASSERT_TRUE(thread_pool_); } @@ -65,6 +66,7 @@ } TaskTracker task_tracker_; + DelayedTaskManager delayed_task_manager_; DISALLOW_COPY_AND_ASSIGN(TaskSchedulerThreadPoolTest); };
diff --git a/base/task_scheduler/task_traits.cc b/base/task_scheduler/task_traits.cc index 1229d0d..dd55535 100644 --- a/base/task_scheduler/task_traits.cc +++ b/base/task_scheduler/task_traits.cc
@@ -36,15 +36,6 @@ return *this; } -bool TaskTraits::operator==(const TaskTraits& other) const { - static_assert(sizeof(TaskTraits) == - offsetof(TaskTraits, shutdown_behavior_) + - sizeof(TaskTraits::shutdown_behavior_), - "TaskTraits members changed. Update operator==."); - return with_file_io_ == other.with_file_io_ && priority_ == other.priority_ && - shutdown_behavior_ == other.shutdown_behavior_; -} - std::ostream& operator<<(std::ostream& os, const TaskPriority& task_priority) { switch (task_priority) { case TaskPriority::BACKGROUND:
diff --git a/base/task_scheduler/task_traits.h b/base/task_scheduler/task_traits.h index 9a1b2222..523fd137 100644 --- a/base/task_scheduler/task_traits.h +++ b/base/task_scheduler/task_traits.h
@@ -107,8 +107,6 @@ // Returns the shutdown behavior of tasks with these traits. TaskShutdownBehavior shutdown_behavior() const { return shutdown_behavior_; } - bool operator==(const TaskTraits& other) const; - private: bool with_file_io_; TaskPriority priority_;
diff --git a/base/task_scheduler/utils.cc b/base/task_scheduler/utils.cc index 88bdcf9..30ca461 100644 --- a/base/task_scheduler/utils.cc +++ b/base/task_scheduler/utils.cc
@@ -6,9 +6,9 @@ #include <utility> -#include "base/callback.h" #include "base/logging.h" #include "base/memory/ptr_util.h" +#include "base/task_scheduler/delayed_task_manager.h" #include "base/task_scheduler/priority_queue.h" #include "base/task_scheduler/scheduler_task_executor.h" #include "base/task_scheduler/sequence_sort_key.h" @@ -18,28 +18,27 @@ namespace base { namespace internal { -bool PostTaskToExecutor(const tracked_objects::Location& posted_from, - const Closure& closure, - const TaskTraits& traits, - const TimeDelta& delay, +bool PostTaskToExecutor(std::unique_ptr<Task> task, scoped_refptr<Sequence> sequence, SchedulerTaskExecutor* executor, - TaskTracker* task_tracker) { - DCHECK(!closure.is_null()); + TaskTracker* task_tracker, + DelayedTaskManager* delayed_task_manager) { + DCHECK(task); DCHECK(sequence); DCHECK(executor); DCHECK(task_tracker); - - // TODO(fdoray): Support delayed tasks. - DCHECK(delay.is_zero()); - - std::unique_ptr<Task> task( - new Task(posted_from, closure, traits, TimeTicks())); + DCHECK(delayed_task_manager); if (!task_tracker->WillPostTask(task.get())) return false; - executor->PostTaskWithSequence(std::move(task), std::move(sequence)); + if (task->delayed_run_time.is_null()) { + executor->PostTaskWithSequence(std::move(task), std::move(sequence)); + } else { + delayed_task_manager->AddDelayedTask(std::move(task), std::move(sequence), + executor); + } + return true; }
diff --git a/base/task_scheduler/utils.h b/base/task_scheduler/utils.h index 88eafd5..929d65c 100644 --- a/base/task_scheduler/utils.h +++ b/base/task_scheduler/utils.h
@@ -8,33 +8,26 @@ #include <memory> #include "base/base_export.h" -#include "base/callback_forward.h" -#include "base/location.h" #include "base/memory/ref_counted.h" #include "base/task_scheduler/sequence.h" #include "base/task_scheduler/task.h" namespace base { - -class TaskTraits; -class TimeDelta; - namespace internal { +class DelayedTaskManager; class PriorityQueue; class SchedulerTaskExecutor; class TaskTracker; -// Attempts to post a task to the provided |sequence| and |executor| conditional -// on |task_tracker|. Returns true if the task is posted. -bool BASE_EXPORT -PostTaskToExecutor(const tracked_objects::Location& posted_from, - const Closure& closure, - const TaskTraits& traits, - const TimeDelta& delay, - scoped_refptr<Sequence> sequence, - SchedulerTaskExecutor* executor, - TaskTracker* task_tracker); +// Attempts to post |task| to the provided |sequence| and |executor| conditional +// on |task_tracker|. If |task| has a delayed run time, it is handled by +// |delayed_task_manager|. Returns true if the task is posted. +bool BASE_EXPORT PostTaskToExecutor(std::unique_ptr<Task> task, + scoped_refptr<Sequence> sequence, + SchedulerTaskExecutor* executor, + TaskTracker* task_tracker, + DelayedTaskManager* delayed_task_manager); // Posts |task| to the provided |sequence| and |priority_queue|. This must only // be called after |task|'s delayed run time. Returns true if |sequence| was
diff --git a/base/task_scheduler/utils_unittest.cc b/base/task_scheduler/utils_unittest.cc index c2962f6..eb8d888 100644 --- a/base/task_scheduler/utils_unittest.cc +++ b/base/task_scheduler/utils_unittest.cc
@@ -8,9 +8,9 @@ #include "base/bind.h" #include "base/bind_helpers.h" -#include "base/callback.h" #include "base/memory/ptr_util.h" #include "base/memory/ref_counted.h" +#include "base/task_scheduler/delayed_task_manager.h" #include "base/task_scheduler/priority_queue.h" #include "base/task_scheduler/scheduler_task_executor.h" #include "base/task_scheduler/sequence.h" @@ -20,11 +20,6 @@ #include "testing/gtest/include/gtest/gtest.h" namespace base { - -bool operator==(const Closure& lhs, const Closure& rhs) { - return lhs.Equals(rhs); -} - namespace internal { namespace { @@ -32,26 +27,43 @@ public: void PostTaskWithSequence(std::unique_ptr<Task> task, scoped_refptr<Sequence> sequence) override { - PostTaskWithSequenceMock(task->task, task->traits, sequence.get()); + PostTaskWithSequenceMock(task.get(), sequence.get()); } - MOCK_METHOD3(PostTaskWithSequenceMock, - void(const Closure&, const TaskTraits&, Sequence* sequence)); + MOCK_METHOD2(PostTaskWithSequenceMock, + void(const Task* task, const Sequence* sequence)); }; -// Verifies that when PostTaskToExecutor receives a Task that is allowed to be -// posted, it forwards it to a SchedulerTaskExecutor. +// Verifies that when PostTaskToExecutor receives a non-delayed Task that is +// allowed to be posted, it forwards it to a SchedulerTaskExecutor. TEST(TaskSchedulerPostTaskToExecutorTest, PostTaskAllowed) { - const Closure closure(Bind(&DoNothing)); - const TaskTraits traits; + std::unique_ptr<Task> task( + new Task(FROM_HERE, Bind(&DoNothing), TaskTraits(), TimeTicks())); + const Task* task_raw = task.get(); scoped_refptr<Sequence> sequence(new Sequence); testing::StrictMock<MockSchedulerTaskExecutor> executor; TaskTracker task_tracker; + DelayedTaskManager delayed_task_manager(Bind(&DoNothing)); - EXPECT_CALL(executor, - PostTaskWithSequenceMock(closure, traits, sequence.get())); - PostTaskToExecutor(FROM_HERE, closure, traits, TimeDelta(), sequence, - &executor, &task_tracker); + EXPECT_CALL(executor, PostTaskWithSequenceMock(task_raw, sequence.get())); + PostTaskToExecutor(std::move(task), sequence, &executor, &task_tracker, + &delayed_task_manager); +} + +// Verifies that when PostTaskToExecutor receives a delayed Task that is allowed +// to be posted, it forwards it to a DelayedTaskManager. +TEST(TaskSchedulerPostTaskToExecutorTest, PostDelayedTaskAllowed) { + scoped_refptr<Sequence> sequence(new Sequence); + testing::StrictMock<MockSchedulerTaskExecutor> executor; + TaskTracker task_tracker; + DelayedTaskManager delayed_task_manager(Bind(&DoNothing)); + + EXPECT_TRUE(delayed_task_manager.GetDelayedRunTime().is_null()); + PostTaskToExecutor( + WrapUnique(new Task(FROM_HERE, Bind(&DoNothing), TaskTraits(), + TimeTicks::Now() + TimeDelta::FromSeconds(10))), + sequence, &executor, &task_tracker, &delayed_task_manager); + EXPECT_FALSE(delayed_task_manager.GetDelayedRunTime().is_null()); } // Verifies that when PostTaskToExecutor receives a Task that isn't allowed to @@ -61,12 +73,13 @@ // call to the mock method of |executor|. testing::StrictMock<MockSchedulerTaskExecutor> executor; TaskTracker task_tracker; + DelayedTaskManager delayed_task_manager(Bind(&DoNothing)); task_tracker.Shutdown(); - PostTaskToExecutor( - FROM_HERE, Bind(&DoNothing), - TaskTraits().WithShutdownBehavior(TaskShutdownBehavior::SKIP_ON_SHUTDOWN), - TimeDelta(), make_scoped_refptr(new Sequence), &executor, &task_tracker); + PostTaskToExecutor(WrapUnique(new Task(FROM_HERE, Bind(&DoNothing), + TaskTraits(), TimeTicks())), + make_scoped_refptr(new Sequence), &executor, &task_tracker, + &delayed_task_manager); } // Verifies that when AddTaskToSequenceAndPriorityQueue is called with an empty
diff --git a/blimp/client/app/android/java/src/org/chromium/blimp/BlimpRendererActivity.java b/blimp/client/app/android/java/src/org/chromium/blimp/BlimpRendererActivity.java index d97c9b40..c32d831 100644 --- a/blimp/client/app/android/java/src/org/chromium/blimp/BlimpRendererActivity.java +++ b/blimp/client/app/android/java/src/org/chromium/blimp/BlimpRendererActivity.java
@@ -10,6 +10,7 @@ import android.text.TextUtils; import org.chromium.base.Log; +import org.chromium.base.annotations.SuppressFBWarnings; import org.chromium.base.library_loader.ProcessInitException; import org.chromium.blimp.auth.RetryingTokenSource; import org.chromium.blimp.auth.TokenSource; @@ -43,6 +44,7 @@ private WebInputBox mWebInputBox; @Override + @SuppressFBWarnings("DM_EXIT") // FindBugs doesn't like System.exit(). protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -116,6 +118,8 @@ onTokenUnavailable(false); } break; + default: + break; } }
diff --git a/blimp/client/app/android/java/strings/translations/android_blimp_strings_am.xtb b/blimp/client/app/android/java/strings/translations/android_blimp_strings_am.xtb index c34654af..f7c1159a 100644 --- a/blimp/client/app/android/java/strings/translations/android_blimp_strings_am.xtb +++ b/blimp/client/app/android/java/strings/translations/android_blimp_strings_am.xtb
@@ -5,6 +5,8 @@ <translation id="1416550906796893042">የመተግበሪያ ስሪት</translation> <translation id="2004526128230838685">ምደባ አልተሳካም። ያልታወቀ ችግር።</translation> <translation id="2023631438558435272">ምደባ አልተሳካም። ልክ ያልሆነ ምላሽ።</translation> +<translation id="2078561879028077171">የስሪት መረጃ</translation> +<translation id="2117453604279487107">የመዳቢ ዩአርኤል</translation> <translation id="2353984724370197742">ምደባ አልተሳካም። የአውታረ መረብ ጥያቄ አልተሳካም።</translation> <translation id="3046825211487065480">ምደባ አልተሳካም። ሁለተኛው ጥያቄ ከመጀመሪያው ጥያቄ መልስ ከመስጠቱ በፊት ተልኳል።</translation> <translation id="3346106862344060497">ሞተር ተገናኝቷል።</translation> @@ -14,10 +16,14 @@ <translation id="4562971394107096647">ምደባ አልተሳካም። አገልጋይ ስህተት።</translation> <translation id="4641972508298030550">ተጠቃሚውን ማረጋገጥ አልተቻለም።</translation> <translation id="5184329579814168207">በChrome ውስጥ ክፈት</translation> +<translation id="5340171012633472275">የፕሮግራም ስሪት</translation> +<translation id="5721743316780845421">Blimp %1$s</translation> <translation id="5860346505531085166">ምደባ አልተሳካም። መለያ መዳረሻ የለውም።</translation> +<translation id="6232798399907177395">ስለBlimp</translation> <translation id="704835510384979817">ምደባ አልተሳካም። ምንም ተዛማጅ የፕሮግራም ስሪት የለም።</translation> <translation id="7536363920335771251">የሞተር ግንኙነት ተቋርጧል፣ ምክንያት፦ %1$s</translation> <translation id="7596558890252710462">ስርዓተ ክወና</translation> +<translation id="7608553142876436780">የፕሮግራም አይፒ</translation> <translation id="7961542533680218955">ምደባ ተሳክቷል።</translation> <translation id="8514856595257368555">ማስመሰያ ተገኝቷል።</translation> </translationbundle> \ No newline at end of file
diff --git a/blimp/client/app/android/java/strings/translations/android_blimp_strings_ar.xtb b/blimp/client/app/android/java/strings/translations/android_blimp_strings_ar.xtb index 503b781..b318756 100644 --- a/blimp/client/app/android/java/strings/translations/android_blimp_strings_ar.xtb +++ b/blimp/client/app/android/java/strings/translations/android_blimp_strings_ar.xtb
@@ -5,6 +5,8 @@ <translation id="1416550906796893042">إصدار التطبيق</translation> <translation id="2004526128230838685">أخفق التعيين. مشكلة غير معروفة.</translation> <translation id="2023631438558435272">أخفق التعيين. استجابة غير صالحة.</translation> +<translation id="2078561879028077171">معلومات الإصدار</translation> +<translation id="2117453604279487107">عنوان URL للمعيّن</translation> <translation id="2353984724370197742">أخفق التعيين. أخفق طلب الشبكة.</translation> <translation id="3046825211487065480">أخفق التعيين. تم إرسال الطلب الثاني قبل استجابة الطلب الأول.</translation> <translation id="3346106862344060497">المحرك متصل.</translation> @@ -14,10 +16,14 @@ <translation id="4562971394107096647">أخفق التعيين. خطأ في الخادم.</translation> <translation id="4641972508298030550">تتعذر مصادقة المستخدم.</translation> <translation id="5184329579814168207">فتح في Chrome</translation> +<translation id="5340171012633472275">إصدار المحرك</translation> +<translation id="5721743316780845421">Blimp %1$s</translation> <translation id="5860346505531085166">أخفق التعيين. لا تتوفر إمكانية الدخول إلى الحساب.</translation> +<translation id="6232798399907177395">حول Blimp</translation> <translation id="704835510384979817">أخفق التعيين. لا يوجد إصدار محرك مطابق.</translation> <translation id="7536363920335771251">المحرك غير متصل، والسبب: %1$s</translation> <translation id="7596558890252710462">نظام التشغيل</translation> +<translation id="7608553142876436780">عنوان IP للمحرك</translation> <translation id="7961542533680218955">تم نجاح التعيين.</translation> <translation id="8514856595257368555">تم استرداد الرمز المميز.</translation> </translationbundle> \ No newline at end of file
diff --git a/blimp/client/app/android/java/strings/translations/android_blimp_strings_en-GB.xtb b/blimp/client/app/android/java/strings/translations/android_blimp_strings_en-GB.xtb index f4aca3e..dd840288 100644 --- a/blimp/client/app/android/java/strings/translations/android_blimp_strings_en-GB.xtb +++ b/blimp/client/app/android/java/strings/translations/android_blimp_strings_en-GB.xtb
@@ -5,6 +5,8 @@ <translation id="1416550906796893042">Application version</translation> <translation id="2004526128230838685">Assignment failed. Unknown issue.</translation> <translation id="2023631438558435272">Assignment failed. Invalid response.</translation> +<translation id="2078561879028077171">Version Info</translation> +<translation id="2117453604279487107">Assigner URL</translation> <translation id="2353984724370197742">Assignment failed. Network request failed.</translation> <translation id="3046825211487065480">Assignment failed. Second request sent before first request responded.</translation> <translation id="3346106862344060497">Engine connected.</translation> @@ -14,10 +16,14 @@ <translation id="4562971394107096647">Assignment failed. Server error.</translation> <translation id="4641972508298030550">Unable to authenticate user.</translation> <translation id="5184329579814168207">Open in Chrome</translation> +<translation id="5340171012633472275">Engine Version</translation> +<translation id="5721743316780845421">Blimp %1$s</translation> <translation id="5860346505531085166">Assignment failed. Account does not have access.</translation> +<translation id="6232798399907177395">About Blimp</translation> <translation id="704835510384979817">Assignment failed. No matching engine version.</translation> <translation id="7536363920335771251">Engine disconnected, reason: %1$s</translation> <translation id="7596558890252710462">Operating system</translation> +<translation id="7608553142876436780">Engine IP</translation> <translation id="7961542533680218955">Assignment succeeded.</translation> <translation id="8514856595257368555">Token retrieved.</translation> </translationbundle> \ No newline at end of file
diff --git a/blimp/client/app/android/java/strings/translations/android_blimp_strings_hu.xtb b/blimp/client/app/android/java/strings/translations/android_blimp_strings_hu.xtb index 27a349bb..666ec49 100644 --- a/blimp/client/app/android/java/strings/translations/android_blimp_strings_hu.xtb +++ b/blimp/client/app/android/java/strings/translations/android_blimp_strings_hu.xtb
@@ -5,6 +5,8 @@ <translation id="1416550906796893042">Alkalmazás verziószáma</translation> <translation id="2004526128230838685">A hozzárendelés nem sikerült. Ismeretlen hiba történt.</translation> <translation id="2023631438558435272">A hozzárendelés nem sikerült. Érvénytelen válasz.</translation> +<translation id="2078561879028077171">Verzióinformáció</translation> +<translation id="2117453604279487107">Hozzárendelő URL-je</translation> <translation id="2353984724370197742">A hozzárendelés nem sikerült. Sikertelen hálózati kérés.</translation> <translation id="3046825211487065480">A hozzárendelés nem sikerült. Második kérést küldtek az első kérés megválaszolása előtt.</translation> <translation id="3346106862344060497">Motor csatlakoztatva.</translation> @@ -14,10 +16,14 @@ <translation id="4562971394107096647">A hozzárendelés nem sikerült. Szerverhiba.</translation> <translation id="4641972508298030550">Nem lehet hitelesíteni a felhasználót.</translation> <translation id="5184329579814168207">Megnyitás Chrome-ban</translation> +<translation id="5340171012633472275">Motorverzió</translation> +<translation id="5721743316780845421">Blimp %1$s</translation> <translation id="5860346505531085166">A hozzárendelés nem sikerült. A fióknak nincs hozzáférése.</translation> +<translation id="6232798399907177395">A Blimp névjegye</translation> <translation id="704835510384979817">A hozzárendelés nem sikerült. Nincs egyező motorverzió.</translation> <translation id="7536363920335771251">Motor leválasztva, ok: %1$s</translation> <translation id="7596558890252710462">Operációs rendszer</translation> +<translation id="7608553142876436780">Motor IP-címe</translation> <translation id="7961542533680218955">A hozzárendelés sikerült.</translation> <translation id="8514856595257368555">Token lekérve.</translation> </translationbundle> \ No newline at end of file
diff --git a/blimp/client/app/android/java/strings/translations/android_blimp_strings_iw.xtb b/blimp/client/app/android/java/strings/translations/android_blimp_strings_iw.xtb index 98dad36..8539b95d 100644 --- a/blimp/client/app/android/java/strings/translations/android_blimp_strings_iw.xtb +++ b/blimp/client/app/android/java/strings/translations/android_blimp_strings_iw.xtb
@@ -5,6 +5,8 @@ <translation id="1416550906796893042">גרסת אפליקציה</translation> <translation id="2004526128230838685">ההקצאה נכשלה. בעיה לא ידועה.</translation> <translation id="2023631438558435272">ההקצאה נכשלה. תגובה לא חוקית.</translation> +<translation id="2078561879028077171">פרטי גירסה</translation> +<translation id="2117453604279487107">כתובת אתר של המקצה</translation> <translation id="2353984724370197742">ההקצאה נכשלה. בקשת הרשת נכשלה.</translation> <translation id="3046825211487065480">ההקצאה נכשלה. הבקשה השנייה נשלחה לפני התגובה לבקשה הראשונה.</translation> <translation id="3346106862344060497">המנוע מחובר.</translation> @@ -14,10 +16,14 @@ <translation id="4562971394107096647">ההקצאה נכשלה. שגיאת שרת.</translation> <translation id="4641972508298030550">לא ניתן לאמת את המשתמש.</translation> <translation id="5184329579814168207">פתח ב-Chrome</translation> +<translation id="5340171012633472275">גירסת מנוע</translation> +<translation id="5721743316780845421">Blimp %1$s</translation> <translation id="5860346505531085166">ההקצאה נכשלה. אין לחשבון הרשאת גישה.</translation> +<translation id="6232798399907177395">מידע על Blimp</translation> <translation id="704835510384979817">ההקצאה נכשלה. לא נמצאה גירסת מנוע תואמת.</translation> <translation id="7536363920335771251">המנוע מנותק. הסיבה: %1$s</translation> <translation id="7596558890252710462">מערכת הפעלה</translation> +<translation id="7608553142876436780">כתובת IP של המנוע</translation> <translation id="7961542533680218955">ההקצאה הצליחה.</translation> <translation id="8514856595257368555">האסימון אוחזר.</translation> </translationbundle> \ No newline at end of file
diff --git a/blimp/client/app/android/java/strings/translations/android_blimp_strings_pt-BR.xtb b/blimp/client/app/android/java/strings/translations/android_blimp_strings_pt-BR.xtb index a757145..dc52d40e 100644 --- a/blimp/client/app/android/java/strings/translations/android_blimp_strings_pt-BR.xtb +++ b/blimp/client/app/android/java/strings/translations/android_blimp_strings_pt-BR.xtb
@@ -5,6 +5,8 @@ <translation id="1416550906796893042">Versão do aplicativo</translation> <translation id="2004526128230838685">Falha na atribuição. Problema desconhecido.</translation> <translation id="2023631438558435272">Falha na atribuição. Resposta inválida.</translation> +<translation id="2078561879028077171">Informações da versão</translation> +<translation id="2117453604279487107">URL do atribuidor</translation> <translation id="2353984724370197742">Falha na atribuição. Falha na solicitação de rede.</translation> <translation id="3046825211487065480">Falha na atribuição. Segunda solicitação enviada antes de a primeira solicitação responder.</translation> <translation id="3346106862344060497">Mecanismo conectado.</translation> @@ -14,10 +16,14 @@ <translation id="4562971394107096647">Falha na atribuição. Erro do servidor.</translation> <translation id="4641972508298030550">Não foi possível autenticar usuário.</translation> <translation id="5184329579814168207">Abrir no Google Chrome</translation> +<translation id="5340171012633472275">Versão do mecanismo</translation> +<translation id="5721743316780845421">Blimp %1$s</translation> <translation id="5860346505531085166">Falha na atribuição. A conta não tem acesso.</translation> +<translation id="6232798399907177395">Sobre o Blimp</translation> <translation id="704835510384979817">Falha na atribuição. Nenhuma versão compatível do mecanismo.</translation> <translation id="7536363920335771251">Mecanismo desconectado, motivo: %1$s</translation> <translation id="7596558890252710462">Sistema operacional</translation> +<translation id="7608553142876436780">IP do mecanismo</translation> <translation id="7961542533680218955">Atribuição concluída.</translation> <translation id="8514856595257368555">Token recuperado.</translation> </translationbundle> \ No newline at end of file
diff --git a/blimp/client/app/android/java/strings/translations/android_blimp_strings_pt-PT.xtb b/blimp/client/app/android/java/strings/translations/android_blimp_strings_pt-PT.xtb index d61245d..563947ce 100644 --- a/blimp/client/app/android/java/strings/translations/android_blimp_strings_pt-PT.xtb +++ b/blimp/client/app/android/java/strings/translations/android_blimp_strings_pt-PT.xtb
@@ -5,6 +5,8 @@ <translation id="1416550906796893042">Versão da aplicação</translation> <translation id="2004526128230838685">A atribuição falhou. Problema desconhecido.</translation> <translation id="2023631438558435272">A atribuição falhou. Resposta inválida.</translation> +<translation id="2078561879028077171">Informações da versão</translation> +<translation id="2117453604279487107">URL do atribuidor</translation> <translation id="2353984724370197742">A atribuição falhou. Falha no pedido de rede.</translation> <translation id="3046825211487065480">A atribuição falhou. O segundo pedido foi enviado antes de o primeiro pedido responder.</translation> <translation id="3346106862344060497">Motor ligado.</translation> @@ -14,10 +16,14 @@ <translation id="4562971394107096647">A atribuição falhou. Erro do servidor.</translation> <translation id="4641972508298030550">Não é possível autenticar o utilizador.</translation> <translation id="5184329579814168207">Abrir no Chrome</translation> +<translation id="5340171012633472275">Versão do motor</translation> +<translation id="5721743316780845421">Blimp %1$s</translation> <translation id="5860346505531085166">A atribuição falhou. A conta não tem acesso.</translation> +<translation id="6232798399907177395">Acerca do Blimp</translation> <translation id="704835510384979817">A atribuição falhou. Não há uma versão do motor correspondente.</translation> <translation id="7536363920335771251">Motor desligado, motivo: %1$s</translation> <translation id="7596558890252710462">Sistema operativo</translation> +<translation id="7608553142876436780">IP do motor</translation> <translation id="7961542533680218955">A atribuição foi bem-sucedida.</translation> <translation id="8514856595257368555">Símbolo obtido.</translation> </translationbundle> \ No newline at end of file
diff --git a/blimp/client/app/android/java/strings/translations/android_blimp_strings_ru.xtb b/blimp/client/app/android/java/strings/translations/android_blimp_strings_ru.xtb index edef03c..b2fdb86 100644 --- a/blimp/client/app/android/java/strings/translations/android_blimp_strings_ru.xtb +++ b/blimp/client/app/android/java/strings/translations/android_blimp_strings_ru.xtb
@@ -5,6 +5,8 @@ <translation id="1416550906796893042">Версия приложения</translation> <translation id="2004526128230838685">Неизвестная ошибка.</translation> <translation id="2023631438558435272">Ошибка. Недействительный ответ.</translation> +<translation id="2078561879028077171">Версия</translation> +<translation id="2117453604279487107">URL указателя</translation> <translation id="2353984724370197742">Ошибка. Не удалось обработать запрос.</translation> <translation id="3046825211487065480">Ошибка. Второй запрос был отправлен раньше, чем пришел ответ на первый.</translation> <translation id="3346106862344060497">Соединение установлено.</translation> @@ -14,10 +16,14 @@ <translation id="4562971394107096647">Ошибка сервера.</translation> <translation id="4641972508298030550">Не удалось идентифицировать пользователя.</translation> <translation id="5184329579814168207">Открыть в Chrome</translation> +<translation id="5340171012633472275">Версия поисковой системы</translation> +<translation id="5721743316780845421">Blimp %1$s</translation> <translation id="5860346505531085166">Ошибка. У аккаунта нет права доступа.</translation> +<translation id="6232798399907177395">О Blimp</translation> <translation id="704835510384979817">Ошибка. Совместимая версия поисковой системы отсутствует.</translation> <translation id="7536363920335771251">Соединение прервано. Причина: %1$s.</translation> <translation id="7596558890252710462">Операционная система</translation> +<translation id="7608553142876436780">IP-адрес поисковой системы</translation> <translation id="7961542533680218955">Готово.</translation> <translation id="8514856595257368555">Токен получен.</translation> </translationbundle> \ No newline at end of file
diff --git a/blimp/client/app/android/java/strings/translations/android_blimp_strings_sk.xtb b/blimp/client/app/android/java/strings/translations/android_blimp_strings_sk.xtb index f398a7cc..93afe10 100644 --- a/blimp/client/app/android/java/strings/translations/android_blimp_strings_sk.xtb +++ b/blimp/client/app/android/java/strings/translations/android_blimp_strings_sk.xtb
@@ -5,6 +5,8 @@ <translation id="1416550906796893042">Verzia aplikácie</translation> <translation id="2004526128230838685">Priradenie zlyhalo. Neznáma chyba.</translation> <translation id="2023631438558435272">Priradenie zlyhalo. Neplatná odpoveď.</translation> +<translation id="2078561879028077171">Informácie o verzii</translation> +<translation id="2117453604279487107">Webová adresa postupiteľa</translation> <translation id="2353984724370197742">Priradenie zlyhalo. Zlyhala žiadosť do siete.</translation> <translation id="3046825211487065480">Priradenie zlyhalo. Druhá žiadosť bola odoslaná ešte pred odpoveďou na prvú žiadosť.</translation> <translation id="3346106862344060497">Nástroj bol pripojený.</translation> @@ -14,10 +16,14 @@ <translation id="4562971394107096647">Priradenie zlyhalo. Chyba servera.</translation> <translation id="4641972508298030550">Používateľa sa nepodarilo overiť.</translation> <translation id="5184329579814168207">Otvoriť v prehliadači Chrome</translation> +<translation id="5340171012633472275">Verzia nástroja</translation> +<translation id="5721743316780845421">Blimp %1$s</translation> <translation id="5860346505531085166">Priradenie zlyhalo. Účet nemá prístup.</translation> +<translation id="6232798399907177395">Informácie o nástroji Blimp</translation> <translation id="704835510384979817">Priradenie zlyhalo. Žiadna zodpovedajúca verzia nástroja.</translation> <translation id="7536363920335771251">Nástroj bol odpojený. Dôvod: %1$s</translation> <translation id="7596558890252710462">Operačný systém</translation> +<translation id="7608553142876436780">Adresa IP nástroja</translation> <translation id="7961542533680218955">Priradenie bolo úspešné.</translation> <translation id="8514856595257368555">Token bol načítaný.</translation> </translationbundle> \ No newline at end of file
diff --git a/blimp/client/app/android/java/strings/translations/android_blimp_strings_sw.xtb b/blimp/client/app/android/java/strings/translations/android_blimp_strings_sw.xtb index 98280aa..1364f06 100644 --- a/blimp/client/app/android/java/strings/translations/android_blimp_strings_sw.xtb +++ b/blimp/client/app/android/java/strings/translations/android_blimp_strings_sw.xtb
@@ -5,6 +5,8 @@ <translation id="1416550906796893042">Toleo la programu</translation> <translation id="2004526128230838685">Haijafaulu kuhawilisha. Hitilafu isiyojulikana.</translation> <translation id="2023631438558435272">Haijafaulu kuhawilisha. Jibu si sahihi.</translation> +<translation id="2078561879028077171">Maelezo ya Toleo</translation> +<translation id="2117453604279487107">URL ya anayehawilisha</translation> <translation id="2353984724370197742">Haijafaulu kuhawilisha. Ombi la mtandao halijafaulu.</translation> <translation id="3046825211487065480">Haijafaulu kuhawilisha. Ombi la pili limetumwa kabla ya ombi la kwanza kujibu.</translation> <translation id="3346106862344060497">Mtambo umeunganishwa.</translation> @@ -14,10 +16,14 @@ <translation id="4562971394107096647">Haijafaulu kuhawilisha. Hitilafu ya seva.</translation> <translation id="4641972508298030550">Haikuweza kumthibitisha mtumiaji.</translation> <translation id="5184329579814168207">Fungulia katika Chrome</translation> +<translation id="5340171012633472275">Toleo la Mtambo</translation> +<translation id="5721743316780845421">Blimp %1$s</translation> <translation id="5860346505531085166">Haijafaulu kuhawilisha. Akaunti haina idhini ya kufikia.</translation> +<translation id="6232798399907177395">Kuhusu Blimp</translation> <translation id="704835510384979817">Haijafaulu kuhawilisha. Hakuna toleo la mtambo linalolingana.</translation> <translation id="7536363920335771251">Mtambo umeondolewa, sababu: %1$s</translation> <translation id="7596558890252710462">Mfumo wa uendeshaji</translation> +<translation id="7608553142876436780">IP ya Mtambo</translation> <translation id="7961542533680218955">Imefaulu kuhawilisha.</translation> <translation id="8514856595257368555">Tokeni imerejeshwa.</translation> </translationbundle> \ No newline at end of file
diff --git a/blimp/client/app/android/java/strings/translations/android_blimp_strings_uk.xtb b/blimp/client/app/android/java/strings/translations/android_blimp_strings_uk.xtb index a574e25..878e8ee 100644 --- a/blimp/client/app/android/java/strings/translations/android_blimp_strings_uk.xtb +++ b/blimp/client/app/android/java/strings/translations/android_blimp_strings_uk.xtb
@@ -5,6 +5,8 @@ <translation id="1416550906796893042">Версія додатка</translation> <translation id="2004526128230838685">Не вдалось отримати завдання. Невідома проблема.</translation> <translation id="2023631438558435272">Не вдалось отримати завдання. Недійсна відповідь.</translation> +<translation id="2078561879028077171">Інформація про версію</translation> +<translation id="2117453604279487107">URL-адреса призначення</translation> <translation id="2353984724370197742">Не вдалось отримати завдання. Помилка мережі.</translation> <translation id="3046825211487065480">Не вдалось отримати завдання. Другий запит надіслано до того, як надійшла відповідь на перший.</translation> <translation id="3346106862344060497">Систему під’єднано.</translation> @@ -14,10 +16,14 @@ <translation id="4562971394107096647">Не вдалось отримати завдання. Помилка сервера.</translation> <translation id="4641972508298030550">Не вдається підтвердити облікові дані користувача.</translation> <translation id="5184329579814168207">Відкрити в Chrome</translation> +<translation id="5340171012633472275">Версія системи</translation> +<translation id="5721743316780845421">Blimp %1$s</translation> <translation id="5860346505531085166">Не вдалось отримати завдання. Обліковий запис не має доступу.</translation> +<translation id="6232798399907177395">Про Blimp</translation> <translation id="704835510384979817">Не вдалось отримати завдання. Немає відповідної версії ресурсу.</translation> <translation id="7536363920335771251">Систему від’єднано. Причина: %1$s</translation> <translation id="7596558890252710462">Операційна система</translation> +<translation id="7608553142876436780">IP-адреса системи</translation> <translation id="7961542533680218955">Завдання отримано.</translation> <translation id="8514856595257368555">Маркер отримано.</translation> </translationbundle> \ No newline at end of file
diff --git a/blimp/client/feature/compositor/blimp_compositor.cc b/blimp/client/feature/compositor/blimp_compositor.cc index 0c27935..706b4df1 100644 --- a/blimp/client/feature/compositor/blimp_compositor.cc +++ b/blimp/client/feature/compositor/blimp_compositor.cc
@@ -112,12 +112,6 @@ void BlimpCompositor::DidCompletePageScaleAnimation() {} -void BlimpCompositor::RecordFrameTimingEvents( - std::unique_ptr<cc::FrameTimingTracker::CompositeTimingSet> - composite_events, - std::unique_ptr<cc::FrameTimingTracker::MainFrameTimingSet> - main_frame_events) {} - void BlimpCompositor::SetProtoReceiver(ProtoReceiver* receiver) { remote_proto_channel_receiver_ = receiver; }
diff --git a/blimp/client/feature/compositor/blimp_compositor.h b/blimp/client/feature/compositor/blimp_compositor.h index c558b50f..76f2861 100644 --- a/blimp/client/feature/compositor/blimp_compositor.h +++ b/blimp/client/feature/compositor/blimp_compositor.h
@@ -150,11 +150,6 @@ void DidCommitAndDrawFrame() override; void DidCompleteSwapBuffers() override; void DidCompletePageScaleAnimation() override; - void RecordFrameTimingEvents( - std::unique_ptr<cc::FrameTimingTracker::CompositeTimingSet> - composite_events, - std::unique_ptr<cc::FrameTimingTracker::MainFrameTimingSet> - main_frame_events) override; // RemoteProtoChannel implementation. void SetProtoReceiver(ProtoReceiver* receiver) override;
diff --git a/blimp/client/feature/compositor/blimp_gpu_memory_buffer_manager.cc b/blimp/client/feature/compositor/blimp_gpu_memory_buffer_manager.cc index 4aae7d9..d94f15fb 100644 --- a/blimp/client/feature/compositor/blimp_gpu_memory_buffer_manager.cc +++ b/blimp/client/feature/compositor/blimp_gpu_memory_buffer_manager.cc
@@ -7,6 +7,8 @@ #include <stddef.h> #include <stdint.h> +#include <memory> + #include "base/logging.h" #include "base/memory/ptr_util.h" #include "base/numerics/safe_conversions.h"
diff --git a/blimp/client/feature/compositor/blimp_gpu_memory_buffer_manager.h b/blimp/client/feature/compositor/blimp_gpu_memory_buffer_manager.h index cbd5552..997e242 100644 --- a/blimp/client/feature/compositor/blimp_gpu_memory_buffer_manager.h +++ b/blimp/client/feature/compositor/blimp_gpu_memory_buffer_manager.h
@@ -5,6 +5,8 @@ #ifndef BLIMP_CLIENT_FEATURE_COMPOSITOR_BLIMP_GPU_MEMORY_BUFFER_MANAGER_H_ #define BLIMP_CLIENT_FEATURE_COMPOSITOR_BLIMP_GPU_MEMORY_BUFFER_MANAGER_H_ +#include <memory> + #include "base/macros.h" #include "gpu/command_buffer/client/gpu_memory_buffer_manager.h"
diff --git a/blimp/common/blob_cache/blob_cache.h b/blimp/common/blob_cache/blob_cache.h index 54993238..45c9eb9 100644 --- a/blimp/common/blob_cache/blob_cache.h +++ b/blimp/common/blob_cache/blob_cache.h
@@ -14,7 +14,8 @@ namespace blimp { using BlobId = std::string; -using BlobData = scoped_refptr<base::RefCountedData<const std::string>>; +using BlobData = base::RefCountedData<const std::string>; +using BlobDataPtr = scoped_refptr<BlobData>; // An interface for a cache of blobs. class BLIMP_COMMON_EXPORT BlobCache { @@ -26,11 +27,11 @@ // Stores |data| with the identifier |id| in the cache. // Command is ignored if there is already a cache item stored under |id|. - virtual void Put(const BlobId& id, BlobData data) = 0; + virtual void Put(const BlobId& id, BlobDataPtr data) = 0; // Returns a pointer to the cache item |id|, or nullptr if no cache item // exists under that identifier. - virtual BlobData Get(const BlobId& id) const = 0; + virtual BlobDataPtr Get(const BlobId& id) const = 0; }; } // namespace blimp
diff --git a/blimp/common/blob_cache/in_memory_blob_cache.cc b/blimp/common/blob_cache/in_memory_blob_cache.cc index 5928faa..fbdfe50 100644 --- a/blimp/common/blob_cache/in_memory_blob_cache.cc +++ b/blimp/common/blob_cache/in_memory_blob_cache.cc
@@ -15,7 +15,7 @@ InMemoryBlobCache::~InMemoryBlobCache() {} -void InMemoryBlobCache::Put(const BlobId& id, BlobData data) { +void InMemoryBlobCache::Put(const BlobId& id, BlobDataPtr data) { if (Contains(id)) { // In cases where the engine has miscalculated what is already available // on the client, Put() might be called unnecessarily, which should be @@ -30,7 +30,7 @@ return cache_.find(id) != cache_.end(); } -BlobData InMemoryBlobCache::Get(const BlobId& id) const { +BlobDataPtr InMemoryBlobCache::Get(const BlobId& id) const { if (!Contains(id)) { return nullptr; }
diff --git a/blimp/common/blob_cache/in_memory_blob_cache.h b/blimp/common/blob_cache/in_memory_blob_cache.h index 986feb4..b4177cd 100644 --- a/blimp/common/blob_cache/in_memory_blob_cache.h +++ b/blimp/common/blob_cache/in_memory_blob_cache.h
@@ -24,11 +24,11 @@ // BlobCache implementation. bool Contains(const BlobId& id) const override; - void Put(const BlobId& id, BlobData data) override; - BlobData Get(const BlobId& id) const override; + void Put(const BlobId& id, BlobDataPtr data) override; + BlobDataPtr Get(const BlobId& id) const override; private: - std::map<const BlobId, BlobData> cache_; + std::map<const BlobId, BlobDataPtr> cache_; DISALLOW_COPY_AND_ASSIGN(InMemoryBlobCache); };
diff --git a/blimp/common/blob_cache/in_memory_blob_cache_unittest.cc b/blimp/common/blob_cache/in_memory_blob_cache_unittest.cc index e0531e4c..828c395 100644 --- a/blimp/common/blob_cache/in_memory_blob_cache_unittest.cc +++ b/blimp/common/blob_cache/in_memory_blob_cache_unittest.cc
@@ -21,8 +21,8 @@ const char kDeadbeef[] = "\xde\xad\xbe\xef"; const char kForbiddenCode[] = "\x4b\x1d\xc0\xd3"; -BlobData CreateBlobData(const std::string& data) { - return new base::RefCountedData<const std::string>(data); +BlobDataPtr CreateBlobDataPtr(const std::string& data) { + return new BlobData(data); } class InMemoryBlobCacheTest : public testing::Test { @@ -38,29 +38,29 @@ EXPECT_FALSE(cache_.Contains(kFoo)); EXPECT_EQ(nullptr, cache_.Get(kFoo)); - BlobData blob_data = CreateBlobData(kDeadbeef); + BlobDataPtr blob_data = CreateBlobDataPtr(kDeadbeef); cache_.Put(kFoo, blob_data); EXPECT_TRUE(cache_.Contains(kFoo)); EXPECT_FALSE(cache_.Contains(kBar)); - BlobData out = cache_.Get(kFoo); + BlobDataPtr out = cache_.Get(kFoo); EXPECT_EQ(blob_data, out); } TEST_F(InMemoryBlobCacheTest, TestDuplicatePut) { - BlobData first = CreateBlobData(kDeadbeef); - BlobData duplicate = CreateBlobData(kForbiddenCode); + BlobDataPtr first = CreateBlobDataPtr(kDeadbeef); + BlobDataPtr duplicate = CreateBlobDataPtr(kForbiddenCode); cache_.Put(kFoo, first); - BlobData out1 = cache_.Get(kFoo); + BlobDataPtr out1 = cache_.Get(kFoo); EXPECT_EQ(first, out1); // The second put should be ignored and retrieving kFoo should still retrieve // the first item. cache_.Put(kFoo, duplicate); - BlobData out2 = cache_.Get(kFoo); + BlobDataPtr out2 = cache_.Get(kFoo); EXPECT_EQ(first, out2); }
diff --git a/blimp/common/compositor/webp_decoder.cc b/blimp/common/compositor/webp_decoder.cc index 436df4e..ff006c96 100644 --- a/blimp/common/compositor/webp_decoder.cc +++ b/blimp/common/compositor/webp_decoder.cc
@@ -54,7 +54,7 @@ std::string hex_id = FormatBlobId(deserialized.id()); // Declared here to still be in scope while decoding WebP data. - BlobData cached; + BlobDataPtr cached; // Set to true if the client already has the data in its cache. If it does not // keeping |found_in_cache| as false will trigger caching the input in the @@ -131,7 +131,7 @@ if (!found_in_cache) { DVLOG(2) << "Inserting image to cache with SHA1: " << hex_id << " size: " << webp_data.size; - BlobData to_cache(new base::RefCountedData<const std::string>(std::string( + BlobDataPtr to_cache(new BlobData(std::string( reinterpret_cast<const char*>(webp_data.bytes), webp_data.size))); g_blob_cache.Get().Put(deserialized.id(), std::move(to_cache)); }
diff --git a/blimp/net/input_message_generator.cc b/blimp/net/input_message_generator.cc index cfdc7c89..195def3a 100644 --- a/blimp/net/input_message_generator.cc +++ b/blimp/net/input_message_generator.cc
@@ -170,6 +170,7 @@ case blink::WebInputEvent::Type::TouchMove: case blink::WebInputEvent::Type::TouchEnd: case blink::WebInputEvent::Type::TouchCancel: + case blink::WebInputEvent::Type::TouchScrollStarted: NOTIMPLEMENTED(); return nullptr; }
diff --git a/breakpad/breakpad.gyp b/breakpad/breakpad.gyp index b77bc7a..9feab73d 100644 --- a/breakpad/breakpad.gyp +++ b/breakpad/breakpad.gyp
@@ -715,7 +715,6 @@ 'variables': { 'test_type': 'gtest', 'test_suite_name': '<(_target_name)', - 'isolate_file': 'breakpad_unittests.isolate', }, 'includes': [ '../build/android/test_runner.gypi' ], 'ldflags!': [
diff --git a/build/all.gyp b/build/all.gyp index 7760325c..b51b9d9b 100644 --- a/build/all.gyp +++ b/build/all.gyp
@@ -827,7 +827,6 @@ '../ui/android/ui_android.gyp:ui_android_unittests', '../ui/base/ui_base_tests.gyp:ui_base_unittests', '../ui/events/events_unittests.gyp:events_unittests', - '../ui/latency_info/latency_info_unittests.gyp:latency_info_unittests', '../ui/touch_selection/ui_touch_selection.gyp:ui_touch_selection_unittests', # Unit test bundles packaged as an apk. '../base/base.gyp:base_unittests_apk', @@ -856,7 +855,6 @@ '../ui/events/events_unittests.gyp:events_unittests_apk', '../ui/gfx/gfx_tests.gyp:gfx_unittests_apk', '../ui/gl/gl_tests.gyp:gl_unittests_apk', - '../ui/latency_info/latency_info_unittests.gyp:latency_info_unittests', '../ui/touch_selection/ui_touch_selection.gyp:ui_touch_selection_unittests_apk', ], 'conditions': [ @@ -1056,7 +1054,6 @@ '../ui/events/events_unittests.gyp:events_unittests', '../ui/gfx/gfx_tests.gyp:gfx_unittests', '../ui/gl/gl_tests.gyp:gl_unittests', - '../ui/latency_info/latency_info_unittests.gyp:latency_info_unittests', '../ui/touch_selection/ui_touch_selection.gyp:ui_touch_selection_unittests', '../ui/views/views.gyp:views_unittests', '../url/url.gyp:url_unittests', @@ -1160,7 +1157,6 @@ '../ui/gfx/gfx_tests.gyp:gfx_unittests', '../ui/gl/gl_tests.gyp:gl_unittests', '../ui/keyboard/keyboard.gyp:keyboard_unittests', - '../ui/latency_info/latency_info_unittests.gyp:latency_info_unittests', '../ui/touch_selection/ui_touch_selection.gyp:ui_touch_selection_unittests', '../url/url.gyp:url_unittests', ], @@ -1279,7 +1275,6 @@ '../ui/events/events.gyp:*', '../ui/gfx/gfx_tests.gyp:gfx_unittests', '../ui/gl/gl_tests.gyp:gl_unittests', - '../ui/latency_info/latency_info.gyp:*', '../ui/keyboard/keyboard.gyp:*', '../ui/snapshot/snapshot.gyp:snapshot_unittests', '../ui/touch_selection/ui_touch_selection.gyp:ui_touch_selection_unittests',
diff --git a/build/common.gypi b/build/common.gypi index 609422e..963f9bc2 100644 --- a/build/common.gypi +++ b/build/common.gypi
@@ -3097,6 +3097,10 @@ # TODO: Enable on Windows too, http://crbug.com/404525 'variables': { 'clang_warning_flags': ['-Wexit-time-destructors']}, }], + ['"<!(python <(DEPTH)/tools/clang/scripts/update.py --print-revision)"!="266460-1"', { + # TODO(thakis): https://crbug.com/604888 + 'variables': { 'clang_warning_flags': ['-Wno-undefined-var-template']}, + }], ['chromium_code==0', { 'variables': { 'clang_warning_flags': [
diff --git a/build/config/android/internal_rules.gni b/build/config/android/internal_rules.gni index c7fed43..ec5f76c 100644 --- a/build/config/android/internal_rules.gni +++ b/build/config/android/internal_rules.gni
@@ -1935,6 +1935,7 @@ sources = [] forward_variables_from(invoker, [ + "data", "deps", "inputs", "sources", @@ -2077,13 +2078,18 @@ defined(invoker.incremental_install) && invoker.incremental_install action(target_name) { + data_deps = [] + deps = [] + forward_variables_from(invoker, + [ + "data_deps", + "deps", + ]) + script = "//build/android/gyp/create_test_runner_script.py" depfile = "$target_gen_dir/$target_name.d" - deps = [] - datadeps = [ - "//build/android:test_runner_py", - ] + data_deps += [ "//build/android:test_runner_py" ] test_runner_args = [ _test_type,
diff --git a/build/config/android/rules.gni b/build/config/android/rules.gni index ed42b575..591ccc49 100644 --- a/build/config/android/rules.gni +++ b/build/config/android/rules.gni
@@ -2282,6 +2282,9 @@ ] dest = invoker.dist_dir + data = [ + "${invoker.dist_dir}/", + ] _rebased_libraries_list = rebase_path(_libraries_list, root_build_dir) _rebased_binaries_list = rebase_path([ invoker.binary ], root_build_dir)
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn index 3cf7222..aae3bac6 100644 --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn
@@ -835,12 +835,6 @@ if (visual_studio_version == "2015") { cflags += [ - # VC++ 2015 changes 32-bit size_t truncation warnings from 4244 to 4267. - # Example: short TruncTest(size_t x) { return x; } - # Since we disable 4244 we need to disable 4267 during migration. - # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. - "/wd4267", - # C4312 is a VS 2015 64-bit warning for integer to larger pointer. # TODO(brucedawson): fix warnings, crbug.com/554200 "/wd4312", @@ -851,6 +845,16 @@ # See http://bugs.icu-project.org/trac/ticket/11122 "/wd4595", ] + + if (current_cpu == "x86") { + cflags += [ + # VC++ 2015 changes 32-bit size_t truncation warnings from 4244 to + # 4267. Example: short TruncTest(size_t x) { return x; } + # Since we disable 4244 we need to disable 4267 during migration. + # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. + "/wd4267", + ] + } } # VS xtree header file needs to be patched or 4702 (unreachable code @@ -955,6 +959,15 @@ # TODO(thakis): Enable this, crbug.com/507717 "-Wno-shift-negative-value", ] + + if (exec_script("//tools/clang/scripts/update.py", + [ "--print-revision" ], + "trim string") != "266460-1") { + cflags += [ + # TODO(thakis): https://crbug.com/604888 + "-Wno-undefined-var-template", + ] + } } } }
diff --git a/build/config/ios/ios_compile_xib.py b/build/config/ios/ios_compile_xib.py deleted file mode 100644 index ebca3ab..0000000 --- a/build/config/ios/ios_compile_xib.py +++ /dev/null
@@ -1,34 +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 argparse -import os -import subprocess -import sys - - -def main(): - parser = argparse.ArgumentParser( - description='A script to compile xib and storyboard.', - fromfile_prefix_chars='@') - parser.add_argument('-o', '--output', required=True, - help='Path to output bundle.') - parser.add_argument('-i', '--input', required=True, - help='Path to input xib or storyboard.') - parser.add_argument('-m', '--minimum-deployment-target', required=True, - help='Minimum deployment target.') - args = parser.parse_args() - - subprocess.check_call([ - 'xcrun', 'ibtool', '--errors', '--warnings', '--notices', - '--auto-activate-custom-fonts', '--target-device', 'iphone', - '--target-device', 'ipad', '--output-format', 'human-readable-text', - '--minimum-deployment-target', args.minimum_deployment_target, - '--compile', os.path.abspath(args.output), os.path.abspath(args.input), - ]) - - -if __name__ == '__main__': - sys.exit(main())
diff --git a/build/config/ios/rules.gni b/build/config/ios/rules.gni index 171dbf5..5d5e273 100644 --- a/build/config/ios/rules.gni +++ b/build/config/ios/rules.gni
@@ -188,25 +188,19 @@ _target_name = target_name _compile_xib = target_name + "_compile_xib" - _nib_basename = get_path_info(invoker.source, "name") - _nib_filename = "$_nib_basename.nib" - - action(_compile_xib) { - visibility = [ ":$_target_name" ] - script = "//build/config/ios/ios_compile_xib.py" + compile_xibs(_compile_xib) { sources = [ invoker.source, ] - outputs = [ - "$target_gen_dir/$_nib_filename", - ] - args = [ + visibility = [ ":$_target_name" ] + ibtool_flags = [ "--minimum-deployment-target", ios_deployment_target, - "--output", - rebase_path("$target_gen_dir/$_nib_filename"), - "--input", - rebase_path(invoker.source, root_out_dir), + "--auto-activate-custom-fonts", + "--target-device", + "iphone", + "--target-device", + "ipad", ] } @@ -218,11 +212,10 @@ } public_deps += [ ":$_compile_xib" ] - sources = [ - "$target_gen_dir/$_nib_filename", - ] + sources = get_target_outputs(":$_compile_xib") + outputs = [ - "{{bundle_resources_dir}}/$_nib_filename", + "{{bundle_resources_dir}}/{{source_file_part}}", ] } }
diff --git a/build/config/mac/compile_xib.py b/build/config/mac/compile_xib.py new file mode 100644 index 0000000..845f8c1 --- /dev/null +++ b/build/config/mac/compile_xib.py
@@ -0,0 +1,51 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + + +import argparse +import os +import re +import subprocess +import sys + + +def main(): + parser = argparse.ArgumentParser( + description='A script to compile xib and storyboard.', + fromfile_prefix_chars='@') + parser.add_argument('-o', '--output', required=True, + help='Path to output bundle.') + parser.add_argument('-i', '--input', required=True, + help='Path to input xib or storyboard.') + args, unknown_args = parser.parse_known_args() + + ibtool_args = [ + 'xcrun', 'ibtool', + '--errors', '--warnings', '--notices', + '--output-format', 'human-readable-text' + ] + ibtool_args += unknown_args + ibtool_args += [ + '--compile', + os.path.abspath(args.output), + os.path.abspath(args.input) + ] + + ibtool_section_re = re.compile(r'/\*.*\*/') + ibtool_re = re.compile(r'.*note:.*is clipping its content') + ibtoolout = subprocess.Popen(ibtool_args, stdout=subprocess.PIPE) + current_section_header = None + for line in ibtoolout.stdout: + if ibtool_section_re.match(line): + current_section_header = line + elif not ibtool_re.match(line): + if current_section_header: + sys.stdout.write(current_section_header) + current_section_header = None + sys.stdout.write(line) + return ibtoolout.returncode + + +if __name__ == '__main__': + sys.exit(main())
diff --git a/build/config/mac/rules.gni b/build/config/mac/rules.gni index cdb12d9..11b86c9 100644 --- a/build/config/mac/rules.gni +++ b/build/config/mac/rules.gni
@@ -3,6 +3,7 @@ # found in the LICENSE file. import("//build/toolchain/toolchain.gni") +import("//build/config/mac/mac_sdk.gni") # This is used as the base template for both iOS and Mac frameworks.. # @@ -137,6 +138,94 @@ } } +# Template to combile .xib or .storyboard files. +# +# +# Arguments +# +# sources: +# list of string, sources to compile +# +# ibtool_flags: +# (optional) list of string, additional flags to pass to the ibtool +template("compile_xibs") { + action_foreach(target_name) { + forward_variables_from(invoker, + [ + "testonly", + "visibility", + ]) + assert(defined(invoker.sources), + "Sources must be specified for $target_name") + + ibtool_flags = [] + if (defined(invoker.ibtool_flags)) { + ibtool_flags = invoker.ibtool_flags + } + + script = "//build/config/mac/compile_xib.py" + sources = invoker.sources + outputs = [ + "$target_gen_dir/{{source_name_part}}.nib", + ] + args = [ + "--input", + "{{source}}", + "--output", + rebase_path("$target_gen_dir/{{source_name_part}}.nib"), + ] + ibtool_flags + } +} + +# Template to compile and package Mac XIB files as bundle data. +# +# Arguments +# +# sources: +# list of string, sources to comiple +# +# output_path: +# (optional) string, the path to use for the outputs list in the +# bundle_data step. If unspecified, defaults to bundle_resources_dir. +template("mac_xib_bundle_data") { + _target_name = target_name + _compile_target_name = _target_name + "_compile_ibtool" + + compile_xibs(_compile_target_name) { + forward_variables_from(invoker, [ "testonly" ]) + visibility = [ ":$_target_name" ] + sources = invoker.sources + ibtool_flags = [ + "--minimum-deployment-target", + mac_deployment_target, + "--target-device", + "mac", + ] + } + + bundle_data(_target_name) { + forward_variables_from(invoker, + [ + "testonly", + "visibility", + ]) + + public_deps = [ + ":$_compile_target_name", + ] + sources = get_target_outputs(":$_compile_target_name") + + _output_path = "{{bundle_resources_dir}}" + if (defined(invoker.output_path)) { + _output_path = invoker.output_path + } + + outputs = [ + "$_output_path/{{source_file_part}}", + ] + } +} + # Template to package a shared library into a Mac framework bundle. # # Arguments @@ -290,6 +379,11 @@ _loadable_module_target = _target_name + "_loadable_module" _loadable_module_bundle_data = _loadable_module_target + "_bundle_data" + _output_name = _target_name + if (defined(invoker.output_name)) { + _output_name = invoker.output_name + } + loadable_module(_loadable_module_target) { visibility = [ ":$_loadable_module_bundle_data" ] forward_variables_from(invoker, @@ -300,15 +394,18 @@ "output_name", "visibility", ]) + output_dir = "$target_out_dir" + output_name = _output_name } bundle_data(_loadable_module_bundle_data) { + forward_variables_from(invoker, [ "testonly" ]) visibility = [ ":$_target_name" ] sources = [ - "$root_out_dir/${_loadable_module_target}.so", + "$target_out_dir/${_output_name}.so", ] outputs = [ - "{{bundle_executable_dir}}/$_target_name", + "{{bundle_executable_dir}}/$_output_name", ] public_deps = [ ":$_loadable_module_target", @@ -329,7 +426,7 @@ } deps += [ ":$_loadable_module_bundle_data" ] - bundle_root_dir = "$root_out_dir/$_target_name.plugin/Contents" + bundle_root_dir = "$root_out_dir/$_output_name.plugin/Contents" bundle_executable_dir = "$bundle_root_dir/MacOS" } }
diff --git a/build/gypi_to_gn.py b/build/gypi_to_gn.py index a5175a40..0800708 100644 --- a/build/gypi_to_gn.py +++ b/build/gypi_to_gn.py
@@ -4,6 +4,29 @@ """Converts a given gypi file to a python scope and writes the result to stdout. +USING THIS SCRIPT IN CHROMIUM + +Forking Python to run this script in the middle of GN is slow, especially on +Windows, and it makes both the GYP and GN files harder to follow. You can't +use "git grep" to find files in the GN build any more, and tracking everything +in GYP down requires a level of indirection. Any calls will have to be removed +and cleaned up once the GYP-to-GN transition is complete. + +As a result, we only use this script when the list of files is large and +frequently-changing. In these cases, having one canonical list outweights the +downsides. + +As of this writing, the GN build is basically complete. It's likely that all +large and frequently changing targets where this is appropriate use this +mechanism already. And since we hope to turn down the GYP build soon, the time +horizon is also relatively short. As a result, it is likely that no additional +uses of this script should every be added to the build. During this later part +of the transition period, we should be focusing more and more on the absolute +readability of the GN build. + + +HOW TO USE + It is assumed that the file contains a toplevel dictionary, and this script will return that dictionary as a GN "scope" (see example below). This script does not know anything about GYP and it will not expand variables or execute
diff --git a/build/secondary/testing/gtest/BUILD.gn b/build/secondary/testing/gtest/BUILD.gn index 13d49f12..79b6bd5 100644 --- a/build/secondary/testing/gtest/BUILD.gn +++ b/build/secondary/testing/gtest/BUILD.gn
@@ -2,6 +2,8 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import("//build_overrides/gtest.gni") + config("gtest_config") { visibility = [ ":*", @@ -91,9 +93,6 @@ "include/gtest/internal/gtest-type-util.h", #"gtest/src/gtest-all.cc", # Not needed by our build. - "../multiprocess_func_list.cc", - "../multiprocess_func_list.h", - "../platform_test.h", "src/gtest-death-test.cc", "src/gtest-filepath.cc", "src/gtest-internal-inl.h", @@ -104,6 +103,17 @@ "src/gtest.cc", ] + if (gtest_include_multiprocess) { + sources += [ + "../multiprocess_func_list.cc", + "../multiprocess_func_list.h", + ] + } + + if (gtest_include_platform_test) { + sources += [ "../platform_test.h" ] + } + if (is_mac || is_ios) { if (is_ios) { set_sources_assignment_filter([]) @@ -111,8 +121,10 @@ sources += [ "../gtest_mac.h", "../gtest_mac.mm", - "../platform_test_mac.mm", ] + if (gtest_include_platform_test) { + sources += [ "../platform_test_mac.mm" ] + } set_sources_assignment_filter(sources_assignment_filter) }
diff --git a/build_overrides/gtest.gni b/build_overrides/gtest.gni new file mode 100644 index 0000000..d7ce189 --- /dev/null +++ b/build_overrides/gtest.gni
@@ -0,0 +1,9 @@ +# 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. + +# Exclude support for registering main function in multi-process tests. +gtest_include_multiprocess = true + +# Exclude support for platform-specific operations across unit tests. +gtest_include_platform_test = true
diff --git a/cc/BUILD.gn b/cc/BUILD.gn index fae8e87..bd8cf6b9 100644 --- a/cc/BUILD.gn +++ b/cc/BUILD.gn
@@ -49,10 +49,6 @@ "debug/devtools_instrumentation.h", "debug/frame_rate_counter.cc", "debug/frame_rate_counter.h", - "debug/frame_timing_request.cc", - "debug/frame_timing_request.h", - "debug/frame_timing_tracker.cc", - "debug/frame_timing_tracker.h", "debug/frame_viewer_instrumentation.cc", "debug/frame_viewer_instrumentation.h", "debug/invalidation_benchmark.cc", @@ -372,8 +368,9 @@ "raster/staging_buffer_pool.h", "raster/synchronous_task_graph_runner.cc", "raster/synchronous_task_graph_runner.h", + "raster/task.cc", + "raster/task.h", "raster/task_category.h", - "raster/task_graph_runner.cc", "raster/task_graph_runner.h", "raster/task_graph_work_queue.cc", "raster/task_graph_work_queue.h", @@ -551,10 +548,10 @@ "//gpu", "//gpu/command_buffer/client:gles2_interface", "//media", + "//ui/events:events_base", "//ui/gfx", "//ui/gfx/geometry", "//ui/gl", - "//ui/latency_info", ] defines = [ "CC_IMPLEMENTATION=1" ] @@ -784,7 +781,6 @@ "base/simple_enclosed_region_unittest.cc", "base/tiling_data_unittest.cc", "base/unique_notifier_unittest.cc", - "debug/frame_timing_tracker_unittest.cc", "debug/layer_tree_debug_state_unittest.cc", "debug/micro_benchmark_controller_unittest.cc", "debug/rendering_stats_unittest.cc", @@ -949,12 +945,12 @@ "//media", "//testing/gmock", "//testing/gtest", + "//ui/events:events_base", "//ui/gfx", "//ui/gfx:test_support", "//ui/gfx/geometry", "//ui/gl", "//ui/gl:test_support", - "//ui/latency_info", ] data_deps = [
diff --git a/cc/DEPS b/cc/DEPS index 93452863..f1bdb3f 100644 --- a/cc/DEPS +++ b/cc/DEPS
@@ -15,7 +15,7 @@ "+third_party/khronos/GLES2/gl2.h", "+third_party/khronos/GLES2/gl2ext.h", "+third_party/skia/include", - "+ui/latency_info", + "+ui/events/latency_info.h", "+ui/gfx", "+ui/gl", "-cc/blink",
diff --git a/cc/blink/web_layer_impl.cc b/cc/blink/web_layer_impl.cc index 845e971..98d8232a 100644 --- a/cc/blink/web_layer_impl.cc +++ b/cc/blink/web_layer_impl.cc
@@ -301,31 +301,6 @@ return result; } -void WebLayerImpl::setFrameTimingRequests( - const WebVector<std::pair<int64_t, WebRect>>& requests) { - std::vector<cc::FrameTimingRequest> frame_timing_requests(requests.size()); - for (size_t i = 0; i < requests.size(); ++i) { - frame_timing_requests[i] = cc::FrameTimingRequest( - requests[i].first, gfx::Rect(requests[i].second)); - } - layer_->SetFrameTimingRequests(frame_timing_requests); -} - -WebVector<std::pair<int64_t, WebRect>> WebLayerImpl::frameTimingRequests() - const { - const std::vector<cc::FrameTimingRequest>& frame_timing_requests = - layer_->FrameTimingRequests(); - - size_t num_requests = frame_timing_requests.size(); - - WebVector<std::pair<int64_t, WebRect>> result(num_requests); - for (size_t i = 0; i < num_requests; ++i) { - result[i] = std::make_pair(frame_timing_requests[i].id(), - frame_timing_requests[i].rect()); - } - return result; -} - void WebLayerImpl::setTouchEventHandlerRegion(const WebVector<WebRect>& rects) { cc::Region region; for (size_t i = 0; i < rects.size(); ++i)
diff --git a/cc/blink/web_layer_impl.h b/cc/blink/web_layer_impl.h index af1145ce9..cdc5bcf 100644 --- a/cc/blink/web_layer_impl.h +++ b/cc/blink/web_layer_impl.h
@@ -118,11 +118,6 @@ void setTouchEventHandlerRegion( const blink::WebVector<blink::WebRect>& region) override; blink::WebVector<blink::WebRect> touchEventHandlerRegion() const override; - void setFrameTimingRequests( - const blink::WebVector<std::pair<int64_t, blink::WebRect>>& requests) - override; - blink::WebVector<std::pair<int64_t, blink::WebRect>> frameTimingRequests() - const override; void setIsContainerForFixedPositionLayers(bool is_container) override; bool isContainerForFixedPositionLayers() const override; void setPositionConstraint(
diff --git a/cc/cc.gyp b/cc/cc.gyp index 7b29a6e..0878db9 100644 --- a/cc/cc.gyp +++ b/cc/cc.gyp
@@ -19,10 +19,10 @@ '<(DEPTH)/media/media.gyp:media', '<(DEPTH)/skia/skia.gyp:skia', '<(DEPTH)/third_party/protobuf/protobuf.gyp:protobuf_lite', + '<(DEPTH)/ui/events/events.gyp:events_base', '<(DEPTH)/ui/gfx/gfx.gyp:gfx', '<(DEPTH)/ui/gfx/gfx.gyp:gfx_geometry', '<(DEPTH)/ui/gl/gl.gyp:gl', - "<(DEPTH)/ui/latency_info/latency_info.gyp:latency_info", ], 'variables': { 'optimize': 'max', @@ -110,10 +110,6 @@ 'debug/devtools_instrumentation.h', 'debug/frame_rate_counter.cc', 'debug/frame_rate_counter.h', - 'debug/frame_timing_request.cc', - 'debug/frame_timing_request.h', - 'debug/frame_timing_tracker.cc', - 'debug/frame_timing_tracker.h', 'debug/frame_viewer_instrumentation.cc', 'debug/frame_viewer_instrumentation.h', 'debug/invalidation_benchmark.cc', @@ -433,8 +429,9 @@ 'raster/staging_buffer_pool.h', 'raster/synchronous_task_graph_runner.cc', 'raster/synchronous_task_graph_runner.h', + 'raster/task.cc', + 'raster/task.h', 'raster/task_category.h', - 'raster/task_graph_runner.cc', 'raster/task_graph_runner.h', 'raster/task_graph_work_queue.cc', 'raster/task_graph_work_queue.h', @@ -664,9 +661,9 @@ '<(DEPTH)/base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations', '<(DEPTH)/gpu/gpu.gyp:gpu', '<(DEPTH)/skia/skia.gyp:skia', + '<(DEPTH)/ui/events/events.gyp:events_base', '<(DEPTH)/ui/gfx/gfx.gyp:gfx', '<(DEPTH)/ui/gfx/gfx.gyp:gfx_geometry', - "<(DEPTH)/ui/latency_info/latency_info.gyp:latency_info", ], 'defines': [ 'CC_SURFACES_IMPLEMENTATION=1',
diff --git a/cc/cc_tests.gyp b/cc/cc_tests.gyp index b2aec9f..b8384c3 100644 --- a/cc/cc_tests.gyp +++ b/cc/cc_tests.gyp
@@ -28,7 +28,6 @@ 'base/simple_enclosed_region_unittest.cc', 'base/tiling_data_unittest.cc', 'base/unique_notifier_unittest.cc', - 'debug/frame_timing_tracker_unittest.cc', 'debug/layer_tree_debug_state_unittest.cc', 'debug/micro_benchmark_controller_unittest.cc', 'debug/rendering_stats_unittest.cc', @@ -330,9 +329,9 @@ '../testing/gmock.gyp:gmock', '../testing/gtest.gyp:gtest', '../third_party/protobuf/protobuf.gyp:protobuf_lite', + '../ui/events/events.gyp:events_base', '../ui/gfx/gfx.gyp:gfx', '../ui/gfx/gfx.gyp:gfx_geometry', - '../ui/latency_info/latency_info.gyp:latency_info', 'cc.gyp:cc', 'cc.gyp:cc_proto', 'cc.gyp:cc_surfaces',
diff --git a/cc/debug/frame_timing_request.cc b/cc/debug/frame_timing_request.cc deleted file mode 100644 index 211d57d..0000000 --- a/cc/debug/frame_timing_request.cc +++ /dev/null
@@ -1,19 +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 <stdint.h> - -#include "cc/debug/frame_timing_request.h" - -namespace cc { - -FrameTimingRequest::FrameTimingRequest() : id_(0) { -} - -FrameTimingRequest::FrameTimingRequest(int64_t request_id, - const gfx::Rect& rect) - : id_(request_id), rect_(rect) { -} - -} // namespace cc
diff --git a/cc/debug/frame_timing_request.h b/cc/debug/frame_timing_request.h deleted file mode 100644 index 6b2b57c5..0000000 --- a/cc/debug/frame_timing_request.h +++ /dev/null
@@ -1,41 +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 CC_DEBUG_FRAME_TIMING_REQUEST_H_ -#define CC_DEBUG_FRAME_TIMING_REQUEST_H_ - -#include <stdint.h> - -#include "cc/base/cc_export.h" -#include "ui/gfx/geometry/rect.h" - -namespace cc { - -// This class represents a request to record frame timing information about the -// given rect (in layer space) and an associated request id. When this request -// is propagated to the active LayerImpl, it will cause events to be saved in -// FrameTimingTracker, which in turn can be consumed by the requester. -class CC_EXPORT FrameTimingRequest { - public: - FrameTimingRequest(); - FrameTimingRequest(int64_t request_id, const gfx::Rect& rect); - - // Return the ID for the request. - int64_t id() const { return id_; } - - // Return the layer space rect for this request. - const gfx::Rect& rect() const { return rect_; } - - bool operator==(const FrameTimingRequest& other) const { - return (id_ == other.id_) && (rect_ == other.rect_); - } - - private: - int64_t id_; - gfx::Rect rect_; -}; - -} // namespace cc - -#endif // CC_DEBUG_FRAME_TIMING_REQUEST_H_
diff --git a/cc/debug/frame_timing_tracker.cc b/cc/debug/frame_timing_tracker.cc deleted file mode 100644 index d0b9a9b..0000000 --- a/cc/debug/frame_timing_tracker.cc +++ /dev/null
@@ -1,119 +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 "cc/debug/frame_timing_tracker.h" - -#include <stdint.h> - -#include <algorithm> -#include <limits> - -#include "base/memory/ptr_util.h" -#include "base/metrics/histogram.h" -#include "cc/trees/layer_tree_host_impl.h" -#include "cc/trees/proxy.h" - -namespace cc { -namespace { -int kSendTimingIntervalMS = 200; -} - -FrameTimingTracker::CompositeTimingEvent::CompositeTimingEvent( - int _frame_id, - base::TimeTicks _timestamp) - : frame_id(_frame_id), timestamp(_timestamp) { -} - -FrameTimingTracker::CompositeTimingEvent::~CompositeTimingEvent() { -} - -FrameTimingTracker::MainFrameTimingEvent::MainFrameTimingEvent( - int frame_id, - base::TimeTicks timestamp, - base::TimeTicks end_time) - : frame_id(frame_id), timestamp(timestamp), end_time(end_time) { -} - -FrameTimingTracker::MainFrameTimingEvent::~MainFrameTimingEvent() { -} - -// static -std::unique_ptr<FrameTimingTracker> FrameTimingTracker::Create( - LayerTreeHostImpl* layer_tree_host_impl) { - return base::WrapUnique(new FrameTimingTracker(layer_tree_host_impl)); -} - -FrameTimingTracker::FrameTimingTracker(LayerTreeHostImpl* layer_tree_host_impl) - : layer_tree_host_impl_(layer_tree_host_impl), - post_events_notifier_( - layer_tree_host_impl_->GetTaskRunner(), - base::Bind(&FrameTimingTracker::PostEvents, base::Unretained(this)), - base::TimeDelta::FromMilliseconds(kSendTimingIntervalMS)) {} - -FrameTimingTracker::~FrameTimingTracker() { -} - -void FrameTimingTracker::SaveTimeStamps( - base::TimeTicks timestamp, - const std::vector<FrameAndRectIds>& frame_ids) { - if (!composite_events_) - composite_events_.reset(new CompositeTimingSet); - for (const auto& pair : frame_ids) { - (*composite_events_)[pair.second].push_back( - CompositeTimingEvent(pair.first, timestamp)); - } - if (!post_events_notifier_.HasPendingNotification()) - post_events_notifier_.Schedule(); -} - -void FrameTimingTracker::SaveMainFrameTimeStamps( - const std::vector<int64_t>& request_ids, - base::TimeTicks main_frame_time, - base::TimeTicks end_time, - int source_frame_number) { - if (!main_frame_events_) - main_frame_events_.reset(new MainFrameTimingSet); - for (const auto& request : request_ids) { - std::vector<MainFrameTimingEvent>& events = (*main_frame_events_)[request]; - events.push_back( - MainFrameTimingEvent(source_frame_number, main_frame_time, end_time)); - } - if (!post_events_notifier_.HasPendingNotification()) - post_events_notifier_.Schedule(); -} - -std::unique_ptr<FrameTimingTracker::CompositeTimingSet> -FrameTimingTracker::GroupCompositeCountsByRectId() { - if (!composite_events_) - return base::WrapUnique(new CompositeTimingSet); - for (auto& infos : *composite_events_) { - std::sort( - infos.second.begin(), infos.second.end(), - [](const CompositeTimingEvent& lhs, const CompositeTimingEvent& rhs) { - return lhs.timestamp < rhs.timestamp; - }); - } - return std::move(composite_events_); -} - -std::unique_ptr<FrameTimingTracker::MainFrameTimingSet> -FrameTimingTracker::GroupMainFrameCountsByRectId() { - if (!main_frame_events_) - return base::WrapUnique(new MainFrameTimingSet); - for (auto& infos : *main_frame_events_) { - std::sort( - infos.second.begin(), infos.second.end(), - [](const MainFrameTimingEvent& lhs, const MainFrameTimingEvent& rhs) { - return lhs.timestamp < rhs.timestamp; - }); - } - return std::move(main_frame_events_); -} - -void FrameTimingTracker::PostEvents() { - layer_tree_host_impl_->PostFrameTimingEvents(GroupCompositeCountsByRectId(), - GroupMainFrameCountsByRectId()); -} - -} // namespace cc
diff --git a/cc/debug/frame_timing_tracker.h b/cc/debug/frame_timing_tracker.h deleted file mode 100644 index f6f9d2b..0000000 --- a/cc/debug/frame_timing_tracker.h +++ /dev/null
@@ -1,98 +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 CC_DEBUG_FRAME_TIMING_TRACKER_H_ -#define CC_DEBUG_FRAME_TIMING_TRACKER_H_ - -#include <stdint.h> - -#include <memory> -#include <unordered_map> -#include <utility> -#include <vector> - -#include "base/macros.h" -#include "base/time/time.h" -#include "cc/base/cc_export.h" -#include "cc/base/delayed_unique_notifier.h" - -namespace cc { - -class LayerTreeHostImpl; - -// This class maintains a history of timestamps and rect IDs to communicate -// frame events back to Blink -// TODO(mpb): Start using this. crbug.com/442554 -class CC_EXPORT FrameTimingTracker { - public: - struct CC_EXPORT CompositeTimingEvent { - CompositeTimingEvent(int, base::TimeTicks); - ~CompositeTimingEvent(); - - int frame_id; - base::TimeTicks timestamp; - }; - - using CompositeTimingSet = - std::unordered_map<int64_t, std::vector<CompositeTimingEvent>>; - - struct CC_EXPORT MainFrameTimingEvent { - MainFrameTimingEvent(int frame_id, - base::TimeTicks timestamp, - base::TimeTicks end_time); - ~MainFrameTimingEvent(); - - int frame_id; - base::TimeTicks timestamp; - base::TimeTicks end_time; - }; - - using MainFrameTimingSet = - std::unordered_map<int64_t, std::vector<MainFrameTimingEvent>>; - - static std::unique_ptr<FrameTimingTracker> Create( - LayerTreeHostImpl* layer_tree_host_impl); - - ~FrameTimingTracker(); - - // This routine takes all of the individual CompositeEvents stored in the - // tracker and collects them by "rect_id", as in the example below. - // [ {f_id1,r_id1,t1}, {f_id2,r_id1,t2}, {f_id3,r_id2,t3} ] - // ====> - // [ {r_id1,<{f_id1,t1},{f_id2,t2}>}, {r_id2,<{f_id3,t3}>} ] - std::unique_ptr<CompositeTimingSet> GroupCompositeCountsByRectId(); - - // This routine takes all of the individual MainFrameEvents stored in the - // tracker and collects them by "rect_id", as in the example below. - std::unique_ptr<MainFrameTimingSet> GroupMainFrameCountsByRectId(); - - // This routine takes a timestamp and an array of frame_id,rect_id pairs - // and generates CompositeTimingEvents (frame_id, timestamp) and adds them to - // internal hash_map keyed on rect_id - using FrameAndRectIds = std::pair<int, int64_t>; - void SaveTimeStamps(base::TimeTicks timestamp, - const std::vector<FrameAndRectIds>& frame_ids); - - void SaveMainFrameTimeStamps(const std::vector<int64_t>& request_ids, - base::TimeTicks main_frame_time, - base::TimeTicks end_time, - int source_frame_number); - - private: - explicit FrameTimingTracker(LayerTreeHostImpl* layer_tree_host_impl); - - void PostEvents(); - - std::unique_ptr<CompositeTimingSet> composite_events_; - std::unique_ptr<MainFrameTimingSet> main_frame_events_; - - LayerTreeHostImpl* layer_tree_host_impl_; - DelayedUniqueNotifier post_events_notifier_; - - DISALLOW_COPY_AND_ASSIGN(FrameTimingTracker); -}; - -} // namespace cc - -#endif // CC_DEBUG_FRAME_TIMING_TRACKER_H_
diff --git a/cc/debug/frame_timing_tracker_unittest.cc b/cc/debug/frame_timing_tracker_unittest.cc deleted file mode 100644 index 109b730d..0000000 --- a/cc/debug/frame_timing_tracker_unittest.cc +++ /dev/null
@@ -1,297 +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 <stdint.h> - -#include <set> -#include <string> - -#include "base/time/time.h" -#include "base/trace_event/trace_event_argument.h" -#include "base/values.h" -#include "cc/debug/frame_timing_tracker.h" -#include "cc/test/fake_impl_task_runner_provider.h" -#include "cc/test/fake_layer_tree_host_impl.h" -#include "cc/test/test_shared_bitmap_manager.h" -#include "cc/test/test_task_graph_runner.h" -#include "testing/gtest/include/gtest/gtest.h" - -namespace cc { -namespace { - -std::string CompositeToString( - std::unique_ptr<FrameTimingTracker::CompositeTimingSet> timingset) { - std::unique_ptr<base::trace_event::TracedValue> value( - new base::trace_event::TracedValue()); - value->BeginArray("values"); - std::set<int> rect_ids; - for (const auto& pair : *timingset) - rect_ids.insert(pair.first); - - for (const auto& rect_id : rect_ids) { - auto& events = (*timingset)[rect_id]; - value->BeginDictionary(); - value->SetInteger("rect_id", rect_id); - value->BeginArray("events"); - for (const auto& event : events) { - value->BeginDictionary(); - value->SetInteger("frame_id", event.frame_id); - value->SetInteger("timestamp", event.timestamp.ToInternalValue()); - value->EndDictionary(); - } - value->EndArray(); - value->EndDictionary(); - } - value->EndArray(); - return value->ToString(); -} - -std::string MainFrameToString( - std::unique_ptr<FrameTimingTracker::MainFrameTimingSet> timingset) { - std::unique_ptr<base::trace_event::TracedValue> value( - new base::trace_event::TracedValue()); - value->BeginArray("values"); - std::set<int> rect_ids; - for (const auto& pair : *timingset) - rect_ids.insert(pair.first); - - for (const auto& rect_id : rect_ids) { - auto& events = (*timingset)[rect_id]; - value->BeginDictionary(); - value->SetInteger("rect_id", rect_id); - value->BeginArray("events"); - for (const auto& event : events) { - value->BeginDictionary(); - value->SetInteger("end_time", event.end_time.ToInternalValue()); - value->SetInteger("frame_id", event.frame_id); - value->SetInteger("timestamp", event.timestamp.ToInternalValue()); - value->EndDictionary(); - } - value->EndArray(); - value->EndDictionary(); - } - value->EndArray(); - return value->ToString(); -} - -TEST(FrameTimingTrackerTest, DefaultTrackerIsEmpty) { - FakeImplTaskRunnerProvider task_runner_provider; - TestSharedBitmapManager shared_bitmap_manager; - TestTaskGraphRunner task_graph_runner; - FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, - &task_graph_runner); - - std::unique_ptr<FrameTimingTracker> tracker( - FrameTimingTracker::Create(&host_impl)); - EXPECT_EQ("{\"values\":[]}", - CompositeToString(tracker->GroupCompositeCountsByRectId())); - EXPECT_EQ("{\"values\":[]}", - MainFrameToString(tracker->GroupMainFrameCountsByRectId())); -} - -TEST(FrameTimingTrackerTest, NoFrameIdsIsEmpty) { - FakeImplTaskRunnerProvider task_runner_provider; - TestSharedBitmapManager shared_bitmap_manager; - TestTaskGraphRunner task_graph_runner; - FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, - &task_graph_runner); - - std::unique_ptr<FrameTimingTracker> tracker( - FrameTimingTracker::Create(&host_impl)); - std::vector<std::pair<int, int64_t>> ids; - tracker->SaveTimeStamps(base::TimeTicks::FromInternalValue(100), ids); - EXPECT_EQ("{\"values\":[]}", - CompositeToString(tracker->GroupCompositeCountsByRectId())); -} - -TEST(FrameTimingTrackerTest, NoRectIdsYieldsNoMainFrameEvents) { - FakeImplTaskRunnerProvider task_runner_provider; - TestSharedBitmapManager shared_bitmap_manager; - TestTaskGraphRunner task_graph_runner; - FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, - &task_graph_runner); - - std::unique_ptr<FrameTimingTracker> tracker( - FrameTimingTracker::Create(&host_impl)); - tracker->SaveMainFrameTimeStamps(std::vector<int64_t>(), - base::TimeTicks::FromInternalValue(100), - base::TimeTicks::FromInternalValue(110), 1); - EXPECT_EQ("{\"values\":[]}", - MainFrameToString(tracker->GroupMainFrameCountsByRectId())); -} - -TEST(FrameTimingTrackerTest, OneFrameId) { - FakeImplTaskRunnerProvider task_runner_provider; - TestSharedBitmapManager shared_bitmap_manager; - TestTaskGraphRunner task_graph_runner; - FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, - &task_graph_runner); - - std::unique_ptr<FrameTimingTracker> tracker( - FrameTimingTracker::Create(&host_impl)); - std::vector<std::pair<int, int64_t>> ids; - ids.push_back(std::make_pair(1, 2)); - tracker->SaveTimeStamps(base::TimeTicks::FromInternalValue(100), ids); - EXPECT_EQ( - "{\"values\":[{\"events\":[" - "{\"frame_id\":1,\"timestamp\":100}],\"rect_id\":2}]}", - CompositeToString(tracker->GroupCompositeCountsByRectId())); -} - -TEST(FrameTimingTrackerTest, OneMainFrameRect) { - FakeImplTaskRunnerProvider task_runner_provider; - TestSharedBitmapManager shared_bitmap_manager; - TestTaskGraphRunner task_graph_runner; - FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, - &task_graph_runner); - - std::unique_ptr<FrameTimingTracker> tracker( - FrameTimingTracker::Create(&host_impl)); - std::vector<int64_t> rect_ids; - rect_ids.push_back(1); - tracker->SaveMainFrameTimeStamps(rect_ids, - base::TimeTicks::FromInternalValue(100), - base::TimeTicks::FromInternalValue(110), 2); - EXPECT_EQ( - "{\"values\":[{\"events\":[" - "{\"end_time\":110,\"frame_id\":2,\"timestamp\":100}],\"rect_id\":1}]}", - MainFrameToString(tracker->GroupMainFrameCountsByRectId())); -} - -TEST(FrameTimingTrackerTest, UnsortedTimestampsIds) { - FakeImplTaskRunnerProvider task_runner_provider; - TestSharedBitmapManager shared_bitmap_manager; - TestTaskGraphRunner task_graph_runner; - FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, - &task_graph_runner); - - std::unique_ptr<FrameTimingTracker> tracker( - FrameTimingTracker::Create(&host_impl)); - std::vector<std::pair<int, int64_t>> ids; - ids.push_back(std::make_pair(1, 2)); - tracker->SaveTimeStamps(base::TimeTicks::FromInternalValue(200), ids); - tracker->SaveTimeStamps(base::TimeTicks::FromInternalValue(400), ids); - tracker->SaveTimeStamps(base::TimeTicks::FromInternalValue(100), ids); - EXPECT_EQ( - "{\"values\":[{\"events\":[" - "{\"frame_id\":1,\"timestamp\":100}," - "{\"frame_id\":1,\"timestamp\":200}," - "{\"frame_id\":1,\"timestamp\":400}],\"rect_id\":2}]}", - CompositeToString(tracker->GroupCompositeCountsByRectId())); -} - -TEST(FrameTimingTrackerTest, MainFrameUnsortedTimestamps) { - FakeImplTaskRunnerProvider task_runner_provider; - TestSharedBitmapManager shared_bitmap_manager; - TestTaskGraphRunner task_graph_runner; - FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, - &task_graph_runner); - - std::unique_ptr<FrameTimingTracker> tracker( - FrameTimingTracker::Create(&host_impl)); - std::vector<int64_t> rect_ids; - rect_ids.push_back(2); - tracker->SaveMainFrameTimeStamps(rect_ids, - base::TimeTicks::FromInternalValue(200), - base::TimeTicks::FromInternalValue(280), 1); - tracker->SaveMainFrameTimeStamps(rect_ids, - base::TimeTicks::FromInternalValue(400), - base::TimeTicks::FromInternalValue(470), 1); - tracker->SaveMainFrameTimeStamps(rect_ids, - base::TimeTicks::FromInternalValue(100), - base::TimeTicks::FromInternalValue(160), 1); - EXPECT_EQ( - "{\"values\":[{\"events\":[" - "{\"end_time\":160,\"frame_id\":1,\"timestamp\":100}," - "{\"end_time\":280,\"frame_id\":1,\"timestamp\":200}," - "{\"end_time\":470,\"frame_id\":1,\"timestamp\":400}],\"rect_id\":2}]}", - MainFrameToString(tracker->GroupMainFrameCountsByRectId())); -} - -TEST(FrameTimingTrackerTest, MultipleFrameIds) { - FakeImplTaskRunnerProvider task_runner_provider; - TestSharedBitmapManager shared_bitmap_manager; - TestTaskGraphRunner task_graph_runner; - FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, - &task_graph_runner); - - std::unique_ptr<FrameTimingTracker> tracker( - FrameTimingTracker::Create(&host_impl)); - - std::vector<std::pair<int, int64_t>> ids200; - ids200.push_back(std::make_pair(1, 2)); - ids200.push_back(std::make_pair(1, 3)); - tracker->SaveTimeStamps(base::TimeTicks::FromInternalValue(200), ids200); - - std::vector<std::pair<int, int64_t>> ids400; - ids400.push_back(std::make_pair(2, 2)); - tracker->SaveTimeStamps(base::TimeTicks::FromInternalValue(400), ids400); - - std::vector<std::pair<int, int64_t>> ids100; - ids100.push_back(std::make_pair(3, 2)); - ids100.push_back(std::make_pair(2, 3)); - ids100.push_back(std::make_pair(3, 4)); - tracker->SaveTimeStamps(base::TimeTicks::FromInternalValue(100), ids100); - - EXPECT_EQ( - "{\"values\":[{\"events\":[" - "{\"frame_id\":3,\"timestamp\":100}," - "{\"frame_id\":1,\"timestamp\":200}," - "{\"frame_id\":2,\"timestamp\":400}],\"rect_id\":2}," - "{\"events\":[" - "{\"frame_id\":2,\"timestamp\":100}," - "{\"frame_id\":1,\"timestamp\":200}],\"rect_id\":3}," - "{\"events\":[" - "{\"frame_id\":3,\"timestamp\":100}],\"rect_id\":4}" - "]}", - CompositeToString(tracker->GroupCompositeCountsByRectId())); -} - -TEST(FrameTimingTrackerTest, MultipleMainFrameEvents) { - FakeImplTaskRunnerProvider task_runner_provider; - TestSharedBitmapManager shared_bitmap_manager; - TestTaskGraphRunner task_graph_runner; - FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, - &task_graph_runner); - - std::unique_ptr<FrameTimingTracker> tracker( - FrameTimingTracker::Create(&host_impl)); - - std::vector<int64_t> rect_ids200; - rect_ids200.push_back(2); - rect_ids200.push_back(3); - tracker->SaveMainFrameTimeStamps(rect_ids200, - base::TimeTicks::FromInternalValue(200), - base::TimeTicks::FromInternalValue(220), 1); - - std::vector<int64_t> rect_ids400; - rect_ids400.push_back(2); - tracker->SaveMainFrameTimeStamps(rect_ids400, - base::TimeTicks::FromInternalValue(400), - base::TimeTicks::FromInternalValue(440), 2); - - std::vector<int64_t> rect_ids100; - rect_ids100.push_back(2); - rect_ids100.push_back(3); - rect_ids100.push_back(4); - tracker->SaveMainFrameTimeStamps(rect_ids100, - base::TimeTicks::FromInternalValue(100), - base::TimeTicks::FromInternalValue(110), 3); - - EXPECT_EQ( - "{\"values\":[{\"events\":[" - "{\"end_time\":110,\"frame_id\":3,\"timestamp\":100}," - "{\"end_time\":220,\"frame_id\":1,\"timestamp\":200}," - "{\"end_time\":440,\"frame_id\":2,\"timestamp\":400}],\"rect_id\":2}," - "{\"events\":[" - "{\"end_time\":110,\"frame_id\":3,\"timestamp\":100}," - "{\"end_time\":220,\"frame_id\":1,\"timestamp\":200}],\"rect_id\":3}," - "{\"events\":[" - "{\"end_time\":110,\"frame_id\":3,\"timestamp\":100}],\"rect_id\":4}" - "]}", - MainFrameToString(tracker->GroupMainFrameCountsByRectId())); -} - -} // namespace -} // namespace cc
diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc index 52f0d8a8..f9a8f2b 100644 --- a/cc/layers/layer.cc +++ b/cc/layers/layer.cc
@@ -90,8 +90,7 @@ clip_parent_(nullptr), replica_layer_(nullptr), client_(nullptr), - num_unclipped_descendants_(0), - frame_timing_requests_dirty_(false) {} + num_unclipped_descendants_(0) {} Layer::~Layer() { // Our parent should be holding a reference to us so there should be no @@ -1270,11 +1269,6 @@ update_rect_.Union(layer->update_rect()); layer->SetUpdateRect(update_rect_); - if (frame_timing_requests_dirty_) { - layer->SetFrameTimingRequests(frame_timing_requests_); - frame_timing_requests_dirty_ = false; - } - // Reset any state that should be cleared for the next update. subtree_property_changed_ = false; update_rect_ = gfx::Rect(); @@ -1476,8 +1470,6 @@ // TODO(nyquist): Figure out what to do with LayerAnimationController. // See crbug.com/570376. - // TODO(nyquist): Figure out what to do with FrameTimingRequests. See - // crbug.com/570377. update_rect_ = gfx::Rect(); } @@ -1793,16 +1785,6 @@ benchmark->RunOnLayer(this); } -void Layer::SetFrameTimingRequests( - const std::vector<FrameTimingRequest>& requests) { - // TODO(vmpstr): Early out if there are no changes earlier in the call stack. - if (requests == frame_timing_requests_) - return; - frame_timing_requests_ = requests; - frame_timing_requests_dirty_ = true; - SetNeedsCommit(); -} - void Layer::SetElementId(uint64_t id) { DCHECK(IsPropertyChangeAllowed()); if (element_id_ == id)
diff --git a/cc/layers/layer.h b/cc/layers/layer.h index af935839e..220a9db 100644 --- a/cc/layers/layer.h +++ b/cc/layers/layer.h
@@ -20,7 +20,6 @@ #include "cc/animation/target_property.h" #include "cc/base/cc_export.h" #include "cc/base/region.h" -#include "cc/debug/frame_timing_request.h" #include "cc/debug/micro_benchmark.h" #include "cc/input/input_handler.h" #include "cc/layers/layer_collections.h" @@ -488,14 +487,6 @@ void SetSubtreePropertyChanged(); bool subtree_property_changed() const { return subtree_property_changed_; } - // Sets new frame timing requests for this layer. - void SetFrameTimingRequests(const std::vector<FrameTimingRequest>& requests); - - // Accessor for unit tests - const std::vector<FrameTimingRequest>& FrameTimingRequests() const { - return frame_timing_requests_; - } - void DidBeginTracing(); int num_copy_requests_in_target_subtree(); @@ -689,9 +680,6 @@ gfx::Rect visible_layer_rect_; size_t num_unclipped_descendants_; - std::vector<FrameTimingRequest> frame_timing_requests_; - bool frame_timing_requests_dirty_; - DISALLOW_COPY_AND_ASSIGN(Layer); };
diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc index 740f8e7..b7c0c1f 100644 --- a/cc/layers/layer_impl.cc +++ b/cc/layers/layer_impl.cc
@@ -91,8 +91,7 @@ mutable_properties_(MutableProperty::kNone), debug_info_(nullptr), force_render_surface_(false), - frame_timing_requests_dirty_(false), - layer_or_descendant_is_drawn_(false), + scrolls_drawn_descendant_(false), layer_or_descendant_has_touch_handler_(false) { DCHECK_GT(layer_id_, 0); @@ -595,11 +594,6 @@ if (owned_debug_info_) layer->SetDebugInfo(std::move(owned_debug_info_)); - if (frame_timing_requests_dirty_) { - layer->SetFrameTimingRequests(frame_timing_requests_); - frame_timing_requests_dirty_ = false; - } - // Reset any state that should be cleared for the next update. layer_property_changed_ = false; update_rect_ = gfx::Rect(); @@ -1214,18 +1208,6 @@ sorting_context_id_ = id; } -void LayerImpl::SetFrameTimingRequests( - const std::vector<FrameTimingRequest>& requests) { - frame_timing_requests_ = requests; - frame_timing_requests_dirty_ = true; - SetNeedsPushProperties(); -} - -void LayerImpl::GatherFrameTimingRequestIds(std::vector<int64_t>* request_ids) { - for (const auto& request : frame_timing_requests_) - request_ids->push_back(request.id()); -} - void LayerImpl::SetTransform(const gfx::Transform& transform) { if (transform_ == transform) return; @@ -1487,17 +1469,6 @@ NOTREACHED(); } } - - if (!frame_timing_requests_.empty()) { - state->BeginArray("frame_timing_requests"); - for (const auto& request : frame_timing_requests_) { - state->BeginDictionary(); - state->SetInteger("request_id", request.id()); - MathUtil::AddToTracedValue("request_rect", request.rect(), state); - state->EndDictionary(); - } - state->EndArray(); - } } bool LayerImpl::IsDrawnRenderSurfaceLayerListMember() const {
diff --git a/cc/layers/layer_impl.h b/cc/layers/layer_impl.h index ac6a2bf..fdb8218 100644 --- a/cc/layers/layer_impl.h +++ b/cc/layers/layer_impl.h
@@ -22,7 +22,6 @@ #include "cc/base/cc_export.h" #include "cc/base/region.h" #include "cc/base/synced_property.h" -#include "cc/debug/frame_timing_request.h" #include "cc/input/input_handler.h" #include "cc/layers/draw_properties.h" #include "cc/layers/layer_collections.h" @@ -532,13 +531,6 @@ void Set3dSortingContextId(int id); int sorting_context_id() { return sorting_context_id_; } - void SetFrameTimingRequests( - const std::vector<FrameTimingRequest>& frame_timing_requests); - const std::vector<FrameTimingRequest>& frame_timing_requests() const { - return frame_timing_requests_; - } - void GatherFrameTimingRequestIds(std::vector<int64_t>* request_ids); - const SyncedScrollOffset* synced_scroll_offset() const; SyncedScrollOffset* synced_scroll_offset(); @@ -548,11 +540,11 @@ virtual gfx::Rect GetEnclosingRectInTargetSpace() const; - void set_layer_or_descendant_is_drawn(bool layer_or_descendant_is_drawn) { - layer_or_descendant_is_drawn_ = layer_or_descendant_is_drawn; + void set_scrolls_drawn_descendant(bool scrolls_drawn_descendant) { + scrolls_drawn_descendant_ = scrolls_drawn_descendant; } - bool layer_or_descendant_is_drawn() { return layer_or_descendant_is_drawn_; } + bool scrolls_drawn_descendant() { return scrolls_drawn_descendant_; } void set_layer_or_descendant_has_touch_handler( bool layer_or_descendant_has_touch_handler) { @@ -752,9 +744,7 @@ bool force_render_surface_; - std::vector<FrameTimingRequest> frame_timing_requests_; - bool frame_timing_requests_dirty_; - bool layer_or_descendant_is_drawn_; + bool scrolls_drawn_descendant_; // If true, the layer or one of its descendants has a touch handler. bool layer_or_descendant_has_touch_handler_;
diff --git a/cc/layers/render_surface_impl.h b/cc/layers/render_surface_impl.h index cb7a795..d738646 100644 --- a/cc/layers/render_surface_impl.h +++ b/cc/layers/render_surface_impl.h
@@ -55,7 +55,7 @@ } float draw_opacity() const { return draw_properties_.draw_opacity; } - void SetNearestOcclusionImmuneAncestor(RenderSurfaceImpl* surface) { + void SetNearestOcclusionImmuneAncestor(const RenderSurfaceImpl* surface) { nearest_occlusion_immune_ancestor_ = surface; } const RenderSurfaceImpl* nearest_occlusion_immune_ancestor() const { @@ -211,7 +211,7 @@ // The nearest ancestor target surface that will contain the contents of this // surface, and that ignores outside occlusion. This can point to itself. - RenderSurfaceImpl* nearest_occlusion_immune_ancestor_; + const RenderSurfaceImpl* nearest_occlusion_immune_ancestor_; std::unique_ptr<DamageTracker> damage_tracker_;
diff --git a/cc/output/compositor_frame_metadata.h b/cc/output/compositor_frame_metadata.h index c73499d..54b2047 100644 --- a/cc/output/compositor_frame_metadata.h +++ b/cc/output/compositor_frame_metadata.h
@@ -13,9 +13,9 @@ #include "cc/output/viewport_selection_bound.h" #include "cc/surfaces/surface_id.h" #include "third_party/skia/include/core/SkColor.h" +#include "ui/events/latency_info.h" #include "ui/gfx/geometry/size_f.h" #include "ui/gfx/geometry/vector2d_f.h" -#include "ui/latency_info/latency_info.h" namespace cc {
diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc index ae13dd3b..414ffc0 100644 --- a/cc/output/gl_renderer.cc +++ b/cc/output/gl_renderer.cc
@@ -3613,10 +3613,12 @@ GLint sorting_context_id = ca_layer_overlay.sorting_context_id; GLfloat transform[16]; ca_layer_overlay.transform.asColMajorf(transform); + unsigned filter = GL_LINEAR; gl_->ScheduleCALayerCHROMIUM( texture_id, contents_rect, ca_layer_overlay.opacity, ca_layer_overlay.background_color, ca_layer_overlay.edge_aa_mask, - bounds_rect, is_clipped, clip_rect, sorting_context_id, transform); + bounds_rect, is_clipped, clip_rect, sorting_context_id, transform, + filter); } }
diff --git a/cc/output/latency_info_swap_promise.h b/cc/output/latency_info_swap_promise.h index 4b59159..23a1c862 100644 --- a/cc/output/latency_info_swap_promise.h +++ b/cc/output/latency_info_swap_promise.h
@@ -9,7 +9,7 @@ #include "base/compiler_specific.h" #include "cc/output/swap_promise.h" -#include "ui/latency_info/latency_info.h" +#include "ui/events/latency_info.h" namespace cc {
diff --git a/cc/raster/task_graph_runner.cc b/cc/raster/task.cc similarity index 73% rename from cc/raster/task_graph_runner.cc rename to cc/raster/task.cc index 4f1af43..c19e549 100644 --- a/cc/raster/task_graph_runner.cc +++ b/cc/raster/task.cc
@@ -1,15 +1,10 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. +// 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 "cc/raster/task_graph_runner.h" +#include "cc/raster/task.h" -#include <algorithm> -#include <utility> - -#include "base/atomic_sequence_num.h" -#include "base/threading/thread_restrictions.h" -#include "base/trace_event/trace_event.h" +#include "base/logging.h" namespace cc {
diff --git a/cc/raster/task.h b/cc/raster/task.h new file mode 100644 index 0000000..96959c1 --- /dev/null +++ b/cc/raster/task.h
@@ -0,0 +1,93 @@ +// 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 CC_RASTER_TASK_H_ +#define CC_RASTER_TASK_H_ + +#include <stdint.h> + +#include <vector> + +#include "base/memory/ref_counted.h" +#include "cc/base/cc_export.h" + +namespace cc { + +// A task which can be run by a TaskGraphRunner. To run a Task, it should be +// inserted into a TaskGraph, which can then be scheduled on the +// TaskGraphRunner. +class CC_EXPORT Task : public base::RefCountedThreadSafe<Task> { + public: + typedef std::vector<scoped_refptr<Task>> Vector; + + // Subclasses should implement this method. RunOnWorkerThread may be called + // on any thread, and subclasses are responsible for locking and thread + // safety. + virtual void RunOnWorkerThread() = 0; + + void WillRun(); + void DidRun(); + bool HasFinishedRunning() const; + + protected: + friend class base::RefCountedThreadSafe<Task>; + + Task(); + virtual ~Task(); + + bool will_run_; + bool did_run_; +}; + +// A task dependency graph describes the order in which to execute a set +// of tasks. Dependencies are represented as edges. Each node is assigned +// a category, a priority and a run count that matches the number of +// dependencies. Priority range from 0 (most favorable scheduling) to UINT16_MAX +// (least favorable). Categories range from 0 to UINT16_MAX. It is up to the +// implementation and its consumer to determine the meaning (if any) of a +// category. A TaskGraphRunner implementation may chose to prioritize certain +// categories over others, regardless of the individual priorities of tasks. +struct CC_EXPORT TaskGraph { + struct Node { + typedef std::vector<Node> Vector; + + Node(Task* task, + uint16_t category, + uint16_t priority, + uint32_t dependencies) + : task(task), + category(category), + priority(priority), + dependencies(dependencies) {} + + Task* task; + uint16_t category; + uint16_t priority; + uint32_t dependencies; + }; + + struct Edge { + typedef std::vector<Edge> Vector; + + Edge(const Task* task, Task* dependent) + : task(task), dependent(dependent) {} + + const Task* task; + Task* dependent; + }; + + TaskGraph(); + TaskGraph(const TaskGraph& other); + ~TaskGraph(); + + void Swap(TaskGraph* other); + void Reset(); + + Node::Vector nodes; + Edge::Vector edges; +}; + +} // namespace cc + +#endif // CC_RASTER_TASK_H_
diff --git a/cc/raster/task_graph_runner.h b/cc/raster/task_graph_runner.h index d5f8cee..51ac3341c 100644 --- a/cc/raster/task_graph_runner.h +++ b/cc/raster/task_graph_runner.h
@@ -16,85 +16,10 @@ #include "base/logging.h" #include "base/memory/ref_counted.h" #include "cc/base/cc_export.h" +#include "cc/raster/task.h" namespace cc { -class TaskGraphRunner; - -// A task which can be run by a TaskGraphRunner. To run a Task, it should be -// inserted into a TaskGraph, which can then be scheduled on the -// TaskGraphRunner. -class CC_EXPORT Task : public base::RefCountedThreadSafe<Task> { - public: - typedef std::vector<scoped_refptr<Task>> Vector; - - // Subclasses should implement this method. RunOnWorkerThread may be called - // on any thread, and subclasses are responsible for locking and thread - // safety. - virtual void RunOnWorkerThread() = 0; - - void WillRun(); - void DidRun(); - bool HasFinishedRunning() const; - - protected: - friend class base::RefCountedThreadSafe<Task>; - - Task(); - virtual ~Task(); - - bool will_run_; - bool did_run_; -}; - -// A task dependency graph describes the order in which to execute a set -// of tasks. Dependencies are represented as edges. Each node is assigned -// a category, a priority and a run count that matches the number of -// dependencies. Priority range from 0 (most favorable scheduling) to UINT16_MAX -// (least favorable). Categories range from 0 to UINT16_MAX. It is up to the -// implementation and its consumer to determine the meaning (if any) of a -// category. A TaskGraphRunner implementation may chose to prioritize certain -// categories over others, regardless of the individual priorities of tasks. -struct CC_EXPORT TaskGraph { - struct Node { - typedef std::vector<Node> Vector; - - Node(Task* task, - uint16_t category, - uint16_t priority, - uint32_t dependencies) - : task(task), - category(category), - priority(priority), - dependencies(dependencies) {} - - Task* task; - uint16_t category; - uint16_t priority; - uint32_t dependencies; - }; - - struct Edge { - typedef std::vector<Edge> Vector; - - Edge(const Task* task, Task* dependent) - : task(task), dependent(dependent) {} - - const Task* task; - Task* dependent; - }; - - TaskGraph(); - TaskGraph(const TaskGraph& other); - ~TaskGraph(); - - void Swap(TaskGraph* other); - void Reset(); - - Node::Vector nodes; - Edge::Vector edges; -}; - // Opaque identifier that defines a namespace of tasks. class CC_EXPORT NamespaceToken { public: @@ -166,61 +91,6 @@ virtual ~TaskGraphRunner() {} }; -// Helper class for iterating over all dependents of a task. -class DependentIterator { - public: - DependentIterator(TaskGraph* graph, const Task* task) - : graph_(graph), - task_(task), - current_index_(static_cast<size_t>(-1)), - current_node_(NULL) { - ++(*this); - } - - TaskGraph::Node& operator->() const { - DCHECK_LT(current_index_, graph_->edges.size()); - DCHECK_EQ(graph_->edges[current_index_].task, task_); - DCHECK(current_node_); - return *current_node_; - } - - TaskGraph::Node& operator*() const { - DCHECK_LT(current_index_, graph_->edges.size()); - DCHECK_EQ(graph_->edges[current_index_].task, task_); - DCHECK(current_node_); - return *current_node_; - } - - // Note: Performance can be improved by keeping edges sorted. - DependentIterator& operator++() { - // Find next dependency edge for |task_|. - do { - ++current_index_; - if (current_index_ == graph_->edges.size()) - return *this; - } while (graph_->edges[current_index_].task != task_); - - // Now find the node for the dependent of this edge. - TaskGraph::Node::Vector::iterator it = std::find_if( - graph_->nodes.begin(), graph_->nodes.end(), - [this](const TaskGraph::Node& node) { - return node.task == graph_->edges[current_index_].dependent; - }); - DCHECK(it != graph_->nodes.end()); - current_node_ = &(*it); - - return *this; - } - - operator bool() const { return current_index_ < graph_->edges.size(); } - - private: - TaskGraph* graph_; - const Task* task_; - size_t current_index_; - TaskGraph::Node* current_node_; -}; - } // namespace cc #endif // CC_RASTER_TASK_GRAPH_RUNNER_H_
diff --git a/cc/raster/task_graph_work_queue.cc b/cc/raster/task_graph_work_queue.cc index 98413ee..aa75654 100644 --- a/cc/raster/task_graph_work_queue.cc +++ b/cc/raster/task_graph_work_queue.cc
@@ -43,6 +43,62 @@ private: uint16_t category_; }; + +// Helper class for iterating over all dependents of a task. +class DependentIterator { + public: + DependentIterator(TaskGraph* graph, const Task* task) + : graph_(graph), + task_(task), + current_index_(static_cast<size_t>(-1)), + current_node_(NULL) { + ++(*this); + } + + TaskGraph::Node& operator->() const { + DCHECK_LT(current_index_, graph_->edges.size()); + DCHECK_EQ(graph_->edges[current_index_].task, task_); + DCHECK(current_node_); + return *current_node_; + } + + TaskGraph::Node& operator*() const { + DCHECK_LT(current_index_, graph_->edges.size()); + DCHECK_EQ(graph_->edges[current_index_].task, task_); + DCHECK(current_node_); + return *current_node_; + } + + // Note: Performance can be improved by keeping edges sorted. + DependentIterator& operator++() { + // Find next dependency edge for |task_|. + do { + ++current_index_; + if (current_index_ == graph_->edges.size()) + return *this; + } while (graph_->edges[current_index_].task != task_); + + // Now find the node for the dependent of this edge. + TaskGraph::Node::Vector::iterator it = std::find_if( + graph_->nodes.begin(), graph_->nodes.end(), + [this](const TaskGraph::Node& node) { + return node.task == graph_->edges[current_index_].dependent; + }); + DCHECK(it != graph_->nodes.end()); + current_node_ = &(*it); + + return *this; + } + + operator bool() const { return current_index_ < graph_->edges.size(); } + + private: + TaskGraph* graph_; + const Task* task_; + size_t current_index_; + TaskGraph::Node* current_node_; +}; + } // namespace TaskGraphWorkQueue::TaskNamespace::TaskNamespace() {}
diff --git a/cc/raster/tile_task_runner.cc b/cc/raster/tile_task_runner.cc index e76218c..fde8ad80 100644 --- a/cc/raster/tile_task_runner.cc +++ b/cc/raster/tile_task_runner.cc
@@ -7,8 +7,17 @@ namespace cc { -TileTask::TileTask() : did_schedule_(false), did_complete_(false) { -} +TileTask::TileTask(bool supports_concurrent_execution) + : supports_concurrent_execution_(supports_concurrent_execution), + did_schedule_(false), + did_complete_(false) {} + +TileTask::TileTask(bool supports_concurrent_execution, + TileTask::Vector* dependencies) + : supports_concurrent_execution_(supports_concurrent_execution), + dependencies_(std::move(*dependencies)), + did_schedule_(false), + did_complete_(false) {} TileTask::~TileTask() { DCHECK(!did_schedule_); @@ -43,26 +52,6 @@ return did_complete_; } -ImageDecodeTask::ImageDecodeTask() { -} - -ImageDecodeTask::ImageDecodeTask(scoped_refptr<ImageDecodeTask> dependency) - : dependency_(std::move(dependency)) {} - -ImageDecodeTask::~ImageDecodeTask() { -} - -bool ImageDecodeTask::SupportsConcurrentExecution() const { - return true; -} - -RasterTask::RasterTask(ImageDecodeTask::Vector* dependencies) { - dependencies_.swap(*dependencies); -} - -RasterTask::~RasterTask() { -} - bool TileTaskRunner::ResourceFormatRequiresSwizzle(ResourceFormat format) { switch (format) { case RGBA_8888:
diff --git a/cc/raster/tile_task_runner.h b/cc/raster/tile_task_runner.h index dc1586a..3bda3ad 100644 --- a/cc/raster/tile_task_runner.h +++ b/cc/raster/tile_task_runner.h
@@ -11,7 +11,7 @@ #include "base/callback.h" #include "cc/raster/raster_buffer.h" -#include "cc/raster/task_graph_runner.h" +#include "cc/raster/task.h" #include "cc/resources/resource_format.h" namespace cc { @@ -20,6 +20,16 @@ public: typedef std::vector<scoped_refptr<TileTask>> Vector; + const TileTask::Vector& dependencies() const { return dependencies_; } + + // Indicates whether this TileTask can be run at the same time as other tasks + // in the task graph. If false, this task will be scheduled with + // TASK_CATEGORY_NONCONCURRENT_FOREGROUND. The base implementation always + // returns true. + bool SupportsConcurrentExecution() const { + return supports_concurrent_execution_; + } + virtual void ScheduleOnOriginThread(RasterBufferProvider* provider) = 0; virtual void CompleteOnOriginThread(RasterBufferProvider* provider) = 0; @@ -32,49 +42,16 @@ bool HasCompleted() const; protected: - TileTask(); + explicit TileTask(bool supports_concurrent_execution); + TileTask(bool supports_concurrent_execution, TileTask::Vector* dependencies); ~TileTask() override; + const bool supports_concurrent_execution_; + TileTask::Vector dependencies_; bool did_schedule_; bool did_complete_; }; -class CC_EXPORT ImageDecodeTask : public TileTask { - public: - typedef std::vector<scoped_refptr<ImageDecodeTask>> Vector; - - // Indicates whether this ImageDecodeTask can be run at the same time as - // other tasks in the task graph. If false, this task will be scheduled with - // TASK_CATEGORY_NONCONCURRENT_FOREGROUND. The base implementation always - // returns true. - virtual bool SupportsConcurrentExecution() const; - - // Returns an optional task which this task depends on. May be null. - const scoped_refptr<ImageDecodeTask>& dependency() { return dependency_; } - - protected: - ImageDecodeTask(); - explicit ImageDecodeTask(scoped_refptr<ImageDecodeTask> dependency); - ~ImageDecodeTask() override; - - private: - scoped_refptr<ImageDecodeTask> dependency_; -}; - -class CC_EXPORT RasterTask : public TileTask { - public: - typedef std::vector<scoped_refptr<RasterTask>> Vector; - - const ImageDecodeTask::Vector& dependencies() const { return dependencies_; } - - protected: - explicit RasterTask(ImageDecodeTask::Vector* dependencies); - ~RasterTask() override; - - private: - ImageDecodeTask::Vector dependencies_; -}; - // This interface can be used to schedule and run tile tasks. // The client can call CheckForCompletedTasks() at any time to dispatch // pending completion callbacks for all tasks that have finished running.
diff --git a/cc/raster/tile_task_worker_pool.h b/cc/raster/tile_task_worker_pool.h index e05256ef..f4e675c 100644 --- a/cc/raster/tile_task_worker_pool.h +++ b/cc/raster/tile_task_worker_pool.h
@@ -8,6 +8,7 @@ #include <stddef.h> #include "cc/playback/raster_source.h" +#include "cc/raster/task_graph_runner.h" #include "cc/raster/tile_task_runner.h" #include "ui/gfx/geometry/rect.h" #include "ui/gfx/geometry/size.h"
diff --git a/cc/raster/tile_task_worker_pool_perftest.cc b/cc/raster/tile_task_worker_pool_perftest.cc index 2335ca7..04922d68 100644 --- a/cc/raster/tile_task_worker_pool_perftest.cc +++ b/cc/raster/tile_task_worker_pool_perftest.cc
@@ -123,9 +123,9 @@ static const int kWarmupRuns = 5; static const int kTimeCheckInterval = 10; -class PerfImageDecodeTaskImpl : public ImageDecodeTask { +class PerfImageDecodeTaskImpl : public TileTask { public: - PerfImageDecodeTaskImpl() {} + PerfImageDecodeTaskImpl() : TileTask(true) {} // Overridden from Task: void RunOnWorkerThread() override {} @@ -148,11 +148,11 @@ DISALLOW_COPY_AND_ASSIGN(PerfImageDecodeTaskImpl); }; -class PerfRasterTaskImpl : public RasterTask { +class PerfRasterTaskImpl : public TileTask { public: PerfRasterTaskImpl(std::unique_ptr<ScopedResource> resource, - ImageDecodeTask::Vector* dependencies) - : RasterTask(dependencies), resource_(std::move(resource)) {} + TileTask::Vector* dependencies) + : TileTask(true, dependencies), resource_(std::move(resource)) {} // Overridden from Task: void RunOnWorkerThread() override {} @@ -184,7 +184,7 @@ class TileTaskWorkerPoolPerfTestBase { public: - typedef std::vector<scoped_refptr<RasterTask>> RasterTaskVector; + typedef std::vector<scoped_refptr<TileTask>> RasterTaskVector; enum NamedTaskSet { REQUIRED_FOR_ACTIVATION, REQUIRED_FOR_DRAW, ALL }; @@ -197,13 +197,13 @@ kTimeCheckInterval) {} void CreateImageDecodeTasks(unsigned num_image_decode_tasks, - ImageDecodeTask::Vector* image_decode_tasks) { + TileTask::Vector* image_decode_tasks) { for (unsigned i = 0; i < num_image_decode_tasks; ++i) image_decode_tasks->push_back(new PerfImageDecodeTaskImpl); } void CreateRasterTasks(unsigned num_raster_tasks, - const ImageDecodeTask::Vector& image_decode_tasks, + const TileTask::Vector& image_decode_tasks, RasterTaskVector* raster_tasks) { const gfx::Size size(1, 1); @@ -213,7 +213,7 @@ resource->Allocate(size, ResourceProvider::TEXTURE_HINT_IMMUTABLE, RGBA_8888); - ImageDecodeTask::Vector dependencies = image_decode_tasks; + TileTask::Vector dependencies = image_decode_tasks; raster_tasks->push_back( new PerfRasterTaskImpl(std::move(resource), &dependencies)); } @@ -300,7 +300,7 @@ void RunScheduleTasksTest(const std::string& test_name, unsigned num_raster_tasks, unsigned num_image_decode_tasks) { - ImageDecodeTask::Vector image_decode_tasks; + TileTask::Vector image_decode_tasks; RasterTaskVector raster_tasks; CreateImageDecodeTasks(num_image_decode_tasks, &image_decode_tasks); CreateRasterTasks(num_raster_tasks, image_decode_tasks, &raster_tasks); @@ -329,7 +329,7 @@ unsigned num_raster_tasks, unsigned num_image_decode_tasks) { const size_t kNumVersions = 2; - ImageDecodeTask::Vector image_decode_tasks[kNumVersions]; + TileTask::Vector image_decode_tasks[kNumVersions]; RasterTaskVector raster_tasks[kNumVersions]; for (size_t i = 0; i < kNumVersions; ++i) { CreateImageDecodeTasks(num_image_decode_tasks, &image_decode_tasks[i]); @@ -362,7 +362,7 @@ void RunScheduleAndExecuteTasksTest(const std::string& test_name, unsigned num_raster_tasks, unsigned num_image_decode_tasks) { - ImageDecodeTask::Vector image_decode_tasks; + TileTask::Vector image_decode_tasks; RasterTaskVector raster_tasks; CreateImageDecodeTasks(num_image_decode_tasks, &image_decode_tasks); CreateRasterTasks(num_raster_tasks, image_decode_tasks, &raster_tasks); @@ -471,7 +471,7 @@ void RunBuildTileTaskGraphTest(const std::string& test_name, unsigned num_raster_tasks, unsigned num_image_decode_tasks) { - ImageDecodeTask::Vector image_decode_tasks; + TileTask::Vector image_decode_tasks; RasterTaskVector raster_tasks; CreateImageDecodeTasks(num_image_decode_tasks, &image_decode_tasks); CreateRasterTasks(num_raster_tasks, image_decode_tasks, &raster_tasks);
diff --git a/cc/raster/tile_task_worker_pool_unittest.cc b/cc/raster/tile_task_worker_pool_unittest.cc index e3d2ab5d..03f835c 100644 --- a/cc/raster/tile_task_worker_pool_unittest.cc +++ b/cc/raster/tile_task_worker_pool_unittest.cc
@@ -51,14 +51,14 @@ TILE_TASK_WORKER_POOL_TYPE_BITMAP }; -class TestRasterTaskImpl : public RasterTask { +class TestRasterTaskImpl : public TileTask { public: typedef base::Callback<void(bool was_canceled)> Reply; TestRasterTaskImpl(const Resource* resource, const Reply& reply, - ImageDecodeTask::Vector* dependencies) - : RasterTask(dependencies), + TileTask::Vector* dependencies) + : TileTask(true, dependencies), resource_(resource), reply_(reply), raster_source_(FakeRasterSource::CreateFilled(gfx::Size(1, 1))) {} @@ -99,7 +99,7 @@ BlockingTestRasterTaskImpl(const Resource* resource, const Reply& reply, base::Lock* lock, - ImageDecodeTask::Vector* dependencies) + TileTask::Vector* dependencies) : TestRasterTaskImpl(resource, reply, dependencies), lock_(lock) {} // Overridden from Task: @@ -125,7 +125,7 @@ bool canceled; }; - typedef std::vector<scoped_refptr<RasterTask>> RasterTaskVector; + typedef std::vector<scoped_refptr<TileTask>> RasterTaskVector; enum NamedTaskSet { REQUIRED_FOR_ACTIVATION, REQUIRED_FOR_DRAW, ALL }; @@ -210,7 +210,7 @@ RGBA_8888); const Resource* const_resource = resource.get(); - ImageDecodeTask::Vector empty; + TileTask::Vector empty; tasks_.push_back(new TestRasterTaskImpl( const_resource, base::Bind(&TileTaskWorkerPoolTest::OnTaskCompleted, @@ -229,7 +229,7 @@ RGBA_8888); const Resource* const_resource = resource.get(); - ImageDecodeTask::Vector empty; + TileTask::Vector empty; tasks_.push_back(new BlockingTestRasterTaskImpl( const_resource, base::Bind(&TileTaskWorkerPoolTest::OnTaskCompleted,
diff --git a/cc/resources/resource_util.h b/cc/resources/resource_util.h index 68a4aa5..51cda02 100644 --- a/cc/resources/resource_util.h +++ b/cc/resources/resource_util.h
@@ -55,18 +55,6 @@ ResourceFormat format); private: - // TODO(prashant.n): Replace IsSameType with std::is_same once C++11 is used - // on all platforms. - template <typename T, typename U> - struct IsSameType { - static const bool value = false; - }; - - template <typename T> - struct IsSameType<T, T> { - static const bool value = true; - }; - template <typename T> static inline void VerifyType(); @@ -161,7 +149,7 @@ template <typename T> void ResourceUtil::VerifyType() { static_assert( - std::numeric_limits<T>::is_integer && !IsSameType<T, bool>::value, + std::numeric_limits<T>::is_integer && !std::is_same<T, bool>::value, "T must be non-bool integer type. Preferred type is size_t."); }
diff --git a/cc/surfaces/BUILD.gn b/cc/surfaces/BUILD.gn index c64d96e5..1c5ca5c 100644 --- a/cc/surfaces/BUILD.gn +++ b/cc/surfaces/BUILD.gn
@@ -55,9 +55,9 @@ "//gpu/command_buffer/client:gles2_interface", "//gpu/command_buffer/common", "//skia", + "//ui/events:events_base", "//ui/gfx", "//ui/gfx/geometry", - "//ui/latency_info", ] if (is_android && !is_debug) {
diff --git a/cc/surfaces/display.h b/cc/surfaces/display.h index d3e256d..c4400cd 100644 --- a/cc/surfaces/display.h +++ b/cc/surfaces/display.h
@@ -18,7 +18,7 @@ #include "cc/surfaces/surface_id.h" #include "cc/surfaces/surface_manager.h" #include "cc/surfaces/surfaces_export.h" -#include "ui/latency_info/latency_info.h" +#include "ui/events/latency_info.h" namespace gpu { class GpuMemoryBufferManager;
diff --git a/cc/surfaces/surface_display_output_surface_unittest.cc b/cc/surfaces/surface_display_output_surface_unittest.cc index 8315130..f263363 100644 --- a/cc/surfaces/surface_display_output_surface_unittest.cc +++ b/cc/surfaces/surface_display_output_surface_unittest.cc
@@ -4,6 +4,8 @@ #include "cc/surfaces/surface_display_output_surface.h" +#include <memory> + #include "cc/surfaces/onscreen_display_client.h" #include "cc/surfaces/surface_id_allocator.h" #include "cc/surfaces/surface_manager.h" @@ -115,7 +117,7 @@ protected: std::unique_ptr<base::SimpleTestTickClock> now_src_; scoped_refptr<OrderedSimpleTaskRunner> task_runner_; - scoped_ptr<BackToBackBeginFrameSource> begin_frame_source_; + std::unique_ptr<BackToBackBeginFrameSource> begin_frame_source_; SurfaceIdAllocator allocator_; const gfx::Size display_size_;
diff --git a/cc/test/fake_channel_impl.h b/cc/test/fake_channel_impl.h index 053a7ad..8690ba8a 100644 --- a/cc/test/fake_channel_impl.h +++ b/cc/test/fake_channel_impl.h
@@ -28,10 +28,6 @@ bool success, const RendererCapabilities& capabilities) override {} void DidCompletePageScaleAnimation() override {} - void PostFrameTimingEventsOnMain( - std::unique_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, - std::unique_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events) - override {} void BeginMainFrame(std::unique_ptr<BeginMainFrameAndCommitState> begin_main_frame_state) override {} };
diff --git a/cc/test/fake_layer_tree_host_client.h b/cc/test/fake_layer_tree_host_client.h index ecaa8a6..1684e3e 100644 --- a/cc/test/fake_layer_tree_host_client.h +++ b/cc/test/fake_layer_tree_host_client.h
@@ -49,10 +49,6 @@ void DidCommitAndDrawFrame() override {} void DidCompleteSwapBuffers() override {} void DidCompletePageScaleAnimation() override {} - void RecordFrameTimingEvents( - std::unique_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, - std::unique_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events) - override {} // LayerTreeHostSingleThreadClient implementation. void DidPostSwapBuffers() override {}
diff --git a/cc/test/fake_layer_tree_host_impl_client.h b/cc/test/fake_layer_tree_host_impl_client.h index f3e8e98..8fc8ab4 100644 --- a/cc/test/fake_layer_tree_host_impl_client.h +++ b/cc/test/fake_layer_tree_host_impl_client.h
@@ -5,7 +5,6 @@ #ifndef CC_TEST_FAKE_LAYER_TREE_HOST_IMPL_CLIENT_H_ #define CC_TEST_FAKE_LAYER_TREE_HOST_IMPL_CLIENT_H_ -#include "cc/debug/frame_timing_tracker.h" #include "cc/output/begin_frame_args.h" #include "cc/trees/layer_tree_host_impl.h" @@ -42,10 +41,6 @@ void DidPrepareTiles() override {} void DidCompletePageScaleAnimationOnImplThread() override {} void OnDrawForOutputSurface(bool resourceless_software_draw) override {} - void PostFrameTimingEventsOnImplThread( - std::unique_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, - std::unique_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events) - override {} }; } // namespace cc
diff --git a/cc/test/fake_tile_manager.cc b/cc/test/fake_tile_manager.cc index ebc0b70a..7397ae4a3 100644 --- a/cc/test/fake_tile_manager.cc +++ b/cc/test/fake_tile_manager.cc
@@ -26,7 +26,7 @@ void Shutdown() override {} void ScheduleTasks(TaskGraph* graph) override { for (const auto& node : graph->nodes) { - RasterTask* task = static_cast<RasterTask*>(node.task); + TileTask* task = static_cast<TileTask*>(node.task); task->WillSchedule(); task->ScheduleOnOriginThread(this); @@ -36,10 +36,9 @@ } } void CheckForCompletedTasks() override { - for (RasterTask::Vector::iterator it = completed_tasks_.begin(); - it != completed_tasks_.end(); - ++it) { - RasterTask* task = it->get(); + for (TileTask::Vector::iterator it = completed_tasks_.begin(); + it != completed_tasks_.end(); ++it) { + TileTask* task = it->get(); task->WillComplete(); task->CompleteOnOriginThread(this); @@ -65,7 +64,7 @@ void ReleaseBufferForRaster(std::unique_ptr<RasterBuffer> buffer) override {} private: - RasterTask::Vector completed_tasks_; + TileTask::Vector completed_tasks_; }; base::LazyInstance<FakeTileTaskRunnerImpl> g_fake_tile_task_runner = LAZY_INSTANCE_INITIALIZER;
diff --git a/cc/test/layer_tree_test.cc b/cc/test/layer_tree_test.cc index 8ff231a..3c7c8e4 100644 --- a/cc/test/layer_tree_test.cc +++ b/cc/test/layer_tree_test.cc
@@ -394,11 +394,6 @@ void DidCompletePageScaleAnimation() override {} void BeginMainFrameNotExpectedSoon() override {} - void RecordFrameTimingEvents( - std::unique_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, - std::unique_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events) - override {} - private: explicit LayerTreeHostClientForTesting(TestHooks* test_hooks) : test_hooks_(test_hooks) {}
diff --git a/cc/test/proxy_impl_for_test.h b/cc/test/proxy_impl_for_test.h index 8919232..97d5f89b 100644 --- a/cc/test/proxy_impl_for_test.h +++ b/cc/test/proxy_impl_for_test.h
@@ -31,9 +31,6 @@ const DelayedUniqueNotifier& smoothness_priority_expiration_notifier() const { return smoothness_priority_expiration_notifier_; } - const BeginFrameArgs& last_begin_frame_args() const { - return last_begin_main_frame_args_; - } ProxyImplForTest( TestHooks* test_hooks,
diff --git a/cc/test/proxy_main_for_test.cc b/cc/test/proxy_main_for_test.cc index 715e997..d4c60db7 100644 --- a/cc/test/proxy_main_for_test.cc +++ b/cc/test/proxy_main_for_test.cc
@@ -99,14 +99,6 @@ ProxyMain::DidCompletePageScaleAnimation(); } -void ProxyMainForTest::PostFrameTimingEventsOnMain( - std::unique_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, - std::unique_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events) { - test_hooks_->ReceivedPostFrameTimingEventsOnMain(); - ProxyMain::PostFrameTimingEventsOnMain(std::move(composite_events), - std::move(main_frame_events)); -} - void ProxyMainForTest::BeginMainFrame( std::unique_ptr<BeginMainFrameAndCommitState> begin_main_frame_state) { test_hooks_->ReceivedBeginMainFrame();
diff --git a/cc/test/proxy_main_for_test.h b/cc/test/proxy_main_for_test.h index c2082116..ef354e3 100644 --- a/cc/test/proxy_main_for_test.h +++ b/cc/test/proxy_main_for_test.h
@@ -50,10 +50,6 @@ bool success, const RendererCapabilities& capabilities) override; void DidCompletePageScaleAnimation() override; - void PostFrameTimingEventsOnMain( - std::unique_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, - std::unique_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events) - override; void BeginMainFrame(std::unique_ptr<BeginMainFrameAndCommitState> begin_main_frame_state) override;
diff --git a/cc/test/test_gpu_memory_buffer_manager.h b/cc/test/test_gpu_memory_buffer_manager.h index ac805b86..e5c70ec 100644 --- a/cc/test/test_gpu_memory_buffer_manager.h +++ b/cc/test/test_gpu_memory_buffer_manager.h
@@ -5,6 +5,8 @@ #ifndef CC_TEST_TEST_GPU_MEMORY_BUFFER_MANAGER_H_ #define CC_TEST_TEST_GPU_MEMORY_BUFFER_MANAGER_H_ +#include <memory> + #include "base/macros.h" #include "gpu/command_buffer/client/gpu_memory_buffer_manager.h"
diff --git a/cc/test/test_in_process_context_provider.h b/cc/test/test_in_process_context_provider.h index 3e5bd25..5062909 100644 --- a/cc/test/test_in_process_context_provider.h +++ b/cc/test/test_in_process_context_provider.h
@@ -7,6 +7,8 @@ #include <stdint.h> +#include <memory> + #include "base/synchronization/lock.h" #include "cc/output/context_provider.h" #include "cc/test/test_gpu_memory_buffer_manager.h"
diff --git a/cc/tiles/gpu_image_decode_controller.cc b/cc/tiles/gpu_image_decode_controller.cc index ab683d6..cdb6f33c 100644 --- a/cc/tiles/gpu_image_decode_controller.cc +++ b/cc/tiles/gpu_image_decode_controller.cc
@@ -57,12 +57,13 @@ // Task which decodes an image and stores the result in discardable memory. // This task does not use GPU resources and can be run on any thread. -class ImageDecodeTaskImpl : public ImageDecodeTask { +class ImageDecodeTaskImpl : public TileTask { public: ImageDecodeTaskImpl(GpuImageDecodeController* controller, const DrawImage& draw_image, uint64_t source_prepare_tiles_id) - : controller_(controller), + : TileTask(true), + controller_(controller), image_(draw_image), image_ref_(skia::SharePtr(draw_image.image())), source_prepare_tiles_id_(source_prepare_tiles_id) { @@ -97,18 +98,19 @@ // Task which creates an image from decoded data. Typically this involves // uploading data to the GPU, which requires this task be run on the non- // concurrent thread. -class ImageUploadTaskImpl : public ImageDecodeTask { +class ImageUploadTaskImpl : public TileTask { public: ImageUploadTaskImpl(GpuImageDecodeController* controller, const DrawImage& draw_image, - scoped_refptr<ImageDecodeTask> decode_dependency, + scoped_refptr<TileTask> decode_dependency, uint64_t source_prepare_tiles_id) - : ImageDecodeTask(std::move(decode_dependency)), + : TileTask(false), controller_(controller), image_(draw_image), image_ref_(skia::SharePtr(draw_image.image())), source_prepare_tiles_id_(source_prepare_tiles_id) { DCHECK(!SkipImage(draw_image)); + dependencies_.push_back(std::move(decode_dependency)); } // Override from Task: @@ -123,9 +125,6 @@ controller_->UploadTaskCompleted(image_); } - // Override from ImageDecodeTask: - bool SupportsConcurrentExecution() const override { return false; } - protected: ~ImageUploadTaskImpl() override {} @@ -158,12 +157,16 @@ ResourceFormat decode_format) : format_(decode_format), context_(context), - context_threadsafe_proxy_( - skia::AdoptRef(context->GrContext()->threadSafeProxy())), image_data_(ImageDataMRUCache::NO_AUTO_EVICT), cached_items_limit_(kMaxDiscardableItems), cached_bytes_limit_(kMaxGpuImageBytes), - bytes_used_(0) {} + bytes_used_(0) { + // Acquire the context_lock so that we can safely retrieve the + // GrContextThreadSafeProxy. This proxy can then be used with no lock held. + ContextProvider::ScopedContextLock context_lock(context_); + context_threadsafe_proxy_ = + skia::AdoptRef(context->GrContext()->threadSafeProxy()); +} GpuImageDecodeController::~GpuImageDecodeController() { // SetShouldAggressivelyFreeResources will zero our limits and free all @@ -174,7 +177,7 @@ bool GpuImageDecodeController::GetTaskForImageAndRef( const DrawImage& draw_image, uint64_t prepare_tiles_id, - scoped_refptr<ImageDecodeTask>* task) { + scoped_refptr<TileTask>* task) { if (SkipImage(draw_image)) { *task = nullptr; return false; @@ -202,7 +205,7 @@ // We didn't have a pre-uploaded image, so we need an upload task. Try to find // an existing one. - scoped_refptr<ImageDecodeTask>& existing_task = + scoped_refptr<TileTask>& existing_task = pending_image_upload_tasks_[image_id]; if (existing_task) { // We had an existing upload task, ref the image and return the task. @@ -387,9 +390,9 @@ // Checks if an existing image decode exists. If not, returns a task to produce // the requested decode. -scoped_refptr<ImageDecodeTask> -GpuImageDecodeController::GetImageDecodeTaskAndRef(const DrawImage& draw_image, - uint64_t prepare_tiles_id) { +scoped_refptr<TileTask> GpuImageDecodeController::GetImageDecodeTaskAndRef( + const DrawImage& draw_image, + uint64_t prepare_tiles_id) { lock_.AssertAcquired(); const uint32_t image_id = draw_image.image()->uniqueID(); @@ -408,7 +411,7 @@ } // We didn't have an existing locked image, create a task to lock or decode. - scoped_refptr<ImageDecodeTask>& existing_task = + scoped_refptr<TileTask>& existing_task = pending_image_decode_tasks_[image_id]; if (!existing_task) { // Ref image decode and create a decode task. This ref will be released in
diff --git a/cc/tiles/gpu_image_decode_controller.h b/cc/tiles/gpu_image_decode_controller.h index 10b03e13..32b2b4c 100644 --- a/cc/tiles/gpu_image_decode_controller.h +++ b/cc/tiles/gpu_image_decode_controller.h
@@ -61,7 +61,7 @@ // upload task to upload the image if an exsiting image does not exist. bool GetTaskForImageAndRef(const DrawImage& image, uint64_t prepare_tiles_id, - scoped_refptr<ImageDecodeTask>* task) override; + scoped_refptr<TileTask>* task) override; void UnrefImage(const DrawImage& image) override; DecodedDrawImage GetDecodedImageForDraw(const DrawImage& draw_image) override; void DrawWithImageFinished(const DrawImage& image, @@ -135,9 +135,8 @@ // Similar to GetTaskForImageAndRef, but gets the dependent decode task // rather than the upload task, if necessary. - scoped_refptr<ImageDecodeTask> GetImageDecodeTaskAndRef( - const DrawImage& image, - uint64_t prepare_tiles_id); + scoped_refptr<TileTask> GetImageDecodeTaskAndRef(const DrawImage& image, + uint64_t prepare_tiles_id); void RefImageDecode(const DrawImage& draw_image); void UnrefImageDecode(const DrawImage& draw_image); @@ -170,9 +169,9 @@ // All members below this point must only be accessed while holding |lock_|. base::Lock lock_; - std::unordered_map<uint32_t, scoped_refptr<ImageDecodeTask>> + std::unordered_map<uint32_t, scoped_refptr<TileTask>> pending_image_upload_tasks_; - std::unordered_map<uint32_t, scoped_refptr<ImageDecodeTask>> + std::unordered_map<uint32_t, scoped_refptr<TileTask>> pending_image_decode_tasks_; ImageDataMRUCache image_data_;
diff --git a/cc/tiles/gpu_image_decode_controller_unittest.cc b/cc/tiles/gpu_image_decode_controller_unittest.cc index fef46e98..71bc063 100644 --- a/cc/tiles/gpu_image_decode_controller_unittest.cc +++ b/cc/tiles/gpu_image_decode_controller_unittest.cc
@@ -31,25 +31,25 @@ return matrix; } -void ScheduleTask(ImageDecodeTask* task) { +void ScheduleTask(TileTask* task) { task->WillSchedule(); task->ScheduleOnOriginThread(nullptr); task->DidSchedule(); } -void RunTask(ImageDecodeTask* task) { +void RunTask(TileTask* task) { task->WillRun(); task->RunOnWorkerThread(); task->DidRun(); } -void CompleteTask(ImageDecodeTask* task) { +void CompleteTask(TileTask* task) { task->WillComplete(); task->CompleteOnOriginThread(nullptr); task->DidComplete(); } -void ProcessTask(ImageDecodeTask* task) { +void ProcessTask(TileTask* task) { ScheduleTask(task); RunTask(task); CompleteTask(task); @@ -68,7 +68,7 @@ DrawImage draw_image( image.get(), SkIRect::MakeWH(image->width(), image->height()), quality, CreateMatrix(SkSize::Make(0.5f, 0.5f), is_decomposable)); - scoped_refptr<ImageDecodeTask> task; + scoped_refptr<TileTask> task; bool need_unref = controller.GetTaskForImageAndRef(draw_image, prepare_tiles_id, &task); EXPECT_TRUE(need_unref); @@ -77,13 +77,13 @@ DrawImage another_draw_image( image.get(), SkIRect::MakeWH(image->width(), image->height()), quality, CreateMatrix(SkSize::Make(1.5f, 1.5f), is_decomposable)); - scoped_refptr<ImageDecodeTask> another_task; + scoped_refptr<TileTask> another_task; need_unref = controller.GetTaskForImageAndRef( another_draw_image, prepare_tiles_id, &another_task); EXPECT_TRUE(need_unref); EXPECT_TRUE(task.get() == another_task.get()); - ProcessTask(task->dependency().get()); + ProcessTask(task->dependencies()[0].get()); ProcessTask(task.get()); controller.UnrefImage(draw_image); @@ -104,7 +104,7 @@ first_image.get(), SkIRect::MakeWH(first_image->width(), first_image->height()), quality, CreateMatrix(SkSize::Make(0.5f, 0.5f), is_decomposable)); - scoped_refptr<ImageDecodeTask> first_task; + scoped_refptr<TileTask> first_task; bool need_unref = controller.GetTaskForImageAndRef( first_draw_image, prepare_tiles_id, &first_task); EXPECT_TRUE(need_unref); @@ -115,16 +115,16 @@ second_image.get(), SkIRect::MakeWH(second_image->width(), second_image->height()), quality, CreateMatrix(SkSize::Make(0.25f, 0.25f), is_decomposable)); - scoped_refptr<ImageDecodeTask> second_task; + scoped_refptr<TileTask> second_task; need_unref = controller.GetTaskForImageAndRef(second_draw_image, prepare_tiles_id, &second_task); EXPECT_TRUE(need_unref); EXPECT_TRUE(second_task); EXPECT_TRUE(first_task.get() != second_task.get()); - ProcessTask(first_task->dependency().get()); + ProcessTask(first_task->dependencies()[0].get()); ProcessTask(first_task.get()); - ProcessTask(second_task->dependency().get()); + ProcessTask(second_task->dependencies()[0].get()); ProcessTask(second_task.get()); controller.UnrefImage(first_draw_image); @@ -144,18 +144,19 @@ DrawImage draw_image( image.get(), SkIRect::MakeWH(image->width(), image->height()), quality, CreateMatrix(SkSize::Make(0.5f, 0.5f), is_decomposable)); - scoped_refptr<ImageDecodeTask> task; + scoped_refptr<TileTask> task; bool need_unref = controller.GetTaskForImageAndRef(draw_image, prepare_tiles_id, &task); EXPECT_TRUE(need_unref); EXPECT_TRUE(task); - EXPECT_TRUE(task->dependency()); + EXPECT_EQ(task->dependencies().size(), 1u); + EXPECT_TRUE(task->dependencies()[0]); - ProcessTask(task->dependency().get()); + ProcessTask(task->dependencies()[0].get()); ScheduleTask(task.get()); RunTask(task.get()); - scoped_refptr<ImageDecodeTask> another_task; + scoped_refptr<TileTask> another_task; need_unref = controller.GetTaskForImageAndRef(draw_image, prepare_tiles_id, &another_task); EXPECT_TRUE(need_unref); @@ -180,16 +181,16 @@ DrawImage draw_image( image.get(), SkIRect::MakeWH(image->width(), image->height()), quality, CreateMatrix(SkSize::Make(0.5f, 0.5f), is_decomposable)); - scoped_refptr<ImageDecodeTask> task; + scoped_refptr<TileTask> task; bool need_unref = controller.GetTaskForImageAndRef(draw_image, prepare_tiles_id, &task); EXPECT_TRUE(need_unref); EXPECT_TRUE(task); - ProcessTask(task->dependency().get()); + ProcessTask(task->dependencies()[0].get()); ScheduleTask(task.get()); - scoped_refptr<ImageDecodeTask> another_task; + scoped_refptr<TileTask> another_task; need_unref = controller.GetTaskForImageAndRef(draw_image, prepare_tiles_id, &another_task); EXPECT_TRUE(need_unref); @@ -203,14 +204,14 @@ controller.UnrefImage(draw_image); // Here a new task is created. - scoped_refptr<ImageDecodeTask> third_task; + scoped_refptr<TileTask> third_task; need_unref = controller.GetTaskForImageAndRef(draw_image, prepare_tiles_id, &third_task); EXPECT_TRUE(need_unref); EXPECT_TRUE(third_task); EXPECT_FALSE(third_task.get() == task.get()); - ProcessTask(third_task->dependency().get()); + ProcessTask(third_task->dependencies()[0].get()); ProcessTask(third_task.get()); controller.UnrefImage(draw_image); @@ -230,16 +231,16 @@ DrawImage draw_image( image.get(), SkIRect::MakeWH(image->width(), image->height()), quality, CreateMatrix(SkSize::Make(0.5f, 0.5f), is_decomposable)); - scoped_refptr<ImageDecodeTask> task; + scoped_refptr<TileTask> task; bool need_unref = controller.GetTaskForImageAndRef(draw_image, prepare_tiles_id, &task); EXPECT_TRUE(need_unref); EXPECT_TRUE(task); - ProcessTask(task->dependency().get()); + ProcessTask(task->dependencies()[0].get()); ScheduleTask(task.get()); - scoped_refptr<ImageDecodeTask> another_task; + scoped_refptr<TileTask> another_task; need_unref = controller.GetTaskForImageAndRef(draw_image, prepare_tiles_id, &another_task); EXPECT_TRUE(need_unref); @@ -250,14 +251,14 @@ // Note that here, everything is reffed, but a new task is created. This is // possible with repeated schedule/cancel operations. - scoped_refptr<ImageDecodeTask> third_task; + scoped_refptr<TileTask> third_task; need_unref = controller.GetTaskForImageAndRef(draw_image, prepare_tiles_id, &third_task); EXPECT_TRUE(need_unref); EXPECT_TRUE(third_task); EXPECT_FALSE(third_task.get() == task.get()); - ProcessTask(third_task->dependency().get()); + ProcessTask(third_task->dependencies()[0].get()); ProcessTask(third_task.get()); // 3 Unrefs! @@ -279,13 +280,13 @@ DrawImage draw_image( image.get(), SkIRect::MakeWH(image->width(), image->height()), quality, CreateMatrix(SkSize::Make(0.5f, 0.5f), is_decomposable)); - scoped_refptr<ImageDecodeTask> task; + scoped_refptr<TileTask> task; bool need_unref = controller.GetTaskForImageAndRef(draw_image, prepare_tiles_id, &task); EXPECT_TRUE(need_unref); EXPECT_TRUE(task); - ProcessTask(task->dependency().get()); + ProcessTask(task->dependencies()[0].get()); ProcessTask(task.get()); // Must hold context lock before calling GetDecodedImageForDraw / @@ -314,13 +315,13 @@ DrawImage draw_image( image.get(), SkIRect::MakeWH(image->width(), image->height()), quality, CreateMatrix(SkSize::Make(0.5f, 0.5f), is_decomposable)); - scoped_refptr<ImageDecodeTask> task; + scoped_refptr<TileTask> task; bool need_unref = controller.GetTaskForImageAndRef(draw_image, prepare_tiles_id, &task); EXPECT_TRUE(need_unref); EXPECT_TRUE(task); - ProcessTask(task->dependency().get()); + ProcessTask(task->dependencies()[0].get()); ProcessTask(task.get()); // Must hold context lock before calling GetDecodedImageForDraw / @@ -353,7 +354,7 @@ image.get(), SkIRect::MakeWH(image->width(), image->height()), quality, CreateMatrix(SkSize::Make(0.5f, 0.5f), is_decomposable)); - scoped_refptr<ImageDecodeTask> task; + scoped_refptr<TileTask> task; bool need_unref = controller.GetTaskForImageAndRef(draw_image, prepare_tiles_id, &task); EXPECT_FALSE(need_unref); @@ -388,7 +389,7 @@ image.get(), SkIRect::MakeWH(image->width(), image->height()), quality, CreateMatrix(SkSize::Make(0.5f, 0.5f), is_decomposable)); - scoped_refptr<ImageDecodeTask> task; + scoped_refptr<TileTask> task; bool need_unref = controller.GetTaskForImageAndRef(draw_image, prepare_tiles_id, &task); EXPECT_FALSE(need_unref); @@ -410,7 +411,7 @@ // cache. controller.DrawWithImageFinished(draw_image, decoded_draw_image); - scoped_refptr<ImageDecodeTask> another_task; + scoped_refptr<TileTask> another_task; bool another_task_needs_unref = controller.GetTaskForImageAndRef(draw_image, prepare_tiles_id, &task); EXPECT_TRUE(another_task_needs_unref); @@ -467,7 +468,7 @@ image.get(), SkIRect::MakeWH(image->width(), image->height()), quality, CreateMatrix(SkSize::Make(0.f, 0.f), is_decomposable)); - scoped_refptr<ImageDecodeTask> task; + scoped_refptr<TileTask> task; bool need_unref = controller.GetTaskForImageAndRef(draw_image, prepare_tiles_id, &task); EXPECT_FALSE(task); @@ -497,7 +498,7 @@ image.get(), SkIRect::MakeXYWH(150, 150, image->width(), image->height()), quality, CreateMatrix(SkSize::Make(1.f, 1.f), is_decomposable)); - scoped_refptr<ImageDecodeTask> task; + scoped_refptr<TileTask> task; bool need_unref = controller.GetTaskForImageAndRef(draw_image, prepare_tiles_id, &task); EXPECT_FALSE(task); @@ -527,15 +528,15 @@ image.get(), SkIRect::MakeXYWH(0, 0, image->width(), image->height()), quality, CreateMatrix(SkSize::Make(1.f, 1.f), is_decomposable)); - scoped_refptr<ImageDecodeTask> task; + scoped_refptr<TileTask> task; bool need_unref = controller.GetTaskForImageAndRef(draw_image, prepare_tiles_id, &task); EXPECT_NE(0u, controller.GetBytesUsedForTesting()); EXPECT_TRUE(task); EXPECT_TRUE(need_unref); - ScheduleTask(task->dependency().get()); - CompleteTask(task->dependency().get()); + ScheduleTask(task->dependencies()[0].get()); + CompleteTask(task->dependencies()[0].get()); ScheduleTask(task.get()); CompleteTask(task.get()); @@ -556,7 +557,7 @@ DrawImage draw_image( image.get(), SkIRect::MakeWH(image->width(), image->height()), quality, CreateMatrix(SkSize::Make(0.5f, 0.5f), is_decomposable)); - scoped_refptr<ImageDecodeTask> task; + scoped_refptr<TileTask> task; { bool need_unref = controller.GetTaskForImageAndRef(draw_image, prepare_tiles_id, &task); @@ -564,7 +565,7 @@ EXPECT_TRUE(task); } - ProcessTask(task->dependency().get()); + ProcessTask(task->dependencies()[0].get()); ProcessTask(task.get()); controller.UnrefImage(draw_image); @@ -594,7 +595,7 @@ EXPECT_TRUE(task); } - ProcessTask(task->dependency().get()); + ProcessTask(task->dependencies()[0].get()); ProcessTask(task.get()); // The image should be in our cache after un-ref.
diff --git a/cc/tiles/image_decode_controller.h b/cc/tiles/image_decode_controller.h index 6d3cd29a..af7c22a 100644 --- a/cc/tiles/image_decode_controller.h +++ b/cc/tiles/image_decode_controller.h
@@ -11,14 +11,14 @@ namespace cc { -class ImageDecodeTask; +class TileTask; // ImageDecodeController is responsible for generating decode tasks, decoding // images, storing images in cache, and being able to return the decoded images // when requested. // ImageDecodeController is responsible for the following things: -// 1. Given a DrawImage, it can return an ImageDecodeTask which when run will +// 1. Given a DrawImage, it can return an TileTask which when run will // decode and cache the resulting image. If the image does not need a task to // be decoded, then nullptr will be returned. The return value of the // function indicates whether the image was or is going to be locked, so an @@ -35,7 +35,7 @@ public: virtual ~ImageDecodeController() {} - // Fill in an ImageDecodeTask which will decode the given image when run. In + // Fill in an TileTask which will decode the given image when run. In // case the image is already cached, fills in nullptr. Returns true if the // image needs to be unreffed when the caller is finished with it. // @@ -43,7 +43,7 @@ // a raster task. virtual bool GetTaskForImageAndRef(const DrawImage& image, uint64_t prepare_tiles_id, - scoped_refptr<ImageDecodeTask>* task) = 0; + scoped_refptr<TileTask>* task) = 0; // Unrefs an image. When the tile is finished, this should be called for every // GetTaskForImageAndRef call that returned true. virtual void UnrefImage(const DrawImage& image) = 0;
diff --git a/cc/tiles/software_image_decode_controller.cc b/cc/tiles/software_image_decode_controller.cc index f05bb5d..80190b4 100644 --- a/cc/tiles/software_image_decode_controller.cc +++ b/cc/tiles/software_image_decode_controller.cc
@@ -41,7 +41,7 @@ public: AutoRemoveKeyFromTaskMap( std::unordered_map<SoftwareImageDecodeController::ImageKey, - scoped_refptr<ImageDecodeTask>, + scoped_refptr<TileTask>, SoftwareImageDecodeController::ImageKeyHash>* task_map, const SoftwareImageDecodeController::ImageKey& key) : task_map_(task_map), key_(key) {} @@ -49,18 +49,19 @@ private: std::unordered_map<SoftwareImageDecodeController::ImageKey, - scoped_refptr<ImageDecodeTask>, + scoped_refptr<TileTask>, SoftwareImageDecodeController::ImageKeyHash>* task_map_; SoftwareImageDecodeController::ImageKey key_; }; -class ImageDecodeTaskImpl : public ImageDecodeTask { +class ImageDecodeTaskImpl : public TileTask { public: ImageDecodeTaskImpl(SoftwareImageDecodeController* controller, const SoftwareImageDecodeController::ImageKey& image_key, const DrawImage& image, uint64_t source_prepare_tiles_id) - : controller_(controller), + : TileTask(true), + controller_(controller), image_key_(image_key), image_(image), image_ref_(skia::SharePtr(image.image())), @@ -152,7 +153,7 @@ bool SoftwareImageDecodeController::GetTaskForImageAndRef( const DrawImage& image, uint64_t prepare_tiles_id, - scoped_refptr<ImageDecodeTask>* task) { + scoped_refptr<TileTask>* task) { // If the image already exists or if we're going to create a task for it, then // we'll likely need to ref this image (the exception is if we're prerolling // the image only). That means the image is or will be in the cache. When the @@ -179,7 +180,7 @@ if (!CanHandleImage(key)) { base::AutoLock lock(lock_); if (prerolled_images_.count(key.image_id()) == 0) { - scoped_refptr<ImageDecodeTask>& existing_task = pending_image_tasks_[key]; + scoped_refptr<TileTask>& existing_task = pending_image_tasks_[key]; if (!existing_task) { existing_task = make_scoped_refptr( new ImageDecodeTaskImpl(this, key, image, prepare_tiles_id)); @@ -212,7 +213,7 @@ } // If the task exists, return it. - scoped_refptr<ImageDecodeTask>& existing_task = pending_image_tasks_[key]; + scoped_refptr<TileTask>& existing_task = pending_image_tasks_[key]; if (existing_task) { RefImage(key); *task = existing_task;
diff --git a/cc/tiles/software_image_decode_controller.h b/cc/tiles/software_image_decode_controller.h index 9697720..8f6ed0d 100644 --- a/cc/tiles/software_image_decode_controller.h +++ b/cc/tiles/software_image_decode_controller.h
@@ -110,7 +110,7 @@ // ImageDecodeController overrides. bool GetTaskForImageAndRef(const DrawImage& image, uint64_t prepare_tiles_id, - scoped_refptr<ImageDecodeTask>* task) override; + scoped_refptr<TileTask>* task) override; void UnrefImage(const DrawImage& image) override; DecodedDrawImage GetDecodedImageForDraw(const DrawImage& image) override; void DrawWithImageFinished(const DrawImage& image, @@ -241,7 +241,7 @@ const char* cache_name, base::trace_event::ProcessMemoryDump* pmd) const; - std::unordered_map<ImageKey, scoped_refptr<ImageDecodeTask>, ImageKeyHash> + std::unordered_map<ImageKey, scoped_refptr<TileTask>, ImageKeyHash> pending_image_tasks_; // The members below this comment can only be accessed if the lock is held to
diff --git a/cc/tiles/software_image_decode_controller_unittest.cc b/cc/tiles/software_image_decode_controller_unittest.cc index 38246b38..cbf6e3c 100644 --- a/cc/tiles/software_image_decode_controller_unittest.cc +++ b/cc/tiles/software_image_decode_controller_unittest.cc
@@ -359,7 +359,7 @@ DrawImage draw_image( image.get(), SkIRect::MakeWH(image->width(), image->height()), quality, CreateMatrix(SkSize::Make(0.5f, 0.5f), is_decomposable)); - scoped_refptr<ImageDecodeTask> task; + scoped_refptr<TileTask> task; bool need_unref = controller.GetTaskForImageAndRef(draw_image, prepare_tiles_id, &task); EXPECT_TRUE(need_unref); @@ -368,7 +368,7 @@ DrawImage another_draw_image( image.get(), SkIRect::MakeWH(image->width(), image->height()), quality, CreateMatrix(SkSize::Make(0.5f, 0.5f), is_decomposable)); - scoped_refptr<ImageDecodeTask> another_task; + scoped_refptr<TileTask> another_task; need_unref = controller.GetTaskForImageAndRef( another_draw_image, prepare_tiles_id, &another_task); EXPECT_TRUE(need_unref); @@ -389,7 +389,7 @@ image.get(), SkIRect::MakeWH(image->width(), image->height()), kHigh_SkFilterQuality, CreateMatrix(SkSize::Make(0.5f, 0.5f), is_decomposable)); - scoped_refptr<ImageDecodeTask> high_quality_task; + scoped_refptr<TileTask> high_quality_task; bool need_unref = controller.GetTaskForImageAndRef( high_quality_draw_image, prepare_tiles_id, &high_quality_task); EXPECT_TRUE(need_unref); @@ -399,7 +399,7 @@ image.get(), SkIRect::MakeWH(image->width(), image->height()), kMedium_SkFilterQuality, CreateMatrix(SkSize::Make(0.5f, 0.5f), is_decomposable)); - scoped_refptr<ImageDecodeTask> medium_quality_task; + scoped_refptr<TileTask> medium_quality_task; need_unref = controller.GetTaskForImageAndRef( medium_quality_draw_image, prepare_tiles_id, &medium_quality_task); // Medium quality isn't handled by the controller, so it won't ref it. Note @@ -413,7 +413,7 @@ image.get(), SkIRect::MakeWH(image->width(), image->height()), kLow_SkFilterQuality, CreateMatrix(SkSize::Make(0.5f, 0.5f), is_decomposable)); - scoped_refptr<ImageDecodeTask> low_quality_task; + scoped_refptr<TileTask> low_quality_task; need_unref = controller.GetTaskForImageAndRef( low_quality_draw_image, prepare_tiles_id, &low_quality_task); EXPECT_TRUE(need_unref); @@ -435,7 +435,7 @@ DrawImage half_size_draw_image( image.get(), SkIRect::MakeWH(image->width(), image->height()), quality, CreateMatrix(SkSize::Make(0.5f, 0.5f), is_decomposable)); - scoped_refptr<ImageDecodeTask> half_size_task; + scoped_refptr<TileTask> half_size_task; bool need_unref = controller.GetTaskForImageAndRef( half_size_draw_image, prepare_tiles_id, &half_size_task); EXPECT_TRUE(need_unref); @@ -444,7 +444,7 @@ DrawImage quarter_size_draw_image( image.get(), SkIRect::MakeWH(image->width(), image->height()), quality, CreateMatrix(SkSize::Make(0.25f, 0.25f), is_decomposable)); - scoped_refptr<ImageDecodeTask> quarter_size_task; + scoped_refptr<TileTask> quarter_size_task; need_unref = controller.GetTaskForImageAndRef( quarter_size_draw_image, prepare_tiles_id, &quarter_size_task); EXPECT_TRUE(need_unref); @@ -466,7 +466,7 @@ first_image.get(), SkIRect::MakeWH(first_image->width(), first_image->height()), quality, CreateMatrix(SkSize::Make(0.5f, 0.5f), is_decomposable)); - scoped_refptr<ImageDecodeTask> first_task; + scoped_refptr<TileTask> first_task; bool need_unref = controller.GetTaskForImageAndRef( first_draw_image, prepare_tiles_id, &first_task); EXPECT_TRUE(need_unref); @@ -477,7 +477,7 @@ second_image.get(), SkIRect::MakeWH(second_image->width(), second_image->height()), quality, CreateMatrix(SkSize::Make(0.25f, 0.25f), is_decomposable)); - scoped_refptr<ImageDecodeTask> second_task; + scoped_refptr<TileTask> second_task; need_unref = controller.GetTaskForImageAndRef(second_draw_image, prepare_tiles_id, &second_task); EXPECT_TRUE(need_unref); @@ -498,7 +498,7 @@ DrawImage draw_image( image.get(), SkIRect::MakeWH(image->width(), image->height()), quality, CreateMatrix(SkSize::Make(0.5f, 0.5f), is_decomposable)); - scoped_refptr<ImageDecodeTask> task; + scoped_refptr<TileTask> task; bool need_unref = controller.GetTaskForImageAndRef(draw_image, prepare_tiles_id, &task); EXPECT_TRUE(need_unref); @@ -509,7 +509,7 @@ task->DidSchedule(); task->RunOnWorkerThread(); - scoped_refptr<ImageDecodeTask> another_task; + scoped_refptr<TileTask> another_task; need_unref = controller.GetTaskForImageAndRef(draw_image, prepare_tiles_id, &another_task); EXPECT_TRUE(need_unref); @@ -533,7 +533,7 @@ DrawImage draw_image( image.get(), SkIRect::MakeWH(image->width(), image->height()), quality, CreateMatrix(SkSize::Make(1.f, 1.f), is_decomposable)); - scoped_refptr<ImageDecodeTask> task; + scoped_refptr<TileTask> task; bool need_unref = controller.GetTaskForImageAndRef(draw_image, prepare_tiles_id, &task); EXPECT_TRUE(need_unref); @@ -544,7 +544,7 @@ task->DidSchedule(); task->RunOnWorkerThread(); - scoped_refptr<ImageDecodeTask> another_task; + scoped_refptr<TileTask> another_task; need_unref = controller.GetTaskForImageAndRef(draw_image, prepare_tiles_id, &another_task); EXPECT_TRUE(need_unref); @@ -554,7 +554,7 @@ task->CompleteOnOriginThread(nullptr); task->DidComplete(); - scoped_refptr<ImageDecodeTask> third_task; + scoped_refptr<TileTask> third_task; need_unref = controller.GetTaskForImageAndRef(draw_image, prepare_tiles_id, &third_task); EXPECT_TRUE(need_unref); @@ -575,7 +575,7 @@ DrawImage draw_image( image.get(), SkIRect::MakeWH(image->width(), image->height()), quality, CreateMatrix(SkSize::Make(0.5f, 0.5f), is_decomposable)); - scoped_refptr<ImageDecodeTask> task; + scoped_refptr<TileTask> task; bool need_unref = controller.GetTaskForImageAndRef(draw_image, prepare_tiles_id, &task); EXPECT_TRUE(need_unref); @@ -585,7 +585,7 @@ task->ScheduleOnOriginThread(nullptr); task->DidSchedule(); - scoped_refptr<ImageDecodeTask> another_task; + scoped_refptr<TileTask> another_task; need_unref = controller.GetTaskForImageAndRef(draw_image, prepare_tiles_id, &another_task); EXPECT_TRUE(need_unref); @@ -601,7 +601,7 @@ controller.UnrefImage(draw_image); // Here a new task is created. - scoped_refptr<ImageDecodeTask> third_task; + scoped_refptr<TileTask> third_task; need_unref = controller.GetTaskForImageAndRef(draw_image, prepare_tiles_id, &third_task); EXPECT_TRUE(need_unref); @@ -622,7 +622,7 @@ DrawImage draw_image( image.get(), SkIRect::MakeWH(image->width(), image->height()), quality, CreateMatrix(SkSize::Make(0.5f, 0.5f), is_decomposable)); - scoped_refptr<ImageDecodeTask> task; + scoped_refptr<TileTask> task; bool need_unref = controller.GetTaskForImageAndRef(draw_image, prepare_tiles_id, &task); EXPECT_TRUE(need_unref); @@ -632,7 +632,7 @@ task->ScheduleOnOriginThread(nullptr); task->DidSchedule(); - scoped_refptr<ImageDecodeTask> another_task; + scoped_refptr<TileTask> another_task; need_unref = controller.GetTaskForImageAndRef(draw_image, prepare_tiles_id, &another_task); EXPECT_TRUE(need_unref); @@ -645,7 +645,7 @@ // Note that here, everything is reffed, but a new task is created. This is // possible with repeated schedule/cancel operations. - scoped_refptr<ImageDecodeTask> third_task; + scoped_refptr<TileTask> third_task; need_unref = controller.GetTaskForImageAndRef(draw_image, prepare_tiles_id, &third_task); EXPECT_TRUE(need_unref); @@ -668,7 +668,7 @@ DrawImage draw_image( image.get(), SkIRect::MakeWH(image->width(), image->height()), quality, CreateMatrix(SkSize::Make(0.5f, 0.5f), is_decomposable)); - scoped_refptr<ImageDecodeTask> task; + scoped_refptr<TileTask> task; bool need_unref = controller.GetTaskForImageAndRef(draw_image, prepare_tiles_id, &task); EXPECT_TRUE(need_unref); @@ -710,7 +710,7 @@ DrawImage draw_image( image.get(), SkIRect::MakeXYWH(20, 30, image->width(), image->height()), quality, CreateMatrix(SkSize::Make(0.5f, 0.5f), is_decomposable)); - scoped_refptr<ImageDecodeTask> task; + scoped_refptr<TileTask> task; bool need_unref = controller.GetTaskForImageAndRef(draw_image, prepare_tiles_id, &task); EXPECT_TRUE(need_unref); @@ -819,7 +819,7 @@ EXPECT_FALSE(decoded_draw_image.is_scale_adjustment_identity()); EXPECT_TRUE(decoded_draw_image.is_at_raster_decode()); - scoped_refptr<ImageDecodeTask> task; + scoped_refptr<TileTask> task; bool need_unref = controller.GetTaskForImageAndRef(draw_image, prepare_tiles_id, &task); EXPECT_TRUE(need_unref); @@ -873,7 +873,7 @@ EXPECT_FALSE(decoded_draw_image.is_scale_adjustment_identity()); EXPECT_TRUE(decoded_draw_image.is_at_raster_decode()); - scoped_refptr<ImageDecodeTask> task; + scoped_refptr<TileTask> task; bool need_unref = controller.GetTaskForImageAndRef(draw_image, prepare_tiles_id, &task); EXPECT_TRUE(need_unref); @@ -916,7 +916,7 @@ image.get(), SkIRect::MakeWH(image->width(), image->height()), quality, CreateMatrix(SkSize::Make(0.f, 0.f), is_decomposable)); - scoped_refptr<ImageDecodeTask> task; + scoped_refptr<TileTask> task; bool need_unref = controller.GetTaskForImageAndRef(draw_image, prepare_tiles_id, &task); EXPECT_FALSE(task); @@ -940,7 +940,7 @@ image.get(), SkIRect::MakeXYWH(150, 150, image->width(), image->height()), quality, CreateMatrix(SkSize::Make(1.f, 1.f), is_decomposable)); - scoped_refptr<ImageDecodeTask> task; + scoped_refptr<TileTask> task; bool need_unref = controller.GetTaskForImageAndRef(draw_image, prepare_tiles_id, &task); EXPECT_FALSE(task); @@ -964,7 +964,7 @@ image.get(), SkIRect::MakeWH(image->width(), image->height()), quality, CreateMatrix(SkSize::Make(1.f, 1.f), is_decomposable)); - scoped_refptr<ImageDecodeTask> task; + scoped_refptr<TileTask> task; bool need_unref = controller.GetTaskForImageAndRef(draw_image, prepare_tiles_id, &task); EXPECT_TRUE(task); @@ -991,7 +991,7 @@ DrawImage draw_image(image.get(), SkIRect::MakeXYWH(10, 10, 80, 80), quality, CreateMatrix(SkSize::Make(0.5f, 0.5f), is_decomposable)); - scoped_refptr<ImageDecodeTask> task; + scoped_refptr<TileTask> task; bool need_unref = controller.GetTaskForImageAndRef(draw_image, prepare_tiles_id, &task); EXPECT_TRUE(task); @@ -1020,7 +1020,7 @@ DrawImage draw_image(image.get(), SkIRect::MakeXYWH(10, 10, 80, 80), quality, CreateMatrix(SkSize::Make(0.5f, 0.5f), is_decomposable)); - scoped_refptr<ImageDecodeTask> task; + scoped_refptr<TileTask> task; bool need_unref = controller.GetTaskForImageAndRef(draw_image, prepare_tiles_id, &task); EXPECT_TRUE(task);
diff --git a/cc/tiles/tile.h b/cc/tiles/tile.h index f6dd675..9dc8afc 100644 --- a/cc/tiles/tile.h +++ b/cc/tiles/tile.h
@@ -144,7 +144,7 @@ unsigned scheduled_priority_; - scoped_refptr<RasterTask> raster_task_; + scoped_refptr<TileTask> raster_task_; DISALLOW_COPY_AND_ASSIGN(Tile); };
diff --git a/cc/tiles/tile_manager.cc b/cc/tiles/tile_manager.cc index cec859ff..74f1707e 100644 --- a/cc/tiles/tile_manager.cc +++ b/cc/tiles/tile_manager.cc
@@ -42,7 +42,7 @@ "Compositing.%s.RasterTask.RasterUs", "Compositing.%s.RasterTask.RasterPixelsPerMs"); -class RasterTaskImpl : public RasterTask { +class RasterTaskImpl : public TileTask { public: RasterTaskImpl(const Resource* resource, scoped_refptr<RasterSource> raster_source, @@ -59,8 +59,8 @@ uint64_t resource_content_id, int source_frame_number, const base::Callback<void(bool)>& reply, - ImageDecodeTask::Vector* dependencies) - : RasterTask(dependencies), + TileTask::Vector* dependencies) + : TileTask(true, dependencies), resource_(resource), raster_source_(std::move(raster_source)), content_rect_(content_rect), @@ -156,15 +156,18 @@ } void InsertNodeForDecodeTask(TaskGraph* graph, - ImageDecodeTask* task, + TileTask* task, uint16_t category, uint16_t priority) { uint32_t dependency_count = 0u; - auto* dependency = task->dependency().get(); - if (dependency && !dependency->HasCompleted()) { - InsertNodeForDecodeTask(graph, dependency, category, priority); - graph->edges.push_back(TaskGraph::Edge(dependency, task)); - dependency_count = 1u; + if (task->dependencies().size()) { + DCHECK_EQ(task->dependencies().size(), 1u); + auto* dependency = task->dependencies()[0].get(); + if (!dependency->HasCompleted()) { + InsertNodeForDecodeTask(graph, dependency, category, priority); + graph->edges.push_back(TaskGraph::Edge(dependency, task)); + dependency_count = 1u; + } } InsertNodeForTask(graph, task, task->SupportsConcurrentExecution() ? category @@ -173,8 +176,8 @@ } void InsertNodesForRasterTask(TaskGraph* graph, - RasterTask* raster_task, - const ImageDecodeTask::Vector& decode_tasks, + TileTask* raster_task, + const TileTask::Vector& decode_tasks, size_t priority, bool use_gpu_rasterization, bool high_priority) { @@ -198,9 +201,9 @@ high_priority ? TASK_CATEGORY_FOREGROUND : TASK_CATEGORY_BACKGROUND; // Insert image decode tasks. - for (ImageDecodeTask::Vector::const_iterator it = decode_tasks.begin(); + for (TileTask::Vector::const_iterator it = decode_tasks.begin(); it != decode_tasks.end(); ++it) { - ImageDecodeTask* decode_task = it->get(); + TileTask* decode_task = it->get(); // Skip if already decoded. if (decode_task->HasCompleted()) @@ -242,7 +245,8 @@ explicit TaskSetFinishedTaskImpl( base::SequencedTaskRunner* task_runner, const base::Closure& on_task_set_finished_callback) - : task_runner_(task_runner), + : TileTask(true), + task_runner_(task_runner), on_task_set_finished_callback_(on_task_set_finished_callback) {} // Overridden from Task: @@ -779,7 +783,7 @@ if (!tile->raster_task_) tile->raster_task_ = CreateRasterTask(prioritized_tile); - RasterTask* task = tile->raster_task_.get(); + TileTask* task = tile->raster_task_.get(); DCHECK(!task->HasCompleted()); if (tile->required_for_activation()) { @@ -845,7 +849,7 @@ ScheduledTasksStateAsValue()); } -scoped_refptr<RasterTask> TileManager::CreateRasterTask( +scoped_refptr<TileTask> TileManager::CreateRasterTask( const PrioritizedTile& prioritized_tile) { Tile* tile = prioritized_tile.tile(); @@ -872,7 +876,7 @@ prioritized_tile.priority().resolution == LOW_RESOLUTION; // Create and queue all image decode tasks that this tile depends on. - ImageDecodeTask::Vector decode_tasks; + TileTask::Vector decode_tasks; std::vector<DrawImage>& images = scheduled_draw_images_[tile->id()]; images.clear(); if (!playback_settings.skip_images) { @@ -883,7 +887,7 @@ // We can skip the image hijack canvas if we have no images. playback_settings.use_image_hijack_canvas = !images.empty(); for (auto it = images.begin(); it != images.end();) { - scoped_refptr<ImageDecodeTask> task; + scoped_refptr<TileTask> task; bool need_to_unref_when_finished = image_decode_controller_->GetTaskForImageAndRef( *it, prepare_tiles_count_, &task);
diff --git a/cc/tiles/tile_manager.h b/cc/tiles/tile_manager.h index 94eac03..d58d5b0 100644 --- a/cc/tiles/tile_manager.h +++ b/cc/tiles/tile_manager.h
@@ -249,7 +249,7 @@ void FreeResourcesForTile(Tile* tile); void FreeResourcesForTileAndNotifyClientIfTileWasReadyToDraw(Tile* tile); - scoped_refptr<RasterTask> CreateRasterTask( + scoped_refptr<TileTask> CreateRasterTask( const PrioritizedTile& prioritized_tile); std::unique_ptr<EvictionTilePriorityQueue>
diff --git a/cc/trees/channel_impl.h b/cc/trees/channel_impl.h index f2c2933..c0985b7 100644 --- a/cc/trees/channel_impl.h +++ b/cc/trees/channel_impl.h
@@ -6,7 +6,6 @@ #define CC_TREES_CHANNEL_IMPL_H_ #include "cc/base/cc_export.h" -#include "cc/debug/frame_timing_tracker.h" #include "cc/output/renderer_capabilities.h" #include "cc/trees/proxy_common.h" @@ -33,10 +32,6 @@ bool success, const RendererCapabilities& capabilities) = 0; virtual void DidCompletePageScaleAnimation() = 0; - virtual void PostFrameTimingEventsOnMain( - std::unique_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, - std::unique_ptr<FrameTimingTracker::MainFrameTimingSet> - main_frame_events) = 0; virtual void BeginMainFrame( std::unique_ptr<BeginMainFrameAndCommitState> begin_main_frame_state) = 0;
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc index f91f925..0de0251 100644 --- a/cc/trees/layer_tree_host.cc +++ b/cc/trees/layer_tree_host.cc
@@ -1281,13 +1281,6 @@ proxy_->SetAuthoritativeVSyncInterval(interval); } -void LayerTreeHost::RecordFrameTimingEvents( - std::unique_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, - std::unique_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events) { - client_->RecordFrameTimingEvents(std::move(composite_events), - std::move(main_frame_events)); -} - Layer* LayerTreeHost::LayerById(int id) const { LayerIdMap::const_iterator iter = layer_id_map_.find(id); return iter != layer_id_map_.end() ? iter->second : NULL;
diff --git a/cc/trees/layer_tree_host.h b/cc/trees/layer_tree_host.h index 0fcf1d5d..7c18a8ac 100644 --- a/cc/trees/layer_tree_host.h +++ b/cc/trees/layer_tree_host.h
@@ -22,7 +22,6 @@ #include "base/time/time.h" #include "cc/animation/target_property.h" #include "cc/base/cc_export.h" -#include "cc/debug/frame_timing_tracker.h" #include "cc/debug/micro_benchmark.h" #include "cc/debug/micro_benchmark_controller.h" #include "cc/input/event_listener_properties.h" @@ -355,11 +354,6 @@ return needs_meta_info_recomputation_; } - void RecordFrameTimingEvents( - std::unique_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, - std::unique_ptr<FrameTimingTracker::MainFrameTimingSet> - main_frame_events); - Layer* LayerById(int id) const; void AddLayerShouldPushProperties(Layer* layer);
diff --git a/cc/trees/layer_tree_host_client.h b/cc/trees/layer_tree_host_client.h index d871647..a84848420 100644 --- a/cc/trees/layer_tree_host_client.h +++ b/cc/trees/layer_tree_host_client.h
@@ -8,8 +8,6 @@ #include <memory> #include "base/memory/ref_counted.h" -#include "base/time/time.h" -#include "cc/debug/frame_timing_tracker.h" namespace gfx { class Vector2d; @@ -59,10 +57,6 @@ virtual void DidCommit() = 0; virtual void DidCommitAndDrawFrame() = 0; virtual void DidCompleteSwapBuffers() = 0; - virtual void RecordFrameTimingEvents( - std::unique_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, - std::unique_ptr<FrameTimingTracker::MainFrameTimingSet> - main_frame_events) = 0; // Called when page scale animation has completed. virtual void DidCompletePageScaleAnimation() = 0;
diff --git a/cc/trees/layer_tree_host_common.cc b/cc/trees/layer_tree_host_common.cc index 9fec1ab..b94c34a 100644 --- a/cc/trees/layer_tree_host_common.cc +++ b/cc/trees/layer_tree_host_common.cc
@@ -8,6 +8,7 @@ #include <algorithm> +#include "base/containers/adapters.h" #include "base/trace_event/trace_event.h" #include "cc/base/math_util.h" #include "cc/layers/heads_up_display_layer_impl.h" @@ -248,10 +249,6 @@ return !layer->parent(); } -static inline bool IsRootLayer(const LayerImpl* layer) { - return layer->layer_tree_impl()->IsRootLayer(layer); -} - template <typename LayerType> static bool HasInvertibleOrAnimatedTransform(LayerType* layer) { return layer->transform_is_invertible() || @@ -263,8 +260,6 @@ int current_render_surface_layer_list_id) { layer->draw_properties().last_drawn_render_surface_layer_list_id = current_render_surface_layer_list_id; - layer->set_layer_or_descendant_is_drawn( - !!current_render_surface_layer_list_id); } static inline void MarkMasksWithRenderSurfaceLayerListId( @@ -280,44 +275,24 @@ } } -static inline void MarkLayerListWithRenderSurfaceLayerListId( - LayerImplList* layer_list, - int current_render_surface_layer_list_id) { - for (LayerImplList::iterator it = layer_list->begin(); - it != layer_list->end(); ++it) { - MarkLayerWithRenderSurfaceLayerListId(*it, - current_render_surface_layer_list_id); - MarkMasksWithRenderSurfaceLayerListId(*it, - current_render_surface_layer_list_id); +static inline void ClearRenderSurfaceLayerListId(LayerImplList* layer_list, + ScrollTree* scroll_tree) { + const int cleared_render_surface_layer_list_id = 0; + for (LayerImpl* layer : *layer_list) { + if (layer->IsDrawnRenderSurfaceLayerListMember()) { + DCHECK_GT(scroll_tree->Node(layer->scroll_tree_index()) + ->data.num_drawn_descendants, + 0); + scroll_tree->Node(layer->scroll_tree_index()) + ->data.num_drawn_descendants--; + } + MarkLayerWithRenderSurfaceLayerListId(layer, + cleared_render_surface_layer_list_id); + MarkMasksWithRenderSurfaceLayerListId(layer, + cleared_render_surface_layer_list_id); } } -static inline void RemoveSurfaceForEarlyExit( - LayerImpl* layer_to_remove, - LayerImplList* render_surface_layer_list) { - DCHECK(layer_to_remove->render_surface()); - // Technically, we know that the layer we want to remove should be - // at the back of the render_surface_layer_list. However, we have had - // bugs before that added unnecessary layers here - // (https://bugs.webkit.org/show_bug.cgi?id=74147), but that causes - // things to crash. So here we proactively remove any additional - // layers from the end of the list. - while (render_surface_layer_list->back() != layer_to_remove) { - MarkLayerListWithRenderSurfaceLayerListId( - &render_surface_layer_list->back()->render_surface()->layer_list(), 0); - MarkLayerWithRenderSurfaceLayerListId(render_surface_layer_list->back(), 0); - - render_surface_layer_list->back()->ClearRenderSurfaceLayerList(); - render_surface_layer_list->pop_back(); - } - DCHECK_EQ(render_surface_layer_list->back(), layer_to_remove); - MarkLayerListWithRenderSurfaceLayerListId( - &layer_to_remove->render_surface()->layer_list(), 0); - MarkLayerWithRenderSurfaceLayerListId(layer_to_remove, 0); - render_surface_layer_list->pop_back(); - layer_to_remove->ClearRenderSurfaceLayerList(); -} - struct PreCalculateMetaInformationRecursiveData { size_t num_unclipped_descendants; int num_layer_or_descendants_with_copy_request; @@ -527,209 +502,230 @@ DONT_BUILD_PROPERTY_TREES }; -static void MarkMasksAndAddChildToDescendantsIfRequired( - LayerImpl* child_layer, - LayerImplList* descendants, - const int current_render_surface_layer_list_id) { - // If the child is its own render target, then it has a render surface. - if (child_layer->has_render_surface() && - child_layer->render_target() == child_layer->render_surface() && - !child_layer->render_surface()->layer_list().empty() && - !child_layer->render_surface()->content_rect().IsEmpty()) { - // This child will contribute its render surface, which means - // we need to mark just the mask layer (and replica mask layer) - // with the id. - MarkMasksWithRenderSurfaceLayerListId(child_layer, - current_render_surface_layer_list_id); - descendants->push_back(child_layer); +static void ComputeLayerScrollsDrawnDescendants(LayerTreeImpl* layer_tree_impl, + ScrollTree* scroll_tree) { + for (int i = static_cast<int>(scroll_tree->size()) - 1; i > 0; --i) { + ScrollNode* node = scroll_tree->Node(i); + scroll_tree->parent(node)->data.num_drawn_descendants += + node->data.num_drawn_descendants; + } + for (LayerImpl* layer : *layer_tree_impl) { + bool scrolls_drawn_descendant = false; + if (layer->scrollable()) { + ScrollNode* node = scroll_tree->Node(layer->scroll_tree_index()); + if (node->data.num_drawn_descendants > 0) + scrolls_drawn_descendant = true; + } + layer->set_scrolls_drawn_descendant(scrolls_drawn_descendant); } } -static void SetLayerOrDescendantIsDrawnIfRequired(LayerImpl* layer, - LayerImpl* child_layer) { - if (child_layer->layer_or_descendant_is_drawn()) { - layer->set_layer_or_descendant_is_drawn(true); - } -} - -void CalculateRenderSurfaceLayerList( - LayerImpl* layer, +static void ComputeInitialRenderSurfaceLayerList( + LayerTreeImpl* layer_tree_impl, PropertyTrees* property_trees, LayerImplList* render_surface_layer_list, - LayerImplList* descendants, - RenderSurfaceImpl* nearest_occlusion_immune_ancestor, - bool subtree_visible_from_ancestor, + bool can_render_to_separate_surface, + int current_render_surface_layer_list_id) { + ScrollTree* scroll_tree = &property_trees->scroll_tree; + for (int i = 0; i < static_cast<int>(scroll_tree->size()); ++i) + scroll_tree->Node(i)->data.num_drawn_descendants = 0; + + // Add all non-skipped surfaces to the initial render surface layer list. Add + // all non-skipped layers to the layer list of their target surface, and + // add their content rect to their target surface's accumulated content rect. + for (LayerImpl* layer : *layer_tree_impl) { + if (layer->render_surface()) + layer->ClearRenderSurfaceLayerList(); + + bool layer_is_drawn = + property_trees->effect_tree.Node(layer->effect_tree_index()) + ->data.is_drawn; + bool is_root = layer_tree_impl->IsRootLayer(layer); + bool skip_layer = + !is_root && draw_property_utils::LayerShouldBeSkipped( + layer, layer_is_drawn, property_trees->transform_tree, + property_trees->effect_tree); + if (skip_layer) + continue; + + bool render_to_separate_surface = + is_root || (can_render_to_separate_surface && layer->render_surface()); + + if (render_to_separate_surface) { + DCHECK(layer->render_surface()); + DCHECK(layer->render_target() == layer->render_surface()); + RenderSurfaceImpl* surface = layer->render_surface(); + surface->ClearAccumulatedContentRect(); + render_surface_layer_list->push_back(layer); + if (is_root) { + // The root surface does not contribute to any other surface, it has no + // target. + layer->render_surface()->set_contributes_to_drawn_surface(false); + } else { + surface->render_target()->layer_list().push_back(layer); + bool contributes_to_drawn_surface = + property_trees->effect_tree.ContributesToDrawnSurface( + layer->effect_tree_index()); + layer->render_surface()->set_contributes_to_drawn_surface( + contributes_to_drawn_surface); + } + + draw_property_utils::ComputeSurfaceDrawProperties(property_trees, + surface); + + // Ignore occlusion from outside the surface when surface contents need to + // be fully drawn. Layers with copy-request need to be complete. We could + // be smarter about layers with replica and exclude regions where both + // layer and the replica are occluded, but this seems like overkill. The + // same is true for layers with filters that move pixels. + // TODO(senorblanco): make this smarter for the SkImageFilter case (check + // for pixel-moving filters) + bool is_occlusion_immune = layer->HasCopyRequest() || + layer->has_replica() || + layer->filters().HasReferenceFilter() || + layer->filters().HasFilterThatMovesPixels(); + if (is_occlusion_immune) { + surface->SetNearestOcclusionImmuneAncestor(surface); + } else if (is_root) { + surface->SetNearestOcclusionImmuneAncestor(nullptr); + } else { + surface->SetNearestOcclusionImmuneAncestor( + surface->render_target()->nearest_occlusion_immune_ancestor()); + } + } + bool layer_should_be_drawn = draw_property_utils::LayerNeedsUpdate( + layer, layer_is_drawn, property_trees->transform_tree); + if (!layer_should_be_drawn) + continue; + + MarkLayerWithRenderSurfaceLayerListId(layer, + current_render_surface_layer_list_id); + scroll_tree->Node(layer->scroll_tree_index())->data.num_drawn_descendants++; + layer->render_target()->layer_list().push_back(layer); + + // The layer contributes its drawable content rect to its render target. + layer->render_target()->AccumulateContentRectFromContributingLayer(layer); + } +} + +static void ComputeSurfaceContentRects(LayerTreeImpl* layer_tree_impl, + PropertyTrees* property_trees, + LayerImplList* render_surface_layer_list, + int max_texture_size) { + // Walk the list backwards, accumulating each surface's content rect into its + // target's content rect. + for (LayerImpl* layer : base::Reversed(*render_surface_layer_list)) { + if (layer_tree_impl->IsRootLayer(layer)) { + // The root layer's surface content rect is always the entire viewport. + gfx::Rect viewport = + gfx::ToEnclosingRect(property_trees->clip_tree.ViewportClip()); + layer->render_surface()->SetContentRect(viewport); + continue; + } + + RenderSurfaceImpl* surface = layer->render_surface(); + gfx::Rect surface_content_rect = surface->accumulated_content_rect(); + + if (!layer->replica_layer() && !layer->HasCopyRequest() && + surface->is_clipped()) { + // Here, we clip the render surface's content rect with its clip rect. + // As the clip rect of render surface is in the surface's target + // space, we first map the content rect into the target space, + // intersect it with clip rect and project back the result to the + // surface space. + if (!surface_content_rect.IsEmpty()) { + gfx::Rect surface_clip_rect = LayerTreeHostCommon::CalculateVisibleRect( + surface->clip_rect(), surface_content_rect, + surface->draw_transform()); + surface_content_rect.Intersect(surface_clip_rect); + } + } + // The RenderSurfaceImpl backing texture cannot exceed the maximum + // supported texture size. + surface_content_rect.set_width( + std::min(surface_content_rect.width(), max_texture_size)); + surface_content_rect.set_height( + std::min(surface_content_rect.height(), max_texture_size)); + surface->SetContentRect(surface_content_rect); + + // Now the render surface's content rect is calculated correctly, it could + // contribute to its render target. + surface->render_target() + ->AccumulateContentRectFromContributingRenderSurface(surface); + } +} + +static void ComputeListOfNonEmptySurfaces( + LayerTreeImpl* layer_tree_impl, + PropertyTrees* property_trees, + LayerImplList* initial_surface_list, + LayerImplList* final_surface_list, + int current_render_surface_layer_list_id) { + // Walk the initial surface list forwards. The root surface and each + // surface with a non-empty content rect go into the final render surface + // layer list. Surfaces with empty content rects or whose target isn't in + // the final list do not get added to the final list. + for (LayerImpl* layer : *initial_surface_list) { + bool is_root = layer_tree_impl->IsRootLayer(layer); + RenderSurfaceImpl* surface = layer->render_surface(); + RenderSurfaceImpl* target_surface = surface->render_target(); + if (!is_root && (surface->content_rect().IsEmpty() || + target_surface->layer_list().empty())) { + ClearRenderSurfaceLayerListId(&surface->layer_list(), + &property_trees->scroll_tree); + surface->ClearLayerLists(); + if (!is_root) { + LayerImplList& target_list = target_surface->layer_list(); + auto it = std::find(target_list.begin(), target_list.end(), layer); + if (it != target_list.end()) { + target_list.erase(it); + // This surface has an empty content rect. If its target's layer list + // had no other layers, then its target would also have had an empty + // content rect, meaning it would have been removed and had its layer + // list cleared when we visited it, unless the target surface is the + // root surface. + DCHECK(!target_surface->layer_list().empty() || + target_surface->render_target() == target_surface); + } else { + // This layer was removed when the target itself was cleared. + DCHECK(target_surface->layer_list().empty()); + } + } + continue; + } + MarkMasksWithRenderSurfaceLayerListId(layer, + current_render_surface_layer_list_id); + final_surface_list->push_back(layer); + } +} + +static void CalculateRenderSurfaceLayerList( + LayerTreeImpl* layer_tree_impl, + PropertyTrees* property_trees, + LayerImplList* render_surface_layer_list, const bool can_render_to_separate_surface, const int current_render_surface_layer_list_id, const int max_texture_size) { // This calculates top level Render Surface Layer List, and Layer List for all // Render Surfaces. - - // |layer| is current layer. - // |render_surface_layer_list| is the top level RenderSurfaceLayerList. - // |descendants| is used to determine what's in current layer's render - // surface's layer list. + LayerImplList initial_render_surface_list; - // |subtree_visible_from_ancestor| is set during recursion to affect current - // layer's subtree. + // First compute an RSLL that might include surfaces that later turn out to + // have an empty content rect. After surface content rects are computed, + // produce a final RSLL that omits empty surfaces. + ComputeInitialRenderSurfaceLayerList( + layer_tree_impl, property_trees, &initial_render_surface_list, + can_render_to_separate_surface, current_render_surface_layer_list_id); + ComputeSurfaceContentRects(layer_tree_impl, property_trees, + &initial_render_surface_list, max_texture_size); + ComputeListOfNonEmptySurfaces( + layer_tree_impl, property_trees, &initial_render_surface_list, + render_surface_layer_list, current_render_surface_layer_list_id); - // |can_render_to_separate_surface| and |current_render_surface_layer_list_id| - // are settings that should stay the same during recursion. - bool layer_is_drawn = false; - DCHECK_GE(layer->effect_tree_index(), 0); - layer_is_drawn = property_trees->effect_tree.Node(layer->effect_tree_index()) - ->data.is_drawn; - - // The root layer cannot be skipped. - if (!IsRootLayer(layer) && - draw_property_utils::LayerShouldBeSkipped(layer, layer_is_drawn, - property_trees->transform_tree, - property_trees->effect_tree)) { - if (layer->render_surface()) - layer->ClearRenderSurfaceLayerList(); - for (auto* child_layer : layer->children()) { - CalculateRenderSurfaceLayerList( - child_layer, property_trees, render_surface_layer_list, descendants, - nearest_occlusion_immune_ancestor, layer_is_drawn, - can_render_to_separate_surface, current_render_surface_layer_list_id, - max_texture_size); - - MarkMasksAndAddChildToDescendantsIfRequired( - child_layer, descendants, current_render_surface_layer_list_id); - SetLayerOrDescendantIsDrawnIfRequired(layer, child_layer); - } - return; - } - - bool render_to_separate_surface = - IsRootLayer(layer) || - (can_render_to_separate_surface && layer->render_surface()); - - if (render_to_separate_surface) { - DCHECK(layer->render_surface()); - draw_property_utils::ComputeSurfaceDrawProperties(property_trees, - layer->render_surface()); - - - if (IsRootLayer(layer)) { - // The root surface does not contribute to any other surface, it has no - // target. - layer->render_surface()->set_contributes_to_drawn_surface(false); - } else { - bool contributes_to_drawn_surface = - property_trees->effect_tree.ContributesToDrawnSurface( - layer->effect_tree_index()); - layer->render_surface()->set_contributes_to_drawn_surface( - contributes_to_drawn_surface); - } - - // Ignore occlusion from outside the surface when surface contents need to - // be fully drawn. Layers with copy-request need to be complete. - // We could be smarter about layers with replica and exclude regions - // where both layer and the replica are occluded, but this seems like an - // overkill. The same is true for layers with filters that move pixels. - // TODO(senorblanco): make this smarter for the SkImageFilter case (check - // for pixel-moving filters) - if (layer->HasCopyRequest() || layer->has_replica() || - layer->filters().HasReferenceFilter() || - layer->filters().HasFilterThatMovesPixels()) { - nearest_occlusion_immune_ancestor = layer->render_surface(); - } - layer->render_surface()->SetNearestOcclusionImmuneAncestor( - nearest_occlusion_immune_ancestor); - layer->ClearRenderSurfaceLayerList(); - - render_surface_layer_list->push_back(layer); - - descendants = &(layer->render_surface()->layer_list()); - } - - bool layer_should_be_skipped = !draw_property_utils::LayerNeedsUpdate( - layer, layer_is_drawn, property_trees->transform_tree); - if (!layer_should_be_skipped) { - MarkLayerWithRenderSurfaceLayerListId(layer, - current_render_surface_layer_list_id); - descendants->push_back(layer); - } - - - // Clear the old accumulated content rect of surface. - if (render_to_separate_surface) - layer->render_surface()->ClearAccumulatedContentRect(); - - for (auto* child_layer : layer->children()) { - CalculateRenderSurfaceLayerList( - child_layer, property_trees, render_surface_layer_list, descendants, - nearest_occlusion_immune_ancestor, layer_is_drawn, - can_render_to_separate_surface, current_render_surface_layer_list_id, - max_texture_size); - - MarkMasksAndAddChildToDescendantsIfRequired( - child_layer, descendants, current_render_surface_layer_list_id); - SetLayerOrDescendantIsDrawnIfRequired(layer, child_layer); - } - - if (render_to_separate_surface && !IsRootLayer(layer) && - layer->render_surface()->layer_list().empty()) { - RemoveSurfaceForEarlyExit(layer, render_surface_layer_list); - return; - } - - // The render surface's content rect is the union of drawable content rects - // of the layers that draw into the surface. If the render surface is clipped, - // it is also intersected with the render's surface clip rect. - if (!IsRootLayer(layer)) { - // Layer contriubutes its drawable content rect to its render target. - if (layer->DrawsContent()) - layer->render_target()->AccumulateContentRectFromContributingLayer(layer); - - if (render_to_separate_surface) { - gfx::Rect surface_content_rect = - layer->render_surface()->accumulated_content_rect(); - - if (!layer->replica_layer() && !layer->HasCopyRequest() && - layer->render_surface()->is_clipped()) { - // Here, we clip the render surface's content rect with its clip rect. - // As the clip rect of render surface is in the surface's target - // space, we first map the content rect into the target space, - // intersect it with clip rect and project back the result to the - // surface space. - if (!surface_content_rect.IsEmpty()) { - gfx::Rect surface_clip_rect = - LayerTreeHostCommon::CalculateVisibleRect( - layer->render_surface()->clip_rect(), surface_content_rect, - layer->render_surface()->draw_transform()); - surface_content_rect.Intersect(surface_clip_rect); - } - } - // The RenderSurfaceImpl backing texture cannot exceed the maximum - // supported texture size. - surface_content_rect.set_width( - std::min(surface_content_rect.width(), max_texture_size)); - surface_content_rect.set_height( - std::min(surface_content_rect.height(), max_texture_size)); - layer->render_surface()->SetContentRect(surface_content_rect); - - // Now the render surface's content rect is calculated correctly, it could - // contribute to its render target. - layer->render_surface() - ->render_target() - ->AccumulateContentRectFromContributingRenderSurface( - layer->render_surface()); - } - } else { - // The root layer's surface content rect is always the entire viewport. - gfx::Rect viewport = - gfx::ToEnclosingRect(property_trees->clip_tree.ViewportClip()); - layer->render_surface()->SetContentRect(viewport); - } - - if (render_to_separate_surface && !IsRootLayer(layer) && - layer->render_surface()->DrawableContentRect().IsEmpty()) { - RemoveSurfaceForEarlyExit(layer, render_surface_layer_list); - } + ComputeLayerScrollsDrawnDescendants(layer_tree_impl, + &property_trees->scroll_tree); } static void ComputeMaskLayerDrawProperties(const LayerImpl* layer, @@ -828,7 +824,6 @@ DCHECK(inputs->can_render_to_separate_surface == inputs->property_trees->non_root_surfaces_enabled); - const bool subtree_visible_from_ancestor = true; for (LayerImpl* layer : visible_layer_list) { draw_property_utils::ComputeLayerDrawProperties( layer, inputs->property_trees, inputs->layers_always_allowed_lcd_text, @@ -845,9 +840,8 @@ inputs->current_render_surface_layer_list_id, inputs->root_layer->layer_tree_impl()->current_render_surface_list_id()); CalculateRenderSurfaceLayerList( - inputs->root_layer, inputs->property_trees, - inputs->render_surface_layer_list, nullptr, nullptr, - subtree_visible_from_ancestor, inputs->can_render_to_separate_surface, + inputs->root_layer->layer_tree_impl(), inputs->property_trees, + inputs->render_surface_layer_list, inputs->can_render_to_separate_surface, inputs->current_render_surface_layer_list_id, inputs->max_texture_size); if (should_measure_property_tree_performance) {
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc index 03004e1e..696f96c 100644 --- a/cc/trees/layer_tree_host_impl.cc +++ b/cc/trees/layer_tree_host_impl.cc
@@ -240,7 +240,6 @@ id_(id), requires_high_res_to_draw_(false), is_likely_to_require_a_draw_(false), - frame_timing_tracker_(FrameTimingTracker::Create(this)), mutator_(nullptr) { animation_host_ = AnimationHost::Create(ThreadInstance::IMPL); animation_host_->SetMutatorHostClient(this); @@ -900,16 +899,6 @@ frame->will_draw_layers.push_back(*it); it->AppendQuads(target_render_pass, &append_quads_data); - - // For layers that represent themselves, add composite frame timing - // requests if the visible rect intersects the requested rect. - for (const auto& request : it->frame_timing_requests()) { - if (request.rect().Intersects(it->visible_layer_rect())) { - frame->composite_events.push_back( - FrameTimingTracker::FrameAndRectIds( - active_tree_->source_frame_number(), request.id())); - } - } } ++layers_drawn; @@ -1611,11 +1600,6 @@ base::TimeTicks frame_begin_time = CurrentBeginFrameArgs().frame_time; DCHECK(CanDraw()); - if (!frame->composite_events.empty()) { - frame_timing_tracker_->SaveTimeStamps(frame_begin_time, - frame->composite_events); - } - if (frame->has_no_damage) { TRACE_EVENT_INSTANT0("cc", "EarlyOut_NoDamage", TRACE_EVENT_SCOPE_THREAD); DCHECK(!resourceless_software_draw_); @@ -2250,27 +2234,6 @@ settings_.renderer_settings.preferred_tile_format); } -void LayerTreeHostImpl::RecordMainFrameTiming( - const BeginFrameArgs& start_of_main_frame_args, - const BeginFrameArgs& expected_next_main_frame_args) { - std::vector<int64_t> request_ids; - active_tree_->GatherFrameTimingRequestIds(&request_ids); - if (request_ids.empty()) - return; - - base::TimeTicks start_time = start_of_main_frame_args.frame_time; - base::TimeTicks end_time = expected_next_main_frame_args.frame_time; - frame_timing_tracker_->SaveMainFrameTimeStamps( - request_ids, start_time, end_time, active_tree_->source_frame_number()); -} - -void LayerTreeHostImpl::PostFrameTimingEvents( - std::unique_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, - std::unique_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events) { - client_->PostFrameTimingEventsOnImplThread(std::move(composite_events), - std::move(main_frame_events)); -} - void LayerTreeHostImpl::SetLayerTreeMutator(LayerTreeMutator* mutator) { TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("compositor-worker"), "LayerTreeHostImpl::SetLayerTreeMutator");
diff --git a/cc/trees/layer_tree_host_impl.h b/cc/trees/layer_tree_host_impl.h index 9feb348..8e50cbba 100644 --- a/cc/trees/layer_tree_host_impl.h +++ b/cc/trees/layer_tree_host_impl.h
@@ -19,7 +19,6 @@ #include "cc/animation/layer_tree_mutator.h" #include "cc/base/cc_export.h" #include "cc/base/synced_property.h" -#include "cc/debug/frame_timing_tracker.h" #include "cc/debug/micro_benchmark_controller_impl.h" #include "cc/input/input_handler.h" #include "cc/input/scrollbar_animation_controller.h" @@ -74,6 +73,7 @@ class SwapPromise; class SwapPromiseMonitor; class SynchronousTaskGraphRunner; +class TaskGraphRunner; class TextureMailboxDeleter; class TopControlsManager; class UIResourceBitmap; @@ -131,11 +131,6 @@ // Called when output surface asks for a draw. virtual void OnDrawForOutputSurface(bool resourceless_software_draw) = 0; - virtual void PostFrameTimingEventsOnImplThread( - std::unique_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, - std::unique_ptr<FrameTimingTracker::MainFrameTimingSet> - main_frame_events) = 0; - protected: virtual ~LayerTreeHostImplClient() {} }; @@ -222,7 +217,6 @@ std::vector<gfx::Rect> occluding_screen_space_rects; std::vector<gfx::Rect> non_occluding_screen_space_rects; - std::vector<FrameTimingTracker::FrameAndRectIds> composite_events; RenderPassList render_passes; const LayerImplList* render_surface_layer_list; LayerImplList will_draw_layers; @@ -584,10 +578,6 @@ bool prepare_tiles_needed() const { return tile_priorities_dirty_; } - FrameTimingTracker* frame_timing_tracker() { - return frame_timing_tracker_.get(); - } - gfx::Vector2dF ScrollSingleNode(ScrollNode* scroll_node, const gfx::Vector2dF& delta, const gfx::Point& viewport_point, @@ -600,25 +590,6 @@ bool output_is_secure() const { return output_is_secure_; } - // Record main frame timing information. - // |start_of_main_frame_args| is the BeginFrameArgs of the beginning of the - // main frame (ie the frame that kicked off the main frame). - // |expected_next_main_frame_args| is the BeginFrameArgs of the frame that - // follows the completion of the main frame (whether it is activation or some - // other completion, such as early out). Note that if there is a main frame - // scheduled in that frame, then this BeginFrameArgs will become the main - // frame args. However, if no such frame is scheduled, then this _would_ be - // the main frame args if it was scheduled. - void RecordMainFrameTiming( - const BeginFrameArgs& start_of_main_frame_args, - const BeginFrameArgs& expected_next_main_frame_args); - - // Post the given frame timing events to the requester. - void PostFrameTimingEvents( - std::unique_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, - std::unique_ptr<FrameTimingTracker::MainFrameTimingSet> - main_frame_events); - base::SingleThreadTaskRunner* GetTaskRunner() const { DCHECK(task_runner_provider_); return task_runner_provider_->HasImplThread() @@ -865,8 +836,6 @@ bool requires_high_res_to_draw_; bool is_likely_to_require_a_draw_; - std::unique_ptr<FrameTimingTracker> frame_timing_tracker_; - std::unique_ptr<Viewport> viewport_; LayerTreeMutator* mutator_;
diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc index 3c2bb86d..feca1bf 100644 --- a/cc/trees/layer_tree_host_impl_unittest.cc +++ b/cc/trees/layer_tree_host_impl_unittest.cc
@@ -175,10 +175,6 @@ host_impl_->SwapBuffers(*frame); last_on_draw_frame_ = std::move(frame); } - void PostFrameTimingEventsOnImplThread( - std::unique_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, - std::unique_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events) - override {} void set_reduce_memory_result(bool reduce_memory_result) { reduce_memory_result_ = reduce_memory_result; @@ -965,8 +961,8 @@ scrollbar->SetBounds(scrollbar_size); scrollbar->SetPosition(gfx::PointF(345, 0)); scrollbar->SetScrollLayerId(scroll->id()); - scrollbar->set_layer_or_descendant_is_drawn(true); scrollbar->SetDrawsContent(true); + scrollbar->SetOpacity(1.f); std::unique_ptr<LayerImpl> squash1 = LayerImpl::Create(layer_tree_impl, 5); squash1->SetBounds(gfx::Size(140, 300));
diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc index a4482371..bd303e3f 100644 --- a/cc/trees/layer_tree_host_unittest.cc +++ b/cc/trees/layer_tree_host_unittest.cc
@@ -5520,94 +5520,6 @@ SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestOneActivatePerPrepareTiles); -class LayerTreeHostTestFrameTimingRequestsSaveTimestamps - : public LayerTreeHostTest { - public: - LayerTreeHostTestFrameTimingRequestsSaveTimestamps() - : check_results_on_commit_(false) {} - - void SetupTree() override { - scoped_refptr<FakePictureLayer> root_layer = - FakePictureLayer::Create(&client_); - root_layer->SetBounds(gfx::Size(200, 200)); - root_layer->SetIsDrawable(true); - - scoped_refptr<FakePictureLayer> child_layer = - FakePictureLayer::Create(&client_); - child_layer->SetBounds(gfx::Size(1500, 1500)); - child_layer->SetIsDrawable(true); - - std::vector<FrameTimingRequest> requests; - requests.push_back(FrameTimingRequest(1, gfx::Rect(0, 0, 100, 100))); - requests.push_back(FrameTimingRequest(2, gfx::Rect(300, 0, 100, 100))); - child_layer->SetFrameTimingRequests(requests); - - root_layer->AddChild(child_layer); - layer_tree_host()->SetRootLayer(root_layer); - LayerTreeHostTest::SetupTree(); - client_.set_bounds(root_layer->bounds()); - } - - void BeginTest() override { PostSetNeedsCommitToMainThread(); } - - void BeginCommitOnThread(LayerTreeHostImpl* host_impl) override { - if (!check_results_on_commit_) - return; - - // Since in reality, the events will be read by LayerTreeHost during commit, - // we check the requests here to ensure that they are correct at the next - // commit time (as opposed to checking in DrawLayers for instance). - // TODO(vmpstr): Change this to read things from the main thread when this - // information is propagated to the main thread (not yet implemented). - FrameTimingTracker* tracker = host_impl->frame_timing_tracker(); - - // Check composite events. - { - std::unique_ptr<FrameTimingTracker::CompositeTimingSet> timing_set = - tracker->GroupCompositeCountsByRectId(); - EXPECT_EQ(1u, timing_set->size()); - auto rect_1_it = timing_set->find(1); - EXPECT_TRUE(rect_1_it != timing_set->end()); - const auto& timing_events = rect_1_it->second; - EXPECT_EQ(1u, timing_events.size()); - EXPECT_EQ(host_impl->active_tree()->source_frame_number(), - timing_events[0].frame_id); - EXPECT_GT(timing_events[0].timestamp, base::TimeTicks()); - } - - // Check main frame events. - { - std::unique_ptr<FrameTimingTracker::MainFrameTimingSet> timing_set = - tracker->GroupMainFrameCountsByRectId(); - EXPECT_EQ(2u, timing_set->size()); - auto rect_1_it = timing_set->find(1); - EXPECT_TRUE(rect_1_it != timing_set->end()); - const auto& timing_events = rect_1_it->second; - EXPECT_EQ(1u, timing_events.size()); - EXPECT_EQ(host_impl->active_tree()->source_frame_number(), - timing_events[0].frame_id); - EXPECT_GT(timing_events[0].timestamp, base::TimeTicks()); - EXPECT_GT(timing_events[0].end_time, timing_events[0].timestamp); - } - - EndTest(); - } - - void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { - check_results_on_commit_ = true; - PostSetNeedsCommitToMainThread(); - } - - void AfterTest() override {} - - private: - FakeContentLayerClient client_; - bool check_results_on_commit_; -}; - -// Frame timing is not implemented in single thread proxy. -MULTI_THREAD_TEST_F(LayerTreeHostTestFrameTimingRequestsSaveTimestamps); - class LayerTreeHostTestActivationCausesPrepareTiles : public LayerTreeHostTest { public: LayerTreeHostTestActivationCausesPrepareTiles()
diff --git a/cc/trees/layer_tree_host_unittest_remote_server.cc b/cc/trees/layer_tree_host_unittest_remote_server.cc index b563fa4c..e9bf1fa 100644 --- a/cc/trees/layer_tree_host_unittest_remote_server.cc +++ b/cc/trees/layer_tree_host_unittest_remote_server.cc
@@ -55,10 +55,6 @@ void DidCommit() override {} void DidCommitAndDrawFrame() override {} void DidCompleteSwapBuffers() override {} - void RecordFrameTimingEvents( - std::unique_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, - std::unique_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events) - override{}; void DidCompletePageScaleAnimation() override {} void SendBeginFramesToChildren(const BeginFrameArgs& args) override {}
diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc index 7d178db..e41da4b4 100644 --- a/cc/trees/layer_tree_impl.cc +++ b/cc/trees/layer_tree_impl.cc
@@ -119,22 +119,6 @@ } } -void LayerTreeImpl::GatherFrameTimingRequestIds( - std::vector<int64_t>* request_ids) { - if (!root_layer_) - return; - - // TODO(vmpstr): Early out if there are no requests on any of the layers. For - // that, we need to inform LayerTreeImpl whenever there are requests when we - // get them. - LayerTreeHostCommon::CallFunctionForEveryLayer( - this, - [request_ids](LayerImpl* layer) { - layer->GatherFrameTimingRequestIds(request_ids); - }, - CallFunctionLayerType::ALL_LAYERS); -} - bool LayerTreeImpl::IsViewportLayerId(int id) const { if (id == inner_viewport_scroll_layer_id_ || id == outer_viewport_scroll_layer_id_) @@ -1760,20 +1744,9 @@ static bool ScrollsOrScrollbarAnyDrawnRenderSurfaceLayerListMember( LayerImpl* layer) { - if (!layer->scrollable() && !layer->ToScrollbarLayer()) - return false; - if (layer->layer_or_descendant_is_drawn()) - return true; - - if (!layer->scroll_children()) - return false; - for (std::set<LayerImpl*>::const_iterator it = - layer->scroll_children()->begin(); - it != layer->scroll_children()->end(); ++it) { - if ((*it)->layer_or_descendant_is_drawn()) - return true; - } - return false; + return layer->scrolls_drawn_descendant() || + (layer->ToScrollbarLayer() && + layer->IsDrawnRenderSurfaceLayerListMember()); } struct FindScrollingLayerOrScrollbarLayerFunctor {
diff --git a/cc/trees/layer_tree_impl.h b/cc/trees/layer_tree_impl.h index 6f47b3e..ab2fa3b 100644 --- a/cc/trees/layer_tree_impl.h +++ b/cc/trees/layer_tree_impl.h
@@ -434,8 +434,6 @@ std::unique_ptr<PendingPageScaleAnimation> pending_animation); std::unique_ptr<PendingPageScaleAnimation> TakePendingPageScaleAnimation(); - void GatherFrameTimingRequestIds(std::vector<int64_t>* request_ids); - void DidUpdateScrollOffset(int layer_id, int transform_id); void DidUpdateScrollState(int layer_id);
diff --git a/cc/trees/property_tree.cc b/cc/trees/property_tree.cc index 6c0bf01..05f6306 100644 --- a/cc/trees/property_tree.cc +++ b/cc/trees/property_tree.cc
@@ -528,7 +528,8 @@ user_scrollable_horizontal(false), user_scrollable_vertical(false), element_id(0), - transform_id(0) {} + transform_id(0), + num_drawn_descendants(0) {} ScrollNodeData::ScrollNodeData(const ScrollNodeData& other) = default;
diff --git a/cc/trees/property_tree.h b/cc/trees/property_tree.h index eff9594..14cacd4 100644 --- a/cc/trees/property_tree.h +++ b/cc/trees/property_tree.h
@@ -306,6 +306,8 @@ bool user_scrollable_vertical; int element_id; int transform_id; + // Number of drawn layers pointing to this node or any of its descendants. + int num_drawn_descendants; bool operator==(const ScrollNodeData& other) const;
diff --git a/cc/trees/proxy_impl.cc b/cc/trees/proxy_impl.cc index 428ad91..00cc663 100644 --- a/cc/trees/proxy_impl.cc +++ b/cc/trees/proxy_impl.cc
@@ -188,7 +188,6 @@ if (CommitEarlyOutHandledCommit(reason)) { SetInputThrottledUntilCommitOnImpl(false); - last_processed_begin_main_frame_args_ = last_begin_main_frame_args_; } layer_tree_host_impl_->BeginMainFrameAborted(reason); scheduler_->NotifyBeginMainFrameStarted(main_thread_start_time); @@ -456,8 +455,6 @@ commit_completion_event_ = nullptr; next_commit_waits_for_activation_ = false; } - - last_processed_begin_main_frame_args_ = last_begin_main_frame_args_; } void ProxyImpl::WillPrepareTiles() { @@ -480,26 +477,9 @@ scheduler_->OnDrawForOutputSurface(resourceless_software_draw); } -void ProxyImpl::PostFrameTimingEventsOnImplThread( - std::unique_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, - std::unique_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events) { - DCHECK(IsImplThread()); - channel_impl_->PostFrameTimingEventsOnMain(std::move(composite_events), - std::move(main_frame_events)); -} - void ProxyImpl::WillBeginImplFrame(const BeginFrameArgs& args) { DCHECK(IsImplThread()); layer_tree_host_impl_->WillBeginImplFrame(args); - if (last_processed_begin_main_frame_args_.IsValid()) { - // Last processed begin main frame args records the frame args that we sent - // to the main thread for the last frame that we've processed. If that is - // set, that means the current frame is one past the frame in which we've - // finished the processing. - layer_tree_host_impl_->RecordMainFrameTiming( - last_processed_begin_main_frame_args_, args); - last_processed_begin_main_frame_args_ = BeginFrameArgs(); - } } void ProxyImpl::DidFinishImplFrame() { @@ -524,10 +504,6 @@ layer_tree_host_impl_->memory_allocation_limit_bytes(); begin_main_frame_state->evicted_ui_resources = layer_tree_host_impl_->EvictedUIResourcesExist(); - // TODO(vmpstr): This needs to be fixed if - // main_frame_before_activation_enabled is set, since we might run this code - // twice before recording a duration. crbug.com/469824 - last_begin_main_frame_args_ = begin_main_frame_state->begin_frame_args; channel_impl_->BeginMainFrame(std::move(begin_main_frame_state)); devtools_instrumentation::DidRequestMainThreadFrame(layer_tree_host_id_); }
diff --git a/cc/trees/proxy_impl.h b/cc/trees/proxy_impl.h index 181fb293..06930a1 100644 --- a/cc/trees/proxy_impl.h +++ b/cc/trees/proxy_impl.h
@@ -106,11 +106,6 @@ void DidPrepareTiles() override; void DidCompletePageScaleAnimationOnImplThread() override; void OnDrawForOutputSurface(bool resourceless_software_draw) override; - // This should only be called by LayerTreeHostImpl::PostFrameTimingEvents. - void PostFrameTimingEventsOnImplThread( - std::unique_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, - std::unique_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events) - override; // SchedulerClient implementation void WillBeginImplFrame(const BeginFrameArgs& args) override; @@ -158,10 +153,6 @@ RenderingStatsInstrumentation* rendering_stats_instrumentation_; - // Values used to keep track of frame durations. Used only in frame timing. - BeginFrameArgs last_begin_main_frame_args_; - BeginFrameArgs last_processed_begin_main_frame_args_; - std::unique_ptr<LayerTreeHostImpl> layer_tree_host_impl_; ChannelImpl* channel_impl_;
diff --git a/cc/trees/proxy_main.cc b/cc/trees/proxy_main.cc index 8feb0a29..d62340f 100644 --- a/cc/trees/proxy_main.cc +++ b/cc/trees/proxy_main.cc
@@ -129,14 +129,6 @@ layer_tree_host_->DidCompletePageScaleAnimation(); } -void ProxyMain::PostFrameTimingEventsOnMain( - std::unique_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, - std::unique_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events) { - DCHECK(IsMainThread()); - layer_tree_host_->RecordFrameTimingEvents(std::move(composite_events), - std::move(main_frame_events)); -} - void ProxyMain::BeginMainFrame( std::unique_ptr<BeginMainFrameAndCommitState> begin_main_frame_state) { benchmark_instrumentation::ScopedBeginFrameTask begin_frame_task(
diff --git a/cc/trees/proxy_main.h b/cc/trees/proxy_main.h index 77b61a33..6627312 100644 --- a/cc/trees/proxy_main.h +++ b/cc/trees/proxy_main.h
@@ -7,7 +7,6 @@ #include "base/macros.h" #include "cc/base/cc_export.h" -#include "cc/debug/frame_timing_tracker.h" #include "cc/input/top_controls_state.h" #include "cc/output/output_surface.h" #include "cc/output/renderer_capabilities.h" @@ -62,10 +61,6 @@ bool success, const RendererCapabilities& capabilities); virtual void DidCompletePageScaleAnimation(); - virtual void PostFrameTimingEventsOnMain( - std::unique_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, - std::unique_ptr<FrameTimingTracker::MainFrameTimingSet> - main_frame_events); virtual void BeginMainFrame( std::unique_ptr<BeginMainFrameAndCommitState> begin_main_frame_state);
diff --git a/cc/trees/remote_channel_impl.cc b/cc/trees/remote_channel_impl.cc index a7639e9..e7dcacb6 100644 --- a/cc/trees/remote_channel_impl.cc +++ b/cc/trees/remote_channel_impl.cc
@@ -371,11 +371,6 @@ void RemoteChannelImpl::DidCompletePageScaleAnimation() {} -void RemoteChannelImpl::PostFrameTimingEventsOnMain( - std::unique_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, - std::unique_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events) { -} - void RemoteChannelImpl::BeginMainFrame( std::unique_ptr<BeginMainFrameAndCommitState> begin_main_frame_state) { std::unique_ptr<proto::CompositorMessage> proto;
diff --git a/cc/trees/remote_channel_impl.h b/cc/trees/remote_channel_impl.h index 485b155..8362937 100644 --- a/cc/trees/remote_channel_impl.h +++ b/cc/trees/remote_channel_impl.h
@@ -180,10 +180,6 @@ bool success, const RendererCapabilities& capabilities) override; void DidCompletePageScaleAnimation() override; - void PostFrameTimingEventsOnMain( - std::unique_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, - std::unique_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events) - override; void BeginMainFrame(std::unique_ptr<BeginMainFrameAndCommitState> begin_main_frame_state) override;
diff --git a/cc/trees/remote_channel_unittest.cc b/cc/trees/remote_channel_unittest.cc index e33f580..79e6a3d 100644 --- a/cc/trees/remote_channel_unittest.cc +++ b/cc/trees/remote_channel_unittest.cc
@@ -150,27 +150,11 @@ EXPECT_EQ(viewport_size_, host_impl->device_viewport_size()); } - void ScheduledActionSendBeginMainFrame() override { - last_args_sent_ = GetProxyImplForTest()->last_begin_frame_args(); - } - - void BeginMainFrame(const BeginFrameArgs& args) override { - last_args_received_ = args; - } - void AfterTest() override { EXPECT_EQ(5, calls_received_); - - // Ensure that we serialized and deserialized the - // BeginMainFrameAndCommitState. While the last_args_received_ will be set - // on the impl thread, it is safe to read it here since the impl thread has - // been destroyed now. - EXPECT_EQ(last_args_sent_, last_args_received_); } const gfx::Size viewport_size_ = gfx::Size(5, 3); - BeginFrameArgs last_args_sent_; - BeginFrameArgs last_args_received_; }; REMOTE_DIRECT_RENDERER_TEST_F(RemoteChannelTestCommit);
diff --git a/cc/trees/single_thread_proxy.cc b/cc/trees/single_thread_proxy.cc index 1fdf005..add60f6 100644 --- a/cc/trees/single_thread_proxy.cc +++ b/cc/trees/single_thread_proxy.cc
@@ -529,13 +529,6 @@ NOTREACHED() << "Implemented by ThreadProxy for synchronous compositor."; } -void SingleThreadProxy::PostFrameTimingEventsOnImplThread( - std::unique_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, - std::unique_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events) { - layer_tree_host_->RecordFrameTimingEvents(std::move(composite_events), - std::move(main_frame_events)); -} - void SingleThreadProxy::CompositeImmediately(base::TimeTicks frame_begin_time) { TRACE_EVENT0("cc,benchmark", "SingleThreadProxy::CompositeImmediately"); DCHECK(task_runner_provider_->IsMainThread());
diff --git a/cc/trees/single_thread_proxy.h b/cc/trees/single_thread_proxy.h index 65d717c..06ee8bd 100644 --- a/cc/trees/single_thread_proxy.h +++ b/cc/trees/single_thread_proxy.h
@@ -106,10 +106,6 @@ void DidPrepareTiles() override; void DidCompletePageScaleAnimationOnImplThread() override; void OnDrawForOutputSurface(bool resourceless_software_draw) override; - void PostFrameTimingEventsOnImplThread( - std::unique_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, - std::unique_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events) - override; void RequestNewOutputSurface();
diff --git a/cc/trees/threaded_channel.cc b/cc/trees/threaded_channel.cc index eacfabb..24ef3f7 100644 --- a/cc/trees/threaded_channel.cc +++ b/cc/trees/threaded_channel.cc
@@ -254,17 +254,6 @@ impl().proxy_main_weak_ptr)); } -void ThreadedChannel::PostFrameTimingEventsOnMain( - std::unique_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, - std::unique_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events) { - DCHECK(IsImplThread()); - MainThreadTaskRunner()->PostTask( - FROM_HERE, base::Bind(&ProxyMain::PostFrameTimingEventsOnMain, - impl().proxy_main_weak_ptr, - base::Passed(std::move(composite_events)), - base::Passed(std::move(main_frame_events)))); -} - void ThreadedChannel::BeginMainFrame( std::unique_ptr<BeginMainFrameAndCommitState> begin_main_frame_state) { DCHECK(IsImplThread());
diff --git a/cc/trees/threaded_channel.h b/cc/trees/threaded_channel.h index 46b7d5f4..77a51d1 100644 --- a/cc/trees/threaded_channel.h +++ b/cc/trees/threaded_channel.h
@@ -126,10 +126,6 @@ bool success, const RendererCapabilities& capabilities) override; void DidCompletePageScaleAnimation() override; - void PostFrameTimingEventsOnMain( - std::unique_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, - std::unique_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events) - override; void BeginMainFrame(std::unique_ptr<BeginMainFrameAndCommitState> begin_main_frame_state) override;
diff --git a/chrome/VERSION b/chrome/VERSION index 5c6acd7..e7b2245 100644 --- a/chrome/VERSION +++ b/chrome/VERSION
@@ -1,4 +1,4 @@ MAJOR=52 MINOR=0 -BUILD=2712 +BUILD=2713 PATCH=0
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn index 9a6ff54..4579edd 100644 --- a/chrome/android/BUILD.gn +++ b/chrome/android/BUILD.gn
@@ -264,8 +264,6 @@ java_files = [ "junit/src/org/chromium/chrome/browser/ShortcutHelperTest.java", "junit/src/org/chromium/chrome/browser/SSLClientCertificateRequestTest.java", - "junit/src/org/chromium/chrome/browser/bookmarks/BookmarkModelUnitTest.java", - "junit/src/org/chromium/chrome/browser/bookmarks/BookmarkUtilsTest.java", "junit/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelperTest.java", "junit/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchSelectionControllerTest.java", "junit/src/org/chromium/chrome/browser/crash/LogcatExtractionCallableTest.java", @@ -285,6 +283,7 @@ "junit/src/org/chromium/chrome/browser/media/router/cast/TestUtils.java", "junit/src/org/chromium/chrome/browser/notifications/NotificationUIManagerUnitTest.java", "junit/src/org/chromium/chrome/browser/ntp/NativePageFactoryTest.java", + "junit/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapterTest.java", "junit/src/org/chromium/chrome/browser/offlinepages/ClientIdTest.java", "junit/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridgeTest.java", "junit/src/org/chromium/chrome/browser/offlinepages/OfflinePageTabObserverTest.java", @@ -311,6 +310,7 @@ "//sync:sync_java_test_support", "//sync/android:sync_java", "//third_party/android_tools:android_support_v7_mediarouter_java", + "//third_party/android_tools:android_support_v7_recyclerview_java", "//third_party/cacheinvalidation:cacheinvalidation_javalib", "//third_party/junit:hamcrest", "//ui/android:ui_java",
diff --git a/chrome/android/java/AndroidManifest.xml b/chrome/android/java/AndroidManifest.xml index c3820ddb..1bc8c3e 100644 --- a/chrome/android/java/AndroidManifest.xml +++ b/chrome/android/java/AndroidManifest.xml
@@ -347,6 +347,7 @@ <activity android:name="org.chromium.chrome.browser.bookmarks.BookmarkEditActivity" android:theme="@style/BookmarkDialogWhite" android:windowSoftInputMode="stateHidden" + android:label="@string/edit_bookmark" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|mcc|mnc|screenLayout|smallestScreenSize"> </activity> <activity android:name="org.chromium.chrome.browser.bookmarks.BookmarkAddEditFolderActivity" @@ -425,12 +426,6 @@ android:excludeFromRecents="true"> </activity> - <activity android:name="org.chromium.chrome.browser.childaccounts.ResetDataActivity" - android:theme="@android:style/Theme.Translucent.NoTitleBar" - android:exported="true" - android:excludeFromRecents="true"> - </activity> - <!-- This activity is started along with IncognitoDocumentActivity, so it also must disable hardware acceleration. Besides, it doesn't have any UI. --> <activity android:name="org.chromium.chrome.browser.document.CipherKeyActivity"
diff --git a/chrome/android/java/res/layout/bookmark_edit.xml b/chrome/android/java/res/layout/bookmark_edit.xml index 629091e..6ffccd71 100644 --- a/chrome/android/java/res/layout/bookmark_edit.xml +++ b/chrome/android/java/res/layout/bookmark_edit.xml
@@ -83,39 +83,6 @@ android:singleLine="true" chrome:alertMessage="@string/bookmark_missing_url" /> </org.chromium.chrome.browser.widget.FloatLabelLayout> - - <LinearLayout - android:id="@+id/offline_page_group" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:orientation="horizontal" - android:layout_marginTop="28dp" - android:visibility="gone" > - - <TextView - android:id="@+id/offline_page_info_text" - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_weight="1" - android:layout_gravity="center_vertical" - android:layout_marginStart="3dp" - android:text="@string/bookmark_offline_page_none" - android:textAlignment="viewStart" - android:textAppearance="@style/TextAppearance.AppCompat.Medium" - android:textColor="@color/dark_mode_tint" - android:textSize="15sp" /> - - <Button - android:id="@+id/offline_page_save_remove_button" - style="@style/ButtonCompatBorderless" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="center_vertical" - android:textAllCaps="true" - android:textColor="@color/light_active_color" - android:textSize="15sp" /> - - </LinearLayout> </LinearLayout> </ScrollView> </LinearLayout>
diff --git a/chrome/android/java/res/layout/bookmark_offline_pages_storage_space_header.xml b/chrome/android/java/res/layout/bookmark_offline_pages_storage_space_header.xml deleted file mode 100644 index 8f89179..0000000 --- a/chrome/android/java/res/layout/bookmark_offline_pages_storage_space_header.xml +++ /dev/null
@@ -1,51 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - 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. ---> -<!-- TODO(kkimlabs): Generalize and unify with bookmark_promo_header.xml --> -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:chrome="http://schemas.android.com/apk/res-auto" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:orientation="vertical" - android:padding="16dp" > - - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="@string/offline_pages_storage_space_title" - android:textColor="@color/default_text_color" - android:textSize="16sp" - android:textStyle="bold" /> - - <TextView - android:id="@+id/storage_header_message" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginTop="8dp" - android:textColor="@color/default_text_color" - android:textSize="14sp" /> - - <LinearLayout - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginTop="16dp" - android:layout_gravity="end" - android:gravity="center_vertical" - android:orientation="horizontal" > - - <Button - android:id="@+id/storage_header_button" - style="@style/ButtonCompatBorderless" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="@string/offline_pages_free_up_space_title" - android:textAllCaps="true" - android:textColor="@color/light_active_color" - android:textSize="15sp" /> - </LinearLayout> - -</LinearLayout>
diff --git a/chrome/android/java/res/layout/bookmark_row_content.xml b/chrome/android/java/res/layout/bookmark_row_content.xml index b51ec193..8f195f5 100644 --- a/chrome/android/java/res/layout/bookmark_row_content.xml +++ b/chrome/android/java/res/layout/bookmark_row_content.xml
@@ -22,34 +22,17 @@ android:contentDescription="@null" android:scaleType="center" /> - <LinearLayout + <TextView + android:id="@+id/title" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:minHeight="48dp" + android:singleLine="true" android:gravity="center_vertical" - android:orientation="vertical" > - - <TextView - android:id="@+id/title" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:singleLine="true" - android:textAlignment="viewStart" - android:textColor="@color/default_text_color" - android:textSize="16sp" /> - - <TextView - android:id="@+id/offline_page_size" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:singleLine="true" - android:textAlignment="viewStart" - android:textColor="@color/secondary_text_default_material_light" - android:textSize="15sp" - android:visibility="gone" /> - - </LinearLayout> + android:textAlignment="viewStart" + android:textColor="@color/default_text_color" + android:textSize="16sp" /> <org.chromium.chrome.browser.widget.TintedImageButton android:id="@+id/more"
diff --git a/chrome/android/java/res/layout/payment_line_item.xml b/chrome/android/java/res/layout/payment_line_item.xml new file mode 100644 index 0000000..285f46d6 --- /dev/null +++ b/chrome/android/java/res/layout/payment_line_item.xml
@@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + 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. +--> +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_height="wrap_content" + android:layout_width="wrap_content"> + + <TextView + android:id="@+id/lineItemPrice" + android:layout_alignParentEnd="true" + android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:textStyle="bold" /> + + <TextView + android:id="@+id/lineItemCurrencyCode" + android:layout_height="wrap_content" + android:layout_marginEnd="6dp" + android:layout_toStartOf="@id/lineItemPrice" + android:layout_width="wrap_content" /> + + <TextView + android:id="@+id/lineItemLabel" + android:layout_alignParentStart="true" + android:layout_height="wrap_content" + android:layout_toStartOf="@id/lineItemCurrencyCode" + android:layout_width="wrap_content" /> + +</RelativeLayout>
diff --git a/chrome/android/java/res/layout/payment_option_line.xml b/chrome/android/java/res/layout/payment_option_line.xml new file mode 100644 index 0000000..4a3a8cb --- /dev/null +++ b/chrome/android/java/res/layout/payment_option_line.xml
@@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + 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. +--> +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_height="wrap_content" + android:layout_width="match_parent"> + + <RadioButton + android:id="@+id/optionRadioButton" + android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:clickable="false" + android:importantForAccessibility="no" + android:paddingEnd="8dp" + android:visibility="gone" /> + + <ImageView + android:id="@+id/optionIcon" + android:layout_alignParentEnd="true" + android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:importantForAccessibility="no" /> + + <TextView + android:id="@+id/optionLabel" + android:layout_height="wrap_content" + android:layout_toEndOf="@id/optionRadioButton" + android:layout_toStartOf="@id/optionIcon" + android:layout_width="match_parent" + android:singleLine="false" + android:textColor="#000000" /> + + <TextView + android:id="@+id/optionSubLabel" + android:layout_below="@id/optionLabel" + android:layout_height="wrap_content" + android:layout_toEndOf="@id/optionRadioButton" + android:layout_toStartOf="@id/optionIcon" + android:layout_width="match_parent" + android:singleLine="false" /> + +</RelativeLayout>
diff --git a/chrome/android/java/res/layout/payment_request.xml b/chrome/android/java/res/layout/payment_request.xml new file mode 100644 index 0000000..4a19a24d --- /dev/null +++ b/chrome/android/java/res/layout/payment_request.xml
@@ -0,0 +1,262 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + 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. +--> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="vertical"> + + <LinearLayout + android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:orientation="horizontal" + android:padding="16dp"> + + <ImageView + android:id="@+id/pageFavIcon" + android:layout_height="match_parent" + android:layout_width="wrap_content" + android:importantForAccessibility="no" + android:paddingEnd="8dp" /> + + <LinearLayout + android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:orientation="vertical"> + + <TextView + android:id="@+id/pageTitle" + android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:textColor="#000000" + android:textStyle="bold" /> + + <TextView + android:id="@+id/hostname" + android:layout_height="wrap_content" + android:layout_width="wrap_content" /> + + </LinearLayout> + + </LinearLayout> + + + <LinearLayout + android:id="@+id/paymentContainer" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical"> + + <TextView + android:id="@+id/orderSummaryLabel" + android:layout_height="wrap_content" + android:layout_width="match_parent" + android:textColor="#0000ff" + android:text="@string/payments_order_summary_label" + android:padding="16dp" /> + + <LinearLayout + android:id="@+id/lineItems" + android:layout_height="wrap_content" + android:layout_width="match_parent" + android:orientation="vertical" + android:padding="16dp"> + + </LinearLayout> + + <View + android:layout_height="1dp" + android:layout_width="match_parent" + android:background="#cccccc" + android:padding="16dp"> + </View> + + <TextView + android:id="@+id/shippingSummaryLabel" + android:layout_height="wrap_content" + android:layout_width="match_parent" + android:textColor="#0000ff" + android:text="@string/payments_shipping_summary_label" + android:padding="16dp" /> + + <RelativeLayout + android:id="@+id/shippingSummary" + android:layout_height="wrap_content" + android:layout_width="match_parent" + android:padding="16dp"> + + <TextView + android:id="@+id/shippingSummaryOption" + android:layout_alignParentEnd="true" + android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:singleLine="false" + android:textColor="#000000" /> + + <TextView + android:id="@+id/shippingSummaryAddress" + android:layout_height="wrap_content" + android:layout_toStartOf="@id/shippingSummaryOption" + android:layout_width="match_parent" + android:singleLine="false" + android:textColor="#000000" /> + + </RelativeLayout> + + <View + android:id="@+id/shippingSummarySeparator" + android:layout_height="1dp" + android:layout_width="match_parent" + android:background="#cccccc" + android:padding="16dp"> + </View> + + <TextView + android:id="@+id/shippingAddressesLabel" + android:layout_height="wrap_content" + android:layout_width="match_parent" + android:textColor="#0000ff" + android:text="@string/payments_shipping_address_label" + android:padding="16dp" + android:visibility="gone" /> + + <RadioGroup + android:id="@+id/shippingAddresses" + android:layout_height="wrap_content" + android:layout_width="match_parent" + android:orientation="vertical" + android:padding="16dp" + android:visibility="gone"> + + </RadioGroup> + + <View + android:id="@+id/shippingAddressesSeparator" + android:layout_height="1dp" + android:layout_width="match_parent" + android:background="#cccccc" + android:padding="16dp" + android:visibility="gone"> + </View> + + <TextView + android:id="@+id/shippingOptionsLabel" + android:layout_height="wrap_content" + android:layout_width="match_parent" + android:textColor="#0000ff" + android:text="@string/payments_shipping_option_label" + android:padding="16dp" + android:visibility="gone" /> + + <TextView + android:id="@+id/selectShippingOptionPrompt" + android:layout_height="wrap_content" + android:layout_width="match_parent" + android:text="@string/payments_select_shipping_option_prompt" + android:padding="16dp" + android:visibility="gone" /> + + <RadioGroup + android:id="@+id/shippingOptions" + android:layout_height="wrap_content" + android:layout_width="match_parent" + android:orientation="vertical" + android:padding="16dp" + android:visibility="gone"> + + </RadioGroup> + + <View + android:id="@+id/shippingOptionsSeparator" + android:layout_height="1dp" + android:layout_width="match_parent" + android:background="#cccccc" + android:padding="16dp" + android:visibility="gone"> + </View> + + <TextView + android:id="@+id/paymentsListLabel" + android:layout_height="wrap_content" + android:layout_width="match_parent" + android:textColor="#0000ff" + android:text="@string/payments_method_of_payment_label" + android:padding="16dp" /> + + <RadioGroup + android:id="@+id/paymentsList" + android:layout_height="wrap_content" + android:layout_width="match_parent" + android:orientation="vertical" + android:padding="16dp"> + + </RadioGroup> + + <LinearLayout + android:layout_gravity="end" + android:layout_height="match_parent" + android:layout_width="wrap_content" + android:orientation="horizontal" + style="?android:attr/buttonBarStyle" + android:padding="16dp"> + + <Button + android:id="@+id/editButton" + android:layout_gravity="bottom" + android:layout_height="wrap_content" + android:layout_weight="1" + android:layout_width="0dp" + android:text="@string/payments_edit_button" + android:layout_marginEnd="8dp" + android:textColor="#0000ff" + android:background="#ffffff" + style="?android:attr/buttonBarButtonStyle" /> + + <Button + android:id="@+id/payButton" + android:layout_gravity="bottom" + android:layout_height="wrap_content" + android:layout_weight="1" + android:layout_width="0dp" + android:text="@string/payments_pay_button" + android:textColor="#ffffff" + android:background="#0000ff" + style="?android:attr/buttonBarButtonStyle" /> + </LinearLayout> + + </LinearLayout> + + <LinearLayout + android:id="@+id/waitingOverlay" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:gravity="center" + android:orientation="vertical" + android:padding="36dp" + android:visibility="gone"> + + <ProgressBar + android:id="@+id/waitingProgressBar" + android:layout_width="36dp" + android:layout_height="36dp" + android:layout_marginBottom="8dp" /> + + <ImageView + android:id="@+id/waitingSuccess" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:src="@drawable/verify_checkmark" + android:visibility="gone" + android:contentDescription="@null" /> + + <TextView + android:id="@+id/waitingMessage" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/payments_processing_message" + android:textColor="@color/light_active_color" + android:textSize="20sp" /> + </LinearLayout> +</LinearLayout>
diff --git a/chrome/android/java/res/values/dimens.xml b/chrome/android/java/res/values/dimens.xml index b00dba8..2e02556 100644 --- a/chrome/android/java/res/values/dimens.xml +++ b/chrome/android/java/res/values/dimens.xml
@@ -317,9 +317,6 @@ icon but otherwise, the icon is meant to be a flat color so it doesn't really matter. --> <dimen name="media_session_icon_size">48dp</dimen> - <!-- Offline pages dimensions --> - <dimen name="offline_page_item_vertical_spacing">16dp</dimen> - <!-- Account chooser dialog dimensions --> <dimen name="account_chooser_dialog_margin">24dp</dimen> <dimen name="account_chooser_dialog_item_margin">20dp</dimen>
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ActivityTabTaskDescriptionHelper.java b/chrome/android/java/src/org/chromium/chrome/browser/ActivityTabTaskDescriptionHelper.java new file mode 100644 index 0000000..92b6039 --- /dev/null +++ b/chrome/android/java/src/org/chromium/chrome/browser/ActivityTabTaskDescriptionHelper.java
@@ -0,0 +1,278 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser; + +import android.graphics.Bitmap; +import android.text.TextUtils; + +import org.chromium.base.ApiCompatibilityUtils; +import org.chromium.chrome.browser.favicon.FaviconHelper; +import org.chromium.chrome.browser.ntp.NewTabPage; +import org.chromium.chrome.browser.tab.EmptyTabObserver; +import org.chromium.chrome.browser.tab.Tab; +import org.chromium.chrome.browser.tab.TabObserver; +import org.chromium.chrome.browser.tabmodel.EmptyTabModelObserver; +import org.chromium.chrome.browser.tabmodel.EmptyTabModelSelectorObserver; +import org.chromium.chrome.browser.tabmodel.TabModel; +import org.chromium.chrome.browser.tabmodel.TabModel.TabSelectionType; +import org.chromium.chrome.browser.tabmodel.TabModelObserver; +import org.chromium.chrome.browser.tabmodel.TabModelSelector; +import org.chromium.chrome.browser.tabmodel.TabModelSelectorObserver; +import org.chromium.chrome.browser.util.UrlUtilities; +import org.chromium.components.security_state.ConnectionSecurityLevel; + +import java.util.List; + +/** + * Helper that updates the Android task description given the state of the current tab. + * + * <p> + * The task description is what is shown in Android's Overview/Recents screen for each entry. + */ +public class ActivityTabTaskDescriptionHelper { + private final int mDefaultThemeColor; + private final ChromeActivity mActivity; + private final TabModelSelector mTabModelSelector; + + private final ActivityTaskDescriptionIconGenerator mIconGenerator; + private final FaviconHelper mFaviconHelper; + + private final TabModelSelectorObserver mTabModelSelectorObserver; + private final TabModelObserver mTabModelObserver; + private final TabObserver mTabObserver; + + private Bitmap mLargestFavicon; + private Tab mCurrentTab; + + /** + * Constructs a task description helper for the given activity. + * + * @param activity The activity whose descriptions should be updated. + * @param defaultThemeColor The default theme color to be used if the tab does not override it. + */ + public ActivityTabTaskDescriptionHelper(ChromeActivity activity, int defaultThemeColor) { + mActivity = activity; + mDefaultThemeColor = defaultThemeColor; + + mTabModelSelector = mActivity.getTabModelSelector(); + + mIconGenerator = new ActivityTaskDescriptionIconGenerator(activity); + mFaviconHelper = new FaviconHelper(); + + mTabObserver = new EmptyTabObserver() { + @Override + public void onWebContentsSwapped(Tab tab, boolean didStartLoad, boolean didFinishLoad) { + if (!didStartLoad) return; + resetIcon(); + } + + @Override + public void onFaviconUpdated(Tab tab, Bitmap icon) { + if (icon == null) return; + updateFavicon(icon); + } + + @Override + public void onUrlUpdated(Tab tab) { + updateTaskDescription(); + } + + @Override + public void onTitleUpdated(Tab tab) { + updateTaskDescription(); + } + + @Override + public void onSSLStateUpdated(Tab tab) { + if (hasSecurityWarningOrError(tab)) resetIcon(); + } + + @Override + public void onDidNavigateMainFrame(Tab tab, String url, String baseUrl, + boolean isNavigationToDifferentPage, boolean isFragmentNavigation, + int statusCode) { + if (!isNavigationToDifferentPage) return; + mLargestFavicon = null; + updateTaskDescription(); + } + + @Override + public void onLoadStopped(Tab tab, boolean toDifferentDocument) { + updateTaskDescription(); + } + + @Override + public void onDidChangeThemeColor(Tab tab, int color) { + updateTaskDescription(); + } + + @Override + public void onDidAttachInterstitialPage(Tab tab) { + resetIcon(); + } + + @Override + public void onDidDetachInterstitialPage(Tab tab) { + resetIcon(); + } + + private boolean hasSecurityWarningOrError(Tab tab) { + int securityLevel = tab.getSecurityLevel(); + return securityLevel == ConnectionSecurityLevel.SECURITY_ERROR + || securityLevel == ConnectionSecurityLevel.SECURITY_WARNING + || securityLevel == ConnectionSecurityLevel.SECURITY_POLICY_WARNING; + } + }; + + mTabModelSelectorObserver = new EmptyTabModelSelectorObserver() { + @Override + public void onTabModelSelected(TabModel newModel, TabModel oldModel) { + refreshSelectedTab(); + } + }; + + mTabModelObserver = new EmptyTabModelObserver() { + @Override + public void didSelectTab(Tab tab, TabSelectionType type, int lastId) { + refreshSelectedTab(); + } + + @Override + public void tabClosureUndone(Tab tab) { + refreshSelectedTab(); + } + + @Override + public void didCloseTab(int tabId, boolean incognito) { + refreshSelectedTab(); + } + + @Override + public void tabRemoved(Tab tab) { + refreshSelectedTab(); + } + + @Override + public void tabPendingClosure(Tab tab) { + refreshSelectedTab(); + } + + @Override + public void allTabsPendingClosure(List<Integer> tabIds) { + refreshSelectedTab(); + } + }; + + mTabModelSelector.addObserver(mTabModelSelectorObserver); + for (TabModel model : mTabModelSelector.getModels()) model.addObserver(mTabModelObserver); + refreshSelectedTab(); + } + + private void resetIcon() { + mLargestFavicon = null; + updateTaskDescription(); + } + + private void updateFavicon(Bitmap favicon) { + if (favicon == null) return; + if (mLargestFavicon == null || favicon.getWidth() > mLargestFavicon.getWidth() + || favicon.getHeight() > mLargestFavicon.getHeight()) { + mLargestFavicon = favicon; + updateTaskDescription(); + } + } + + private void updateTaskDescription() { + if (mCurrentTab == null) { + updateTaskDescription(null, null); + return; + } + + if (NewTabPage.isNTPUrl(mCurrentTab.getUrl()) && !mCurrentTab.isIncognito()) { + // NTP needs a new color in recents, but uses the default application title and icon + updateTaskDescription(null, null); + return; + } + + String label = mCurrentTab.getTitle(); + String domain = UrlUtilities.getDomainAndRegistry(mCurrentTab.getUrl(), false); + if (TextUtils.isEmpty(label)) { + label = domain; + } + if (mLargestFavicon == null && TextUtils.isEmpty(label)) { + updateTaskDescription(null, null); + return; + } + + Bitmap bitmap = null; + if (!mCurrentTab.isIncognito()) { + bitmap = mIconGenerator.getBitmap(mCurrentTab.getUrl(), mLargestFavicon); + } + + updateTaskDescription(label, bitmap); + } + + /** + * Update the task description with the specified icon and label. + * + * <p> + * This is only publicly visible to allow activities to set this early during initialization + * prior to the tab's being available. + * + * @param label The text to use in the task description. + * @param icon The icon to use in the task description. + */ + public void updateTaskDescription(String label, Bitmap icon) { + int color = mDefaultThemeColor; + if (mCurrentTab != null && !mCurrentTab.isDefaultThemeColor()) { + color = mCurrentTab.getThemeColor(); + } + ApiCompatibilityUtils.setTaskDescription(mActivity, label, icon, color); + } + + private void refreshSelectedTab() { + Tab tab = mTabModelSelector.getCurrentTab(); + if (mCurrentTab == tab) return; + + if (mCurrentTab != null) mCurrentTab.removeObserver(mTabObserver); + + mCurrentTab = tab; + if (mCurrentTab != null) { + mCurrentTab.addObserver(mTabObserver); + + final String currentUrl = mCurrentTab.getUrl(); + mFaviconHelper.getLocalFaviconImageForURL( + mCurrentTab.getProfile(), mCurrentTab.getUrl(), 0, + new FaviconHelper.FaviconImageCallback() { + @Override + public void onFaviconAvailable(Bitmap image, String iconUrl) { + if (mCurrentTab == null + || !TextUtils.equals(currentUrl, mCurrentTab.getUrl())) { + return; + } + + updateFavicon(image); + } + }); + } + updateTaskDescription(); + } + + /** + * Destroys all dependent components of the task description helper. + */ + public void destroy() { + mFaviconHelper.destroy(); + + if (mCurrentTab != null) { + mCurrentTab.removeObserver(mTabObserver); + } + + mTabModelSelector.removeObserver(mTabModelSelectorObserver); + for (TabModel model : mTabModelSelector.getModels()) { + model.removeObserver(mTabModelObserver); + } + } +}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/document/DocumentActivityIcon.java b/chrome/android/java/src/org/chromium/chrome/browser/ActivityTaskDescriptionIconGenerator.java similarity index 76% rename from chrome/android/java/src/org/chromium/chrome/browser/document/DocumentActivityIcon.java rename to chrome/android/java/src/org/chromium/chrome/browser/ActivityTaskDescriptionIconGenerator.java index 8a0b0c0..859b7a14 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/document/DocumentActivityIcon.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ActivityTaskDescriptionIconGenerator.java
@@ -2,7 +2,7 @@ // 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.document; +package org.chromium.chrome.browser; import android.content.Context; import android.graphics.Bitmap; @@ -11,9 +11,9 @@ import org.chromium.chrome.browser.widget.RoundedIconGenerator; /** - * Generates the icon for the DocumentActivity in the recent tasks list. + * Generates icons suitable for Activities in the recent tasks list. */ -public class DocumentActivityIcon { +public class ActivityTaskDescriptionIconGenerator { private static final int APP_ICON_MIN_SIZE_DP = 32; private static final int APP_ICON_SIZE_DP = 64; private static final int APP_ICON_CORNER_RADIUS_DP = 3; @@ -21,6 +21,7 @@ private static final int APP_ICON_DEFAULT_BACKGROUND_COLOR = 0xFF323232; private Context mContext; + private int mMinSizePx; /** * The page URL for which {@link #mGeneratedIcon} was generated. @@ -37,23 +38,24 @@ */ private RoundedIconGenerator mGenerator; - public DocumentActivityIcon(Context context) { + public ActivityTaskDescriptionIconGenerator(Context context) { mContext = context; + mMinSizePx = + (int) mContext.getResources().getDisplayMetrics().density * APP_ICON_MIN_SIZE_DP; } /** - * Returns the icon to use for the DocumentActivity in the recent tasks list. Returns the - * favicon if it is adequate. If the passed in favicon is not adequate, an icon is generated - * from the page URL. - * @param pageUrl The URL of the DocumentActivity's tab. + * Returns the icon to use for the Activity in the recent tasks list. Returns the favicon if it + * is adequate. If the passed in favicon is not adequate, an icon is generated from the + * page URL. + * + * @param pageUrl The URL of the tab. * @param largestFavicon The largest favicon available at the page URL. * @return The icon to use in the recent tasks list. */ public Bitmap getBitmap(String pageUrl, Bitmap largestFavicon) { - int minSize = - (int) mContext.getResources().getDisplayMetrics().density * APP_ICON_MIN_SIZE_DP; - if (largestFavicon != null && largestFavicon.getWidth() >= minSize - && largestFavicon.getHeight() >= minSize) { + if (largestFavicon != null && largestFavicon.getWidth() >= mMinSizePx + && largestFavicon.getHeight() >= mMinSizePx) { return largestFavicon; }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java index f1b3357..806e6ef 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
@@ -121,6 +121,7 @@ import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.chrome.browser.webapps.AddToHomescreenDialog; import org.chromium.chrome.browser.widget.ControlContainer; +import org.chromium.components.bookmarks.BookmarkId; import org.chromium.content.browser.ContentVideoView; import org.chromium.content.browser.ContentViewCore; import org.chromium.content.common.ContentSwitches; @@ -221,6 +222,10 @@ private AssistStatusHandler mAssistStatusHandler; + // A set of views obscuring all tabs. When this set is nonempty, + // all tab content will be hidden from the accessibility tree. + private List<View> mViewsObscuringAllTabs = new ArrayList<View>(); + private static AppMenuHandlerFactory sAppMenuHandlerFactory = new AppMenuHandlerFactory() { @Override public AppMenuHandler get( @@ -1057,8 +1062,13 @@ if (!tabToBookmark.isClosing() && tabToBookmark.isInitialized()) { // The BookmarkModel will be destroyed by BookmarkUtils#addOrEditBookmark() when // done. - BookmarkUtils.addOrEditBookmark(bookmarkId, bookmarkModel, - tabToBookmark, getSnackbarManager(), ChromeActivity.this); + BookmarkId newBookmarkId = + BookmarkUtils.addOrEditBookmark(bookmarkId, bookmarkModel, + tabToBookmark, getSnackbarManager(), ChromeActivity.this); + // If a new bookmark was created, try to save an offline page for it. + if (newBookmarkId != null && newBookmarkId.getId() != bookmarkId) { + OfflinePageUtils.saveBookmarkOffline(newBookmarkId, tabToBookmark); + } } else { bookmarkModel.destroy(); } @@ -1465,6 +1475,39 @@ return true; } + /** + * Add a view to the set of views that obscure the content of all tabs for + * accessibility. As long as this set is nonempty, all tabs should be + * hidden from the accessibility tree. + * + * @param view The view that obscures the contents of all tabs. + */ + public void addViewObscuringAllTabs(View view) { + mViewsObscuringAllTabs.add(view); + + Tab tab = getActivityTab(); + if (tab != null) tab.updateAccessibilityVisibility(); + } + + /** + * Remove a view that previously obscured the content of all tabs. + * + * @param view The view that no longer obscures the contents of all tabs. + */ + public void removeViewObscuringAllTabs(View view) { + mViewsObscuringAllTabs.remove(view); + + Tab tab = getActivityTab(); + if (tab != null) tab.updateAccessibilityVisibility(); + } + + /** + * Returns whether or not any views obscure all tabs. + */ + public boolean isViewObscuringAllTabs() { + return !mViewsObscuringAllTabs.isEmpty(); + } + private void markSessionResume() { // Start new session for UMA. if (mUmaSessionStats == null) {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java index 1f67786..b7edc74 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java
@@ -53,6 +53,10 @@ handleFetchSnippets(context); break; + case SnippetsLauncher.TASK_TAG_RESCHEDULE: + handleRescheduleSnippets(context); + break; + case PrecacheController.PERIODIC_TASK_TAG: case PrecacheController.CONTINUATION_TASK_TAG: handlePrecache(context, params.getTag()); @@ -91,6 +95,18 @@ SnippetsBridge.fetchSnippets(); } + private void handleRescheduleSnippets(Context context) { + if (!SnippetsLauncher.hasInstance()) { + launchBrowser(context); + } + rescheduleSnippets(); + } + + @VisibleForTesting + protected void rescheduleSnippets() { + SnippetsBridge.rescheduleFetching(); + } + private void handlePrecache(Context context, String tag) { if (!hasPrecacheInstance()) { launchBrowser(context);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegate.java index 4989b9c..dc57cc3 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegate.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegate.java
@@ -15,7 +15,6 @@ import org.chromium.chrome.browser.UrlConstants; import org.chromium.chrome.browser.bookmarks.BookmarkBridge; import org.chromium.chrome.browser.multiwindow.MultiWindowUtils; -import org.chromium.chrome.browser.offlinepages.OfflinePageUtils; import org.chromium.chrome.browser.omaha.UpdateMenuItemHelper; import org.chromium.chrome.browser.preferences.ManagedPreferencesUtils; import org.chromium.chrome.browser.preferences.PrefServiceBridge; @@ -122,8 +121,7 @@ recentTabsMenuItem.setTitle(R.string.menu_recent_tabs); MenuItem allBookmarksMenuItem = menu.findItem(R.id.all_bookmarks_menu_id); - allBookmarksMenuItem.setTitle( - mActivity.getString(OfflinePageUtils.getStringId(R.string.menu_bookmarks))); + allBookmarksMenuItem.setTitle(mActivity.getString(R.string.menu_bookmarks)); // Don't allow "chrome://" pages to be shared. menu.findItem(R.id.share_row_menu_id).setVisible(!isChromeScheme);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/autofill/CardUnmaskBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/autofill/CardUnmaskBridge.java index f39f750..2032fec1 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/autofill/CardUnmaskBridge.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/autofill/CardUnmaskBridge.java
@@ -22,8 +22,9 @@ private final CardUnmaskPrompt mCardUnmaskPrompt; public CardUnmaskBridge(long nativeCardUnmaskPromptViewAndroid, String title, - String instructions, int iconId, boolean shouldRequestExpirationDate, - boolean canStoreLocally, boolean defaultToStoringLocally, WindowAndroid windowAndroid) { + String instructions, String confirmButtonLabel, int iconId, + boolean shouldRequestExpirationDate, boolean canStoreLocally, + boolean defaultToStoringLocally, WindowAndroid windowAndroid) { mNativeCardUnmaskPromptViewAndroid = nativeCardUnmaskPromptViewAndroid; Activity activity = windowAndroid.getActivity().get(); if (activity == null) { @@ -38,17 +39,18 @@ }); } else { mCardUnmaskPrompt = new CardUnmaskPrompt(activity, this, title, instructions, - ResourceId.mapToDrawableId(iconId), shouldRequestExpirationDate, - canStoreLocally, defaultToStoringLocally); + confirmButtonLabel, ResourceId.mapToDrawableId(iconId), + shouldRequestExpirationDate, canStoreLocally, defaultToStoringLocally); } } @CalledByNative private static CardUnmaskBridge create(long nativeUnmaskPrompt, String title, - String instructions, int iconId, boolean shouldRequestExpirationDate, - boolean canStoreLocally, boolean defaultToStoringLocally, WindowAndroid windowAndroid) { - return new CardUnmaskBridge(nativeUnmaskPrompt, title, instructions, iconId, - shouldRequestExpirationDate, canStoreLocally, defaultToStoringLocally, + String instructions, String confirmButtonLabel, int iconId, + boolean shouldRequestExpirationDate, boolean canStoreLocally, + boolean defaultToStoringLocally, WindowAndroid windowAndroid) { + return new CardUnmaskBridge(nativeUnmaskPrompt, title, instructions, confirmButtonLabel, + iconId, shouldRequestExpirationDate, canStoreLocally, defaultToStoringLocally, windowAndroid); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/autofill/CardUnmaskPrompt.java b/chrome/android/java/src/org/chromium/chrome/browser/autofill/CardUnmaskPrompt.java index 975372f..d71aba1 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/autofill/CardUnmaskPrompt.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/autofill/CardUnmaskPrompt.java
@@ -98,8 +98,9 @@ } public CardUnmaskPrompt(Context context, CardUnmaskPromptDelegate delegate, String title, - String instructions, int drawableId, boolean shouldRequestExpirationDate, - boolean canStoreLocally, boolean defaultToStoringLocally) { + String instructions, String confirmButtonLabel, int drawableId, + boolean shouldRequestExpirationDate, boolean canStoreLocally, + boolean defaultToStoringLocally) { mDelegate = delegate; LayoutInflater inflater = LayoutInflater.from(context); @@ -131,7 +132,7 @@ .setTitle(title) .setView(v) .setNegativeButton(R.string.cancel, null) - .setPositiveButton(R.string.autofill_card_unmask_confirm_button, null) + .setPositiveButton(confirmButtonLabel, null) .create(); mDialog.setOnDismissListener(this);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkActionBar.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkActionBar.java index 0dc9828..a0bc2c25 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkActionBar.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkActionBar.java
@@ -19,7 +19,6 @@ import org.chromium.chrome.R; import org.chromium.chrome.browser.bookmarks.BookmarkBridge.BookmarkItem; import org.chromium.chrome.browser.bookmarks.BookmarkBridge.BookmarkModelObserver; -import org.chromium.chrome.browser.offlinepages.OfflinePageUtils; import org.chromium.chrome.browser.widget.NumberRollView; import org.chromium.components.bookmarks.BookmarkId; import org.chromium.components.bookmarks.BookmarkType; @@ -56,18 +55,12 @@ inflateMenu(R.menu.bookmark_action_bar_menu); setOnMenuItemClickListener(this); - getMenu() - .findItem(R.id.search_menu_id) - .setTitle(OfflinePageUtils.getStringId(R.string.bookmark_action_bar_search)); - getMenu() - .findItem(R.id.selection_mode_edit_menu_id) - .setTitle(OfflinePageUtils.getStringId(R.string.edit_bookmark)); - getMenu() - .findItem(R.id.selection_mode_move_menu_id) - .setTitle(OfflinePageUtils.getStringId(R.string.bookmark_action_bar_move)); - getMenu() - .findItem(R.id.selection_mode_delete_menu_id) - .setTitle(OfflinePageUtils.getStringId(R.string.bookmark_action_bar_delete)); + getMenu().findItem(R.id.search_menu_id).setTitle(R.string.bookmark_action_bar_search); + getMenu().findItem(R.id.selection_mode_edit_menu_id).setTitle(R.string.edit_bookmark); + getMenu().findItem(R.id.selection_mode_move_menu_id) + .setTitle(R.string.bookmark_action_bar_move); + getMenu().findItem(R.id.selection_mode_delete_menu_id) + .setTitle(R.string.bookmark_action_bar_delete); } @Override @@ -108,7 +101,7 @@ if (item.isFolder()) { BookmarkAddEditFolderActivity.startEditFolderActivity(getContext(), item.getId()); } else { - BookmarkUtils.startEditActivity(getContext(), item.getId(), null); + BookmarkUtils.startEditActivity(getContext(), item.getId()); } return true; } else if (menuItem.getItemId() == R.id.selection_mode_move_menu_id) { @@ -217,7 +210,7 @@ @Override public void onAllBookmarksStateSet() { - setTitle(getTitleForAllItems()); + setTitle(R.string.bookmark_title_bar_all_items); setNavigationButton(NAVIGATION_BUTTON_MENU); getMenu().findItem(R.id.search_menu_id).setVisible(true); getMenu().findItem(R.id.edit_menu_id).setVisible(false); @@ -234,7 +227,7 @@ if (mDelegate.getModel().getTopLevelFolderParentIDs().contains( mCurrentFolder.getParentId())) { if (TextUtils.isEmpty(mCurrentFolder.getTitle())) { - setTitle(getTitleForAllItems()); + setTitle(R.string.bookmark_title_bar_all_items); } else { setTitle(mCurrentFolder.getTitle()); } @@ -246,14 +239,6 @@ } @Override - public void onFilterStateSet(BookmarkFilter filter) { - assert filter == BookmarkFilter.OFFLINE_PAGES; - setTitle(R.string.bookmark_title_bar_filter_offline_pages); - setNavigationButton(NAVIGATION_BUTTON_MENU); - getMenu().findItem(R.id.edit_menu_id).setVisible(false); - } - - @Override public void onSelectionStateChange(List<BookmarkId> selectedBookmarks) { boolean wasSelectionEnabled = mIsSelectionEnabled; mIsSelectionEnabled = mDelegate.isSelectionEnabled(); @@ -294,8 +279,4 @@ mDelegate.notifyStateChange(this); } } - - private int getTitleForAllItems() { - return OfflinePageUtils.getStringId(R.string.bookmark_title_bar_all_items); - } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkActivity.java index 484c0cf..b3ba425 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkActivity.java
@@ -12,7 +12,6 @@ import org.chromium.chrome.R; import org.chromium.chrome.browser.UrlConstants; -import org.chromium.chrome.browser.offlinepages.OfflinePageUtils; import org.chromium.chrome.browser.snackbar.SnackbarManager; import org.chromium.chrome.browser.snackbar.SnackbarManager.SnackbarManageable; import org.chromium.components.bookmarks.BookmarkId; @@ -40,8 +39,7 @@ mBookmarkManager.updateForUrl(url); setContentView(mBookmarkManager.getView()); - BookmarkUtils.setTaskDescriptionInDocumentMode( - this, getString(OfflinePageUtils.getStringId(R.string.bookmarks))); + BookmarkUtils.setTaskDescriptionInDocumentMode(this, getString(R.string.bookmarks)); // Hack to work around inferred theme false lint error: http://crbug.com/445633 assert (R.layout.bookmark_main_content != 0);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkAddActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkAddActivity.java index 22bc609..f4cb2890 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkAddActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkAddActivity.java
@@ -48,8 +48,7 @@ BookmarkId bookmarkId = BookmarkUtils.addBookmarkSilently( BookmarkAddActivity.this, mModel, title, url); if (bookmarkId != null) { - BookmarkUtils.startEditActivity(BookmarkAddActivity.this, - bookmarkId, null); + BookmarkUtils.startEditActivity(BookmarkAddActivity.this, bookmarkId); } finish(); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkBridge.java index a668b51..a764d04 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkBridge.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkBridge.java
@@ -680,6 +680,11 @@ return nativeIsEditBookmarksEnabled(mNativeBookmarkBridge); } + /** Gets the profile. */ + protected Profile getProfile() { + return mProfile; + } + /** * Notifies the observer that bookmark model has been loaded. */
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkContentView.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkContentView.java index d27f44e..612aed2 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkContentView.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkContentView.java
@@ -12,7 +12,6 @@ import org.chromium.base.ApiCompatibilityUtils; import org.chromium.chrome.R; -import org.chromium.chrome.browser.offlinepages.OfflinePageUtils; import org.chromium.chrome.browser.widget.FadingShadow; import org.chromium.chrome.browser.widget.FadingShadowView; import org.chromium.chrome.browser.widget.LoadingView; @@ -45,7 +44,7 @@ super.onFinishInflate(); mItemsContainer = (BookmarkRecyclerView) findViewById(R.id.bookmark_items_container); TextView emptyView = (TextView) findViewById(R.id.bookmark_empty_view); - emptyView.setText(OfflinePageUtils.getStringId(R.string.bookmarks_folder_empty)); + emptyView.setText(R.string.bookmarks_folder_empty); mItemsContainer.setEmptyView(emptyView); mActionBar = (BookmarkActionBar) findViewById(R.id.bookmark_action_bar); mLoadingView = (LoadingView) findViewById(R.id.bookmark_initial_loading_view); @@ -102,11 +101,6 @@ } @Override - public void onFilterStateSet(BookmarkFilter filter) { - mLoadingView.hideLoadingUI(); - } - - @Override public void onSelectionStateChange(List<BookmarkId> selectedBookmarks) { } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkDelegate.java index 67f1987..19bab5cf 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkDelegate.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkDelegate.java
@@ -49,13 +49,6 @@ void openFolder(BookmarkId folder); /** - * Corresponds to any filter named list item in the side drawer. Shows bookmarks that match - * that filter. - * @param filter A filter that will narrow down a list of bookmarks to show. - */ - void openFilter(BookmarkFilter filter); - - /** * Clear all selected items. After this call, {@link #isSelectionEnabled()} will return false. */ void clearSelection();
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkDrawerListView.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkDrawerListView.java index 933bb14..6abf890 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkDrawerListView.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkDrawerListView.java
@@ -11,10 +11,7 @@ import android.widget.AdapterView; import android.widget.ListView; -import org.chromium.base.metrics.RecordHistogram; import org.chromium.chrome.browser.bookmarks.BookmarkBridge.BookmarkModelObserver; -import org.chromium.chrome.browser.offlinepages.OfflinePageBridge; -import org.chromium.chrome.browser.offlinepages.OfflinePageUtils; import org.chromium.components.bookmarks.BookmarkId; import java.util.List; @@ -49,20 +46,6 @@ BookmarkDrawerListViewAdapter.Item item = (BookmarkDrawerListViewAdapter.Item) mAdapter.getItem(position); - if (OfflinePageBridge.isEnabled()) { - int currentState = mDelegate.getCurrentState(); - boolean isConnected = OfflinePageUtils.isConnected(); - if (item.mType == BookmarkDrawerListViewAdapter.TYPE_FILTER - && currentState != BookmarkUIState.STATE_FILTER) { - RecordHistogram.recordBooleanHistogram( - "OfflinePages.Filter.OnlineWhenEntering", isConnected); - } else if (item.mType != BookmarkDrawerListViewAdapter.TYPE_FILTER - && currentState == BookmarkUIState.STATE_FILTER) { - RecordHistogram.recordBooleanHistogram( - "OfflinePages.Filter.OnlineWhenLeaving", isConnected); - } - } - switch (item.mType) { case BookmarkDrawerListViewAdapter.TYPE_FOLDER: mDelegate.openFolder(item.mFolderId); @@ -70,9 +53,6 @@ case BookmarkDrawerListViewAdapter.TYPE_ALL_ITEMS: mDelegate.openAllBookmarks(); break; - case BookmarkDrawerListViewAdapter.TYPE_FILTER: - mDelegate.openFilter(item.mFilter); - break; default: assert false; } @@ -117,13 +97,6 @@ } @Override - public void onFilterStateSet(BookmarkFilter filter) { - mAdapter.updateList(); - setItemChecked(mAdapter.getItemPosition(BookmarkUIState.STATE_FILTER, filter), - true); - } - - @Override public void onSelectionStateChange(List<BookmarkId> selectedBookmarks) { } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkDrawerListViewAdapter.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkDrawerListViewAdapter.java index 41720f06..995c5460 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkDrawerListViewAdapter.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkDrawerListViewAdapter.java
@@ -11,8 +11,6 @@ import android.widget.TextView; import org.chromium.chrome.R; -import org.chromium.chrome.browser.offlinepages.OfflinePageBridge; -import org.chromium.chrome.browser.offlinepages.OfflinePageUtils; import org.chromium.components.bookmarks.BookmarkId; import java.util.ArrayList; @@ -28,7 +26,6 @@ static final int TYPE_ALL_ITEMS = -1; static final int TYPE_DIVIDER = -2; static final int TYPE_FOLDERS_TITLE = -3; - static final int TYPE_FILTER = -4; static final int VIEW_TYPE_ITEM = 0; static final int VIEW_TYPE_DIVIDER = 1; @@ -52,26 +49,16 @@ static class Item { final int mType; final BookmarkId mFolderId; - final BookmarkFilter mFilter; Item(int itemType) { mType = itemType; mFolderId = null; - mFilter = null; } Item(BookmarkId folderId) { assert folderId != null; mType = TYPE_FOLDER; mFolderId = folderId; - mFilter = null; - } - - Item(BookmarkFilter filter) { - assert filter != null; - mType = TYPE_FILTER; - mFolderId = null; - mFilter = filter; } @Override @@ -81,7 +68,6 @@ int result = 1; result = prime * result + ((mFolderId == null) ? 0 : mFolderId.hashCode()); result = prime * result + mType; - result = prime * result + ((mFilter == null) ? 0 : mFilter.ordinal()); return result; } @@ -99,9 +85,6 @@ if (mType != other.mType) { return false; } - if (mFilter != other.mFilter) { - return false; - } return true; } } @@ -119,9 +102,6 @@ if (mDelegate.getModel().isFolderVisible(mOthersNodeId)) { mTopSection.add(new Item(mOthersNodeId)); } - if (OfflinePageBridge.isEnabled()) { - mTopSection.add(new Item(BookmarkFilter.OFFLINE_PAGES)); - } if (mManagedAndPartnerFolderIds != null) { for (BookmarkId id : mManagedAndPartnerFolderIds) { @@ -224,9 +204,6 @@ topFolderId = parentId; } return positionOfBookmarkId(topFolderId); - } else if (state == BookmarkUIState.STATE_FILTER) { - BookmarkFilter filter = (BookmarkFilter) modeDetail; - return positionOfItem(new Item(filter)); } return -1; @@ -328,7 +305,7 @@ switch (item.mType) { case TYPE_ALL_ITEMS: title = listItemView.getContext().getResources().getString( - OfflinePageUtils.getStringId(R.string.bookmark_drawer_all_items)); + R.string.bookmark_drawer_all_items); iconDrawableId = R.drawable.btn_star; break; case TYPE_FOLDER: @@ -344,12 +321,6 @@ iconDrawableId = 0; } break; - case TYPE_FILTER: - assert item.mFilter == BookmarkFilter.OFFLINE_PAGES; - title = listItemView.getContext().getResources().getString( - R.string.bookmark_drawer_filter_offline_pages); - iconDrawableId = R.drawable.bookmark_filter_offline_pages; - break; default: title = ""; iconDrawableId = 0;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkEditActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkEditActivity.java index b84119b..c8dac7c 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkEditActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkEditActivity.java
@@ -7,34 +7,19 @@ import android.content.Intent; import android.os.Bundle; import android.support.v7.widget.Toolbar; -import android.text.format.Formatter; import android.view.Menu; import android.view.MenuItem; import android.view.View; -import android.widget.Button; import android.widget.TextView; import org.chromium.base.Log; -import org.chromium.base.metrics.RecordHistogram; -import org.chromium.base.metrics.RecordUserAction; import org.chromium.chrome.R; import org.chromium.chrome.browser.bookmarks.BookmarkBridge.BookmarkItem; import org.chromium.chrome.browser.bookmarks.BookmarkBridge.BookmarkModelObserver; -import org.chromium.chrome.browser.offlinepages.ClientId; -import org.chromium.chrome.browser.offlinepages.OfflinePageBridge; -import org.chromium.chrome.browser.offlinepages.OfflinePageBridge.DeletePageCallback; -import org.chromium.chrome.browser.offlinepages.OfflinePageBridge.OfflinePageModelObserver; -import org.chromium.chrome.browser.offlinepages.OfflinePageBridge.SavePageCallback; -import org.chromium.chrome.browser.offlinepages.OfflinePageItem; -import org.chromium.chrome.browser.offlinepages.OfflinePageUtils; import org.chromium.chrome.browser.util.UrlUtilities; import org.chromium.chrome.browser.widget.EmptyAlertEditText; import org.chromium.chrome.browser.widget.TintedDrawable; import org.chromium.components.bookmarks.BookmarkId; -import org.chromium.content_public.browser.WebContents; -import org.chromium.net.NetworkChangeNotifier; - -import java.util.List; /** * The activity that enables the user to modify the title, url and parent folder of a bookmark. @@ -42,32 +27,17 @@ public class BookmarkEditActivity extends BookmarkActivityBase { /** The intent extra specifying the ID of the bookmark to be edited. */ public static final String INTENT_BOOKMARK_ID = "BookmarkEditActivity.BookmarkId"; - public static final String INTENT_WEB_CONTENTS = "BookmarkEditActivity.WebContents"; private static final String TAG = "BookmarkEdit"; - private enum OfflineButtonType { - NONE, - SAVE, - REMOVE, - VISIT, - } - private BookmarkModel mModel; - private OfflinePageBridge mOfflinePageBridge; private BookmarkId mBookmarkId; private EmptyAlertEditText mTitleEditText; private EmptyAlertEditText mUrlEditText; private TextView mFolderTextView; - private WebContents mWebContents; - private MenuItem mDeleteButton; - private NetworkChangeNotifier.ConnectionTypeObserver mConnectionObserver; - private OfflineButtonType mOfflineButtonType = OfflineButtonType.NONE; - private OfflinePageModelObserver mOfflinePageModelObserver; - private BookmarkModelObserver mBookmarkModelObserver = new BookmarkModelObserver() { @Override public void bookmarkModelChanged() { @@ -85,11 +55,7 @@ protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - int title = OfflinePageUtils.getStringId(R.string.edit_bookmark); - setTitle(title); - BookmarkUtils.setTaskDescriptionInDocumentMode(this, getString(title)); mModel = new BookmarkModel(); - mOfflinePageBridge = mModel.getOfflinePageBridge(); mBookmarkId = BookmarkId.getBookmarkIdFromString( getIntent().getStringExtra(INTENT_BOOKMARK_ID)); mModel.addObserver(mBookmarkModelObserver); @@ -112,34 +78,6 @@ } }); - if (mOfflinePageBridge != null && OfflinePageBridge.canSavePage( - mModel.getBookmarkById(mBookmarkId).getUrl())) { - mConnectionObserver = new NetworkChangeNotifier.ConnectionTypeObserver() { - public void onConnectionTypeChanged(int connectionType) { - updateOfflineSection(); - } - }; - NetworkChangeNotifier.init(this); - NetworkChangeNotifier.getInstance().addConnectionTypeObserver(mConnectionObserver); - - mOfflinePageModelObserver = new OfflinePageModelObserver() { - @Override - public void offlinePageDeleted(long offlineId, ClientId clientId) { - BookmarkId bookmarkId = BookmarkModel.getBookmarkIdForOfflineClientId(clientId); - if (mBookmarkId.equals(bookmarkId)) { - updateOfflineSection(); - } - } - }; - - mOfflinePageBridge.addObserver(mOfflinePageModelObserver); - // Make offline page section visible and find controls. - findViewById(R.id.offline_page_group).setVisibility(View.VISIBLE); - getIntent().setExtrasClassLoader(WebContents.class.getClassLoader()); - mWebContents = getIntent().getParcelableExtra(INTENT_WEB_CONTENTS); - updateOfflineSection(); - } - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); @@ -205,22 +143,6 @@ && mModel.getBookmarkById(mBookmarkId).isUrlEditable()) { String fixedUrl = UrlUtilities.fixupUrl(url); if (fixedUrl != null && !fixedUrl.equals(originalUrl)) { - ClientId clientId = ClientId.createClientIdForBookmarkId(mBookmarkId); - if (mOfflinePageBridge != null) { - mOfflinePageBridge.getPagesByClientId( - clientId, new OfflinePageBridge.MultipleOfflinePageItemCallback() { - @Override - public void onResult(List<OfflinePageItem> items) { - // Bookmarks ensures only one item will be present per - // client ID. - assert items.size() <= 1; - - recordUrlChangeHistogram(!items.isEmpty()); - } - }); - } else { - recordUrlChangeHistogram(false); - } mModel.setBookmarkUrl(mBookmarkId, fixedUrl); } } @@ -229,144 +151,14 @@ super.onStop(); } - private void recordUrlChangeHistogram(boolean hasOfflinePage) { - RecordHistogram.recordBooleanHistogram( - "OfflinePages.Edit.BookmarkUrlChangedForOfflinePage", hasOfflinePage); - } - @Override protected void onDestroy() { - recordOfflineButtonAction(false); - if (mOfflinePageBridge != null) { - mOfflinePageBridge.removeObserver(mOfflinePageModelObserver); - mOfflinePageBridge = null; - } - - if (mConnectionObserver != null) { - NetworkChangeNotifier.getInstance().removeConnectionTypeObserver(mConnectionObserver); - } - mModel.removeObserver(mBookmarkModelObserver); mModel.destroy(); mModel = null; super.onDestroy(); } - private void updateOfflineSection() { - assert mOfflinePageBridge != null; - - // It is possible that callback arrives after the activity was dismissed. - // See http://crbug.com/566939 - if (mModel == null) return; - - mOfflinePageBridge.checkOfflinePageMetadata(); - - ClientId clientId = ClientId.createClientIdForBookmarkId(mBookmarkId); - mOfflinePageBridge.getPagesByClientId( - clientId, new OfflinePageBridge.MultipleOfflinePageItemCallback() { - @Override - public void onResult(List<OfflinePageItem> items) { - offlineItemsRetrieved(items); - } - }); - } - - private void offlineItemsRetrieved(List<OfflinePageItem> items) { - // It is possible that callback arrives after the activity was dismissed. - // See http://crbug.com/566939 - if (mModel == null || mOfflinePageBridge == null) return; - - Button saveRemoveVisitButton = (Button) findViewById(R.id.offline_page_save_remove_button); - TextView offlinePageInfoTextView = (TextView) findViewById(R.id.offline_page_info_text); - - // Bookmarks should enforce that only one item exists per client ID. - OfflinePageItem offlinePage = null; - if (items.size() > 0) offlinePage = items.get(0); - - if (offlinePage != null) { - // Offline page exists. Show information and button to remove. - offlinePageInfoTextView.setText( - getString(OfflinePageUtils.getStringId( - R.string.offline_pages_as_bookmarks_offline_page_size), - Formatter.formatFileSize(this, offlinePage.getFileSize()))); - updateButtonToDeleteOfflinePage(saveRemoveVisitButton); - saveRemoveVisitButton.setVisibility(View.VISIBLE); - } else if (mWebContents != null && !mWebContents.isDestroyed() && mOfflinePageBridge != null - && mOfflinePageBridge.canSavePage(mWebContents.getLastCommittedUrl())) { - // Offline page is not saved, but a bookmarked page is opened. Show save button. - offlinePageInfoTextView.setText( - getString(OfflinePageUtils.getStringId(R.string.bookmark_offline_page_none))); - updateButtonToSaveOfflinePage(saveRemoveVisitButton); - saveRemoveVisitButton.setVisibility(View.VISIBLE); - } else { - // Offline page is not saved, and edit page was opened from the bookmarks UI, which - // means there is no action the user can take any action - hide button. - offlinePageInfoTextView.setText(getString(OfflinePageUtils.getStringId( - R.string.offline_pages_as_bookmarks_offline_page_visit))); - updateButtonToVisitOfflinePage(saveRemoveVisitButton); - if (NetworkChangeNotifier.isOnline()) { - saveRemoveVisitButton.setVisibility(View.VISIBLE); - } else { - saveRemoveVisitButton.setVisibility(View.GONE); - } - } - saveRemoveVisitButton.setEnabled(true); - } - - private void updateButtonToDeleteOfflinePage(final Button button) { - mOfflineButtonType = OfflineButtonType.REMOVE; - button.setText(getString(R.string.remove)); - button.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - recordOfflineButtonAction(true); - button.setEnabled(false); - ClientId clientId = ClientId.createClientIdForBookmarkId(mBookmarkId); - mOfflinePageBridge.deletePage(clientId, new DeletePageCallback() { - @Override - public void onDeletePageDone(int deletePageResult) { - // TODO(fgorski): Add snackbar upon failure. - // Always update UI, as buttons might be disabled. - updateOfflineSection(); - } - }); - } - }); - } - - private void updateButtonToSaveOfflinePage(final Button button) { - mOfflineButtonType = OfflineButtonType.SAVE; - button.setText(getString(R.string.save)); - button.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - recordOfflineButtonAction(true); - ClientId clientId = ClientId.createClientIdForBookmarkId(mBookmarkId); - button.setEnabled(false); - mOfflinePageBridge.savePage(mWebContents, clientId, new SavePageCallback() { - @Override - public void onSavePageDone(int savePageResult, String url, long offlineId) { - // TODO(fgorski): Add snackbar upon failure. - // Always update UI, as buttons might be disabled. - updateOfflineSection(); - } - }); - } - }); - } - - private void updateButtonToVisitOfflinePage(Button button) { - mOfflineButtonType = OfflineButtonType.VISIT; - button.setText(getString(R.string.bookmark_btn_offline_page_visit)); - button.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - recordOfflineButtonAction(true); - openBookmark(); - } - }); - } - private void openBookmark() { // TODO(kkimlabs): Refactor this out to handle the intent in ChromeActivity. // If this activity was started via startActivityForResult(), set the result. Otherwise, @@ -381,36 +173,4 @@ } finish(); } - - private void recordOfflineButtonAction(boolean clicked) { - // If button type is not set, it means that either offline section is not shown or we have - // already recorded the click action. - if (mOfflineButtonType == OfflineButtonType.NONE) { - return; - } - - assert mOfflineButtonType == OfflineButtonType.SAVE - || mOfflineButtonType == OfflineButtonType.REMOVE - || mOfflineButtonType == OfflineButtonType.VISIT; - - if (clicked) { - if (mOfflineButtonType == OfflineButtonType.SAVE) { - RecordUserAction.record("OfflinePages.Edit.SaveButtonClicked"); - } else if (mOfflineButtonType == OfflineButtonType.REMOVE) { - RecordUserAction.record("OfflinePages.Edit.RemoveButtonClicked"); - } else if (mOfflineButtonType == OfflineButtonType.VISIT) { - RecordUserAction.record("OfflinePages.Edit.VisitButtonClicked"); - } - } else { - if (mOfflineButtonType == OfflineButtonType.SAVE) { - RecordUserAction.record("OfflinePages.Edit.SaveButtonNotClicked"); - } else if (mOfflineButtonType == OfflineButtonType.REMOVE) { - RecordUserAction.record("OfflinePages.Edit.RemoveButtonNotClicked"); - } else if (mOfflineButtonType == OfflineButtonType.VISIT) { - RecordUserAction.record("OfflinePages.Edit.VisitButtonNotClicked"); - } - } - - mOfflineButtonType = OfflineButtonType.NONE; - } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkFilter.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkFilter.java deleted file mode 100644 index f89a921..0000000 --- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkFilter.java +++ /dev/null
@@ -1,23 +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. - -package org.chromium.chrome.browser.bookmarks; - -/** - * Possible filters for the bookmarks. - */ -enum BookmarkFilter { - OFFLINE_PAGES("OFFLINE_PAGES"); - - /** - * An {@link BookmarkFilter} can be persisted in URLs. To ensure the - * URLs are consistent, values should remain the same even after the enums - * are renamed. - */ - public final String value; - - private BookmarkFilter(String value) { - this.value = value; - } -}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkItemRow.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkItemRow.java index a837258..4436b00 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkItemRow.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkItemRow.java
@@ -9,24 +9,15 @@ import android.graphics.drawable.BitmapDrawable; import android.support.v4.graphics.drawable.RoundedBitmapDrawable; import android.support.v4.graphics.drawable.RoundedBitmapDrawableFactory; -import android.text.format.Formatter; import android.util.AttributeSet; -import android.view.View; -import android.widget.TextView; import org.chromium.base.ApiCompatibilityUtils; -import org.chromium.base.Callback; import org.chromium.chrome.R; import org.chromium.chrome.browser.bookmarks.BookmarkBridge.BookmarkItem; import org.chromium.chrome.browser.favicon.LargeIconBridge.LargeIconCallback; -import org.chromium.chrome.browser.offlinepages.ClientId; -import org.chromium.chrome.browser.offlinepages.OfflinePageBridge; -import org.chromium.chrome.browser.offlinepages.OfflinePageItem; import org.chromium.chrome.browser.widget.RoundedIconGenerator; import org.chromium.components.bookmarks.BookmarkId; -import java.util.List; - /** * A row view that shows bookmark info in the bookmarks UI. */ @@ -65,9 +56,6 @@ case BookmarkUIState.STATE_FOLDER: launchLocation = BookmarkLaunchLocation.FOLDER; break; - case BookmarkUIState.STATE_FILTER: - launchLocation = BookmarkLaunchLocation.FILTER; - break; case BookmarkUIState.STATE_LOADING: assert false : "The main content shouldn't be inflated if it's still loading"; @@ -86,67 +74,9 @@ mIconImageView.setImageDrawable(null); mTitleView.setText(item.getTitle()); mDelegate.getLargeIconBridge().getLargeIconForUrl(mUrl, mMinIconSize, this); - - updateOfflineSectionForBookmark(bookmarkId); - return item; } - private void updateOfflineSectionForBookmark(BookmarkId bookmarkId) { - boolean hasOfflineSection = mDelegate.getCurrentState() == BookmarkUIState.STATE_FILTER; - updateOfflinePageSizeTextVisibility(hasOfflineSection); - if (hasOfflineSection) { - getOfflinePageItemForBookmark(bookmarkId, new Callback<OfflinePageItem>() { - @Override - public void onResult(OfflinePageItem offlinePage) { - if (offlinePage == null) { - updateOfflinePageSizeTextVisibility(false); - return; - } - updateOfflinePageSizeText(offlinePage.getFileSize()); - } - }); - } - } - - private void getOfflinePageItemForBookmark( - BookmarkId bookmarkId, final Callback<OfflinePageItem> callback) { - OfflinePageBridge bridge = mDelegate.getModel().getOfflinePageBridge(); - if (bridge == null) return; - - bridge.getPagesByClientId(ClientId.createClientIdForBookmarkId(bookmarkId), - new OfflinePageBridge.MultipleOfflinePageItemCallback() { - @Override - public void onResult(List<OfflinePageItem> items) { - // Offline pages generated by bookmarking a page will have a one-to-one - // mapping from Client ID to Bookmark ID. - assert items.size() <= 1; - - callback.onResult(items.isEmpty() ? null : items.get(0)); - } - }); - } - - private void updateOfflinePageSizeTextVisibility(boolean visible) { - TextView textView = (TextView) findViewById(R.id.offline_page_size); - textView.setVisibility(visible ? View.VISIBLE : View.GONE); - View bookmarkRowView = findViewById(R.id.bookmark_row); - if (visible) { - int verticalPadding = textView.getResources().getDimensionPixelSize( - R.dimen.offline_page_item_vertical_spacing); - // Get the embedded bookmark_row layout, and add padding. This is because the entries - // in filter view are larger (contain more items) than normal bookmark view. - bookmarkRowView.setPadding(0, verticalPadding / 2, 0, verticalPadding / 2); - } else { - bookmarkRowView.setPadding(0, 0, 0, 0); - } - } - - private void updateOfflinePageSizeText(long size) { - TextView textView = (TextView) findViewById(R.id.offline_page_size); - textView.setText(Formatter.formatFileSize(getContext(), size)); - } - // LargeIconCallback implementation. @Override
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkItemsAdapter.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkItemsAdapter.java index df7671e3..7edde5f9 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkItemsAdapter.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkItemsAdapter.java
@@ -11,20 +11,12 @@ import android.view.View; import android.view.ViewGroup; -import org.chromium.base.Callback; import org.chromium.base.annotations.SuppressFBWarnings; import org.chromium.base.metrics.RecordHistogram; import org.chromium.chrome.R; import org.chromium.chrome.browser.bookmarks.BookmarkBridge.BookmarkItem; import org.chromium.chrome.browser.bookmarks.BookmarkBridge.BookmarkModelObserver; import org.chromium.chrome.browser.bookmarks.BookmarkPromoHeader.PromoHeaderShowingChangeListener; -import org.chromium.chrome.browser.offlinepages.ClientId; -import org.chromium.chrome.browser.offlinepages.OfflinePageBridge; -import org.chromium.chrome.browser.offlinepages.OfflinePageBridge.OfflinePageModelObserver; -import org.chromium.chrome.browser.offlinepages.OfflinePageFreeUpSpaceCallback; -import org.chromium.chrome.browser.offlinepages.OfflinePageFreeUpSpaceDialog; -import org.chromium.chrome.browser.offlinepages.OfflinePageStorageSpaceHeader; -import org.chromium.chrome.browser.offlinepages.OfflinePageStorageSpacePolicy; import org.chromium.components.bookmarks.BookmarkId; import java.util.ArrayList; @@ -39,17 +31,13 @@ private static final int FOLDER_VIEW = 1; private static final int DIVIDER_VIEW = 2; private static final int BOOKMARK_VIEW = 3; - private static final int OFFLINE_PAGES_STORAGE_VIEW = 4; private BookmarkDelegate mDelegate; private Context mContext; private BookmarkPromoHeader mPromoHeaderManager; - private OfflinePageStorageSpaceHeader mOfflineStorageHeader; - private OfflinePageBridge mOfflinePageBridge; private List<List<? extends Object>> mSections; private List<Object> mPromoHeaderSection = new ArrayList<>(); - private List<Object> mOfflineStorageSection = new ArrayList<>(); private List<Object> mFolderDividerSection = new ArrayList<>(); private List<BookmarkId> mFolderSection = new ArrayList<>(); private List<Object> mBookmarkDividerSection = new ArrayList<>(); @@ -84,14 +72,11 @@ } }; - private OfflinePageModelObserver mOfflinePageModelObserver; - BookmarkItemsAdapter(Context context) { mContext = context; mSections = new ArrayList<>(); mSections.add(mPromoHeaderSection); - mSections.add(mOfflineStorageSection); mSections.add(mFolderDividerSection); mSections.add(mFolderSection); mSections.add(mBookmarkDividerSection); @@ -161,8 +146,7 @@ mFolderDividerSection.clear(); mBookmarkDividerSection.clear(); - boolean isHeaderPresent = - !mPromoHeaderSection.isEmpty() || !mOfflineStorageSection.isEmpty(); + boolean isHeaderPresent = !mPromoHeaderSection.isEmpty(); if (isHeaderPresent && !mFolderSection.isEmpty()) { mFolderDividerSection.add(null); @@ -196,8 +180,6 @@ if (section == mPromoHeaderSection) { return PROMO_HEADER_VIEW; - } else if (section == mOfflineStorageSection) { - return OFFLINE_PAGES_STORAGE_VIEW; } else if (section == mFolderDividerSection || section == mBookmarkDividerSection) { return DIVIDER_VIEW; @@ -218,8 +200,6 @@ switch (viewType) { case PROMO_HEADER_VIEW: return mPromoHeaderManager.createHolder(parent); - case OFFLINE_PAGES_STORAGE_VIEW: - return mOfflineStorageHeader.createHolder(parent); case DIVIDER_VIEW: return new ViewHolder(LayoutInflater.from(parent.getContext()).inflate( R.layout.bookmark_divider, parent, false)) {}; @@ -246,7 +226,6 @@ switch (getItemViewType(position)) { case PROMO_HEADER_VIEW: - case OFFLINE_PAGES_STORAGE_VIEW: case DIVIDER_VIEW: break; case FOLDER_VIEW: @@ -283,35 +262,6 @@ mDelegate.addUIObserver(this); mDelegate.getModel().addObserver(mBookmarkModelObserver); mPromoHeaderManager = new BookmarkPromoHeader(mContext, this); - mOfflinePageBridge = mDelegate.getModel().getOfflinePageBridge(); - if (mOfflinePageBridge != null) { - mOfflinePageModelObserver = new OfflinePageModelObserver() { - @Override - public void offlinePageModelChanged() { - mDelegate.notifyStateChange(BookmarkItemsAdapter.this); - } - - @Override - public void offlinePageDeleted(long offlineId, ClientId clientId) { - if (mDelegate.getCurrentState() == BookmarkUIState.STATE_FILTER) { - BookmarkId id = BookmarkModel.getBookmarkIdForOfflineClientId(clientId); - int deletedPosition = getPositionForBookmark(id); - if (deletedPosition >= 0) { - removeItem(deletedPosition); - } - } - } - }; - mOfflinePageBridge.addObserver(mOfflinePageModelObserver); - - OfflinePageStorageSpacePolicy.create( - mOfflinePageBridge, new Callback<OfflinePageStorageSpacePolicy>() { - @Override - public void onResult(OfflinePageStorageSpacePolicy policy) { - setOfflineStorageHeader(policy); - } - }); - } } @Override @@ -321,15 +271,6 @@ mDelegate = null; mPromoHeaderManager.destroy(); - - if (mOfflinePageBridge != null) { - mOfflinePageBridge.removeObserver(mOfflinePageModelObserver); - mOfflinePageBridge = null; - } - - if (mOfflineStorageHeader != null) { - mOfflineStorageHeader.destroy(); - } } @Override @@ -350,28 +291,6 @@ } @Override - public void onFilterStateSet(BookmarkFilter filter) { - assert filter == BookmarkFilter.OFFLINE_PAGES; - assert mDelegate != null; - assert mOfflinePageBridge != null; - - setBookmarks(null, new ArrayList<BookmarkId>()); - mOfflinePageBridge.checkOfflinePageMetadata(); - BookmarkModel bookmarkModel = mDelegate.getModel(); - bookmarkModel.getBookmarkIDsByFilter( - BookmarkFilter.OFFLINE_PAGES, new Callback<List<BookmarkId>>() { - @Override - public void onResult(List<BookmarkId> bookmarkIds) { - if (mDelegate == null) return; - RecordHistogram.recordCountHistogram( - "OfflinePages.OfflinePageCount", bookmarkIds.size()); - - setBookmarks(null, bookmarkIds); - } - }); - } - - @Override public void onSelectionStateChange(List<BookmarkId> selectedBookmarks) {} private static class ItemViewHolder extends RecyclerView.ViewHolder { @@ -380,31 +299,6 @@ } } - private void setOfflineStorageHeader(OfflinePageStorageSpacePolicy policy) { - if (mOfflinePageBridge == null) return; - - mOfflineStorageHeader = new OfflinePageStorageSpaceHeader( - mContext, mOfflinePageBridge, policy, new OfflinePageFreeUpSpaceCallback() { - @Override - public void onFreeUpSpaceDone() { - if (mDelegate == null) return; - - refreshOfflinePagesFilterView(); - mDelegate.getSnackbarManager().showSnackbar( - OfflinePageFreeUpSpaceDialog.createStorageClearedSnackbar( - mContext)); - } - - @Override - public void onFreeUpSpaceCancelled() { - // No need to refresh, as result outcome should - // be the same here. - } - }); - - updateHeader(); - } - private void updateHeader() { if (mDelegate == null) return; @@ -412,33 +306,10 @@ if (currentUIState == BookmarkUIState.STATE_LOADING) return; mPromoHeaderSection.clear(); - mOfflineStorageSection.clear(); - if (currentUIState == BookmarkUIState.STATE_FILTER) { - if (mOfflineStorageHeader != null && mOfflineStorageHeader.shouldShow()) { - mOfflineStorageSection.add(null); - } - } else { - assert currentUIState == BookmarkUIState.STATE_ALL_BOOKMARKS - || currentUIState == BookmarkUIState.STATE_FOLDER - : "Unexpected UI state"; - if (mPromoHeaderManager.shouldShow()) { - mPromoHeaderSection.add(null); - } + assert currentUIState == BookmarkUIState.STATE_ALL_BOOKMARKS + || currentUIState == BookmarkUIState.STATE_FOLDER : "Unexpected UI state"; + if (mPromoHeaderManager.shouldShow()) { + mPromoHeaderSection.add(null); } } - - private void refreshOfflinePagesFilterView() { - if (mDelegate == null || mDelegate.getCurrentState() != BookmarkUIState.STATE_FILTER) { - return; - } - setBookmarks(null, new ArrayList<BookmarkId>()); - mDelegate.getModel().getBookmarkIDsByFilter( - BookmarkFilter.OFFLINE_PAGES, new Callback<List<BookmarkId>>() { - @Override - public void onResult(List<BookmarkId> bookmarkIds) { - if (mDelegate == null) return; - setBookmarks(null, bookmarkIds); - } - }); - } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkManager.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkManager.java index d4ed5a7f..b53aedd 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkManager.java
@@ -269,9 +269,7 @@ if (state.mState != BookmarkUIState.STATE_LOADING) { // Loading state may be pushed to the stack but should never be stored in preferences. - if (state.mShouldPersist) { - BookmarkUtils.setLastUsedUrl(mActivity, state.mUrl); - } + BookmarkUtils.setLastUsedUrl(mActivity, state.mUrl); // If a loading state is replaced by another loading state, do not notify this change. if (mUrlChangeListener != null) { mUrlChangeListener.onBookmarkUIStateChange(state.mUrl); @@ -305,11 +303,6 @@ } @Override - public void openFilter(BookmarkFilter filter) { - setState(BookmarkUIState.createFilterState(filter, mBookmarkModel)); - } - - @Override public void clearSelection() { mSelectedBookmarks.clear(); for (BookmarkUIObserver observer : mUIObservers) { @@ -360,9 +353,6 @@ // UIObservers, which means that there will be no observers at the time. Do nothing. assert mUIObservers.isEmpty(); break; - case BookmarkUIState.STATE_FILTER: - observer.onFilterStateSet(mStateStack.peek().mFilter); - break; default: assert false : "State not valid"; break;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkModel.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkModel.java index dc6ca0f..5d6783e 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkModel.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkModel.java
@@ -4,26 +4,12 @@ package org.chromium.chrome.browser.bookmarks; -import org.chromium.base.Callback; import org.chromium.base.ObserverList; import org.chromium.base.VisibleForTesting; -import org.chromium.base.metrics.RecordHistogram; -import org.chromium.chrome.browser.offlinepages.ClientId; -import org.chromium.chrome.browser.offlinepages.OfflinePageBridge; -import org.chromium.chrome.browser.offlinepages.OfflinePageBridge.OfflinePageModelObserver; -import org.chromium.chrome.browser.offlinepages.OfflinePageBridge.SavePageCallback; -import org.chromium.chrome.browser.offlinepages.OfflinePageItem; import org.chromium.chrome.browser.profiles.Profile; import org.chromium.components.bookmarks.BookmarkId; import org.chromium.components.bookmarks.BookmarkType; -import org.chromium.components.dom_distiller.core.DomDistillerUrlUtils; -import org.chromium.components.offlinepages.SavePageResult; -import org.chromium.content_public.browser.WebContents; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.HashSet; import java.util.List; /** @@ -35,22 +21,6 @@ private static final int FAVICON_MAX_CACHE_SIZE = 10 * 1024 * 1024; // 10MB /** - * Callback for use with addBookmarkAsync / saveOfflinePage. - */ - public interface AddBookmarkCallback { - static final int SAVED = 0; - static final int SKIPPED = 1; - static final int ERROR = 2; - - /** - * Called when the bookmark has been added. - * @param bookmarkId ID of the bookmark that has been added. - * @param result of saving an offline copy of the bookmarked page. - */ - void onBookmarkAdded(BookmarkId bookmarkId, int saveResult); - } - - /** * Observer that listens to delete event. This interface is used by undo controllers to know * which bookmarks were deleted. Note this observer only listens to events that go through * bookmark model. @@ -65,25 +35,7 @@ void onDeleteBookmarks(String[] titles, boolean isUndoable); } - /** A comparator to sort the offline pages according to the most recent access time. */ - private static final Comparator<OfflinePageItem> sOfflinePageComparator = - new Comparator<OfflinePageItem>() { - @Override - public int compare(OfflinePageItem o1, OfflinePageItem o2) { - if (o1.getLastAccessTimeMs() > o2.getLastAccessTimeMs()) { - return -1; - } else if (o1.getLastAccessTimeMs() < o2.getLastAccessTimeMs()) { - return 1; - } else { - return 0; - } - } - }; - private ObserverList<BookmarkDeleteObserver> mDeleteObservers = new ObserverList<>(); - private OfflinePageBridge mOfflinePageBridge; - private boolean mIsOfflinePageModelLoaded; - private OfflinePageModelObserver mOfflinePageModelObserver; /** * Initialize bookmark model for last used non-incognito profile. @@ -95,27 +47,6 @@ @VisibleForTesting public BookmarkModel(Profile profile) { super(profile); - - // Note: we check if mOfflinePageBridge is null after this to determine if offline pages - // feature is enabled. When it is enabled by default, we should check all the places - // that checks for nullability of mOfflinePageBridge. - if (OfflinePageBridge.isEnabled()) { - mOfflinePageBridge = OfflinePageBridge.getForProfile(profile); - if (mOfflinePageBridge.isOfflinePageModelLoaded()) { - mIsOfflinePageModelLoaded = true; - } else { - mOfflinePageModelObserver = new OfflinePageModelObserver() { - @Override - public void offlinePageModelLoaded() { - mIsOfflinePageModelLoaded = true; - if (isBookmarkModelLoaded()) { - notifyBookmarkModelLoaded(); - } - } - }; - mOfflinePageBridge.addObserver(mOfflinePageModelObserver); - } - } } /** @@ -123,18 +54,12 @@ */ @Override public void destroy() { - if (mOfflinePageBridge != null) { - mOfflinePageBridge.removeObserver(mOfflinePageModelObserver); - mOfflinePageBridge = null; - } - super.destroy(); } @Override public boolean isBookmarkModelLoaded() { - return super.isBookmarkModelLoaded() - && (mOfflinePageBridge == null || mIsOfflinePageModelLoaded); + return super.isBookmarkModelLoaded(); } /** @@ -198,67 +123,6 @@ } /** - * Add a new bookmark asynchronously. - * - * @param parent Folder where to add. - * @param index The position where the bookmark will be placed in parent folder - * @param title Title of the new bookmark. - * @param url Url of the new bookmark - * @param webContents A {@link WebContents} object for saving the offline copy. If null, the - * saving should be skipped. - * @param callback The callback to be invoked when the bookmark is added. - */ - public void addBookmarkAsync(BookmarkId parent, int index, String title, String url, - WebContents webContents, final AddBookmarkCallback callback) { - url = DomDistillerUrlUtils.getOriginalUrlFromDistillerUrl(url); - final BookmarkId bookmarkId = addBookmark(parent, index, title, url); - - // If bookmark was not created return an error. - if (bookmarkId == null) { - callback.onBookmarkAdded(null, AddBookmarkCallback.ERROR); - return; - } - - // If there is no need to save offline page, return now. - if (mOfflinePageBridge == null || webContents == null) { - callback.onBookmarkAdded(bookmarkId, AddBookmarkCallback.SKIPPED); - return; - } - - saveOfflinePage(bookmarkId, webContents, callback); - } - - /** - * Save an offline copy for the bookmarked page asynchronously. - * - * @param bookmarkId The ID of the page to save an offline copy. - * @param webContents A {@link WebContents} object. - * @param callback The callback to be invoked when the offline copy is saved. - */ - public void saveOfflinePage(final BookmarkId bookmarkId, WebContents webContents, - final AddBookmarkCallback callback) { - if (mOfflinePageBridge != null) { - RecordHistogram.recordBooleanHistogram("OfflinePages.IncognitoSave", - webContents.isIncognito()); - ClientId clientId = ClientId.createClientIdForBookmarkId(bookmarkId); - mOfflinePageBridge.savePage(webContents, clientId, new SavePageCallback() { - @Override - public void onSavePageDone(int savePageResult, String url, long offlineId) { - int saveResult; - if (savePageResult == SavePageResult.SUCCESS) { - saveResult = AddBookmarkCallback.SAVED; - } else if (savePageResult == SavePageResult.SKIPPED) { - saveResult = AddBookmarkCallback.SKIPPED; - } else { - saveResult = AddBookmarkCallback.ERROR; - } - callback.onBookmarkAdded(bookmarkId, saveResult); - } - }); - } - } - - /** * @see org.chromium.chrome.browser.bookmarks.BookmarkBridge.BookmarkItem#getTitle() */ public String getBookmarkTitle(BookmarkId bookmarkId) { @@ -266,79 +130,9 @@ } /** - * Retrieves the url to launch a bookmark or saved page. If latter, also marks it as being - * accessed and reports the UMAs. - * - * @param bookmarkId ID of the bookmark to launch. - * @return The launch URL. - */ - public String getLaunchUrlAndMarkAccessed(BookmarkId bookmarkId) { - String url = getBookmarkById(bookmarkId).getUrl(); - if (mOfflinePageBridge == null) return url; - - return mOfflinePageBridge.getLaunchUrlFromOnlineUrl(url); - } - - /** * @return The id of the default folder to add bookmarks/folders to. */ public BookmarkId getDefaultFolder() { return getMobileFolderId(); } - - /** - * Gets a list of bookmark IDs for all offline pages. - * - * @return A list of bookmark IDs of bookmarks matching the offline pages filter. - */ - public void getBookmarkIDsByFilter( - BookmarkFilter filter, final Callback<List<BookmarkId>> callback) { - assert filter == BookmarkFilter.OFFLINE_PAGES; - assert mOfflinePageBridge != null; - - mOfflinePageBridge.getAllPages(new OfflinePageBridge.MultipleOfflinePageItemCallback() { - @Override - public void onResult(List<OfflinePageItem> offlinePages) { - callback.onResult(filterBookmarkIdsByOfflinePages(offlinePages)); - } - }); - } - - /** - * Gets all bookmarks that correspond to the given list of offline pages, in MRU order. - * @see http://crbug.com/537806 - */ - private List<BookmarkId> filterBookmarkIdsByOfflinePages(List<OfflinePageItem> offlinePages) { - Collections.sort(offlinePages, sOfflinePageComparator); - - HashSet<BookmarkId> existingBookmarks = - new HashSet<>(getAllBookmarkIDsOrderedByCreationDate()); - - List<BookmarkId> bookmarkIds = new ArrayList<>(); - for (OfflinePageItem offlinePage : offlinePages) { - BookmarkId bookmarkId = getBookmarkIdForOfflineClientId(offlinePage.getClientId()); - if (existingBookmarks.contains(bookmarkId)) { - bookmarkIds.add(bookmarkId); - } - } - return bookmarkIds; - } - - /** - * @return Offline page bridge. - */ - public OfflinePageBridge getOfflinePageBridge() { - return mOfflinePageBridge; - } - - /** - * @param id The client id to convert. - * @return The bookmark id contained in the specified client id. - */ - public static BookmarkId getBookmarkIdForOfflineClientId(ClientId id) { - if (!id.getNamespace().equals(OfflinePageBridge.BOOKMARK_NAMESPACE)) { - return new BookmarkId(-1, BookmarkType.NORMAL); - } - return BookmarkId.getBookmarkIdFromString(id.getId()); - } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkPage.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkPage.java index 6c9e44c3..f6a3931 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkPage.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkPage.java
@@ -14,7 +14,6 @@ import org.chromium.chrome.browser.NativePage; import org.chromium.chrome.browser.UrlConstants; import org.chromium.chrome.browser.bookmarks.BookmarkDelegate.BookmarkStateChangeListener; -import org.chromium.chrome.browser.offlinepages.OfflinePageUtils; import org.chromium.chrome.browser.tab.Tab; import org.chromium.content_public.browser.LoadUrlParams; @@ -38,7 +37,7 @@ public BookmarkPage(Activity activity, Tab tab) { mActivity = activity; mTab = tab; - mTitle = activity.getString(OfflinePageUtils.getStringId(R.string.bookmarks)); + mTitle = activity.getString(R.string.bookmarks); mBackgroundColor = ApiCompatibilityUtils.getColor(activity.getResources(), R.color.default_primary_color); mThemeColor = ApiCompatibilityUtils.getColor(
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkRecyclerView.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkRecyclerView.java index e77b8b8..aeae8a7 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkRecyclerView.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkRecyclerView.java
@@ -128,12 +128,6 @@ } @Override - public void onFilterStateSet(BookmarkFilter filter) { - assert filter == BookmarkFilter.OFFLINE_PAGES; - scrollToPosition(0); - } - - @Override public void onSelectionStateChange(List<BookmarkId> selectedBookmarks) { if (!mDelegate.isSelectionEnabled()) { for (int i = 0; i < getLayoutManager().getChildCount(); ++i) {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkRow.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkRow.java index 4094f43..91589e4a 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkRow.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkRow.java
@@ -157,8 +157,7 @@ BookmarkAddEditFolderActivity.startEditFolderActivity( getContext(), item.getId()); } else { - BookmarkUtils.startEditActivity( - getContext(), item.getId(), null); + BookmarkUtils.startEditActivity(getContext(), item.getId()); } } else if (position == 2) { BookmarkFolderSelectActivity.startFolderSelectActivity(getContext(), @@ -281,10 +280,6 @@ } @Override - public void onFilterStateSet(BookmarkFilter filter) { - } - - @Override public void onSelectionStateChange(List<BookmarkId> selectedBookmarks) { updateSelectionState(); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkSearchView.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkSearchView.java index 28b1a76..fd1dfbf 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkSearchView.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkSearchView.java
@@ -367,10 +367,6 @@ } @Override - public void onFilterStateSet(BookmarkFilter filter) { - } - - @Override public void onSelectionStateChange(List<BookmarkId> selectedBookmarks) { }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkUIObserver.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkUIObserver.java index 7bba7a7f..5c9982bb 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkUIObserver.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkUIObserver.java
@@ -32,11 +32,6 @@ void onFolderStateSet(BookmarkId folder); /** - * @see BookmarkDelegate#openFilter(BookmarkFilter) - */ - void onFilterStateSet(BookmarkFilter filter); - - /** * Please refer to * {@link BookmarkDelegate#toggleSelectionForBookmark(BookmarkId)}, * {@link BookmarkDelegate#clearSelection()} and
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkUIState.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkUIState.java index bb2322af..ec8851c 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkUIState.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkUIState.java
@@ -8,7 +8,6 @@ import android.text.TextUtils; import org.chromium.chrome.browser.UrlConstants; -import org.chromium.chrome.browser.offlinepages.OfflinePageBridge; import org.chromium.components.bookmarks.BookmarkId; /** @@ -21,7 +20,6 @@ static final int STATE_LOADING = 1; static final int STATE_ALL_BOOKMARKS = 2; static final int STATE_FOLDER = 3; - static final int STATE_FILTER = 4; private static final int STATE_INVALID = 0; /** @@ -29,15 +27,11 @@ */ int mState; String mUrl; - /** Whether this state should be persisted as user's last location. */ - boolean mShouldPersist = true; BookmarkId mFolder; - BookmarkFilter mFilter; static BookmarkUIState createLoadingState() { BookmarkUIState state = new BookmarkUIState(); state.mState = STATE_LOADING; - state.mShouldPersist = false; state.mUrl = ""; return state; } @@ -51,11 +45,6 @@ return createStateFromUrl(createFolderUrl(folder), bookmarkModel); } - static BookmarkUIState createFilterState( - BookmarkFilter filter, BookmarkModel bookmarkModel) { - return createStateFromUrl(createFilterUrl(filter, true), bookmarkModel); - } - /** * @see #createStateFromUrl(Uri, BookmarkModel) */ @@ -71,7 +60,6 @@ BookmarkUIState state = new BookmarkUIState(); state.mState = STATE_INVALID; state.mUrl = uri.toString(); - state.mShouldPersist = shouldPersist(uri); if (state.mUrl.equals(UrlConstants.BOOKMARKS_URL)) { state.mState = STATE_ALL_BOOKMARKS; @@ -81,12 +69,6 @@ state.mFolder = BookmarkId.getBookmarkIdFromString(path); state.mState = STATE_FOLDER; } - } else if (state.mUrl.startsWith(UrlConstants.BOOKMARKS_FILTER_URL)) { - String path = uri.getLastPathSegment(); - if (!path.isEmpty()) { - state.mState = STATE_FILTER; - state.mFilter = BookmarkFilter.valueOf(path); - } } if (!state.isValid(bookmarkModel)) { @@ -98,33 +80,13 @@ } static Uri createFolderUrl(BookmarkId folderId) { - return createUrl(UrlConstants.BOOKMARKS_FOLDER_URL, folderId.toString(), true); - } - - static Uri createFilterUrl(BookmarkFilter filter, boolean shouldPersist) { - return createUrl(UrlConstants.BOOKMARKS_FILTER_URL, filter.value, shouldPersist); - } - - /** - * Encodes the path and appends it to the base url. A simple appending - * does not work because there might be spaces in suffix. - * @param shouldPersist Whether this url should be saved to preferences as - * user's last location. - */ - private static Uri createUrl(String baseUrl, String pathSuffix, boolean shouldPersist) { - Uri.Builder builder = Uri.parse(baseUrl).buildUpon(); - builder.appendPath(pathSuffix); - if (!shouldPersist) { - builder.appendQueryParameter(URI_PERSIST_QUERY_NAME, "0"); - } + Uri.Builder builder = Uri.parse(UrlConstants.BOOKMARKS_FOLDER_URL).buildUpon(); + // Encodes the path and appends it to the base url. A simple appending + // does not work because there might be spaces in suffix. + builder.appendPath(folderId.toString()); return builder.build(); } - private static boolean shouldPersist(Uri uri) { - String queryString = uri.getQueryParameter(URI_PERSIST_QUERY_NAME); - return !("0".equals(queryString)); - } - private BookmarkUIState() {} @Override @@ -150,13 +112,6 @@ && !mFolder.equals(bookmarkModel.getRootFolderId()); } - if (mState == STATE_FILTER) { - if (mFilter == null) return false; - if (mFilter == BookmarkFilter.OFFLINE_PAGES) { - return OfflinePageBridge.isEnabled(); - } - } - return true; } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkUtils.java index e5d0c6e..fb7d48f 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkUtils.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkUtils.java
@@ -9,7 +9,6 @@ import android.content.Intent; import android.content.SharedPreferences; import android.net.Uri; -import android.os.AsyncTask; import android.preference.PreferenceManager; import android.provider.Browser; import android.text.TextUtils; @@ -21,11 +20,8 @@ import org.chromium.chrome.R; import org.chromium.chrome.browser.IntentHandler; import org.chromium.chrome.browser.UrlConstants; -import org.chromium.chrome.browser.bookmarks.BookmarkModel.AddBookmarkCallback; import org.chromium.chrome.browser.document.ChromeLauncherActivity; import org.chromium.chrome.browser.ntp.NewTabPageUma; -import org.chromium.chrome.browser.offlinepages.OfflinePageBridge; -import org.chromium.chrome.browser.offlinepages.OfflinePageUtils; import org.chromium.chrome.browser.snackbar.Snackbar; import org.chromium.chrome.browser.snackbar.SnackbarManager; import org.chromium.chrome.browser.snackbar.SnackbarManager.SnackbarController; @@ -33,7 +29,7 @@ import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.components.bookmarks.BookmarkId; import org.chromium.components.bookmarks.BookmarkType; -import org.chromium.content_public.browser.WebContents; +import org.chromium.components.dom_distiller.core.DomDistillerUrlUtils; import org.chromium.ui.base.DeviceFormFactor; /** @@ -49,23 +45,21 @@ * * Note: Takes ownership of bookmarkModel, and will call |destroy| on it when finished. * - * @param idToAdd The bookmark ID if the tab has already been bookmarked. + * @param existingBookmarkId The bookmark ID if the tab has already been bookmarked. * @param bookmarkModel The bookmark model. * @param tab The tab to add or edit a bookmark. * @param snackbarManager The SnackbarManager used to show the snackbar. * @param activity Current activity. + * @return Bookmark ID of the bookmark. Could be <code>null</code> if bookmark didn't exist + * and bookmark model failed to create it. */ - public static void addOrEditBookmark(long idToAdd, BookmarkModel bookmarkModel, + public static BookmarkId addOrEditBookmark(long existingBookmarkId, BookmarkModel bookmarkModel, Tab tab, SnackbarManager snackbarManager, Activity activity) { - // See if the Tab's contents should be saved or not. - WebContents webContentsToSave = null; - if (!shouldSkipSavingTabOffline(tab)) webContentsToSave = tab.getWebContents(); - - if (idToAdd != Tab.INVALID_BOOKMARK_ID) { - startEditActivity(activity, new BookmarkId(idToAdd, BookmarkType.NORMAL), - webContentsToSave); + if (existingBookmarkId != Tab.INVALID_BOOKMARK_ID) { + BookmarkId bookmarkId = new BookmarkId(existingBookmarkId, BookmarkType.NORMAL); + startEditActivity(activity, bookmarkId); bookmarkModel.destroy(); - return; + return bookmarkId; } BookmarkId parent = getLastUsedParent(activity); @@ -73,11 +67,32 @@ parent = bookmarkModel.getDefaultFolder(); } - // The bookmark model will be destroyed in the created AddBookmarkCallback. - bookmarkModel.addBookmarkAsync(parent, bookmarkModel.getChildCount(parent), tab.getTitle(), - tab.getUrl(), webContentsToSave, - createAddBookmarkCallback(bookmarkModel, snackbarManager, activity, - webContentsToSave)); + String url = DomDistillerUrlUtils.getOriginalUrlFromDistillerUrl(tab.getUrl()); + BookmarkId bookmarkId = bookmarkModel.addBookmark( + parent, bookmarkModel.getChildCount(parent), tab.getTitle(), url); + + if (bookmarkId != null) { + Snackbar snackbar; + String folderName = bookmarkModel.getBookmarkTitle( + bookmarkModel.getBookmarkById(bookmarkId).getParentId()); + SnackbarController snackbarController = + createSnackbarControllerForEditButton(activity, bookmarkId); + if (getLastUsedParent(activity) == null) { + snackbar = Snackbar.make(activity.getString(R.string.bookmark_page_saved), + snackbarController, Snackbar.TYPE_ACTION); + } else { + snackbar = Snackbar.make(folderName, snackbarController, Snackbar.TYPE_ACTION) + .setTemplateText( + activity.getString(R.string.bookmark_page_saved_folder)); + } + snackbar = snackbar.setSingleLine(false).setAction( + activity.getString(R.string.bookmark_item_edit), null); + + snackbarManager.showSnackbar(snackbar); + } + + bookmarkModel.destroy(); + return bookmarkId; } /** @@ -87,8 +102,8 @@ * @param title The title of the bookmark. * @param url The URL of the new bookmark. */ - public static BookmarkId addBookmarkSilently(Context context, - BookmarkModel bookmarkModel, String title, String url) { + public static BookmarkId addBookmarkSilently( + Context context, BookmarkModel bookmarkModel, String title, String url) { BookmarkId parent = getLastUsedParent(context); if (parent == null || !bookmarkModel.doesBookmarkExist(parent)) { parent = bookmarkModel.getDefaultFolder(); @@ -98,114 +113,6 @@ } /** - * Shows a snackbar after a bookmark has been added. - * - * NOTE: This method calls BookmarkModel#destroy() on the BookmarkModel that is passed to it. - */ - private static void showSnackbarForAddingBookmark(final BookmarkModel bookmarkModel, - final SnackbarManager snackbarManager, final Activity activity, - final BookmarkId bookmarkId, final int saveResult, boolean isStorageAlmostFull, - final WebContents webContents) { - Snackbar snackbar; - OfflinePageBridge offlinePageBridge = bookmarkModel.getOfflinePageBridge(); - if (offlinePageBridge == null) { - String folderName = bookmarkModel - .getBookmarkTitle(bookmarkModel.getBookmarkById(bookmarkId).getParentId()); - SnackbarController snackbarController = - createSnackbarControllerForEditButton(activity, bookmarkId); - if (getLastUsedParent(activity) == null) { - snackbar = Snackbar.make(activity.getString(R.string.bookmark_page_saved), - snackbarController, Snackbar.TYPE_ACTION); - } else { - snackbar = Snackbar.make(folderName, snackbarController, Snackbar.TYPE_ACTION) - .setTemplateText(activity.getString(R.string.bookmark_page_saved_folder)); - } - snackbar = snackbar.setSingleLine(false) - .setAction(activity.getString(R.string.bookmark_item_edit), webContents); - } else { - SnackbarController snackbarController = null; - int messageId; - String suffix = null; - int buttonId = R.string.bookmark_item_edit; - - if (saveResult == AddBookmarkCallback.SKIPPED) { - messageId = OfflinePageUtils.getStringId( - R.string.offline_pages_as_bookmarks_page_skipped); - } else if (isStorageAlmostFull) { - messageId = OfflinePageUtils.getStringId(saveResult == AddBookmarkCallback.SAVED - ? R.string.offline_pages_as_bookmarks_page_saved_storage_near_full - : R.string.offline_pages_as_bookmarks_page_failed_to_save_storage_near_full); - // Show "Free up space" button. - buttonId = OfflinePageUtils.getStringId(R.string.offline_pages_free_up_space_title); - snackbarController = OfflinePageUtils.createSnackbarControllerForFreeUpSpaceButton( - offlinePageBridge, snackbarManager, activity); - } else { - if (saveResult == AddBookmarkCallback.SAVED) { - if (getLastUsedParent(activity) == null) { - messageId = OfflinePageUtils.getStringId( - R.string.offline_pages_as_bookmarks_page_saved); - } else { - messageId = OfflinePageUtils.getStringId( - R.string.offline_pages_as_bookmarks_page_saved_folder); - suffix = bookmarkModel.getBookmarkTitle( - bookmarkModel.getBookmarkById(bookmarkId).getParentId()); - } - } else { - messageId = OfflinePageUtils.getStringId( - R.string.offline_pages_as_bookmarks_page_failed_to_save); - } - } - if (snackbarController == null) { - snackbarController = createSnackbarControllerForEditButton(activity, bookmarkId); - } - snackbar = Snackbar - .make(activity.getString(messageId, suffix), snackbarController, - Snackbar.TYPE_ACTION) - .setAction(activity.getString(buttonId), webContents).setSingleLine(false); - } - - snackbarManager.showSnackbar(snackbar); - bookmarkModel.destroy(); - } - - /** - * Shows a snackbar if necessary after adding a bookmark. - * - * NOTE: This callback will call BookmarkModel#destroy() on the passed-in bookmark model. - */ - private static AddBookmarkCallback createAddBookmarkCallback( - final BookmarkModel bookmarkModel, final SnackbarManager snackbarManager, - final Activity activity, final WebContents webContents) { - return new AddBookmarkCallback() { - @Override - public void onBookmarkAdded(final BookmarkId bookmarkId, final int saveResult) { - // Shows the snackbar right away when offline pages feature is not enabled since - // there is no need to wait to get the storage info. - if (bookmarkModel.getOfflinePageBridge() == null) { - showSnackbarForAddingBookmark(bookmarkModel, snackbarManager, activity, - bookmarkId, saveResult, false, webContents); - return; - } - - // Gets the storage info asynchronously which is needed to produce the message for - // the snackbar. - new AsyncTask<Void, Void, Boolean>() { - @Override - protected Boolean doInBackground(Void... params) { - return OfflinePageUtils.isStorageAlmostFull(); - } - - @Override - protected void onPostExecute(Boolean isStorageAlmostFull) { - showSnackbarForAddingBookmark(bookmarkModel, snackbarManager, activity, - bookmarkId, saveResult, isStorageAlmostFull, webContents); - } - }.execute(); - } - }; - } - - /** * Creates a snackbar controller for a case where "Edit" button is shown to edit the newly * created bookmark. */ @@ -222,20 +129,12 @@ @Override public void onAction(Object actionData) { RecordUserAction.record("EnhancedBookmarks.EditAfterCreateButtonClicked"); - startEditActivity(activity, bookmarkId, (WebContents) actionData); + startEditActivity(activity, bookmarkId); } }; } /** - * Gets whether bookmark manager should load offline page initially. - */ - private static boolean shouldShowOfflinePageAtFirst(OfflinePageBridge bridge) { - return !OfflinePageUtils.isConnected() && bridge != null - && bridge.maybeHasPages(OfflinePageBridge.BOOKMARK_NAMESPACE); - } - - /** * Shows bookmark main UI. */ public static void showBookmarkManager(Activity activity) { @@ -251,18 +150,9 @@ } /** - * The initial url the bookmark manager shows depends on offline page status and some - * experiments we run. + * The initial url the bookmark manager shows depends some experiments we run. */ private static String getFirstUrlToLoad(Activity activity) { - BookmarkModel model = new BookmarkModel(); - OfflinePageBridge bridge = model.getOfflinePageBridge(); - model.destroy(); - - if (shouldShowOfflinePageAtFirst(bridge)) { - return BookmarkUIState.createFilterUrl(BookmarkFilter.OFFLINE_PAGES, false).toString(); - } - String lastUsedUrl = getLastUsedUrl(activity); return TextUtils.isEmpty(lastUsedUrl) ? UrlConstants.BOOKMARKS_URL : lastUsedUrl; } @@ -305,19 +195,10 @@ preferences.getString(PREF_LAST_USED_PARENT, null)); } - /** - * Starts an {@link BookmarkEditActivity} for the given {@link BookmarkId}. - * If the given {@link WebContents} is null, an option to visit the page is shown - * as opposed to showing an option to directly save the page - * (only if offline pages are enabled). - */ - public static void startEditActivity( - Context context, BookmarkId bookmarkId, WebContents webContents) { + /** Starts an {@link BookmarkEditActivity} for the given {@link BookmarkId}. */ + public static void startEditActivity(Context context, BookmarkId bookmarkId) { Intent intent = new Intent(context, BookmarkEditActivity.class); intent.putExtra(BookmarkEditActivity.INTENT_BOOKMARK_ID, bookmarkId.toString()); - if (webContents != null) { - intent.putExtra(BookmarkEditActivity.INTENT_WEB_CONTENTS, webContents); - } if (context instanceof BookmarkActivity) { ((BookmarkActivity) context).startActivityForResult( intent, BookmarkActivity.EDIT_BOOKMARK_REQUEST_CODE); @@ -327,7 +208,7 @@ } /** - * Opens a bookmark depending on connection status and reports UMA. + * Opens a bookmark and reports UMA. * @param model Bookmarks model to manage the bookmark. * @param activity Activity requesting to open the bookmark. * @param bookmarkId ID of the bookmark to be opened. @@ -338,19 +219,11 @@ BookmarkId bookmarkId, int launchLocation) { if (model.getBookmarkById(bookmarkId) == null) return false; - String url = model.getLaunchUrlAndMarkAccessed(bookmarkId); - - // TODO(jianli): Notify the user about the failure. - if (TextUtils.isEmpty(url)) return false; + String url = model.getBookmarkById(bookmarkId).getUrl(); NewTabPageUma.recordAction(NewTabPageUma.ACTION_OPENED_BOOKMARK); - if (url.startsWith("file:")) { - RecordHistogram.recordEnumeratedHistogram( - "OfflinePages.LaunchLocation", launchLocation, BookmarkLaunchLocation.COUNT); - } else { - RecordHistogram.recordEnumeratedHistogram( - "Stars.LaunchLocation", launchLocation, BookmarkLaunchLocation.COUNT); - } + RecordHistogram.recordEnumeratedHistogram( + "Stars.LaunchLocation", launchLocation, BookmarkLaunchLocation.COUNT); openUrl(activity, url); return true; @@ -384,12 +257,4 @@ ((Activity) context).finish(); } } - - /** - * Indicates whether we should skip saving the given tab as an offline page. - * A tab shouldn't be saved offline if it shows an error page or a sad tab page. - */ - private static boolean shouldSkipSavingTabOffline(Tab tab) { - return tab.isShowingErrorPage() || tab.isShowingSadTab(); - } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/childaccounts/ResetDataActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/childaccounts/ResetDataActivity.java deleted file mode 100644 index 5ba99496..0000000 --- a/chrome/android/java/src/org/chromium/chrome/browser/childaccounts/ResetDataActivity.java +++ /dev/null
@@ -1,117 +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. - -package org.chromium.chrome.browser.childaccounts; - -import android.annotation.TargetApi; -import android.app.Activity; -import android.app.ActivityManager; -import android.content.Context; -import android.content.Intent; -import android.os.Build; -import android.os.Bundle; - -import org.chromium.chrome.browser.externalauth.ExternalAuthUtils; -import org.chromium.chrome.browser.firstrun.FirstRunStatus; -import org.chromium.chrome.browser.util.IntentUtils; - -/** - * An activity that allows whitelisted applications to reset all data in Chrome, - * as part of the child account setup. - */ -public class ResetDataActivity extends Activity { - - /** - * The operation succeeded. Note that this value will only be returned for dry runs, because - * successfully resetting data will kill this process and return - * {@link Activity#RESULT_CANCELED}. - */ - private static final int RESULT_OK = Activity.RESULT_OK; - - /** - * The calling activity is not authorized. This activity is only available to Google-signed - * applications. - */ - private static final int RESULT_ERROR_UNAUTHORIZED = Activity.RESULT_FIRST_USER; - - /** - * Resetting data is not supported. - */ - private static final int RESULT_ERROR_NOT_SUPPORTED = Activity.RESULT_FIRST_USER + 1; - - /** - * There was an error resetting data. - */ - private static final int RESULT_ERROR_COULD_NOT_RESET_DATA = Activity.RESULT_FIRST_USER + 2; - - /** - * If this is set to true, perform a "dry run", i.e. only check whether there is data to be - * cleared. This defaults to true, to avoid accidentally resetting data. - */ - private static final String EXTRA_DRY_RUN = "dry_run"; - - /** - * If a dry run is performed, this key contains a boolean flag that states whether there is data - * to be cleared. - */ - private static final String EXTRA_HAS_DATA = "has_data"; - - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - if (!authenticateSender()) { - returnResult(RESULT_ERROR_UNAUTHORIZED); - return; - } - - // If resetting data is not supported, immediately return an error. - if (!supportsResetData()) { - returnResult(RESULT_ERROR_NOT_SUPPORTED); - return; - } - - boolean dryRun = IntentUtils.safeGetBooleanExtra(getIntent(), EXTRA_DRY_RUN, true); - - if (dryRun) { - returnHasData(FirstRunStatus.getFirstRunFlowComplete(this)); - return; - } - - boolean success = resetData(); - - // We should only land here if resetting data was not successful, as otherwise the process - // will be killed. - assert !success; - returnResult(RESULT_ERROR_COULD_NOT_RESET_DATA); - } - - private boolean authenticateSender() { - return ExternalAuthUtils.getInstance().isGoogleSigned(getPackageManager(), - getCallingPackage()); - } - - private boolean supportsResetData() { - return Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT; - } - - @TargetApi(Build.VERSION_CODES.KITKAT) - private boolean resetData() { - assert supportsResetData(); - ActivityManager am = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE); - return am.clearApplicationUserData(); - } - - private void returnHasData(boolean hasData) { - Intent result = new Intent(); - result.putExtra(EXTRA_HAS_DATA, hasData); - setResult(RESULT_OK, result); - finish(); - } - - private void returnResult(int resultCode) { - setResult(resultCode); - finish(); - } -}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/ScrollingStripStacker.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/ScrollingStripStacker.java index f356bb0..b1deeb3 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/ScrollingStripStacker.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/ScrollingStripStacker.java
@@ -38,10 +38,10 @@ @Override public void performOcclusionPass(int selectedIndex, StripLayoutTab[] indexOrderedTabs, - float layoutWidth) { + float stripWidth) { for (int i = 0; i < indexOrderedTabs.length; i++) { StripLayoutTab tab = indexOrderedTabs[i]; - tab.setVisible((tab.getDrawX() + tab.getWidth()) >= 0 && tab.getDrawX() <= layoutWidth); + tab.setVisible((tab.getDrawX() + tab.getWidth()) >= 0 && tab.getDrawX() <= stripWidth); } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelper.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelper.java index be9e442..32a6977f 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelper.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelper.java
@@ -144,6 +144,7 @@ private float mBrightness; // Whether the CascadingStripStacker should be used. private boolean mShouldCascadeTabs; + private boolean mIsFirstLayoutPass; // Tab menu item IDs public static final int ID_CLOSE_ALL_TABS = 0; @@ -208,9 +209,7 @@ int screenWidthDp = context.getResources().getConfiguration().screenWidthDp; mShouldCascadeTabs = screenWidthDp >= DeviceFormFactor.MINIMUM_TABLET_WIDTH_DP; mStripStacker = mShouldCascadeTabs ? mCascadingStripStacker : mScrollingStripStacker; - - // TODO(twellington): auto-scroll on cold start and when the tab model is switched - // so the selected tab is visible when !mShouldCascadeTabs. + mIsFirstLayoutPass = true; } /** @@ -429,10 +428,24 @@ PerfTraceEvent.instant("StripLayoutHelper:updateLayout"); final boolean doneAnimating = onUpdateAnimation(time, false); updateStrip(); + + // If this is the first layout pass, scroll to the selected tab so that it is visible. + // This is needed if the ScrollingStripStacker is being used because the selected tab is + // not guaranteed to be visible. + if (mIsFirstLayoutPass) bringSelectedTabToVisibleArea(time, false); + mIsFirstLayoutPass = false; + return doneAnimating; } /** + * Called when the tab model this StripLayoutHelper visually represents has been selected. + */ + public void tabModelSelected() { + bringSelectedTabToVisibleArea(0, false); + } + + /** * Called when a tab get selected. * @param time The current time of the app in ms. * @param id The id of the selected tab. @@ -446,10 +459,7 @@ // If the tab was selected through a method other than the user tapping on the strip, it // may not be currently visible. Scroll if necessary. - if (!mShouldCascadeTabs && !findTabById(id).isVisible()) { - float delta = calculateOffsetToMakeTabVisible(findTabById(id), true, true, true); - setScrollForScrollingTabStacker(delta, true, time); - } + bringSelectedTabToVisibleArea(time, true); mUpdateHost.requestUpdate(); } @@ -1620,6 +1630,28 @@ } /** + * Scrolls to the selected tab if it's not fully visible. + */ + private void bringSelectedTabToVisibleArea(long time, boolean animate) { + // The selected tab is always visible in the CascadingStripStacker. + if (mShouldCascadeTabs) return; + + Tab selectedTab = mModel.getTabAt(mModel.index()); + if (selectedTab == null) return; + + StripLayoutTab selectedLayoutTab = findTabById(selectedTab.getId()); + if (isSelectedTabCompletelyVisible(selectedLayoutTab)) return; + + float delta = calculateOffsetToMakeTabVisible(selectedLayoutTab, true, true, true); + setScrollForScrollingTabStacker(delta, animate, time); + } + + private boolean isSelectedTabCompletelyVisible(StripLayoutTab selectedTab) { + return selectedTab.isVisible() && selectedTab.getDrawX() >= 0 + && selectedTab.getDrawX() + selectedTab.getWidth() <= mWidth; + } + + /** * @return true if the tab menu is showing */ @VisibleForTesting
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelperManager.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelperManager.java index 4995334b..31fef90 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelperManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelperManager.java
@@ -212,6 +212,7 @@ public void setTabModelSelector(TabModelSelector modelSelector, TabCreatorManager tabCreatorManager) { if (mTabModelSelector == modelSelector) return; + mTabModelSelector = modelSelector; mNormalHelper.setTabModel(mTabModelSelector.getModel(false), tabCreatorManager.getTabCreator(false)); @@ -279,6 +280,12 @@ if (incognito == mIsIncognito) return; mIsIncognito = incognito; + if (mIsIncognito) { + mIncognitoHelper.tabModelSelected(); + } else { + mNormalHelper.tabModelSelected(); + } + updateModelSwitcherButton(); mUpdateHost.requestUpdate();
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/SeparateTaskCustomTabActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/SeparateTaskCustomTabActivity.java index caf19e6..f51b186 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/SeparateTaskCustomTabActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/SeparateTaskCustomTabActivity.java
@@ -8,15 +8,17 @@ import android.os.Build; import org.chromium.base.ApiCompatibilityUtils; +import org.chromium.chrome.R; +import org.chromium.chrome.browser.ActivityTabTaskDescriptionHelper; /** * Simple wrapper around the CustomTabActivity to be used when launching each CustomTab in a * separate task. */ -// TODO(tedchoc): Add support for updating the Android task info on L+. public class SeparateTaskCustomTabActivity extends CustomTabActivity { private boolean mDidFinishForReparenting; + private ActivityTabTaskDescriptionHelper mTaskDescriptionHelper; @Override public void preInflationStartup() { @@ -34,6 +36,16 @@ } @Override + public void finishNativeInitialization() { + super.finishNativeInitialization(); + + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + mTaskDescriptionHelper = new ActivityTabTaskDescriptionHelper(this, + ApiCompatibilityUtils.getColor(getResources(), R.color.default_primary_color)); + } + } + + @Override public void onStop() { super.onStop(); @@ -41,6 +53,13 @@ } @Override + protected void onDestroyInternal() { + super.onDestroyInternal(); + + if (mTaskDescriptionHelper != null) mTaskDescriptionHelper.destroy(); + } + + @Override public void finishAndClose() { if (mDidFinishForReparenting) return;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/document/DocumentActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/document/DocumentActivity.java index e38fb571d..6fbe099 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/document/DocumentActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/document/DocumentActivity.java
@@ -6,7 +6,6 @@ import android.annotation.TargetApi; import android.content.Intent; -import android.graphics.Bitmap; import android.graphics.Color; import android.os.Build; import android.text.TextUtils; @@ -25,6 +24,7 @@ import org.chromium.base.library_loader.LibraryLoader; import org.chromium.base.metrics.RecordUserAction; 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.IntentHandler; @@ -65,9 +65,7 @@ import org.chromium.chrome.browser.toolbar.ToolbarControlContainer; import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.chrome.browser.util.IntentUtils; -import org.chromium.chrome.browser.util.UrlUtilities; import org.chromium.chrome.browser.widget.findinpage.FindToolbarManager; -import org.chromium.components.security_state.ConnectionSecurityLevel; import org.chromium.components.service_tab_launcher.ServiceTabLauncher; import org.chromium.content_public.browser.LoadUrlParams; import org.chromium.content_public.browser.NavigationEntry; @@ -110,73 +108,18 @@ } @Override - public void onWebContentsSwapped(Tab tab, boolean didStartLoad, boolean didFinishLoad) { - if (!didStartLoad) return; - resetIcon(); - } - - @Override - public void onFaviconUpdated(Tab tab, Bitmap icon) { - if (icon == null) return; - if (mLargestFavicon == null || icon.getWidth() > mLargestFavicon.getWidth() - || icon.getHeight() > mLargestFavicon.getHeight()) { - mLargestFavicon = icon; - updateTaskDescription(); - } - } - - @Override public void onUrlUpdated(Tab tab) { assert mTab == tab; - - updateTaskDescription(); mTabModel.updateEntry(getIntent(), mTab); } @Override - public void onTitleUpdated(Tab tab) { - super.onTitleUpdated(tab); - updateTaskDescription(); - } - - @Override - public void onSSLStateUpdated(Tab tab) { - if (hasSecurityWarningOrError(tab)) resetIcon(); - } - - @Override - public void onDidNavigateMainFrame(Tab tab, String url, String baseUrl, - boolean isNavigationToDifferentPage, boolean isFragmentNavigation, - int statusCode) { - if (!isNavigationToDifferentPage) return; - mLargestFavicon = null; - updateTaskDescription(); - } - - @Override public void onLoadStopped(Tab tab, boolean toDifferentDocument) { assert mTab == tab; - - updateTaskDescription(); mTabModel.updateEntry(getIntent(), mTab); } @Override - public void onDidChangeThemeColor(Tab tab, int color) { - updateTaskDescription(); - } - - @Override - public void onDidAttachInterstitialPage(Tab tab) { - resetIcon(); - } - - @Override - public void onDidDetachInterstitialPage(Tab tab) { - resetIcon(); - } - - @Override public void onCrash(Tab tab, boolean sadTabShown) { int currentState = ApplicationStatus.getStateForActivity(DocumentActivity.this); if (currentState != ActivityState.STOPPED) return; @@ -194,28 +137,11 @@ // eventually destroy the Activities, anyway (crbug.com/450292). if (!isIncognito()) finish(); } - - private boolean hasSecurityWarningOrError(Tab tab) { - int securityLevel = tab.getSecurityLevel(); - return securityLevel == ConnectionSecurityLevel.SECURITY_ERROR - || securityLevel == ConnectionSecurityLevel.SECURITY_WARNING - || securityLevel == ConnectionSecurityLevel.SECURITY_POLICY_WARNING; - } } private DocumentTabModel mTabModel; private InitializationObserver mTabInitializationObserver; - /** - * Generates the icon to use in the recent task list. - */ - private DocumentActivityIcon mIcon; - - /** - * The tab's largest favicon. - */ - private Bitmap mLargestFavicon; - - private int mDefaultThemeColor; + private ActivityTabTaskDescriptionHelper mTaskDescriptionHelper; private Tab mTab; private FindToolbarManager mFindToolbarManager; @@ -461,6 +387,13 @@ StartupMetrics.getInstance().recordHistogram(true); } + @Override + protected void onDestroyInternal() { + super.onDestroyInternal(); + + if (mTaskDescriptionHelper != null) mTaskDescriptionHelper.destroy(); + } + private void handleDocumentUma() { if (mRecordedStartupUma) { DocumentUma.recordStartedBy( @@ -587,10 +520,10 @@ } private void initializeUI() { - mIcon = new DocumentActivityIcon(this); - mDefaultThemeColor = isIncognito() + int defaultThemeColor = isIncognito() ? ApiCompatibilityUtils.getColor(getResources(), R.color.incognito_primary_color) : ApiCompatibilityUtils.getColor(getResources(), R.color.default_primary_color); + mTaskDescriptionHelper = new ActivityTabTaskDescriptionHelper(this, defaultThemeColor); AsyncTabParams params = AsyncTabParamsManager.remove( ActivityDelegate.getTabIdFromIntent(getIntent())); @@ -648,7 +581,7 @@ ActivityDelegate.getTabIdFromIntent(getIntent()), asyncParams); // Use the URL as the document title until tab is loaded. - updateTaskDescription(loadUrlParams.getUrl(), null); + mTaskDescriptionHelper.updateTaskDescription(loadUrlParams.getUrl(), null); } else { loadLastKnownUrl(asyncParams); } @@ -738,11 +671,6 @@ removeWindowBackground(); } - private void resetIcon() { - mLargestFavicon = null; - updateTaskDescription(); - } - private void updateLastTabId() { ChromeApplication.getDocumentTabModelSelector().selectModel(isIncognito()); int tabId = mTab == null @@ -907,44 +835,6 @@ super.showAppMenuForKeyboardEvent(); } - private void updateTaskDescription() { - if (mTab == null) { - updateTaskDescription(null, null); - return; - } - - if (isNewTabPage() && !isIncognito()) { - // NTP needs a new color in recents, but uses the default application title and icon; - updateTaskDescription(null, null); - return; - } - - String label = mTab.getTitle(); - String domain = UrlUtilities.getDomainAndRegistry(mTab.getUrl(), false); - if (TextUtils.isEmpty(label)) { - label = domain; - } - if (mLargestFavicon == null && TextUtils.isEmpty(label)) { - updateTaskDescription(null, null); - return; - } - - Bitmap bitmap = null; - if (!isIncognito()) { - bitmap = mIcon.getBitmap(mTab.getUrl(), mLargestFavicon); - } - - updateTaskDescription(label, bitmap); - } - - private void updateTaskDescription(String label, Bitmap icon) { - int color = mDefaultThemeColor; - if (getActivityTab() != null && !getActivityTab().isDefaultThemeColor()) { - color = getActivityTab().getThemeColor(); - } - ApiCompatibilityUtils.setTaskDescription(this, label, icon, color); - } - /** * @return Whether the {@link DocumentTab} this activity uses is incognito. */
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/document/DocumentMigrationHelper.java b/chrome/android/java/src/org/chromium/chrome/browser/document/DocumentMigrationHelper.java index a6303a40..5afcbd5f 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/document/DocumentMigrationHelper.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/document/DocumentMigrationHelper.java
@@ -26,6 +26,7 @@ import org.chromium.base.ImportantFileWriterAndroid; import org.chromium.base.Log; import org.chromium.chrome.R; +import org.chromium.chrome.browser.ActivityTaskDescriptionIconGenerator; import org.chromium.chrome.browser.ApplicationLifetime; import org.chromium.chrome.browser.ChromeApplication; import org.chromium.chrome.browser.IntentHandler; @@ -204,7 +205,7 @@ @Override public void onFaviconAvailable(final Bitmap favicon, String iconUrl) { - mIcon = new DocumentActivityIcon(mActivity).getBitmap(mUrl, favicon); + mIcon = new ActivityTaskDescriptionIconGenerator(mActivity).getBitmap(mUrl, favicon); mTabContentManager.getThumbnailForId(mTabId, this); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/mojo/ChromeServiceRegistrar.java b/chrome/android/java/src/org/chromium/chrome/browser/mojo/ChromeServiceRegistrar.java index 003449c..76af5f4 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/mojo/ChromeServiceRegistrar.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/mojo/ChromeServiceRegistrar.java
@@ -4,11 +4,10 @@ package org.chromium.chrome.browser.mojo; -import android.content.Context; - import org.chromium.base.annotations.CalledByNative; import org.chromium.chrome.browser.payments.PaymentRequestFactory; import org.chromium.content.browser.ServiceRegistry; +import org.chromium.content_public.browser.WebContents; import org.chromium.mojom.payments.PaymentRequest; /** @@ -17,8 +16,7 @@ class ChromeServiceRegistrar { @CalledByNative private static void registerRenderFrameMojoServices( - ServiceRegistry registry, Context applicationContext) { - assert applicationContext != null; - registry.addService(PaymentRequest.MANAGER, new PaymentRequestFactory(applicationContext)); + ServiceRegistry registry, WebContents webContents) { + registry.addService(PaymentRequest.MANAGER, new PaymentRequestFactory(webContents)); } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationUIManager.java b/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationUIManager.java index c766599..fc6ef11 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationUIManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationUIManager.java
@@ -12,6 +12,7 @@ import android.content.res.Resources; import android.graphics.Bitmap; import android.net.Uri; +import android.os.Build; import android.os.Bundle; import android.os.StrictMode; import android.os.SystemClock; @@ -620,6 +621,9 @@ if (commandLine.hasSwitch(ChromeSwitches.DISABLE_WEB_NOTIFICATION_CUSTOM_LAYOUTS)) { return false; } + if (Build.VERSION.CODENAME.equals("N")) { + return false; + } return !groupName.equals("Disabled"); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/IncognitoNewTabPage.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/IncognitoNewTabPage.java index b1db008..869d519c 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/IncognitoNewTabPage.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/IncognitoNewTabPage.java
@@ -18,7 +18,6 @@ import org.chromium.chrome.browser.compositor.layouts.content.InvalidationAwareThumbnailProvider; import org.chromium.chrome.browser.help.HelpAndFeedback; import org.chromium.chrome.browser.ntp.IncognitoNewTabPageView.IncognitoNewTabPageManager; -import org.chromium.chrome.browser.offlinepages.OfflinePageUtils; import org.chromium.chrome.browser.profiles.Profile; /** @@ -69,8 +68,8 @@ TextView newTabIncognitoMessage = (TextView) mIncognitoNewTabPageView.findViewById( R.id.new_tab_incognito_message); - newTabIncognitoMessage.setText(activity.getResources().getString( - OfflinePageUtils.getStringId(R.string.new_tab_incognito_message))); + newTabIncognitoMessage.setText( + activity.getResources().getString(R.string.new_tab_incognito_message)); } /**
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java index af82c4c9..243e1aa 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java
@@ -543,6 +543,12 @@ NewTabPageUma.recordSnippetAction(NewTabPageUma.SNIPPETS_ACTION_DISMISSED); mSnippetsBridge.discardSnippet(dismissedSnippet); } + + @Override + public void addTabObserver(TabObserver tabObserver) { + if (mIsDestroyed) return; + mTab.addObserver(tabObserver); + } }; /**
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageToolbar.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageToolbar.java index 43a48a5..f26f491 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageToolbar.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageToolbar.java
@@ -13,7 +13,6 @@ import org.chromium.base.ApiCompatibilityUtils; import org.chromium.chrome.R; -import org.chromium.chrome.browser.offlinepages.OfflinePageUtils; import org.chromium.chrome.browser.widget.TintedDrawable; /** @@ -48,11 +47,9 @@ super.onFinishInflate(); mBookmarksButton = initButton(R.id.bookmarks_button, R.drawable.btn_star); mRecentTabsButton = initButton(R.id.recent_tabs_button, R.drawable.btn_recents); - ((TextView) mBookmarksButton.getChildAt(0)) - .setText(OfflinePageUtils.getStringId(R.string.ntp_bookmarks)); - ((TextView) mBookmarksButton.getChildAt(0)) - .setContentDescription(getResources().getString(OfflinePageUtils.getStringId( - R.string.accessibility_ntp_toolbar_btn_bookmarks))); + ((TextView) mBookmarksButton.getChildAt(0)).setText(R.string.ntp_bookmarks); + ((TextView) mBookmarksButton.getChildAt(0)).setContentDescription(getResources().getString( + R.string.accessibility_ntp_toolbar_btn_bookmarks)); mInterestsButton = initButton(R.id.interests_button, R.drawable.btn_star_filled); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageView.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageView.java index 651d186..afc984a 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageView.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageView.java
@@ -50,6 +50,7 @@ import org.chromium.chrome.browser.ntp.snippets.SnippetsBridge.SnippetsObserver; import org.chromium.chrome.browser.profiles.MostVisitedSites.MostVisitedURLsObserver; import org.chromium.chrome.browser.profiles.MostVisitedSites.ThumbnailCallback; +import org.chromium.chrome.browser.tab.TabObserver; import org.chromium.chrome.browser.util.ViewUtils; import org.chromium.chrome.browser.widget.RoundedIconGenerator; import org.chromium.ui.base.DeviceFormFactor; @@ -163,6 +164,9 @@ /** Sets the observer that will be notified of new snippets. */ void setSnippetsObserver(SnippetsObserver observer); + /** Registers a {@link TabObserver} for the NTP. */ + void addTabObserver(TabObserver tabObserver); + /** * Gets a cached thumbnail of a URL. * @param url The URL whose thumbnail is being retrieved.
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapter.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapter.java index b1d4b71..de7aeeef 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapter.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapter.java
@@ -17,6 +17,8 @@ import org.chromium.chrome.browser.ntp.snippets.SnippetArticleViewHolder; import org.chromium.chrome.browser.ntp.snippets.SnippetHeaderListItem; import org.chromium.chrome.browser.ntp.snippets.SnippetsBridge.SnippetsObserver; +import org.chromium.chrome.browser.tab.EmptyTabObserver; +import org.chromium.chrome.browser.tab.Tab; import java.util.ArrayList; import java.util.List; @@ -79,6 +81,14 @@ mNewTabPageListItems.add(mAboveTheFoldListItem); mNewTabPageManager.setSnippetsObserver(this); + + // Fetch new snippets when switching back to the NTP, from another tab or another app. + mNewTabPageManager.addTabObserver(new EmptyTabObserver() { + @Override + public void onShown(Tab tab) { + mNewTabPageManager.setSnippetsObserver(NewTabPageAdapter.this); + } + }); } /** Returns callbacks to configure the interactions with the RecyclerView's items. */ @@ -90,15 +100,29 @@ public void onSnippetsReceived(List<SnippetArticle> listSnippets) { int newSnippetCount = listSnippets.size(); Log.d(TAG, "Received %d new snippets.", newSnippetCount); - mNewTabPageListItems.clear(); - mNewTabPageListItems.add(mAboveTheFoldListItem); - if (newSnippetCount > 0) { - mNewTabPageListItems.add(new SnippetHeaderListItem()); - mNewTabPageListItems.addAll(listSnippets); + // At first, there might be no snippets available, we wait until they have been fetched. + if (newSnippetCount == 0) return; + + // Copy thumbnails over + for (SnippetArticle newSnippet : listSnippets) { + int existingSnippetIdx = mNewTabPageListItems.indexOf(newSnippet); + if (existingSnippetIdx == -1) continue; + + newSnippet.setThumbnailBitmap( + ((SnippetArticle) mNewTabPageListItems.get(existingSnippetIdx)) + .getThumbnailBitmap()); } + mNewTabPageListItems.clear(); + mNewTabPageListItems.add(mAboveTheFoldListItem); + mNewTabPageListItems.add(new SnippetHeaderListItem()); + mNewTabPageListItems.addAll(listSnippets); + notifyDataSetChanged(); + + // We don't want to get notified of other changes. + mNewTabPageManager.setSnippetsObserver(null); } @Override @@ -150,4 +174,8 @@ notifyItemRangeRemoved(position, numRemovedItems); } + + List<NewTabPageListItem> getItemsForTesting() { + return mNewTabPageListItems; + } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticle.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticle.java index f4c81f8..9e68b0a 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticle.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticle.java
@@ -45,6 +45,17 @@ } @Override + public boolean equals(Object other) { + if (!(other instanceof SnippetArticle)) return false; + return mUrl.equals(((SnippetArticle) other).mUrl); + } + + @Override + public int hashCode() { + return mUrl.hashCode(); + } + + @Override public int getType() { return NewTabPageListItem.VIEW_TYPE_SNIPPET; } @@ -53,12 +64,12 @@ * Returns this article's tumbnail as a {@link Bitmap}. Can return {@code null} as it is * initially unset. */ - Bitmap getThumbnailBitmap() { + public Bitmap getThumbnailBitmap() { return mThumbnailBitmap; } /** Sets the tumbnail bitmap for this article. */ - void setThumbnailBitmap(Bitmap bitmap) { + public void setThumbnailBitmap(Bitmap bitmap) { mThumbnailBitmap = bitmap; } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsBridge.java index bcf3b5ee..c91e6b92 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsBridge.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsBridge.java
@@ -54,6 +54,14 @@ } /** + * Reschedules the fetching of snippets. Used to support different fetching intervals for + * different times of day. + */ + public static void rescheduleFetching() { + nativeRescheduleFetching(); + } + + /** * Tells the native service to discard a snippet. It will be removed from the native side * storage and will also be discarded from subsequent fetch results. * @@ -65,18 +73,19 @@ } /** - * Sets the recipient for the fetched snippets. This method should be called only once. + * Sets the recipient for the fetched snippets. * - * Before the observer is set, the native code will not attempt to transmit them to java. Upon - * registration, the observer will be notified of already fetched snippets. + * An observer needs to be set before the native code attempts to transmit snippets them to + * java. Upon registration, the observer will be notified of already fetched snippets. * - * @param observer object to notify when snippets are received. + * @param observer object to notify when snippets are received, or {@code null} if we want to + * stop observing. */ public void setObserver(SnippetsObserver observer) { - assert mObserver == null; + assert mObserver == null || mObserver == observer; mObserver = observer; - nativeSetObserver(mNativeSnippetsBridge, this); + nativeSetObserver(mNativeSnippetsBridge, observer == null ? null : this); } @CalledByNative @@ -98,6 +107,7 @@ private native long nativeInit(Profile profile); private native void nativeDestroy(long nativeNTPSnippetsBridge); private static native void nativeFetchSnippets(); + private static native void nativeRescheduleFetching(); private native void nativeDiscardSnippet(long nativeNTPSnippetsBridge, String snippetUrl); private native void nativeSetObserver(long nativeNTPSnippetsBridge, SnippetsBridge bridge); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsLauncher.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsLauncher.java index f8dd2c5d..0f33f69 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsLauncher.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsLauncher.java
@@ -7,6 +7,7 @@ import android.content.Context; import com.google.android.gms.gcm.GcmNetworkManager; +import com.google.android.gms.gcm.OneoffTask; import com.google.android.gms.gcm.PeriodicTask; import com.google.android.gms.gcm.Task; @@ -18,6 +19,8 @@ import org.chromium.chrome.browser.externalauth.ExternalAuthUtils; import org.chromium.chrome.browser.externalauth.UserRecoverableErrorHandler; +import java.util.Date; + /** * The {@link SnippetsLauncher} singleton is created and owned by the C++ browser. * @@ -26,10 +29,15 @@ public class SnippetsLauncher { private static final String TAG = "SnippetsLauncher"; + // Task tags for fetching snippets. public static final String TASK_TAG_WIFI_CHARGING = "FetchSnippetsWifiCharging"; public static final String TASK_TAG_WIFI = "FetchSnippetsWifi"; public static final String TASK_TAG_FALLBACK = "FetchSnippetsFallback"; + // Task tag for re-scheduling the snippet fetching. This is used to support different fetching + // intervals during different times of day. + public static final String TASK_TAG_RESCHEDULE = "RescheduleSnippets"; + // The instance of SnippetsLauncher currently owned by a C++ SnippetsLauncherAndroid, if any. // If it is non-null then the browser is running. private static SnippetsLauncher sInstance; @@ -90,7 +98,7 @@ } } - private static PeriodicTask buildTask( + private static PeriodicTask buildFetchTask( String tag, long periodSeconds, int requiredNetwork, boolean requiresCharging) { return new PeriodicTask.Builder() .setService(ChromeBackgroundService.class) @@ -103,21 +111,51 @@ .build(); } + private static OneoffTask buildRescheduleTask(Date date) { + Date now = new Date(); + // Convert from milliseconds to seconds, rounding up. + long delaySeconds = (now.getTime() - date.getTime() + 999) / 1000; + final long intervalSeconds = 15 * 60; + return new OneoffTask.Builder() + .setService(ChromeBackgroundService.class) + .setTag(TASK_TAG_RESCHEDULE) + .setExecutionWindow(delaySeconds, delaySeconds + intervalSeconds) + .setRequiredNetwork(Task.NETWORK_STATE_ANY) + .setRequiresCharging(false) + .setPersisted(true) + .setUpdateCurrent(true) + .build(); + } + + private void scheduleOrCancelFetchTask( + String taskTag, long period, int requiredNetwork, boolean requiresCharging) { + if (period > 0) { + mScheduler.schedule(buildFetchTask(taskTag, period, requiredNetwork, requiresCharging)); + } else { + mScheduler.cancelTask(taskTag, ChromeBackgroundService.class); + } + } + @CalledByNative - private boolean schedule( - long periodWifiChargingSeconds, long periodWifiSeconds, long periodFallbackSeconds) { + private boolean schedule(long periodWifiChargingSeconds, long periodWifiSeconds, + long periodFallbackSeconds, long rescheduleTime) { if (!mGCMEnabled) return false; Log.d(TAG, "Scheduling: " + periodWifiChargingSeconds + " " + periodWifiSeconds + " " + periodFallbackSeconds); // Google Play Services may not be up to date, if the application was not installed through // the Play Store. In this case, scheduling the task will fail silently. try { - mScheduler.schedule(buildTask(TASK_TAG_WIFI_CHARGING, periodWifiChargingSeconds, - Task.NETWORK_STATE_UNMETERED, true)); - mScheduler.schedule(buildTask( - TASK_TAG_WIFI, periodWifiSeconds, Task.NETWORK_STATE_UNMETERED, false)); - mScheduler.schedule(buildTask( - TASK_TAG_FALLBACK, periodFallbackSeconds, Task.NETWORK_STATE_CONNECTED, false)); + scheduleOrCancelFetchTask(TASK_TAG_WIFI_CHARGING, periodWifiChargingSeconds, + Task.NETWORK_STATE_UNMETERED, true); + scheduleOrCancelFetchTask( + TASK_TAG_WIFI, periodWifiSeconds, Task.NETWORK_STATE_UNMETERED, false); + scheduleOrCancelFetchTask( + TASK_TAG_FALLBACK, periodFallbackSeconds, Task.NETWORK_STATE_CONNECTED, false); + if (rescheduleTime > 0) { + mScheduler.schedule(buildRescheduleTask(new Date(rescheduleTime))); + } else { + mScheduler.cancelTask(TASK_TAG_RESCHEDULE, ChromeBackgroundService.class); + } } catch (IllegalArgumentException e) { // Disable GCM for the remainder of this session. mGCMEnabled = false; @@ -131,18 +169,7 @@ private boolean unschedule() { if (!mGCMEnabled) return false; Log.i(TAG, "Unscheduling"); - try { - mScheduler.cancelTask(TASK_TAG_WIFI_CHARGING, ChromeBackgroundService.class); - mScheduler.cancelTask(TASK_TAG_WIFI, ChromeBackgroundService.class); - mScheduler.cancelTask(TASK_TAG_FALLBACK, ChromeBackgroundService.class); - } catch (IllegalArgumentException e) { - // This occurs when SnippetsLauncherService is not found in the application - // manifest. Disable GCM for the remainder of this session. - mGCMEnabled = false; - // Return false so that the failure will be logged. - return false; - } - return true; + return schedule(0, 0, 0, 0); } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java index d0e3bbbd..1a4000f 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java
@@ -185,22 +185,12 @@ } /** - * @return The mode of the offline pages feature. Uses - * {@see org.chromium.components.offlinepages.FeatureMode} enum. - */ - public static int getFeatureMode() { - ThreadUtils.assertOnUiThread(); - if (sFeatureMode == null) sFeatureMode = nativeGetFeatureMode(); - return sFeatureMode; - } - - /** * @return True if the offline pages feature is enabled, regardless whether bookmark or saved * page shown in UI strings. */ public static boolean isEnabled() { ThreadUtils.assertOnUiThread(); - return getFeatureMode() != FeatureMode.DISABLED; + return nativeGetFeatureMode() != FeatureMode.DISABLED; } /** @@ -240,7 +230,7 @@ * * @param callback The callback to run when the operation completes. */ - + @VisibleForTesting public void getAllPages(final MultipleOfflinePageItemCallback callback) { List<OfflinePageItem> result = new ArrayList<>(); nativeGetAllPages(mNativeOfflinePageBridge, result, callback); @@ -287,6 +277,7 @@ * @return A {@link OfflinePageItem} matching the bookmark Id or <code>null</code> if none * exist. */ + @VisibleForTesting public void getPagesByClientId( final ClientId clientId, final MultipleOfflinePageItemCallback callback) { runWhenLoaded(new Runnable() { @@ -433,6 +424,7 @@ * @param callback Interface that contains a callback. * @see DeletePageCallback */ + @VisibleForTesting public void deletePage(final ClientId clientId, DeletePageCallback callback) { assert mIsNativeOfflinePageModelLoaded; ArrayList<ClientId> ids = new ArrayList<ClientId>();
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageFreeUpSpaceCallback.java b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageFreeUpSpaceCallback.java deleted file mode 100644 index 7b5fc38..0000000 --- a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageFreeUpSpaceCallback.java +++ /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. - -package org.chromium.chrome.browser.offlinepages; - -/** Interface for informing the caller that the clean up operation is completed. */ -public interface OfflinePageFreeUpSpaceCallback { - /** Called when clean up operation is completed. */ - void onFreeUpSpaceDone(); - - /** Called when clean up operation is canceled. */ - void onFreeUpSpaceCancelled(); -}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageFreeUpSpaceDialog.java b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageFreeUpSpaceDialog.java deleted file mode 100644 index a611a76..0000000 --- a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageFreeUpSpaceDialog.java +++ /dev/null
@@ -1,117 +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. - -package org.chromium.chrome.browser.offlinepages; - -import android.app.Dialog; -import android.app.DialogFragment; -import android.content.Context; -import android.content.DialogInterface; -import android.os.Bundle; -import android.support.v7.app.AlertDialog; -import android.text.format.Formatter; - -import org.chromium.base.metrics.RecordUserAction; -import org.chromium.chrome.R; -import org.chromium.chrome.browser.offlinepages.OfflinePageBridge.DeletePageCallback; -import org.chromium.chrome.browser.snackbar.Snackbar; -import org.chromium.chrome.browser.snackbar.SnackbarManager.SnackbarController; - -import java.util.ArrayList; -import java.util.List; - -/** - * Shows a "Free up space" dialog to clean up storage for offline pages. - */ -public class OfflinePageFreeUpSpaceDialog - extends DialogFragment implements DialogInterface.OnClickListener { - private OfflinePageBridge mOfflinePageBridge; - private List<OfflinePageItem> mOfflinePagesToDelete; - private OfflinePageFreeUpSpaceCallback mCallback; - - /** - * Creates the dialog. If the passed bridge instance needs to be destroyed after the dialog - * is finished, it should be taken care of in the callback implementation. - * - * @param offlinePageBridge An object to access offline page functionality. - * @param callback An object that will be called when the dialog finishes. Can be null. - * @see OfflinePageFreeUpSpaceCallback - */ - public static OfflinePageFreeUpSpaceDialog newInstance( - OfflinePageBridge offlinePageBridge, OfflinePageFreeUpSpaceCallback callback) { - assert offlinePageBridge != null; - OfflinePageFreeUpSpaceDialog dialog = new OfflinePageFreeUpSpaceDialog(); - dialog.mOfflinePageBridge = offlinePageBridge; - dialog.mCallback = callback; - return dialog; - } - - /** - * Creates a snackbar informing user that the storage has been cleared. - */ - public static Snackbar createStorageClearedSnackbar(Context context) { - return Snackbar.make(context.getString(OfflinePageUtils.getStringId( - R.string.offline_pages_storage_cleared)), - new SnackbarController() { - @Override - public void onDismissNoAction(Object actionData) {} - @Override - public void onAction(Object actionData) {} - }, Snackbar.TYPE_ACTION); - } - - @Override - public Dialog onCreateDialog(Bundle savedInstanceState) { - if (savedInstanceState != null) dismiss(); - - mOfflinePagesToDelete = mOfflinePageBridge.getPagesToCleanUp(); - AlertDialog.Builder builder = - new AlertDialog.Builder(getActivity(), R.style.AlertDialogTheme) - .setTitle(OfflinePageUtils.getStringId( - R.string.offline_pages_free_up_space_title)) - .setPositiveButton(R.string.delete, this) - .setNegativeButton(R.string.cancel, this) - .setMessage(getString(OfflinePageUtils.getStringId( - R.string.offline_pages_free_up_space_message), - mOfflinePagesToDelete.size(), - Formatter.formatFileSize(getActivity(), getTotalSize()))); - return builder.create(); - } - - @Override - public void onClick(DialogInterface dialog, int id) { - if (id == AlertDialog.BUTTON_NEGATIVE) { - RecordUserAction.record("OfflinePages.FreeUpSpaceDialogButtonNotClicked"); - dialog.cancel(); - if (mCallback != null) mCallback.onFreeUpSpaceCancelled(); - return; - } - - mOfflinePageBridge.deletePages(getOfflineIdsToDelete(), new DeletePageCallback() { - @Override - public void onDeletePageDone(int deletePageResult) { - RecordUserAction.record("OfflinePages.FreeUpSpaceDialogButtonClicked"); - if (mCallback != null) mCallback.onFreeUpSpaceDone(); - } - }); - } - - /** Returns a list of IDs for which the offline pages will be deleted. */ - private List<Long> getOfflineIdsToDelete() { - List<Long> offlineIds = new ArrayList<>(); - for (OfflinePageItem offlinePage : mOfflinePagesToDelete) { - offlineIds.add(offlinePage.getOfflineId()); - } - return offlineIds; - } - - /** Returns a total size of offline pages that will be deleted. */ - private long getTotalSize() { - long totalSize = 0; - for (OfflinePageItem offlinePage : mOfflinePagesToDelete) { - totalSize += offlinePage.getFileSize(); - } - return totalSize; - } -}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageItem.java b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageItem.java index 75b4973b..d004de6 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageItem.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageItem.java
@@ -57,11 +57,13 @@ } /** @return Size of the offline copy of the page. */ + @VisibleForTesting public long getFileSize() { return mFileSize; } /** @return Time in milliseconds the offline page was created. */ + @VisibleForTesting public long getCreationTimeMs() { return mCreationTimeMs; } @@ -73,6 +75,7 @@ } /** @return Last time in milliseconds the offline page has been accessed. */ + @VisibleForTesting public long getLastAccessTimeMs() { return mLastAccessTimeMs; }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageOpenStorageSettingsDialog.java b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageOpenStorageSettingsDialog.java deleted file mode 100644 index b5b7172b..0000000 --- a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageOpenStorageSettingsDialog.java +++ /dev/null
@@ -1,44 +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. - -package org.chromium.chrome.browser.offlinepages; - -import android.content.Context; -import android.content.DialogInterface; -import android.content.DialogInterface.OnClickListener; -import android.content.Intent; -import android.provider.Settings; -import android.support.v7.app.AlertDialog; - -import org.chromium.chrome.R; - -/** - * A dialog that prompts the user to open the Storage page in Android settings. - * - * Shown when an offline page can't be saved because the device storage is almost full. - */ -public class OfflinePageOpenStorageSettingsDialog { - public static void showDialog(final Context context) { - OnClickListener listener = new OnClickListener() { - @Override - public void onClick(DialogInterface dialog, int id) { - if (id == AlertDialog.BUTTON_NEGATIVE) { - dialog.cancel(); - return; - } - context.startActivity(new Intent(Settings.ACTION_MEMORY_CARD_SETTINGS)); - } - }; - - AlertDialog.Builder builder = - new AlertDialog.Builder(context, R.style.AlertDialogTheme) - .setTitle(OfflinePageUtils.getStringId( - R.string.offline_pages_free_up_space_title)) - .setPositiveButton(R.string.offline_pages_view_button, listener) - .setNegativeButton(R.string.cancel, listener) - .setMessage(OfflinePageUtils.getStringId( - R.string.offline_pages_open_storage_settings_dialog_text)); - builder.create().show(); - } -}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageStorageSpaceHeader.java b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageStorageSpaceHeader.java deleted file mode 100644 index f933968..0000000 --- a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageStorageSpaceHeader.java +++ /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. - -package org.chromium.chrome.browser.offlinepages; - -import android.app.Activity; -import android.content.Context; -import android.support.v7.widget.RecyclerView.ViewHolder; -import android.text.format.Formatter; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.TextView; - -import org.chromium.base.metrics.RecordUserAction; -import org.chromium.chrome.R; - -/** - * Header shown in saved pages view to inform user of total used storage and offer freeing up - * space. - */ -public class OfflinePageStorageSpaceHeader { - OfflinePageBridge mOfflinePageBridge; - OfflinePageStorageSpacePolicy mOfflinePageStorageSpacePolicy; - Context mContext; - OfflinePageFreeUpSpaceCallback mCallback; - boolean mClicked = false; - - /** - * @param offlinePageBridge An object to access offline page functionality. - */ - public OfflinePageStorageSpaceHeader(Context context, OfflinePageBridge offlinePageBridge, - OfflinePageStorageSpacePolicy offlinePageStorageSpacePolicy, - OfflinePageFreeUpSpaceCallback callback) { - assert offlinePageBridge != null; - mOfflinePageBridge = offlinePageBridge; - mOfflinePageStorageSpacePolicy = offlinePageStorageSpacePolicy; - mContext = context; - mCallback = callback; - } - - public void destroy() { - if (!mClicked) RecordUserAction.record("OfflinePages.FreeUpSpaceHeaderNotClicked"); - } - - /** @return Whether the header should be shown. */ - public boolean shouldShow() { - return mOfflinePageStorageSpacePolicy.shouldShowStorageSpaceHeader(); - } - - /** @return A view holder with the contents of the header. */ - public ViewHolder createHolder(ViewGroup parent) { - // TODO(fgorski): Enable recalculation in case some pages were deleted. - ViewGroup header = (ViewGroup) LayoutInflater.from(mContext).inflate( - R.layout.bookmark_offline_pages_storage_space_header, parent, false); - - ((TextView) header.findViewById(R.id.storage_header_message)) - .setText(mContext.getString( - OfflinePageUtils.getStringId(R.string.offline_pages_storage_space_message), - Formatter.formatFileSize( - mContext, mOfflinePageStorageSpacePolicy.getSizeOfAllPages()))); - - header.findViewById(R.id.storage_header_button) - .setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - mClicked = true; - RecordUserAction.record("OfflinePages.FreeUpSpaceHeaderClicked"); - OfflinePageFreeUpSpaceDialog dialog = - OfflinePageFreeUpSpaceDialog.newInstance( - mOfflinePageBridge, mCallback); - dialog.show(((Activity) mContext).getFragmentManager(), null); - } - }); - - return new ViewHolder(header) {}; - } -}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageStorageSpacePolicy.java b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageStorageSpacePolicy.java deleted file mode 100644 index 06dc5e1..0000000 --- a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageStorageSpacePolicy.java +++ /dev/null
@@ -1,87 +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. - -package org.chromium.chrome.browser.offlinepages; - -import org.chromium.base.Callback; - -import java.util.List; - -/** - * Manages the storage space policy for offline pages. - * - * When created, it records the size on disk that is being used, this value never changes after - * creation so make a new OfflinePageStorageSpacePolicy whenever a new measurement is desired. - */ -public class OfflinePageStorageSpacePolicy { - /** - * Minimal total size of all pages, before a header will be shown to offer freeing up space. - */ - private static final long MINIMUM_TOTAL_SIZE_BYTES = 10 * (1 << 20); // 10MB - /** - * Minimal size of pages to clean up, before a header will be shown to offer freeing up space. - */ - private static final long MINIMUM_CLEANUP_SIZE_BYTES = 5 * (1 << 20); // 5MB - - private long mSizeOfAllPages; - private long mSizeOfPagesToCleanUp; - - /** - * Asynchronously creates an OffinePageStorageSpacePolicy which is prefilled with information - * about the state of the disk usage of Offline Pages. - */ - public static void create(final OfflinePageBridge offlinePageBridge, - final Callback<OfflinePageStorageSpacePolicy> callback) { - assert offlinePageBridge != null; - offlinePageBridge.getAllPages(new OfflinePageBridge.MultipleOfflinePageItemCallback() { - @Override - public void onResult(List<OfflinePageItem> allPages) { - callback.onResult(new OfflinePageStorageSpacePolicy(offlinePageBridge, allPages)); - } - }); - } - - /** - * Creates a policy object with the given list of offline pages. - * - * @param offlinePageBridge An object to access offline page functionality. - * @param offlinePages The list of all offline pages. - */ - private OfflinePageStorageSpacePolicy( - OfflinePageBridge offlinePageBridge, List<OfflinePageItem> offlinePages) { - mSizeOfAllPages = getTotalSize(offlinePages); - mSizeOfPagesToCleanUp = getTotalSize(offlinePageBridge.getPagesToCleanUp()); - } - - /** @return Whether there exists offline pages that could be cleaned up to make space. */ - public boolean hasPagesToCleanUp() { - return mSizeOfPagesToCleanUp > 0; - } - - /** - * @return Whether the header should be shown in saved pages view to inform user of total used - * storage and offer freeing up space. - */ - public boolean shouldShowStorageSpaceHeader() { - return getSizeOfAllPages() > MINIMUM_TOTAL_SIZE_BYTES - && getSizeOfPagesToCleanUp() > MINIMUM_CLEANUP_SIZE_BYTES; - } - - /** @return Total size, in bytes, of all saved pages. */ - public long getSizeOfAllPages() { - return mSizeOfAllPages; - } - - private long getSizeOfPagesToCleanUp() { - return mSizeOfPagesToCleanUp; - } - - private long getTotalSize(List<OfflinePageItem> offlinePages) { - long totalSize = 0; - for (OfflinePageItem page : offlinePages) { - totalSize += page.getFileSize(); - } - return totalSize; - } -}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtils.java index 9333a7c95..3ffb456 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtils.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtils.java
@@ -4,14 +4,12 @@ package org.chromium.chrome.browser.offlinepages; -import android.app.Activity; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.os.BatteryManager; import android.os.Environment; -import org.chromium.base.Callback; import org.chromium.base.Log; import org.chromium.base.metrics.RecordHistogram; import org.chromium.base.metrics.RecordUserAction; @@ -22,8 +20,9 @@ import org.chromium.chrome.browser.snackbar.SnackbarManager.SnackbarController; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.tabmodel.TabModelSelector; -import org.chromium.components.offlinepages.FeatureMode; +import org.chromium.components.bookmarks.BookmarkId; import org.chromium.content_public.browser.LoadUrlParams; +import org.chromium.content_public.browser.WebContents; import org.chromium.net.ConnectionType; import org.chromium.net.NetworkChangeNotifier; import org.chromium.ui.base.PageTransition; @@ -55,80 +54,53 @@ } /** - * Returns true if the stoarge is almost full which indicates that the user probably needs to - * free up some space. - */ - public static boolean isStorageAlmostFull() { - return getFreeSpaceInBytes() < STORAGE_ALMOST_FULL_THRESHOLD_BYTES; - } - - /** * Returns true if the network is connected. */ public static boolean isConnected() { return NetworkChangeNotifier.isOnline(); } - /** - * Finds out the appropriate resource ID of UI string shown to the user. - * @param stringResId The resource ID of UI string used when 'bookmarks' name is used in UI - * strings. - * return The resource ID of UI string shown to the user, depending on the experiment. + /* + * Save an offline copy for the bookmarked page asynchronously. + * + * @param bookmarkId The ID of the page to save an offline copy. + * @param tab A {@link Tab} object. + * @param callback The callback to be invoked when the offline copy is saved. */ - public static int getStringId(int stringResId) { - if (!OfflinePageBridge.isEnabled()) { - return stringResId; - } - if (OfflinePageBridge.getFeatureMode() != FeatureMode.ENABLED_AS_SAVED_PAGES) { - return stringResId; - } - if (stringResId == R.string.bookmark_action_bar_delete) { - return R.string.offline_pages_action_bar_delete; - } else if (stringResId == R.string.bookmark_action_bar_move) { - return R.string.offline_pages_action_bar_move; - } else if (stringResId == R.string.bookmark_action_bar_search) { - return R.string.offline_pages_action_bar_search; - } else if (stringResId == R.string.edit_bookmark) { - return R.string.offline_pages_edit_item; - } else if (stringResId == R.string.bookmark_drawer_all_items) { - return R.string.offline_pages_all_items; - } else if (stringResId == R.string.bookmark_title_bar_all_items) { - return R.string.offline_pages_all_items; - } else if (stringResId == R.string.bookmarks) { - return R.string.offline_pages_saved_pages; - } else if (stringResId == R.string.menu_bookmarks) { - return R.string.menu_bookmarks_offline_pages; - } else if (stringResId == R.string.ntp_bookmarks) { - return R.string.offline_pages_ntp_button_name; - } else if (stringResId == R.string.accessibility_ntp_toolbar_btn_bookmarks) { - return R.string.offline_pages_ntp_button_accessibility; - } else if (stringResId == R.string.bookmarks_folder_empty) { - return R.string.offline_pages_folder_empty; - } else if (stringResId == R.string.new_tab_incognito_message) { - return R.string.offline_pages_new_tab_incognito_message; - } else if (stringResId == R.string.offline_pages_as_bookmarks_page_saved) { - return R.string.offline_pages_page_saved; - } else if (stringResId == R.string.offline_pages_as_bookmarks_page_saved_folder) { - return R.string.offline_pages_page_saved_folder; - } else if (stringResId == R.string.offline_pages_as_bookmarks_page_skipped) { - return R.string.offline_pages_page_skipped; - } else if (stringResId - == R.string.offline_pages_as_bookmarks_page_saved_storage_near_full) { - return R.string.offline_pages_page_saved_storage_near_full; - } else if (stringResId == R.string.offline_pages_as_bookmarks_page_failed_to_save) { - return R.string.offline_pages_page_failed_to_save; - } else if (stringResId - == R.string.offline_pages_as_bookmarks_page_failed_to_save_storage_near_full) { - return R.string.offline_pages_page_failed_to_save_storage_near_full; - } else if (stringResId == R.string.offline_pages_as_bookmarks_storage_space_message) { - return R.string.offline_pages_storage_space_message; - } else if (stringResId == R.string.offline_pages_as_bookmarks_viewing_offline_page) { - return R.string.offline_pages_viewing_offline_page; - } else if (stringResId == R.string.offline_pages_as_bookmarks_offline_page_size) { - return R.string.bookmark_offline_page_size; - } else { - return stringResId; - } + public static void saveBookmarkOffline(BookmarkId bookmarkId, Tab tab) { + // If bookmark ID is missing there is nothing to save here. + if (bookmarkId == null) return; + + // Making sure the feature is enabled. + if (!OfflinePageBridge.isEnabled()) return; + + // Making sure tab is worth keeping. + if (shouldSkipSavingTabOffline(tab)) return; + + OfflinePageBridge offlinePageBridge = OfflinePageBridge.getForProfile(tab.getProfile()); + if (offlinePageBridge == null) return; + + WebContents webContents = tab.getWebContents(); + ClientId clientId = ClientId.createClientIdForBookmarkId(bookmarkId); + + // TODO(fgorski): Ensure that request is queued if the model is not loaded. + offlinePageBridge.savePage(webContents, clientId, new OfflinePageBridge.SavePageCallback() { + @Override + public void onSavePageDone(int savePageResult, String url, long offlineId) { + // TODO(fgorski): Decide if we need to do anything with result. + // Perhaps some UMA reporting, but that can really happen someplace else. + } + }); + } + + /** + * Indicates whether we should skip saving the given tab as an offline page. + * A tab shouldn't be saved offline if it shows an error page or a sad tab page. + */ + private static boolean shouldSkipSavingTabOffline(Tab tab) { + WebContents webContents = tab.getWebContents(); + return tab.isShowingErrorPage() || tab.isShowingSadTab() || webContents == null + || webContents.isDestroyed() || webContents.isIncognito(); } /** @@ -190,69 +162,16 @@ if (tabId == Tab.INVALID_TAB_ID) return; Log.d(TAG, "showReloadSnackbar called with controller " + snackbarController); - final int snackbarTextId = getStringId(R.string.offline_pages_viewing_offline_page); - Snackbar snackbar = Snackbar.make(context.getString(snackbarTextId), snackbarController, - Snackbar.TYPE_ACTION) - .setSingleLine(false) - .setAction(context.getString(R.string.reload), tabId); + Snackbar snackbar = + Snackbar.make(context.getString(R.string.offline_pages_viewing_offline_page), + snackbarController, Snackbar.TYPE_ACTION) + .setSingleLine(false) + .setAction(context.getString(R.string.reload), tabId); snackbar.setDuration(SNACKBAR_DURATION); snackbarManager.showSnackbar(snackbar); } /** - * Creates a snackbar controller for a case where "Free up space" button is shown to clean up - * space taken by the offline pages. - */ - public static SnackbarController createSnackbarControllerForFreeUpSpaceButton( - final OfflinePageBridge offlinePageBridge, final SnackbarManager snackbarManager, - final Activity activity) { - return new SnackbarController() { - @Override - public void onDismissNoAction(Object actionData) { - // This method will be called only if the snackbar is dismissed by timeout. - RecordUserAction.record( - "OfflinePages.SaveStatusSnackbar.FreeUpSpaceButtonNotClicked"); - } - - @Override - public void onAction(Object actionData) { - RecordUserAction.record("OfflinePages.SaveStatusSnackbar.FreeUpSpaceButtonClicked"); - Callback<OfflinePageStorageSpacePolicy> callback = - getStorageSpacePolicyCallback(offlinePageBridge, snackbarManager, activity); - - OfflinePageStorageSpacePolicy.create(offlinePageBridge, callback); - } - }; - } - - private static Callback<OfflinePageStorageSpacePolicy> getStorageSpacePolicyCallback( - final OfflinePageBridge offlinePageBridge, final SnackbarManager snackbarManager, - final Activity activity) { - return new Callback<OfflinePageStorageSpacePolicy>() { - @Override - public void onResult(OfflinePageStorageSpacePolicy policy) { - if (policy.hasPagesToCleanUp()) { - OfflinePageFreeUpSpaceCallback callback = new OfflinePageFreeUpSpaceCallback() { - @Override - public void onFreeUpSpaceDone() { - snackbarManager.showSnackbar( - OfflinePageFreeUpSpaceDialog.createStorageClearedSnackbar( - activity)); - } - @Override - public void onFreeUpSpaceCancelled() {} - }; - OfflinePageFreeUpSpaceDialog dialog = - OfflinePageFreeUpSpaceDialog.newInstance(offlinePageBridge, callback); - dialog.show(activity.getFragmentManager(), null); - } else { - OfflinePageOpenStorageSettingsDialog.showDialog(activity); - } - } - }; - } - - /** * Gets a snackbar controller that we can use to show our snackbar. * @param tabModelSelector used to retrieve a tab by ID */
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarLayout.java b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarLayout.java index 95bc2647..90880e3 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarLayout.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarLayout.java
@@ -90,7 +90,6 @@ import org.chromium.chrome.browser.widget.TintedImageButton; import org.chromium.components.security_state.ConnectionSecurityLevel; import org.chromium.content.browser.ContentViewCore; -import org.chromium.content.browser.accessibility.BrowserAccessibilityManager; import org.chromium.content_public.browser.LoadUrlParams; import org.chromium.content_public.browser.WebContents; import org.chromium.ui.UiUtils; @@ -217,10 +216,6 @@ private OmniboxPrerender mOmniboxPrerender; - private View mFocusedTabView; - private int mFocusedTabImportantForAccessibilityState; - private BrowserAccessibilityManager mFocusedTabAccessibilityManager; - private boolean mSuggestionModalShown; private boolean mUseDarkColors; private boolean mIsEmphasizingHttpsScheme; @@ -2130,46 +2125,16 @@ private void updateOmniboxResultsContainerVisibility(boolean visible) { boolean currentlyVisible = mOmniboxResultsContainer.getVisibility() == VISIBLE; - if (currentlyVisible == visible) { - // This early return is necessary. Otherwise, calling - // updateOmniboxResultsContainerVisibility(true) twice in a row will update - // mFocusedTabImportantForAccessibilityState incorrectly and cause - // mFocusedTabView to be stuck in IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS mode. - // http://crbug.com/445560 - return; - } + if (currentlyVisible == visible) return; + + ChromeActivity activity = (ChromeActivity) mWindowAndroid.getActivity().get(); if (visible) { mOmniboxResultsContainer.setVisibility(VISIBLE); - - if (getContentViewCore() != null) { - mFocusedTabAccessibilityManager = - getContentViewCore().getBrowserAccessibilityManager(); - if (mFocusedTabAccessibilityManager != null) { - mFocusedTabAccessibilityManager.setVisible(false); - } - } - - if (getCurrentTab() != null && getCurrentTab().getView() != null) { - mFocusedTabView = getCurrentTab().getView(); - mFocusedTabImportantForAccessibilityState = - mFocusedTabView.getImportantForAccessibility(); - mFocusedTabView.setImportantForAccessibility( - IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS); - } + if (activity != null) activity.addViewObscuringAllTabs(mOmniboxResultsContainer); } else { mOmniboxResultsContainer.setVisibility(INVISIBLE); - - if (mFocusedTabAccessibilityManager != null) { - mFocusedTabAccessibilityManager.setVisible(true); - mFocusedTabAccessibilityManager = null; - } - - if (mFocusedTabView != null) { - mFocusedTabView.setImportantForAccessibility( - mFocusedTabImportantForAccessibilityState); - mFocusedTabView = null; - } + if (activity != null) activity.removeViewObscuringAllTabs(mOmniboxResultsContainer); } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestDialog.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestDialog.java deleted file mode 100644 index 5002b9d..0000000 --- a/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestDialog.java +++ /dev/null
@@ -1,58 +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. - -package org.chromium.chrome.browser.payments; - -import android.content.Context; - -import org.chromium.mojo.system.MojoException; -import org.chromium.mojom.payments.PaymentDetails; -import org.chromium.mojom.payments.PaymentOptions; -import org.chromium.mojom.payments.PaymentRequest; -import org.chromium.mojom.payments.PaymentRequestClient; - -/** - * Android implementation of the PaymentRequest service defined in - * third_party/WebKit/public/platform/modules/payments/payment_request.mojom. - */ -public class PaymentRequestDialog implements PaymentRequest { - private final Context mApplicationContext; - private PaymentRequestClient mClient; - - /** - * Builds the dialog. - * - * @param applicationContext The application context. - */ - public PaymentRequestDialog(Context applicationContext) { - mApplicationContext = applicationContext; - } - - @Override - public void setClient(PaymentRequestClient client) { - mClient = client; - } - - @Override - public void show(String[] supportedMethods, PaymentDetails details, PaymentOptions options, - String stringifiedData) { - assert mClient != null; - mClient.onError(); - } - - @Override - public void abort() {} - - @Override - public void complete(boolean success) { - assert mClient != null; - mClient.onComplete(); - } - - @Override - public void close() {} - - @Override - public void onConnectionError(MojoException e) {} -}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestFactory.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestFactory.java index 16167c7..83da5e0 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestFactory.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestFactory.java
@@ -4,28 +4,27 @@ package org.chromium.chrome.browser.payments; -import android.content.Context; - import org.chromium.content.browser.ServiceRegistry.ImplementationFactory; +import org.chromium.content_public.browser.WebContents; import org.chromium.mojom.payments.PaymentRequest; /** * Creates instances of PaymentRequest. */ public class PaymentRequestFactory implements ImplementationFactory<PaymentRequest> { - private final Context mApplicationContext; + private final WebContents mWebContents; /** * Builds a factory for PaymentRequest. * - * @param applicationContext The application context. + * @param webContents The web contents that may invoke the PaymentRequest API. */ - public PaymentRequestFactory(Context applicationContext) { - mApplicationContext = applicationContext; + public PaymentRequestFactory(WebContents webContents) { + mWebContents = webContents; } @Override public PaymentRequest createImpl() { - return new PaymentRequestDialog(mApplicationContext); + return new PaymentRequestImpl(mWebContents); } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java new file mode 100644 index 0000000..b66f3b0 --- /dev/null +++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java
@@ -0,0 +1,65 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.payments; + +import org.chromium.content_public.browser.WebContents; +import org.chromium.mojo.system.MojoException; +import org.chromium.mojom.payments.PaymentDetails; +import org.chromium.mojom.payments.PaymentOptions; +import org.chromium.mojom.payments.PaymentRequest; +import org.chromium.mojom.payments.PaymentRequestClient; + +/** + * Android implementation of the PaymentRequest service defined in + * third_party/WebKit/public/platform/modules/payments/payment_request.mojom. + */ +public class PaymentRequestImpl implements PaymentRequest { + /** + * Builds the dialog. + * + * @param webContents The web contents that have invoked the PaymentRequest API. + */ + public PaymentRequestImpl(WebContents webContents) {} + + /** + * Called by the renderer to provide an endpoint for callbacks. + */ + @Override + public void setClient(PaymentRequestClient client) { + assert client != null; + client.onError(); + } + + /** + * Called by the merchant website to show the payment request to the user. + */ + @Override + public void show(String[] supportedMethods, PaymentDetails details, PaymentOptions options, + String stringifiedData) {} + + /** + * Called by the merchant website to abort the payment. + */ + @Override + public void abort() {} + + /** + * Called when the merchant website has processed the payment. + */ + @Override + public void complete(boolean success) {} + + /** + * Called when the renderer closes the Mojo connection. + */ + @Override + public void close() {} + + /** + * Called when the Mojo connection encounters an error. + */ + @Override + public void onConnectionError(MojoException e) {} +}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/LineItem.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/LineItem.java new file mode 100644 index 0000000..0d702921 --- /dev/null +++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/LineItem.java
@@ -0,0 +1,54 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.payments.ui; + +/** + * The line item on the bill. + */ +public class LineItem { + private final String mLabel; + private final String mCurrency; + private final String mPrice; + + /** + * Builds a line item. + * + * @param label The line item label. + * @param currency The currency code. + * @param price The price string. + */ + public LineItem(String label, String currency, String price) { + mLabel = label; + mCurrency = currency; + mPrice = price; + } + + /** + * Returns the label of this line item. For example, “CA state tax”. + * + * @return The label of this line item. + */ + public String getLabel() { + return mLabel; + } + + /** + * Returns the currency code string of this line item. For example, “USD”. + * + * @return The currency code string of this line item. + */ + public String getCurrency() { + return mCurrency; + } + + /** + * Returns the price string of this line item. For example, “$10.00”. + * + * @return The price string of this line item. + */ + public String getPrice() { + return mPrice; + } +}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentInformation.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentInformation.java new file mode 100644 index 0000000..2dcda8d --- /dev/null +++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentInformation.java
@@ -0,0 +1,90 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.payments.ui; + +import java.util.ArrayList; + +/** + * The data to show in the PaymentRequest UI when first showing the UI. + */ +public class PaymentInformation { + private final ArrayList<LineItem> mLineItems; + private final SectionInformation mShippingAddresses; + private final SectionInformation mShippingOptions; + private final SectionInformation mPaymentMethods; + + /** + * Builds the default payment information to show in the initial PaymentRequest view. + * + * @param totalPrice The total price. + * @param defaultShippingAddress The default shipping address. + * @param defaultShippingOption The defaullt shipping option. + * @param defaultPaymentMethod The default payment method. + */ + public PaymentInformation(LineItem totalPrice, PaymentOption defaultShippingAddress, + PaymentOption defaultShippingOption, PaymentOption defaultPaymentMethod) { + mLineItems = new ArrayList<LineItem>(1); + mLineItems.add(totalPrice); + mShippingAddresses = new SectionInformation(defaultShippingAddress); + mShippingOptions = new SectionInformation(defaultShippingOption); + mPaymentMethods = new SectionInformation(defaultPaymentMethod); + } + + /** + * Returns the line items on the bill. + * + * @return The line items on the bill. + */ + public ArrayList<LineItem> getLineItems() { + return mLineItems; + } + + /** + * Returns the shipping addresses. + * + * @return The shipping addresses. + */ + public SectionInformation getShippingAddresses() { + return mShippingAddresses; + } + + /** + * Returns the label for the selected shipping address. + * + * @return The label for the selected shipping address or null. + */ + public String getSelectedShippingAddressLabel() { + PaymentOption address = mShippingAddresses.getSelectedItem(); + return address != null ? address.getLabel() : null; + } + + /** + * Returns the shipping options. + * + * @return The shipping options. + */ + public SectionInformation getShippingOptions() { + return mShippingAddresses; + } + + /** + * Returns the label for the selected shipping option. + * + * @return The label for the selected shipping option or null. + */ + public String getSelectedShippingOptionLabel() { + PaymentOption option = mShippingOptions.getSelectedItem(); + return option != null ? option.getLabel() : null; + } + + /** + * Returns the payment methods. + * + * @return The payment methods. + */ + public SectionInformation getPaymentMethods() { + return mPaymentMethods; + } +}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentOption.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentOption.java new file mode 100644 index 0000000..99d17c5 --- /dev/null +++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentOption.java
@@ -0,0 +1,66 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.payments.ui; + +/** + * An option that the user can select, e.g., a shipping option, a shipping address, or a payment + * method. + */ +public class PaymentOption { + /** + * The placeholder value that indicates the absence of an icon for this option. + */ + public static final int NO_ICON = 0; + + private final String mId; + private final String mLabel; + private final String mSublabel; + private final int mIcon; + + /** + * Constructs a payment option. + * + * @param id The identifier. + * @param label The label. + * @param sublabel The optional sublabel. + * @param icon The drawable icon identifier or NO_ICON. + */ + public PaymentOption(String id, String label, String sublabel, int icon) { + mId = id; + mLabel = label; + mSublabel = sublabel; + mIcon = icon; + } + + /** + * The non-human readable identifier for this option. For example, "standard_shipping" or the + * GUID of an autofill card. + */ + public String getIdentifier() { + return mId; + } + + /** + * The primary label of this option. For example, “Visa***1234” or "2-day shipping". + */ + public String getLabel() { + return mLabel; + } + + /** + * The optional sublabel of this option. For example, “Expiration date: 12/2025”. + */ + public String getSublabel() { + return mSublabel; + } + + /** + * The identifier for the drawable icon for this payment option. For example, + * R.drawable.visa_card_issuer_icon or NO_ICON. + */ + public int getDrawableIconId() { + return mIcon; + } +}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestUI.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestUI.java new file mode 100644 index 0000000..6d939b74 --- /dev/null +++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestUI.java
@@ -0,0 +1,607 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.payments.ui; + +import android.app.Activity; +import android.app.Dialog; +import android.content.Context; +import android.content.DialogInterface; +import android.graphics.Bitmap; +import android.graphics.Color; +import android.os.Handler; +import android.view.Gravity; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.view.Window; +import android.widget.Button; +import android.widget.ImageView; +import android.widget.RadioButton; +import android.widget.TextView; + +import org.chromium.base.Callback; +import org.chromium.chrome.R; +import org.chromium.chrome.browser.widget.AlwaysDismissedDialog; + +import java.util.ArrayList; + +/** + * The PaymentRequest UI. + */ +public class PaymentRequestUI implements DialogInterface.OnDismissListener, View.OnClickListener { + /** + * The interface to be implemented by the consumer of the PaymentRequest UI. + */ + public interface Client { + /** + * Asynchronously returns the default payment information. + */ + void getDefaultPaymentInformation(Callback<PaymentInformation> callback); + + /** + * Asynchronously returns the full bill. The last line item is the total. + */ + void getLineItems(Callback<ArrayList<LineItem>> callback); + + /** + * Asynchronously returns the full list of available shipping addresses. + */ + void getShippingAddresses(Callback<SectionInformation> callback); + + /** + * Asynchronously returns the full list of available shipping options. + */ + void getShippingOptions(Callback<SectionInformation> callback); + + /** + * Asynchronously returns the full list of available payment methods. + */ + void getPaymentMethods(Callback<SectionInformation> callback); + + /** + * Called when the user changes the current shipping address. This may update the line items + * and/or the shipping options. + */ + void onShippingAddressChanged(PaymentOption selectedShippingAddress); + + /** + * Called when the user changes the current shipping option. This may update the line items. + */ + void onShippingOptionChanged(PaymentOption selectedShippingOption); + + /** + * Called when the user changes the current payment method. + */ + void onPaymentMethodChanged(PaymentOption selectedPaymentMethod); + + /** + * Called when the user clicks on the “Pay” button. At this point, the UI is disabled and is + * showing a spinner. + */ + void onPayClicked(PaymentOption selectedShippingAddress, + PaymentOption selectedShippingOption, PaymentOption selectedPaymentMethod); + + /** + * Called when the user dismisses the UI via the “back” button on their phone + * or the “X” button in UI. + */ + void onDismiss(); + } + + /** + * The number of milliseconds to display "Payment processed" or "Error processing payment" + * message. + */ + private static final int SHOW_RESULT_DELAY_MS = 3000; + + private final Context mContext; + private final Client mClient; + private final boolean mRequestShipping; + + private final Dialog mDialog; + private final ViewGroup mContainer; + private final View mPaymentContainer; + private final View mWaitingOverlay; + private final View mWaitingProgressBar; + private final View mWaitingSuccess; + private final TextView mWaitingMessage; + private final Button mEditButton; + private final Button mPayButton; + + private final View mOrderSummaryLabel; + private final ViewGroup mOrderSummary; + + private final View mShippingSummaryLabel; + private final View mShippingSummary; + private final TextView mShippingSummaryAddress; + private final TextView mShippingSummaryOption; + private final View mShippingSummarySeparator; + + private final View mShippingAddressesLabel; + private final ViewGroup mShippingAddresses; + private final View mShippingAddressesSeparator; + + private final View mShippingOptionsLabel; + private final View mSelectShippingOptionPrompt; + private final ViewGroup mShippingOptions; + private final View mShippingOptionsSeparator; + + private final View mPaymentMethodsLabel; + private final ViewGroup mPaymentMethods; + + private View mSelectedSectionLabel; + private ViewGroup mSelectedSection; + + private ArrayList<LineItem> mLineItems; + private SectionInformation mPaymentMethodsSection; + private SectionInformation mShippingAddressesSection; + private SectionInformation mShippingOptionsSection; + + /** + * Builds and shows the UI for PaymentRequest. + * + * @param activity The activity on top of which the UI should be displayed. + * @param client The consumer of the PaymentRequest UI. + * @param requestShipping Whether the UI should show the shipping address and option selection. + * @param title The title to show at the top of the UI. This can be, for example, the + * <title> of the merchant website. If the string is too long for UI, + * it elides at the end. + * @param origin The origin (part of URL) to show under the title. For example, + * “https://shop.momandpop.com”. If the origin is too long for the UI, + * it should elide according to: + * https://www.chromium.org/Home/chromium-security/enamel#TOC-Eliding-Origin-Names-And-Hostnames + */ + public PaymentRequestUI(Activity activity, Client client, boolean requestShipping, String title, + String origin) { + mContext = activity; + mClient = client; + mRequestShipping = requestShipping; + + mContainer = + (ViewGroup) LayoutInflater.from(mContext).inflate(R.layout.payment_request, null); + ((TextView) mContainer.findViewById(R.id.pageTitle)).setText(title); + ((TextView) mContainer.findViewById(R.id.hostname)).setText(origin); + + mPaymentContainer = mContainer.findViewById(R.id.paymentContainer); + mWaitingOverlay = mContainer.findViewById(R.id.waitingOverlay); + mWaitingProgressBar = mContainer.findViewById(R.id.waitingProgressBar); + mWaitingSuccess = mContainer.findViewById(R.id.waitingSuccess); + mWaitingMessage = (TextView) mContainer.findViewById(R.id.waitingMessage); + + mEditButton = (Button) mContainer.findViewById(R.id.editButton); + mEditButton.setOnClickListener(this); + + mPayButton = (Button) mContainer.findViewById(R.id.payButton); + mPayButton.setOnClickListener(this); + + mOrderSummaryLabel = mContainer.findViewById(R.id.orderSummaryLabel); + mOrderSummary = (ViewGroup) mContainer.findViewById(R.id.lineItems); + mOrderSummaryLabel.setOnClickListener(this); + mOrderSummary.setOnClickListener(this); + + mShippingSummaryLabel = mContainer.findViewById(R.id.shippingSummaryLabel); + mShippingSummary = mContainer.findViewById(R.id.shippingSummary); + mShippingSummaryAddress = (TextView) mContainer.findViewById(R.id.shippingSummaryAddress); + mShippingSummaryOption = (TextView) mContainer.findViewById(R.id.shippingSummaryOption); + mShippingSummarySeparator = mContainer.findViewById(R.id.shippingSummarySeparator); + + mShippingAddressesLabel = mContainer.findViewById(R.id.shippingAddressesLabel); + mShippingAddresses = (ViewGroup) mContainer.findViewById(R.id.shippingAddresses); + mShippingAddressesSeparator = mContainer.findViewById(R.id.shippingAddressesSeparator); + + mShippingOptionsLabel = mContainer.findViewById(R.id.shippingOptionsLabel); + mSelectShippingOptionPrompt = mContainer.findViewById(R.id.selectShippingOptionPrompt); + mShippingOptions = (ViewGroup) mContainer.findViewById(R.id.shippingOptions); + mShippingOptionsSeparator = mContainer.findViewById(R.id.shippingOptionsSeparator); + + if (mRequestShipping) { + mShippingSummaryLabel.setOnClickListener(this); + mShippingSummaryAddress.setOnClickListener(this); + mShippingAddressesLabel.setOnClickListener(this); + mShippingAddresses.setOnClickListener(this); + mShippingSummaryOption.setOnClickListener(this); + mShippingOptionsLabel.setOnClickListener(this); + mSelectShippingOptionPrompt.setOnClickListener(this); + mShippingOptions.setOnClickListener(this); + } else { + mShippingSummaryLabel.setVisibility(View.GONE); + mShippingSummary.setVisibility(View.GONE); + mShippingSummarySeparator.setVisibility(View.GONE); + } + + mPaymentMethodsLabel = mContainer.findViewById(R.id.paymentsListLabel); + mPaymentMethods = (ViewGroup) mContainer.findViewById(R.id.paymentsList); + mPaymentMethodsLabel.setOnClickListener(this); + mPaymentMethods.setOnClickListener(this); + + mDialog = new AlwaysDismissedDialog(activity, R.style.DialogWhenLarge); + mDialog.setOnDismissListener(this); + mDialog.addContentView( + mContainer, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, + ViewGroup.LayoutParams.MATCH_PARENT)); + Window dialogWindow = mDialog.getWindow(); + dialogWindow.setGravity(Gravity.BOTTOM); + dialogWindow.setLayout( + ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); + mDialog.show(); + + mClient.getDefaultPaymentInformation(new Callback<PaymentInformation>() { + public void onResult(PaymentInformation result) { + updateLineItems(result.getLineItems()); + + if (mRequestShipping) { + mShippingAddressesSection = result.getShippingAddresses(); + String selectedAddressLabel = result.getSelectedShippingAddressLabel(); + if (selectedAddressLabel != null) { + mShippingSummaryAddress.setText(selectedAddressLabel); + } + + mShippingOptionsSection = result.getShippingOptions(); + String selectedShippingOptionLabel = result.getSelectedShippingOptionLabel(); + if (selectedShippingOptionLabel != null) { + mShippingSummaryOption.setText(selectedShippingOptionLabel); + } else { + mShippingSummaryOption.setText(mContext.getString( + R.string.payments_select_shipping_option_prompt)); + } + } + + mPaymentMethodsSection = result.getPaymentMethods(); + updateSection(mPaymentMethods, mPaymentMethodsSection, null); + } + }); + } + + /** + * Closes the UI. Can be invoked in response to, for example: + * <ul> + * <li>Successfully processing the payment.</li> + * <li>Failure to process the payment.</li> + * <li>The JavaScript calling the abort() method in PaymentRequest API.</li> + * <li>The PaymentRequest JavaScript object being destroyed.</li> + * </ul> + * + * Does not call Client.onDismissed(). + * + * Should not be called multiple times. + * + * @param paymentSuccess Whether the payment (if any) was successful. + * @param callback The callback to notify of finished animations. + */ + public void close(boolean paymentSuccess, final Runnable callback) { + mDialog.setOnDismissListener(null); + + if (mWaitingOverlay.getVisibility() == View.GONE) { + mDialog.dismiss(); + if (callback != null) callback.run(); + return; + } + + mWaitingProgressBar.setVisibility(View.GONE); + + if (paymentSuccess) { + mWaitingSuccess.setVisibility(View.VISIBLE); + mWaitingMessage.setText(mContext.getString(R.string.payments_success_message)); + } else { + mWaitingMessage.setText(mContext.getString(R.string.payments_error_message)); + } + + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + mDialog.dismiss(); + if (callback != null) callback.run(); + } + }, SHOW_RESULT_DELAY_MS); + } + + /** + * Sets the icon in the top left of the UI. This can be, for example, the favicon of the + * merchant website. This is not a part of the constructor because favicon retrieval is + * asynchronous. + * + * @param bitmap The bitmap to show next to the title. + */ + public void setTitleBitmap(Bitmap bitmap) { + ((ImageView) mContainer.findViewById(R.id.pageFavIcon)).setImageBitmap(bitmap); + } + + /** + * Updates the line items in response to a changed shipping address or option. + * + * @param lineItems The full bill. The last line item is the total. + */ + public void updateLineItems(ArrayList<LineItem> lineItems) { + mLineItems = lineItems; + mOrderSummary.removeAllViews(); + + if (mLineItems == null || mLineItems.isEmpty()) { + mOrderSummary.setVisibility(View.GONE); + return; + } + + mOrderSummary.setVisibility(View.VISIBLE); + + LineItem total = lineItems.get(lineItems.size() - 1); + mOrderSummary.addView(buildLineItem(total)); + + if (mSelectedSection != mOrderSummary) return; + + for (LineItem item : lineItems) { + if (item == total) return; + mOrderSummary.addView(buildLineItem(item)); + } + } + + private ViewGroup buildLineItem(LineItem item) { + ViewGroup line = + (ViewGroup) LayoutInflater.from(mContext).inflate(R.layout.payment_line_item, null); + ((TextView) line.findViewById(R.id.lineItemLabel)).setText(item.getLabel()); + ((TextView) line.findViewById(R.id.lineItemCurrencyCode)).setText(item.getCurrency()); + ((TextView) line.findViewById(R.id.lineItemPrice)).setText(item.getPrice()); + return line; + } + + /** + * Updates the shipping options in response to a changed shipping address. + * + * @param shipping The shipping options. + */ + public void updateShippingOptions(SectionInformation section) { + mShippingOptionsSection = section; + updateSection(mShippingOptions, mShippingOptionsSection, mSelectShippingOptionPrompt); + } + + /** + * Selects or deselects the given section. Possible sections are: shipping address, shipping + * options, and payment methods. + * + * A selected section lists out all options as radio buttons. + * + * A deselected section shows the currently selected option without radio buttons. If there's no + * currently selected option, then selectOptionPrompt is displayed instead. This is important + * for shipping options. If the merchant provides multiple shipping options, then there will be + * no shipping option selected by default. + * + * @param sectionContainer The container for all UI elements of this section. + * @param section The model that contains all options and specifies the currently selected + * option. + * @param selectOptionPrompt The view to show if no option is selected. If null, then nothing + * is shown. + */ + private void updateSection( + ViewGroup sectionContainer, final SectionInformation section, View selectOptionPrompt) { + sectionContainer.removeAllViews(); + if (section == null) { + sectionContainer.setVisibility(View.GONE); + return; + } + + sectionContainer.setVisibility(View.VISIBLE); + + PaymentOption selectedItem = section.getSelectedItem(); + if (mSelectedSection != sectionContainer && selectedItem == null) { + if (selectOptionPrompt != null) selectOptionPrompt.setVisibility(View.VISIBLE); + return; + } + + if (selectOptionPrompt != null) selectOptionPrompt.setVisibility(View.GONE); + + if (mSelectedSection != sectionContainer && selectedItem != null) { + OptionLine line = new OptionLine(mContext, selectedItem); + sectionContainer.addView(line.container); + return; + } + + if (section.isEmpty()) return; + + final OptionLine[] lines = new OptionLine[section.getSize()]; + for (int i = 0; i < lines.length; i++) { + lines[i] = new OptionLine(mContext, section.getItem(i)); + lines[i].radioButton.setVisibility(mSelectedSection == sectionContainer + ? View.VISIBLE : View.GONE); + lines[i].radioButton.setChecked(i == section.getSelectedItemIndex()); + lines[i].container.setClickable(true); + lines[i].container.setTag(new OptionLineTag(section, lines, i)); + lines[i].container.setOnClickListener(this); + sectionContainer.addView(lines[i].container); + } + } + + private static class OptionLine { + public ViewGroup container; + public RadioButton radioButton; + + public OptionLine(Context context, PaymentOption option) { + container = (ViewGroup) LayoutInflater.from(context).inflate( + R.layout.payment_option_line, null); + radioButton = (RadioButton) container.findViewById(R.id.optionRadioButton); + + ((TextView) container.findViewById(R.id.optionLabel)).setText(option.getLabel()); + ((TextView) container.findViewById(R.id.optionSubLabel)).setText(option.getSublabel()); + + if (option.getDrawableIconId() != PaymentOption.NO_ICON) { + ((ImageView) container.findViewById(R.id.optionIcon)) + .setImageResource(option.getDrawableIconId()); + } + } + } + + private static class OptionLineTag { + private final SectionInformation mSection; + private final OptionLine[] mOptionLines; + private final int mThisLineIndex; + + public OptionLineTag(SectionInformation section, OptionLine[] lines, int index) { + mSection = section; + mOptionLines = lines; + mThisLineIndex = index; + } + + public void selectOptionLine() { + mSection.setSelectedItemIndex(mThisLineIndex); + mOptionLines[mThisLineIndex].radioButton.setChecked(true); + for (int i = 0; i < mOptionLines.length; i++) { + if (i == mThisLineIndex) continue; + mOptionLines[i].radioButton.setChecked(false); + } + } + + public SectionInformation getSection() { + return mSection; + } + } + + /** + * Called when user clicks anything in the dialog. + */ + @Override + public void onClick(View v) { + if (v == mOrderSummaryLabel || v == mOrderSummary) { + expand(mOrderSummaryLabel, mOrderSummary); + } else if (v == mShippingSummaryLabel || v == mShippingSummaryAddress + || v == mShippingAddressesLabel || v == mShippingAddresses) { + expand(mShippingAddressesLabel, mShippingAddresses); + } else if (v == mShippingSummaryOption || v == mShippingOptionsLabel + || v == mShippingOptions || v == mSelectShippingOptionPrompt) { + expand(mShippingOptionsLabel, mShippingOptions); + } else if (v == mPaymentMethodsLabel || v == mPaymentMethods) { + expand(mPaymentMethodsLabel, mPaymentMethods); + } else if (v == mPayButton) { + mPaymentContainer.setVisibility(View.GONE); + mWaitingOverlay.setVisibility(View.VISIBLE); + Window dialogWindow = mDialog.getWindow(); + dialogWindow.setGravity(Gravity.CENTER); + dialogWindow.setLayout( + ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); + + mClient.onPayClicked( + mShippingAddressesSection == null + ? null : mShippingAddressesSection.getSelectedItem(), + mShippingOptionsSection == null + ? null : mShippingOptionsSection.getSelectedItem(), + mPaymentMethodsSection == null + ? null : mPaymentMethodsSection.getSelectedItem()); + } else if (v == mEditButton) { + if (mSelectedSection == null) { + expand(mOrderSummaryLabel, mOrderSummary); + } else { + mDialog.dismiss(); + } + } else if (v.getTag() != null && v.getTag() instanceof OptionLineTag) { + OptionLineTag tag = (OptionLineTag) v.getTag(); + tag.selectOptionLine(); + + if (tag.getSection() == mShippingAddressesSection) { + mClient.onShippingAddressChanged(tag.getSection().getSelectedItem()); + } else if (tag.getSection() == mShippingOptionsSection) { + mClient.onShippingOptionChanged(tag.getSection().getSelectedItem()); + } else if (tag.getSection() == mPaymentMethodsSection) { + mClient.onPaymentMethodChanged(tag.getSection().getSelectedItem()); + } + } + } + + private void expand(View sectionLabel, ViewGroup section) { + mEditButton.setText(mContext.getString(R.string.payments_cancel_button)); + mDialog.getWindow().setLayout( + ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); + + boolean isFirstExpansionWithShipping = + mRequestShipping && mShippingSummaryLabel.getVisibility() != View.GONE; + if (isFirstExpansionWithShipping) { + mShippingSummaryLabel.setVisibility(View.GONE); + mShippingSummary.setVisibility(View.GONE); + mShippingSummarySeparator.setVisibility(View.GONE); + + mShippingAddressesLabel.setVisibility(View.VISIBLE); + mShippingAddresses.setVisibility(View.VISIBLE); + mShippingAddressesSeparator.setVisibility(View.VISIBLE); + + mShippingOptionsLabel.setVisibility(View.VISIBLE); + mSelectShippingOptionPrompt.setVisibility(View.VISIBLE); + mShippingOptions.setVisibility(View.VISIBLE); + mShippingOptionsSeparator.setVisibility(View.VISIBLE); + } + + if (mSelectedSectionLabel != null) { + mSelectedSectionLabel.setBackgroundColor(Color.WHITE); + mSelectedSectionLabel.setClickable(true); + } + + if (mSelectedSection != null) { + mSelectedSection.setBackgroundColor(Color.WHITE); + mSelectedSection.setClickable(true); + } + + sectionLabel.setBackgroundColor(R.color.default_primary_color); + sectionLabel.setClickable(false); + + section.setBackgroundColor(R.color.default_primary_color); + section.setClickable(false); + + ViewGroup noLongerSelectedSection = mSelectedSection; + mSelectedSectionLabel = sectionLabel; + mSelectedSection = section; + + if (noLongerSelectedSection == mOrderSummary) { + updateLineItems(mLineItems); + } + if (noLongerSelectedSection == mShippingAddresses + || (isFirstExpansionWithShipping && mSelectedSection != mShippingAddresses)) { + updateSection(mShippingAddresses, mShippingAddressesSection, null); + } + if (noLongerSelectedSection == mShippingOptions + || (isFirstExpansionWithShipping && mSelectedSection != mShippingOptions)) { + updateSection(mShippingOptions, mShippingOptionsSection, mSelectShippingOptionPrompt); + } + if (noLongerSelectedSection == mPaymentMethods) { + updateSection(mPaymentMethods, mPaymentMethodsSection, null); + } + + if (mSelectedSection == mOrderSummary) { + mClient.getLineItems(new Callback<ArrayList<LineItem>>() { + @Override + public void onResult(ArrayList<LineItem> result) { + updateLineItems(result); + } + }); + } else if (mSelectedSection == mShippingAddresses) { + mClient.getShippingAddresses(new Callback<SectionInformation>() { + @Override + public void onResult(SectionInformation result) { + mShippingAddressesSection = result; + updateSection(mShippingAddresses, mShippingAddressesSection, null); + } + }); + } else if (mSelectedSection == mShippingOptions) { + mClient.getShippingOptions(new Callback<SectionInformation>() { + @Override + public void onResult(SectionInformation result) { + mShippingOptionsSection = result; + updateSection( + mShippingOptions, mShippingOptionsSection, mSelectShippingOptionPrompt); + } + }); + } else if (mSelectedSection == mPaymentMethods) { + mClient.getPaymentMethods(new Callback<SectionInformation>() { + @Override + public void onResult(SectionInformation result) { + mPaymentMethodsSection = result; + updateSection(mPaymentMethods, mPaymentMethodsSection, null); + } + }); + } + } + + /** + * Called when the user dismisses the dialog by clicking the "back" button on the phone or the + * "X" button in the top-right corner of the dialog. + */ + @Override + public void onDismiss(DialogInterface dialog) { + mClient.onDismiss(); + } +}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/SectionInformation.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/SectionInformation.java new file mode 100644 index 0000000..df8e9d5 --- /dev/null +++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/SectionInformation.java
@@ -0,0 +1,120 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.payments.ui; + +import java.util.ArrayList; +import java.util.Collection; + +/** + * The data to show in a single section where the user can select something, e.g., their + * shipping address or payment method. + */ +public class SectionInformation { + /** + * This value indicates that the user has not made a selection in this section. + */ + public static final int NO_SELECTION = -1; + + private final ArrayList<PaymentOption> mItems; + private int mSelectedItem; + + /** + * Builds an empty section without selection. + */ + public SectionInformation() { + mSelectedItem = NO_SELECTION; + mItems = null; + } + + /** + * Builds a section with a single option, which is selected. + * + * @param defaultItem The only item. It is selected by default. + */ + public SectionInformation(PaymentOption defaultItem) { + if (null != defaultItem) { + mSelectedItem = 0; + mItems = new ArrayList<PaymentOption>(1); + mItems.add(defaultItem); + } else { + mSelectedItem = NO_SELECTION; + mItems = null; + } + } + + /** + * Builds a section. + * + * @param selection The index of the currently selected item. + * @param itemCollection The items in the section. + */ + public SectionInformation(int selection, Collection<? extends PaymentOption> itemCollection) { + mSelectedItem = selection; + mItems = new ArrayList<PaymentOption>(itemCollection.size()); + mItems.addAll(itemCollection); + } + + /** + * Returns whether the section is empty. + * + * @return Whether the section is empty. + */ + public boolean isEmpty() { + return mItems == null || mItems.isEmpty(); + } + + /** + * Returns the number of items in this section. For example, the number of shipping addresses or + * payment methods. + * + * @return The number of items in this section. + */ + public int getSize() { + return mItems == null ? 0 : mItems.size(); + } + + /** + * Returns the item in the given position. + * + * @param position The index of the item to return. + * @return The item in the given position or null. + */ + public PaymentOption getItem(int position) { + if (mItems == null || mItems.isEmpty() || position < 0 || position >= mItems.size()) { + return null; + } + + return mItems.get(position); + } + + /** + * Sets the currently selected item. + * + * @param index The index of the currently selected item, or NO_SELECTION if a selection has not + * yet been made. + */ + public void setSelectedItemIndex(int index) { + mSelectedItem = index; + } + + /** + * Returns the index of the selected item. + * + * @return The index of the currently selected item, or NO_SELECTION if a selection has not yet + * been made. + */ + public int getSelectedItemIndex() { + return mSelectedItem; + } + + /** + * Returns the selected item, if any. + * + * @return The selected item or null if none selected. + */ + public PaymentOption getSelectedItem() { + return getItem(getSelectedItemIndex()); + } +}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/ListUrlsActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/ListUrlsActivity.java index 555a7bf4..c4753c2 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/ListUrlsActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/ListUrlsActivity.java
@@ -200,7 +200,7 @@ super.onStop(); } - private void resolve(Collection<String> urls) { + private void resolve(Collection<UrlInfo> urls) { final long timestamp = SystemClock.elapsedRealtime(); mPwsClient.resolve(urls, new PwsClient.ResolveScanCallback() { @Override @@ -246,7 +246,7 @@ * @param urls The set of newly-found nearby URLs. */ @Override - public void onDisplayableUrlsAdded(Collection<String> urls) { + public void onDisplayableUrlsAdded(Collection<UrlInfo> urls) { resolve(urls); } @@ -261,7 +261,7 @@ // Clear the list adapter to trigger the empty list display. mAdapter.clear(); - Collection<String> urls = UrlManager.getInstance(this).getUrls(true); + Collection<UrlInfo> urls = UrlManager.getInstance(this).getUrls(true); // Check the Physical Web preference to ensure we do not resolve URLs when Physical Web is // off or onboarding. Normally the user will not reach this activity unless the preference
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebDiagnosticsPage.java b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebDiagnosticsPage.java index 29e7846a..f51511e 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebDiagnosticsPage.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebDiagnosticsPage.java
@@ -156,9 +156,9 @@ private void appendUrlManagerReport(StringBuilder sb) { UrlManager urlManager = UrlManager.getInstance(mContext); - Set<String> nearbyUrls = urlManager.getCachedNearbyUrls(); - Set<String> resolvedUrls = urlManager.getCachedResolvedUrls(); - Set<String> union = new HashSet<String>(nearbyUrls); + Set<UrlInfo> nearbyUrls = new HashSet<UrlInfo>(urlManager.getCachedNearbyUrls()); + Set<UrlInfo> resolvedUrls = new HashSet<UrlInfo>(urlManager.getCachedResolvedUrls()); + Set<UrlInfo> union = new HashSet<UrlInfo>(nearbyUrls); union.addAll(resolvedUrls); sb.append("<h2>Nearby web pages</h2>"); @@ -166,7 +166,7 @@ if (union.isEmpty()) { sb.append("No nearby web pages found<br/>"); } else { - for (String url : union) { + for (UrlInfo url : union) { boolean isNearby = nearbyUrls.contains(url); boolean isResolved = resolvedUrls.contains(url);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PwsClient.java b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PwsClient.java index 1d55fbf..d11562d 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PwsClient.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PwsClient.java
@@ -40,7 +40,7 @@ * @param broadcastUrls The URLs to resolve. * @param resolveScanCallback The callback to be run when the response is received. */ - void resolve(Collection<String> broadcastUrls, ResolveScanCallback resolveScanCallback); + void resolve(Collection<UrlInfo> broadcastUrls, ResolveScanCallback resolveScanCallback); /** * Send an HTTP request to fetch a favicon.
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PwsClientImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PwsClientImpl.java index bdcf54ab..20f0a61 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PwsClientImpl.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PwsClientImpl.java
@@ -38,13 +38,13 @@ } } - private static JSONObject createResolveScanPayload(Collection<String> urls) + private static JSONObject createResolveScanPayload(Collection<UrlInfo> urls) throws JSONException { // Encode the urls. JSONArray objects = new JSONArray(); - for (String url : urls) { + for (UrlInfo urlInfo : urls) { JSONObject obj = new JSONObject(); - obj.put("url", url); + obj.put("url", urlInfo.getUrl()); objects.put(obj); } @@ -88,7 +88,7 @@ * @param resolveScanCallback The callback to be run when the response is received. */ @Override - public void resolve(final Collection<String> broadcastUrls, + public void resolve(final Collection<UrlInfo> broadcastUrls, final ResolveScanCallback resolveScanCallback) { // Create the response callback. JsonObjectHttpRequest.RequestCallback requestCallback =
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/UrlInfo.java b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/UrlInfo.java new file mode 100644 index 0000000..05530e73 --- /dev/null +++ b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/UrlInfo.java
@@ -0,0 +1,126 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.physicalweb; + +import org.json.JSONException; +import org.json.JSONObject; + +import java.util.Locale; + +/** + * This class represents a scanned URL and information associated with that URL. + */ +class UrlInfo implements Comparable<UrlInfo> { + private static final String URL_KEY = "url"; + private static final String DISTANCE_KEY = "distance"; + private final String mUrl; + private final double mDistance; + + public UrlInfo(String url, double distance) { + mUrl = url; + mDistance = distance; + } + + /** + * Constructs a simple UrlInfo with only a URL. + */ + public UrlInfo(String url) { + this(url, -1.0); + } + + /** + * Gets the URL represented by this object. + * @param The URL. + */ + public String getUrl() { + return mUrl; + } + + /** + * Gets the distance of the URL from the scanner in meters.. + * @return The estimated distance of the URL from the scanner in meters. + */ + public double getDistance() { + return mDistance; + } + + /** + * Creates a JSON object that represents this data structure. + * @return a JSON serialization of this data structure. + * @throws JSONException if the values cannot be deserialized. + */ + public JSONObject jsonSerialize() throws JSONException { + return new JSONObject() + .put(URL_KEY, mUrl) + .put(DISTANCE_KEY, mDistance); + } + + /** + * Populates a UrlInfo with data from a given JSON object. + * @param jsonObject a serialized UrlInfo. + * @return The UrlInfo represented by the serialized object. + * @throws JSONException if the values cannot be serialized. + */ + public static UrlInfo jsonDeserialize(JSONObject jsonObject) throws JSONException { + return new UrlInfo(jsonObject.getString(URL_KEY), jsonObject.getDouble(DISTANCE_KEY)); + } + + /** + * Returns a hash code for this UrlInfo. + * @return hash code + */ + @Override + public int hashCode() { + int hash = 31 + mUrl.hashCode(); + hash = hash * 31 + (int) mDistance; + return hash; + } + + /** + * Checks if two UrlInfos are equal. + * @param other the UrlInfo to compare to. + * @return true if the UrlInfo are equal. + */ + @Override + public boolean equals(Object other) { + if (this == other) { + return true; + } + + if (other instanceof UrlInfo) { + UrlInfo urlInfo = (UrlInfo) other; + return compareTo(urlInfo) == 0; + } + return false; + } + + /** + * Compares two UrlInfos. + * @param other the UrlInfo to compare to. + * @return the comparison value. + */ + @Override + public int compareTo(UrlInfo other) { + int compareValue = mUrl.compareTo(other.mUrl); + if (compareValue != 0) { + return compareValue; + } + + compareValue = Double.compare(mDistance, other.mDistance); + if (compareValue != 0) { + return compareValue; + } + + return 0; + } + + /** + * Represents the UrlInfo as a String. + */ + @Override + public String toString() { + return String.format(Locale.getDefault(), "%s %f", mUrl, mDistance); + } +}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/UrlManager.java b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/UrlManager.java index e8b4f49..53aecca 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/UrlManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/UrlManager.java
@@ -29,11 +29,15 @@ import org.chromium.chrome.browser.notifications.NotificationManagerProxy; import org.chromium.chrome.browser.notifications.NotificationManagerProxyImpl; +import org.json.JSONException; +import org.json.JSONObject; + import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.HashSet; +import java.util.List; import java.util.Set; /** @@ -71,10 +75,10 @@ public interface Listener { /** * Callback called when one or more URLs are added to the URL list. - * @param urls A set of strings containing nearby URLs resolvable with our resolution + * @param urls A set of UrlInfos containing nearby URLs resolvable with our resolution * service. */ - void onDisplayableUrlsAdded(Collection<String> urls); + void onDisplayableUrlsAdded(Collection<UrlInfo> urls); } /** @@ -121,13 +125,13 @@ /** * Add a URL to the store of URLs. * This method additionally updates the Physical Web notification. - * @param url The URL to add. + * @param urlInfo The URL to add. */ @VisibleForTesting - public void addUrl(String url) { - Log.d(TAG, "URL found: %s", url); + public void addUrl(UrlInfo urlInfo) { + Log.d(TAG, "URL found: %s", urlInfo); boolean isOnboarding = PhysicalWeb.isOnboarding(mContext); - Set<String> nearbyUrls = getCachedNearbyUrls(); + List<UrlInfo> nearbyUrls = getCachedNearbyUrls(); // A URL is displayable if it is both nearby and resolved through our resolution service. // When new displayable URLs are found we tell our observers. In onboarding mode we do not @@ -145,11 +149,11 @@ displayableUrlsBefore = notificationUrlsBefore = getUrls().size(); } - nearbyUrls.add(url); + nearbyUrls.add(urlInfo); putCachedNearbyUrls(nearbyUrls); if (!isOnboarding) { - resolveUrl(url); + resolveUrl(urlInfo); } int displayableUrlsAfter; @@ -162,20 +166,29 @@ } updateNotification(notificationUrlsBefore == 0, notificationUrlsAfter == 0); - notifyDisplayableUrlsChanged(displayableUrlsBefore, displayableUrlsAfter, url); + notifyDisplayableUrlsChanged(displayableUrlsBefore, displayableUrlsAfter, urlInfo); + } + + /** + * Add a URL to the store of URLs. + */ + // TODO(conleyo) we should remove this method after calling code only passes us a UrlInfo. + @VisibleForTesting + public void addUrl(String url) { + addUrl(new UrlInfo(url)); } /** * Remove a URL to the store of URLs. * This method additionally updates the Physical Web notification. - * @param url The URL to remove. + * @param urlInfo The URL to remove. */ @VisibleForTesting - public void removeUrl(String url) { - Log.d(TAG, "URL lost: %s", url); + public void removeUrl(UrlInfo urlInfo) { + Log.d(TAG, "URL lost: %s", urlInfo); boolean isOnboarding = PhysicalWeb.isOnboarding(mContext); - Set<String> nearbyUrls = getCachedNearbyUrls(); - nearbyUrls.remove(url); + List<UrlInfo> nearbyUrls = getCachedNearbyUrls(); + nearbyUrls.remove(urlInfo); putCachedNearbyUrls(nearbyUrls); int notificationUrlsAfter = isOnboarding ? nearbyUrls.size() : getUrls().size(); @@ -183,10 +196,20 @@ } /** - * Get the list of URLs which are both nearby and resolved through PWS. - * @return A set of nearby and resolved URLs. + * Remove a URL to the store of URLs. */ - public Set<String> getUrls() { + // TODO(conleyo) we should remove this method after calling code only passes us a UrlInfo. + @VisibleForTesting + public void removeUrl(String url) { + removeUrl(new UrlInfo(url)); + } + + /** + * Get the list of URLs which are both nearby and resolved through PWS. + * @return A set of nearby and resolved URLs, sorted by distance. + */ + // TODO(conleyo) We will need to provide sorted URLs after distance is in place. + public List<UrlInfo> getUrls() { return getUrls(false); } @@ -196,16 +219,23 @@ * resolved URL list is empty. * @return A set of nearby URLs. */ - public Set<String> getUrls(boolean allowUnresolved) { - Set<String> nearbyUrls = getCachedNearbyUrls(); - Set<String> resolvedUrls = getCachedResolvedUrls(); - Set<String> intersection = new HashSet<String>(nearbyUrls); - intersection.retainAll(resolvedUrls); + public List<UrlInfo> getUrls(boolean allowUnresolved) { + List<UrlInfo> nearbyUrls = getCachedNearbyUrls(); + Set<String> resolvedUrls = new HashSet<>(); + for (UrlInfo urlInfo : getCachedResolvedUrls()) { + resolvedUrls.add(urlInfo.getUrl()); + } + List<UrlInfo> intersection = new ArrayList<>(); + for (UrlInfo urlInfo : nearbyUrls) { + if (resolvedUrls.contains(urlInfo.getUrl())) { + intersection.add(urlInfo); + } + } Log.d(TAG, "Get URLs With: %d nearby, %d resolved, and %d in intersection.", nearbyUrls.size(), resolvedUrls.size(), intersection.size()); if (allowUnresolved && resolvedUrls.isEmpty()) { - intersection = nearbyUrls; + return nearbyUrls; } return intersection; @@ -215,9 +245,9 @@ * Forget all stored URLs and clear the notification. */ public void clearUrls() { - Set<String> emptySet = Collections.emptySet(); - putCachedNearbyUrls(emptySet); - putCachedResolvedUrls(emptySet); + List<UrlInfo> emptyList = Collections.emptyList(); + putCachedNearbyUrls(emptyList); + putCachedResolvedUrls(emptyList); clearNotification(); cancelClearNotificationAlarm(); } @@ -231,9 +261,9 @@ mNotificationManager.cancel(NotificationConstants.NOTIFICATION_ID_PHYSICAL_WEB); } - private void addResolvedUrl(String url) { + private void addResolvedUrl(UrlInfo url) { Log.d(TAG, "PWS resolved: %s", url); - Set<String> resolvedUrls = getCachedResolvedUrls(); + List<UrlInfo> resolvedUrls = getCachedResolvedUrls(); int displayableUrlsBefore = getUrls().size(); resolvedUrls.add(url); @@ -244,9 +274,9 @@ notifyDisplayableUrlsChanged(displayableUrlsBefore, displayableUrlsAfter, url); } - private void removeResolvedUrl(String url) { + private void removeResolvedUrl(UrlInfo url) { Log.d(TAG, "PWS unresolved: %s", url); - Set<String> resolvedUrls = getCachedResolvedUrls(); + List<UrlInfo> resolvedUrls = getCachedResolvedUrls(); resolvedUrls.remove(url); putCachedResolvedUrls(resolvedUrls); updateNotification(false, getUrls().isEmpty()); @@ -275,36 +305,51 @@ }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); } - private Set<String> getStringSetFromSharedPreferences(String preferenceName) { + private List<UrlInfo> getUrlInfoListFromSharedPreferences(String preferenceName) { // Check the version. SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(mContext); - // Make sure to construct a new set so it can be modified safely. See crbug.com/568369. - return new HashSet<String>(prefs.getStringSet(preferenceName, new HashSet<String>())); + List<UrlInfo> urls = new ArrayList<>(); + for (String serializedUrl : prefs.getStringSet(preferenceName, new HashSet<String>())) { + try { + JSONObject jsonObject = new JSONObject(serializedUrl); + urls.add(UrlInfo.jsonDeserialize(jsonObject)); + } catch (JSONException e) { + Log.e(TAG, "Could not deserialize UrlInfo", e); + } + } + return urls; } - private void setStringSetInSharedPreferences(String preferenceName, - Set<String> preferenceValue) { - // Write the version. + private void setUrlInfoListInSharedPreferences(String preferenceName, List<UrlInfo> urls) { + Set<String> serializedUrls = new HashSet<>(); + for (UrlInfo url : urls) { + try { + serializedUrls.add(url.jsonSerialize().toString()); + } catch (JSONException e) { + Log.e(TAG, "Could not serialize UrlInfo", e); + } + } + SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(mContext); SharedPreferences.Editor editor = prefs.edit(); - editor.putStringSet(preferenceName, preferenceValue); + editor.putStringSet(preferenceName, serializedUrls); editor.apply(); } - Set<String> getCachedNearbyUrls() { - return getStringSetFromSharedPreferences(PREFS_NEARBY_URLS_KEY); + List<UrlInfo> getCachedNearbyUrls() { + return getUrlInfoListFromSharedPreferences(PREFS_NEARBY_URLS_KEY); } - private void putCachedNearbyUrls(Set<String> urls) { - setStringSetInSharedPreferences(PREFS_NEARBY_URLS_KEY, urls); + private void putCachedNearbyUrls(List<UrlInfo> urls) { + setUrlInfoListInSharedPreferences(PREFS_NEARBY_URLS_KEY, urls); } - Set<String> getCachedResolvedUrls() { - return getStringSetFromSharedPreferences(PREFS_RESOLVED_URLS_KEY); + List<UrlInfo> getCachedResolvedUrls() { + return getUrlInfoListFromSharedPreferences(PREFS_RESOLVED_URLS_KEY); } - private void putCachedResolvedUrls(Set<String> urls) { - setStringSetInSharedPreferences(PREFS_RESOLVED_URLS_KEY, urls); + private void putCachedResolvedUrls(List<UrlInfo> urls) { + setUrlInfoListInSharedPreferences(PREFS_RESOLVED_URLS_KEY, urls); } private PendingIntent createListUrlsIntent() { @@ -320,8 +365,8 @@ return pendingIntent; } - private void resolveUrl(final String url) { - Set<String> urls = new HashSet<String>(Arrays.asList(url)); + private void resolveUrl(final UrlInfo url) { + Set<UrlInfo> urls = new HashSet<UrlInfo>(Arrays.asList(url)); final long timestamp = SystemClock.elapsedRealtime(); mPwsClient.resolve(urls, new PwsClient.ResolveScanCallback() { @Override @@ -333,7 +378,7 @@ public void run() { for (PwsResult pwsResult : pwsResults) { String requestUrl = pwsResult.requestUrl; - if (url.equalsIgnoreCase(requestUrl)) { + if (url.getUrl().equalsIgnoreCase(requestUrl)) { addResolvedUrl(url); return; } @@ -463,11 +508,11 @@ } private void notifyDisplayableUrlsChanged(int displayCountBefore, int displayCountAfter, - String url) { + UrlInfo url) { if (displayCountAfter > displayCountBefore) { - Collection<String> urls = new ArrayList<String>(); + Collection<UrlInfo> urls = new ArrayList<>(); urls.add(url); - Collection<String> wrappedUrls = Collections.unmodifiableCollection(urls); + Collection<UrlInfo> wrappedUrls = Collections.unmodifiableCollection(urls); for (Listener observer : mObservers) { observer.onDisplayableUrlsAdded(wrappedUrls); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java b/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java index c850037..2b776b703 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java
@@ -23,6 +23,7 @@ import android.view.View.OnClickListener; import android.view.ViewGroup; import android.view.ViewGroup.LayoutParams; +import android.view.accessibility.AccessibilityEvent; import android.widget.FrameLayout; import org.chromium.base.ApiCompatibilityUtils; @@ -1301,9 +1302,7 @@ for (TabObserver observer : mObservers) { observer.onDidChangeThemeColor(this, mDefaultThemeColor); } - for (TabObserver observer : mObservers) { - observer.onContentChanged(this); - } + notifyContentChanged(); destroyNativePageInternal(previousNativePage); } @@ -1326,7 +1325,7 @@ if (mNativePage == null) return; NativePage previousNativePage = mNativePage; mNativePage = null; - for (TabObserver observer : mObservers) observer.onContentChanged(this); + notifyContentChanged(); destroyNativePageInternal(previousNativePage); } @@ -1710,6 +1709,10 @@ mNativePage = null; destroyNativePageInternal(previousNativePage); + if (mContentViewCore != null) { + mContentViewCore.setObscuredByAnotherView(false); + } + mContentViewCore = cvc; cvc.getContainerView().setOnHierarchyChangeListener(this); cvc.getContainerView().setOnSystemUiVisibilityChangeListener(this); @@ -1757,7 +1760,7 @@ mSwipeRefreshHandler = new SwipeRefreshHandler(mThemedApplicationContext); mSwipeRefreshHandler.setContentViewCore(mContentViewCore); - for (TabObserver observer : mObservers) observer.onContentChanged(this); + notifyContentChanged(); // For browser tabs, we want to set accessibility focus to the page // when it loads. This is not the default behavior for embedded @@ -1853,7 +1856,7 @@ getContentViewCore().getContainerView().addView( mSadTabView, new FrameLayout.LayoutParams( LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)); - for (TabObserver observer : mObservers) observer.onContentChanged(this); + notifyContentChanged(); } FullscreenManager fullscreenManager = getFullscreenManager(); if (fullscreenManager != null) { @@ -1867,7 +1870,7 @@ private void removeSadTabIfPresent() { if (isShowingSadTab()) { getContentViewCore().getContainerView().removeView(mSadTabView); - for (TabObserver observer : mObservers) observer.onContentChanged(this); + notifyContentChanged(); } mSadTabView = null; } @@ -1881,6 +1884,14 @@ } /** + * Calls onContentChanged on all TabObservers and updates accessibility visibility. + */ + private void notifyContentChanged() { + for (TabObserver observer : mObservers) observer.onContentChanged(this); + updateAccessibilityVisibility(); + } + + /** * Cleans up all internal state, destroying any {@link NativePage} or {@link ContentViewCore} * currently associated with this {@link Tab}. This also destroys the native counterpart * to this class, which means that all subclasses should erase their native pointers after @@ -2951,6 +2962,34 @@ } /** + * Update whether or not the current native tab and/or web contents are + * currently visible (from an accessibility perspective), or whether + * they're obscured by another view. + */ + public void updateAccessibilityVisibility() { + int importantForAccessibility = isObscuredByAnotherViewForAccessibility() + ? View.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS + : View.IMPORTANT_FOR_ACCESSIBILITY_YES; + if (getView().getImportantForAccessibility() != importantForAccessibility) { + getView().setImportantForAccessibility(importantForAccessibility); + getView().sendAccessibilityEvent( + AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED); + } + + ContentViewCore cvc = getContentViewCore(); + if (cvc != null) { + boolean isWebContentObscured = isObscuredByAnotherViewForAccessibility() + || isShowingSadTab(); + cvc.setObscuredByAnotherView(isWebContentObscured); + } + } + + private boolean isObscuredByAnotherViewForAccessibility() { + ChromeActivity activity = getActivity(); + return activity != null && activity.isViewObscuringAllTabs(); + } + + /** * Creates a new tab to be loaded lazily. This can be used for tabs opened in the background * that should be loaded when switched to. initialize() needs to be called afterwards to * complete the second level initialization.
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/CustomTabToolbar.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/CustomTabToolbar.java index 380f4753..3a8c9ea 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/CustomTabToolbar.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/CustomTabToolbar.java
@@ -372,9 +372,10 @@ getProgressBar().setForegroundColor(ApiCompatibilityUtils.getColor(resources, R.color.progress_bar_foreground_white)); } else { - int progressBarBackgroundColorResource = R.color.progress_bar_background; getProgressBar().setBackgroundColor(ApiCompatibilityUtils.getColor(resources, - progressBarBackgroundColorResource)); + R.color.progress_bar_background)); + getProgressBar().setForegroundColor(ApiCompatibilityUtils.getColor(resources, + R.color.progress_bar_foreground)); } } }
diff --git a/chrome/android/java/strings/android_chrome_strings.grd b/chrome/android/java/strings/android_chrome_strings.grd index f693d11f..2c78495 100644 --- a/chrome/android/java/strings/android_chrome_strings.grd +++ b/chrome/android/java/strings/android_chrome_strings.grd
@@ -1868,9 +1868,6 @@ <message name="IDS_MENU_BOOKMARKS" desc="Menu item for opening the bookmarks page that contains all the user's bookmarks. [CHAR-LIMIT=27]"> Bookmarks </message> - <message name="IDS_MENU_BOOKMARKS_OFFLINE_PAGES" desc="Menu item for opening the saved pages page that contains all the user's saved pages (bookmarks and offline). [CHAR-LIMIT=27]"> - Saved pages - </message> <message name="IDS_MENU_RECENT_TABS" desc="Menu item for opening the 'Recent tabs' page that shows recently closed tabs and pages the user has opened on his/her other devices. [CHAR-LIMIT=27]"> Recent tabs </message> @@ -1933,15 +1930,9 @@ <message name="IDS_BOOKMARK_DRAWER_FOLDERS" desc="Title for the list of folders in the drawer view. [CHAR-LIMIT=32]"> Folders </message> - <message name="IDS_BOOKMARK_DRAWER_FILTER_OFFLINE_PAGES" desc="Menu item for showing all bookmarks with an offline pages [CHAR-LIMIT=24]"> - Saved offline - </message> <message name="IDS_BOOKMARK_TITLE_BAR_ALL_ITEMS" desc="Title bar text for showing all bookmark items in the bookmarks UI [CHAR-LIMIT=32]"> Bookmarks </message> - <message name="IDS_BOOKMARK_TITLE_BAR_FILTER_OFFLINE_PAGES" desc="Title bar text for showing all save pages with offline copy in the bookmarks UI. [CHAR-LIMIT=24]"> - Saved offline - </message> <message name="IDS_BOOKMARK_PARENT_FOLDER" desc="Header text for title of parent folder of the bookmark [CHAR-LIMIT=32]"> Parent folder </message> @@ -1999,15 +1990,6 @@ <message name="IDS_BOOKMARK_FOLDER" desc="Label specifying what folder a bookmark is in. [CHAR-LIMIT=32]"> Folder </message> - <message name="IDS_BOOKMARK_OFFLINE_PAGE_NONE" desc="Label specifying that given saved page does not have an offline copy, but user has the page open."> - Not saved offline - </message> - <message name="IDS_BOOKMARK_OFFLINE_PAGE_SIZE" desc="Label specifying that given saved page has an offline copy of a specific size."> - <ph name="PAGE_SIZE_STRING">%1$s<ex>1.32 MB</ex></ph> page saved offline - </message> - <message name="IDS_BOOKMARK_BTN_OFFLINE_PAGE_VISIT" desc="Label for a button to visit an offline page. [CHAR-LIMIT=20]"> - Visit - </message> <message name="IDS_BOOKMARK_MISSING_TITLE" desc="Error message appearing when a user tries to create/edit a bookmark or a folder without a title. [CHAR-LIMIT=32]"> Title required </message> @@ -2040,107 +2022,9 @@ </message> <!-- Offline pages --> - <message name="IDS_OFFLINE_PAGES_ACTION_BAR_DELETE" desc="Button text to delete the saved web pages that are being selected [CHAR-LIMIT=32]"> - Delete saved pages - </message> - <message name="IDS_OFFLINE_PAGES_ACTION_BAR_MOVE" desc="Button text to move the saved web pages that are being selected [CHAR-LIMIT=32]"> - Move saved pages - </message> - <message name="IDS_OFFLINE_PAGES_ACTION_BAR_SEARCH" desc="Button text to search among the saved web pages [CHAR-LIMIT=32]"> - Search saved pages - </message> - <message name="IDS_OFFLINE_PAGES_ALL_ITEMS" desc="Title button and text for showing the list of web pages that have been saved/bookmarked. [CHAR-LIMIT=32]"> - All saved pages - </message> - <message name="IDS_OFFLINE_PAGES_EDIT_ITEM" desc="The string prompting the user to edit the content of a saved page. [CHAR-LIMIT=32]"> - Edit saved page - </message> - <message name="IDS_OFFLINE_PAGES_FREE_UP_SPACE_TITLE" desc="Text on a button and title of the dialog offering to remove offline pages to free up storage space. [CHAR-LIMIT=32]"> - Free up space - </message> - <message name="IDS_OFFLINE_PAGES_FREE_UP_SPACE_MESSAGE" desc="Text explaining how many offline copies of saved pages are going to be removed and how much storage is going to be freed."> - Delete <ph name="PAGES_NUMBER">%1$d<ex>8</ex></ph> offline copies not used in the past month? This will clear <ph name="TOTAL_PAGE_SIZE">%2$s<ex>8.3 MB</ex></ph> of space. - </message> - <message name="IDS_OFFLINE_PAGES_FOLDER_EMPTY" desc="Text explaining that the currently selected saved pages folder is empty."> - No saved pages here - </message> - <message name="IDS_OFFLINE_PAGES_NTP_BUTTON_NAME" desc="Text for saved pages button on the new tab page [CHAR-LIMIT=20]"> - Saved pages - </message> - <message name="IDS_OFFLINE_PAGES_NTP_BUTTON_ACCESSIBILITY" desc="Content description for saved pages button on the new tab page."> - Saved pages - </message> - <message name="IDS_OFFLINE_PAGES_OPEN_STORAGE_SETTINGS_DIALOG_TEXT" desc="Text of the dialog asking if the user wants to open storage settings to remove files to make space."> - Your device storage is full. Please remove other media to make space. - </message> - <message name="IDS_OFFLINE_PAGES_PAGE_SAVED" desc="Message shown after user adds a new offline page."> - Page saved offline - </message> - <message name="IDS_OFFLINE_PAGES_PAGE_SAVED_FOLDER" desc="Message shown after user saves a new offline page. Also specifies in which folder the bookmark was added."> - Page saved offline to <ph name="FOLDER_NAME">%1$s<ex>Mobile bookmarks</ex></ph> - </message> - <message name="IDS_OFFLINE_PAGES_PAGE_SKIPPED" desc="Message shown after a page was saved as a bookmark, but an offline copy was not created due to that the page is not HTTP or HTTPS page."> - Page saved - </message> - <message name="IDS_OFFLINE_PAGES_PAGE_SAVED_STORAGE_NEAR_FULL" desc="Message shown after user adds a new offline page and the storage is almost full."> - Page saved offline. Storage almost full. - </message> - <message name="IDS_OFFLINE_PAGES_PAGE_FAILED_TO_SAVE" desc="Message shown after a page was saved as a bookmark, but an offline copy was not created due to problems other than storage."> - Saved page not available offline - </message> - <message name="IDS_OFFLINE_PAGES_PAGE_FAILED_TO_SAVE_STORAGE_NEAR_FULL" desc="Message shown after a page was saved as a bookmark, but an offline copy was not created due to storage problem."> - Saved page not available offline. Storage almost full. - </message> - <message name="IDS_OFFLINE_PAGES_SAVED_PAGES" desc="Title in recent tasks list for showing the list of web pages that have been saved."> - Saved pages - </message> - <message name="IDS_OFFLINE_PAGES_STORAGE_SPACE_TITLE" desc="Title of the promo header for managing offline pages storage. [CHAR-LIMIT=32]"> - Storage space - </message> - <message name="IDS_OFFLINE_PAGES_STORAGE_SPACE_MESSAGE" desc="Text explaining how much storage is currently used for offline copies of saved pages."> - Saved pages are currently taking up <ph name="TOTAL_OFFLINE_STORAGE_SIZE">%1$s<ex>780 MB</ex></ph>. - </message> - <message name="IDS_OFFLINE_PAGES_STORAGE_CLEARED" desc="Text for the snackbar confirming clearing of the offline page storage space."> - Storage cleared - </message> <message name="IDS_OFFLINE_PAGES_VIEWING_OFFLINE_PAGE" desc="Text explaining that the user is viewing an offline copy of a web page."> Viewing an offline copy of this page </message> - <message name="IDS_OFFLINE_PAGES_VIEW_BUTTON" desc="Label for a button to open a system settings page. [CHAR-LIMIT=20]"> - View - </message> - - <!-- Offline pages (Use 'bookmarks' name in UI strings) --> - <message name="IDS_OFFLINE_PAGES_AS_BOOKMARKS_OFFLINE_PAGE_SIZE" desc="Label specifying that given saved page has an offline copy of a specific size (Use 'bookmarks' name in UI strings)."> - <ph name="PAGE_SIZE_STRING">%1$s<ex>1.32 MB</ex></ph> bookmark saved offline - </message> - <message name="IDS_OFFLINE_PAGES_AS_BOOKMARKS_OFFLINE_PAGE_VISIT" desc="Label specifying that given saved page does not have an offline copy, and user does not have that page open (Use 'bookmarks' name in UI strings)."> - Visit bookmark to save offline - </message> - <message name="IDS_OFFLINE_PAGES_AS_BOOKMARKS_PAGE_SAVED" desc="Message shown after user adds a new offline page (Use 'bookmarks' name in UI strings)."> - Bookmark saved offline - </message> - <message name="IDS_OFFLINE_PAGES_AS_BOOKMARKS_PAGE_SAVED_FOLDER" desc="Message shown after user saves a new offline page. Also specifies in which folder the bookmark was added (Use 'bookmarks' name in UI strings)."> - Bookmark saved offline to <ph name="FOLDER_NAME">%1$s<ex>Mobile bookmarks</ex></ph> - </message> - <message name="IDS_OFFLINE_PAGES_AS_BOOKMARKS_PAGE_SKIPPED" desc="Message shown after a page was saved as a bookmark, but an offline copy was not created due to that the page is not HTTP or HTTPS page (Use 'bookmarks' name in UI strings)."> - Bookmarked - </message> - <message name="IDS_OFFLINE_PAGES_AS_BOOKMARKS_PAGE_SAVED_STORAGE_NEAR_FULL" desc="Message shown after user adds a new offline page and the storage is almost full (Use 'bookmarks' name in UI strings)."> - Bookmark saved offline. Storage almost full. - </message> - <message name="IDS_OFFLINE_PAGES_AS_BOOKMARKS_PAGE_FAILED_TO_SAVE" desc="Message shown after a page was saved as a bookmark, but an offline copy was not created due to problems other than storage (Use 'bookmarks' name in UI strings)."> - Bookmark not available offline - </message> - <message name="IDS_OFFLINE_PAGES_AS_BOOKMARKS_PAGE_FAILED_TO_SAVE_STORAGE_NEAR_FULL" desc="Message shown after a page was saved as a bookmark, but an offline copy was not created due to storage problem (Use 'bookmarks' name in UI strings)."> - Bookmark not available offline. Storage almost full. - </message> - <message name="IDS_OFFLINE_PAGES_AS_BOOKMARKS_STORAGE_SPACE_MESSAGE" desc="Text explaining how much storage is currently used for offline copies of saved pages (Use 'bookmarks' name in UI strings)."> - Bookmarks are currently taking up <ph name="TOTAL_OFFLINE_STORAGE_SIZE">%1$s<ex>780 MB</ex></ph>. - </message> - <message name="IDS_OFFLINE_PAGES_AS_BOOKMARKS_VIEWING_OFFLINE_PAGE" desc="Text explaining that the user is viewing an offline copy of a web page (Use 'bookmarks' name in UI strings)."> - Viewing an offline copy of this bookmark - </message> <!-- Find in page --> <message name="IDS_HINT_FIND_IN_PAGE" desc="Hint text to show for the find in page search field when the search field is empty."> @@ -2306,11 +2190,6 @@ However, you aren’t invisible. Going incognito doesn’t hide your browsing from your employer, your internet service provider, or the websites you visit. </message> - <message name="IDS_OFFLINE_PAGES_NEW_TAB_INCOGNITO_MESSAGE" desc="Message shown when a user opens an incognito tab explaining incognito mode"> - Pages you view in incognito tabs won’t stick around in your browser’s history, cookie store, or search history after you’ve closed all of your incognito tabs. Any downloaded files or saved pages will be kept. - -However, you aren’t invisible. Going incognito doesn’t hide your browsing from your employer, your internet service provider, or the websites you visit. - </message> <!-- Contextual Search --> <message name="IDS_CONTEXTUAL_SEARCH_NETWORK_UNAVAILABLE" desc="Tells the user the network is not accessible."> @@ -2435,6 +2314,44 @@ <message name="IDS_USB_CHOOSER_DIALOG_FOOTNOTE_TEXT" desc="This text is shown at the bottom of the USB chooser dialog with a link to part of its text."> Not seeing your device? <ph name="BEGIN_LINK"><link></ph>Get help<ph name="END_LINK"></link></ph> </message> + + <!-- Payments --> + <message name="IDS_PAYMENTS_METHOD_OF_PAYMENT_LABEL" desc="The title for the section that lets the user select the method of payment."> + Payment + </message> + <message name="IDS_PAYMENTS_SHIPPING_SUMMARY_LABEL" desc="The title for the section of shipping information."> + Shipping + </message> + <message name="IDS_PAYMENTS_SHIPPING_ADDRESS_LABEL" desc="The title for the section that lets the user select the address where the product should be shipped."> + Shipping address + </message> + <message name="IDS_PAYMENTS_SHIPPING_OPTION_LABEL" desc="The title for the section that lets the user select how the product should be shipped."> + Shipping option + </message> + <message name="IDS_PAYMENTS_SELECT_SHIPPING_OPTION_PROMPT" desc="The label for the button that presents the user with the list of possible shipping options."> + Select shipping option + </message> + <message name="IDS_PAYMENTS_ORDER_SUMMARY_LABEL" desc="The title of the section that shows the summary of the order, including names and prices of individual line items, i.e. the bill."> + Order summary + </message> + <message name="IDS_PAYMENTS_EDIT_BUTTON" desc="The label for the button that lets the user edit their payment options."> + Edit + </message> + <message name="IDS_PAYMENTS_CANCEL_BUTTON" desc="The label for the button that cancels the pending payment operation."> + Cancel + </message> + <message name="IDS_PAYMENTS_PAY_BUTTON" desc="The label for the button that finishes the payment process."> + Pay + </message> + <message name="IDS_PAYMENTS_PROCESSING_MESSAGE" desc="The text that informs the user that the payment is being verified and charged."> + Processing + </message> + <message name="IDS_PAYMENTS_SUCCESS_MESSAGE" desc="The text that informs the user that the payment has been verified and charged."> + Payment processed + </message> + <message name="IDS_PAYMENTS_ERROR_MESSAGE" desc="The text that informs the user that there is error in verifying and charging the payment."> + Error processing payment + </message> </messages> </release> </grit>
diff --git a/chrome/android/java/strings/translations/android_chrome_strings_am.xtb b/chrome/android/java/strings/translations/android_chrome_strings_am.xtb index 26cf767..d155b273 100644 --- a/chrome/android/java/strings/translations/android_chrome_strings_am.xtb +++ b/chrome/android/java/strings/translations/android_chrome_strings_am.xtb
@@ -18,6 +18,7 @@ <translation id="1240668123557180468">በአቅራቢያ ባሉ ነገሮች የተላኩ ድረ-ገጾችን ያግኙ። Chrome በእርስዎ ዙሪያ ካሉ ነገሮች ጋር ተያያዥነት ያላቸውን ድረ-ገጾችን ይሰበስባል፣ ለእርስዎ በጣም አስፈላጊ የሆነውን ለማግኘት ወደ Google አገልግሎት ስም-አልባ አድርጎ ይልካቸዋል፣ ከዚያ ያሳያቸዋል። አካላዊ ድርን ለመጠቀም ብሉቱዝ እና አካባቢን ማብራት አለብዎት።</translation> +<translation id="1250508505624960884">የChrome ቅድመ-ይሁንታ ዕልባቶች</translation> <translation id="1254090737195733114">ውሂብ ከውጭ ይምጣ?</translation> <translation id="1258753120186372309">Google doodle፦ <ph name="DOODLE_DESCRIPTION" /></translation> <translation id="1272079795634619415">አቁም</translation> @@ -39,9 +40,11 @@ <translation id="1445680696957526815">የChrome አባላት እርስ ከራሳቸው ጋር ተኳሃኝ አይደሉም። Chrome እያላቀ ሊሆን ይችላል፣ እባክዎ በጥቂት ደቂቃዎች ውስጥ እንደገና ይሞክሩ። ችግሩ ከቀጠለ Chromeን አራግፈውት እንደገና ጭነው ይሞክሩ።</translation> <translation id="1446450296470737166">ሙሉ የMIDI መሣሪያዎች መቆጣጠርን ያስችላል</translation> <translation id="145097072038377568">በAndroid ቅንብሮች ውስጥ ጠፍቷል።</translation> +<translation id="147006957810816598">ከእርስዎ የGoogle መለያ ዘግተው እንዲወጡ አይደረጉም።</translation> <translation id="1477626028522505441">በአገልጋይ ችግሮች ምክንያት <ph name="FILE_NAME" />ን ማውረድ አልተሳካም።</translation> <translation id="1506061864768559482">የፍለጋ ፕሮግራም</translation> <translation id="1513352483775369820">ዕልባቶች እና የድር ታሪክ</translation> +<translation id="1549000191223877751">ወደ ሌላ መስኮት ውሰድ</translation> <translation id="1553358976309200471">Chromeን አዘምን</translation> <translation id="1557201757634521564">ምስጠራን በራስ እወቅ</translation> <translation id="1592483623187843893">ዕልባት ከመስመር ውጭ ተቀምጧል</translation> @@ -69,8 +72,10 @@ <translation id="194341124344773587">በ<ph name="BEGIN_LINK" />Android ቅንብሮች<ph name="END_LINK" /> ውስጥ ፍቃዶችን ለChrome ያብሩ።</translation> <translation id="1943432128510653496">የይለፍ ቃላትን አስቀምጥ</translation> <translation id="1944384637046898011">ከ<ph name="TIME" /> ጀምሮ በGoogle ይለፍ ቃል አመስጥር</translation> +<translation id="1959930595721737608">ጃቫስክሪፕት በሚከተለው ጣቢያ ላይ ፍቀድ።</translation> <translation id="1966710179511230534">እባክዎ የመግቢያ ዝርዝሮችዎን ያዘምኑ።</translation> <translation id="1974060860693918893">የላቀ</translation> +<translation id="1984321224716884559">የChrome ገንቢ ዕልባቶች</translation> <translation id="1984937141057606926">የተፈቀደ፣ ከሶስተኛ ወገን በቀር</translation> <translation id="1994173015038366702">የጣቢያ ዩአርኤል</translation> <translation id="2001120796168634316">በኋላ ላይ ለመጠቀም የተገናኘ ገጽን አስቀምጥ</translation> @@ -80,6 +85,7 @@ <translation id="2079545284768500474">ቀልብስ</translation> <translation id="2082238445998314030">ውጤት <ph name="RESULT_NUMBER" /> ከ<ph name="TOTAL_RESULTS" /></translation> <translation id="2095887075102408547">ይህ ባህሪ ሲበራ Chrome የጎበኟቸውን ገጾች ከማውረዱ በፊት ለማመቅ የGoogle አገልጋዮችን ይጠቀማል። ግላዊ ግንኙነቶችን (ኤችቲቲፒኤስ) ወይም ማንነት የማያሳውቁ ትሮችን በመጠቀም የተደረሰባቸው ገጾች አይተቡም ወይም በGoogle አይታይም።</translation> +<translation id="2096396629993765042">ከእርስዎ የGoogle መለያ ዘግተው እንዲወጡ አይደረጉም። የእርስዎ Google መለያ በ<ph name="BEGIN_LINK" />history.google.<ph name="END_LINK" /> ውስጥ ሌሎች ዓይነቶች የአሰሳ ታሪኮች ሊኖሩት ይችላል።</translation> <translation id="2100273922101894616">በራስ-ግባ</translation> <translation id="2126426811489709554">በChrome የጎለበተ</translation> <translation id="213279576345780926"><ph name="TAB_TITLE" /> ተዘግቷል</translation> @@ -188,6 +194,7 @@ <translation id="360480449234699036">ገጹን ትተው ሳይሄዱ በድር ጣቢያዎች ላይ ስላሉ ርዕሶች ይወቁ። ለመፈለግ ይንኩ አንድ ቃል እና በዙሪያው ያለውን አውድ ወደ Google ፍለጋ ይልክና ትርጓሜዎችን፣ ስዕሎችን የፍለጋ ውጤቶችን እና ሌሎች ዝርዝሮችን ይመልሳል። የፍለጋ ቃልዎን ለማስተካከል ለመምረጥ በረዥሙ ይጫኑ። ፍለጋዎን ይበልጥ ለማጥራት መቃኑን እስከ ላይ ድረስ ያንሸራትቱት እና የፍለጋ ሳጥኑን ይንኩ።</translation> +<translation id="3623048332793834136">የChrome Canary ዕልባቶች</translation> <translation id="363596933471559332">የተከማቹ ምስክርነቶችን በመጠቀም በራስ-ሰር ወደ የድር ጣቢያዎች መለያ ይግቡ። ባህሪው ሲጠፋ ወደ አንድ ድር ጣቢያ ከመግባትዎ በፊት ማረጋገጫ ይጠየቃሉ።</translation> <translation id="3653742808139624888">የእርስዎን ዕልባቶች በሁሉም መሣሪያዎችዎ ላይ ለማግኘት ወደ Chrome ይግቡ</translation> <translation id="3656115297268584622">በ<ph name="BEGIN_LINK" />Android ቅንብሮች<ph name="END_LINK" /> ውስጥ አካባቢን ያብሩ።</translation> @@ -196,7 +203,7 @@ <translation id="3716158070938632480">ድረ-ገጾች በአቅራቢያ ናቸው</translation> <translation id="3732088672634061408">ፍላጎቶችን ሰርስሮ ማውጣት አልተቻለም።</translation> <translation id="3738139272394829648">ለመፈለግ ይንኩ</translation> -<translation id="3744111561329211289">የጀርባ ስምረት</translation> +<translation id="3744111561329211289">የዳራ ስምረት</translation> <translation id="3809549525127675114">«<ph name="VIDEO_TITLE" />» ጨርሷል</translation> <translation id="3828029223314399057">ዕልባቶች ፈልግ</translation> <translation id="3871171699884605801">የአሰሳ ታሪክ በህጻናት መለያ ሊጸዳ አይችልም</translation> @@ -255,6 +262,7 @@ <translation id="4645575059429386691">በእርስዎ ወላጅ የሚቀናበር</translation> <translation id="4663756553811254707"><ph name="NUMBER_OF_BOOKMARKS" /> ዕልባቶች ተሰርዘዋል</translation> <translation id="4665282149850138822"><ph name="NAME" /> ወደ እርስዎ መነሻ ገፅ ታክሏል</translation> +<translation id="4668044310199835006">የChrome ዕልባቶችን ይስሩ</translation> <translation id="4684427112815847243">ሁሉንም ያመሳስሉ</translation> <translation id="4686372254213217147">የመጀመሪያ መጠን</translation> <translation id="4690286298542128877">ትሮች በChrome ውስጥ ወደሚገኝ የትር ቀያያሪ ይንቀሳቀሳሉ።</translation> @@ -415,6 +423,7 @@ <translation id="6464825623202322042">ይህ መሣሪያ</translation> <translation id="6476911854266661814">«<ph name="VIDEO_TITLE" />»ን ለአፍታ ቆሟል</translation> <translation id="6482749332252372425">በማከማቻ ቦታ ጥበት ምክንያት <ph name="FILE_NAME" />ን ማውረድ አልተሳካም።</translation> +<translation id="6541922744811587456">የChrome ዕልባቶች</translation> <translation id="654446541061731451">በሞገድ የሚለቅቁት ትር ይምረጡ</translation> <translation id="6550675742724504774">አማራጮች</translation> <translation id="656628257199996201"><ph name="SOURCE_LANGUAGE" />ን ሁልጊዜ መተርጎም</translation> @@ -428,6 +437,7 @@ <translation id="6656545060687952787">Chrome መሣሪያዎችን ለመቃኘት የአካባቢ መዳረሻ ያስፈልገዋል። <ph name="BEGIN_LINK" />ፍቃዶችን ያዘምኑ<ph name="END_LINK" /></translation> <translation id="666268767214822976">በአድራሻ አሞሌው ላይ እየተየቡ ሳለ ተዛማጅ መጠይቆችን ለማሳየት እና ታዋቂ ድር ጣቢያዎችን ለማሳየት የመገመቻ አገልግሎት ይጠቀሙ</translation> <translation id="666981079809192359">የChrome ግላዊነት ማስታወቂያ</translation> +<translation id="6683720003467092441">በሚከተለው ጣቢያ ላይ የዳራ ስምረት ፍቀድ።</translation> <translation id="6697251040310467641">ገጽ ከመስመር ውጪ ተቀምጧል</translation> <translation id="6698801883190606802">የተመሳሰለ ውሂብ ያስተዳድሩ</translation> <translation id="6699351163704950317">ሁሉም የተቀመጡ ገጾች</translation> @@ -493,6 +503,9 @@ <translation id="7473891865547856676">አይ፣ አመሰግናለሁ</translation> <translation id="7475192538862203634">ይህን በተደጋጋሚነት እያዩት ከሆኑ እነዚህን <ph name="BEGIN_LINK" />የአስተያየት ጥቆማዎች<ph name="END_LINK" /> ይሞክሩ።</translation> <translation id="748127970106343339">የመሣሪያ ምስክርነት ስረዛን ያረጋግጡ</translation> +<translation id="7487352416683556407">የተመረጤው ውሂብ ከChrome እና የሰመሩ መሣሪያዎችዎ ተወግዷል። + +የእርስዎ Google መለያ በ<ph name="BEGIN_LINK" />history.google.com<ph name="END_LINK" /> ላይ እንደ ፍለጋዎች እና የሌሎች Google አገልግሎቶች እንቅስቃሴ ያሉ ሌሎች የአሰሳ ታሪክ ዓይነቶች ሊኖሩት ይችላል።</translation> <translation id="7493994139787901920"><ph name="VERSION" /> (የተዘመነው በ<ph name="TIME_SINCE_UPDATE" />)</translation> <translation id="7498271377022651285">እባክዎ ይጠብቁ…</translation> <translation id="7499262814309712782">መለያን አሥምር</translation> @@ -596,6 +609,7 @@ <translation id="8737542153238017984">የተቀመጠ ገጽ ከመስመር ውጭ አይገኝም። ማከማቻ ሊሞላ ትንሽ ነው የቀረው።</translation> <translation id="8793430725658173476">ዩአርኤል ቅዳ</translation> <translation id="8798099450830957504">እንደወረደ</translation> +<translation id="8812942424849541387">ይሄ እንዴት እንደሚሠራ በ<ph name="BEGIN_LINK1" />ቅንብሮች<ph name="END_LINK1" /> ውስጥ ይቆጣጠሩ</translation> <translation id="8820817407110198400">ዕልባቶች</translation> <translation id="8829678271838353305"><ph name="ACCOUNT_EMAIL_LAST" /> ገብቷል። በ<ph name="ACCOUNT_EMAIL_NEW" /> መግባት እንደ ዕልባቶች ያለ በመለያዎች መካከል የተመሳሰለ ውሂብ ያዋህዳል። መረጃ አለያይቶ ለማቆየት የአሰሳ ውሂብ በ<ph name="BEGIN_LINK" />ቅንብሮች<ph name="END_LINK" /> ውስጥ ያጽዱ።</translation> <translation id="8853345339104747198"><ph name="TAB_TITLE" />፣ ትር</translation>
diff --git a/chrome/android/java/strings/translations/android_chrome_strings_ar.xtb b/chrome/android/java/strings/translations/android_chrome_strings_ar.xtb index 3efc438..ec00f5e 100644 --- a/chrome/android/java/strings/translations/android_chrome_strings_ar.xtb +++ b/chrome/android/java/strings/translations/android_chrome_strings_ar.xtb
@@ -18,6 +18,7 @@ <translation id="1240668123557180468">تعرَّف على صفحات الويب التي أرسلتها الأجهزة المجاورة. يُجمِّع Chrome صفحات الويب المرتبطة بالأجهزة حولك ويُرسلها دون الكشف عن هويتها إلى خدمة Google لمعرفة أكثرها نفعًا لك ثم يعرضها. يتعين عليك تشغيل خدمتى البلوتوث والموقع لاستخدام الشبكة المادية.</translation> +<translation id="1250508505624960884">الإشارات المرجعية للإصدار التجريبي من متصفح Chrome</translation> <translation id="1254090737195733114">هل تريد استيراد البيانات؟</translation> <translation id="1258753120186372309">رسم الشعار المبتكر من Google: <ph name="DOODLE_DESCRIPTION" /></translation> <translation id="1272079795634619415">إيقاف</translation> @@ -39,9 +40,11 @@ <translation id="1445680696957526815">مكونات Chrome غير متوافقة مع بعضها البعض. قد تتم ترقية Chrome؛ لذا يُرجى إعادة المحاولة بعد دقائق قليلة. وإذا استمرت المشكلة، فحاول إلغاء تثبيت Chrome وإعادة تثبيته.</translation> <translation id="1446450296470737166">السماح بالتحكم الكامل لأجهزة MIDI</translation> <translation id="145097072038377568">تم إيقافه في إعدادات Android.</translation> +<translation id="147006957810816598">لن يتم تسجيل خروجك من حسابك في Google.</translation> <translation id="1477626028522505441">أخفق تنزيل الملف <ph name="FILE_NAME" /> بسبب مشكلات بالخادم.</translation> <translation id="1506061864768559482">محرك البحث</translation> <translation id="1513352483775369820">الإشارات المرجعية وسجل بحث الويب</translation> +<translation id="1549000191223877751">الانتقال إلى نافذة أخرى</translation> <translation id="1553358976309200471">تحديث Chrome</translation> <translation id="1557201757634521564">الاكتشاف التلقائي للتشفير</translation> <translation id="1592483623187843893">حُفظَت الإشارة المرجعية بلا اتصال</translation> @@ -69,8 +72,10 @@ <translation id="194341124344773587">تشغيل الإذن لـ Chrome في <ph name="BEGIN_LINK" />إعدادات Android<ph name="END_LINK" /></translation> <translation id="1943432128510653496">حفظ كلمات المرور</translation> <translation id="1944384637046898011">ترميز الكل باستخدام كلمة مرور Google بدءًا من <ph name="TIME" /></translation> +<translation id="1959930595721737608">السماح بتشغيل جافا سكريبت في الموقع التالي.</translation> <translation id="1966710179511230534">الرجاء تحديث تفاصيل تسجيل الدخول.</translation> <translation id="1974060860693918893">إعدادات متقدمة</translation> +<translation id="1984321224716884559">الإشارات المرجعية لإصدار مطوّري البرامج من Chrome</translation> <translation id="1984937141057606926">مسموح باستثناء الجهات الخارجية</translation> <translation id="1994173015038366702">عنوان URL للموقع</translation> <translation id="2001120796168634316">حفظ الصفحة المرتبطة لوقت لاحق</translation> @@ -80,6 +85,7 @@ <translation id="2079545284768500474">تراجع</translation> <translation id="2082238445998314030">النتيجة <ph name="RESULT_NUMBER" /> من <ph name="TOTAL_RESULTS" /></translation> <translation id="2095887075102408547">عند تشغيل هذه الميزة، سيستخدم Chrome خوادم Google لضغط الصفحات التي تزورها قبل تنزيلها. ولن يتم تحسين الصفحات التي يتم الوصول إليها باستخدام الاتصالات الخاصة (HTTPS) أو من خلال علامات تبويب التصفح المتخفي أو لن يكتشفها متصفح Google.</translation> +<translation id="2096396629993765042">لن يتم تسجيل خروجك من حسابك في Google. قد يتضمن حسابك في Google نماذج أخرى من سجل التصفح في <ph name="BEGIN_LINK" />history.google.com<ph name="END_LINK" />.</translation> <translation id="2100273922101894616">تسجيل الدخول التلقائي</translation> <translation id="2126426811489709554">يدعمها Chrome</translation> <translation id="213279576345780926">تم إغلاق <ph name="TAB_TITLE" /></translation> @@ -186,6 +192,7 @@ <translation id="360480449234699036">اعرف موضوعات معنية بمواقع الويب بدون مغادرة الصفحة. تُرسل ميزة "المس للبحث" الكلمة والسياق المحيط بها إلى بحث Google، والتعريفات العائدة، والصور، ونتائج البحث، وتفاصيل أخرى. لضبط عبارة البحث، اضغط مع الاستمرار للتحديد. لتحسين البحث، مرّر اللوحة للأعلى والمس مربع البحث.</translation> +<translation id="3623048332793834136">الإشارات المرجعية لمتصفح Chrome Canary</translation> <translation id="363596933471559332">يمكن تسجيل الدخول تلقائيًا إلى مواقع الويب باستخدم الاعتمادات المخزّنة. وعندما تكون الميزة معطّلة، فسيُطلب منك التحقق كل مرة قبل تسجيل الدخول إلى مواقع الويب.</translation> <translation id="3653742808139624888">للحصول على الإشارات المرجعية على جميع أجهزتك، سجِّل الدخول إلى Chrome</translation> <translation id="3656115297268584622">تشغيل الموقع في <ph name="BEGIN_LINK" />إعدادات Android<ph name="END_LINK" />.</translation> @@ -254,6 +261,7 @@ <translation id="4645575059429386691">يديره والداك</translation> <translation id="4663756553811254707">تم حذف <ph name="NUMBER_OF_BOOKMARKS" /> من الإشارات المرجعية</translation> <translation id="4665282149850138822">تمت إضافة <ph name="NAME" /> إلى صفحتك الرئيسية</translation> +<translation id="4668044310199835006">الإشارات المرجعية لمتصفح Work Chrome</translation> <translation id="4684427112815847243">مزامنة كل شيء</translation> <translation id="4686372254213217147">الحجم الأصلي</translation> <translation id="4690286298542128877">سيتم نقل علامات التبويب إلى مبدّل علامات التبويب في Chrome.</translation> @@ -414,6 +422,7 @@ <translation id="6464825623202322042">هذا الجهاز</translation> <translation id="6476911854266661814">تم إيقاف "<ph name="VIDEO_TITLE" />" مؤقتًا</translation> <translation id="6482749332252372425">أخفق تنزيل الملف <ph name="FILE_NAME" /> لعدم توفر مساحة لتخزين.</translation> +<translation id="6541922744811587456">الإشارات المرجعية لمتصفح Chrome</translation> <translation id="654446541061731451">حدد علامة تبويب لإرسالها باستخدام الشعاع</translation> <translation id="6550675742724504774">خيارات</translation> <translation id="656628257199996201">ترجمة <ph name="SOURCE_LANGUAGE" /> دائمًا</translation> @@ -427,6 +436,7 @@ <translation id="6656545060687952787">يحتاج Chrome للوصول إلى المواقع للبحث عن الأجهزة. <ph name="BEGIN_LINK" />تحديث الأذونات<ph name="END_LINK" />.</translation> <translation id="666268767214822976">يمكنك استخدام خدمة التوقعات لعرض طلبات البحث ذات الصلة ومواقع الويب الشائعة أثناء الكتابة في شريط العناوين</translation> <translation id="666981079809192359">إشعار خصوصية Chrome</translation> +<translation id="6683720003467092441">السماح بتشغيل "مزامنة الخلفية" في الموقع التالي.</translation> <translation id="6697251040310467641">تم حفظ صفحة بلا اتصال</translation> <translation id="6698801883190606802">إدارة البيانات المتزامنة</translation> <translation id="6699351163704950317">جميع الصفحات التي تم حفظها</translation> @@ -492,6 +502,9 @@ <translation id="7473891865547856676">لا، شكرًا</translation> <translation id="7475192538862203634">إذا تكرر ظهور هذا، فحاول الاستفادة من <ph name="BEGIN_LINK" />الاقتراحات<ph name="END_LINK" />.</translation> <translation id="748127970106343339">تأكيد حذف بيانات اعتماد الجهاز</translation> +<translation id="7487352416683556407">تمت إزالة البيانات المُحددة من متصفح Chrome والأجهزة التي تمت مزامنتها. + +قد يحتوي حسابك في Google على نماذج أخرى من سجل التصفح، مثل عمليات البحث والأنشطة من خدمات Google الأخرى في <ph name="BEGIN_LINK" />history.google.com<ph name="END_LINK" />.</translation> <translation id="7493994139787901920"><ph name="VERSION" /> (تم التحديث منذ <ph name="TIME_SINCE_UPDATE" />)</translation> <translation id="7498271377022651285">يُرجى الانتظار...</translation> <translation id="7499262814309712782">حساب المزامنة</translation> @@ -597,6 +610,7 @@ <translation id="8737542153238017984">الصفحة المحفوظة غير متوفرة في وضع عدم الاتصال. سعة التخزين ممتلئة.</translation> <translation id="8793430725658173476">نسخ عنوان URL</translation> <translation id="8798099450830957504">الافتراضي</translation> +<translation id="8812942424849541387">التحكم في كيفية عمل هذا في <ph name="BEGIN_LINK1" />الإعدادات<ph name="END_LINK1" /></translation> <translation id="8820817407110198400">إشارات</translation> <translation id="8829678271838353305">تم تسجيل دخول <ph name="ACCOUNT_EMAIL_LAST" />. سيدمج تسجيل الدخول باستخدام <ph name="ACCOUNT_EMAIL_NEW" /> البيانات التي تمت مزامنتها، مثل الإشارات المرجعية بين الحسابات. للحفاظ على المعلومات منفصلة، عليك بمحو بيانات التصفح في <ph name="BEGIN_LINK" />الإعدادات<ph name="END_LINK" />.</translation> <translation id="8853345339104747198">علامة التبويب <ph name="TAB_TITLE" /></translation>
diff --git a/chrome/android/java/strings/translations/android_chrome_strings_ca.xtb b/chrome/android/java/strings/translations/android_chrome_strings_ca.xtb index feebf9c..e353056 100644 --- a/chrome/android/java/strings/translations/android_chrome_strings_ca.xtb +++ b/chrome/android/java/strings/translations/android_chrome_strings_ca.xtb
@@ -73,7 +73,7 @@ <translation id="1974060860693918893">Configuració avançada</translation> <translation id="1984937141057606926">Permeses, excepte les de tercers</translation> <translation id="1994173015038366702">URL del lloc</translation> -<translation id="2001120796168634316">Desa pàg. enllaç. per a més tard</translation> +<translation id="2001120796168634316">Desa la pàgina per a més tard</translation> <translation id="200669432486043882">Substitueix el fitxer</translation> <translation id="2038563949887743358">Activa Mostra com a ordinador</translation> <translation id="2073235970478114994">Carrega les imatges</translation>
diff --git a/chrome/android/java/strings/translations/android_chrome_strings_de.xtb b/chrome/android/java/strings/translations/android_chrome_strings_de.xtb index ced5758..775f20a 100644 --- a/chrome/android/java/strings/translations/android_chrome_strings_de.xtb +++ b/chrome/android/java/strings/translations/android_chrome_strings_de.xtb
@@ -56,7 +56,7 @@ <translation id="1657479659644194568">Chrome einrichten</translation> <translation id="169033420419426091"><ph name="FILE_NAME" /> konnte nicht heruntergeladen werden, weil keine SD-Karte gefunden wurde.</translation> <translation id="1692118695553449118">Synchronisierung ist aktiviert</translation> -<translation id="1709438864123551175">Datenkomprimierung</translation> +<translation id="1709438864123551175">Datensparmodus</translation> <translation id="1742134235943978220">In folgende Sprache übersetzt: <ph name="TARGET_LANGUAGE" /></translation> <translation id="1749561566933687563">Lesezeichen synchronisieren</translation> <translation id="17513872634828108">Geöffnete Tabs</translation> @@ -113,7 +113,7 @@ <translation id="2501278716633472235">Zurück</translation> <translation id="2512222046227390255">AutoFill-Formulare</translation> <translation id="2521102375070725336">Lesezeichen offline im Ordner "<ph name="FOLDER_NAME" />" gespeichert</translation> -<translation id="2526148617758225454">Die Datenkomprimierung ist aktiviert. Sie können sie in den Einstellungen verwalten.</translation> +<translation id="2526148617758225454">Der Datensparmodus ist aktiviert. Über die Einstellungen können Sie ihn wieder deaktivieren.</translation> <translation id="2532336938189706096">Web-Ansicht</translation> <translation id="2536728043171574184">Eine Offline-Kopie dieser Seite wird angezeigt.</translation> <translation id="2546283357679194313">Cookies und Websitedaten</translation> @@ -366,7 +366,7 @@ <translation id="5817918615728894473">Pairing durchführen</translation> <translation id="5832934273103296195">Maximiert – zum Minimieren klicken</translation> <translation id="583891442612896534">Chrome kann die Google-Server für die Datenkomprimierung nicht erreichen. Ihre Einsparungen bei der Datennutzung können begrenzt sein.</translation> -<translation id="585027516397408832">Datenkomprimierung aktiviert</translation> +<translation id="585027516397408832">Datensparmodus aktiviert</translation> <translation id="5860033963881614850">Aus</translation> <translation id="5869522115854928033">Gespeicherte Passwörter</translation> <translation id="5899349522111170522">Neue Datei erstellen</translation> @@ -460,7 +460,7 @@ <translation id="6999892069268112724">Google-Konto bestätigen</translation> <translation id="7021515813996758557"><ph name="FILE_NAME" /> heruntergeladen</translation> <translation id="7022756207310403729">Im Browser öffnen</translation> -<translation id="7026897394897382018">Optimierung aktivieren</translation> +<translation id="7026897394897382018">Datensparmodus aktivieren</translation> <translation id="7029809446516969842">Passwörter</translation> <translation id="7031882061095297553">Synchronisieren mit</translation> <translation id="7053983685419859001">Blockieren</translation> @@ -474,7 +474,7 @@ <translation id="7096034533295549981">Video wird geladen</translation> <translation id="7180611975245234373">Aktualisieren</translation> <translation id="7191430249889272776">Tab im Hintergrund geöffnet</translation> -<translation id="7208788139759694678">Datenkomprimierung deaktiviert</translation> +<translation id="7208788139759694678">Datensparmodus deaktiviert</translation> <translation id="7243308994586599757">Optionen unten auf dem Bildschirm verfügbar</translation> <translation id="7244362611678346589"><ph name="SEARCH_ENGINE_URL" /> zeigt Ihnen lokale Suchergebnisse basierend auf Ihrem Standort.</translation> <translation id="7299441085833132046"><ph name="BEGIN_LINK" />Hilfe<ph name="END_LINK" /></translation>
diff --git a/chrome/android/java/strings/translations/android_chrome_strings_en-GB.xtb b/chrome/android/java/strings/translations/android_chrome_strings_en-GB.xtb index e1766b9..bd26ba1 100644 --- a/chrome/android/java/strings/translations/android_chrome_strings_en-GB.xtb +++ b/chrome/android/java/strings/translations/android_chrome_strings_en-GB.xtb
@@ -18,6 +18,7 @@ <translation id="1240668123557180468">Discover web pages sent by nearby objects. Chrome gathers web pages associated with objects around you, sends them anonymously to a Google service to find the ones most useful to you, then displays them. You must have Bluetooth and Location turned on in order to use the Physical Web.</translation> +<translation id="1250508505624960884">Chrome Beta bookmarks</translation> <translation id="1254090737195733114">Import data?</translation> <translation id="1258753120186372309">Google doodle: <ph name="DOODLE_DESCRIPTION" /></translation> <translation id="1272079795634619415">Stop</translation> @@ -39,9 +40,11 @@ <translation id="1445680696957526815">Chrome’s components are incompatible with one another. Chrome may be upgrading, please try again in a few minutes. If the problem continues, try uninstalling and re-installing Chrome.</translation> <translation id="1446450296470737166">Allow full control of MIDI devices</translation> <translation id="145097072038377568">Turned off in Android Settings</translation> +<translation id="147006957810816598">You won’t be signed out of your Google account.</translation> <translation id="1477626028522505441"><ph name="FILE_NAME" /> download failed due to server issues.</translation> <translation id="1506061864768559482">Search engine</translation> <translation id="1513352483775369820">Bookmarks and web history</translation> +<translation id="1549000191223877751">Move to other window</translation> <translation id="1553358976309200471">Update Chrome</translation> <translation id="1557201757634521564">Auto-detect encoding</translation> <translation id="1592483623187843893">Bookmark saved offline</translation> @@ -69,8 +72,10 @@ <translation id="194341124344773587">Turn on permission for Chrome in <ph name="BEGIN_LINK" />Android Settings<ph name="END_LINK" />.</translation> <translation id="1943432128510653496">Save passwords</translation> <translation id="1944384637046898011">Encrypt all with Google password as of <ph name="TIME" /></translation> +<translation id="1959930595721737608">Allow JavaScript on the following site.</translation> <translation id="1966710179511230534">Please update your sign-in details.</translation> <translation id="1974060860693918893">Advanced</translation> +<translation id="1984321224716884559">Chrome Dev bookmarks</translation> <translation id="1984937141057606926">Allowed, except third-party</translation> <translation id="1994173015038366702">Site URL</translation> <translation id="2001120796168634316">Save linked page for later</translation> @@ -80,6 +85,7 @@ <translation id="2079545284768500474">Undo</translation> <translation id="2082238445998314030">Result <ph name="RESULT_NUMBER" /> of <ph name="TOTAL_RESULTS" /></translation> <translation id="2095887075102408547">When this feature is turned on, Chrome will use Google servers to compress pages that you visit before downloading them. Pages accessed using private connections (HTTPS) or in Incognito tabs will not be optimised or seen by Google.</translation> +<translation id="2096396629993765042">You won’t be signed out of your Google account. Your Google account may have other forms of browsing history at <ph name="BEGIN_LINK" />history.google.com<ph name="END_LINK" />.</translation> <translation id="2100273922101894616">Auto Sign-in</translation> <translation id="2126426811489709554">Powered by Chrome</translation> <translation id="213279576345780926">Closed <ph name="TAB_TITLE" /></translation> @@ -188,6 +194,7 @@ <translation id="360480449234699036">Learn about topics on websites without leaving the page. Touch to Search sends a word and its surrounding context to Google Search, returning definitions, pictures, search results and other details. To adjust your search term, long press to select. To refine your search, slide the panel all the way up and touch the search box.</translation> +<translation id="3623048332793834136">Chrome Canary bookmarks</translation> <translation id="363596933471559332">Automatically sign in to websites using stored credentials. When the feature is off, you’ll be asked for verification every time before signing in to a website.</translation> <translation id="3653742808139624888">To get your bookmarks on all your devices, sign in to Chrome</translation> <translation id="3656115297268584622">Turn on location in <ph name="BEGIN_LINK" />Android Settings<ph name="END_LINK" />.</translation> @@ -255,6 +262,7 @@ <translation id="4645575059429386691">Managed by your parent</translation> <translation id="4663756553811254707"><ph name="NUMBER_OF_BOOKMARKS" /> bookmarks deleted</translation> <translation id="4665282149850138822"><ph name="NAME" /> was added to your Home screen</translation> +<translation id="4668044310199835006">Work Chrome bookmarks</translation> <translation id="4684427112815847243">Sync everything</translation> <translation id="4686372254213217147">Original size</translation> <translation id="4690286298542128877">Tabs will move to a tab switcher inside Chrome.</translation> @@ -415,6 +423,7 @@ <translation id="6464825623202322042">This device</translation> <translation id="6476911854266661814">Paused “<ph name="VIDEO_TITLE" />”</translation> <translation id="6482749332252372425"><ph name="FILE_NAME" /> download failed due to lack of storage space.</translation> +<translation id="6541922744811587456">Chrome bookmarks</translation> <translation id="654446541061731451">Select a tab to beam</translation> <translation id="6550675742724504774">Options</translation> <translation id="656628257199996201">Always translate <ph name="SOURCE_LANGUAGE" /></translation> @@ -428,6 +437,7 @@ <translation id="6656545060687952787">Chrome needs location access to scan for devices. <ph name="BEGIN_LINK" />Update permissions<ph name="END_LINK" /></translation> <translation id="666268767214822976">Use a prediction service to show related queries and popular websites as you type in the address bar</translation> <translation id="666981079809192359">Chrome Privacy Notice</translation> +<translation id="6683720003467092441">Allow Background Sync on the following site.</translation> <translation id="6697251040310467641">Page saved offline</translation> <translation id="6698801883190606802">Manage synced data</translation> <translation id="6699351163704950317">All saved pages</translation> @@ -493,6 +503,9 @@ <translation id="7473891865547856676">No Thanks</translation> <translation id="7475192538862203634">If you’re seeing this frequently, try these <ph name="BEGIN_LINK" />suggestions<ph name="END_LINK" />.</translation> <translation id="748127970106343339">Confirm device credential deletion</translation> +<translation id="7487352416683556407">The selected data has been removed from Chrome and your synced devices. + +Your Google account may have other forms of browsing history like searches and activity from other Google services at <ph name="BEGIN_LINK" />history.google.com<ph name="END_LINK" />.</translation> <translation id="7493994139787901920"><ph name="VERSION" /> (Updated <ph name="TIME_SINCE_UPDATE" />)</translation> <translation id="7498271377022651285">Please wait…</translation> <translation id="7499262814309712782">Sync account</translation> @@ -596,6 +609,7 @@ <translation id="8737542153238017984">Saved page not available offline. Storage almost full.</translation> <translation id="8793430725658173476">Copy url</translation> <translation id="8798099450830957504">Default</translation> +<translation id="8812942424849541387">Control how this works in <ph name="BEGIN_LINK1" />Settings<ph name="END_LINK1" /></translation> <translation id="8820817407110198400">Bookmarks</translation> <translation id="8829678271838353305"><ph name="ACCOUNT_EMAIL_LAST" /> was signed in. Signing in with <ph name="ACCOUNT_EMAIL_NEW" /> will merge synced data like bookmarks between accounts. To keep information separate, clear browsing data in <ph name="BEGIN_LINK" />settings<ph name="END_LINK" />.</translation> <translation id="8853345339104747198"><ph name="TAB_TITLE" />, tab</translation>
diff --git a/chrome/android/java/strings/translations/android_chrome_strings_es.xtb b/chrome/android/java/strings/translations/android_chrome_strings_es.xtb index f24bcc98..eb7aed1 100644 --- a/chrome/android/java/strings/translations/android_chrome_strings_es.xtb +++ b/chrome/android/java/strings/translations/android_chrome_strings_es.xtb
@@ -285,7 +285,7 @@ <translation id="5016205925109358554">Serif</translation> <translation id="5039804452771397117">Permitir</translation> <translation id="5040262127954254034">Privacidad</translation> -<translation id="5056549851600133418">Artículos recomendados</translation> +<translation id="5056549851600133418">Artículos recomendados para ti</translation> <translation id="5063480226653192405">Uso</translation> <translation id="5100237604440890931">Contraído (hacer clic para ampliar)</translation> <translation id="5107381076085091558">Se ha pausado la descarga.</translation>
diff --git a/chrome/android/java/strings/translations/android_chrome_strings_hu.xtb b/chrome/android/java/strings/translations/android_chrome_strings_hu.xtb index 251571c..94ed1bd8 100644 --- a/chrome/android/java/strings/translations/android_chrome_strings_hu.xtb +++ b/chrome/android/java/strings/translations/android_chrome_strings_hu.xtb
@@ -18,6 +18,7 @@ <translation id="1240668123557180468">Közeli objektumok által küldött weboldalak felfedezése. A Chrome összegyűjti az Ön közelében található objektumokhoz társított weboldalakat, névtelenül elküldi őket egy Google-szolgáltatásnak, hogy megtalálja az Ön számára leghasznosabbakat, majd megjeleníti az oldalakat. A Fizikai web használatához be kell kapcsolnia a Bluetooth funkciót és a helyszolgáltatást.</translation> +<translation id="1250508505624960884">A Chrome bétaverziójának könyvjelzői</translation> <translation id="1254090737195733114">Importálja az adatokat?</translation> <translation id="1258753120186372309">Google ünnepi embléma: <ph name="DOODLE_DESCRIPTION" /></translation> <translation id="1272079795634619415">Leállítás</translation> @@ -39,9 +40,11 @@ <translation id="1445680696957526815">A Chrome egyes összetevői nem kompatibilisek egymással. Lehet, hogy éppen a Chrome verziófrissítése zajlik, ezért próbálja újra pár perc múlva. Ha a probléma továbbra is fennáll, próbálja meg eltávolítani, majd újratelepíteni a Chrome-ot.</translation> <translation id="1446450296470737166">MIDI-eszközök teljes vezérlése</translation> <translation id="145097072038377568">Kikapcsolva az Android beállításaiban</translation> +<translation id="147006957810816598">A rendszer nem jelentkezteti ki Google-fiókjából.</translation> <translation id="1477626028522505441">A következő fájl letöltése szerverproblémák miatt nem sikerült: <ph name="FILE_NAME" />.</translation> <translation id="1506061864768559482">Keresőmotor</translation> <translation id="1513352483775369820">Könyvjelzők és webes előzmények</translation> +<translation id="1549000191223877751">Áthelyezés másik ablakba</translation> <translation id="1553358976309200471">A Chrome böngésző frissítése</translation> <translation id="1557201757634521564">Kódolás automatikus felismerése</translation> <translation id="1592483623187843893">Könyvjelző mentve offline</translation> @@ -69,8 +72,10 @@ <translation id="194341124344773587">A Chrome-ra vonatkozó engedély aktiválása az <ph name="BEGIN_LINK" />Android beállításaiban<ph name="END_LINK" />.</translation> <translation id="1943432128510653496">Jelszavak mentése</translation> <translation id="1944384637046898011">Az összes titkosítása Google-jelszóval ekkortól: <ph name="TIME" /></translation> +<translation id="1959930595721737608">JavaScript engedélyezése a következő webhelyen.</translation> <translation id="1966710179511230534">Kérjük, frissítse bejelentkezési adatait.</translation> <translation id="1974060860693918893">Speciális</translation> +<translation id="1984321224716884559">Chrome Dev-könyvjelzők</translation> <translation id="1984937141057606926">Engedélyezve, kivéve a harmadik felektől származó cookie-kat</translation> <translation id="1994173015038366702">Webhely URL-je</translation> <translation id="2001120796168634316">Linkelt oldal mentése későbbre</translation> @@ -80,6 +85,7 @@ <translation id="2079545284768500474">Visszavonás</translation> <translation id="2082238445998314030">Eredmény: <ph name="RESULT_NUMBER" />/<ph name="TOTAL_RESULTS" /></translation> <translation id="2095887075102408547">Amikor ezt a funkciót bekapcsolja, a Chrome a Google-szerverek segítségével tömöríti az Ön által felkeresett oldalakat, mielőtt letöltené azokat. A privát kapcsolat (HTTPS) használatával, illetve az inkognitómódban megtekintett oldalakat a Google nem látja és nem optimalizálja.</translation> +<translation id="2096396629993765042">A rendszer nem jelentkezteti ki Google-fiókjából. Előfordulhat, hogy a böngészési előzmények más formái még megtalálhatók Google-fiókjában a <ph name="BEGIN_LINK" />history.google.com<ph name="END_LINK" /> címen.</translation> <translation id="2100273922101894616">Automatikus bejelentkezés</translation> <translation id="2126426811489709554">A Chrome erejével</translation> <translation id="213279576345780926">Bezárva: <ph name="TAB_TITLE" /></translation> @@ -188,6 +194,7 @@ <translation id="360480449234699036">Megtudhatja a webhelyek témáit anélkül, hogy elhagyná az oldalt. A Keresés érintéssel funkció elküld egy szót és annak kontextusát a Google Keresés számára, majd meghatározásokat, képeket, keresési eredményeket és egyéb részleteket ad vissza. A keresési kifejezés módosításához hosszú nyomva tartással hajthat végre kiválasztást. A keresés finomításához csúsztassa a panelt teljesen fel, majd érintse meg a keresőmezőt.</translation> +<translation id="3623048332793834136">Chrome Canary-könyvjelzők</translation> <translation id="363596933471559332">Automatikus bejelentkezés webhelyekre a tárolt hitelesítő adatokkal. Ha ez a funkció ki van kapcsolva, mindig meg kell adnia hitelesítő adatait, amikor egy webhelyre szeretne bejelentkezni.</translation> <translation id="3653742808139624888">Ha az összes eszközén szeretné elérni könyvjelzőit, jelentkezzen be a Chrome-ba</translation> <translation id="3656115297268584622">Kapcsolja be a helyszolgáltatást az <ph name="BEGIN_LINK" />Android-beállításokban<ph name="END_LINK" />.</translation> @@ -255,6 +262,7 @@ <translation id="4645575059429386691">A szülő kezeli</translation> <translation id="4663756553811254707"><ph name="NUMBER_OF_BOOKMARKS" /> könyvjelző törölve</translation> <translation id="4665282149850138822">A(z) <ph name="NAME" /> felkerült a kezdőképernyőre</translation> +<translation id="4668044310199835006">Chrome for Work-könyvjelzők</translation> <translation id="4684427112815847243">Minden szinkronizálása</translation> <translation id="4686372254213217147">Eredeti méret</translation> <translation id="4690286298542128877">A lapok a Chrome-on belüli lapváltóba kerülnek.</translation> @@ -415,6 +423,7 @@ <translation id="6464825623202322042">Ezen az eszközön</translation> <translation id="6476911854266661814">„<ph name="VIDEO_TITLE" />” szüneteltetve</translation> <translation id="6482749332252372425">A következő fájl letöltése tárhelyhiány miatt nem sikerült: <ph name="FILE_NAME" />.</translation> +<translation id="6541922744811587456">Chrome-könyvjelzők</translation> <translation id="654446541061731451">Válassza ki a sugározni kívánt lapot</translation> <translation id="6550675742724504774">Beállítások</translation> <translation id="656628257199996201">Mindig fordítson <ph name="SOURCE_LANGUAGE" /> nyelvről</translation> @@ -428,6 +437,7 @@ <translation id="6656545060687952787">A Chrome-nak hozzá kell férnie a tartózkodási helyhez, hogy eszközöket kereshessen. <ph name="BEGIN_LINK" />Frissítse az engedélyeket<ph name="END_LINK" /></translation> <translation id="666268767214822976">„Várható kifejezések” szolgáltatás használata a kapcsolódó lekérdezések és népszerű webhelyek megjelenítéséhez a címsávba történő gépelés során.</translation> <translation id="666981079809192359">Chrome – Adatvédelmi közlemény</translation> +<translation id="6683720003467092441">Háttérben történő szinkronizálás engedélyezése a következő webhelyen.</translation> <translation id="6697251040310467641">Oldal elmentve offline</translation> <translation id="6698801883190606802">Szinkronizálás kezelése</translation> <translation id="6699351163704950317">Minden mentett oldal</translation> @@ -493,6 +503,9 @@ <translation id="7473891865547856676">Nem, köszönöm</translation> <translation id="7475192538862203634">Ha gyakran látja ezt, próbálja ki ezeket a <ph name="BEGIN_LINK" />javaslatokat<ph name="END_LINK" />.</translation> <translation id="748127970106343339">Eszközhitelesítési adatok törlésének megerősítése</translation> +<translation id="7487352416683556407">A kiválasztott adatokat eltávolítottuk a Chrome-ból és a szinkronizált eszközökről. + +Előfordulhat, hogy Google-fiókjában (a <ph name="BEGIN_LINK" />history.google.com<ph name="END_LINK" /> címen) még szerepelnek a böngészési előzmények egyéb formái, így például a keresések és egyéb tevékenységek más Google-szolgáltatásokból.</translation> <translation id="7493994139787901920"><ph name="VERSION" /> (Frissítve: <ph name="TIME_SINCE_UPDATE" />)</translation> <translation id="7498271377022651285">Kérjük, várjon…</translation> <translation id="7499262814309712782">Fiók szinkronizálása</translation> @@ -598,6 +611,7 @@ <translation id="8737542153238017984">A mentett oldal nem érhető el offline módban. A tárhely már majdnem megtelt.</translation> <translation id="8793430725658173476">URL másolása</translation> <translation id="8798099450830957504">Alapértelmezett</translation> +<translation id="8812942424849541387">A működési mód szabályozása a <ph name="BEGIN_LINK1" />Beállítások<ph name="END_LINK1" /> oldalon</translation> <translation id="8820817407110198400">Könyvjelzők</translation> <translation id="8829678271838353305"><ph name="ACCOUNT_EMAIL_LAST" /> volt bejelentkezve. <ph name="ACCOUNT_EMAIL_NEW" /> bejelentkezésével a szinkronizált adatok (pl. könyvjelzők) össze lesznek vonva a két fiókban. Az adatok külön megőrzéséhez törölje a böngészési adatokat a <ph name="BEGIN_LINK" />beállításokban<ph name="END_LINK" />.</translation> <translation id="8853345339104747198"><ph name="TAB_TITLE" /> lap</translation>
diff --git a/chrome/android/java/strings/translations/android_chrome_strings_iw.xtb b/chrome/android/java/strings/translations/android_chrome_strings_iw.xtb index 22d5165..1811c19 100644 --- a/chrome/android/java/strings/translations/android_chrome_strings_iw.xtb +++ b/chrome/android/java/strings/translations/android_chrome_strings_iw.xtb
@@ -18,6 +18,7 @@ <translation id="1240668123557180468">תוכל לגלות דפי אינטרנט שנשלחו על ידי אובייקטים בקרבת מקום. Chrome אוסף דפי אינטרנט המשויכים לאובייקטים בסביבה, ושולח אותם בצורה אנונימית לשירות של Google כדי למצוא את הדפים המועילים ביותר עבורך. לאחר מכן הוא מציג אותם. כדי להשתמש באינטרנט הווירטופיזי, עליך להפעיל את Bluetooth ואת שירותי המיקום.</translation> +<translation id="1250508505624960884">סימניות של Chrome בגירסת ביטא</translation> <translation id="1254090737195733114">האם לייבא נתונים?</translation> <translation id="1258753120186372309">דודל של Google: <ph name="DOODLE_DESCRIPTION" /></translation> <translation id="1272079795634619415">הפסק</translation> @@ -39,9 +40,11 @@ <translation id="1445680696957526815">הרכיבים של Chrome אינם תואמים זה לזה. ייתכן ש-Chrome מבצע שדרוג, נסה שוב בעוד כמה דקות. אם הבעיה נמשכת, נסה להסיר את Chrome ולהתקין אותו מחדש.</translation> <translation id="1446450296470737166">התר שליטה מלאה על מכשירי MIDI</translation> <translation id="145097072038377568">כבוי בהגדרות Android</translation> +<translation id="147006957810816598">לא תבוצע יציאה מחשבון Google שלך.</translation> <translation id="1477626028522505441">הורדת <ph name="FILE_NAME" /> נכשלה עקב בעיות בשרת.</translation> <translation id="1506061864768559482">מנוע חיפוש</translation> <translation id="1513352483775369820">סימניות והיסטוריית אתרים</translation> +<translation id="1549000191223877751">העבר לחלון האחר</translation> <translation id="1553358976309200471">עדכן את Chrome</translation> <translation id="1557201757634521564">זיהוי אוטומטי של קידוד</translation> <translation id="1592483623187843893">הסימניה נשמרה במצב לא מקוון</translation> @@ -69,8 +72,10 @@ <translation id="194341124344773587">הפעל הרשאה בשביל Chrome ב<ph name="BEGIN_LINK" />הגדרות Android<ph name="END_LINK" />.</translation> <translation id="1943432128510653496">שמור סיסמאות</translation> <translation id="1944384637046898011">הצפן הכל באמצעות סיסמת Google החל מ-<ph name="TIME" /></translation> +<translation id="1959930595721737608">התר JavaScript באתר הבא.</translation> <translation id="1966710179511230534">עדכן את פרטי הכניסה שלך.</translation> <translation id="1974060860693918893">מתקדם</translation> +<translation id="1984321224716884559">סימניות של Chrome בגירסת הפיתוח</translation> <translation id="1984937141057606926">מותר, מלבד צד שלישי</translation> <translation id="1994173015038366702">כתובת אתר</translation> <translation id="2001120796168634316">שמור דף מקושר למועד מאוחר יותר</translation> @@ -80,6 +85,7 @@ <translation id="2079545284768500474">בטל</translation> <translation id="2082238445998314030">תוצאה <ph name="RESULT_NUMBER" /> מתוך <ph name="TOTAL_RESULTS" /></translation> <translation id="2095887075102408547">כשהתכונה הזו פועלת, Chrome ישתמש בשרתי Google כדי לדחוס דפים שבהם אתה מבקר לפני הורדתם. Google לא תראה דפים שהגישה אליהם בוצעה בחיבור פרטי (HTTPS) או בכרטיסיות גלישה בסתר', וגם לא תבצע אופטימיזציה שלהם.</translation> +<translation id="2096396629993765042">לא תבוצע יציאה מחשבון Google שלך. ייתכן שתוכל לגשת לסוגים אחרים של היסטוריית גלישה בחשבון Google בכתובת <ph name="BEGIN_LINK" />history.google.com<ph name="END_LINK" />.</translation> <translation id="2100273922101894616">כניסה אוטומטית</translation> <translation id="2126426811489709554">מבוסס על Chrome</translation> <translation id="213279576345780926"><ph name="TAB_TITLE" /> נסגר</translation> @@ -188,6 +194,7 @@ <translation id="360480449234699036">קבל מידע על נושאים באתרים מבלי לצאת מהדף. התכונה 'גע כדי לחפש' שולחת מילה ואת ההקשר שלה אל חיפוש Google, המחזיר הגדרות, תמונות, תוצאות חיפוש ופרטים אחרים. כדי לשנות את מונח החיפוש, גע נגיעה ארוכה במונח כדי לבחור בו. כדי לצמצם את החיפוש, הסט את החלונית עד למעלה וגע בתיבת החיפוש.</translation> +<translation id="3623048332793834136">סימניות של Chrome בגירסה הניסיונית</translation> <translation id="363596933471559332">היכנס באופן אוטומטי לאתרים באמצעות פרטי כניסה מאוחסנים. כשתכונה זו כבויה, תתבקש לבצע אימות לפני כל כניסה לאתר.</translation> <translation id="3653742808139624888">כדי שהסימניות שלך יופיעו בכל המכשירים, היכנס ל-Chrome</translation> <translation id="3656115297268584622">הפעל מיקום ב<ph name="BEGIN_LINK" />הגדרות Android<ph name="END_LINK" />.</translation> @@ -255,6 +262,7 @@ <translation id="4645575059429386691">מנוהל על-ידי ההורה שלך</translation> <translation id="4663756553811254707"><ph name="NUMBER_OF_BOOKMARKS" /> סימניות נמחקו</translation> <translation id="4665282149850138822">האתר <ph name="NAME" /> נוסף למסך דף הבית שלך</translation> +<translation id="4668044310199835006">סימניות Chrome לעבודה</translation> <translation id="4684427112815847243">סנכרן הכל</translation> <translation id="4686372254213217147">גודל מקורי</translation> <translation id="4690286298542128877">כרטיסיות יועברו למחליף כרטיסיות בתוך Chrome.</translation> @@ -285,7 +293,7 @@ <translation id="5016205925109358554">Serif</translation> <translation id="5039804452771397117">אפשר</translation> <translation id="5040262127954254034">פרטיות</translation> -<translation id="5056549851600133418">מאמרים מומלצים עבורך</translation> +<translation id="5056549851600133418">מאמרים שעשויים לעניין אותך</translation> <translation id="5063480226653192405">שימוש</translation> <translation id="5100237604440890931">מכווץ - לחץ כדי להרחיב.</translation> <translation id="5107381076085091558">ההורדה הושהתה.</translation> @@ -415,6 +423,7 @@ <translation id="6464825623202322042">מכשיר זה</translation> <translation id="6476911854266661814">"<ph name="VIDEO_TITLE" />" מושהה</translation> <translation id="6482749332252372425">הורדת <ph name="FILE_NAME" /> נכשלה מאחר שחסר מקום אחסון.</translation> +<translation id="6541922744811587456">סימניות Chrome</translation> <translation id="654446541061731451">בחר כרטיסייה להעברת התוכן שלה</translation> <translation id="6550675742724504774">אפשרויות</translation> <translation id="656628257199996201">תרגם <ph name="SOURCE_LANGUAGE" /> תמיד</translation> @@ -428,6 +437,7 @@ <translation id="6656545060687952787">כדי לבצע סריקה לאיתור מכשירים ב-Chrome, יש צורך בגישה לנתוני מיקום. <ph name="BEGIN_LINK" />עדכן הרשאות<ph name="END_LINK" /></translation> <translation id="666268767214822976">השתמש בשירות חיזוי כדי להציג שאילתות קשורות ואתרים פופולריים תוך כדי ההקלדה בסרגל הכתובות</translation> <translation id="666981079809192359">הודעת הפרטיות של Chrome</translation> +<translation id="6683720003467092441">התר סינכרון ברקע באתר הבא.</translation> <translation id="6697251040310467641">הדף נשמר באופן לא מקוון</translation> <translation id="6698801883190606802">נהל נתונים מסונכרנים</translation> <translation id="6699351163704950317">כל הדפים שנשמרו</translation> @@ -493,6 +503,9 @@ <translation id="7473891865547856676">לא, תודה</translation> <translation id="7475192538862203634">אם אתה רואה זאת לעתים קרובות, נסה את <ph name="BEGIN_LINK" />ההצעות<ph name="END_LINK" /> האלה.</translation> <translation id="748127970106343339">אשר את מחיקת פרטי הכניסה של המכשיר</translation> +<translation id="7487352416683556407">הנתונים שבחרת הוסרו מ-Chrome ומהמכשירים המסונכרנים. + +ייתכן שתוכל לגשת לסוגים אחרים של היסטוריית גלישה בחשבון Google בכתובת <ph name="BEGIN_LINK" />history.google.com<ph name="END_LINK" />, כמו חיפושים ופעילות משירותי Google אחרים.</translation> <translation id="7493994139787901920"><ph name="VERSION" /> (עודכן <ph name="TIME_SINCE_UPDATE" />)</translation> <translation id="7498271377022651285">המתן…</translation> <translation id="7499262814309712782">חשבון לסינכרון</translation> @@ -543,7 +556,7 @@ <translation id="8069239273282989646">לאחר דחיסה</translation> <translation id="8073388330009372546">פתח את התמונה בכרטיסייה חדשה</translation> <translation id="8076014560081431679">הגדרות אתרים שנשמרו לא יימחקו ועשויות לשקף את הרגלי הגלישה שלך. <ph name="BEGIN_LINK" />למידע נוסף<ph name="END_LINK" /></translation> -<translation id="8087000398470557479">התוכן הזה הוא מ-<ph name="DOMAIN_NAME" />, ומסופק על-ידי Google.</translation> +<translation id="8087000398470557479">התוכן הזה הוא מ-<ph name="DOMAIN_NAME" />, ומוגש על-ידי Google.</translation> <translation id="8098570222830891427">בסביבה הקרובה יש מכשירים שמשדרים דפי אינטרנט בתקשורת Bluetooth. Chrome יאתר את הדפים האלו בסריקה ויציג אותם כשתוציא את המכשיר ממצב שינה. הדפים יעברו דרך שירות של Google כדי לשפר את איכות התוצאות. ניתן לשלוט על האינטרנט הווירטופיזי בהגדרות של Chrome.</translation> @@ -596,6 +609,7 @@ <translation id="8737542153238017984">הדף שנשמר אינו זמין במצב לא מקוון. מיצית כמעט את כל נפח האחסון.</translation> <translation id="8793430725658173476">העתק כתובת אתר</translation> <translation id="8798099450830957504">ברירת מחדל</translation> +<translation id="8812942424849541387">קבע ב<ph name="BEGIN_LINK1" />הגדרות<ph name="END_LINK1" /> כיצד זה פועל</translation> <translation id="8820817407110198400">סימניות</translation> <translation id="8829678271838353305">בוצעה כניסה לחשבון עם <ph name="ACCOUNT_EMAIL_LAST" />. כניסה עם <ph name="ACCOUNT_EMAIL_NEW" /> תמזג נתונים מסונכרנים בין החשבונות, כמו סימניות. כדי לשמור על הפרדת המידע, נקה את נתוני הגלישה ב<ph name="BEGIN_LINK" />הגדרות<ph name="END_LINK" />.</translation> <translation id="8853345339104747198"><ph name="TAB_TITLE" />, כרטיסייה</translation>
diff --git a/chrome/android/java/strings/translations/android_chrome_strings_nl.xtb b/chrome/android/java/strings/translations/android_chrome_strings_nl.xtb index ddcf41b6..86003f6 100644 --- a/chrome/android/java/strings/translations/android_chrome_strings_nl.xtb +++ b/chrome/android/java/strings/translations/android_chrome_strings_nl.xtb
@@ -425,7 +425,7 @@ <translation id="6612856669344839356">Bladwijzer opslaan</translation> <translation id="6627583120233659107">Map bewerken</translation> <translation id="6647073004883890710">Wil je dat <ph name="PASSWORD_MANAGER_BRAND" /> het wachtwoord voor <ph name="USERNAME" /> updatet voor deze site?</translation> -<translation id="6656545060687952787">Chrome heeft locatietoegang nodig om naar apparaten te scannen. <ph name="BEGIN_LINK" />Rechten updaten<ph name="END_LINK" /></translation> +<translation id="6656545060687952787">Chrome heeft locatietoegang nodig om naar apparaten te zoeken. <ph name="BEGIN_LINK" />Rechten updaten<ph name="END_LINK" /></translation> <translation id="666268767214822976">Een voorspellingsservice gebruiken om gerelateerde zoekopdrachten en populaire websites te tonen terwijl je in de adresbalk typt</translation> <translation id="666981079809192359">Privacybeleid van Chrome</translation> <translation id="6697251040310467641">Pagina offline opgeslagen</translation> @@ -544,7 +544,7 @@ <translation id="8073388330009372546">Openen op nieuw tabblad</translation> <translation id="8076014560081431679">Opgeslagen site-instellingen worden niet verwijderd en kunnen je browsegedrag weerspiegelen. <ph name="BEGIN_LINK" />Meer informatie<ph name="END_LINK" /></translation> <translation id="8087000398470557479">Deze content is afkomstig van <ph name="DOMAIN_NAME" />, geleverd door Google.</translation> -<translation id="8098570222830891427">Apparaten bij je in de buurt verzenden webpagina's via Bluetooth. Chrome scant op pagina's en geeft ze weer wanneer je je apparaat activeert uit de slaapstand. Deze pagina's worden verwerkt door een Google-servcice om de kwaliteit van paginaresultaten te verbeteren. +<translation id="8098570222830891427">Apparaten bij je in de buurt verzenden webpagina's via Bluetooth. Chrome zoekt naar pagina's en geeft ze weer wanneer je je apparaat activeert uit de slaapstand. Deze pagina's worden verwerkt door een Google-servcice om de kwaliteit van paginaresultaten te verbeteren. Je kunt het Fysieke web beheren via de instellingen van Chrome.</translation> <translation id="8106211421800660735">Creditcardnummer</translation>
diff --git a/chrome/android/java/strings/translations/android_chrome_strings_pt-BR.xtb b/chrome/android/java/strings/translations/android_chrome_strings_pt-BR.xtb index 11ab76a6..6070297 100644 --- a/chrome/android/java/strings/translations/android_chrome_strings_pt-BR.xtb +++ b/chrome/android/java/strings/translations/android_chrome_strings_pt-BR.xtb
@@ -18,6 +18,7 @@ <translation id="1240668123557180468">Descubra páginas da Web enviadas por objetos nas proximidades. O Chrome reúne páginas da Web associadas a objetos ao seu redor, envia-as anonimamente para um serviço do Google para encontrar as mais úteis para você e as exibe. É necessário que o Bluetooth e o Local estejam ativados para usar a Web física.</translation> +<translation id="1250508505624960884">Favoritos do Chrome Beta</translation> <translation id="1254090737195733114">Importar dados?</translation> <translation id="1258753120186372309">Doodle do Google: <ph name="DOODLE_DESCRIPTION" /></translation> <translation id="1272079795634619415">Parar</translation> @@ -39,9 +40,11 @@ <translation id="1445680696957526815">Os componentes do Chrome são incompatíveis entre si. O Chrome pode estar fazendo um upgrade. Tente novamente em alguns minutos. Se o problema persistir, tente desinstalar e reinstalar o Chrome.</translation> <translation id="1446450296470737166">Permitir controle total de dispositivos MIDI</translation> <translation id="145097072038377568">Desativada nas configurações do Android</translation> +<translation id="147006957810816598">Você não será desconectado da sua Conta do Google.</translation> <translation id="1477626028522505441">Falha no download do arquivo <ph name="FILE_NAME" /> devido a problemas de servidor.</translation> <translation id="1506061864768559482">Mecanismo de pesquisa</translation> <translation id="1513352483775369820">Favoritos e histórico da Web</translation> +<translation id="1549000191223877751">Mover para outra janela</translation> <translation id="1553358976309200471">Atualizar o Google Chrome</translation> <translation id="1557201757634521564">Detectar codificação automaticamente</translation> <translation id="1592483623187843893">Favorito salvo off-line</translation> @@ -69,8 +72,10 @@ <translation id="194341124344773587">Ative a permissão para o Chrome nas <ph name="BEGIN_LINK" />configurações do Android<ph name="END_LINK" />.</translation> <translation id="1943432128510653496">Salvar senhas</translation> <translation id="1944384637046898011">Criptografar tudo com senha do Google a partir de <ph name="TIME" /></translation> +<translation id="1959930595721737608">Permitir o JavaScript no site a seguir.</translation> <translation id="1966710179511230534">Atualize seus detalhes de login.</translation> <translation id="1974060860693918893">Avançado</translation> +<translation id="1984321224716884559">Favoritos do Chrome Dev</translation> <translation id="1984937141057606926">Permitidos, exceto de terceiros</translation> <translation id="1994173015038366702">URL do site</translation> <translation id="2001120796168634316">Salvar página vinculada para mais tarde</translation> @@ -80,6 +85,7 @@ <translation id="2079545284768500474">Desfazer</translation> <translation id="2082238445998314030">Resultado <ph name="RESULT_NUMBER" /> de <ph name="TOTAL_RESULTS" /></translation> <translation id="2095887075102408547">Quando este recurso está ativado, o Chrome usa os servidores do Google para compactar as páginas que você visita antes de fazer o download delas. Páginas acessadas usando conexões privadas (HTTPS) ou guias anônimas não são otimizadas ou vistas pelo Google.</translation> +<translation id="2096396629993765042">Você não será desconectado da sua Conta do Google. É possível que sua Conta do Google tenha outras formas de histórico de navegação em <ph name="BEGIN_LINK" />history.google.com<ph name="END_LINK" />.</translation> <translation id="2100273922101894616">Login automático</translation> <translation id="2126426811489709554">Em execução no Chrome</translation> <translation id="213279576345780926"><ph name="TAB_TITLE" /> fechada</translation> @@ -188,6 +194,7 @@ <translation id="360480449234699036">Saiba mais sobre tópicos em websites sem sair da página. A opção "Tocar para pesquisar" envia uma palavra e seu respectivo contexto para a Pesquisa Google, que retorna definições, imagens, resultados de pesquisa e outros detalhes. Para ajustar seu termo de pesquisa, mantenha-o pressionado para selecionar. Para refinar sua pesquisa, deslize o painel totalmente para cima e toque na caixa de pesquisa.</translation> +<translation id="3623048332793834136">Favoritos do Chrome Canary</translation> <translation id="363596933471559332">Faça login automaticamente nos websites usando as credenciais armazenadas. Se o recurso estiver desativado, será preciso fazer a verificação sempre antes de fazer login em um website.</translation> <translation id="3653742808139624888">Para ter seus favoritos em todos os seus dispositivos, faça login no Chrome</translation> <translation id="3656115297268584622">Ative o local nas <ph name="BEGIN_LINK" />Configurações do Android<ph name="END_LINK" />.</translation> @@ -255,6 +262,7 @@ <translation id="4645575059429386691">Gerenciado pelos seus pais</translation> <translation id="4663756553811254707"><ph name="NUMBER_OF_BOOKMARKS" /> favoritos excluídos</translation> <translation id="4665282149850138822"><ph name="NAME" /> foi adicionado à sua tela inicial</translation> +<translation id="4668044310199835006">Favoritos do Work Chrome</translation> <translation id="4684427112815847243">Sincronizar tudo</translation> <translation id="4686372254213217147">Tamanho original</translation> <translation id="4690286298542128877">As guias serão movidas para um alternador de guias dentro do Google Chrome.</translation> @@ -414,6 +422,7 @@ <translation id="6464825623202322042">Este dispositivo</translation> <translation id="6476911854266661814">“<ph name="VIDEO_TITLE" />” pausado</translation> <translation id="6482749332252372425">Falha no download do arquivo <ph name="FILE_NAME" /> devido à falta de espaço de armazenamento.</translation> +<translation id="6541922744811587456">Favoritos do Chrome</translation> <translation id="654446541061731451">Selecione uma guia para transferir</translation> <translation id="6550675742724504774">Opções</translation> <translation id="656628257199996201">Sempre traduzir <ph name="SOURCE_LANGUAGE" /></translation> @@ -427,6 +436,7 @@ <translation id="6656545060687952787">O Chrome precisa de acesso ao local para procurar por dispositivos. <ph name="BEGIN_LINK" />Atualizar permissões<ph name="END_LINK" /></translation> <translation id="666268767214822976">Usar um serviço de previsão para mostrar consultas relacionadas e sites populares quando você digitar na barra de endereços</translation> <translation id="666981079809192359">Aviso de Privacidade do Chrome</translation> +<translation id="6683720003467092441">Permitir a sincronização em segundo plano no site a seguir.</translation> <translation id="6697251040310467641">Página salva off-line</translation> <translation id="6698801883190606802">Gerenciar dados sincronizados</translation> <translation id="6699351163704950317">Todas as páginas salvas</translation> @@ -492,6 +502,9 @@ <translation id="7473891865547856676">Não, obrigado</translation> <translation id="7475192538862203634">Se estiver vendo isso com frequência, tente estas <ph name="BEGIN_LINK" />sugestões<ph name="END_LINK" />.</translation> <translation id="748127970106343339">Confirmar exclusão da credencial do dispositivo</translation> +<translation id="7487352416683556407">Os dados selecionados foram removidos do Chrome e dos seus dispositivos sincronizados. + +É possível que sua Conta do Google tenha outras formas de histórico de navegação, como pesquisas e atividades de outros serviços do Google em <ph name="BEGIN_LINK" />history.google.com<ph name="END_LINK" />.</translation> <translation id="7493994139787901920"><ph name="VERSION" /> (atualizada <ph name="TIME_SINCE_UPDATE" />)</translation> <translation id="7498271377022651285">Aguarde...</translation> <translation id="7499262814309712782">Conta de sincronização</translation> @@ -596,6 +609,7 @@ <translation id="8737542153238017984">Página salva não disponível off-line. Armazenamento quase cheio.</translation> <translation id="8793430725658173476">Copiar URL</translation> <translation id="8798099450830957504">Padrão</translation> +<translation id="8812942424849541387">Controlar como esse recurso funciona nas <ph name="BEGIN_LINK1" />Configurações<ph name="END_LINK1" /></translation> <translation id="8820817407110198400">Favoritos</translation> <translation id="8829678271838353305"><ph name="ACCOUNT_EMAIL_LAST" /> fez o login. Fazer o login com <ph name="ACCOUNT_EMAIL_NEW" /> mescla dados sincronizados, por exemplo, os favoritos, entre as contas. Para manter as informações separadas, limpe os dados de navegação em "<ph name="BEGIN_LINK" />Configurações<ph name="END_LINK" />".</translation> <translation id="8853345339104747198"><ph name="TAB_TITLE" />, guia</translation>
diff --git a/chrome/android/java/strings/translations/android_chrome_strings_pt-PT.xtb b/chrome/android/java/strings/translations/android_chrome_strings_pt-PT.xtb index 9a80a4a..e33bc25 100644 --- a/chrome/android/java/strings/translations/android_chrome_strings_pt-PT.xtb +++ b/chrome/android/java/strings/translations/android_chrome_strings_pt-PT.xtb
@@ -18,6 +18,7 @@ <translation id="1240668123557180468">Descubra páginas Web enviadas por objetos próximos. O Chrome reúne páginas Web associadas a objetos à sua volta, envia-as anonimamente para um serviço Google para procurar as que lhe são mais úteis e, em seguida, apresenta-as. Tem de ter a Localização e o Bluetooth ativados para poder utilizar a Web física.</translation> +<translation id="1250508505624960884">Marcadores do Chrome Beta</translation> <translation id="1254090737195733114">Pretende importar dados?</translation> <translation id="1258753120186372309">Doodle da Google: <ph name="DOODLE_DESCRIPTION" /></translation> <translation id="1272079795634619415">Parar</translation> @@ -39,9 +40,11 @@ <translation id="1445680696957526815">Os componentes do Chrome são incompatíveis entre si. O Chrome pode estar a ser atualizado, tente novamente dentro de alguns minutos. Se o problema continuar, experimente desinstalar e reinstalar o Chrome.</translation> <translation id="1446450296470737166">Perm. controlo total dispo. MIDI</translation> <translation id="145097072038377568">Desativada nas Definições do Android</translation> +<translation id="147006957810816598">A sessão na sua Conta Google não é terminada.</translation> <translation id="1477626028522505441">A transferência de <ph name="FILE_NAME" /> falhou devido a problemas do servidor.</translation> <translation id="1506061864768559482">Motor de pesquisa</translation> <translation id="1513352483775369820">Marcadores e histórico da Web</translation> +<translation id="1549000191223877751">Mover para outra janela</translation> <translation id="1553358976309200471">Atualizar o Chrome</translation> <translation id="1557201757634521564">Deteção automática de codificação</translation> <translation id="1592483623187843893">Marcador guardado offline</translation> @@ -69,8 +72,10 @@ <translation id="194341124344773587">Ative a autorização para o Chrome nas <ph name="BEGIN_LINK" />Definições do Android<ph name="END_LINK" />.</translation> <translation id="1943432128510653496">Guardar palavras-passe</translation> <translation id="1944384637046898011">Encriptar tudo com uma palavra-passe do Google a partir de <ph name="TIME" /></translation> +<translation id="1959930595721737608">Permitir JavaScript no seguinte site.</translation> <translation id="1966710179511230534">Atualize os detalhes de início de sessão.</translation> <translation id="1974060860693918893">Avançadas</translation> +<translation id="1984321224716884559">Marcadores do Chrome Dev</translation> <translation id="1984937141057606926">Permitidos, exceto de terceiros</translation> <translation id="1994173015038366702">URL do site</translation> <translation id="2001120796168634316">Guardar pág. ligação p/ depois</translation> @@ -80,6 +85,7 @@ <translation id="2079545284768500474">Anular</translation> <translation id="2082238445998314030">Resultado <ph name="RESULT_NUMBER" /> de <ph name="TOTAL_RESULTS" /></translation> <translation id="2095887075102408547">Quando esta funcionalidade está ativada, o Chrome utiliza os servidores da Google para comprimir as páginas visitadas antes de as transferir. As páginas acedidas através de ligações privadas (HTTPS) ou em separadores de navegação anónima não são otimizadas ou vistas pela Google.</translation> +<translation id="2096396629993765042">A sessão na sua Conta Google não é terminada. A sua Conta Google pode ter outras formas do histórico de navegação em <ph name="BEGIN_LINK" />history.google.com<ph name="END_LINK" />.</translation> <translation id="2100273922101894616">Início de sessão automático</translation> <translation id="2126426811489709554">Com tecnologia do Chrome</translation> <translation id="213279576345780926"><ph name="TAB_TITLE" /> fechado</translation> @@ -188,6 +194,7 @@ <translation id="360480449234699036">Saiba mais acerca dos tópicos nos Websites sem sair da página. A funcionalidade Tocar para pesquisar envia uma palavra e o respetivo contexto circundante para a Pesquisa Google, que devolve definições, imagens, resultados da pesquisa e outros detalhes. Para ajustar o termo de pesquisa, prima continuamente para selecionar. Para refinar a sua pesquisa, deslize lentamente o painel totalmente para cima e toque na caixa de pesquisa.</translation> +<translation id="3623048332793834136">Marcadores do Chrome Canary</translation> <translation id="363596933471559332">Inicie automaticamente sessão em Websites com as credenciais armazenadas. Quando a funcionalidade está desativada, é-lhe sempre pedida validação antes de iniciar sessão num Website.</translation> <translation id="3653742808139624888">Para obter os seus marcadores em todos os dispositivos, inicie sessão no Chrome</translation> <translation id="3656115297268584622">Ative a localização nas <ph name="BEGIN_LINK" />Definições do Android<ph name="END_LINK" />.</translation> @@ -255,6 +262,7 @@ <translation id="4645575059429386691">Gerido pelos teus pais</translation> <translation id="4663756553811254707"><ph name="NUMBER_OF_BOOKMARKS" /> marcadores eliminados</translation> <translation id="4665282149850138822"><ph name="NAME" /> foi adicionado ao seu Ecrã principal</translation> +<translation id="4668044310199835006">Marcadores do Work Chrome</translation> <translation id="4684427112815847243">Sincronizar tudo</translation> <translation id="4686372254213217147">Tamanho original</translation> <translation id="4690286298542128877">Os separadores são movidos para um comutador de separadores no Chrome.</translation> @@ -415,6 +423,7 @@ <translation id="6464825623202322042">Este dispositivo</translation> <translation id="6476911854266661814">"<ph name="VIDEO_TITLE" />" em pausa</translation> <translation id="6482749332252372425">A transferência de <ph name="FILE_NAME" /> falhou devido à falta de espaço de armazenamento.</translation> +<translation id="6541922744811587456">Marcadores do Chrome</translation> <translation id="654446541061731451">Selecione um separador a transmitir</translation> <translation id="6550675742724504774">Opções</translation> <translation id="656628257199996201">Traduzir sempre <ph name="SOURCE_LANGUAGE" /></translation> @@ -428,6 +437,7 @@ <translation id="6656545060687952787">O Chrome necessita de acesso à localização para procurar dispositivos. <ph name="BEGIN_LINK" />Atualizar autorizações<ph name="END_LINK" /></translation> <translation id="666268767214822976">Utilizar um serviço de previsão para mostrar consultas relacionadas e Websites populares à medida que escreve na barra de endereço</translation> <translation id="666981079809192359">Aviso de privacidade do Chrome</translation> +<translation id="6683720003467092441">Permitir Sincronização em segundo plano no seguinte site.</translation> <translation id="6697251040310467641">Página guardada offline</translation> <translation id="6698801883190606802">Gerir dados sincronizados</translation> <translation id="6699351163704950317">Todas as páginas guardadas</translation> @@ -493,6 +503,9 @@ <translation id="7473891865547856676">Não, obrigado</translation> <translation id="7475192538862203634">Se vê isto com frequência, experimente estas <ph name="BEGIN_LINK" />sugestões<ph name="END_LINK" />.</translation> <translation id="748127970106343339">Confirmar a eliminação das credenciais do dispositivo</translation> +<translation id="7487352416683556407">Os dados selecionados foram removidos do Chrome e dos dispositivos sincronizados. + +A sua Conta Google pode ter outras formas do histórico de navegação, como pesquisas e atividade de outros serviços Google, em <ph name="BEGIN_LINK" />history.google.com<ph name="END_LINK" />.</translation> <translation id="7493994139787901920"><ph name="VERSION" /> (atualizado há <ph name="TIME_SINCE_UPDATE" />)</translation> <translation id="7498271377022651285">Aguarde…</translation> <translation id="7499262814309712782">Conta de sincronização</translation> @@ -598,6 +611,7 @@ <translation id="8737542153238017984">Página guardada não disponível offline. O armazenamento está quase cheio.</translation> <translation id="8793430725658173476">Copiar URL</translation> <translation id="8798099450830957504">Predefinição</translation> +<translation id="8812942424849541387">Controle esta funcionalidade nas <ph name="BEGIN_LINK1" />Definições<ph name="END_LINK1" /></translation> <translation id="8820817407110198400">Marcadores</translation> <translation id="8829678271838353305"><ph name="ACCOUNT_EMAIL_LAST" /> iniciou sessão. Ao iniciar sessão com <ph name="ACCOUNT_EMAIL_NEW" />, irá unir os dados sincronizados, tais como marcadores, entre contas. Para manter as informações separadas, limpe os dados de navegação nas <ph name="BEGIN_LINK" />definições<ph name="END_LINK" />.</translation> <translation id="8853345339104747198">Separador <ph name="TAB_TITLE" /></translation>
diff --git a/chrome/android/java/strings/translations/android_chrome_strings_ru.xtb b/chrome/android/java/strings/translations/android_chrome_strings_ru.xtb index 52e0e49..06108420 100644 --- a/chrome/android/java/strings/translations/android_chrome_strings_ru.xtb +++ b/chrome/android/java/strings/translations/android_chrome_strings_ru.xtb
@@ -18,6 +18,7 @@ <translation id="1240668123557180468">"Интернет вокруг нас" – это новый способ познавать мир. Chrome находит и анонимно отправляет в сервис Google веб-страницы, связанные с находящимися рядом объектами, а затем предлагает вам самые интересные и полезные ресурсы. Чтобы использовать эту функцию, необходимо включить Bluetooth и доступ к геоданным.</translation> +<translation id="1250508505624960884">Закладки Chrome (бета)</translation> <translation id="1254090737195733114">Импорт данных</translation> <translation id="1258753120186372309">Дудл Google: <ph name="DOODLE_DESCRIPTION" /></translation> <translation id="1272079795634619415">Остановить</translation> @@ -39,9 +40,11 @@ <translation id="1445680696957526815">Компоненты Chrome несовместимы друг с другом. Возможно, выполняется обновление. Повторите попытку через несколько минут. Если проблема не исчезнет, переустановите браузер.</translation> <translation id="1446450296470737166">Полный доступ к управлению MIDI-устройствами</translation> <translation id="145097072038377568">Отключено в настройках Android</translation> +<translation id="147006957810816598">Вы останетесь в аккаунте Google.</translation> <translation id="1477626028522505441">Не удалось скачать файл <ph name="FILE_NAME" /> из-за неполадок на сервере.</translation> <translation id="1506061864768559482">Поисковая система</translation> <translation id="1513352483775369820">Закладки и история поиска</translation> +<translation id="1549000191223877751">Перейти к другому окну</translation> <translation id="1553358976309200471">Обновить Chrome</translation> <translation id="1557201757634521564">Определять кодировку</translation> <translation id="1592483623187843893">Закладка доступна в офлайн-режиме</translation> @@ -69,8 +72,10 @@ <translation id="194341124344773587">Разрешение для Chrome можно предоставить в <ph name="BEGIN_LINK" />настройках Android<ph name="END_LINK" />.</translation> <translation id="1943432128510653496">Сохранение паролей</translation> <translation id="1944384637046898011">Зашифровать все с помощью пароля аккаунта Google с <ph name="TIME" /></translation> +<translation id="1959930595721737608">Разрешить JavaScript на следующих сайтах.</translation> <translation id="1966710179511230534">Обновите учетные данные</translation> <translation id="1974060860693918893">Дополнительные</translation> +<translation id="1984321224716884559">Закладки Chrome для разработчиков</translation> <translation id="1984937141057606926">Разрешено, кроме сторонних сайтов</translation> <translation id="1994173015038366702">Адрес сайта</translation> <translation id="2001120796168634316">Сохранить страницу офлайн</translation> @@ -80,6 +85,7 @@ <translation id="2079545284768500474">Отмена</translation> <translation id="2082238445998314030">Результат <ph name="RESULT_NUMBER" />, всего <ph name="TOTAL_RESULTS" /></translation> <translation id="2095887075102408547">Если вы включите эту функцию, серверы Google начнут сжимать данные перед показом веб-страниц в Chrome. Это не касается данных, полученных по протоколу HTTPS и в режиме инкогнито.</translation> +<translation id="2096396629993765042">Вы не выйдете из аккаунта Google. Остальная история ваших действий в Интернете доступна на странице <ph name="BEGIN_LINK" />history.google.com<ph name="END_LINK" />.</translation> <translation id="2100273922101894616">Автоматический вход</translation> <translation id="2126426811489709554">Технологии Chrome</translation> <translation id="213279576345780926">Вкладка "<ph name="TAB_TITLE" />" закрыта</translation> @@ -188,6 +194,7 @@ <translation id="360480449234699036">Ищите картинки, определения и другую информацию, не покидая выбранную страницу. Просто выберите слово, и оно будет отправлено в Google Поиск вместе с контекстом. Чтобы задать новый поисковый запрос, нажмите на нужное слово и не отпускайте палец. Чтобы уточнить запрос, прокрутите панель вверх и коснитесь поисковой строки.</translation> +<translation id="3623048332793834136">Закладки Chrome Canary</translation> <translation id="363596933471559332">Входить на веб-сайты с помощью сохраненного имени пользователя и пароля. Когда функция отключена, эти данные нужно указывать при каждом входе.</translation> <translation id="3653742808139624888">Чтобы получить доступ к закладкам на всех ваших устройствах, войдите в Chrome.</translation> <translation id="3656115297268584622">Включите определение местоположения в <ph name="BEGIN_LINK" />настройках Android<ph name="END_LINK" />.</translation> @@ -255,6 +262,7 @@ <translation id="4645575059429386691">Управляется вашими родителями</translation> <translation id="4663756553811254707">Удалено закладок: <ph name="NUMBER_OF_BOOKMARKS" /></translation> <translation id="4665282149850138822">Сайт <ph name="NAME" /> добавлен на главный экран</translation> +<translation id="4668044310199835006">Закладки Work Chrome</translation> <translation id="4684427112815847243">Синхронизировать все</translation> <translation id="4686372254213217147">Исходный размер</translation> <translation id="4690286298542128877">Каждая вкладка будет отображаться внутри Chrome, а не в виде отдельных окон в списке приложений.</translation> @@ -415,6 +423,7 @@ <translation id="6464825623202322042">На этом устройстве</translation> <translation id="6476911854266661814">Воспроизведение видео "<ph name="VIDEO_TITLE" />" приостановлено</translation> <translation id="6482749332252372425">Не удалось скачать файл <ph name="FILE_NAME" />, так как места для хранения данных недостаточно.</translation> +<translation id="6541922744811587456">Закладки Chrome</translation> <translation id="654446541061731451">Выберите вкладку для передачи</translation> <translation id="6550675742724504774">Параметры</translation> <translation id="656628257199996201">Всегда переводить <ph name="SOURCE_LANGUAGE" /></translation> @@ -428,6 +437,7 @@ <translation id="6656545060687952787">Чтобы выполнить поиск устройств, браузеру Chrome нужен доступ к геоданным. <ph name="BEGIN_LINK" />Обновить разрешения<ph name="END_LINK" /></translation> <translation id="666268767214822976">Показывать подсказки с похожими запросами и часто посещаемыми сайтами по мере ввода в адресную строку</translation> <translation id="666981079809192359">Примечание о конфиденциальности Chrome</translation> +<translation id="6683720003467092441">Разрешить фоновую синхронизацию на следующих сайтах:</translation> <translation id="6697251040310467641">Сохранено в офлайн-доступе</translation> <translation id="6698801883190606802">Управление синхронизированными данными</translation> <translation id="6699351163704950317">Все сохраненные страницы</translation> @@ -493,6 +503,9 @@ <translation id="7473891865547856676">Пропустить</translation> <translation id="7475192538862203634">Если эта проблема возникает часто, узнайте, <ph name="BEGIN_LINK" />как ее решить<ph name="END_LINK" />.</translation> <translation id="748127970106343339">Подтвердите удаление учетных данных устройства</translation> +<translation id="7487352416683556407">Выбранные данные удалены из Chrome и с синхронизированных устройств. + +Остальная история ваших действий в Интернете может храниться в аккаунте Google, например в виде поисковых запросов и сведений из наших сервисов. Она доступна на странице <ph name="BEGIN_LINK" />history.google.com<ph name="END_LINK" />.</translation> <translation id="7493994139787901920"><ph name="VERSION" /> (последнее обновление: <ph name="TIME_SINCE_UPDATE" />)</translation> <translation id="7498271377022651285">Подождите…</translation> <translation id="7499262814309712782">Аккаунт для синхронизации</translation> @@ -598,6 +611,7 @@ <translation id="8737542153238017984">Страница недоступна в офлайн-режиме: свободное пространство заканчивается.</translation> <translation id="8793430725658173476">Копировать URL</translation> <translation id="8798099450830957504">По умолчанию</translation> +<translation id="8812942424849541387">Изменить эти параметры можно в <ph name="BEGIN_LINK1" />настройках<ph name="END_LINK1" /></translation> <translation id="8820817407110198400">Закладки</translation> <translation id="8829678271838353305">Был выполнен вход в аккаунт <ph name="ACCOUNT_EMAIL_LAST" />. Если вы войдете в аккаунт <ph name="ACCOUNT_EMAIL_NEW" />, синхронизируемые данные (например, закладки) будут объединены. Чтобы этого не произошло, <ph name="BEGIN_LINK" />удалите данные о работе в браузере<ph name="END_LINK" />.</translation> <translation id="8853345339104747198">Вкладка "<ph name="TAB_TITLE" />"</translation>
diff --git a/chrome/android/java/strings/translations/android_chrome_strings_sk.xtb b/chrome/android/java/strings/translations/android_chrome_strings_sk.xtb index 4480dee4..9aa92539 100644 --- a/chrome/android/java/strings/translations/android_chrome_strings_sk.xtb +++ b/chrome/android/java/strings/translations/android_chrome_strings_sk.xtb
@@ -18,6 +18,7 @@ <translation id="1240668123557180468">Objavte webové stránky odosielané objektmi v okolí. Chrome zhromažďuje webové stránky týkajúce sa objektov okolo vás, odosiela ich anonymne do služby Google, aby tak našiel tie, ktoré sú pre vás najužitočnejšie. Následne ich zobrazí. Ak chcete používať Fyzický web, musíte mať zapnuté rozhranie Bluetooth a sledovanie polohy.</translation> +<translation id="1250508505624960884">Záložky Chrome Beta</translation> <translation id="1254090737195733114">Importovať údaje?</translation> <translation id="1258753120186372309">Sviatočné logo Google: <ph name="DOODLE_DESCRIPTION" /></translation> <translation id="1272079795634619415">Zastaviť</translation> @@ -39,9 +40,11 @@ <translation id="1445680696957526815">Komponenty prehliadača Chrome sú vzájomne nekompatibilné. Chrome možno inštaluje inováciu. Skúste to znova o niekoľko minút. Ak problém pretrváva, skúste prehliadač Chrome odinštalovať a znovu nainštalovať.</translation> <translation id="1446450296470737166">Povoliť úplné ovlád. zar. MIDI</translation> <translation id="145097072038377568">Vypnuté v nastaveniach Androidu</translation> +<translation id="147006957810816598">Neodhlásime vás z účtu Google.</translation> <translation id="1477626028522505441">Súbor <ph name="FILE_NAME" /> sa nepodarilo stiahnuť z dôvodu problémov so serverom.</translation> <translation id="1506061864768559482">Vyhľadávač</translation> <translation id="1513352483775369820">Záložky a webová história</translation> +<translation id="1549000191223877751">Prejsť do druhého okna</translation> <translation id="1553358976309200471">Aktualizovať Chrome</translation> <translation id="1557201757634521564">Automaticky rozpoznávať kódovanie</translation> <translation id="1592483623187843893">Záložka bola uložená offline</translation> @@ -69,8 +72,10 @@ <translation id="194341124344773587">Zapnite povolenie pre Chrome v <ph name="BEGIN_LINK" />nastaveniach Androidu<ph name="END_LINK" />.</translation> <translation id="1943432128510653496">Ukladanie hesiel</translation> <translation id="1944384637046898011">Šifrovať všetko pomocou hesla Google od <ph name="TIME" /></translation> +<translation id="1959930595721737608">Povolenie JavaScriptu na nasledujúcom webe.</translation> <translation id="1966710179511230534">Aktualizujte svoje prihlasovacie údaje.</translation> <translation id="1974060860693918893">Rozšírené</translation> +<translation id="1984321224716884559">Záložky Chrome Dev</translation> <translation id="1984937141057606926">Povolené (okrem tretích strán)</translation> <translation id="1994173015038366702">Webová adresa stránok</translation> <translation id="2001120796168634316">Uložiť prepojenú stránku na neskôr</translation> @@ -80,6 +85,7 @@ <translation id="2079545284768500474">Späť</translation> <translation id="2082238445998314030">Výsledok <ph name="RESULT_NUMBER" /> z <ph name="TOTAL_RESULTS" /></translation> <translation id="2095887075102408547">Keď je táto funkcia zapnutá, Chrome navštívené stránky pred stiahnutím komprimuje pomocou serverov Google. Stránky navštívené pomocou súkromných pripojení (HTTPS) alebo v rámci kariet inkognito nebudú optimalizované ani viditeľné pre Google.</translation> +<translation id="2096396629993765042">Neodhlásime vás z účtu Google. Váš účet Google môže mať ďalšie formy histórie prehliadania na adrese <ph name="BEGIN_LINK" />history.google.com<ph name="END_LINK" />.</translation> <translation id="2100273922101894616">Automaticky prihlásiť</translation> <translation id="2126426811489709554">Používa technológiu prehliadača Chrome</translation> <translation id="213279576345780926">Karta <ph name="TAB_TITLE" /> je zavretá</translation> @@ -188,6 +194,7 @@ <translation id="360480449234699036">Získajte informácie o témach na weboch bez toho, aby ste danú stránku museli opustiť. Funkcia Vyhľadávanie klepnutím odošle slovo a súvisiaci kontext do Vyhľadávania Google a vráti definície, obrázky, výsledky vyhľadávania a ďalšie podrobnosti. Ak chcete upraviť hľadaný výraz, vyberte ho dlhým stlačením. Ak chcete vyhľadávanie spresniť, posuňte panel úplne hore a klepnite na vyhľadávacie pole.</translation> +<translation id="3623048332793834136">Záložky Chrome Canary</translation> <translation id="363596933471559332">Povolí automatické prihlasovanie na webové stránky pomocou uložených poverení. Keď je funkcia vypnutá, zobrazí sa výzva na overenie vždy pred prihlásením na web.</translation> <translation id="3653742808139624888">Ak chcete mať záložky vo všetkých svojich zariadeniach, prihláste sa do prehliadača Chrome.</translation> <translation id="3656115297268584622">Zapnúť polohu v <ph name="BEGIN_LINK" />nastaveniach systému Android<ph name="END_LINK" />.</translation> @@ -255,6 +262,7 @@ <translation id="4645575059429386691">Spravované vaším rodičom</translation> <translation id="4663756553811254707">Počet odstránených záložiek: <ph name="NUMBER_OF_BOOKMARKS" /></translation> <translation id="4665282149850138822">Stránky <ph name="NAME" /> boli pridané na plochu</translation> +<translation id="4668044310199835006">Záložky Work Chrome</translation> <translation id="4684427112815847243">Synchronizovať všetko</translation> <translation id="4686372254213217147">Pôvodná veľkosť</translation> <translation id="4690286298542128877">Karty sa presunú na prepínač kariet v prehliadači Chrome.</translation> @@ -415,6 +423,7 @@ <translation id="6464825623202322042">Toto zariadenie</translation> <translation id="6476911854266661814">Pozastavené: <ph name="VIDEO_TITLE" /></translation> <translation id="6482749332252372425">Súbor <ph name="FILE_NAME" /> sa nepodarilo stiahnuť z dôvodu nedostatku voľného miesta v úložisku.</translation> +<translation id="6541922744811587456">Záložky Chrome</translation> <translation id="654446541061731451">Vyberte kartu, ktorú chcete preniesť</translation> <translation id="6550675742724504774">Možnosti</translation> <translation id="656628257199996201">Vždy prekladať jazyk <ph name="SOURCE_LANGUAGE" /></translation> @@ -428,6 +437,7 @@ <translation id="6656545060687952787">Na to, aby mohol Chrome hľadať zariadenia, musí mať prístup k polohe. <ph name="BEGIN_LINK" />Aktualizovať povolenia<ph name="END_LINK" /></translation> <translation id="666268767214822976">Použite službu predpovedí na zobrazovanie súvisiacich dopytov a populárnych webových stránok počas zadávania textu do panela s adresou</translation> <translation id="666981079809192359">Upozornenie o ochrane osobných údajov prehliadača Chrome</translation> +<translation id="6683720003467092441">Povolenie synchronizácie na pozadí na nasledujúcom webe.</translation> <translation id="6697251040310467641">Stránka bola uložená offline</translation> <translation id="6698801883190606802">Spravovať synchronizované údaje</translation> <translation id="6699351163704950317">Všetky uložené stránky</translation> @@ -493,6 +503,9 @@ <translation id="7473891865547856676">Nie, ďakujem</translation> <translation id="7475192538862203634">Ak sa vám táto stránka zobrazuje často, skúste použiť tieto <ph name="BEGIN_LINK" />návrhy<ph name="END_LINK" />.</translation> <translation id="748127970106343339">Potvrdiť odstránenie poverení zariadenia</translation> +<translation id="7487352416683556407">Vybraté údaje boli odstránené z Chromu a vašich synchronizovaných zariadení. + +Váš účet Google môže mať na adrese <ph name="BEGIN_LINK" />history.google.com<ph name="END_LINK" /> ďalšie formy histórie prehliadania, ako napríklad vyhľadávania a aktivity v iných službách Google.</translation> <translation id="7493994139787901920"><ph name="VERSION" /> (Aktualizované <ph name="TIME_SINCE_UPDATE" />)</translation> <translation id="7498271377022651285">Čakajte…</translation> <translation id="7499262814309712782">Synchronizácia účtu</translation> @@ -596,6 +609,7 @@ <translation id="8737542153238017984">Uložené stránka nie je k dispozícii v režime offline. Úložisko je takmer plné.</translation> <translation id="8793430725658173476">Kopírovať webovú adresu</translation> <translation id="8798099450830957504">Predvolené</translation> +<translation id="8812942424849541387">Túto funkciu môžete ovládať v <ph name="BEGIN_LINK1" />Nastaveniach<ph name="END_LINK1" /></translation> <translation id="8820817407110198400">Záložky</translation> <translation id="8829678271838353305">Prihlásili ste sa pomocou účtu <ph name="ACCOUNT_EMAIL_LAST" />. Po prihlásení pomocou účtu <ph name="ACCOUNT_EMAIL_NEW" /> sa v rámci účtov zlúčia synchronizované údaje (napr. záložky). Ak chcete údaje uchovávať oddelene, vymažte údaje prehliadania v <ph name="BEGIN_LINK" />Nastaveniach<ph name="END_LINK" />.</translation> <translation id="8853345339104747198"><ph name="TAB_TITLE" />, karta</translation>
diff --git a/chrome/android/java/strings/translations/android_chrome_strings_sw.xtb b/chrome/android/java/strings/translations/android_chrome_strings_sw.xtb index 45729dfc..e291e5c 100644 --- a/chrome/android/java/strings/translations/android_chrome_strings_sw.xtb +++ b/chrome/android/java/strings/translations/android_chrome_strings_sw.xtb
@@ -18,6 +18,7 @@ <translation id="1240668123557180468">Gundua kurasa za wavuti zinazotumwa na vifaa vilivyo karibu. Chrome hukusanya kurasa za wavuti zinazohusishwa na vifaa vilivyo karibu nawe, huzituma bila maelezo yanayoweza kukutambulisha kwenye huduma za Google ili kupata kurasa muhimu zaidi kwako, kisha huzionyesha. Lazima uwashe Bluetooth na kipengele cha Mahali ili uweze kutumia Wavuti Kila Mahali.</translation> +<translation id="1250508505624960884">Alamisho za Chrome Beta</translation> <translation id="1254090737195733114">Ungependa kuleta data?</translation> <translation id="1258753120186372309">Google doodle: <ph name="DOODLE_DESCRIPTION" /></translation> <translation id="1272079795634619415">Simamisha</translation> @@ -39,9 +40,11 @@ <translation id="1445680696957526815">Vipengele vya Chrome havioani. Huenda Chrome inajaribu kupata toleo jipya, tafadhali jaribu tena baada ya dakika chache. Ikiwa tatizo litaendelea, jaribu kuondoa na usakinishe upya Chrome.</translation> <translation id="1446450296470737166">Ruhusu udhibiti kamili wa vifaa vya MIDI</translation> <translation id="145097072038377568">Imezimwa katika Mipangilio ya Android</translation> +<translation id="147006957810816598">Hutaondolewa katika akaunti yako ya Google.</translation> <translation id="1477626028522505441">Kipakuliwa cha <ph name="FILE_NAME" /> hakijafaulu kwa sababu ya matatizo ya seva.</translation> <translation id="1506061864768559482">Mtambo wa utafutaji</translation> <translation id="1513352483775369820">Alamisho na historia ya wavuti</translation> +<translation id="1549000191223877751">Nenda kwenye dirisha jingine</translation> <translation id="1553358976309200471">Sasisha Chrome</translation> <translation id="1557201757634521564">Gundua usimbaji fiche kiotomatiki</translation> <translation id="1592483623187843893">Alamisho imehifadhiwa nje ya mtandao</translation> @@ -69,8 +72,10 @@ <translation id="194341124344773587">Washa ruhusa ya Chrome katika <ph name="BEGIN_LINK" />Mipangilio ya Android<ph name="END_LINK" />.</translation> <translation id="1943432128510653496">Hifadhi manenosiri</translation> <translation id="1944384637046898011">Simba yote kwa njia fiche ukitumia nenosiri la Google kuanzia <ph name="TIME" /></translation> +<translation id="1959930595721737608">Ruhusu JavaScript kwenye tovuti inayofuata.</translation> <translation id="1966710179511230534">Tafadhali sasisha maelezo yako ya kuingia katika akaunti.</translation> <translation id="1974060860693918893">Mipangilio ya kina</translation> +<translation id="1984321224716884559">Alamisho za Chrome Dev</translation> <translation id="1984937141057606926">Inaruhusiwa, isipokuwa vidakuzi vingine</translation> <translation id="1994173015038366702">URL ya Tovuti</translation> <translation id="2001120796168634316">Hifadhi ukurasa uliounganishwa kwa matumizi ya baadaye</translation> @@ -80,6 +85,7 @@ <translation id="2079545284768500474">Tendua</translation> <translation id="2082238445998314030">Tokeo <ph name="RESULT_NUMBER" /> kati ya <ph name="TOTAL_RESULTS" /></translation> <translation id="2095887075102408547">Kipengele hiki kikiwashwa, Chrome itatumia seva za Google kushindilia kurasa unazotembelea kabla ya kuzipakua. Kurasa zinazofikiwa kwa kutumia miunganisho ya faragha (HTTPS) au vichupo vya Hali Fiche hazitaboreshwa wala kuonekana na Google.</translation> +<translation id="2096396629993765042">Hutaondolewa katika akaunti yako ya Google. Huenda Akaunti yako ya Google ina aina nyingine za historia ya mambo uliyovinjari katika <ph name="BEGIN_LINK" />history.google.com<ph name="END_LINK" />.</translation> <translation id="2100273922101894616">Ingia katika Akaunti Kiotomatiki</translation> <translation id="2126426811489709554">Unaendeshwa na Chrome</translation> <translation id="213279576345780926">Umefunga <ph name="TAB_TITLE" /></translation> @@ -188,6 +194,7 @@ <translation id="360480449234699036">Pata maelezo kuhusu mada kwenye tovuti bila kuondoka kwenye ukurasa. Gusa ili Kutafuta inatuma neno na muktadha wake uliopo kwenye Tafuta na Google, kurejesha ufafanuzi, picha, matokeo ya utafutaji, na maelezo mengine. Ili kurekebisha hoja yako ya utafutaji, bonyeza kwa muda mrefu ili kuchagua. Ili kuchuja utafutaji wako, telezesha paneli hadi juu na uguse kisanduku cha utafutaji.</translation> +<translation id="3623048332793834136">Alamisho za Chrome Canary</translation> <translation id="363596933471559332">Ingia katika tovuti kiotomatiki kwa kutumia kitambulisho kilichohifadhiwa. Kipengele kikiwa kimezimwa, utaombwa kuthibitisha kila wakati kabla ya kuingia katika tovuti.</translation> <translation id="3653742808139624888">Ingia katika Chrome ili upate alamisho zako kwenye vifaa vyako vyote</translation> <translation id="3656115297268584622">Washa eneo katika <ph name="BEGIN_LINK" />Mipangilio ya Android<ph name="END_LINK" />.</translation> @@ -255,6 +262,7 @@ <translation id="4645575059429386691">Inadhibitiwa na wazazi wako</translation> <translation id="4663756553811254707">Alamisho <ph name="NUMBER_OF_BOOKMARKS" /> zimefutwa</translation> <translation id="4665282149850138822"><ph name="NAME" /> iliongezwa kwenye Skrini yako ya kwanza</translation> +<translation id="4668044310199835006">Alamisho za Chrome ya Biashara</translation> <translation id="4684427112815847243">Sawazisha kila kitu</translation> <translation id="4686372254213217147">Ukubwa wa Asili</translation> <translation id="4690286298542128877">Vichupo vitasonga kwenye kibadilishaji cha kichupo ndani ya Chrome.</translation> @@ -415,6 +423,7 @@ <translation id="6464825623202322042">Kifaa hiki</translation> <translation id="6476911854266661814">Imesitisha “<ph name="VIDEO_TITLE" />”</translation> <translation id="6482749332252372425">Kipakuliwa cha <ph name="FILE_NAME" /> hakijafaulu kwa sababu hakuna nafasi ya hifadhi ya kutosha.</translation> +<translation id="6541922744811587456">Alamisho za Chrome</translation> <translation id="654446541061731451">Chagua kichupo cha kusambaza</translation> <translation id="6550675742724504774">Chaguo</translation> <translation id="656628257199996201">Tafsiri <ph name="SOURCE_LANGUAGE" /> kila wakati</translation> @@ -428,6 +437,7 @@ <translation id="6656545060687952787">Chrome inahitaji idhini ya kufikia mahali ili ichanganue vifaa. <ph name="BEGIN_LINK" />Ruhusa za sasisho<ph name="END_LINK" /></translation> <translation id="666268767214822976">Tumia huduma ya ubashiri ili kuonyesha hoja zinazohusiana na tovuti maarufu unapocharaza katika sehemu ya anwani</translation> <translation id="666981079809192359">Ilani ya Faragha ya Chrome</translation> +<translation id="6683720003467092441">Ruhusu Usawazishaji wa Chini Chini kwenye tovuti ifuatayo.</translation> <translation id="6697251040310467641">Ukurasa umehifadhiwa nje ya mtandao</translation> <translation id="6698801883190606802">Dhibiti data iliyosawazishwa</translation> <translation id="6699351163704950317">Kurasa zote zilizohifadhiwa</translation> @@ -493,6 +503,9 @@ <translation id="7473891865547856676">La Asante</translation> <translation id="7475192538862203634">Ikiwa unaona hili kila mara, jaribu <ph name="BEGIN_LINK" />mapendekezo<ph name="END_LINK" /> haya.</translation> <translation id="748127970106343339">Thibitisha ufutaji wa kitambulisho cha kifaa</translation> +<translation id="7487352416683556407">Data uliyochagua imeondolewa kwenye Chrome na kwenye vifaa vyako vilivyosawazishwa. + +Huenda Akaunti yako ya Google ina aina nyingine za historia ya kuvinjari kama vile mambo uliyotafuta na shughuli kutoka huduma nyingine za Google katika <ph name="BEGIN_LINK" />history.google.com<ph name="END_LINK" />.</translation> <translation id="7493994139787901920"><ph name="VERSION" /> (Ilisasishwa <ph name="TIME_SINCE_UPDATE" />)</translation> <translation id="7498271377022651285">Tafadhali subiri...</translation> <translation id="7499262814309712782">Akaunti ya kusawazisha</translation> @@ -598,6 +611,7 @@ <translation id="8737542153238017984">Ukurasa uliohifadhiwa haupatikani nje ya mtandao. Hifadhi inakaribia kujaa.</translation> <translation id="8793430725658173476">Nakili url</translation> <translation id="8798099450830957504">Chaguo Msingi</translation> +<translation id="8812942424849541387">Dhibiti namna hii inavyofanya kazi katika <ph name="BEGIN_LINK1" />Mipangilio<ph name="END_LINK1" /></translation> <translation id="8820817407110198400">Alamisho</translation> <translation id="8829678271838353305"><ph name="ACCOUNT_EMAIL_LAST" /> iliingiwa. Kuingia ukitumia <ph name="ACCOUNT_EMAIL_NEW" /> kutaunganisha data iliyosawazishwa kama alamisho kati ya akaunti. Ili kutenganisha maelezo, futa data ya kuvinjari iliyo kwenye <ph name="BEGIN_LINK" />mipangilio<ph name="END_LINK" />.</translation> <translation id="8853345339104747198"><ph name="TAB_TITLE" />, kichupo</translation>
diff --git a/chrome/android/java/strings/translations/android_chrome_strings_uk.xtb b/chrome/android/java/strings/translations/android_chrome_strings_uk.xtb index 18c408e..bf4e938 100644 --- a/chrome/android/java/strings/translations/android_chrome_strings_uk.xtb +++ b/chrome/android/java/strings/translations/android_chrome_strings_uk.xtb
@@ -18,6 +18,7 @@ <translation id="1240668123557180468">Переглядайте веб-сторінки, надіслані об’єктами поблизу. Chrome збирає веб-сторінки, пов’язані з об’єктами поблизу вас, і анонімно надсилає їх службі Google, щоб показувати вам найцікавіші. Увімкніть Bluetooth і службу локації, щоб користуватися сервісом "Інтернет навколо нас".</translation> +<translation id="1250508505624960884">Закладки з бета-версії Chrome</translation> <translation id="1254090737195733114">Імпортувати дані?</translation> <translation id="1258753120186372309">Дудл Google: <ph name="DOODLE_DESCRIPTION" /></translation> <translation id="1272079795634619415">Зупинити</translation> @@ -39,9 +40,11 @@ <translation id="1445680696957526815">Компоненти Chrome несумісні одне з одним. Веб-переглядач може оновлюватися, спробуйте через декілька хвилин. Якщо проблема не зникне, видаліть Chrome і встановіть його знову.</translation> <translation id="1446450296470737166">Повний контроль пристроїв MIDI</translation> <translation id="145097072038377568">Вимкнено в налаштуваннях Android</translation> +<translation id="147006957810816598">Ви не вийдете з облікового запису Google.</translation> <translation id="1477626028522505441">Файл <ph name="FILE_NAME" /> не завантажено через проблеми із сервером.</translation> <translation id="1506061864768559482">Пошукова система</translation> <translation id="1513352483775369820">Закладки й історія веб-пошуку</translation> +<translation id="1549000191223877751">Відкрити в іншому вікні</translation> <translation id="1553358976309200471">Оновити Chrome</translation> <translation id="1557201757634521564">Автоматично визначати кодування</translation> <translation id="1592483623187843893">Закладку збережено офлайн</translation> @@ -69,8 +72,10 @@ <translation id="194341124344773587">Увімкніть дозвіл для Chrome у <ph name="BEGIN_LINK" />налаштуваннях Android<ph name="END_LINK" />.</translation> <translation id="1943432128510653496">Зберігання паролів</translation> <translation id="1944384637046898011">Зашифрувати всі дані за допомогою пароля Google із <ph name="TIME" />.</translation> +<translation id="1959930595721737608">Дозволити JavaScript на цьому сайті.</translation> <translation id="1966710179511230534">Оновіть свої дані для входу.</translation> <translation id="1974060860693918893">Розширені</translation> +<translation id="1984321224716884559">Закладки з Chrome для розробників</translation> <translation id="1984937141057606926">Заборонено лише сторонні файли cookie</translation> <translation id="1994173015038366702">URL-адреса сайту</translation> <translation id="2001120796168634316">Зберегти пов’язану сторінку</translation> @@ -80,6 +85,7 @@ <translation id="2079545284768500474">Скасувати</translation> <translation id="2082238445998314030">Результат <ph name="RESULT_NUMBER" /> з <ph name="TOTAL_RESULTS" /></translation> <translation id="2095887075102408547">Якщо ввімкнути цю функцію, Chrome використовуватиме сервери Google, щоб стискати сторінки перед завантаженням. Однак це не стосується сторінок, відкритих під час конфіденційного з’єднання (HTTPS) або в режимі анонімного перегляду.</translation> +<translation id="2096396629993765042">Ви не вийдете з облікового запису Google. У вашому обліковому записі Google на сторінці <ph name="BEGIN_LINK" />history.google.com<ph name="END_LINK" /> можуть бути інші форми історії веб-перегляду.</translation> <translation id="2100273922101894616">Автоматичний вхід</translation> <translation id="2126426811489709554">Технології Chrome</translation> <translation id="213279576345780926">Вкладку "<ph name="TAB_TITLE" />" закрито</translation> @@ -188,6 +194,7 @@ <translation id="360480449234699036">Дізнавайтеся більше про теми на веб-сайтах, не залишаючи сторінку. Функція пошуку дотиком надсилає слово та його контекст у Пошук Google і повертає визначення, зображення, результати пошуку й інші дані. Щоб змінити пошуковий термін, натисніть і утримуйте його. Щоб уточнити пошуковий запит, пересуньте панель угору та торкніться вікна пошуку.</translation> +<translation id="3623048332793834136">Закладки з Chrome Canary</translation> <translation id="363596933471559332">Автоматично входити в облікові записи на веб-сайтах за допомогою збережених даних. Якщо цю функцію вимкнено, потрібно вводити облікові дані під час кожного входу на сайтах.</translation> <translation id="3653742808139624888">Щоб мати доступ до закладок на всіх своїх пристроях, увійдіть в обліковий запис Chrome</translation> <translation id="3656115297268584622">Увімкніть службу локації в <ph name="BEGIN_LINK" />налаштуваннях Android<ph name="END_LINK" />.</translation> @@ -255,6 +262,7 @@ <translation id="4645575059429386691">Керується одним із батьків</translation> <translation id="4663756553811254707">Видалено закладок: <ph name="NUMBER_OF_BOOKMARKS" /></translation> <translation id="4665282149850138822">Веб-сайт <ph name="NAME" /> додано на головний екран</translation> +<translation id="4668044310199835006">Закладки з Work Chrome</translation> <translation id="4684427112815847243">Синхронізувати все</translation> <translation id="4686372254213217147">Оригінальний розмір</translation> <translation id="4690286298542128877">Вкладки буде переміщено в перемикач вкладок у Chrome.</translation> @@ -415,6 +423,7 @@ <translation id="6464825623202322042">Цей пристрій</translation> <translation id="6476911854266661814">Відео "<ph name="VIDEO_TITLE" />" призупинено</translation> <translation id="6482749332252372425">Не вдалося завантажити файл <ph name="FILE_NAME" />. Замало місця.</translation> +<translation id="6541922744811587456">Закладки з Chrome</translation> <translation id="654446541061731451">Виберіть вкладку для передавання даних</translation> <translation id="6550675742724504774">Параметри</translation> <translation id="656628257199996201">Завжди перекладати з такої мови: <ph name="SOURCE_LANGUAGE" /></translation> @@ -428,6 +437,7 @@ <translation id="6656545060687952787">Щоб знаходити пристрої, Chrome потрібний доступ до геоданих. <ph name="BEGIN_LINK" />Оновлити дозволи<ph name="END_LINK" /></translation> <translation id="666268767214822976">Показувати підказки зі схожими запитами та популярними веб-сайтами під час введення запиту в адресному рядку</translation> <translation id="666981079809192359">Примітка про конфіденційність Chrome</translation> +<translation id="6683720003467092441">Дозволити фонову синхронізацію на цьому сайті.</translation> <translation id="6697251040310467641">Офлайн-версію збережено</translation> <translation id="6698801883190606802">Керування синхронізованими даними</translation> <translation id="6699351163704950317">Усі збережені сторінки</translation> @@ -493,6 +503,9 @@ <translation id="7473891865547856676">Ні, дякую</translation> <translation id="7475192538862203634">Якщо ви часто бачите таку сторінку, скористайтеся цими <ph name="BEGIN_LINK" />пропозиціями<ph name="END_LINK" />.</translation> <translation id="748127970106343339">Підтвердити видалення облікових даних пристрою</translation> +<translation id="7487352416683556407">Вибрані дані видалено з Chrome і синхронізованих пристроїв. + +У вашому обліковому записі Google на сторінці <ph name="BEGIN_LINK" />history.google.com<ph name="END_LINK" /> можуть бути додаткові форми історії веб-перегляду, як-от пошукові запити чи активність в інших службах Google.</translation> <translation id="7493994139787901920"><ph name="VERSION" /> (оновлено: <ph name="TIME_SINCE_UPDATE" />)</translation> <translation id="7498271377022651285">Зачекайте…</translation> <translation id="7499262814309712782">Обліковий запис для синхронізації</translation> @@ -598,6 +611,7 @@ <translation id="8737542153238017984">Збережена сторінка недоступна в режимі офлайн. Пам’ять майже заповнена.</translation> <translation id="8793430725658173476">Копіювати URL-адресу</translation> <translation id="8798099450830957504">За умовчанням</translation> +<translation id="8812942424849541387">Цим параметром можна керувати в <ph name="BEGIN_LINK1" />налаштуваннях<ph name="END_LINK1" /></translation> <translation id="8820817407110198400">Закладки</translation> <translation id="8829678271838353305">Ви ввійшли в обліковий запис <ph name="ACCOUNT_EMAIL_LAST" />. Якщо ввійти як <ph name="ACCOUNT_EMAIL_NEW" />, синхронізовані дані (наприклад, закладки) цих облікових записів буде об’єднано. Щоб інформація зберігалась окремо, очистьте дані веб-перегляду в <ph name="BEGIN_LINK" />налаштуваннях<ph name="END_LINK" />.</translation> <translation id="8853345339104747198">Вкладка "<ph name="TAB_TITLE" />"</translation>
diff --git a/chrome/android/java_sources.gni b/chrome/android/java_sources.gni index 037dc67a..84708ef 100644 --- a/chrome/android/java_sources.gni +++ b/chrome/android/java_sources.gni
@@ -7,6 +7,8 @@ "java/src/android/support/customtabs/CustomTabsIntent.java", "java/src/android/support/customtabs/CustomTabsService.java", "java/src/com/google/android/apps/chrome/appwidget/bookmarks/BookmarkThumbnailWidgetProvider.java", + "java/src/org/chromium/chrome/browser/ActivityTabTaskDescriptionHelper.java", + "java/src/org/chromium/chrome/browser/ActivityTaskDescriptionIconGenerator.java", "java/src/org/chromium/chrome/browser/AfterStartupTaskUtils.java", "java/src/org/chromium/chrome/browser/ApplicationInitialization.java", "java/src/org/chromium/chrome/browser/ApplicationLifetime.java", @@ -93,7 +95,6 @@ "java/src/org/chromium/chrome/browser/bookmarks/BookmarkDrawerListView.java", "java/src/org/chromium/chrome/browser/bookmarks/BookmarkDrawerListViewAdapter.java", "java/src/org/chromium/chrome/browser/bookmarks/BookmarkEditActivity.java", - "java/src/org/chromium/chrome/browser/bookmarks/BookmarkFilter.java", "java/src/org/chromium/chrome/browser/bookmarks/BookmarkFolderRow.java", "java/src/org/chromium/chrome/browser/bookmarks/BookmarkFolderSelectActivity.java", "java/src/org/chromium/chrome/browser/bookmarks/BookmarkItemHighlightView.java", @@ -120,7 +121,6 @@ "java/src/org/chromium/chrome/browser/childaccounts/ChildAccountFeedbackReporter.java", "java/src/org/chromium/chrome/browser/childaccounts/ChildAccountService.java", "java/src/org/chromium/chrome/browser/childaccounts/ExternalFeedbackReporter.java", - "java/src/org/chromium/chrome/browser/childaccounts/ResetDataActivity.java", "java/src/org/chromium/chrome/browser/compositor/CompositorView.java", "java/src/org/chromium/chrome/browser/compositor/CompositorViewHolder.java", "java/src/org/chromium/chrome/browser/compositor/Invalidator.java", @@ -276,7 +276,6 @@ "java/src/org/chromium/chrome/browser/document/ChromeLauncherActivity.java", "java/src/org/chromium/chrome/browser/document/CipherKeyActivity.java", "java/src/org/chromium/chrome/browser/document/DocumentActivity.java", - "java/src/org/chromium/chrome/browser/document/DocumentActivityIcon.java", "java/src/org/chromium/chrome/browser/document/DocumentMetricIds.java", "java/src/org/chromium/chrome/browser/document/DocumentMigrationHelper.java", "java/src/org/chromium/chrome/browser/document/DocumentTabDelegateFactory.java", @@ -520,12 +519,7 @@ "java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageViewHolder.java", "java/src/org/chromium/chrome/browser/offlinepages/ClientId.java", "java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java", - "java/src/org/chromium/chrome/browser/offlinepages/OfflinePageFreeUpSpaceCallback.java", - "java/src/org/chromium/chrome/browser/offlinepages/OfflinePageFreeUpSpaceDialog.java", "java/src/org/chromium/chrome/browser/offlinepages/OfflinePageItem.java", - "java/src/org/chromium/chrome/browser/offlinepages/OfflinePageOpenStorageSettingsDialog.java", - "java/src/org/chromium/chrome/browser/offlinepages/OfflinePageStorageSpaceHeader.java", - "java/src/org/chromium/chrome/browser/offlinepages/OfflinePageStorageSpacePolicy.java", "java/src/org/chromium/chrome/browser/offlinepages/OfflinePageTabObserver.java", "java/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtils.java", "java/src/org/chromium/chrome/browser/omaha/ExponentialBackoffScheduler.java", @@ -573,8 +567,13 @@ "java/src/org/chromium/chrome/browser/password_manager/AccountChooserDialog.java", "java/src/org/chromium/chrome/browser/password_manager/AutoSigninFirstRunDialog.java", "java/src/org/chromium/chrome/browser/password_manager/Credential.java", - "java/src/org/chromium/chrome/browser/payments/PaymentRequestDialog.java", "java/src/org/chromium/chrome/browser/payments/PaymentRequestFactory.java", + "java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java", + "java/src/org/chromium/chrome/browser/payments/ui/LineItem.java", + "java/src/org/chromium/chrome/browser/payments/ui/PaymentInformation.java", + "java/src/org/chromium/chrome/browser/payments/ui/PaymentOption.java", + "java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestUI.java", + "java/src/org/chromium/chrome/browser/payments/ui/SectionInformation.java", "java/src/org/chromium/chrome/browser/physicalweb/BitmapHttpRequest.java", "java/src/org/chromium/chrome/browser/physicalweb/ClearNotificationAlarmReceiver.java", "java/src/org/chromium/chrome/browser/physicalweb/HttpRequest.java", @@ -590,6 +589,7 @@ "java/src/org/chromium/chrome/browser/physicalweb/PwsClientImpl.java", "java/src/org/chromium/chrome/browser/physicalweb/PwsResult.java", "java/src/org/chromium/chrome/browser/physicalweb/SwipeRefreshWidget.java", + "java/src/org/chromium/chrome/browser/physicalweb/UrlInfo.java", "java/src/org/chromium/chrome/browser/physicalweb/UrlManager.java", "java/src/org/chromium/chrome/browser/physicalweb/Utils.java", "java/src/org/chromium/chrome/browser/policy/PolicyAuditor.java", @@ -1078,7 +1078,6 @@ "javatests/src/org/chromium/chrome/browser/ntp/NewTabPageTest.java", "javatests/src/org/chromium/chrome/browser/ntp/interests/InterestsServiceTest.java", "javatests/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridgeTest.java", - "javatests/src/org/chromium/chrome/browser/offlinepages/OfflinePageFeatureTest.java", "javatests/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtilsTest.java", "javatests/src/org/chromium/chrome/browser/omaha/ExponentialBackoffSchedulerTest.java", "javatests/src/org/chromium/chrome/browser/omaha/MockExponentialBackoffScheduler.java",
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/ChromeBackgroundServiceTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/ChromeBackgroundServiceTest.java index 4d7738e2..75c9810 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/ChromeBackgroundServiceTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/ChromeBackgroundServiceTest.java
@@ -29,6 +29,7 @@ static class MockTaskService extends ChromeBackgroundService { private boolean mDidLaunchBrowser = false; private boolean mDidFetchSnippets = false; + private boolean mDidRescheduleSnippets = false; private boolean mHasPrecacheInstance = true; private boolean mPrecachingStarted = false; @@ -43,6 +44,11 @@ } @Override + protected void rescheduleSnippets() { + mDidRescheduleSnippets = true; + } + + @Override protected boolean hasPrecacheInstance() { return mHasPrecacheInstance; } @@ -58,13 +64,16 @@ // to onRunTask, it will be enqueued after any possible call to launchBrowser, and we // can reliably check whether launchBrowser was called. protected void checkExpectations(final boolean expectedLaunchBrowser, - final boolean expectedPrecacheStarted, final boolean expectedFetchSnippets) { + final boolean expectedPrecacheStarted, final boolean expectedFetchSnippets, + final boolean expectedRescheduleSnippets) { ThreadUtils.runOnUiThread(new Runnable() { @Override public void run() { assertEquals("StartedService", expectedLaunchBrowser, mDidLaunchBrowser); assertEquals("StartedPrecache", expectedPrecacheStarted, mPrecachingStarted); assertEquals("FetchedSnippets", expectedFetchSnippets, mDidFetchSnippets); + assertEquals("RescheduledSnippets", expectedRescheduleSnippets, + mDidRescheduleSnippets); } }); } @@ -95,51 +104,87 @@ } private void startOnRunTaskAndVerify(String taskTag, boolean shouldStart, - boolean shouldPrecache, boolean shouldFetchSnippets) { + boolean shouldPrecache, boolean shouldFetchSnippets, boolean shouldRescheduleSnippets) { mTaskService.onRunTask(new TaskParams(taskTag)); - mTaskService.checkExpectations(shouldStart, shouldPrecache, shouldFetchSnippets); + mTaskService.checkExpectations( + shouldStart, shouldPrecache, shouldFetchSnippets, shouldRescheduleSnippets); } @SmallTest @Feature({"BackgroundSync"}) public void testBackgroundSyncNoLaunchBrowserWhenInstanceExists() { - startOnRunTaskAndVerify(BackgroundSyncLauncher.TASK_TAG, false, false, false); + startOnRunTaskAndVerify(BackgroundSyncLauncher.TASK_TAG, false, false, false, false); } @SmallTest @Feature({"BackgroundSync"}) public void testBackgroundSyncLaunchBrowserWhenInstanceDoesNotExist() { deleteSyncLauncherInstance(); - startOnRunTaskAndVerify(BackgroundSyncLauncher.TASK_TAG, true, false, false); + startOnRunTaskAndVerify(BackgroundSyncLauncher.TASK_TAG, true, false, false, false); } @SmallTest @Feature({"NTPSnippets"}) - public void testNTPSnippetsNoLaunchBrowserWhenInstanceExists() { - startOnRunTaskAndVerify(SnippetsLauncher.TASK_TAG_WIFI_CHARGING, false, false, true); - startOnRunTaskAndVerify(SnippetsLauncher.TASK_TAG_WIFI, false, false, true); - startOnRunTaskAndVerify(SnippetsLauncher.TASK_TAG_FALLBACK, false, false, true); + public void testNTPSnippetsFetchWifiChargingNoLaunchBrowserWhenInstanceExists() { + startOnRunTaskAndVerify(SnippetsLauncher.TASK_TAG_WIFI_CHARGING, false, false, true, false); } @SmallTest @Feature({"NTPSnippets"}) - public void testNTPSnippetsLaunchBrowserWhenInstanceDoesNotExist() { + public void testNTPSnippetsFetchWifiNoLaunchBrowserWhenInstanceExists() { + startOnRunTaskAndVerify(SnippetsLauncher.TASK_TAG_WIFI, false, false, true, false); + } + + @SmallTest + @Feature({"NTPSnippets"}) + public void testNTPSnippetsFetchFallbackNoLaunchBrowserWhenInstanceExists() { + startOnRunTaskAndVerify(SnippetsLauncher.TASK_TAG_FALLBACK, false, false, true, false); + } + + @SmallTest + @Feature({"NTPSnippets"}) + public void testNTPSnippetsRescheduleNoLaunchBrowserWhenInstanceExists() { + startOnRunTaskAndVerify(SnippetsLauncher.TASK_TAG_RESCHEDULE, false, false, false, true); + } + + @SmallTest + @Feature({"NTPSnippets"}) + public void testNTPSnippetsFetchWifiChargingLaunchBrowserWhenInstanceDoesNotExist() { deleteSnippetsLauncherInstance(); - startOnRunTaskAndVerify(SnippetsLauncher.TASK_TAG_WIFI_CHARGING, true, false, true); - startOnRunTaskAndVerify(SnippetsLauncher.TASK_TAG_WIFI, true, false, true); - startOnRunTaskAndVerify(SnippetsLauncher.TASK_TAG_FALLBACK, true, false, true); + startOnRunTaskAndVerify(SnippetsLauncher.TASK_TAG_WIFI_CHARGING, true, false, true, false); + } + + @SmallTest + @Feature({"NTPSnippets"}) + public void testNTPSnippetsFetchWifiLaunchBrowserWhenInstanceDoesNotExist() { + deleteSnippetsLauncherInstance(); + startOnRunTaskAndVerify(SnippetsLauncher.TASK_TAG_WIFI, true, false, true, false); + } + + @SmallTest + @Feature({"NTPSnippets"}) + public void testNTPSnippetsFetchFallbackLaunchBrowserWhenInstanceDoesNotExist() { + deleteSnippetsLauncherInstance(); + startOnRunTaskAndVerify(SnippetsLauncher.TASK_TAG_FALLBACK, true, false, true, false); + } + + @SmallTest + @Feature({"NTPSnippets"}) + public void testNTPSnippetsRescheduleLaunchBrowserWhenInstanceDoesNotExist() { + deleteSnippetsLauncherInstance(); + startOnRunTaskAndVerify(SnippetsLauncher.TASK_TAG_RESCHEDULE, true, false, false, true); } @SmallTest @Feature({"Precache"}) public void testPrecacheNoLaunchBrowserWhenInstanceExists() { - startOnRunTaskAndVerify(PrecacheController.PERIODIC_TASK_TAG, false, false, false); + startOnRunTaskAndVerify(PrecacheController.PERIODIC_TASK_TAG, false, false, false, false); } @SmallTest @Feature({"Precache"}) public void testPrecacheLaunchBrowserWhenInstanceDoesNotExist() { mTaskService.deletePrecacheInstance(); - startOnRunTaskAndVerify(PrecacheController.PERIODIC_TASK_TAG, true, true, false); + startOnRunTaskAndVerify(PrecacheController.PERIODIC_TASK_TAG, true, true, false, false); } }
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/bookmarks/BookmarkModelTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/bookmarks/BookmarkModelTest.java index 045fa29f..39660e14 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/bookmarks/BookmarkModelTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/bookmarks/BookmarkModelTest.java
@@ -9,11 +9,8 @@ import org.chromium.base.ThreadUtils; import org.chromium.base.annotations.SuppressFBWarnings; -import org.chromium.base.test.util.CommandLineFlags; import org.chromium.base.test.util.Feature; -import org.chromium.chrome.browser.ChromeSwitches; import org.chromium.chrome.browser.bookmarks.BookmarkBridge.BookmarkItem; -import org.chromium.chrome.browser.bookmarks.BookmarkModel.AddBookmarkCallback; import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.test.util.BookmarkTestUtil; import org.chromium.components.bookmarks.BookmarkId; @@ -208,15 +205,6 @@ verifyBookmark(folderAA, "faa", null, true, folderA); } - @UiThreadTest - @SmallTest - @CommandLineFlags.Add({ChromeSwitches.ENABLE_OFFLINE_PAGES}) - @Feature({"Bookmark"}) - public void testOfflineBridgeLoaded() { - assertTrue(mBookmarkModel.getOfflinePageBridge() != null); - assertTrue(mBookmarkModel.getOfflinePageBridge().isOfflinePageModelLoaded()); - } - private BookmarkId addBookmark(final BookmarkId parent, final int index, final String title, final String url) { final AtomicReference<BookmarkId> result = new AtomicReference<BookmarkId>(); @@ -224,15 +212,8 @@ ThreadUtils.runOnUiThreadBlocking(new Runnable() { @Override public void run() { - mBookmarkModel.addBookmarkAsync( - parent, index, title, url, null, new AddBookmarkCallback() { - @Override - public void onBookmarkAdded( - final BookmarkId bookmarkId, int saveResult) { - result.set(bookmarkId); - semaphore.release(); - } - }); + result.set(mBookmarkModel.addBookmark(parent, index, title, url)); + semaphore.release(); } }); try {
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/bookmarks/BookmarkTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/bookmarks/BookmarkTest.java index d2775bf..6295b79 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/bookmarks/BookmarkTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/bookmarks/BookmarkTest.java
@@ -4,8 +4,6 @@ package org.chromium.chrome.browser.bookmarks; -import android.content.Intent; -import android.net.Uri; import android.os.Environment; import android.test.suitebuilder.annotation.SmallTest; import android.text.TextUtils; @@ -16,10 +14,8 @@ import junit.framework.Assert; import org.chromium.base.ThreadUtils; -import org.chromium.base.test.util.CommandLineFlags; import org.chromium.chrome.R; import org.chromium.chrome.browser.ChromeActivity; -import org.chromium.chrome.browser.ChromeSwitches; import org.chromium.chrome.browser.UrlConstants; import org.chromium.chrome.browser.bookmarks.BookmarkBridge.BookmarkItem; import org.chromium.chrome.test.ChromeActivityTestCaseBase; @@ -94,28 +90,6 @@ } } - private void openBookmarkManager(final String url) throws InterruptedException { - if (DeviceFormFactor.isTablet(getActivity())) { - loadUrl(url); - mItemsContainer = (BookmarkRecyclerView) getActivity().findViewById( - R.id.bookmark_items_container); - } else { - // phone - BookmarkActivity activity = ActivityUtils.waitForActivity(getInstrumentation(), - BookmarkActivity.class, new Runnable() { - @Override - public void run() { - Intent intent = new Intent(getActivity(), - BookmarkActivity.class); - intent.setData(Uri.parse(url)); - getActivity().startActivity(intent); - } - }); - mItemsContainer = (BookmarkRecyclerView) activity.findViewById( - R.id.bookmark_items_container); - } - } - private boolean isItemPresentInBookmarkList(final String expectedTitle) { return ThreadUtils.runOnUiThreadBlockingNoException(new Callable<Boolean>() { @Override @@ -189,13 +163,6 @@ BookmarkUIState.createFolderUrl(bookmarkBarId).toString()); assertEquals("chrome-native://bookmarks/folder/" + otherId, BookmarkUIState.createFolderUrl(otherId).toString()); - - assertEquals("chrome-native://bookmarks/filter/OFFLINE_PAGES", BookmarkUIState - .createFilterUrl(BookmarkFilter.OFFLINE_PAGES, true).toString()); - assertEquals( - "chrome-native://bookmarks/filter/OFFLINE_PAGES?persist=0", - BookmarkUIState.createFilterUrl(BookmarkFilter.OFFLINE_PAGES, - false).toString()); } @SmallTest @@ -207,37 +174,6 @@ BookmarkUtils.getLastUsedUrl(getActivity())); } - @SmallTest - @CommandLineFlags.Add(ChromeSwitches.ENABLE_OFFLINE_PAGES) - public void testOpenBookmarkManagerInOfflinePagePersist() throws InterruptedException { - BookmarkUtils.setLastUsedUrl(getActivity(), UrlConstants.BOOKMARKS_URL); - String url = "chrome-native://bookmarks/filter/OFFLINE_PAGES"; - openBookmarkManager(url); - BookmarkDelegate delegate = mItemsContainer.getDelegateForTesting(); - assertEquals(BookmarkUIState.STATE_FILTER, delegate.getCurrentState()); - assertEquals(url, BookmarkUtils.getLastUsedUrl(getActivity())); - } - - @SmallTest - @CommandLineFlags.Add(ChromeSwitches.ENABLE_OFFLINE_PAGES) - public void testOpenBookmarkManagerInOfflinePageNoPersist() throws InterruptedException { - BookmarkUtils.setLastUsedUrl(getActivity(), UrlConstants.BOOKMARKS_URL); - String url = "chrome-native://bookmarks/filter/OFFLINE_PAGES?persist=0"; - openBookmarkManager(url); - BookmarkDelegate delegate = mItemsContainer.getDelegateForTesting(); - assertEquals(BookmarkUIState.STATE_FILTER, delegate.getCurrentState()); - assertEquals(UrlConstants.BOOKMARKS_URL, - BookmarkUtils.getLastUsedUrl(getActivity())); - } - - @SmallTest - @CommandLineFlags.Add(ChromeSwitches.DISABLE_OFFLINE_PAGES) - public void testOpenBookmarkManagerInOfflinePageWhenDisabled() throws InterruptedException { - openBookmarkManager("chrome-native://bookmarks/filter/OFFLINE_PAGES"); - BookmarkDelegate delegate = mItemsContainer.getDelegateForTesting(); - assertEquals(BookmarkUIState.STATE_ALL_BOOKMARKS, delegate.getCurrentState()); - } - /** * Returns the View that has the given text. *
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/compositor/overlays/strip/TabStripTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/compositor/overlays/strip/TabStripTest.java index 4315e95..1646b30 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/compositor/overlays/strip/TabStripTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/compositor/overlays/strip/TabStripTest.java
@@ -468,22 +468,41 @@ /** * Compares tab strips with models after switching between the ScrollingStripStacker and - * CascadingStripStacker when an incognito tab is present. Also tests tapping the incognito + * CascadingStripStacker when an incognito tab is present. Tests tapping the incognito * button while the strip is using the ScrollingStripStacker (other tests cover tapping - * the button while using the CascadingStripStacker). + * the button while using the CascadingStripStacker), and checks that switching between + * tab models scrolls to make the selected tab visible. */ @LargeTest @Restriction(ChromeRestriction.RESTRICTION_TYPE_TABLET) @Feature({"TabStrip"}) public void testSwitchStripStackersWithIncognito() throws InterruptedException { - // Open an incognito tab. + // Open an incognito tab to switch to the incognito model. newIncognitoTabFromMenu(); + // Open enough regular tabs to cause the tabs to cascade or the strip to scroll depending + // on which stacker is being used. + ChromeTabUtils.newTabsFromMenu(getInstrumentation(), getActivity(), 10); + // Switch to the ScrollingStripStacker. setShouldCascadeTabsAndCheckTabStrips(false); - // Switch tab models. + // Scroll so the selected tab is not visible. + assertSetTabStripScrollOffset(0); + TabModel model = getActivity().getTabModelSelector().getModel(false); + StripLayoutTab tab = TabStripUtils.findStripLayoutTab(getActivity(), false, + model.getTabAt(10).getId()); + assertTabVisibility(false, tab); + + // Open another incognito tab to switch to the incognito model. + newIncognitoTabFromMenu(); + + // Switch tab models to switch back to the regular tab strip. clickIncognitoToggleButton(); + getInstrumentation().waitForIdleSync(); + + // Assert selected tab is visible. + assertTabVisibility(true, tab); // Switch to the CascadingStripStacker. setShouldCascadeTabsAndCheckTabStrips(true);
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/OfflinePageFeatureTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/OfflinePageFeatureTest.java deleted file mode 100644 index b63e5a6..0000000 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/OfflinePageFeatureTest.java +++ /dev/null
@@ -1,80 +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. - -package org.chromium.chrome.browser.offlinepages; - -import android.test.UiThreadTest; -import android.test.suitebuilder.annotation.SmallTest; - -import org.chromium.base.test.util.CommandLineFlags; -import org.chromium.chrome.R; -import org.chromium.chrome.browser.ChromeSwitches; -import org.chromium.components.offlinepages.FeatureMode; -import org.chromium.content.browser.test.NativeLibraryTestBase; - -/** Unit tests for offline pages feature. */ -public class OfflinePageFeatureTest extends NativeLibraryTestBase { - @Override - protected void setUp() throws Exception { - super.setUp(); - loadNativeLibraryAndInitBrowserProcess(); - } - - @CommandLineFlags.Add({ChromeSwitches.ENABLE_OFFLINE_PAGES_AS_BOOKMARKS}) - @SmallTest - @UiThreadTest - public void testEnableOfflinePagesAsBookmarks() throws Exception { - assertEquals(FeatureMode.ENABLED_AS_BOOKMARKS, OfflinePageBridge.getFeatureMode()); - - /** String is not updated since the experiment switch asks for the "bookmarks" version. */ - assertEquals( - R.string.menu_bookmarks, OfflinePageUtils.getStringId(R.string.menu_bookmarks)); - /** String is not updated when no mapping exists. */ - assertEquals(R.string.bookmark_offline_page_none, - OfflinePageUtils.getStringId(R.string.bookmark_offline_page_none)); - } - - @CommandLineFlags.Add({ChromeSwitches.ENABLE_OFFLINE_PAGES_AS_SAVED_PAGES}) - @SmallTest - @UiThreadTest - public void testEnableOfflinePagesAsSavedPages() throws Exception { - assertEquals(FeatureMode.ENABLED_AS_SAVED_PAGES, OfflinePageBridge.getFeatureMode()); - - /** String is updated when a mapping is found. */ - assertEquals(R.string.menu_bookmarks_offline_pages, - OfflinePageUtils.getStringId(R.string.menu_bookmarks)); - /** String is not updated when no mapping exists. */ - assertEquals(R.string.bookmark_offline_page_none, - OfflinePageUtils.getStringId(R.string.bookmark_offline_page_none)); - } - - @CommandLineFlags.Add({ChromeSwitches.ENABLE_OFFLINE_PAGES}) - @SmallTest - @UiThreadTest - public void testEnableOfflinePages() throws Exception { - assertEquals(FeatureMode.ENABLED_AS_SAVED_PAGES, OfflinePageBridge.getFeatureMode()); - - /** String is not updated since the experiment switch asks for the "bookmarks" version. */ - assertEquals(R.string.menu_bookmarks_offline_pages, - OfflinePageUtils.getStringId(R.string.menu_bookmarks)); - /** String is not updated when no mapping exists. */ - assertEquals(R.string.bookmark_offline_page_none, - OfflinePageUtils.getStringId(R.string.bookmark_offline_page_none)); - } - - @CommandLineFlags.Add({ChromeSwitches.DISABLE_OFFLINE_PAGES}) - @SmallTest - @UiThreadTest - public void testDisableOfflinePages() throws Exception { - assertEquals(FeatureMode.DISABLED, OfflinePageBridge.getFeatureMode()); - - /** Strings are not updated regardless whether the mappings exist when the feature is - * disabled. - */ - assertEquals( - R.string.menu_bookmarks, OfflinePageUtils.getStringId(R.string.menu_bookmarks)); - assertEquals(R.string.bookmark_offline_page_none, - OfflinePageUtils.getStringId(R.string.bookmark_offline_page_none)); - } -}
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/physicalweb/MockPwsClient.java b/chrome/android/javatests/src/org/chromium/chrome/browser/physicalweb/MockPwsClient.java index 578e25b7..296bf7b 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/physicalweb/MockPwsClient.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/physicalweb/MockPwsClient.java
@@ -17,7 +17,7 @@ * This class sends requests to the Physical Web Service. */ class MockPwsClient implements PwsClient { - private List<Collection<String>> mResolveCalls; + private List<Collection<UrlInfo>> mResolveCalls; private List<String> mFetchIconCalls; private List<List<PwsResult>> mPwsResults; private List<Bitmap> mIconBitmaps; @@ -29,7 +29,7 @@ mIconBitmaps = new ArrayList<>(); } - public List<Collection<String>> getResolveCalls() { + public List<Collection<UrlInfo>> getResolveCalls() { return mResolveCalls; } @@ -51,7 +51,7 @@ * @param resolveScanCallback The callback to be run when the response is received. */ @Override - public void resolve(final Collection<String> broadcastUrls, + public void resolve(final Collection<UrlInfo> broadcastUrls, final ResolveScanCallback resolveScanCallback) { mResolveCalls.add(broadcastUrls); resolveScanCallback.onPwsResults(mPwsResults.remove(0));
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/physicalweb/UrlManagerTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/physicalweb/UrlManagerTest.java index 81c399d..791be56c 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/physicalweb/UrlManagerTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/physicalweb/UrlManagerTest.java
@@ -16,7 +16,6 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; -import java.util.Set; /** * Tests for the UrlManager class. @@ -62,11 +61,11 @@ getInstrumentation().waitForIdleSync(); // Make sure that a resolution was *not* attempted. - List<Collection<String>> resolveCalls = mMockPwsClient.getResolveCalls(); + List<Collection<UrlInfo>> resolveCalls = mMockPwsClient.getResolveCalls(); assertEquals(0, resolveCalls.size()); // Make sure that we have no resolved URLs. - Set<String> urls = mUrlManager.getUrls(); + List<UrlInfo> urls = mUrlManager.getUrls(); assertEquals(0, urls.size()); // Make sure that a notification was shown. @@ -81,11 +80,11 @@ getInstrumentation().waitForIdleSync(); // Make sure that a resolution was attempted. - List<Collection<String>> resolveCalls = mMockPwsClient.getResolveCalls(); + List<Collection<UrlInfo>> resolveCalls = mMockPwsClient.getResolveCalls(); assertEquals(1, resolveCalls.size()); // Make sure that we have no resolved URLs. - Set<String> urls = mUrlManager.getUrls(); + List<UrlInfo> urls = mUrlManager.getUrls(); assertEquals(0, urls.size()); // Make sure that we do have unresolved URLs. urls = mUrlManager.getUrls(true); @@ -105,11 +104,11 @@ getInstrumentation().waitForIdleSync(); // Make sure that a resolution was attempted. - List<Collection<String>> resolveCalls = mMockPwsClient.getResolveCalls(); + List<Collection<UrlInfo>> resolveCalls = mMockPwsClient.getResolveCalls(); assertEquals(1, resolveCalls.size()); // Make sure that we have our resolved URLs. - Set<String> urls = mUrlManager.getUrls(); + List<UrlInfo> urls = mUrlManager.getUrls(); assertEquals(1, urls.size()); // Make sure that a notification was shown. @@ -132,7 +131,7 @@ mUrlManager.removeUrl(URL1); // Make sure the URL was removed. - Set<String> urls = mUrlManager.getUrls(true); + List<UrlInfo> urls = mUrlManager.getUrls(true); assertEquals(0, urls.size()); // Make sure no notification is shown. @@ -155,7 +154,7 @@ mUrlManager.clearUrls(); // Make sure all URLs were removed. - Set<String> urls = mUrlManager.getUrls(true); + List<UrlInfo> urls = mUrlManager.getUrls(true); assertEquals(0, urls.size()); // Make sure no notification is shown.
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/bookmarks/BookmarkModelUnitTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/bookmarks/BookmarkModelUnitTest.java deleted file mode 100644 index 720d708..0000000 --- a/chrome/android/junit/src/org/chromium/chrome/browser/bookmarks/BookmarkModelUnitTest.java +++ /dev/null
@@ -1,53 +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. - -package org.chromium.chrome.browser.bookmarks; - -import static org.junit.Assert.assertEquals; - -import org.chromium.base.BaseChromiumApplication; -import org.chromium.base.test.shadows.ShadowMultiDex; -import org.chromium.chrome.browser.offlinepages.ClientId; -import org.chromium.components.bookmarks.BookmarkId; -import org.chromium.components.bookmarks.BookmarkType; -import org.chromium.testing.local.LocalRobolectricTestRunner; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.robolectric.annotation.Config; - -/** - * Robolectric tests for {@link BookmarkUtils}. - */ -@RunWith(LocalRobolectricTestRunner.class) -@Config(manifest = Config.NONE, application = BaseChromiumApplication.class, - shadows = {ShadowMultiDex.class}) -public class BookmarkModelUnitTest { - @Test - public void testGetBookmarkIdForOfflineClientIdBadId() { - ClientId clientId = new ClientId("bookmark", "id"); - BookmarkId id = BookmarkModel.getBookmarkIdForOfflineClientId(clientId); - - assertEquals(id.getType(), BookmarkType.NORMAL); - assertEquals(id.getId(), -1); - } - - @Test - public void testGetBookmarkIdForOfflineClientIdWrongNamespace() { - ClientId clientId = new ClientId("wrong", "6"); - BookmarkId id = BookmarkModel.getBookmarkIdForOfflineClientId(clientId); - - assertEquals(id.getType(), BookmarkType.NORMAL); - assertEquals(id.getId(), -1); - } - - @Test - public void testGetBookmarkIdForOfflineClientIdOk() { - ClientId clientId = new ClientId("bookmark", "6"); - BookmarkId id = BookmarkModel.getBookmarkIdForOfflineClientId(clientId); - - assertEquals(id.getType(), BookmarkType.NORMAL); - assertEquals(id.getId(), 6); - } -}
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/bookmarks/BookmarkUtilsTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/bookmarks/BookmarkUtilsTest.java deleted file mode 100644 index ea631d72..0000000 --- a/chrome/android/junit/src/org/chromium/chrome/browser/bookmarks/BookmarkUtilsTest.java +++ /dev/null
@@ -1,73 +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. - -package org.chromium.chrome.browser.bookmarks; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.mockito.Mockito.verify; - -import android.content.Context; -import android.content.Intent; - -import org.chromium.base.BaseChromiumApplication; -import org.chromium.base.test.shadows.ShadowMultiDex; -import org.chromium.base.test.util.Feature; -import org.chromium.components.bookmarks.BookmarkId; -import org.chromium.components.bookmarks.BookmarkType; -import org.chromium.content_public.browser.WebContents; -import org.chromium.testing.local.LocalRobolectricTestRunner; - -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.ArgumentCaptor; -import org.mockito.Mock; -import org.mockito.MockitoAnnotations; -import org.robolectric.annotation.Config; - -/** - * Robolectric tests for {@link BookmarkUtils}. - */ -@RunWith(LocalRobolectricTestRunner.class) -@Config(manifest = Config.NONE, application = BaseChromiumApplication.class, - shadows = {ShadowMultiDex.class}) -public class BookmarkUtilsTest { - @Mock private Context mContext; - @Mock private BookmarkModel mBookmarkModel; - @Mock private WebContents mWebContents; - - @Before - public void setUp() { - MockitoAnnotations.initMocks(this); - } - - @Test - @Feature({"Bookmark"}) - public void testStartEditActivityWithoutWebContents() { - BookmarkId bookmarkId = new BookmarkId(12345L, BookmarkType.NORMAL); - BookmarkUtils.startEditActivity(mContext, bookmarkId, null /* webContents */); - ArgumentCaptor<Intent> intentArgumentCaptor = ArgumentCaptor.forClass(Intent.class); - - verify(mContext).startActivity(intentArgumentCaptor.capture()); - - // Verify that the intent doesn't contain the WEB_CONTENTS extra. - assertFalse(intentArgumentCaptor.getValue() - .hasExtra(BookmarkEditActivity.INTENT_WEB_CONTENTS)); - } - - @Test - @Feature({"Bookmark"}) - public void testStartEditActivityWithWebContents() { - BookmarkId bookmarkId = new BookmarkId(12345L, BookmarkType.NORMAL); - BookmarkUtils.startEditActivity(mContext, bookmarkId, mWebContents); - ArgumentCaptor<Intent> intentArgumentCaptor = ArgumentCaptor.forClass(Intent.class); - - verify(mContext).startActivity(intentArgumentCaptor.capture()); - - // Verify that the intent contains the right WEB_CONTENTS extra. - assertEquals(mWebContents, intentArgumentCaptor.getValue() - .getParcelableExtra(BookmarkEditActivity.INTENT_WEB_CONTENTS)); - } -}
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapterTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapterTest.java new file mode 100644 index 0000000..e021927 --- /dev/null +++ b/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapterTest.java
@@ -0,0 +1,146 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.ntp.cards; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.mockito.Matchers.any; +import static org.mockito.Mockito.doAnswer; +import static org.mockito.Mockito.mock; + +import org.chromium.base.test.util.Feature; +import org.chromium.chrome.browser.ntp.NewTabPageView.NewTabPageManager; +import org.chromium.chrome.browser.ntp.snippets.SnippetArticle; +import org.chromium.chrome.browser.ntp.snippets.SnippetsBridge.SnippetsObserver; +import org.chromium.chrome.browser.tab.TabObserver; +import org.chromium.testing.local.LocalRobolectricTestRunner; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.invocation.InvocationOnMock; +import org.mockito.stubbing.Answer; +import org.robolectric.annotation.Config; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + + +/** + * Unit tests for {@link NewTabPageAdapter}. + */ +@RunWith(LocalRobolectricTestRunner.class) +@Config(manifest = Config.NONE) +public class NewTabPageAdapterTest { + + private NewTabPageManager mNewTabPageManager; + private SnippetsObserver mSnippetsObserver; + private TabObserver mTabObserver; + + @Before + public void setUp() { + mNewTabPageManager = mock(NewTabPageManager.class); + mSnippetsObserver = null; + mTabObserver = null; + + // Intercept the observers so that we can mock invocations. + doAnswer(new Answer<Void>() { + @Override + public Void answer(InvocationOnMock invocation) throws Throwable { + mSnippetsObserver = invocation.getArgumentAt(0, SnippetsObserver.class); + return null; + }}).when(mNewTabPageManager).setSnippetsObserver(any(SnippetsObserver.class)); + + doAnswer(new Answer<Void>() { + @Override + public Void answer(InvocationOnMock invocation) throws Throwable { + mTabObserver = invocation.getArgumentAt(0, TabObserver.class); + return null; + }}).when(mNewTabPageManager).addTabObserver(any(TabObserver.class)); + } + + /** + * Tests the content of the adapter under standard conditions: on start and after a snippet + * fetch. + */ + @Test + @Feature({"Ntp"}) + public void testSnippetLoading() { + NewTabPageAdapter ntpa = new NewTabPageAdapter(mNewTabPageManager, null); + assertEquals(1, ntpa.getItemCount()); + assertEquals(NewTabPageListItem.VIEW_TYPE_ABOVE_THE_FOLD, ntpa.getItemViewType(0)); + + List<SnippetArticle> snippets = Arrays.asList(new SnippetArticle[] { + new SnippetArticle("title1", "pub1", "txt1", "https://site.com/url1", null, 0, 0), + new SnippetArticle("title2", "pub2", "txt2", "https://site.com/url2", null, 0, 0), + new SnippetArticle("title3", "pub3", "txt3", "https://site.com/url3", null, 0, 0)}); + mSnippetsObserver.onSnippetsReceived(snippets); + + List<NewTabPageListItem> loadedItems = ntpa.getItemsForTesting(); + assertEquals(NewTabPageListItem.VIEW_TYPE_ABOVE_THE_FOLD, ntpa.getItemViewType(0)); + assertEquals(NewTabPageListItem.VIEW_TYPE_HEADER, ntpa.getItemViewType(1)); + assertEquals(snippets, loadedItems.subList(2, loadedItems.size())); + assertNull(mSnippetsObserver); + } + + /** + * Tests that the adapter keeps listening for snippet updates if it didn't get anything from + * a previous fetch. + */ + @Test + @Feature({"Ntp"}) + public void testSnippetLoadingInitiallyEmpty() { + NewTabPageAdapter ntpa = new NewTabPageAdapter(mNewTabPageManager, null); + + // If we don't get anything, we should still have the above-the-fold item present. + mSnippetsObserver.onSnippetsReceived(new ArrayList<SnippetArticle>()); + assertEquals(1, ntpa.getItemCount()); + assertEquals(NewTabPageListItem.VIEW_TYPE_ABOVE_THE_FOLD, ntpa.getItemViewType(0)); + assertNotNull(mSnippetsObserver); + + // We should load new snippets when we get notified about them. + List<SnippetArticle> snippets = Arrays.asList(new SnippetArticle[] { + new SnippetArticle("title1", "pub1", "txt1", "https://site.com/url1", null, 0, 0), + new SnippetArticle("title2", "pub2", "txt2", "https://site.com/url2", null, 0, 0)}); + mSnippetsObserver.onSnippetsReceived(snippets); + List<NewTabPageListItem> loadedItems = ntpa.getItemsForTesting(); + assertEquals(NewTabPageListItem.VIEW_TYPE_ABOVE_THE_FOLD, ntpa.getItemViewType(0)); + assertEquals(NewTabPageListItem.VIEW_TYPE_HEADER, ntpa.getItemViewType(1)); + assertEquals(snippets, loadedItems.subList(2, loadedItems.size())); + assertNull(mSnippetsObserver); + } + + /** + * Tests the behavior on multiple loads. The snippet list should contain only the new ones. + */ + @Test + @Feature({"Ntp"}) + public void testSnippetMultipleLoads() { + NewTabPageAdapter ntpa = new NewTabPageAdapter(mNewTabPageManager, null); + + List<SnippetArticle> snippets = Arrays.asList(new SnippetArticle[] { + new SnippetArticle("title1", "pub1", "txt1", "https://site.com/url1", null, 0, 0), + new SnippetArticle("title2", "pub2", "txt2", "https://site.com/url2", null, 0, 0)}); + mSnippetsObserver.onSnippetsReceived(snippets); + + // Successfull load, so we should have stopped listening to snippet changes + assertNull(mSnippetsObserver); + + // We should be listening to tab events though, and use it to request changes. + mTabObserver.onShown(null); + assertNotNull(mSnippetsObserver); + + snippets = Arrays.asList(new SnippetArticle[] { + new SnippetArticle("title2", "pub2", "txt2", "https://site.com/url2", null, 0, 0), + new SnippetArticle("title3", "pub3", "txt3", "https://site.com/url3", null, 0, 0)}); + mSnippetsObserver.onSnippetsReceived(snippets); + + List<NewTabPageListItem> loadedItems = ntpa.getItemsForTesting(); + assertEquals(NewTabPageListItem.VIEW_TYPE_ABOVE_THE_FOLD, ntpa.getItemViewType(0)); + assertEquals(NewTabPageListItem.VIEW_TYPE_HEADER, ntpa.getItemViewType(1)); + assertEquals(snippets, loadedItems.subList(2, loadedItems.size())); + } +}
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtilsTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtilsTest.java index fb15360f..665ee90 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtilsTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtilsTest.java
@@ -5,8 +5,6 @@ package org.chromium.chrome.browser.offlinepages; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.when; import android.os.Environment; @@ -59,16 +57,6 @@ @Test @Feature({"OfflinePages"}) - public void testIsStorageAlmostFull() { - when(mMockDataDirectory.getUsableSpace()).thenReturn(16L * (1 << 20)); // 16MB - assertFalse(OfflinePageUtils.isStorageAlmostFull()); - - when(mMockDataDirectory.getUsableSpace()).thenReturn(8L * (1 << 20)); // 8MB - assertTrue(OfflinePageUtils.isStorageAlmostFull()); - } - - @Test - @Feature({"OfflinePages"}) public void testStripSchemeFromOnlineUrl() { // Only scheme gets stripped. assertEquals("cs.chromium.org",
diff --git a/chrome/app/android/chrome_main_delegate_android.h b/chrome/app/android/chrome_main_delegate_android.h index 226c086..6e68170e 100644 --- a/chrome/app/android/chrome_main_delegate_android.h +++ b/chrome/app/android/chrome_main_delegate_android.h
@@ -5,8 +5,9 @@ #ifndef CHROME_APP_ANDROID_CHROME_MAIN_DELEGATE_ANDROID_H_ #define CHROME_APP_ANDROID_CHROME_MAIN_DELEGATE_ANDROID_H_ +#include <memory> + #include "base/macros.h" -#include "base/memory/scoped_ptr.h" #include "chrome/app/chrome_main_delegate.h" #include "content/public/browser/browser_main_runner.h" @@ -35,10 +36,11 @@ #endif private: - scoped_ptr<content::BrowserMainRunner> browser_runner_; + std::unique_ptr<content::BrowserMainRunner> browser_runner_; #if defined(SAFE_BROWSING_DB_REMOTE) - scoped_ptr<safe_browsing::SafeBrowsingApiHandler> safe_browsing_api_handler_; + std::unique_ptr<safe_browsing::SafeBrowsingApiHandler> + safe_browsing_api_handler_; #endif DISALLOW_COPY_AND_ASSIGN(ChromeMainDelegateAndroid);
diff --git a/chrome/app/chrome_crash_reporter_client.cc b/chrome/app/chrome_crash_reporter_client.cc index 2a8db668..849e575 100644 --- a/chrome/app/chrome_crash_reporter_client.cc +++ b/chrome/app/chrome_crash_reporter_client.cc
@@ -78,7 +78,7 @@ base::FilePath* crash_dir) { // By setting the BREAKPAD_DUMP_LOCATION environment variable, an alternate // location to write breakpad crash dumps can be set. - scoped_ptr<base::Environment> env(base::Environment::Create()); + std::unique_ptr<base::Environment> env(base::Environment::Create()); std::string alternate_crash_dump_location; if (env->GetVar("BREAKPAD_DUMP_LOCATION", &alternate_crash_dump_location)) { *crash_dir = base::FilePath::FromUTF8Unsafe(alternate_crash_dump_location); @@ -99,7 +99,7 @@ DCHECK(special_build); DCHECK(channel_name); - scoped_ptr<FileVersionInfo> version_info( + std::unique_ptr<FileVersionInfo> version_info( FileVersionInfo::CreateFileVersionInfo(exe_path)); if (version_info.get()) { @@ -123,7 +123,7 @@ bool ChromeCrashReporterClient::ShouldShowRestartDialog(base::string16* title, base::string16* message, bool* is_rtl_locale) { - scoped_ptr<base::Environment> env(base::Environment::Create()); + std::unique_ptr<base::Environment> env(base::Environment::Create()); if (!env->HasVar(env_vars::kShowRestart) || !env->HasVar(env_vars::kRestartInfo) || env->HasVar(env_vars::kMetroConnected)) { @@ -149,7 +149,7 @@ } bool ChromeCrashReporterClient::AboutToRestart() { - scoped_ptr<base::Environment> env(base::Environment::Create()); + std::unique_ptr<base::Environment> env(base::Environment::Create()); if (!env->HasVar(env_vars::kRestartInfo)) return false; @@ -282,7 +282,7 @@ base::FilePath* crash_dir) { // By setting the BREAKPAD_DUMP_LOCATION environment variable, an alternate // location to write breakpad crash dumps can be set. - scoped_ptr<base::Environment> env(base::Environment::Create()); + std::unique_ptr<base::Environment> env(base::Environment::Create()); std::string alternate_crash_dump_location; if (env->GetVar("BREAKPAD_DUMP_LOCATION", &alternate_crash_dump_location)) { base::FilePath crash_dumps_dir_path = @@ -314,7 +314,7 @@ } bool ChromeCrashReporterClient::IsRunningUnattended() { - scoped_ptr<base::Environment> env(base::Environment::Create()); + std::unique_ptr<base::Environment> env(base::Environment::Create()); return env->HasVar(env_vars::kHeadless); }
diff --git a/chrome/app/chrome_crash_reporter_client.h b/chrome/app/chrome_crash_reporter_client.h index 5cdeac26..4d18486 100644 --- a/chrome/app/chrome_crash_reporter_client.h +++ b/chrome/app/chrome_crash_reporter_client.h
@@ -7,9 +7,10 @@ #include <stddef.h> +#include <memory> + #include "base/compiler_specific.h" #include "base/macros.h" -#include "base/memory/scoped_ptr.h" #include "build/build_config.h" #include "components/crash/content/app/crash_reporter_client.h" @@ -74,7 +75,8 @@ private: #if defined(OS_WIN) - scoped_ptr<browser_watcher::CrashReportingMetrics> crash_reporting_metrics_; + std::unique_ptr<browser_watcher::CrashReportingMetrics> + crash_reporting_metrics_; #endif DISALLOW_COPY_AND_ASSIGN(ChromeCrashReporterClient);
diff --git a/chrome/app/chrome_exe_main_win.cc b/chrome/app/chrome_exe_main_win.cc index edde785e..28e1b74d 100644 --- a/chrome/app/chrome_exe_main_win.cc +++ b/chrome/app/chrome_exe_main_win.cc
@@ -39,7 +39,6 @@ #include "components/startup_metric_utils/common/pre_read_field_trial_utils_win.h" #include "content/public/common/content_switches.h" #include "content/public/common/result_codes.h" -#include "ui/gfx/win/dpi.h" namespace {
diff --git a/chrome/app/chrome_main_delegate.cc b/chrome/app/chrome_main_delegate.cc index 4479230..c648afc 100644 --- a/chrome/app/chrome_main_delegate.cc +++ b/chrome/app/chrome_main_delegate.cc
@@ -364,7 +364,7 @@ // support the virtual desktop use-case. if (user_data_dir.empty()) { std::string user_data_dir_string; - scoped_ptr<base::Environment> environment(base::Environment::Create()); + std::unique_ptr<base::Environment> environment(base::Environment::Create()); if (environment->GetVar("CHROME_USER_DATA_DIR", &user_data_dir_string) && base::IsStringUTF8(user_data_dir_string)) { user_data_dir = base::FilePath::FromUTF8Unsafe(user_data_dir_string);
diff --git a/chrome/app/chrome_main_delegate.h b/chrome/app/chrome_main_delegate.h index 1cb0821b..0276d2b7 100644 --- a/chrome/app/chrome_main_delegate.h +++ b/chrome/app/chrome_main_delegate.h
@@ -5,8 +5,9 @@ #ifndef CHROME_APP_CHROME_MAIN_DELEGATE_H_ #define CHROME_APP_CHROME_MAIN_DELEGATE_H_ +#include <memory> + #include "base/macros.h" -#include "base/memory/scoped_ptr.h" #include "build/build_config.h" #include "chrome/common/chrome_content_client.h" #include "content/public/app/content_main_delegate.h"
diff --git a/chrome/app/chrome_watcher_command_line_win.cc b/chrome/app/chrome_watcher_command_line_win.cc index 2f79dbc7..6858de6e 100644 --- a/chrome/app/chrome_watcher_command_line_win.cc +++ b/chrome/app/chrome_watcher_command_line_win.cc
@@ -114,7 +114,7 @@ << "Handles left untaken."; } -scoped_ptr<ChromeWatcherCommandLine> +std::unique_ptr<ChromeWatcherCommandLine> ChromeWatcherCommandLine::InterpretCommandLine( const base::CommandLine& command_line) { base::win::ScopedHandle on_initialized_event_handle; @@ -126,9 +126,9 @@ if (!InterpretChromeWatcherCommandLine( command_line, &parent_process_handle, &main_thread_id, &on_initialized_event_handle)) - return scoped_ptr<ChromeWatcherCommandLine>(); + return std::unique_ptr<ChromeWatcherCommandLine>(); - return scoped_ptr<ChromeWatcherCommandLine>(new ChromeWatcherCommandLine( + return std::unique_ptr<ChromeWatcherCommandLine>(new ChromeWatcherCommandLine( on_initialized_event_handle.Take(), parent_process_handle.Take(), main_thread_id)); }
diff --git a/chrome/app/chrome_watcher_command_line_win.h b/chrome/app/chrome_watcher_command_line_win.h index 3f4c568..4c445d98 100644 --- a/chrome/app/chrome_watcher_command_line_win.h +++ b/chrome/app/chrome_watcher_command_line_win.h
@@ -6,11 +6,12 @@ #define CHROME_APP_CHROME_WATCHER_COMMAND_LINE_WIN_H_ #include <windows.h> + +#include <memory> #include <vector> #include "base/command_line.h" #include "base/files/file_path.h" -#include "base/memory/scoped_ptr.h" #include "base/win/scoped_handle.h" // Class for configuring the Chrome watcher process via the command-line. This @@ -75,7 +76,7 @@ // If this fails any successfully opened handles will be closed prior to // return. Returns a ChromeWatcherCommandLine object on success, nullptr // otherwise. - static scoped_ptr<ChromeWatcherCommandLine> InterpretCommandLine( + static std::unique_ptr<ChromeWatcherCommandLine> InterpretCommandLine( const base::CommandLine& command_line); // Accessors for handles. Any handles not taken from this object at the time
diff --git a/chrome/app/chrome_watcher_command_line_win_unittest.cc b/chrome/app/chrome_watcher_command_line_win_unittest.cc index 82bfaab..bea3c79 100644 --- a/chrome/app/chrome_watcher_command_line_win_unittest.cc +++ b/chrome/app/chrome_watcher_command_line_win_unittest.cc
@@ -84,7 +84,7 @@ base::win::ScopedHandle event_; TestChromeWatcherCommandLineGenerator generator_; base::CommandLine cmd_line_; - scoped_ptr<ChromeWatcherCommandLine> interpreted_; + std::unique_ptr<ChromeWatcherCommandLine> interpreted_; }; // The corresponding death test fixture.
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index d4e63c5..906ab3c 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd
@@ -5990,6 +5990,12 @@ <message name="IDS_FLAGS_PROTECT_SYNC_CREDENTIAL_DESCRIPTION" desc="Description of the flag specifying how the browser will handle autofilling the users sync credential."> How the password manager handles autofill for the sync credential. </message> + <message name="IDS_FLAGS_PASSWORD_IMPORT_EXPORT_NAME" desc="Name of the flag for showing the Import and Export buttons for importing and exporting passwords in Chrome's settings."> + Password import and export + </message> + <message name="IDS_FLAGS_PASSWORD_IMPORT_EXPORT_DESCRIPTION" desc="Description of the flag for showing the Import and Export buttons for importing and exporting passwords in Chrome's settings."> + Import and Export functionality in password settings. + </message> <message name="IDS_FLAGS_PROTECT_SYNC_CREDENTIAL_ON_REAUTH_NAME" desc="Name of the flag specifying how the browser will handle autofilling the users sync credential."> Autofill sync credential only for transactional reauth pages </message> @@ -11661,12 +11667,6 @@ <message name="IDS_FLAGS_ENABLE_WEB_NOTIFICATION_CUSTOM_LAYOUTS_DESCRIPTION" desc="Description for the flag to enable custom layouts for Web Notifications."> Enable custom layouts for Web Notifications. They will have subtle layout improvements that are otherwise not possible. </message> - <message name="IDS_FLAGS_ENABLE_NOTIFICATION_ACTION_ICONS_NAME" desc="Name of the flag to enable action icons for Web Notifications."> - Enable action icons for Web Notifications. - </message> - <message name="IDS_FLAGS_ENABLE_NOTIFICATION_ACTION_ICONS_DESCRIPTION" desc="Description of the flag to enable action icons for Web Notifications."> - Enable icons in action buttons for Web Notifications. - </message> </if> <!-- Mac AppleScript -->
diff --git a/chrome/app/main_dll_loader_win.cc b/chrome/app/main_dll_loader_win.cc index 6118f444f..7097e83 100644 --- a/chrome/app/main_dll_loader_win.cc +++ b/chrome/app/main_dll_loader_win.cc
@@ -2,12 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "chrome/app/main_dll_loader_win.h" + #include <windows.h> // NOLINT #include <shlwapi.h> // NOLINT #include <stddef.h> #include <userenv.h> // NOLINT -#include "chrome/app/main_dll_loader_win.h" +#include <memory> #include "base/base_paths.h" #include "base/base_switches.h" @@ -17,7 +19,6 @@ #include "base/lazy_instance.h" #include "base/logging.h" #include "base/macros.h" -#include "base/memory/scoped_ptr.h" #include "base/path_service.h" #include "base/strings/string16.h" #include "base/strings/string_util.h" @@ -212,9 +213,9 @@ int OnBeforeExit(int return_code, const base::FilePath& dll_path) override; private: - scoped_ptr<ChromeWatcherClient> chrome_watcher_client_; + std::unique_ptr<ChromeWatcherClient> chrome_watcher_client_; #if BUILDFLAG(ENABLE_KASKO) - scoped_ptr<KaskoClient> kasko_client_; + std::unique_ptr<KaskoClient> kasko_client_; #endif };
diff --git a/chrome/app/mash/mash_runner.cc b/chrome/app/mash/mash_runner.cc index f940c8a..4dbcb18f 100644 --- a/chrome/app/mash/mash_runner.cc +++ b/chrome/app/mash/mash_runner.cc
@@ -83,7 +83,8 @@ private: // TODO(sky): move this into mash. - scoped_ptr<shell::ShellClient> CreateShellClient(const std::string& name) { + std::unique_ptr<shell::ShellClient> CreateShellClient( + const std::string& name) { if (name == "mojo:ash_sysui") return base::WrapUnique(new ash::sysui::SysUIApplication); if (name == "mojo:desktop_wm") @@ -112,8 +113,8 @@ } mojo::BindingSet<ShellClientFactory> shell_client_factory_bindings_; - scoped_ptr<shell::ShellClient> shell_client_; - scoped_ptr<shell::ShellConnection> shell_connection_; + std::unique_ptr<shell::ShellClient> shell_client_; + std::unique_ptr<shell::ShellConnection> shell_connection_; DISALLOW_COPY_AND_ASSIGN(DefaultShellClient); }; @@ -188,7 +189,7 @@ // in chrome. NativeRunnerDelegateImpl native_runner_delegate; shell::BackgroundShell background_shell; - scoped_ptr<shell::BackgroundShell::InitParams> init_params( + std::unique_ptr<shell::BackgroundShell::InitParams> init_params( new shell::BackgroundShell::InitParams); init_params->native_runner_delegate = &native_runner_delegate; background_shell.Init(std::move(init_params)); @@ -231,7 +232,7 @@ true); // Tick count // TODO(sky): use MessagePumpMojo. - scoped_ptr<base::MessageLoop> message_loop; + std::unique_ptr<base::MessageLoop> message_loop; #if defined(OS_LINUX) base::AtExitManager exit_manager; #endif
diff --git a/chrome/app/mash/mash_runner.h b/chrome/app/mash/mash_runner.h index db20df79..65b6eabf 100644 --- a/chrome/app/mash/mash_runner.h +++ b/chrome/app/mash/mash_runner.h
@@ -5,8 +5,9 @@ #ifndef CHROME_APP_MASH_MASH_RUNNER_H_ #define CHROME_APP_MASH_MASH_RUNNER_H_ +#include <memory> + #include "base/macros.h" -#include "base/memory/scoped_ptr.h" #include "services/shell/public/interfaces/shell_client.mojom.h" namespace shell { @@ -28,8 +29,8 @@ void StartChildApp(shell::mojom::ShellClientRequest client_request); - scoped_ptr<shell::ShellClient> shell_client_; - scoped_ptr<shell::ShellConnection> shell_connection_; + std::unique_ptr<shell::ShellClient> shell_client_; + std::unique_ptr<shell::ShellConnection> shell_connection_; DISALLOW_COPY_AND_ASSIGN(MashRunner); };
diff --git a/chrome/app/resources/chromium_strings_am.xtb b/chrome/app/resources/chromium_strings_am.xtb index 095b5da..1935a15 100644 --- a/chrome/app/resources/chromium_strings_am.xtb +++ b/chrome/app/resources/chromium_strings_am.xtb
@@ -121,6 +121,7 @@ <translation id="549669000822060376">Chromium የቅርብ ጊዜዎቹ የስርዓቱ ዝማኔዎችን እስኪጭን ድረስ እባክዎ ይጠብቁ።</translation> <translation id="5563479599352954471">በአንዲ ንክኪ ይፈልጉ</translation> <translation id="5620765574781326016">ከገጹ ሳይወጡ በድር ጣቢያዎች ላይ ስላሉ ስለርዕሶች ይወቁ</translation> +<translation id="5634636535844844681">Chromium Windows 7 ወይም ከዚያ በላይ ያስፈልገዋል።</translation> <translation id="5680901439334282664">ወደ Chromium ይግቡ</translation> <translation id="5772805321386874569">(የChromium <ph name="BEGIN_BUTTON" />ዳግም መጀመር<ph name="END_BUTTON" /> ያስፈልገዋል)</translation> <translation id="5796460469508169315">Chromium ዝግጁ ሊሆን ትንሽ ቀርቶታል።</translation> @@ -208,6 +209,7 @@ <translation id="8586442755830160949">የቅጂ መብት <ph name="YEAR" /> የChromium ደራሲያን። ሁሉም መብቶች የተጠበቁ ናቸው።</translation> <translation id="8621669128220841554">ተለይቶ ባልታወቀ ስህተት ምክንያት ጭነት ከሽፏል። እባክዎ Chromiumን እንደገና ያውርዱ።</translation> <translation id="8628626585870903697">Chromium የህትመት ቅድመ እይታ እንዲሰራ የሚያስፈልገው የፒ ዲ ኤፍ ማያውን አያካትትም።</translation> +<translation id="8667808506758191620">የእርስዎ <ph name="DEVICE_TYPE" /> የተዘመነ ነው።</translation> <translation id="8697124171261953979">እንዲሁም Chromiumን ሲጀምሩት ወይም ከኦምኒቦክሱ ሆነው ሲፈልጉ የሚታየውን ገጽ ይቆጣጠራል።</translation> <translation id="8704119203788522458">ይሄ የእርስዎ Chromium ነው</translation> <translation id="872034308864968620">Chromium ጀርባ ላይ ያሂድ</translation>
diff --git a/chrome/app/resources/chromium_strings_ar.xtb b/chrome/app/resources/chromium_strings_ar.xtb index fd7e117e..ecace41 100644 --- a/chrome/app/resources/chromium_strings_ar.xtb +++ b/chrome/app/resources/chromium_strings_ar.xtb
@@ -119,6 +119,7 @@ <translation id="549669000822060376">الرجاء الانتظار أثناء تثبيت Chromium لآخر تحديثات النظام.</translation> <translation id="5563479599352954471">للبحث بلمسة واحدة</translation> <translation id="5620765574781326016">تعرّف على موضوعات على مواقع الويب دون مغادرة الصفحة.</translation> +<translation id="5634636535844844681">يتطلب Chromium نظام التشغيل Windows 7 أو إصدارًا أحدث.</translation> <translation id="5680901439334282664">تسجيل الدخول إلى Chromium</translation> <translation id="5772805321386874569">(<ph name="BEGIN_BUTTON" />إعادة تشغيل<ph name="END_BUTTON" /> Chromium مطلوبة)</translation> <translation id="5796460469508169315">Chromium جاهز تقريبًا.</translation> @@ -206,6 +207,7 @@ <translation id="8586442755830160949">حقوق الطبع والنشر لعام <ph name="YEAR" /> لصالح The Chromium Authors. جميع الحقوق محفوظة.</translation> <translation id="8621669128220841554">أخفق التثبيت نظرًا لحدوث خطأ غير محدد. الرجاء إعادة تنزيل Chromium.</translation> <translation id="8628626585870903697">لا يتضمن Chromium عارض PDF المطلوب لإجراء معاينة الطباعة.</translation> +<translation id="8667808506758191620">جهاز <ph name="DEVICE_TYPE" /> مُحدّث.</translation> <translation id="8697124171261953979">كما أنها تتحكم في الصفحة التي تظهر عند تشغيل Chromium أو إجراء بحث من المربع متعدد الاستخدامات.</translation> <translation id="8704119203788522458">هذا هو Chromium الخاص بك</translation> <translation id="872034308864968620">دع Chromium يعمل في الخلفية</translation>
diff --git a/chrome/app/resources/chromium_strings_bg.xtb b/chrome/app/resources/chromium_strings_bg.xtb index 4935a618..f73ce2d 100644 --- a/chrome/app/resources/chromium_strings_bg.xtb +++ b/chrome/app/resources/chromium_strings_bg.xtb
@@ -117,6 +117,7 @@ <translation id="549669000822060376">Моля, изчакайте, докато Chromium инсталира най-новите системни актуализации.</translation> <translation id="5563479599352954471">Търсене с едно докосване</translation> <translation id="5620765574781326016">Научете за темите в уебсайтовете, без да излизате от страницата.</translation> +<translation id="5634636535844844681">За Chromium се изисква Windows 7 или по-нова версия.</translation> <translation id="5680901439334282664">Влезте в Chromium</translation> <translation id="5772805321386874569">(изисква <ph name="BEGIN_BUTTON" />рестартиране<ph name="END_BUTTON" /> на Chromium)</translation> <translation id="5796460469508169315">Chromium е почти готов.</translation>
diff --git a/chrome/app/resources/chromium_strings_bn.xtb b/chrome/app/resources/chromium_strings_bn.xtb index 4926904..9eb136b 100644 --- a/chrome/app/resources/chromium_strings_bn.xtb +++ b/chrome/app/resources/chromium_strings_bn.xtb
@@ -119,6 +119,7 @@ <translation id="549669000822060376">Chromium যখন সিস্টেম আপডেটগুলিকে ইনস্টল করে তখন দয়া করে অপেক্ষা করুন৷</translation> <translation id="5563479599352954471">একবার স্পর্শ করে অনুসন্ধান</translation> <translation id="5620765574781326016">পৃষ্ঠা থেকে না বেরিয়েই ওয়েবসাইটের বিষয়বস্তুগুলি সম্বন্ধে জানুন৷</translation> +<translation id="5634636535844844681">Chromium এর জন্য Windows 7 বা উচ্চতর সংস্করণ প্রয়োজন।</translation> <translation id="5680901439334282664">Chromium এ সাইন ইন করুন</translation> <translation id="5772805321386874569">(Chromium <ph name="BEGIN_BUTTON" />পুনরায় চালু করা<ph name="END_BUTTON" /> প্রয়োজন)</translation> <translation id="5796460469508169315">Chromium প্রায় প্রস্তুত।</translation>
diff --git a/chrome/app/resources/chromium_strings_ca.xtb b/chrome/app/resources/chromium_strings_ca.xtb index f1cb25ab..3610d22 100644 --- a/chrome/app/resources/chromium_strings_ca.xtb +++ b/chrome/app/resources/chromium_strings_ca.xtb
@@ -119,6 +119,7 @@ <translation id="549669000822060376">Espereu mentre Chromium instal·la les darreres actualitzacions del sistema.</translation> <translation id="5563479599352954471">Cercar amb un toc</translation> <translation id="5620765574781326016">Consulteu més informació sobre els temes en altres llocs web sense sortir de la pàgina.</translation> +<translation id="5634636535844844681">Chromium requereix Windows 7 o una versió posterior.</translation> <translation id="5680901439334282664">Inicieu la sessió a Chromium</translation> <translation id="5772805321386874569">(cal <ph name="BEGIN_BUTTON" />reiniciar<ph name="END_BUTTON" /> Chromium)</translation> <translation id="5796460469508169315">Chromium ja està quasi llest.</translation>
diff --git a/chrome/app/resources/chromium_strings_cs.xtb b/chrome/app/resources/chromium_strings_cs.xtb index 19dbb686..0474e77 100644 --- a/chrome/app/resources/chromium_strings_cs.xtb +++ b/chrome/app/resources/chromium_strings_cs.xtb
@@ -121,6 +121,7 @@ <translation id="549669000822060376">Počkejte prosím, než Chromium nainstaluje nejnovější aktualizace systému.</translation> <translation id="5563479599352954471">Vyhledávání jedním klepnutím</translation> <translation id="5620765574781326016">Vyhledávejte informace o tématech zmíněných na stránce, aniž byste stránku museli opustit.</translation> +<translation id="5634636535844844681">Chromium vyžaduje systém Windows 7 nebo vyšší.</translation> <translation id="5680901439334282664">přihlaste se do prohlížeče Chromium</translation> <translation id="5772805321386874569">(vyžaduje <ph name="BEGIN_BUTTON" />restartování<ph name="END_BUTTON" /> prohlížeče Chromium)</translation> <translation id="5796460469508169315">Prohlížeč Chromium je téměř připraven.</translation>
diff --git a/chrome/app/resources/chromium_strings_da.xtb b/chrome/app/resources/chromium_strings_da.xtb index 62b05c8..c4b825e1 100644 --- a/chrome/app/resources/chromium_strings_da.xtb +++ b/chrome/app/resources/chromium_strings_da.xtb
@@ -119,6 +119,7 @@ <translation id="549669000822060376">Vent, mens Chromium installerer de nyeste systemopdateringer.</translation> <translation id="5563479599352954471">Søg med én berøring</translation> <translation id="5620765574781326016">Læs om emner på websites uden at forlade siden.</translation> +<translation id="5634636535844844681">Chromium kræver Windows 7 eller nyere.</translation> <translation id="5680901439334282664">log ind på Chromium</translation> <translation id="5772805321386874569">(kræver en <ph name="BEGIN_BUTTON" />genstart<ph name="END_BUTTON" /> af Chromium)</translation> <translation id="5796460469508169315">Chromium er næsten klar.</translation>
diff --git a/chrome/app/resources/chromium_strings_de.xtb b/chrome/app/resources/chromium_strings_de.xtb index 583a9ae72..1577479 100644 --- a/chrome/app/resources/chromium_strings_de.xtb +++ b/chrome/app/resources/chromium_strings_de.xtb
@@ -119,6 +119,7 @@ <translation id="549669000822060376">Bitte warten Sie, bis die aktuellen Systemupdates von Chromium installiert wurden.</translation> <translation id="5563479599352954471">Suchen durch einfaches Tippen</translation> <translation id="5620765574781326016">Erfahren Sie mehr über Website-Themen, ohne die Seite zu verlassen.</translation> +<translation id="5634636535844844681">Für Chromium ist Windows 7 oder höher erforderlich.</translation> <translation id="5680901439334282664">In Chromium anmelden</translation> <translation id="5772805321386874569">Ein <ph name="BEGIN_BUTTON" />Neustart<ph name="END_BUTTON" /> von Chromium ist erforderlich.</translation> <translation id="5796460469508169315">Chromium ist gleich bereit.</translation>
diff --git a/chrome/app/resources/chromium_strings_el.xtb b/chrome/app/resources/chromium_strings_el.xtb index f5ab4838..ace7769 100644 --- a/chrome/app/resources/chromium_strings_el.xtb +++ b/chrome/app/resources/chromium_strings_el.xtb
@@ -119,6 +119,7 @@ <translation id="549669000822060376">Περιμένετε μέχρι να γίνει εγκατάσταση των πιο πρόσφατων ενημερώσεων συστήματος από το Chromium.</translation> <translation id="5563479599352954471">Αναζήτηση με ένα μόνο άγγιγμα</translation> <translation id="5620765574781326016">Μάθετε πληροφορίες σχετικά με θέματα σε ιστότοπους, χωρίς να απομακρυνθείτε από τη σελίδα.</translation> +<translation id="5634636535844844681">Το Chromium απαιτεί Windows 7 ή νεότερη έκδοση.</translation> <translation id="5680901439334282664">σύνδεση στο Chromium</translation> <translation id="5772805321386874569">(απαιτείται <ph name="BEGIN_BUTTON" />επανεκκίνηση<ph name="END_BUTTON" /> του Chromium)</translation> <translation id="5796460469508169315">Το Chromium είναι σχεδόν έτοιμο.</translation>
diff --git a/chrome/app/resources/chromium_strings_en-GB.xtb b/chrome/app/resources/chromium_strings_en-GB.xtb index b1d73e26..af603484 100644 --- a/chrome/app/resources/chromium_strings_en-GB.xtb +++ b/chrome/app/resources/chromium_strings_en-GB.xtb
@@ -121,6 +121,7 @@ <translation id="549669000822060376">Please wait while Chromium installs the latest system updates.</translation> <translation id="5563479599352954471">Search with one touch</translation> <translation id="5620765574781326016">Learn about topics on websites without leaving the page.</translation> +<translation id="5634636535844844681">Chromium requires Windows 7 or higher.</translation> <translation id="5680901439334282664">sign in to Chromium</translation> <translation id="5772805321386874569">(requires Chromium <ph name="BEGIN_BUTTON" />restart<ph name="END_BUTTON" />)</translation> <translation id="5796460469508169315">Chromium is almost ready.</translation> @@ -208,6 +209,7 @@ <translation id="8586442755830160949">Copyright <ph name="YEAR" /> The Chromium Authors. All rights reserved.</translation> <translation id="8621669128220841554">Installation failed due to unspecified error. Please download Chromium again.</translation> <translation id="8628626585870903697">Chromium does not include the PDF viewer which is required for Print Preview to function.</translation> +<translation id="8667808506758191620">Your <ph name="DEVICE_TYPE" /> is up to date.</translation> <translation id="8697124171261953979">It also controls what page is shown when you start Chromium or search from the Omnibox.</translation> <translation id="8704119203788522458">This is your Chromium</translation> <translation id="872034308864968620">Let Chromium Run In The Background</translation>
diff --git a/chrome/app/resources/chromium_strings_es-419.xtb b/chrome/app/resources/chromium_strings_es-419.xtb index 4a58837..68d71e7 100644 --- a/chrome/app/resources/chromium_strings_es-419.xtb +++ b/chrome/app/resources/chromium_strings_es-419.xtb
@@ -117,6 +117,7 @@ <translation id="549669000822060376">Espera mientras Chromium instala las últimas actualizaciones del sistema.</translation> <translation id="5563479599352954471">Buscar con un toque</translation> <translation id="5620765574781326016">Obtén información sobre los temas en sitios web sin salir de la página.</translation> +<translation id="5634636535844844681">Para usar Chromium, se requiere Windows 7 o versiones superiores.</translation> <translation id="5680901439334282664">acceder a Chromium</translation> <translation id="5772805321386874569">(Es necesario <ph name="BEGIN_BUTTON" />reiniciar<ph name="END_BUTTON" /> Chromium).</translation> <translation id="5796460469508169315">Chromium está casi listo.</translation>
diff --git a/chrome/app/resources/chromium_strings_es.xtb b/chrome/app/resources/chromium_strings_es.xtb index 9680a82..ce47ed86 100644 --- a/chrome/app/resources/chromium_strings_es.xtb +++ b/chrome/app/resources/chromium_strings_es.xtb
@@ -121,6 +121,7 @@ <translation id="549669000822060376">Espera mientras Chromium instala las últimas actualizaciones del sistema.</translation> <translation id="5563479599352954471">Buscar con un toque</translation> <translation id="5620765574781326016">Obtén información sobre los temas en sitios web sin salir de la página.</translation> +<translation id="5634636535844844681">Chromium requiere Windows 7 o una versión posterior.</translation> <translation id="5680901439334282664">iniciar sesión en Chromium</translation> <translation id="5772805321386874569">(se debe <ph name="BEGIN_BUTTON" />reiniciar<ph name="END_BUTTON" /> Chromium)</translation> <translation id="5796460469508169315">Chromium está casi listo.</translation>
diff --git a/chrome/app/resources/chromium_strings_et.xtb b/chrome/app/resources/chromium_strings_et.xtb index 4915b13..faab231 100644 --- a/chrome/app/resources/chromium_strings_et.xtb +++ b/chrome/app/resources/chromium_strings_et.xtb
@@ -119,6 +119,7 @@ <translation id="549669000822060376">Oodake, kuni Chromium installib uusimad süsteemivärskendused.</translation> <translation id="5563479599352954471">Otsing ühe puudutusega</translation> <translation id="5620765574781326016">Lisateave veebisaitide teemade kohta ilma lehelt lahkumata.</translation> +<translation id="5634636535844844681">Chromium vajab operatsioonisüsteemi Windows 7 või uuemat versiooni.</translation> <translation id="5680901439334282664">logige Chromiumi sisse</translation> <translation id="5772805321386874569">(nõuab Chromiumi <ph name="BEGIN_BUTTON" />taaskäivitamist<ph name="END_BUTTON" />)</translation> <translation id="5796460469508169315">Chromium on peaaegu valmis.</translation>
diff --git a/chrome/app/resources/chromium_strings_fa.xtb b/chrome/app/resources/chromium_strings_fa.xtb index c560b2c..edabd36 100644 --- a/chrome/app/resources/chromium_strings_fa.xtb +++ b/chrome/app/resources/chromium_strings_fa.xtb
@@ -110,7 +110,7 @@ <translation id="4987820182225656817">مهمانها می توانند از Chromium استفاده کنند بدون اینکه اثری از خود به جا بگذارند.</translation> <translation id="4994636714258228724">افرودن خودتان به Chromium</translation> <translation id="5032989939245619637">ذخیره جزئیات در Chromium</translation> -<translation id="5116586539350239523">Chromium بهطور امن جزئیات شخصیتان را ذخیره خواهد کرد، بنابراین نیازی نیست دوباره آنها را تایپ کنید.</translation> +<translation id="5116586539350239523">Chromium بهطور امن جزئیات شخصیتان را ذخیره خواهد کرد تا نیازی نباشد آنها را دوباره تایپ کنید.</translation> <translation id="5358375970380395591">شما با حساب مدیریتشده وارد سیستم میشوید و به سرپرست آن اجازه کنترل بر نمایه Chromium خود را میدهید. دادههای Chromium شما شامل برنامهها، نشانکها، سابقه، گذرواژهها و سایر تنظیمات برای همیشه به <ph name="USER_NAME" /> مرتبط خواهد شد. میتوانید این دادهها را از طریق داشبورد حسابهای Google حذف کنید اما نمیتوانید این دادهها را به حساب دیگری مرتبط سازید. <ph name="LEARN_MORE" /></translation> <translation id="5398878173008909840">نسخه جدیدی از Chromium موجود است.</translation> <translation id="5427571867875391349">تنظیم Chromium به عنوان مرورگر پیشفرضتان</translation> @@ -118,6 +118,7 @@ <translation id="549669000822060376">وقتی Chromium جدیدترین بهروزرسانیهای سیستم را نصب میکند، لطفاً صبر کنید.</translation> <translation id="5563479599352954471">جستجو فقط با یک تماس</translation> <translation id="5620765574781326016">بدون اینکه صفحه را ترک کنید، درباره موضوعات در وبسایتها اطلاعاتی به دست آورید.</translation> +<translation id="5634636535844844681">Chromium به Windows 7 یا بالاتر نیاز دارد.</translation> <translation id="5680901439334282664">ورود به سیستم Chromium</translation> <translation id="5772805321386874569">(Chromium باید <ph name="BEGIN_BUTTON" />راهاندازی مجدد<ph name="END_BUTTON" /> شود)</translation> <translation id="5796460469508169315">Chromium تقریباً آماده است.</translation>
diff --git a/chrome/app/resources/chromium_strings_fi.xtb b/chrome/app/resources/chromium_strings_fi.xtb index fcf0575..8ddd600 100644 --- a/chrome/app/resources/chromium_strings_fi.xtb +++ b/chrome/app/resources/chromium_strings_fi.xtb
@@ -119,6 +119,7 @@ <translation id="549669000822060376">Odota hetki, Chromium asentaa uusimpia järjestelmäpäivityksiä.</translation> <translation id="5563479599352954471">Etsi yhdellä kosketuksella</translation> <translation id="5620765574781326016">Tutustu verkkosivuston aiheisiin poistumatta sivulta.</translation> +<translation id="5634636535844844681">Chromium vaatii Windows 7:n tai uudemman version.</translation> <translation id="5680901439334282664">Kirjaudu sisään Chromiumiin</translation> <translation id="5772805321386874569">(vaatii Chromiumin <ph name="BEGIN_BUTTON" />uudelleenkäynnistyksen<ph name="END_BUTTON" />)</translation> <translation id="5796460469508169315">Chromium on lähes valmis.</translation>
diff --git a/chrome/app/resources/chromium_strings_fil.xtb b/chrome/app/resources/chromium_strings_fil.xtb index 030a967..f720cdb 100644 --- a/chrome/app/resources/chromium_strings_fil.xtb +++ b/chrome/app/resources/chromium_strings_fil.xtb
@@ -121,6 +121,7 @@ <translation id="549669000822060376">Mangyaring maghintay habang ini-install ng Chromium ang mga pinakabagong update sa system.</translation> <translation id="5563479599352954471">Maghanap sa isang pagpindot lang</translation> <translation id="5620765574781326016">Matuto tungkol sa mga paksa sa mga website nang hindi umaalis sa page.</translation> +<translation id="5634636535844844681">Kailangan ng Chromium ng Windows 7 o mas bago.</translation> <translation id="5680901439334282664">mag-sign in sa Chromium</translation> <translation id="5772805321386874569">(kinakailangang <ph name="BEGIN_BUTTON" />i-restart<ph name="END_BUTTON" /> ang Chromium)</translation> <translation id="5796460469508169315">Halos handa na ang Chromium.</translation>
diff --git a/chrome/app/resources/chromium_strings_fr.xtb b/chrome/app/resources/chromium_strings_fr.xtb index e07aae3..863379c 100644 --- a/chrome/app/resources/chromium_strings_fr.xtb +++ b/chrome/app/resources/chromium_strings_fr.xtb
@@ -120,6 +120,7 @@ <translation id="549669000822060376">Veuillez patienter pendant que Chromium installe les dernières mises à jour du système.</translation> <translation id="5563479599352954471">Rechercher en un clic</translation> <translation id="5620765574781326016">Pour en savoir plus sur des sujets évoqués sur des sites Web sans quitter la page.</translation> +<translation id="5634636535844844681">Vous devez disposer de Windows 7 ou version ultérieure pour utiliser Chromium.</translation> <translation id="5680901439334282664">connectez-vous à Chromium</translation> <translation id="5772805321386874569">(nécessite le <ph name="BEGIN_BUTTON" />redémarrage<ph name="END_BUTTON" /> de Chromium)</translation> <translation id="5796460469508169315">Chromium est presque prêt</translation>
diff --git a/chrome/app/resources/chromium_strings_gu.xtb b/chrome/app/resources/chromium_strings_gu.xtb index 3128625..4463235e 100644 --- a/chrome/app/resources/chromium_strings_gu.xtb +++ b/chrome/app/resources/chromium_strings_gu.xtb
@@ -122,6 +122,7 @@ <translation id="549669000822060376">કૃપા કરીને Chromium, નવીનતમ સિસ્ટમ અપડેટ્સ ઇન્સ્ટોલ કરે ત્યાં સુધી રાહ જુઓ.</translation> <translation id="5563479599352954471">એક ટચ વડે શોધ કરો</translation> <translation id="5620765574781326016">પૃષ્ઠને છોડ્યાં વિના વેબસાઇટ્સ પરના મુદ્દાઓ વિશે જાણો.</translation> +<translation id="5634636535844844681">Chromium માટે Windows 7 અથવા તે પછીનું સંસ્કરણ આવશ્યક છે.</translation> <translation id="5680901439334282664">Chromium માં સાઇન ઇન કરો</translation> <translation id="5772805321386874569">(Chromium <ph name="BEGIN_BUTTON" />પુનઃપ્રારંભ કરવું<ph name="END_BUTTON" /> આવશ્યક છે)</translation> <translation id="5796460469508169315">Chromium લગભગ તૈયાર છે.</translation>
diff --git a/chrome/app/resources/chromium_strings_hi.xtb b/chrome/app/resources/chromium_strings_hi.xtb index 2d42ac2..fd6924f 100644 --- a/chrome/app/resources/chromium_strings_hi.xtb +++ b/chrome/app/resources/chromium_strings_hi.xtb
@@ -119,6 +119,7 @@ <translation id="549669000822060376">कृपया क्रोमियम द्वारा नवीनतम सिस्टम अपडेट इंस्टॉल करने के दौरान प्रतीक्षा करें.</translation> <translation id="5563479599352954471">एकल स्पर्श से खोजें</translation> <translation id="5620765574781326016">पृष्ठ को छोड़े बिना वेबसाइटों पर दिए गए विषयों के बारे में जानें.</translation> +<translation id="5634636535844844681">क्रोमियम के लिए Windows 7 या उसके बाद के वर्शन की आवश्यकता होती है.</translation> <translation id="5680901439334282664">क्रोमियम में प्रवेश करें</translation> <translation id="5772805321386874569">(क्रोमियम <ph name="BEGIN_BUTTON" />पुन: प्रारंभ<ph name="END_BUTTON" /> करना आवश्यक है)</translation> <translation id="5796460469508169315">क्रोमियम लगभग तैयार है.</translation>
diff --git a/chrome/app/resources/chromium_strings_hr.xtb b/chrome/app/resources/chromium_strings_hr.xtb index 6e2d3bc..9f9b812 100644 --- a/chrome/app/resources/chromium_strings_hr.xtb +++ b/chrome/app/resources/chromium_strings_hr.xtb
@@ -119,6 +119,7 @@ <translation id="549669000822060376">Pričekajte da Chromium instalira najnovija ažuriranja sustava.</translation> <translation id="5563479599352954471">Pretraživanje jednim dodirom</translation> <translation id="5620765574781326016">Ne morate napustiti stranicu da biste saznali koje su teme web-lokacija.</translation> +<translation id="5634636535844844681">Chromium zahtijeva Windows 7 ili noviju verziju.</translation> <translation id="5680901439334282664">prijavite se na Chromium</translation> <translation id="5772805321386874569">(potrebno je <ph name="BEGIN_BUTTON" />ponovo pokrenuti<ph name="END_BUTTON" /> Chromium)</translation> <translation id="5796460469508169315">Chromium će uskoro biti spreman.</translation>
diff --git a/chrome/app/resources/chromium_strings_hu.xtb b/chrome/app/resources/chromium_strings_hu.xtb index 67f67419..fe997b53 100644 --- a/chrome/app/resources/chromium_strings_hu.xtb +++ b/chrome/app/resources/chromium_strings_hu.xtb
@@ -119,6 +119,7 @@ <translation id="549669000822060376">Kérjük, várjon, amíg a Chromium telepíti a legutóbbi rendszerfrissítéseket.</translation> <translation id="5563479599352954471">Keresés egyetlen érintéssel</translation> <translation id="5620765574781326016">Tudjon meg többet a webhelyeken lévő egyes témákról anélkül, hogy elhagyná az adott oldalt.</translation> +<translation id="5634636535844844681">A Chromium futtatásához Windows 7 vagy újabb verzió szükséges.</translation> <translation id="5680901439334282664">bejelentkezés a Chromiumba</translation> <translation id="5772805321386874569">(a Chromium <ph name="BEGIN_BUTTON" />újraindítását<ph name="END_BUTTON" /> igényli)</translation> <translation id="5796460469508169315">A Chromium majdnem készen áll.</translation> @@ -204,6 +205,7 @@ <translation id="8586442755830160949">Copyright <ph name="YEAR" /> – A Chromium szerzői. Minden jog fenntartva.</translation> <translation id="8621669128220841554">A telepítés egy meg nem határozott hiba miatt nem sikerült. Kérjük, töltse le újra a Chromiumot.</translation> <translation id="8628626585870903697">A Chromium nem tartalmazza a PDF Viewer alkalmazást, amely a Nyomtatási előnézet működéséhez szükséges.</translation> +<translation id="8667808506758191620"><ph name="DEVICE_TYPE" /> eszköze naprakész.</translation> <translation id="8697124171261953979">Továbbá azt is szabályozza, hogy melyik oldal jelenik meg a Chromium indításakor vagy a cím- és keresősávban indított kereséskor.</translation> <translation id="8704119203788522458">Ez az Ön Chromiumja</translation> <translation id="872034308864968620">A Chromium fusson a háttérben</translation>
diff --git a/chrome/app/resources/chromium_strings_id.xtb b/chrome/app/resources/chromium_strings_id.xtb index f2fad0e..1de5f3e2 100644 --- a/chrome/app/resources/chromium_strings_id.xtb +++ b/chrome/app/resources/chromium_strings_id.xtb
@@ -111,7 +111,7 @@ <translation id="4987820182225656817">Tamu dapat menggunakan Chromium tanpa meninggalkan apa pun.</translation> <translation id="4994636714258228724">Tambahkan diri Anda ke Chromium</translation> <translation id="5032989939245619637">Simpan detail di Chromium</translation> -<translation id="5116586539350239523">Chromium akan meyimpan detail pribadi Anda secara aman sehingga Anda tidak perlu mengetiknya lagi.</translation> +<translation id="5116586539350239523">Chromium akan meyimpan informasi pribadi Anda dengan aman sehingga Anda tidak perlu mengetiknya lagi.</translation> <translation id="5358375970380395591">Anda masuk dengan akun yang dikelola dan memberikan administratornya kontrol atas profil Chromium Anda. Data Chromium Anda, seperti aplikasi, bookmark, riwayat, sandi, dan setelan lain selamanya akan dikaitkan ke <ph name="USER_NAME" />. Anda dapat menghapus data ini melalui Dasbor Akun Google, namun Anda tidak akan dapat mengaitkan data ini dengan akun yang lain. <ph name="LEARN_MORE" /></translation> <translation id="5398878173008909840">Tersedia Chromium versi baru.</translation> <translation id="5427571867875391349">Setel Chromium sebagai browser default</translation> @@ -119,6 +119,7 @@ <translation id="549669000822060376">Harap tunggu selagi Chromium memasang pembaruan sistem terkini.</translation> <translation id="5563479599352954471">Telusuri dengan satu sentuhan</translation> <translation id="5620765574781326016">Pelajari tentang topik di situs web tanpa meninggalkan laman.</translation> +<translation id="5634636535844844681">Chromium memerlukan Windows 7 atau lebih tinggi.</translation> <translation id="5680901439334282664">masuk ke Chromium</translation> <translation id="5772805321386874569">(Chromium perlu <ph name="BEGIN_BUTTON" />dimulai ulang<ph name="END_BUTTON" />)</translation> <translation id="5796460469508169315">Chromium hampir siap.</translation>
diff --git a/chrome/app/resources/chromium_strings_it.xtb b/chrome/app/resources/chromium_strings_it.xtb index 2e64d9f..27b4b6b 100644 --- a/chrome/app/resources/chromium_strings_it.xtb +++ b/chrome/app/resources/chromium_strings_it.xtb
@@ -119,6 +119,7 @@ <translation id="549669000822060376">Attendi mentre Chromium installa gli aggiornamenti di sistema più recenti.</translation> <translation id="5563479599352954471">Ricerca con un tocco</translation> <translation id="5620765574781326016">Leggi gli argomenti sui siti web senza uscire dalla pagina.</translation> +<translation id="5634636535844844681">Chromium richiede Windows 7 o versioni successive.</translation> <translation id="5680901439334282664">accedi a Chromium</translation> <translation id="5772805321386874569">(è necessario <ph name="BEGIN_BUTTON" />riavviare<ph name="END_BUTTON" /> Chromium)</translation> <translation id="5796460469508169315">Chromium è quasi pronto.</translation>
diff --git a/chrome/app/resources/chromium_strings_iw.xtb b/chrome/app/resources/chromium_strings_iw.xtb index fbe077c5..54e7ce9 100644 --- a/chrome/app/resources/chromium_strings_iw.xtb +++ b/chrome/app/resources/chromium_strings_iw.xtb
@@ -109,7 +109,7 @@ <translation id="4987820182225656817">אורחים יכולים להשתמש ב-Chromium בלי להשאיר דבר מאחור.</translation> <translation id="4994636714258228724">הוסף את עצמך ל-Chromium</translation> <translation id="5032989939245619637">שמור פרטים ב-Chromium</translation> -<translation id="5116586539350239523">Chromium יאחסן את הפרטים האישיים שלך באופן מאובטח כך שלא תידרש להקליד אותם שוב.</translation> +<translation id="5116586539350239523">Chromium יאחסן את הפרטים האישיים שלך באופן מאובטח כדי שלא תידרש להקליד אותם שוב.</translation> <translation id="5358375970380395591">אתה נכנס עם חשבון מנוהל ונותן למנהל המערכת שלו שליטה על הפרופיל שלך ב-Chromium. הנתונים שלך ב-Chromium, כגון יישומים, סימניות, היסטוריה, סיסמאות והגדרות אחרות ייקשרו באופן קבוע ל-<ph name="USER_NAME" />. תוכל למחוק את הנתונים האלה באמצעות לוח הבקרה של חשבונות Google, אבל לא תוכל לשייך את הנתונים האלה לחשבון אחר. <ph name="LEARN_MORE" /></translation> <translation id="5398878173008909840">גרסה חדשה של Chromium זמינה כעת.</translation> <translation id="5427571867875391349">הגדר את Chromium כדפדפן ברירת המחדל שלך</translation> @@ -117,6 +117,7 @@ <translation id="549669000822060376">המתן בזמן ש-Chromium מתקין את עדכוני המערכת האחרונים.</translation> <translation id="5563479599352954471">חיפוש בנגיעה אחת</translation> <translation id="5620765574781326016">קרא מידע על נושאים באתרים בלי לעזוב את הדף.</translation> +<translation id="5634636535844844681">כדי להשתמש ב-Chromium יש צורך ב-Windows מגירסה 7 ואילך.</translation> <translation id="5680901439334282664">היכנס אל Chromium</translation> <translation id="5772805321386874569">(נדרש <ph name="BEGIN_BUTTON" />אתחול<ph name="END_BUTTON" /> של Chromium)</translation> <translation id="5796460469508169315">Chromium כמעט מוכן.</translation> @@ -204,6 +205,7 @@ <translation id="8586442755830160949">Copyright <ph name="YEAR" /> The Chromium Authors. כל הזכויות שמורות.</translation> <translation id="8621669128220841554">ההתקנה נכשלה בשל שגיאה לא מזוהה. הורד שוב את Chromium.</translation> <translation id="8628626585870903697">Chromium אינו כולל מציג PDF, הנדרש להפעלת תצוגה מקדימה של הדפסה.</translation> +<translation id="8667808506758191620">ה-<ph name="DEVICE_TYPE" /> שלך מעודכן.</translation> <translation id="8697124171261953979">הגדרה זו גם קובעת איזה דף מוצג כשאתה מפעיל את Chromium או מבצע חיפוש מסרגל הכתובות.</translation> <translation id="8704119203788522458">זהו ה-Chromium שלך</translation> <translation id="872034308864968620">אפשר ל-Chromium לפעול ברקע</translation>
diff --git a/chrome/app/resources/chromium_strings_ja.xtb b/chrome/app/resources/chromium_strings_ja.xtb index 4f1d2a5..36d8342 100644 --- a/chrome/app/resources/chromium_strings_ja.xtb +++ b/chrome/app/resources/chromium_strings_ja.xtb
@@ -119,6 +119,7 @@ <translation id="549669000822060376">Chromium は最新のシステム アップデートをインストールしています。しばらくお待ちください。</translation> <translation id="5563479599352954471">ワンタップで検索</translation> <translation id="5620765574781326016">ウェブサイト上のトピックについて、ページを移動せずに調べることができます。</translation> +<translation id="5634636535844844681">Chromium のご利用には Windows 7 以上が必要です。</translation> <translation id="5680901439334282664">Chromium にログイン</translation> <translation id="5772805321386874569">(Chromium を<ph name="BEGIN_BUTTON" />再起動<ph name="END_BUTTON" />する必要があります)</translation> <translation id="5796460469508169315">もうすぐ Chromium を使用できます。</translation>
diff --git a/chrome/app/resources/chromium_strings_kn.xtb b/chrome/app/resources/chromium_strings_kn.xtb index 0a877379..1f6914e0 100644 --- a/chrome/app/resources/chromium_strings_kn.xtb +++ b/chrome/app/resources/chromium_strings_kn.xtb
@@ -117,6 +117,7 @@ <translation id="549669000822060376">ದಯವಿಟ್ಟು ಇತ್ತೀಚಿನ ಸಿಸ್ಟಂ ನವೀಕರಣಗಳನ್ನು Chromium ಸ್ಥಾಪಿಸುವಾಗ ಕಾಯಿರಿ.</translation> <translation id="5563479599352954471">ಒಂದು ಸ್ಪರ್ಶದಲ್ಲಿ ಹುಡುಕಿ</translation> <translation id="5620765574781326016">ಪುಟವನ್ನು ಉಳಿಸದೆ ವೆಬ್ಸೈಟ್ಗಳಲ್ಲಿ ವಿಷಯಗಳ ಕುರಿತು ತಿಳಿಯಿರಿ.</translation> +<translation id="5634636535844844681">Chromium ಗೆ Windows 7 ಅಥವಾ ಆವೃತ್ತಿಯ ಅಗತ್ಯವಿರುತ್ತದೆ.</translation> <translation id="5680901439334282664">Chromium ಗೆ ಸೈನ್ ಇನ್ ಆಗಿ</translation> <translation id="5772805321386874569">(Chromium <ph name="BEGIN_BUTTON" />ಮರುಪ್ರಾರಂಭ<ph name="END_BUTTON" /> ಅಗತ್ಯವಿದೆ)</translation> <translation id="5796460469508169315">Chromium ಬಹುತೇಕ ಸಿದ್ಧಗೊಂಡಿದೆ.</translation>
diff --git a/chrome/app/resources/chromium_strings_ko.xtb b/chrome/app/resources/chromium_strings_ko.xtb index 76794c4..51e8f5bd 100644 --- a/chrome/app/resources/chromium_strings_ko.xtb +++ b/chrome/app/resources/chromium_strings_ko.xtb
@@ -121,6 +121,7 @@ <translation id="549669000822060376">Chromium에서 최신 시스템 업데이트를 설치하는 동안 잠시 기다려 주세요.</translation> <translation id="5563479599352954471">터치 한 번으로 검색</translation> <translation id="5620765574781326016">페이지를 나가지 않고 웹사이트에서 주제에 대해 자세히 알아보기</translation> +<translation id="5634636535844844681">Chromium은 Windows 7 이상에서 사용할 수 있습니다.</translation> <translation id="5680901439334282664">Chromium에 로그인</translation> <translation id="5772805321386874569">(Chromium을 <ph name="BEGIN_BUTTON" />다시 시작<ph name="END_BUTTON" />해야 함)</translation> <translation id="5796460469508169315">Chromium 준비가 거의 완료되었습니다.</translation>
diff --git a/chrome/app/resources/chromium_strings_lt.xtb b/chrome/app/resources/chromium_strings_lt.xtb index 64c9932..87cdb23 100644 --- a/chrome/app/resources/chromium_strings_lt.xtb +++ b/chrome/app/resources/chromium_strings_lt.xtb
@@ -121,6 +121,7 @@ <translation id="549669000822060376">Palaukite, kol „Chromium“ įdiegs naujausius sistemos naujinius.</translation> <translation id="5563479599352954471">Paieška vienu palietimu</translation> <translation id="5620765574781326016">Sužinokite apie temas svetainėse neišėję iš puslapio.</translation> +<translation id="5634636535844844681">Kad būtų galima naudoti „Chromium“, reikalinga 7 ar naujesnės versijos „Windows“.</translation> <translation id="5680901439334282664">prisijunkite prie „Chromium“</translation> <translation id="5772805321386874569">(„Chromium“ būtina <ph name="BEGIN_BUTTON" />paleisti iš naujo<ph name="END_BUTTON" />)</translation> <translation id="5796460469508169315">„Chromium“ beveik paruošta.</translation>
diff --git a/chrome/app/resources/chromium_strings_lv.xtb b/chrome/app/resources/chromium_strings_lv.xtb index 995603d8..fe88c09 100644 --- a/chrome/app/resources/chromium_strings_lv.xtb +++ b/chrome/app/resources/chromium_strings_lv.xtb
@@ -119,6 +119,7 @@ <translation id="549669000822060376">Lūdzu, uzgaidiet, kamēr Chromium instalē jaunākos sistēmas atjauninājumus.</translation> <translation id="5563479599352954471">Meklējiet ar vienu pieskārienu</translation> <translation id="5620765574781326016">Uzziniet vairāk par vietnēs aprakstītajām tēmām, neaizverot lapu.</translation> +<translation id="5634636535844844681">Pārlūka Chromium izmantošanai nepieciešama operētājsistēma Windows 7 vai jaunāka versija.</translation> <translation id="5680901439334282664">pierakstieties pārlūkā Chromium</translation> <translation id="5772805321386874569">(ir <ph name="BEGIN_BUTTON" />jārestartē<ph name="END_BUTTON" /> operētājsistēma Chromium)</translation> <translation id="5796460469508169315">Chromium ir gandrīz gatavs!</translation>
diff --git a/chrome/app/resources/chromium_strings_ml.xtb b/chrome/app/resources/chromium_strings_ml.xtb index 5399807..967f1f6c 100644 --- a/chrome/app/resources/chromium_strings_ml.xtb +++ b/chrome/app/resources/chromium_strings_ml.xtb
@@ -122,6 +122,7 @@ <translation id="549669000822060376">Chromium ഏറ്റവും പുതിയ സിസ്റ്റം അപ്ഡേറ്റുകൾ ഇൻസ്റ്റാളുചെയ്യുന്നതുവരെ കാത്തിരിക്കുക.</translation> <translation id="5563479599352954471">ഒരു സ്പർശനത്തിലൂടെ തിരയുക</translation> <translation id="5620765574781326016">പേജ് വിട്ടുപോകാതെ തന്നെ വെബ്സൈറ്റുകളിലെ വിഷയങ്ങളെക്കുറിച്ച് അറിയുക.</translation> +<translation id="5634636535844844681">Chromium-ത്തിന് Windows 7 അല്ലെങ്കിൽ അതിനുശേഷമുള്ള പതിപ്പ് ആവശ്യമാണ്.</translation> <translation id="5680901439334282664">Chromium-ത്തിലേക്ക് സൈൻ ഇൻ ചെയ്യുക</translation> <translation id="5772805321386874569">( Chromium <ph name="BEGIN_BUTTON" />പുനരാരംഭിക്കൽ<ph name="END_BUTTON" /> ആവശ്യമാണ്)</translation> <translation id="5796460469508169315">Chromium ഏകദേശം തയാറായിക്കഴിഞ്ഞു.</translation>
diff --git a/chrome/app/resources/chromium_strings_mr.xtb b/chrome/app/resources/chromium_strings_mr.xtb index 7fc98e1..b9184d12 100644 --- a/chrome/app/resources/chromium_strings_mr.xtb +++ b/chrome/app/resources/chromium_strings_mr.xtb
@@ -120,6 +120,7 @@ <translation id="549669000822060376">कृपया Chromium नवीनतम सिस्टीम अद्यतने स्थापित करेपर्यंत प्रतीक्षा करा.</translation> <translation id="5563479599352954471">एका स्पर्शाने शोधा</translation> <translation id="5620765574781326016">पृष्ठ न सोडता वेबसाइटवरील विषयांबद्दल जाणून घ्या.</translation> +<translation id="5634636535844844681">Chromium साठी Windows 7 किंवा त्यानंतरची आवृत्ती आवश्यक आहे.</translation> <translation id="5680901439334282664">Chromium वर साइन इन करा</translation> <translation id="5772805321386874569">(Chromium <ph name="BEGIN_BUTTON" />रीस्टार्ट<ph name="END_BUTTON" /> करणे आवश्यक)</translation> <translation id="5796460469508169315">Chromium जवळजवळ सज्ज आहे</translation>
diff --git a/chrome/app/resources/chromium_strings_ms.xtb b/chrome/app/resources/chromium_strings_ms.xtb index 24957d1..ceb1d33 100644 --- a/chrome/app/resources/chromium_strings_ms.xtb +++ b/chrome/app/resources/chromium_strings_ms.xtb
@@ -119,6 +119,7 @@ <translation id="549669000822060376">Sila tunggu sementara Chromium memasang kemas kini sistem terkini.</translation> <translation id="5563479599352954471">Carian dengan satu sentuhan</translation> <translation id="5620765574781326016">Ketahui tentang topik di tapak web tanpa meninggalkan halaman.</translation> +<translation id="5634636535844844681">Chromium memerlukan Windows 7 atau lebih tinggi.</translation> <translation id="5680901439334282664">log masuk ke Chromium</translation> <translation id="5772805321386874569">(memerlukan Chromium <ph name="BEGIN_BUTTON" />dimulakan semula<ph name="END_BUTTON" />)</translation> <translation id="5796460469508169315">Chromium hampir sedia.</translation> @@ -206,6 +207,7 @@ <translation id="8586442755830160949">Hak Cipta <ph name="YEAR" /> Pengarang Chromium. Hak cipta terpelihara.</translation> <translation id="8621669128220841554">Pemasangan gagal disebabkan ralat yang tidak dinyatakan. Sila muat turun semula Chromium.</translation> <translation id="8628626585870903697">Chromium tidak menyertakan pemapar PDF yang diperlukan oleh Pratonton Cetakan untuk berfungsi.</translation> +<translation id="8667808506758191620"><ph name="DEVICE_TYPE" /> anda sudah dikemas kini.</translation> <translation id="8697124171261953979">Sambungan turut mengawal halaman yang ditunjukkan apabila anda memulakan Chromium atau membuat carian dari Kotak Omni.</translation> <translation id="8704119203788522458">Ini Chromium anda</translation> <translation id="872034308864968620">Benarkan Chromium Dijalankan dalam Latar Belakang</translation>
diff --git a/chrome/app/resources/chromium_strings_nl.xtb b/chrome/app/resources/chromium_strings_nl.xtb index 59713d8..390701a84 100644 --- a/chrome/app/resources/chromium_strings_nl.xtb +++ b/chrome/app/resources/chromium_strings_nl.xtb
@@ -121,6 +121,7 @@ <translation id="549669000822060376">Wacht terwijl Chromium de nieuwste systeemupdates installeert.</translation> <translation id="5563479599352954471">Zoeken met een aanraking</translation> <translation id="5620765574781326016">Bekijk informatie over onderwerpen op websites zonder de pagina te verlaten.</translation> +<translation id="5634636535844844681">Voor Chromium is Windows 7 of hoger vereist.</translation> <translation id="5680901439334282664">inloggen bij Chromium</translation> <translation id="5772805321386874569">(je moet Chromium <ph name="BEGIN_BUTTON" />opnieuw starten<ph name="END_BUTTON" />)</translation> <translation id="5796460469508169315">Chromium is bijna klaar.</translation>
diff --git a/chrome/app/resources/chromium_strings_no.xtb b/chrome/app/resources/chromium_strings_no.xtb index 0ad7c8d9..0cec06e 100644 --- a/chrome/app/resources/chromium_strings_no.xtb +++ b/chrome/app/resources/chromium_strings_no.xtb
@@ -119,6 +119,7 @@ <translation id="549669000822060376">Vent mens Chromium installerer de nyeste systemoppdateringene.</translation> <translation id="5563479599352954471">Søk med ett trykk</translation> <translation id="5620765574781326016">Finn ut mer om emner på nettsteder uten å forlate siden.</translation> +<translation id="5634636535844844681">Chromium krever Windows 7 eller nyere.</translation> <translation id="5680901439334282664">logg på Chromium</translation> <translation id="5772805321386874569">(krever at Chromium <ph name="BEGIN_BUTTON" />startes på nytt<ph name="END_BUTTON" />)</translation> <translation id="5796460469508169315">Chromium er nesten klar.</translation>
diff --git a/chrome/app/resources/chromium_strings_pl.xtb b/chrome/app/resources/chromium_strings_pl.xtb index ac2b5fe..9a6665b 100644 --- a/chrome/app/resources/chromium_strings_pl.xtb +++ b/chrome/app/resources/chromium_strings_pl.xtb
@@ -117,6 +117,7 @@ <translation id="549669000822060376">Poczekaj, aż Chromium zainstaluje najnowsze aktualizacje systemu.</translation> <translation id="5563479599352954471">Szukaj jednym kliknięciem</translation> <translation id="5620765574781326016">Poznaj tematy omawiane w witrynach, nie opuszczając strony.</translation> +<translation id="5634636535844844681">Chromium wymaga systemu Windows 7 lub nowszego.</translation> <translation id="5680901439334282664">zaloguj się w Chromium</translation> <translation id="5772805321386874569">(wymaga <ph name="BEGIN_BUTTON" />ponownego uruchomienia<ph name="END_BUTTON" /> Chromium)</translation> <translation id="5796460469508169315">Chromium jest prawie gotowy.</translation>
diff --git a/chrome/app/resources/chromium_strings_pt-BR.xtb b/chrome/app/resources/chromium_strings_pt-BR.xtb index f03213d..3bc4cd5 100644 --- a/chrome/app/resources/chromium_strings_pt-BR.xtb +++ b/chrome/app/resources/chromium_strings_pt-BR.xtb
@@ -117,6 +117,7 @@ <translation id="549669000822060376">Aguarde enquanto o Chromium instala as últimas atualizações do sistema.</translation> <translation id="5563479599352954471">Pesquisar com um toque</translation> <translation id="5620765574781326016">Saiba mais sobre tópicos em websites sem sair da página.</translation> +<translation id="5634636535844844681">O Chromium requer o Windows 7 ou versão superior.</translation> <translation id="5680901439334282664">fazer login no Chromium</translation> <translation id="5772805321386874569">(requer a <ph name="BEGIN_BUTTON" />reinicialização<ph name="END_BUTTON" /> do Chromium)</translation> <translation id="5796460469508169315">O Chromium está quase pronto.</translation> @@ -200,6 +201,7 @@ <translation id="8586442755830160949">Copyright <ph name="YEAR" /> Autores do Chromium. Todos os direitos reservados.</translation> <translation id="8621669128220841554">Falha na instalação devido a um erro não especificado. Faça o download do Chromium novamente.</translation> <translation id="8628626585870903697">O Chromium não inclui o visualizador de PDF que é necessário para que a visualização de impressão funcione.</translation> +<translation id="8667808506758191620">Seu dispositivo <ph name="DEVICE_TYPE" /> está atualizado.</translation> <translation id="8697124171261953979">Controla também qual página deve ser exibida quando você inicia o Chromium ou faz uma pesquisa na Omnibox.</translation> <translation id="8704119203788522458">Este é seu Chromium</translation> <translation id="872034308864968620">Permitir que o Chromium seja executado em segundo plano</translation>
diff --git a/chrome/app/resources/chromium_strings_pt-PT.xtb b/chrome/app/resources/chromium_strings_pt-PT.xtb index 363c3c2..598c3df 100644 --- a/chrome/app/resources/chromium_strings_pt-PT.xtb +++ b/chrome/app/resources/chromium_strings_pt-PT.xtb
@@ -119,6 +119,7 @@ <translation id="549669000822060376">Aguarde até que o Chromium instale as atualizações do sistema mais recentes.</translation> <translation id="5563479599352954471">Pesquisar com um toque</translation> <translation id="5620765574781326016">Saiba mais acerca de tópicos em Websites sem sair da página.</translation> +<translation id="5634636535844844681">O Chromium requer o Windows 7 ou superior.</translation> <translation id="5680901439334282664">inicie sessão no Chromium</translation> <translation id="5772805321386874569">(é necessário <ph name="BEGIN_BUTTON" />reiniciar<ph name="END_BUTTON" /> o Chromium)</translation> <translation id="5796460469508169315">O Chromium está quase pronto.</translation> @@ -206,6 +207,7 @@ <translation id="8586442755830160949">Copyright <ph name="YEAR" /> Os autores do Chromium. Todos os direitos reservados.</translation> <translation id="8621669128220841554">A instalação falhou devido a um erro não especificado. Transfira novamente o Chromium .</translation> <translation id="8628626585870903697">O Chromium não inclui o visualizador de PDF que é necessário para que a Pré-visualização da Impressão funcione.</translation> +<translation id="8667808506758191620">O seu <ph name="DEVICE_TYPE" /> está atualizado.</translation> <translation id="8697124171261953979">Também controla a página apresentada quando inicia o Chromium ou pesquisa a partir da Caixa geral.</translation> <translation id="8704119203788522458">Este é o seu Chromium</translation> <translation id="872034308864968620">Permitir que o Chromium Seja Executado em Segundo Plano</translation>
diff --git a/chrome/app/resources/chromium_strings_ro.xtb b/chrome/app/resources/chromium_strings_ro.xtb index 48a4cbb..d51ea1a 100644 --- a/chrome/app/resources/chromium_strings_ro.xtb +++ b/chrome/app/resources/chromium_strings_ro.xtb
@@ -119,6 +119,7 @@ <translation id="549669000822060376">Așteaptă până când Chromium instalează cele mai recente actualizări de sistem.</translation> <translation id="5563479599352954471">Caută cu o atingere</translation> <translation id="5620765574781326016">Află despre subiectele de pe site-uri fără să părăsești pagina.</translation> +<translation id="5634636535844844681">Chromium necesită Windows 7 sau o versiune ulterioară.</translation> <translation id="5680901439334282664">conectează-te la Chromium</translation> <translation id="5772805321386874569">(necesită <ph name="BEGIN_BUTTON" />repornirea<ph name="END_BUTTON" /> Chromium)</translation> <translation id="5796460469508169315">Chromium este aproape configurat.</translation>
diff --git a/chrome/app/resources/chromium_strings_ru.xtb b/chrome/app/resources/chromium_strings_ru.xtb index bcb34eb..053f8032 100644 --- a/chrome/app/resources/chromium_strings_ru.xtb +++ b/chrome/app/resources/chromium_strings_ru.xtb
@@ -117,6 +117,7 @@ <translation id="549669000822060376">Подождите, пока Chromium устанавливает последние обновления системы</translation> <translation id="5563479599352954471">Поиск в одно касание</translation> <translation id="5620765574781326016">Теперь искать информацию в Интернете можно с любой страницы.</translation> +<translation id="5634636535844844681">Для работы Chromium необходима ОС Windows 7 или более поздней версии.</translation> <translation id="5680901439334282664">войдите в Chromium</translation> <translation id="5772805321386874569">(необходимо <ph name="BEGIN_BUTTON" />перезапустить<ph name="END_BUTTON" /> Chromium)</translation> <translation id="5796460469508169315">Chromium почти готов к работе</translation> @@ -202,6 +203,7 @@ <translation id="8586442755830160949">© The Chromium Authors, <ph name="YEAR" /> . Все права защищены.</translation> <translation id="8621669128220841554">В процессе установки произошла неизвестная ошибка. Скачайте Chromium ещё раз.</translation> <translation id="8628626585870903697">В Chromium нет функции просмотра PDF-файлов, которая нужна для предварительного просмотра при печати.</translation> +<translation id="8667808506758191620">На устройстве <ph name="DEVICE_TYPE" /> используется последняя версия Chromium OS.</translation> <translation id="8697124171261953979">Кроме того, расширение изменило стартовую страницу Chromium и поисковую систему, используемую по умолчанию при вводе запроса в омнибокс.</translation> <translation id="8704119203788522458">Ваш персональный Chromium</translation> <translation id="872034308864968620">Разрешить Chromium работать в фоновом режиме</translation>
diff --git a/chrome/app/resources/chromium_strings_sk.xtb b/chrome/app/resources/chromium_strings_sk.xtb index a486510..1865ba0 100644 --- a/chrome/app/resources/chromium_strings_sk.xtb +++ b/chrome/app/resources/chromium_strings_sk.xtb
@@ -121,6 +121,7 @@ <translation id="549669000822060376">Počkajte, kým Chromium nainštaluje najnovšie aktualizácie systému.</translation> <translation id="5563479599352954471">Vyhľadávanie jediným klepnutím</translation> <translation id="5620765574781326016">Získajte informácie o témach zmienených na stránke bez toho, aby ste danú stránku museli opustiť.</translation> +<translation id="5634636535844844681">Chromium vyžaduje systém Windows 7 alebo vyšší.</translation> <translation id="5680901439334282664">prihláste sa do prehliadača Chromium</translation> <translation id="5772805321386874569">(vyžaduje <ph name="BEGIN_BUTTON" />reštartovanie<ph name="END_BUTTON" /> prehliadača Chromium)</translation> <translation id="5796460469508169315">Prehliadač Chromium je takmer pripravený</translation> @@ -208,6 +209,7 @@ <translation id="8586442755830160949">Copyright <ph name="YEAR" /> Autori Chromium. Všetky práva vyhradené.</translation> <translation id="8621669128220841554">Inštalácia zlyhala kvôli neznámej chybe. Skúste prehliadač Chromium stiahnuť znova.</translation> <translation id="8628626585870903697">Prehliadač Chromium neobsahuje nástroj na zobrazovanie súborov PDF, ktorý je potrebný pre funkciu Ukážka pred tlačou.</translation> +<translation id="8667808506758191620">Vaše zariadenie <ph name="DEVICE_TYPE" /> je aktuálne.</translation> <translation id="8697124171261953979">Tiež určuje, ktorá stránka sa zobrazí pri spustení prehliadača Chromium alebo pri vyhľadávaní pomocou všeobecného poľa.</translation> <translation id="8704119203788522458">Toto je váš prehliadač Chromium</translation> <translation id="872034308864968620">Povoliť prehliadaču Chromium spustenie na pozadí</translation>
diff --git a/chrome/app/resources/chromium_strings_sl.xtb b/chrome/app/resources/chromium_strings_sl.xtb index c5099ac1..f074ef4 100644 --- a/chrome/app/resources/chromium_strings_sl.xtb +++ b/chrome/app/resources/chromium_strings_sl.xtb
@@ -121,6 +121,7 @@ <translation id="549669000822060376">Počakajte, da Chromium namesti najnovejše sistemske posodobitve.</translation> <translation id="5563479599352954471">Iskanje z enim dotikom</translation> <translation id="5620765574781326016">Preberite več o temah na spletnih mestih, ne da bi vam bilo treba zapustiti stran.</translation> +<translation id="5634636535844844681">Chromium zahteva operacijski sistem Windows 7 ali novejši.</translation> <translation id="5680901439334282664">se prijavite v Chromium</translation> <translation id="5772805321386874569">(zahteva <ph name="BEGIN_BUTTON" />vnovični zagon<ph name="END_BUTTON" /> Chromiuma)</translation> <translation id="5796460469508169315">Chromium je skoraj pripravljen.</translation>
diff --git a/chrome/app/resources/chromium_strings_sr.xtb b/chrome/app/resources/chromium_strings_sr.xtb index 2870bb8..162645b6 100644 --- a/chrome/app/resources/chromium_strings_sr.xtb +++ b/chrome/app/resources/chromium_strings_sr.xtb
@@ -121,6 +121,7 @@ <translation id="549669000822060376">Сачекајте да Chromium инсталира најновија ажурирања система.</translation> <translation id="5563479599352954471">Претражујте једним додиром</translation> <translation id="5620765574781326016">Сазнајте више о темама на веб-сајтовима без напуштања странице.</translation> +<translation id="5634636535844844681">За Chromium је потребан Windows 7 или новија верзија.</translation> <translation id="5680901439334282664">пријавите се на Chromium</translation> <translation id="5772805321386874569">(захтева <ph name="BEGIN_BUTTON" />поновно покретање<ph name="END_BUTTON" /> Chromium-а)</translation> <translation id="5796460469508169315">Chromium је скоро спреман.</translation>
diff --git a/chrome/app/resources/chromium_strings_sv.xtb b/chrome/app/resources/chromium_strings_sv.xtb index be0d654..fd2ee02b 100644 --- a/chrome/app/resources/chromium_strings_sv.xtb +++ b/chrome/app/resources/chromium_strings_sv.xtb
@@ -121,6 +121,7 @@ <translation id="549669000822060376">Vänta medan de senaste systemuppdateringarna installeras av Chromium.</translation> <translation id="5563479599352954471">Sök med en tryckning</translation> <translation id="5620765574781326016">Läs mer om vilka ämnen som webbplatser handlar om utan att lämna sidan.</translation> +<translation id="5634636535844844681">För Chromium krävs Windows 7 eller senare.</translation> <translation id="5680901439334282664">Logga in i Chromium</translation> <translation id="5772805321386874569">(Chromium måste <ph name="BEGIN_BUTTON" />startas om<ph name="END_BUTTON" />)</translation> <translation id="5796460469508169315">Chromium är nästan klart.</translation>
diff --git a/chrome/app/resources/chromium_strings_sw.xtb b/chrome/app/resources/chromium_strings_sw.xtb index 0d9bca4..530d5b8 100644 --- a/chrome/app/resources/chromium_strings_sw.xtb +++ b/chrome/app/resources/chromium_strings_sw.xtb
@@ -121,6 +121,7 @@ <translation id="549669000822060376">Tafadhali subiri Chromium inaposakinisha sasisho mpya ya mfumo.</translation> <translation id="5563479599352954471">Tafuta kwa mguso mmoja tu</translation> <translation id="5620765574781326016">Pata maelezo kuhusu mada zilizo kwenye tovuti bila kuondoka kwenye ukurasa.</translation> +<translation id="5634636535844844681">Chromium inahitaji Windows 7 au toleo jipya zaidi.</translation> <translation id="5680901439334282664">ingia katika Chromium</translation> <translation id="5772805321386874569">(inahitaji uanzishaji upya wa <ph name="BEGIN_BUTTON" />Chromium<ph name="END_BUTTON" />)</translation> <translation id="5796460469508169315">Chromium inakaribia kuwa tayari.</translation> @@ -208,6 +209,7 @@ <translation id="8586442755830160949">Hakimiliki <ph name="YEAR" /> Wasanidi wa Chromium. Haki zote zimehifadhiwa.</translation> <translation id="8621669128220841554">Usakinishaji ulishindwa kwa sababu ya hitilafu isiyobainika. Tafadhali pakua Chromium tena.</translation> <translation id="8628626585870903697">Chromium haijumuishi kitazamaji cha PDF kinachohitajika ili Uhakiki wa Uchapishaji ufanye kazi.</translation> +<translation id="8667808506758191620">Kifaa chako cha <ph name="DEVICE_TYPE" /> kimesasishwa.</translation> <translation id="8697124171261953979">Pia inadhibiti ukurasa unaoonyeshwa unapoanzisha Chromium au unapotafuta kutoka Sanduku Kuu.</translation> <translation id="8704119203788522458">Hii ni Chromium yako</translation> <translation id="872034308864968620">Acha Chromium Iendelee Katika Madnarinyuma</translation>
diff --git a/chrome/app/resources/chromium_strings_ta.xtb b/chrome/app/resources/chromium_strings_ta.xtb index f2760df..179a0ad 100644 --- a/chrome/app/resources/chromium_strings_ta.xtb +++ b/chrome/app/resources/chromium_strings_ta.xtb
@@ -119,6 +119,7 @@ <translation id="549669000822060376">சமீபத்திய முறைமை புதுப்பிப்புகளை Chromium நிறுவும் வரை காத்திருக்கவும்.</translation> <translation id="5563479599352954471">ஒரே தொடுதலில் தேடவும்</translation> <translation id="5620765574781326016">பக்கத்தை விட்டு வெளியேறாமலே, இணையதளங்களில் தலைப்புகளைப் பற்றி அறியலாம்.</translation> +<translation id="5634636535844844681">Windows 7 அல்லது அதற்குப் பிந்தைய பதிப்புகளில் மட்டுமே Chromium இயங்கும்.</translation> <translation id="5680901439334282664">Chromium இல் உள்நுழைக</translation> <translation id="5772805321386874569">(Chromium ஐ <ph name="BEGIN_BUTTON" />மறுதொடக்கம்<ph name="END_BUTTON" /> செய்வது அவசியமாகும்)</translation> <translation id="5796460469508169315">Chromium கிட்டத்தட்ட தயாராகிவிட்டது.</translation>
diff --git a/chrome/app/resources/chromium_strings_te.xtb b/chrome/app/resources/chromium_strings_te.xtb index dc9dd89..daf25859 100644 --- a/chrome/app/resources/chromium_strings_te.xtb +++ b/chrome/app/resources/chromium_strings_te.xtb
@@ -117,6 +117,7 @@ <translation id="549669000822060376">దయచేసి Chromium తాజా సిస్టమ్ నవీకరణలను ఇన్స్టాల్ చేస్తున్నప్పుడు వేచి ఉండండి.</translation> <translation id="5563479599352954471">ఒక టచ్తో శోధించండి</translation> <translation id="5620765574781326016">పేజీ నుండి నిష్క్రమించకుండానే వెబ్సైట్ల్లో విషయాల గురించి తెలుసుకోండి.</translation> +<translation id="5634636535844844681">Chromiumకి Windows 7 లేదా అంతకంటే ఆధునికమైనది ఉండటం ఆవశ్యకం.</translation> <translation id="5680901439334282664">Chromiumకి సైన్ ఇన్ చేయండి</translation> <translation id="5772805321386874569">(Chromium <ph name="BEGIN_BUTTON" />పునఃప్రారంభం<ph name="END_BUTTON" /> అవసరం)</translation> <translation id="5796460469508169315">Chromium దాదాపు సిద్ధంగా ఉంది.</translation>
diff --git a/chrome/app/resources/chromium_strings_th.xtb b/chrome/app/resources/chromium_strings_th.xtb index 1e2f2df..efe5c555 100644 --- a/chrome/app/resources/chromium_strings_th.xtb +++ b/chrome/app/resources/chromium_strings_th.xtb
@@ -119,6 +119,7 @@ <translation id="549669000822060376">โปรดรอขณะที่ Chromium ติดตั้งการอัปเดตระบบล่าสุด</translation> <translation id="5563479599352954471">ค้นหาด้วยการแตะเพียงครั้งเดียว</translation> <translation id="5620765574781326016">เรียนรู้เกี่ยวกับหัวข้อต่างๆ บนเว็บไซต์โดยไม่ต้องออกจากหน้า</translation> +<translation id="5634636535844844681">Chromium ต้องใช้ Windows 7 ขึ้นไป</translation> <translation id="5680901439334282664">ลงชื่อเข้าใช้ Chromium</translation> <translation id="5772805321386874569">(จำเป็นต้อง <ph name="BEGIN_BUTTON" />รีสตาร์ท<ph name="END_BUTTON" /> Chromium)</translation> <translation id="5796460469508169315">Chromium เกือบจะพร้อมใช้งานแล้ว</translation>
diff --git a/chrome/app/resources/chromium_strings_tr.xtb b/chrome/app/resources/chromium_strings_tr.xtb index cc417bae..238bfba 100644 --- a/chrome/app/resources/chromium_strings_tr.xtb +++ b/chrome/app/resources/chromium_strings_tr.xtb
@@ -117,6 +117,7 @@ <translation id="549669000822060376">Chromium en son sistem güncellemelerini yüklerken lütfen bekleyin.</translation> <translation id="5563479599352954471">Tek dokunmayla ara</translation> <translation id="5620765574781326016">Sayfadan ayrılmadan web sitelerindeki konular hakkında bilgi edinin.</translation> +<translation id="5634636535844844681">Chromium, Windows 7 veya daha yeni bir sürümünü gerektirir.</translation> <translation id="5680901439334282664">Chromium'da oturum açın</translation> <translation id="5772805321386874569">(Chromium'un <ph name="BEGIN_BUTTON" />yeniden başlatılmasını<ph name="END_BUTTON" /> gerektirir)</translation> <translation id="5796460469508169315">Chromium neredeyse hazır.</translation>
diff --git a/chrome/app/resources/chromium_strings_uk.xtb b/chrome/app/resources/chromium_strings_uk.xtb index 4813473..4d0019a 100644 --- a/chrome/app/resources/chromium_strings_uk.xtb +++ b/chrome/app/resources/chromium_strings_uk.xtb
@@ -119,6 +119,7 @@ <translation id="549669000822060376">Зачекайте, доки Chromium установить найновіші оновлення системи.</translation> <translation id="5563479599352954471">Пошук одним дотиком</translation> <translation id="5620765574781326016">Дізнавайтеся про теми на веб-сайтах, залишаючись на сторінці.</translation> +<translation id="5634636535844844681">Для роботи Chromium потрібно мати ОС Windows 7 або новішої версії.</translation> <translation id="5680901439334282664">увійдіть в обліковий запис Chromium</translation> <translation id="5772805321386874569">(потрібно <ph name="BEGIN_BUTTON" />перезапустити<ph name="END_BUTTON" /> Chromium)</translation> <translation id="5796460469508169315">Chromium майже готовий.</translation> @@ -206,6 +207,7 @@ <translation id="8586442755830160949">Авторське право <ph name="YEAR" /> Автори Chromium. Усі права захищено.</translation> <translation id="8621669128220841554">Не вдалося встановити через невизначену помилку. Завантажте Chromium ще раз.</translation> <translation id="8628626585870903697">У Chromium немає засобу перегляду файлів PDF, який потрібен для перегляду версії для друку.</translation> +<translation id="8667808506758191620">Ваш пристрій <ph name="DEVICE_TYPE" /> оновлено.</translation> <translation id="8697124171261953979">Розширення також змінило сторінку, яка відкривається під час запуску Chromium або пошуку в універсальному вікні пошуку.</translation> <translation id="8704119203788522458">Це ваш Chromium</translation> <translation id="872034308864968620">Дозволити Chromium працювати у фоновому режимі</translation>
diff --git a/chrome/app/resources/chromium_strings_vi.xtb b/chrome/app/resources/chromium_strings_vi.xtb index ac410d58..fe834cb 100644 --- a/chrome/app/resources/chromium_strings_vi.xtb +++ b/chrome/app/resources/chromium_strings_vi.xtb
@@ -119,6 +119,7 @@ <translation id="549669000822060376">Vui lòng đợi khi Chromium cài đặt các bản cập nhật hệ thống mới nhất.</translation> <translation id="5563479599352954471">Tìm kiếm bằng một lần chạm</translation> <translation id="5620765574781326016">Tìm hiểu về các chủ đề trên trang web mà không phải rời khỏi trang.</translation> +<translation id="5634636535844844681">Chromium yêu cầu Windows 7 trở lên.</translation> <translation id="5680901439334282664">đăng nhập vào Chromium</translation> <translation id="5772805321386874569">(yêu cầu Chromium <ph name="BEGIN_BUTTON" />khởi động lại<ph name="END_BUTTON" />)</translation> <translation id="5796460469508169315">Chromium gần như đã sẵn sàng.</translation>
diff --git a/chrome/app/resources/chromium_strings_zh-CN.xtb b/chrome/app/resources/chromium_strings_zh-CN.xtb index 567ba36..bfa1c23 100644 --- a/chrome/app/resources/chromium_strings_zh-CN.xtb +++ b/chrome/app/resources/chromium_strings_zh-CN.xtb
@@ -119,6 +119,7 @@ <translation id="549669000822060376">Chromium正在安装最新的系统更新,请稍候。</translation> <translation id="5563479599352954471">触摸一下即可启动搜索</translation> <translation id="5620765574781326016">无需离开所在页面,即可了解网站上的主题。</translation> +<translation id="5634636535844844681">Chromium 要求操作系统必须为 Windows 7 或更高版本。</translation> <translation id="5680901439334282664">登录 Chromium</translation> <translation id="5772805321386874569">(需要<ph name="BEGIN_BUTTON" />重新启动<ph name="END_BUTTON" /> Chromium)</translation> <translation id="5796460469508169315">Chromium 即将准备就绪。</translation>
diff --git a/chrome/app/resources/chromium_strings_zh-TW.xtb b/chrome/app/resources/chromium_strings_zh-TW.xtb index 464a250..83ac3f8 100644 --- a/chrome/app/resources/chromium_strings_zh-TW.xtb +++ b/chrome/app/resources/chromium_strings_zh-TW.xtb
@@ -119,6 +119,7 @@ <translation id="549669000822060376">請稍候,Chromium 正在安裝最新的系統更新。</translation> <translation id="5563479599352954471">輕觸即可搜尋</translation> <translation id="5620765574781326016">不必離開所在頁面即可瞭解網站上有哪些主題。</translation> +<translation id="5634636535844844681">Chromium 僅支援 Windows 7 以上版本的作業系統。</translation> <translation id="5680901439334282664">登入 Chromium</translation> <translation id="5772805321386874569">(必須<ph name="BEGIN_BUTTON" />重新啟動<ph name="END_BUTTON" /> Chromium)</translation> <translation id="5796460469508169315">Chromium 即將準備就緒。</translation>
diff --git a/chrome/app/resources/generated_resources_am.xtb b/chrome/app/resources/generated_resources_am.xtb index cc6a069c..5a00c0f 100644 --- a/chrome/app/resources/generated_resources_am.xtb +++ b/chrome/app/resources/generated_resources_am.xtb
@@ -183,16 +183,19 @@ <translation id="1259724620062607540">የመደርደሪያ ንጥል 7</translation> <translation id="1260240842868558614">አሳይ፦</translation> <translation id="126710816202626562">የትርጉም ቋንቋ፦</translation> +<translation id="1269690813141254680">Google ፍለጋን እና ሌሎች የGoogle አገልግሎቶችን ግላዊነት ለማላበስ የአሰሳ ታሪክዎን እንዴት እንደሚጠቀም <ph name="BEGIN_LINK" />የGoogle እንቅስቃሴ መቆጣጠሪያዎች<ph name="END_LINK" /> ላይ ይቆጣጠሩ።</translation> <translation id="1272079795634619415">አቁም</translation> <translation id="1272978324304772054">ይህ የተጠቃሚ መለያ መሣሪያው የተመዘገበበት ጎራ አካል አይደለም። ወደተለየ ጎራ መመዝገብ ከፈለጉ መጀመሪያ የመሣሪያ ዳግም ማግኛን ማከናወን አለብዎት።</translation> <translation id="127353061808977798">ቅርጸ ቁምፊዎች እና መቀየር</translation> <translation id="1274997165432133392">ኩኪዎች እና የሌላ ጣቢያ ውሂብ</translation> <translation id="1275718070701477396">ተመርጧል</translation> +<translation id="1277908057200820621">የመሣሪያ ዝርዝርን ይመልከቱ</translation> <translation id="1278049586634282054">እይታዎችን ይመርምሩ፦</translation> <translation id="1278813325885878377">የሃንጋሪኛ Qwerty ቁልፍ ሰሌዳ</translation> <translation id="1285320974508926690">ይህን ጣቢያ በጭራሽ አትተርጉም</translation> <translation id="1285484354230578868">ውሂብ በእርስዎ Google Drive መለያ ላይ ያከማቹ</translation> <translation id="1290223615328246825">በራስ-መግባት አልተሳካም</translation> +<translation id="1293509594570842875">አዲሱ ክትትል የሚደረግበት ተጠቃሚ ለፈጠር አልቻለም። እባክዎ የአውታረ መረብ ግንኙነትዎን ይፈትሹና ቆይተው እንደገና ይሞክሩ።</translation> <translation id="1293556467332435079">ፋይሎች</translation> <translation id="1294298200424241932">የእምነት ቅንብሮችን ያርትዑ፦</translation> <translation id="1295794900245526845">ወደ መለያ ለመግባት በ<ph name="PASSWORD_MANAGER_BRAND" /> የተቀመጠውን የእርስዎን መለያ ይምረጡ።</translation> @@ -291,6 +294,7 @@ <translation id="1429740407920618615">የምልክት ጥንካሬ፦</translation> <translation id="143027896309062157">በጎበኟቸው ድር ጣቢያዎች ላይ ያለው ሁሉም ውሂብዎን ያነብባል እና ይቀይራል</translation> <translation id="1430915738399379752">አትም</translation> +<translation id="1433423644370450034">የማህደረ መረጃ ቅጥ ማሳወቂያ</translation> <translation id="1434696352799406980">ይህ የእርስዎን የመነሻ ገጽ፣ አዲስ የትር ገጽ፣ የፍለጋ ፕሮግራምን እና የተሰኩ ትሮችን ዳግም ያቀናብራቸዋል። እንዲሁም ሁሉንም ቅጥያዎች ያሰናክላል እና እንደ ኩኪዎች ያለ ጊዜያዊ ውሂብን ያጸዳል። የእርስዎ ዕልባቶች፣ ታሪክ እና የተቀመጡ የይለፍ ቃላት አይጸዱም።</translation> <translation id="1434886155212424586">መነሻ ገጽ አዲሱ የትር ገጽ ነው</translation> <translation id="1435550882135542937">የቅጥያ መሣሪያ አሞሌ ዳግም ንድፍ</translation> @@ -378,6 +382,7 @@ <translation id="1526925867532626635">የማመሳሰል ቅንብሮችን ያረጋግጡ</translation> <translation id="1528372117901087631">የበይነመረብ ግንኙነት</translation> <translation id="1529968269513889022">ያለፈው ሳምንት</translation> +<translation id="1531865825384516080">የSafeSearch ዩአርኤሎች ሪፖርት ማድረግ።</translation> <translation id="1532697124104874386">የምናባዊ ቁልፍ ሰሌዳ ዘመናዊ ማሰማራትን አንቃ/አሰናክል።</translation> <translation id="1533897085022183721">ከ<ph name="MINUTES" /> በታች።</translation> <translation id="1533920822694388968">የቲቪ አሰላለፍ</translation> @@ -502,7 +507,7 @@ <translation id="169515659049020177">Shift</translation> <translation id="1697068104427956555">የምስሉ ካሬ ክልል ይምረጡ።</translation> <translation id="1697532407822776718">በቃ ጨርሰዋል!</translation> -<translation id="1697988819212986149">አንድ የGoogle አዶ በGoogle አገልግሎቶች ከተጎላበቱ የአውድ ምናሌ ንጥሎች ጎን ያሳያል።</translation> +<translation id="1697988819212986149">አንድ የGoogle አዶ በGoogle አገልግሎቶች ከተጎለበቱ የአውድ ምናሌ ንጥሎች ጎን ያሳያል።</translation> <translation id="1699274548822076330">ይህ ከtrace-upload-url ሰንደቅ ጋር አብሮ ስራ ላይ የሚውል ነው። ማስጠንቀቂያ፦ በሚነቃበት ጊዜ Chrome ለእያንዳንዱ ዳሰሳ ያለውን የአፈጻጸም ውሂብ ይመዘግብና በtrace-upload-url ሰንደቅ ወደተጠቀሰው ዩአርኤል ይሰቅለዋል። ዱካው እንደ እርስዎ የጎበኙዋቸው ርዕሶችን እና የጎበኟቸው ድር ጣቢያዎች ዩአርኤሎችን ያሉ በግል ማንነትን ለይቶ ለማወቅ የሚያስችል መረጃን (PII) ሊያካትት ይችላል።</translation> <translation id="1699395855685456105">የሃርድዌር ክለሳ፦</translation> @@ -661,7 +666,6 @@ <translation id="1962233722219655970">ይህ ገጽ በኮምፒውተርዎ ላይ የማይሰራ የቤተኛ ደንበኛ መተግበሪያ ይጠቀማል።</translation> <translation id="1965328510789761112">የግል ማህደረ ትውስታ</translation> <translation id="1965624977906726414">ምንም ልዩ ፍቃዶች የሉትም።</translation> -<translation id="1968720524450620475">የእርምጃ አዶዎችን ለድር ማሳወቂያዎች አንቃ።</translation> <translation id="1970746430676306437">የገጽ &መረጃ አሳይ</translation> <translation id="197288927597451399">አስቀምጥ</translation> <translation id="1973491249112991739"><ph name="PLUGIN_NAME" />ን ማውረድ አልተሳካም።</translation> @@ -759,6 +763,7 @@ <translation id="212862741129535676">የተደጋጋሚነት ሁኔታ ያዥነት መቶኛ</translation> <translation id="2128691215891724419">የማመሳሰል ስህተት፦ የማመሳሰል ይለፍ ሐረግ ያዘምኑ...</translation> <translation id="2129904043921227933">የማመሳሰል ስህተት፦ የይለፍ ሐረግ ያዘምኑ...</translation> +<translation id="2130053362119884302">ሙሉ ማያ ገጽ ላይ የትር ማላቀቅን ፍቀድ</translation> <translation id="2131077480075264">በ«<ph name="IMPORT_NAME" />» ስላልተፈቀደ «<ph name="APP_NAME" />»ን መጫን አልተቻለም</translation> <translation id="2134149231879627725">Google በርቀት እንዲቆልፉ፣ እንዲደመሡ እና መሣሪያዎን እንዲያገኝ ያግዘዎት።</translation> <translation id="2134986351331412790">ይህ ጣቢያ ይህን የካርድ ምርት አይቀበለውም።</translation> @@ -771,6 +776,7 @@ <translation id="2143778271340628265">የእራስ ተኪ ውቅር</translation> <translation id="2143915448548023856">የማሳያ ቅንብሮች</translation> <translation id="2144536955299248197">የእውቅና ማረጋገጫ ተመልካች፦ <ph name="CERTIFICATE_NAME" /></translation> +<translation id="2147827593068025794">የጀርባ ስምረት</translation> <translation id="2148756636027685713">ቅርጸት መስራት ተጠናቅቋል</translation> <translation id="2148892889047469596">ትር ውስድ</translation> <translation id="2148999191776934271">በመሙላት ላይ @@ -1149,13 +1155,14 @@ <translation id="2665717534925640469">ይህ ገጽ አሁን ሙሉ ማያ ገጽ ነው፣ እናም የመዳፊትዎ ጠቋሚን አሰናክሎታል።</translation> <translation id="2665919335226618153">ኧረ ቴች! ቅርጸት በሚሰራለት ጊዜ የሆነ ስህተት ነበር።</translation> <translation id="2668079306436607263">የአልፎ-ማሸብለል ታሪክ አሰሳ</translation> +<translation id="2670102641511624474"><ph name="APP_NAME" /> የChrome ትር እያጋራ ነው።</translation> <translation id="2670965183549957348">የChewing ግቤት ስልት</translation> <translation id="2672142220933875349">መጥፎ የcrx ፋይል፣ ጥቅል መክፈት አልተሳካም።</translation> <translation id="2672394958563893062">አንድ ስህተት ተከስቷል። ከመጀመሪያው ጀምሮ ዳግም ለማስጀመር ጠቅ ያድርጉ።</translation> <translation id="267285457822962309">የመሣሪያዎ እና ተነቃይዎችዎ የሆኑ ቅንብሮችን ይቀይሩ።</translation> <translation id="2673135533890720193">የአሰሳ ታሪክዎን ያነብባል</translation> <translation id="2673589024369449924">ለዚህ ተጠቃሚ የዴስክቶፕ ላይ አቋራጭ ፍጠር</translation> -<translation id="2675358154061544447">በከፍተኛ ደረጃ የሙከራ የሆነ የጣቢያ-ሸገር iframes ምስል በተለያዩ ሂደቶች ውስጥ የመሥራት ድጋፍ። በዚህ ሁነታ ላይ ሰነዶች ከተመሳሳዩ ድር ጣቢያ ከሆኑ ብቻ ነው የምስል ሥራ ሂደት የሚጋሩት።</translation> +<translation id="2675358154061544447">በከፍተኛ ደረጃ የሙከራ ተላላፊ-ጣቢያ iframes ምስል በተለያዩ ሂደቶች ውስጥ የመሥራት ድጋፍ። በዚህ ሁነታ ላይ ሰነዶች ከተመሳሳዩ ድር ጣቢያ ከሆኑ ብቻ ነው የምስል ሥራ ሂደት የሚጋሩት።</translation> <translation id="2676946222714718093">እየተጫወተ ያለው በ፦</translation> <translation id="2678063897982469759">እንደገና አንቃ</translation> <translation id="2678246812096664977">ሁሉም ተሰኪዎች</translation> @@ -1195,6 +1202,7 @@ <translation id="2733364097704495499">አታሚ <ph name="PRINTER_NAME" />ን በGoogle ደመና ህትመት ላይ ማስመዝገብ ይፈልጋሉ?</translation> <translation id="2735698359135166290">የሮማኒያኛ መደበኛ የቁልፍ ሰሌዳ</translation> <translation id="2737363922397526254">ሰብስብ...</translation> +<translation id="2737755522130570180">የጥቅል ስክሪፕቶች በdocument.write በኩል ተጭነዋል</translation> <translation id="2738771556149464852">ከኋላ ያለሆነ</translation> <translation id="2739191690716947896">አርም</translation> <translation id="2739240477418971307">የተደራሽነት ቅንብሮችዎን ይቀይራል</translation> @@ -1264,6 +1272,7 @@ <translation id="2805646850212350655">Microsoft Encrypting File System</translation> <translation id="2805707493867224476">ሁሉም ጣቢያዎች ብቅ-ባዮችን እንዲያሳዩ ፍቀድ</translation> <translation id="2805756323405976993">መተግበሪያዎች</translation> +<translation id="2808243220963392165">Mac ላይ በሙሉ ማያ ገጽ ሁነታ ላይ ሲሆን ትሮች ከትር መስመሩ ላይ እንዲላቀቁ ይፍቀዱ።</translation> <translation id="2809142985846095314">በራስ-የሚሞሉ የክሬዲት ካርዶች ሰቀላን ማቅረብ አንቃ</translation> <translation id="2809346626032021864">ንባብ</translation> <translation id="2809586584051668049">እና <ph name="NUMBER_ADDITIONAL_DISABLED" /> ተጨማሪ</translation> @@ -1392,6 +1401,7 @@ <translation id="2968792643335932010">ያነሱ ቅጂዎች</translation> <translation id="2971033837577180453"><span>ID:</span><ph name="EXTENSION_ID" /></translation> <translation id="2971213274238188218">ብሩህ ወደ ታች</translation> +<translation id="2971422413423640756">የሚዲያ ዩአርኤል ያለው ገጽ ሲከፈት ያለው የውርድ አዝራር።</translation> <translation id="2972557485845626008">ጽኑ ትዕዛዝ</translation> <translation id="2972581237482394796">&ድገም</translation> <translation id="297870353673992530">የዲ ኤን ኤስ አገልጋይ፦</translation> @@ -1424,7 +1434,6 @@ <translation id="302014277942214887">የመተግበሪያ መታወቂያ ወይም የድር መደብር ዩአርኤል ያስገቡ።</translation> <translation id="3020616530769498629">ለማደስ-ሳብ ላይ የማይረጋገጥ ዳግም መጫንን አንቃ</translation> <translation id="3020990233660977256">መለያ ቁጥር፦ <ph name="SERIAL_NUMBER" /></translation> -<translation id="3021245547458004908">ሲነቃ የመሣሪያ አሞሌው በትንሹ ዲፒ >= 800 ማያ ገጽ ባላቸው መሣሪያዎች ላይ በሽብለላ ምክንያት በጭራሽ አይደብቅም። የገጽ ይዘቶች ወደ ሙሉ ማያ ገጽ ከሄዱ አሁንም ድረስ እንደተደበቀ ይቀጥላል።</translation> <translation id="3021678814754966447">የፍሬም መነሻ &አሳይ</translation> <translation id="3024374909719388945">ባለ 24 ሰዓት ይጠቀሙ</translation> <translation id="3025022340603654002">በቅጽ አባል ላይ በመጀመሪያ መዳፊት ጠቅታ ላይ የራስ-ሙላ አስተያየት ጥቆማዎችን ስጥ።</translation> @@ -1441,7 +1450,7 @@ ክትትል የሚደረግበት ተጠቃሚ የGoogle መለያ አይፈጥርም፣ እና የእነሱ ዕልባቶች፣ የአሰሳ ታሪክ እና ሌሎች ምርጫዎች ከChrome ስምረት ጋር ወደ ሌሎች መሣሪያዎች አይከተሏቸውም። አዲስ ክትትል የሚደረግበት ተጠቃሚ ከፈጠሩ በኋላ ቅንብሮቻቸውን በ<ph name="BEGIN_MANAGE_LINK" /><ph name="DISPLAY_LINK" /><ph name="END_MANAGE_LINK" /> ላይ በማንኛውም ጊዜ ከማንኛውም መሣሪያ ላይ ማቀናበር ይችላሉ። -ተጨማሪ መረጃ ለማግኘት <ph name="BEGIN_LINK" />የእገዛ ማእከላችንን<ph name="END_LINK" /> ይጎብኙ።</translation> +ተጨማሪ መረጃ ለማግኘት <ph name="BEGIN_LINK" />የእገዛ ማዕከላችንን<ph name="END_LINK" /> ይጎብኙ።</translation> <translation id="3031417829280473749">Agent X</translation> <translation id="3031557471081358569">ከውጪ ለማስመጣት ንጥሎችን ምረጥ፦</translation> <translation id="3033332627063280038">የCache-Control: stale-while-revalidate directiveን የሙከራ ማስፈጸሚያን አንቃ። ይህ አገልጋዮች አንዳንድ ግብዓቶች ተዳፋኝነትን ለማሻሻል ከበስተጀርባ ዳግመኛ መረጋገጥ እንዳለባቸው እንዲጠቅሱ ይፈቅድላቸዋል።</translation> @@ -1457,6 +1466,7 @@ <translation id="3057861065630527966">የእርስዎን ፎቶዎች እና ቪዲዮዎች በምትኬ ያስቀምጡ</translation> <translation id="3058212636943679650">የኮምፒውተርዎን ስርዓተ ክወና ማስመለስ ያስፈለገዎት እንደሆነ የዳግም ማግኛ SD ካርድ ወይም የUSB ማህደረ ትውስታ ያስፈልገዎታል።</translation> <translation id="305932878998873762">የኤች ቲ ቲ ፒ ቀላል መሸጎጫ አዲስ መሸጎጫ ነው። የዲስክ ቦታ ምደባ በስርዓተ ፋይሉ ነው የሚወሰነው።</translation> +<translation id="3062606427884046423">የAndroid MediaStyle ማሳወቂያዎችን ለChrome ማህደረ መረጃ ማሳወቂያዎች ይጠቀሙ።</translation> <translation id="3064388234319122767">በቋንቋ ፊደል መጻፍ (zdravo → здраво)</translation> <translation id="3065041951436100775">የትር ተገድሏል ግብረመልስ።</translation> <translation id="3065140616557457172">ለመፈለግ ይተይቡ ወይም ለመዳሰስ URL ያስገቡ - ሁሉም ነገር በትክክል ይሰራል።</translation> @@ -1495,7 +1505,6 @@ <translation id="3117812041123364382">ተንሳፋፊ ምናባዊ የቁልፍ ሰሌዳ</translation> <translation id="3118319026408854581">የ<ph name="PRODUCT_NAME" /> እገዛ</translation> <translation id="3120430004221004537">በቂ ያልሆነ ምስጠራ ለአንድ የተወሰነ ስርዓተ ክወና በዚህ ላይ፦ «<ph name="DEVICE_NAME" />»።</translation> -<translation id="3121260210578524273">በእርማጅ አዝራሮች ውስጥ አዶዎችን ለድር ማሳወቂያዎች አንቃ።</translation> <translation id="3121793941267913344">ይህን የ<ph name="IDS_SHORT_PRODUCT_NAME" /> መሣሪያ ዳግም ያስጀምሩት</translation> <translation id="3122162841865761901">የገንቢ መሣሪያ ሙከራዎች</translation> <translation id="3122464029669770682">ሲፒዩ</translation> @@ -1540,6 +1549,7 @@ <translation id="3170072451822350649">እንዲሁም መግባቱን ትተው <ph name="LINK_START" />እንደ እንግዳ ማሰስ<ph name="LINK_END" /> ይችላሉ።</translation> <translation id="3170544058711792988">የማጉያ ትኩረት በማያ ገጹ ላይ እንዳተኮረ ያቆዩ</translation> <translation id="3172213052701798825">Google Smart Lock ለይለፍ ቃሎች</translation> +<translation id="3175469972022788345">ሲነቃ WebRTC የECDSA እውቅና ማረጋገጫዎችን ይጠቀማል።</translation> <translation id="317583078218509884">ገጹ ዳግም ከተጫነ በኋላ አዲስ የጣቢያ ፍቃዶች ቅንብሮቹ ይተገበራሉ።</translation> <translation id="3177048931975664371">የይለፍ ቃልን ለመደበቅ ጠቅ ያድርጉ</translation> <translation id="3180365125572747493">ይህን የእውቅና ማረጋገጫ ፋይል ለማመስጠር እባክዎ የይለፍ ቃል ያስገቡ።</translation> @@ -1706,7 +1716,7 @@ <translation id="3392020134425442298">ተንኮል-አዘል ፋይል መልሰህ አግኝ</translation> <translation id="3394150261239285340"><ph name="HOST" /> ካሜራዎን እና ማይክሮፎንዎን ለመጠቀም ይፈልጋል።</translation> <translation id="3394279550557729862">ቤተኛ የማሳወቂያ ማስማሚያዎችን እና የማሳወቂያ ማዕከል በሚገኙባቸው መሣሪያ ስርዓቶች ላይ ለእነሱ ድጋፍ ያንቁ።</translation> -<translation id="3394862755749546286">በAndroid ላይ የተዋሃደ (Android እና ዴስክቶፕ) የሚዲያ መተላለፊያን ያሰናክላል።</translation> +<translation id="3394862755749546286">በAndroid ላይ የተዋሃደ (Android እና ዴስክቶፕ) የማህደረ መረጃ መተላለፊያን ያሰናክላል።</translation> <translation id="3396331542604645348">የተመረጠው አታሚ የለም ወይም በትክክል አልተጫነም። አታሚዎን ያረጋግጡ ወይም ሌላ አታሚ ለመምረጥ ይሞክሩ።</translation> <translation id="3399597614303179694">የመቄዶኒያኛ ቁልፍ ሰሌዳ</translation> <translation id="3401130144947259741">ከነቃ የክስተቶች ክትትል ወደ Event Tracing for Windows (ETW) እንዲላክ ይደረግና ከዚያ በመቀጠል እንደ UIForETW ወይም Xperf ባሉ መሣሪያዎች ሊያዝ ይችላል።</translation> @@ -1965,7 +1975,7 @@ <translation id="3741158646617793859"><ph name="DEVICE_NAME" /> አሁን በአስተዳዳሪ መሥሪያው ውስጥ ይታያል</translation> <translation id="3741243925913727067">የእርስዎን ሚዲያ መሣሪያ ፎቶዎች እና ቪዲዮዎች ወደ Google Drive በምትኬ ያስቀምጡ።</translation> <translation id="3743492083222969745">ለምናባዊ የቁልፍ ሰሌዳ በቅንብሮች ገፅ ላይ የመተየብ እንቅስቃሴ ምልክት አንቃ/አስወግድ።</translation> -<translation id="3744111561329211289">የጀርባ ስምረት</translation> +<translation id="3744111561329211289">የዳራ ስምረት</translation> <translation id="3749289110408117711">የፋይል ስም</translation> <translation id="3751427701788899101">ግንኙነቱ ጠፍቷል</translation> <translation id="3751522270321808809">ይህ ጣቢያ የእርስዎን መረጃ ለመስረቅ ሊያታልልዎት ሊሞክር ይችል ይሆናል (ምሳሌዎች፦ የይለፍ ቃሎች፣ መልዕክቶች፣ ወይም ክሬዲት ካርዶች)።</translation> @@ -1994,6 +2004,7 @@ <translation id="3776796446459804932">ይህ ቅጥያ የChrome ድር ማከማቻ መመሪያን ይጥሳል።</translation> <translation id="3778152852029592020">ማውረድ ተሰርዟል።</translation> <translation id="3778740492972734840">&የዴቬሎፐር መሳሪያዎች</translation> +<translation id="3780663724044634171">ክትትል የሚደረግበት ተጠቃሚ የሚያቀናብሩበት አንድ መለያ ይምረጡ።</translation> <translation id="378312418865624974">የዚህ ኮምፒውተር ልዩ መለያውን ያነብባል</translation> <translation id="3783640748446814672">alt</translation> <translation id="3785308913036335955">የመተግበሪያዎች አቋራጮችን አሳይ</translation> @@ -2017,6 +2028,7 @@ <translation id="3807747707162121253">&ይቅር</translation> <translation id="3809280248639369696">Moonbeam</translation> <translation id="3810973564298564668">አቀናብር</translation> +<translation id="3811494700605067549">1 ፋይል ተመርጧል</translation> <translation id="3812034401428455285"><ph name="UWS_NAME" /> እና <ph name="UWS_NAME" /></translation> <translation id="3812525830114410218">መጥፎ የእውቅና ማረጋገጫ</translation> <translation id="3813984289128269159">እሺ Google</translation> @@ -2046,6 +2058,7 @@ <translation id="3838543471119263078">ኩኪዎች እና የሌላ ጣቢያ እና ተሰኪ ውሂብ</translation> <translation id="3839497635014791588">በዩአይ ክፍለ አካላት ላይ ተጨማሪ የንኪ ግብረመልስ</translation> <translation id="3840053866656739575">ከእርስዎ Chromebox ጋር የነበረው ግንኙነት ጠፍቷል። እባክዎ ጠጋ ይበሉ ወይም ዳግም ለማገናኘት ስንሞክር መሣሪያዎን ይመልከቱ።</translation> +<translation id="3840055807562919428">በdocument.write በኩል ወደ ዋናው ክፈፍ የገቡ የሦስተኛ ወገን ተንታኝ-አጋጅ ስክሪፕቶች ማምጣትን ይከለክላል።</translation> <translation id="3842552989725514455">ባለጭረት ቅርጸ-ቁምፊ</translation> <translation id="3846593650622216128">እነዚህ ቅንብሮች በአንድ ቅጥያ ነው የሚፈጸሙት።</translation> <translation id="3846833722648675493">ከመጀመሪያው ቀለም በኋላ የመተግበሪያ መስኮቶችን አሳይ። መስኮቶች ንብረቶችን በተመሳሳይ ጊዜ ለሚጭኑ መተግበሪያዎች በጣም ዘግይተው ነው የሚታዩት፣ ነገር ግን አብዛኛው ጊዜ ንብረቶቻቸውን ተመሳሳይ ባልሆነ ጊዜ ለሚጭኑ መተግበሪያዎች ብዙም አይቆዩም።</translation> @@ -2275,13 +2288,14 @@ <translation id="421017592316736757">ይህን ፋይል ለመድረስ መስመር ላይ መሆን አለብዎት።</translation> <translation id="421182450098841253">&የዕልባቶች አሞሌን አሳይ</translation> <translation id="4212108296677106246">«<ph name="CERTIFICATE_NAME" />»ን እንደ የእውቅና ማረጋገጫ ባለስልጣን ማመን ይፈልጋሉ?</translation> +<translation id="42126664696688958">ወደ ውጪ ላክ</translation> <translation id="42137655013211669">የዚህ መርጃ መዳረሻ በአገልጋዩ ተከልክሏል።</translation> <translation id="4215350869199060536">ውይ ውይ፣ በስም ውስጥ ህገ-ወጥ ምልክቶች!</translation> <translation id="4215898373199266584">አንዴ ያዳምጡኝማ! ማንነት የማያሳውቅ ሁነታ (<ph name="INCOGNITO_MODE_SHORTCUT" />) ሌላ ጊዜ ላይ ሊጠቅም ይችላል።</translation> <translation id="4218259925454408822">ወደ ሌላ መለያ ይግቡ</translation> <translation id="4219614746733932747">ከነቃ፣ የይዘት ልኬት ከመሣሪያ ልኬት መጠን ጋር ለማመጣጠን Blink የማጉላት ስልቱን ይጠቀማል።</translation> <translation id="4220865787605972627">ማሳያ ባህሪይውን የሚደግፍ ከሆነ የማሳያውን ቀለም መደረዣውን አስችል።</translation> -<translation id="4232692576734035989">ጣቢያ-ሸገር iframes ከላይኛው ሰነድ በተለየ ሂደት ውስጥ የሚቀመጡበት በከፍተኛ ደረጃ የሙከራ የሆነ የአፈጻጸም ሁነታ። በዚህ ሁነታ ላይ ከተለዩ ሶስተኛ ወገን ጣቢያዎች የመጡ iframes ሂደት እንዲጋሩ ይፈቀድላቸዋል።</translation> +<translation id="4232692576734035989">ተላላፊ-ጣቢያ iframes ከላይኛው ሰነድ በተለየ ሂደት ውስጥ የሚቀመጡበት በከፍተኛ ደረጃ የሙከራ የሆነ የአፈጻጸም ሁነታ። በዚህ ሁነታ ላይ ከተለዩ ሶስተኛ ወገን ጣቢያዎች የመጡ iframes ሂደት እንዲጋሩ ይፈቀድላቸዋል።</translation> <translation id="4235200303672858594">መላው የማያ ገጽ</translation> <translation id="4235813040357936597">ለ<ph name="PROFILE_NAME" /> መለያ አክል</translation> <translation id="4240069395079660403"><ph name="PRODUCT_NAME" /> በዚህ ቋንቋ ሊታይ አይችልም።</translation> @@ -2361,6 +2375,7 @@ <translation id="4359408040881008151">በጥገኛ ቅጥያ(ዎች) ምክንያት ተጭኗል።</translation> <translation id="4361190688154226069">በእይታዎች ውስጥ በa ላይ የተመሠረተ ማነጣጠር</translation> <translation id="4364444725319685468"><ph name="FILE_NAME" /> ወርዷል</translation> +<translation id="4364567974334641491"><ph name="APP_NAME" /> አንድ መስኮት እያጋራ ነው።</translation> <translation id="4364830672918311045">ማሳወቂያዎችን አሳይ</translation> <translation id="4365673000813822030">ውይ፣ ማመሳሰል መስራት አቁሟል።</translation> <translation id="4366509400410520531">በእርስዎ የተፈቀደ</translation> @@ -2430,6 +2445,7 @@ <translation id="4479639480957787382">ኢተርኔት</translation> <translation id="4479812471636796472">የአሜሪካ ድቮራክ ቁልፍ ሰሌዳ</translation> <translation id="4481249487722541506">ተጠናቆ ያልቀረበ ቅጥያ ጫን…</translation> +<translation id="4482194545587547824">Google ፍለጋን እና ሌሎች የGoogle አገልግሎቶችን ግላዊነት ለማላበስ የአሰሳ ታሪክዎን ሊጠቀም ይችላል</translation> <translation id="4487088045714738411">የቤልጂየም ቁልፍ ሰሌዳ</translation> <translation id="4492190037599258964">የፍለጋ ውጤቶች ለ'<ph name="SEARCH_STRING" />'</translation> <translation id="4495021739234344583">ከምዝገባ አስወጣ እና ዳግም አስጀምር</translation> @@ -2473,6 +2489,7 @@ <translation id="4554591392113183336">ውጫዊ ቅጥያው ከነባሩ ጋር ተመሳሳይ ወይም ያነሰ ስሪት ነው።</translation> <translation id="4554796861933393312">የቁስ ንድፍ Ink Drop እነማ ፍጥነት</translation> <translation id="4555769855065597957">ጥላ</translation> +<translation id="4556110439722119938">የእርስዎን ዕልባቶች፣ ታሪክ፣ የይለፍ ቃላት እና ሌሎች ቅንብሮች በሁሉም መሣሪያዎችዎ ላይ መጠቀም እንዲችሉ ከGoogle መለያዎ ጋር ይሰምራሉ</translation> <translation id="4557136421275541763">ማስጠንቀቂያ፦</translation> <translation id="4558426062282641716">የራስ-አስጀምር ፍቃድ ተጠይቋል</translation> <translation id="4563210852471260509">የመጀመሪያው የግቤት ቋንቋ ቻይንኛ ነው</translation> @@ -2594,6 +2611,7 @@ <translation id="4742746985488890273">መደርደሪያ ላይ ሰካ</translation> <translation id="474421578985060416">በእርስዎ የታገዱ</translation> <translation id="4744574733485822359">ውርድዎ ተጠናቅቋል</translation> +<translation id="4746330764136728131">ለWebRTC የECDSA እውቅና ማረጋገጫዎችን ተጠቀም</translation> <translation id="4746971725921104503">ያንን ስም የያዘ ተጠቃሚ አስቀድመው እያስተዳደሩ ያሉ ይመስላሉ። <ph name="LINK_START" /><ph name="USER_DISPLAY_NAME" />ን ወደዚህ መሣሪያ ማስመጣት<ph name="LINK_END" /> ይፈልጋሉ?</translation> <translation id="4747271164117300400">መቄዶኒያኛ</translation> <translation id="4749157430980974800">የጂዩርጂያ ቁልፍ ሰሌዳ</translation> @@ -2743,6 +2761,7 @@ <translation id="496226124210045887">የመረጡት አቃፊ ሊጎዱ የሚችሉ ፋይሎች አሉት። እርግጠኛ ነዎት ዘላቂ የዚህ አቃፊ የንባብ መዳረሻ ለ«$1» መስጠት ይፈልጋሉ?</translation> <translation id="4964673849688379040">በመፈተሽ ላይ...</translation> <translation id="4966802378343010715">አዲስ ተጠቃሚ ፍጠር</translation> +<translation id="4967749818080339523">አንድ መለያ ይምረጡ</translation> <translation id="496888482094675990">የፋይሎች መተግበሪያው በGoogle Drive፣ ውጫዊ ማከማቻ ወይም በእርስዎ የChrome OS መሣሪያ ላይ ያስቀመጧቸውን ፋይሎች ፈጣን መዳረሻ ይሰጠዎታል።</translation> <translation id="4971412780836297815">ሲጠናቀቅ ክፈት</translation> <translation id="497244430928947428">የማላያላም ቁልፍ ሰሌዳ (ፎነቲክ)</translation> @@ -2789,6 +2808,7 @@ <translation id="5038863510258510803">በማንቃት ላይ...</translation> <translation id="5039512255859636053">$1 ቴባ</translation> <translation id="5039804452771397117">ፍቀድ</translation> +<translation id="5043851552150732346">1 ማውጫ ተመርጧል</translation> <translation id="5045550434625856497">ትክክል ያልሆነ የይለፍ ቃል</translation> <translation id="5048179823246820836">ኖርዲክ</translation> <translation id="5048294425697652159">ማሳያን ለመለካት Quirks Clientን አንቃ።</translation> @@ -2876,6 +2896,7 @@ <translation id="5170477580121653719">የቀረው የGoogle Drive ማከማቻ ቦታ፦ <ph name="SPACE_AVAILABLE" />።</translation> <translation id="5170568018924773124">በአቃፊ አሳይ</translation> <translation id="5171045022955879922">ይፈልጉ ወይም ዩአርኤል ይጻፉ</translation> +<translation id="5171343362375269016">የተተካ ማህደረ ትውስታ</translation> <translation id="5175870427301879686"><ph name="URL" /> ውሂብ በአካባቢያዊ ኮምፒውተርዎ ላይ እስከመጨረሻው ሊያከማች ይፈልጋል።</translation> <translation id="5177479852722101802">የካሜራ እና ማይክሮፎን መዳረሻ ማገዱን ቀጥል</translation> <translation id="5177526793333269655">ድንክዬ ትይታ</translation> @@ -3033,6 +3054,7 @@ <translation id="5380103295189760361">የእነዚህ መቀየሪያዎች የቁልፍ ሰሌዳ አቋራጮችን ለማየት Control፣ Alt፣ Shift፣ ወይም Searchን ይያዙ።</translation> <translation id="5382392428640372740">የአሰሳ ዱካ ክትትልን አንቃ</translation> <translation id="5388588172257446328">የተጠቃሚው ስም፦</translation> +<translation id="5389237414310520250">አዲሱ ተጠቃሚ ሊፈጠር አልቻለም። እባክዎ የደረቅ አንጻፊዎ ቦታ እና ፍቃዶችን ያረጋግጡና እንደገና ይሞክሩ።</translation> <translation id="5390284375844109566">በመረጃ ጠቋሚ የተሰናዳ የውሂብ ጎታ</translation> <translation id="5392544185395226057">የቤተኛ ደንበኛ ድጋፍን ያነቃል።</translation> <translation id="5396126354477659676">በ<ph name="PEPPER_PLUGIN_DOMAIN" /> ላይ ያለው <ph name="PEPPER_PLUGIN_NAME" /> ኮምፒውተርዎን ሊደርስበት ይፈልጋል።</translation> @@ -3100,6 +3122,7 @@ <translation id="5469954281417596308">የዕልባት አስተዳዳሪ</translation> <translation id="5470838072096800024">የተቀበለበት መጨረሻ ጊዜ</translation> <translation id="5473075389972733037">IBM</translation> +<translation id="5473279832922912143">V8 ለጃቫስክሪፕት ማስፈጸም የሙከራ Ignition ተርጓሚውን እንዲጠቀም ያንቁት።</translation> <translation id="5474139872592516422"><ph name="PLUGIN_NAME" /> ማዘመኑን ሲጨርስ እሱን ለማግበር ገጹን ዳግም ይጫኑ።</translation> <translation id="5480254151128201294">ይህ መሣሪያ በባለቤቱ ተቆልፏል።</translation> <translation id="5483785310822538350">የፋይል እና መሣሪያ መዳረሻ ይሻሩ</translation> @@ -3127,6 +3150,7 @@ <translation id="5509914365760201064">ሰጪ፦ <ph name="CERTIFICATE_AUTHORITY" /></translation> <translation id="5511823366942919280">እርግጠኛ ነዎት ይህንን እንደ «Shark» አድርገው ማዋቀር ይፈልጋሉ?</translation> <translation id="5512653252560939721">የተጠቃሚ እውቅና ማረጋገጫ በሃርድዌር የታዘገ መሆን አለበት።</translation> +<translation id="5513242761114685513">የአውድ ምናሌ</translation> <translation id="5515008897660088170">የToolkit-Views መተግበሪያ መስኮቶች።</translation> <translation id="551752069230578406">አታሚውን ወደ የእርስዎ መለያ በማከል ላይ - ይሄ ትንሽ ጊዜ ሊወስድ ይችላል...</translation> <translation id="5518584115117143805">የኢሜይል ምስጠራ ሰርቲፊኬት</translation> @@ -3307,7 +3331,6 @@ <translation id="577322787686508614">የማንብብ ክወና በዚህ ላይ አይፈቀድም፦ «<ph name="DEVICE_NAME" />»።</translation> <translation id="5774295353725270860">የፋይሎች መተግበሪያን ክፈት</translation> <translation id="5774515636230743468">መግለጫ፡</translation> -<translation id="5776006986202016118">ጣቢያው ከሚከተለው ጋር ለመገናኘት ይፈልጋል፦</translation> <translation id="577624874850706961">ኩኪዎችን ፈልግ</translation> <translation id="5778550464785688721">MIDI መሣሪያዎች ሙሉ ቁጥጥር</translation> <translation id="5780066559993805332">(ምርጥ)</translation> @@ -3384,6 +3407,7 @@ <translation id="5874045675243596003">ከበድ ያለ ተፈጻሚ አድርግ (መሰላሎችን የማናገኝ ከሆነ ከባድ ውድቀት)</translation> <translation id="5875858680971105888">ውይ! ክትትል የሚደረግበት ተጠቃሚ ለፈጠር ማስመጣት አልተቻለም። እባክዎ የአውታረ መረብዎን ግንኙነት ይፈትሹና ቆይተው እንደገና ይሞክሩ።</translation> <translation id="5880247576487732437">ማስመሰያ አለ</translation> +<translation id="5884474295213649357">ይህ ትር ከአንድ የዩኤስቢ መሣሪያ ጋር የተገናኘ ነው።</translation> <translation id="5885324376209859881">የማህደረ መረጃ ቅንብሮችን ያቀናብሩ...</translation> <translation id="5889282057229379085">ከፍተኛ የመሃከለኛ CAዎች ብዛት፦ <ph name="NUM_INTERMEDIATE_CA" /></translation> <translation id="5892290200158927959">የፈረንሳይኛ BÉPO ቁልፍ ሰሌዳ</translation> @@ -3475,6 +3499,8 @@ <translation id="604124094241169006">ራስ-ሰር</translation> <translation id="6042308850641462728">ተጨማሪ</translation> <translation id="604257181445267932">Smart Lock Google ላይ ያስቀመጡትን የይለፍ ቃል በመጠቀም በፍጥነት ወደ መተግበሪዎች እና ጣቢያዎች እንዲገቡ ያግዘዎታል።</translation> +<translation id="6043317578411397101"><ph name="APP_NAME" /> አንድ የChrome ትር ለ<ph name="TAB_NAME" /> እያጋራ ነው።</translation> +<translation id="6044805581023976844"><ph name="APP_NAME" /> አንድ የChrome ትር እና ኦዲዮ ለ<ph name="TAB_NAME" /> እያጋራ ነው።</translation> <translation id="6049065490165456785">ፎቶ ከውስጣዊ ካሜራ</translation> <translation id="6051028581720248124">ወደ FedEx Office በማተም የእነሱን <ph name="START_LINK" />አገልግሎት ውል<ph name="END_LINK" /> ተቀብለዋል።</translation> <translation id="6051086608691487286">ተደራቢ ማሸብለያ አሞሌዎች</translation> @@ -3603,6 +3629,7 @@ <translation id="6251889282623539337">የ<ph name="DOMAIN" /> አገልግሎት ውል</translation> <translation id="6251924700383757765">የግላዊነት መመሪያ</translation> <translation id="6253586523465486793">ለማደስ-ጎትት የማያረጋግጥ ዳግም መጫንን እንዲቀሰቅስ ያስገድደዋል (አብዛኛውን ጊዜ ጠቋሚው በሚሰናከልበት ጊዜ መደበኛ መሸጎጫን የሚያረጋግጥ ዳግም መጫን ነው)።</translation> +<translation id="6254182355913122230">የተተካ ማህደረ ትውስታ</translation> <translation id="6254503684448816922">ቁልፍ ስምምነት ማድረግ</translation> <translation id="6259104249628300056">በአካባቢዎ አውታረ መረብ ላይ መሣሪያዎችን ያግኙ</translation> <translation id="6263082573641595914">Microsoft CA ቅጂ</translation> @@ -3873,6 +3900,7 @@ <translation id="6680028776254050810">ተጠቃሚዎችን ይቀያይር</translation> <translation id="6681668084120808868">ፎቶ አንሳ</translation> <translation id="668171684555832681">ሌላ…</translation> +<translation id="6682083956260248340">ይሄ እንዴት እንደሚሠራ በ<ph name="BEGIN_LINK" /> ውስጥ ይቆጣጠሩ</translation> <translation id="6686490380836145850">በቀኝ በኩል ያሉ ትሮችን ዝጋ</translation> <translation id="6686817083349815241">የይለፍ ቃልዎን ያስቀምጡ</translation> <translation id="6689514201497896398">የጎን የተጠቃሚ ተሳትፎ ፍተሻዎች</translation> @@ -3940,10 +3968,12 @@ <translation id="6798954102094737107">ተሰኪ፦ <ph name="PLUGIN_NAME" /></translation> <translation id="6802031077390104172"><ph name="USAGE" /> (<ph name="OID" />)</translation> <translation id="6804671422566312077">&ሁሉንም እልባቶች በአዲስ መስኮት ክፈት</translation> +<translation id="6805542829187142700">የስርዓት የሰዓት ሰቅ ማወቂያ መሣሪያ መምሪያን ያንቁ።</translation> <translation id="6805647936811177813">የደንበኛ እውቅና ማረጋገጫ ከ<ph name="HOST_NAME" /> ለማስመጣት እባክዎ <ph name="TOKEN_NAME" /> ውስጥ ይግቡ።</translation> <translation id="680572642341004180">የRLZ መከታተል በ<ph name="SHORT_PRODUCT_OS_NAME" /> ላይ አንቃ።</translation> <translation id="6807889908376551050">ሁሉንም አሳይ...</translation> <translation id="6809448577646370871">ለChrome መተግበሪያዎች ብጁ የመስኮት አዙሮ ማምጫ።</translation> +<translation id="6810613314571580006">የተከማቹ ምስክርነቶችን በመጠቀም በራስ-ሰር ወደ ድር ጣቢያዎች ይግቡ። ባህሪው ሲሰናከል ወደ አንድ ድር ጣቢያ ከመግባትዎ በፊት ሁልጊዜ ማረጋገጫ እንዲሰጡ ይጠየቃሉ።</translation> <translation id="6812349420832218321"><ph name="PRODUCT_NAME" /> እንደ ስር ሊሄድ አይችልም።</translation> <translation id="6812841287760418429">ለውጦችን አስቀምጥ</translation> <translation id="6814124696888326520">የግብዓት ዘዴዎችን በቀላሉ ለመቀያየር እና የተጨማሪ የግቤት ባህሪዎች መዳረሻን ለማግኘት፦ የድምፅ ግቤት፣ የእጅ ጽሑፍ እና ስሜት ገላጭ ምስል።</translation> @@ -4132,6 +4162,7 @@ <translation id="7065534935986314333">ስለስርዓቱ</translation> <translation id="7066944511817949584">ከ«<ph name="DEVICE_NAME" />» ጋር መገናኘት አልተቻለም።</translation> <translation id="7067725467529581407">ይህን ዳግም አታሳይ።</translation> +<translation id="7068609958927777019">ከነቃ አግባብ ያልሆነ ዩአርኤሎች ተመልሰው ለSafeSearch ሪፖርት ሊደረጉ ይችላሉ።</translation> <translation id="7070804685954057874">ቀጥተኛ ግቤት</translation> <translation id="7072010813301522126">አቋራጭ ስም</translation> <translation id="7072025625456903686">ሁሉንም ፍቀድ ወይም አብጅ</translation> @@ -4197,10 +4228,10 @@ <translation id="7170467426996704624">በቋንቋ ፊደል መጻፍ (salam → ሰላም)</translation> <translation id="7172053773111046550">የኤስቶኒያኛ ቁልፍ ሰሌዳ</translation> <translation id="7173828187784915717">የChewing ግቤት ቅንብሮች</translation> +<translation id="7173917244679555">አስቀድመው በዚያ ስም ያለ አንድ ተጠቃሚ እያስተዳደሩ ያሉ ይመስላል። <ph name="BEGIN_LINK" /><ph name="PROFILE_NAME" />ን ወደዚህ መሣሪያ ማስመጣት<ph name="END_LINK" /> ፈልገው ነበር?</translation> <translation id="7175353351958621980">የተጫነው ከ፦</translation> <translation id="7180611975245234373">አድስ</translation> <translation id="7180865173735832675">አብጅ</translation> -<translation id="7184428045150946911">በትላልቅ ጡባዊዎች ላይ የመሣሪያ አሞሌውን በራስ-ደብቅ አሰናክል</translation> <translation id="7185690883425432021">tabstrip በቁልል ሁነታ ውስጥ በሚሆንበት ጊዜ ንቁ ያልሆኑ ትሮችን የዝጋ አዝራሮች ይደብቃል።</translation> <translation id="7186088072322679094">በመሣሪያ አሞሌ ውስጥ አቆይ</translation> <translation id="719009910964971313">የአሜሪካ Dvorak ፕሮግራመር ቁልፍ ሰሌዳ</translation> @@ -4265,6 +4296,7 @@ <translation id="7280825545668757494">የWiFi ምስክርነት ማመሳሰል</translation> <translation id="7280877790564589615">ፈቃድ ተጠይቋል</translation> <translation id="7282547042039404307">ለስላሳ</translation> +<translation id="7284549674086796566">የሙከራ ጃቫስክሪፕት ተርጓሚ</translation> <translation id="7287143125007575591">መዳረሻ ተክልክሏል።</translation> <translation id="7288592446024861651">የእርስዎ ዕልባቶች፣ ታሪክ፣ የይለፍ ቃላት እና ሌሎች ቅንብሮች ከGoogle መለያዎ ጋር ይሠምራሉ፣ በዚህም በሁሉም መሣሪያዎችዎ ላይ ሊጠቀሙባቸው ይችላሉ። በ<ph name="BEGIN_LINK" /> ውስጥ ምን እንደሚሠምር ይቆጣጠሩ።</translation> <translation id="7288676996127329262"><ph name="HORIZONTAL_DPI" />x<ph name="VERTICAL_DPI" /> dpi</translation> @@ -4287,6 +4319,7 @@ <translation id="7321545336522791733">አገልጋይ አይደረስበትም</translation> <translation id="7325437708553334317">ባለከፍተኛ ንፅፅር ቅጥያ</translation> <translation id="7326565110843845436">የመዳሰሻ ሰሌዳ ሦስት-ጣት ጠቅታ</translation> +<translation id="7327088014939803293">አዲሱ በክትትል ስር ያለ ተጠቃሚ ሊፈጠር አልቻለም። እባክዎ በትክክል ወደ መለያ መግባትዎን ያረጋግጡና እንደገና ይሞክሩ።</translation> <translation id="73289266812733869">አልተመረጠም</translation> <translation id="7329154610228416156">ደህንነቱ አስተማማኝ ያልሆነ ዩአርኤል (<ph name="BLOCKED_URL" />) እንዲጠቀም ስለተዋቀረ በመለያ መግባት አልተሳካም። እባክዎ የእርስዎን አስተዳዳሪ ያነጋግሩ።</translation> <translation id="7331786426925973633">ለፍጥነት፣ ቅለት እና ደህንነት የተሰራ የድር አሳሽ</translation> @@ -4461,6 +4494,7 @@ <translation id="7573172247376861652">የባትሪ ሙሌት</translation> <translation id="7576032389798113292">6x4</translation> <translation id="7576690715254076113">አጠናክር</translation> +<translation id="7580671184200851182">ተመሳሳዩን ኦዲዮ በሁሉም ድምፅ ማጉያዎች በኩል አጫውት (ሞኖ ኦዲዮ)</translation> <translation id="7581279002575751816">የNPAPI ተሰኪዎች አይደገፉም።</translation> <translation id="7581462281756524039">የማጽጃ መሣሪያ</translation> <translation id="7582582252461552277">ይህን አውታረ መረብ አስቀድመው ይምረጡ</translation> @@ -4693,6 +4727,7 @@ <translation id="7925686952655276919">ለማመሳሰል የተንቀሳቃሽ ስልክ ውሂብን አትጠቀም</translation> <translation id="7926906273904422255">ደህንነታቸው ያልተረጋገጡ ምንጮችን ደህንነታቸው ያልተረጋገጡ ወይም «አጠራጣሪ» የሚል ምልክት አድርግበት።</translation> <translation id="7928710562641958568">መሣሪያን አውጣ</translation> +<translation id="79312157130859720"><ph name="APP_NAME" /> የእርስዎን ማያ ገጽ እና ኦዲዮ እያጋራ ነው።</translation> <translation id="7938594894617528435">በአሁኑ ጊዜ ከመስመር ውጪ</translation> <translation id="7939374455203157513">የደመና አገልግሎቶችን አንቃ</translation> <translation id="7939412583708276221">ለማንኛውም አስቀምጥ</translation> @@ -5026,7 +5061,7 @@ <translation id="839736845446313156">ይመዝገቡ</translation> <translation id="8398790343843005537">ስልክዎን ያግኙ</translation> <translation id="8398877366907290961">ለማንኛውም ቀጥል</translation> -<translation id="8399276228600040370">በ<ph name="PASSWORD_MANAGER_BRAND" /> በተቀመጠው መለያዎ ይግቡ</translation> +<translation id="8399276228600040370">በ<ph name="PASSWORD_MANAGER_BRAND" /> በተቀመጠው መለያዎ ይግቡcro</translation> <translation id="8401363965527883709">ምልክት ያልተደረገበት አመልካች ሳጥን</translation> <translation id="8408402540408758445">የፍለጋ ውጤቶችን ቅድሚያ አምጣ</translation> <translation id="8410073653152358832">ይህን ስልክ ተጠቀም</translation> @@ -5134,6 +5169,7 @@ <translation id="8571108619753148184">አገልጋይ 4</translation> <translation id="8572832761467613633">ፍላሽ ብቻ</translation> <translation id="8572981282494768930">ጣቢያዎች ካሜራዎን እና ማይክሮፎንዎን እንዲደርሱባቸው አይፍቀዱ</translation> +<translation id="8574234089711453001">የሚዲያ ዩአርኤል ያለው ገጽ ሲከፈት የውርድ አዝራር እንዲታይ ይፍቀዱ።</translation> <translation id="857779305329188634">የሙከራ የQUIC ፕሮቶኮል ድጋፍ ያንቁ።</translation> <translation id="8579285237314169903"><ph name="NUMBER_OF_FILES" /> ንጥሎችን በማመሳሰል ላይ...</translation> <translation id="8579549103199280730">በነባሪነት ጠይቅ</translation> @@ -5189,6 +5225,7 @@ <translation id="8656768832129462377">አታረጋግጥ</translation> <translation id="8656946437567854031">ቀጥልን ጠቅ በማድረግ በ<ph name="LEGAL_DOC_LINK_TEXT_1" />፣ <ph name="LEGAL_DOC_LINK_TEXT_2" />፣ <ph name="LEGAL_DOC_LINK_TEXT_3" />፣ <ph name="LEGAL_DOC_LINK_TEXT_4" />፣ <ph name="LEGAL_DOC_LINK_TEXT_5" /> እና <ph name="LEGAL_DOC_LINK_TEXT_6" /> ይስማማሉ።</translation> <translation id="8658595122208653918">የአታሚ አማራጮችን ቀይር...</translation> +<translation id="8658645149275195032"><ph name="APP_NAME" /> የእርስዎን ማያ ገጽ እና ኦዲዮ ለ<ph name="TAB_NAME" /> እያጋራ ነው።</translation> <translation id="8659716501582523573">የአይ ፒ አድራሻ፦</translation> <translation id="8661290697478713397">አገናኙን ማን&ነትን በማያሳውቅ መስኮት ክፈት</translation> <translation id="8662795692588422978">ሰዎች</translation> @@ -5394,6 +5431,7 @@ <translation id="8942416694471994740">የማይክሮፎንዎ መዳረሻ በአስተዳዳሪዎ ቁጥጥር ነው ያለው።</translation> <translation id="894360074127026135">የNetscape አለምአቀፍ አወቃቀር</translation> <translation id="8944779739948852228">ማተሚያ ጥበቃ ተደርጎለታል</translation> +<translation id="8944964446326379280"><ph name="APP_NAME" /> አንድ መስኮት ለ<ph name="TAB_NAME" /> እያጋራ ነው።</translation> <translation id="8946359700442089734">የማረም ባህሪያት በዚህ የ<ph name="IDS_SHORT_PRODUCT_NAME" /> መሣሪያ ላይ ሙሉ ለሙሉ አልነቁም።</translation> <translation id="8946784827990177241">የWebUSB ድጋፍን አንቃ።</translation> <translation id="89515141420106838">ለአታሚ አንጻፊዎች የChrome ድር መደብር የሥነ ጥበብ ማዕከልን ያነቃል። መተግበሪያው ከተወሰነ የዩኤስቢ መታወቂያ ጋር ወደ የዩኤስቢ አታሚ ማተምን የሚደግፉ ቅጥያዎችን በChrome ድር መደብር ውስጥ ይፈልጋል።</translation> @@ -5412,6 +5450,7 @@ <translation id="8965037249707889821">የድሮ ይለፍ ቃል ያስገቡ</translation> <translation id="8965697826696209160">በቂ ቦታ የለም።</translation> <translation id="8968527460726243404">ChromeOS ስርዓት ምስል ጸሐፊ</translation> +<translation id="8970203673128054105">የcast ሁነታ ዝርዝር ይመልከቱ</translation> <translation id="89720367119469899">አምልጥ</translation> <translation id="8972513834460200407">ኬላው ከGoogle አገልጋዩች የሚመጡ ውርዶችን እያገደ አለመሆኑን ለማረጋገጥ እባክዎ የአውታረ መረብ አስተዳዳሪዎን ያግኙ።</translation> <translation id="8974161578568356045">ራስ ፈልግ</translation> @@ -5439,6 +5478,7 @@ <translation id="9011178328451474963">የመጨረሻ ትር</translation> <translation id="9013284500811652791"><ph name="UWS_NAME" />፣ <ph name="UWS_NAME" />፣ እና አንድ ተጨማሪ</translation> <translation id="9013587737291179248">ውይ! ክትትል የሚደረግበት ተጠቃሚ ማስመጣት አልተቻለም። እባክዎ የደረቅ አንጻፊዎ ቦታ እና ፍቃዶችን ያረጋግጡና እንደገና ይሞክሩ።</translation> +<translation id="901440679911238150">የመለያ ዝርዝሮችዎ ጊዜ ያለፈባቸው ናቸው። <ph name="BEGIN_LINK" />እንደገና ይግቡ<ph name="END_LINK" />።</translation> <translation id="9014987600015527693">ሌላ ስልክ አሳይ</translation> <translation id="9015601075560428829">የንግግር ግቤት</translation> <translation id="9016164105820007189">ከ«<ph name="DEVICE_NAME" />» ጋር በመገናኘት ላይ።</translation> @@ -5452,6 +5492,7 @@ <translation id="9025098623496448965">እሺ፣ ነገር ግን ተመልሰህ ወደ መግቢያ ገጹ ውሰደኝ</translation> <translation id="902638246363752736">የቁልፍ ሰሌዳ ቅንብሮች</translation> <translation id="9026731007018893674">የወረደ</translation> +<translation id="9027146684281895941">እነኚህ ሰው የሚጎበኙትን ድር ጣቢያዎች ለመቆጣጠር እና ለመመልከት ከእርስዎ Google መለያ ሲጎበኙ ክትትል ያድርጉባቸው።</translation> <translation id="9027459031423301635">አገናኙን በአዲስ &ትር ክፈት</translation> <translation id="9027603907212475920">ማመሳሰል አዋቅር…</translation> <translation id="9033453977881595182">የማስመሰያ መታወቂያ</translation> @@ -5486,7 +5527,7 @@ <translation id="9074739597929991885">ብሉቱዝ</translation> <translation id="9074836595010225693">የUSB መዳፊት ተገናኝቷል</translation> <translation id="9076523132036239772">ይቅርታ፣ ኢሜይልዎ ወይም የይለፍ ቃልዎ ሊረጋገጥ አልቻለም። መጀመሪያ ከአውታረ መረብ ጋር ለመገናኘት ይሞክሩ።</translation> -<translation id="9077132661879924646">በAndroid ላይ የተዋሃደ የሚዲያ መተላለፊያን ያሰናክላል።</translation> +<translation id="9077132661879924646">በAndroid ላይ የተዋሃደ የማህደረ መረጃ መተላለፊያን ያሰናክላል።</translation> <translation id="907841381057066561">በመጠቅለል ጊዜ ጊዜያዊ ዚፕ ፋይል መፍጠር አልተሳካም።</translation> <translation id="9083147368019416919">አለመመዝገብ አልተሳካም</translation> <translation id="9084064520949870008">እንደ መስኮት ክፈት</translation> @@ -5567,6 +5608,7 @@ <translation id="9203478404496196495">የትሮች ድምጸ-ከል አንሳ</translation> <translation id="9203962528777363226">የዚህ መሣሪያ አስተዳዳሪ አዲስ ተጠቃሚዎች እንዳይታከሉ አሰናክሏል</translation> <translation id="9205143043463108573">የመተግበሪያ አስጀማሪውን በመሬት ገጽታ ሁኔታ በማያ ገጹ መሃል ላይ ያስቀምጡት።</translation> +<translation id="9205160891051296441">የSystemTimezoneAutomaticDetection መመሪያ ድጋፍ</translation> <translation id="9206487995878691001">የካንግጂ ግቤት ስልት</translation> <translation id="9207194316435230304">ATOK</translation> <translation id="9208886416788010685">የAdobe Reader ጊዜው ያለፈበት ነው</translation> @@ -5588,6 +5630,7 @@ <translation id="939736085109172342">አዲስ ዓቃፊ</translation> <translation id="940425055435005472">የቅርጸ-ቁምፊ መጠን፦</translation> <translation id="941543339607623937">ልክ ያልሆነ ግላዊ ቁልፍ።</translation> +<translation id="942532530371314860"><ph name="APP_NAME" /> የChrome ትር እና ኦዲዮ እያጋራ ነው።</translation> <translation id="942954117721265519">በዚህ አቃፊ ውስጥ ምንም ምስሎች የሉም።</translation> <translation id="945522503751344254">ግብረ መልስ ላክ</translation> <translation id="946810925362320585">ምክር ተከተል</translation>
diff --git a/chrome/app/resources/generated_resources_ar.xtb b/chrome/app/resources/generated_resources_ar.xtb index 284abca4..fd1c2d9fd 100644 --- a/chrome/app/resources/generated_resources_ar.xtb +++ b/chrome/app/resources/generated_resources_ar.xtb
@@ -183,16 +183,19 @@ <translation id="1259724620062607540">عنصر الرف 7</translation> <translation id="1260240842868558614">عرض:</translation> <translation id="126710816202626562">لغة الترجمة:</translation> +<translation id="1269690813141254680">يمكنك التحكم في الطريقة التي تتبعها Google عند استخدام سجل التصفح لتخصيص البحث وخدمات Google الأخرى من <ph name="BEGIN_LINK" />عناصر التحكم في نشاط Google<ph name="END_LINK" />.</translation> <translation id="1272079795634619415">إيقاف</translation> <translation id="1272978324304772054">لا ينتمي حساب المستخدم هذا إلى النطاق المسجَّل به هذا الجهاز. إذا أردت التسجيل بنطاق مختلف، فيلزمك إجراء استرداد الجهاز أولاً.</translation> <translation id="127353061808977798">الخطوط والتشفير</translation> <translation id="1274997165432133392">ملفات تعريف الارتباط وبيانات الموقع الأخرى</translation> <translation id="1275718070701477396">محدد</translation> +<translation id="1277908057200820621">عرض قائمة الأجهزة</translation> <translation id="1278049586634282054">التحقق من العروض:</translation> <translation id="1278813325885878377">لوحة مفاتيح Qwerty المجرية</translation> <translation id="1285320974508926690">عدم ترجمة هذا الموقع مطلقًا</translation> <translation id="1285484354230578868">تخزين البيانات في حساب Google Drive</translation> <translation id="1290223615328246825">أخفق تسجيل الدخول التلقائي</translation> +<translation id="1293509594570842875">لا يُمكن إنشاء مستخدم جديد تحت الإشراف. يُرجى التحقق من اتصال الشبكة وإعادة المحاولة لاحقًا.</translation> <translation id="1293556467332435079">ملفات</translation> <translation id="1294298200424241932">تعديل إعدادات الثقة:</translation> <translation id="1295794900245526845">اختر حسابًا محفوظًا بـ <ph name="PASSWORD_MANAGER_BRAND" /> لتسجيل الدخول إليه</translation> @@ -291,6 +294,7 @@ <translation id="1429740407920618615">قوة الإشارة:</translation> <translation id="143027896309062157">قراءة جميع بياناتك وتغييرها على جهاز الكمبيوتر، ومواقع الويب التي تزورها</translation> <translation id="1430915738399379752">طباعة</translation> +<translation id="1433423644370450034">إشعار نمط الوسائط</translation> <translation id="1434696352799406980">سيعيد هذا تعيين صفحة بدء التشغيل، وصفحة علامة تبويب جديدة، ومحرك البحث، وعلامات التبويب المثبتة. وستعطِّل أيضًا جميع الإضافات وتمحو البيانات المؤقتة مثل ملفات تعريف الارتباط. ولن يتم محو الإشارات المرجعية، والسجل، وكلمات المرور المحفوظة.</translation> <translation id="1434886155212424586">الصفحة الرئيسية هي صفحة "علامة تبويب جديدة"</translation> <translation id="1435550882135542937">إعادة تصميم شريط أدوات الإضافات</translation> @@ -379,6 +383,7 @@ <translation id="1526925867532626635">تأكيد إعدادات المزامنة</translation> <translation id="1528372117901087631">اتصال الإنترنت</translation> <translation id="1529968269513889022">الأسبوع الماضي</translation> +<translation id="1531865825384516080">تقارير عناوين URL للبحث الآمن</translation> <translation id="1532697124104874386">تمكين/تعطيل النشر الذكي للوحة المفاتيح الافتراضية.</translation> <translation id="1533897085022183721">أقل من <ph name="MINUTES" />.</translation> <translation id="1533920822694388968">محاذاة التليفزيون</translation> @@ -662,7 +667,6 @@ <translation id="1962233722219655970">هذه الصفحة تستخدم تطبيق Native Client وهو لا يعمل على جهاز الكمبيوتر التابع لك.</translation> <translation id="1965328510789761112">ذاكرة خاصة</translation> <translation id="1965624977906726414">لا يتطلب أذونات خاصة.</translation> -<translation id="1968720524450620475">تمكين رموز الإجراء لإشعارات الويب.</translation> <translation id="1970746430676306437">&عرض معلومات الصفحة</translation> <translation id="197288927597451399">مواصلة</translation> <translation id="1973491249112991739">أخفق تنزيل <ph name="PLUGIN_NAME" />.</translation> @@ -760,6 +764,7 @@ <translation id="212862741129535676">نسبة إشغال حالة التردد</translation> <translation id="2128691215891724419">خطأ في المزامنة: تحديث عبارة مرور المزامنة...</translation> <translation id="2129904043921227933">خطأ في المزامنة: تحديث عبارة مرور المزامنة...</translation> +<translation id="2130053362119884302">السماح بفصل علامة التبويب في وضع ملء الشاشة</translation> <translation id="2131077480075264">تعذّر تثبيت "<ph name="APP_NAME" />" لأنه لم يُسمح به من قبل "<ph name="IMPORT_NAME" />"</translation> <translation id="2134149231879627725">دع Google تساعدك في قفل جهازك، ومحو بياناته، وتحديد موقعه عن بُعد.</translation> <translation id="2134986351331412790">هذا الموقع لا يقبل بطاقات الائتمان من نوع العلامة التجارية هذه</translation> @@ -772,6 +777,7 @@ <translation id="2143778271340628265">تهيئة يدوية للخادم الوكيل</translation> <translation id="2143915448548023856">إعدادات العرض</translation> <translation id="2144536955299248197">عارض الشهادة: <ph name="CERTIFICATE_NAME" /></translation> +<translation id="2147827593068025794">مزامنة الخلفية</translation> <translation id="2148756636027685713">انتهت عملية التنسيق</translation> <translation id="2148892889047469596">علامة التبويب "إرسال"</translation> <translation id="2148999191776934271">الشحن الباقي على ملء البطارية <ph name="HOUR" />:<ph name="MINUTE" /></translation> @@ -1148,6 +1154,7 @@ <translation id="2665717534925640469">هذه الصفحة في وضع ملء الشاشة الآن وتم تعطيل مؤشر الماوس.</translation> <translation id="2665919335226618153">عذرًا، حدث خطأ أثناء التنسيق.</translation> <translation id="2668079306436607263">التنقل عبر السجل بالتمرير الزائد</translation> +<translation id="2670102641511624474">يشارك <ph name="APP_NAME" /> علامة تبويب متصفح Chrome.</translation> <translation id="2670965183549957348">أسلوب الإدخال "Chewing"</translation> <translation id="2672142220933875349">ملف CRX غير صالح. تعذر فك الحزمة.</translation> <translation id="2672394958563893062">حدث خطأ. انقر لإعادة التشغيل من البداية.</translation> @@ -1194,6 +1201,7 @@ <translation id="2733364097704495499">هل ترغب في تسجيل الطابعة <ph name="PRINTER_NAME" /> في الطباعة في السحاب من Google؟</translation> <translation id="2735698359135166290">لوحة المفاتيح الرومانية القياسية</translation> <translation id="2737363922397526254">تصغير...</translation> +<translation id="2737755522130570180">حظر النصوص البرمجية التي تم تحميلها عبر document.write</translation> <translation id="2738771556149464852">آخر يوم للصلاحية</translation> <translation id="2739191690716947896">تصحيح الأخطاء</translation> <translation id="2739240477418971307">تغيير إعدادات إمكانية الوصول</translation> @@ -1263,6 +1271,7 @@ <translation id="2805646850212350655">نظام تشفير الملفات لـ Microsoft</translation> <translation id="2805707493867224476">السماح لجميع المواقع بعرض النوافذ المنبثقة</translation> <translation id="2805756323405976993">تطبيقات</translation> +<translation id="2808243220963392165">السماح بفصل علامات التبويب من شريط علامات التبويب عند التواجد في وضع ملء الشاشة على جهاز Mac.</translation> <translation id="2809142985846095314">تمكين عرض تحميل بطاقات الائتمان ذات الملء التلقائي</translation> <translation id="2809346626032021864">القراءة</translation> <translation id="2809586584051668049">و<ph name="NUMBER_ADDITIONAL_DISABLED" /> من الإضافات الأخرى</translation> @@ -1391,6 +1400,7 @@ <translation id="2968792643335932010">نُسخ أقل</translation> <translation id="2971033837577180453"><span>رقم التعريف:</span><ph name="EXTENSION_ID" /></translation> <translation id="2971213274238188218">خفوت</translation> +<translation id="2971422413423640756">زر "التنزيل" عند فتح صفحة باستخدام عنوان URL للوسائط.</translation> <translation id="2972557485845626008">البرامج الثابتة</translation> <translation id="2972581237482394796">إعا&دة</translation> <translation id="297870353673992530">خادم نظام أسماء النطاقات (DNS):</translation> @@ -1423,7 +1433,6 @@ <translation id="302014277942214887">أدخل معرف التطبيق أو عنوان URL للسوق الإلكتروني.</translation> <translation id="3020616530769498629">تمكين إعادة التحميل دون تحقق عند السحب للتحديث</translation> <translation id="3020990233660977256">الرقم التسلسلي: <ph name="SERIAL_NUMBER" /></translation> -<translation id="3021245547458004908">عند تمكين شريط الأدوات فإنّه لن يختفي مطلقًا بسبب التمرير على الأجهزة بشاشة بحد أدنى dp >=800. ولكن سيظل مختفيًا إذا عُرضت محتويات الصفحة في وضع ملء الشاشة.</translation> <translation id="3021678814754966447">عرض م&صدر الإطار</translation> <translation id="3024374909719388945">استخدام تنسيق 24 ساعة</translation> <translation id="3025022340603654002">تقديم اقتراحات الملء التلقائي عند النقر الأولي بالماوس على عنصر النموذج.</translation> @@ -1456,6 +1465,7 @@ <translation id="3057861065630527966">نسخ الصور ومقاطع الفيديو احتياطيًا</translation> <translation id="3058212636943679650">إذا احتجت يومًا لاسترداد نظام تشغيل الكمبيوتر، فسيتطلب ذلك توفر إما بطاقة SD أو رقاقة ذاكرة USB للاستعادة.</translation> <translation id="305932878998873762">ذاكرة التخزين المؤقت البسيطة لبروتوكول HTTP هي ذاكرة تخزين مؤقتة جديدة، حيث تعتمد على نظام الملفات لتوزيع مساحة القرص.</translation> +<translation id="3062606427884046423">استخدام إشعارات نمط الوسائط لنظام التشغيل Android لإشعارات الوسائط لمتصفح Chrome.</translation> <translation id="3064388234319122767">التحويل الصوتي (ذدرافو ← здраво)</translation> <translation id="3065041951436100775">التعليقات المرتبطة بعلامة التبويب المعطلة.</translation> <translation id="3065140616557457172">يمكنك طباعة كلمة أو عبارة للبحث في الويب أو إدخال عنوان URL للتجوال بين صفحات الويب. الخيار لك.</translation> @@ -1494,7 +1504,6 @@ <translation id="3117812041123364382">تمكين/تعطيل لوحة المفاتيح الظاهرية العائمة</translation> <translation id="3118319026408854581">مساعدة <ph name="PRODUCT_NAME" /></translation> <translation id="3120430004221004537">تشفير غير كافٍ لعملية معينة على: "<ph name="DEVICE_NAME" />".</translation> -<translation id="3121260210578524273">تمكين الرموز في أزرار الإجراءات لإشعارات الويب.</translation> <translation id="3121793941267913344">إعادة تعيين جهاز <ph name="IDS_SHORT_PRODUCT_NAME" /> هذا</translation> <translation id="3122162841865761901">تجارب أدوات مطوّري البرامج</translation> <translation id="3122464029669770682">وحدة المعالجة المركزية</translation> @@ -1539,6 +1548,7 @@ <translation id="3170072451822350649">يمكنك أيضًا تخطي تسجيل الدخول و<ph name="LINK_START" />التصفح كضيف<ph name="LINK_END" />.</translation> <translation id="3170544058711792988">إبقاء تركيز المكبّر متمركزًا على الشاشة</translation> <translation id="3172213052701798825">Google Smart Lock لكلمات المرور</translation> +<translation id="3175469972022788345">عند التمكين، سيستخدم WebRTC شهادات "ECDSA".</translation> <translation id="317583078218509884">ستسري إعدادات أذونات الموقع بعد إعادة تحميل الصفحة.</translation> <translation id="3177048931975664371">انقر لإخفاء كلمة المرور</translation> <translation id="3180365125572747493">الرجاء إدخال كلمة مرور لتشفير ملف الشهادة هذا.</translation> @@ -1990,6 +2000,7 @@ <translation id="3776796446459804932">هذه الإضافة تنتهك سياسة سوق Chrome الإلكتروني.</translation> <translation id="3778152852029592020">تم إلغاء التنزيل.</translation> <translation id="3778740492972734840">أ&دوات مطوري البرامج</translation> +<translation id="3780663724044634171">حدد حسابًا لإدارة المستخدم تحت الإشراف.</translation> <translation id="378312418865624974">الاطلاع على معرّف فريد لهذا الكمبيوتر</translation> <translation id="3783640748446814672">alt</translation> <translation id="3785308913036335955">إظهار اختصار التطبيقات</translation> @@ -2013,6 +2024,7 @@ <translation id="3807747707162121253">إل&غاء</translation> <translation id="3809280248639369696">شعاع القمر</translation> <translation id="3810973564298564668">إدارة محرّكات البحث</translation> +<translation id="3811494700605067549">تم تحديد ملف واحد</translation> <translation id="3812034401428455285"><ph name="UWS_NAME" /> و<ph name="UWS_NAME" /></translation> <translation id="3812525830114410218">شهادة سيئة</translation> <translation id="3813984289128269159">Ok Google</translation> @@ -2042,6 +2054,7 @@ <translation id="3838543471119263078">ملفات تعريف الارتباط وبيانات المواقع والمكونات الإضافية الأخرى</translation> <translation id="3839497635014791588">تعليقات اللمس الإضافية على مكونات واجهة المستخدم</translation> <translation id="3840053866656739575">انقطع الاتصال بجهازك Chromebox. يُرجى الاقتراب، أو التحقق من جهازك بينما نحاول إعادة الاتصال.</translation> +<translation id="3840055807562919428">لعدم السماح لعمليات جلب النصوص البرمجية المحظورة للمحلل اللغوي من طرف ثالث، التي تم إدخالها في الإطار الرئيسي عبر document.write.</translation> <translation id="3842552989725514455">خط Serif</translation> <translation id="3846593650622216128">يتم فرض هذه الإعدادات بواسطة إحدى الإضافات.</translation> <translation id="3846833722648675493">إظهار نوافذ التطبيقات بعد أول عملية رسم. ستظهر النوافذ بعد وقت طويل لاحقًا مع التطبيقات الثقيلة التي تحمِّل الموارد بشكل م</translation> @@ -2270,6 +2283,7 @@ <translation id="421017592316736757">يجب أن تكون متصلاً بالإنترنت للدخول إلى هذا الملف.</translation> <translation id="421182450098841253">&عرض شريط الإشارات</translation> <translation id="4212108296677106246">هل تريد الوثوق بـ "<ph name="CERTIFICATE_NAME" />" باعتبارها مرجعًا مصدقًا؟</translation> +<translation id="42126664696688958">تصدير</translation> <translation id="42137655013211669">الدخول إلى هذا المورد محظور من الخادم</translation> <translation id="4215350869199060536">عفوًا، يشتمل الاسم على رموز غير مسموح بها!</translation> <translation id="4215898373199266584">اعلم أنه يمكنك الاستفادة من وضع التصفح المتخفي <ph name="INCOGNITO_MODE_SHORTCUT" /> في المرة القادمة.</translation> @@ -2356,6 +2370,7 @@ <translation id="4359408040881008151">تم التثبيت بسبب الإضافة (الإضافات) التابعة.</translation> <translation id="4361190688154226069">استهداف المستطيل في المشاهدات</translation> <translation id="4364444725319685468">تم تنزيل <ph name="FILE_NAME" /></translation> +<translation id="4364567974334641491">يشارك <ph name="APP_NAME" /> نافذة.</translation> <translation id="4364830672918311045">عرض الإشعارات</translation> <translation id="4365673000813822030">عذرًا، توقفت المزامنة.</translation> <translation id="4366509400410520531">تم السماح بها بواسطتك</translation> @@ -2425,6 +2440,7 @@ <translation id="4479639480957787382">إيثرنت</translation> <translation id="4479812471636796472">لوحة المفاتيح الأمريكية Dvorak</translation> <translation id="4481249487722541506">تحميل إضافة تم فك حزمتها...</translation> +<translation id="4482194545587547824">قد يستخدم Google سجل التصفح لتخصيص البحث وخدمات Google الأخرى.</translation> <translation id="4487088045714738411">لوحة المفاتيح البلجيكية</translation> <translation id="4492190037599258964">نتائج البحث عن '<ph name="SEARCH_STRING" />'</translation> <translation id="4495021739234344583">إلغاء التسجيل وإعادة التشغيل</translation> @@ -2468,6 +2484,7 @@ <translation id="4554591392113183336">الإضافة الخارجية في نفس الإصدار أو إصدار أقل مقارنة بالموجودة حاليًا.</translation> <translation id="4554796861933393312">سرعة الصور المتحركة لـ Ink Drop للتصميم متعدد الأبعاد</translation> <translation id="4555769855065597957">ظل</translation> +<translation id="4556110439722119938">ستتم مزامنة الإشارات المرجعية والسجل وكلمات المرور والإعدادات الأخرى مع حسابك في Google لكي يتسنّى لك استخدامها على جميع أجهزتك</translation> <translation id="4557136421275541763">تحذير:</translation> <translation id="4558426062282641716">تمّ طلب إذن للتشغيل التلقائي</translation> <translation id="4563210852471260509">لغة الإدخال الأولية هي الصينية</translation> @@ -2588,6 +2605,7 @@ <translation id="4742746985488890273">تثبيت في الرف</translation> <translation id="474421578985060416">تم حظرها بواسطتك</translation> <translation id="4744574733485822359">اكتمل التنزيل</translation> +<translation id="4746330764136728131">استخدام شهادات "ECDSA" لـ WebRTC</translation> <translation id="4746971725921104503">يبدو أنك تدير مستخدم بهذا الاسم فعلاً. هل تريد <ph name="LINK_START" />استيراد <ph name="USER_DISPLAY_NAME" /> إلى هذا الجهاز<ph name="LINK_END" />؟</translation> <translation id="4747271164117300400">المقدونية</translation> <translation id="4749157430980974800">لوحة المفاتيح الجورجية</translation> @@ -2737,6 +2755,7 @@ <translation id="496226124210045887">المجلد الذي حددته يشتمل على ملفات حساسة. فهل تريد بالتأكيد منح "$1" حق الدخول الدائم للقراءة في هذا المجلد؟</translation> <translation id="4964673849688379040">جارٍ التحقق...</translation> <translation id="4966802378343010715">إنشاء حساب مستخدم جديد</translation> +<translation id="4967749818080339523">تحديد حساب</translation> <translation id="496888482094675990">يوفر تطبيق الملفات وصولاً سريعًا إلى الملفات التي حفظتها على Google Drive، أو سعة التخزين الخارجي، أو جهاز نظام التشغيل Chrome.</translation> <translation id="4971412780836297815">فتح عند اكتمال التنزيل</translation> <translation id="497244430928947428">لوحة المفاتيح الملايلامية (صوتية)</translation> @@ -2782,6 +2801,7 @@ <translation id="5038863510258510803">جارٍ التمكين...</translation> <translation id="5039512255859636053">$1 تيرابايت</translation> <translation id="5039804452771397117">سماح</translation> +<translation id="5043851552150732346">تم تحديد دليل واحد</translation> <translation id="5045550434625856497">كلمة مرور غير صحيحة</translation> <translation id="5048179823246820836">الإسكندنافيّة</translation> <translation id="5048294425697652159">تمكين برنامج Quirks لعرض المعايرة.</translation> @@ -2869,6 +2889,7 @@ <translation id="5170477580121653719">المساحة المتبقية في Google Drive: <ph name="SPACE_AVAILABLE" />.</translation> <translation id="5170568018924773124">العرض في المجلد</translation> <translation id="5171045022955879922">البحث أو إدخال عنوان URL</translation> +<translation id="5171343362375269016">ذاكرة مساحة التبديل</translation> <translation id="5175870427301879686">يريد <ph name="URL" /> تخزين بيانات في جهاز الكمبيوتر المحلي بشكل دائم.</translation> <translation id="5177479852722101802">متابعة حظر الدخول إلى الكاميرا والميكروفون</translation> <translation id="5177526793333269655">عرض الصور المصغرة</translation> @@ -3026,6 +3047,7 @@ <translation id="5380103295189760361">اضغط مع الاستمرار على Control أو Alt أو Shift أو Search لمشاهدة اختصارات لوحة المفاتيح لتلك المعدّلات.</translation> <translation id="5382392428640372740">تمكين تتبع التنقل</translation> <translation id="5388588172257446328">اسم المستخدم:</translation> +<translation id="5389237414310520250">تعذّر إنشاء المستخدم الجديد. يُرجى التحقق من مساحة محرك الأقراص الثابتة والأذونات، وإعادة المحاولة.</translation> <translation id="5390284375844109566">قاعدة بيانات مفهرسة</translation> <translation id="5392544185395226057">تمكين دعم Native Client.</translation> <translation id="5396126354477659676">يريد <ph name="PEPPER_PLUGIN_NAME" /> الموجود على <ph name="PEPPER_PLUGIN_DOMAIN" /> الدخول إلى جهاز الكمبيوتر.</translation> @@ -3093,6 +3115,7 @@ <translation id="5469954281417596308">مدير الإشارات</translation> <translation id="5470838072096800024">وقت آخر استلام</translation> <translation id="5473075389972733037">IBM</translation> +<translation id="5473279832922912143">تمكين "V8" لاستخدام مترجم التشغيل التجريبي لتنفيذ جافا سكريبت.</translation> <translation id="5474139872592516422">عند الانتهاء من تحديث <ph name="PLUGIN_NAME" />، أعد تحميل الصفحة لتنشيطه.</translation> <translation id="5480254151128201294">تم قفل هذا الجهاز من قبل المالك.</translation> <translation id="5483785310822538350">إبطال الوصول للملف والجهاز</translation> @@ -3120,6 +3143,7 @@ <translation id="5509914365760201064">جهة الإصدار: <ph name="CERTIFICATE_AUTHORITY" /></translation> <translation id="5511823366942919280">هل أنت متأكد من أنك تريد إعداد هذا الجهاز كـ "Shark"؟</translation> <translation id="5512653252560939721">يجب أن تكون شهادة المستخدم مستندة إلى الأجهزة.</translation> +<translation id="5513242761114685513">قائمة السياق</translation> <translation id="5515008897660088170">نوافذ تطبيق Toolkit-Views</translation> <translation id="551752069230578406">إضافة الطابعة إلى حسابك - قد يستغرق ذلك القليل من الوقت...</translation> <translation id="5518584115117143805">شهادة تشفير البريد الإلكتروني</translation> @@ -3300,7 +3324,6 @@ <translation id="577322787686508614">لا يُسمح بعملية القراءة على: "<ph name="DEVICE_NAME" />".</translation> <translation id="5774295353725270860">فتح تطبيق الملفات</translation> <translation id="5774515636230743468">البيان:</translation> -<translation id="5776006986202016118">هذا الموقع يريد الاتصال بـ:</translation> <translation id="577624874850706961">ملفات تعريف ارتباط البحث</translation> <translation id="5778550464785688721">التحكم الكامل في MIDI</translation> <translation id="5780066559993805332">(الأفضل)</translation> @@ -3378,6 +3401,7 @@ <translation id="5874045675243596003">فرض التقييد (حدوث إخفاق في حالة عدم الحصول على علامات تجزئة)</translation> <translation id="5875858680971105888">عفوًا، يتعذّر استيراد المستخدم الذي يخضع للإشراف. يُرجى التحقق من الاتصال بالإنترنت وإعادة المحاولة لاحقًا.</translation> <translation id="5880247576487732437">الرمز المميز جاهز للاستخدام</translation> +<translation id="5884474295213649357">علامة التبويب هذه متصلة بجهاز USB.</translation> <translation id="5885324376209859881">إدارة إعدادات الوسائط...</translation> <translation id="5889282057229379085">أقصى عدد من المراجع المصدقة المتوسطة (CA): <ph name="NUM_INTERMEDIATE_CA" /></translation> <translation id="5892290200158927959">لوحة مفاتيح BÉPO الفرنسية</translation> @@ -3467,6 +3491,8 @@ <translation id="604124094241169006">تلقائي</translation> <translation id="6042308850641462728">المزيد</translation> <translation id="604257181445267932">يساعدك Smart Lock على تسجيل الدخول بسرعة إلى التطبيقات والمواقع باستخدام كلمات المرور التي حفظتها مع Google.</translation> +<translation id="6043317578411397101">يشارك <ph name="APP_NAME" /> علامة تبويب متصفح Chrome من خلال <ph name="TAB_NAME" />.</translation> +<translation id="6044805581023976844">يشارك <ph name="APP_NAME" /> علامة تبويب متصفح Chrome والصوت من خلال <ph name="TAB_NAME" />.</translation> <translation id="6049065490165456785">صور من الكاميرا الداخلية</translation> <translation id="6051028581720248124">من خلال الطباعة إلى مكتب FedEx، فإنك توافق على <ph name="START_LINK" />بنود الاستخدام<ph name="END_LINK" /> الخاصة بهم.</translation> <translation id="6051086608691487286">أشرطة تمرير التراكب</translation> @@ -3596,6 +3622,7 @@ <translation id="6251889282623539337">بنود خدمة <ph name="DOMAIN" /></translation> <translation id="6251924700383757765">سياسة الخصوصية</translation> <translation id="6253586523465486793">تفرض إعادة التحميل دون تحقق لمُشغِّل السحب للتحديث (بينما يعني هذا عادةً إعادة التحميل للتحقق من ذاكرة التخزين المؤقت والمنتظم عند تعطيل العلامة).</translation> +<translation id="6254182355913122230">ذاكرة مساحة التبديل</translation> <translation id="6254503684448816922">اختراق المفتاح</translation> <translation id="6259104249628300056">اكتشاف الأجهزة الموجودة على شبكتك المحلية</translation> <translation id="6263082573641595914">إصدار المرجع المصدق (CA) لـ Microsoft</translation> @@ -3866,6 +3893,7 @@ <translation id="6680028776254050810">التبديل بين المستخدمين</translation> <translation id="6681668084120808868">التقاط صورة</translation> <translation id="668171684555832681">ملف تعريف آخر...</translation> +<translation id="6682083956260248340">التحكم في كيفية عمل هذا في <ph name="BEGIN_LINK" /></translation> <translation id="6686490380836145850">إغلاق علامات التبويب في الجهة اليسرى.</translation> <translation id="6686817083349815241">حفظ كلمة المرور</translation> <translation id="6689514201497896398">تجاوز عمليات التحقق من جذب المستخدم</translation> @@ -3933,10 +3961,12 @@ <translation id="6798954102094737107">المكوّن الإضافي: <ph name="PLUGIN_NAME" /></translation> <translation id="6802031077390104172"><ph name="USAGE" /> (<ph name="OID" />)</translation> <translation id="6804671422566312077">فتح كل الإشارات المرجعية في &نافذة جديدة</translation> +<translation id="6805542829187142700">تمكين سياسة الجهاز لاكتشاف المنطقة الزمنية تلقائيًا للنظام.</translation> <translation id="6805647936811177813">الرجاء تسجيل الدخول إلى <ph name="TOKEN_NAME" /> لاستيراد شهادة العميل من <ph name="HOST_NAME" />.</translation> <translation id="680572642341004180">تمكين تتبع RLZ في <ph name="SHORT_PRODUCT_OS_NAME" />.</translation> <translation id="6807889908376551050">إظهار الكل...</translation> <translation id="6809448577646370871">تشغيل النافذة المخصصة لتطبيقات Chrome.</translation> +<translation id="6810613314571580006">لتسجيل الدخول تلقائيًا إلى مواقع الويب باستخدام بيانات الاعتماد المخزّنة. عندما تكون الميزة معطّلة، سيُطلب منك التأكيد في كل مرة قبل تسجيل الدخول إلى أحد مواقع الويب.</translation> <translation id="6812349420832218321">لا يمكن تشغيل <ph name="PRODUCT_NAME" /> كجذر.</translation> <translation id="6812841287760418429">الإبقاء على التغييرات</translation> <translation id="6814124696888326520">لتبديل أسهل لأساليب الإدخال والوصول إلى المزيد من ميزات الإدخال: الإدخال الصوتي، والكتابة اليدوية والرموز التعبيرية.</translation> @@ -4125,6 +4155,7 @@ <translation id="7065534935986314333">حول النظام</translation> <translation id="7066944511817949584">أخفق الاتصال بـ "<ph name="DEVICE_NAME" />".</translation> <translation id="7067725467529581407">عدم عرض هذا مرةً أخرى.</translation> +<translation id="7068609958927777019">في حالة التمكين، يمكن الإبلاغ عن عناوين URL غير المناسبة للبحث الآمن.</translation> <translation id="7070804685954057874">الإدخال المباشر</translation> <translation id="7072010813301522126">اسم الاختصار</translation> <translation id="7072025625456903686">السماح للكل أو التخصيص</translation> @@ -4190,10 +4221,10 @@ <translation id="7170467426996704624">التحويل الصوتي (سلام ← ሰላም)</translation> <translation id="7172053773111046550">لوحة المفاتيح الإستونية</translation> <translation id="7173828187784915717">إعدادات إدخال "Chewing"</translation> +<translation id="7173917244679555">يبدو أنك تدير مستخدمًا من خلال هذا الاسم بالفعل. هل أردت <ph name="BEGIN_LINK" />الاستيراد <ph name="PROFILE_NAME" /><ph name="END_LINK" /> إلى هذا الجهاز؟</translation> <translation id="7175353351958621980">تم التحميل من:</translation> <translation id="7180611975245234373">تحديث</translation> <translation id="7180865173735832675">تخصيص</translation> -<translation id="7184428045150946911">تعطيل الإخفاء التلقائي لشريط الأدوات على الأجهزة اللوحية الكبيرة</translation> <translation id="7185690883425432021">يخفي أزرار الإغلاق لعلامات التبويب غير النشطة عندما يكون شريط علامات التبويب في وضع الحزمة.</translation> <translation id="7186088072322679094">البقاء مثبتًا في شريط الأدوات</translation> <translation id="719009910964971313">لوحة مفاتيح المطور الأمريكية Dvorak</translation> @@ -4258,6 +4289,7 @@ <translation id="7280825545668757494">مزامنة بيانات اعتماد WiFi</translation> <translation id="7280877790564589615">تمّ طلب إذن</translation> <translation id="7282547042039404307">سلسة</translation> +<translation id="7284549674086796566">مترجم جافا سكريبت التجريبي</translation> <translation id="7287143125007575591">تم رفض الدخول</translation> <translation id="7288592446024861651">ستتم مزامنة الإشارات المرجعية والسجل وكلمات المرور والإعدادات الأخرى إلى حسابك في Google حتى يتسنّى لك استخدامها على جميع أجهزتك. تحكَّم فيما تريد مزامنته على <ph name="BEGIN_LINK" /></translation> <translation id="7288676996127329262"><ph name="HORIZONTAL_DPI" />x<ph name="VERTICAL_DPI" /> نقطة لكل بوصة</translation> @@ -4280,6 +4312,7 @@ <translation id="7321545336522791733">خادم يتعذر الوصول إليه</translation> <translation id="7325437708553334317">إضافة التباين العالي</translation> <translation id="7326565110843845436">النقر بثلاثة أصابع على لوحة اللمس</translation> +<translation id="7327088014939803293">يتعذر إنشاء مستخدم جديد تحت الإشراف. يُرجى التأكد من تسجيل الدخول بشكل صحيح وإعادة المحاولة.</translation> <translation id="73289266812733869">غير محدد</translation> <translation id="7329154610228416156">فشل تسجيل الدخول نظرًا لأنه قد تم ضبطه على استخدام عنوان URL غير آمن <ph name="BLOCKED_URL" />. يُرجى الاتصال بالمسؤول.</translation> <translation id="7331786426925973633">متصفح ويب تم تصميمه للسرعة والسهولة والأمان</translation> @@ -4454,6 +4487,7 @@ <translation id="7573172247376861652">شحن البطارية</translation> <translation id="7576032389798113292">6x4</translation> <translation id="7576690715254076113">تجميع</translation> +<translation id="7580671184200851182">تشغيل نفس الصوت عبر جميع مكبرات الصوت (صوت أحادي)</translation> <translation id="7581279002575751816">المكونات الإضافية لـ NPAPI غير متوافقة.</translation> <translation id="7581462281756524039">أداة إزالة البرامج</translation> <translation id="7582582252461552277">تفضيل هذه الشبكة</translation> @@ -4686,6 +4720,7 @@ <translation id="7925686952655276919">عدم استخدام بيانات الجوال للمزامنة</translation> <translation id="7926906273904422255">وضع علامة على الأصول غير الآمنة كغير آمنة، أو "مشكوك فيها".</translation> <translation id="7928710562641958568">إخراج الجهاز</translation> +<translation id="79312157130859720">يشارك <ph name="APP_NAME" /> الشاشة والصوت.</translation> <translation id="7938594894617528435">في وضع عدم الاتصال حاليًا</translation> <translation id="7939374455203157513">تمكين خدمات السحاب</translation> <translation id="7939412583708276221">المتابعة على أية حال</translation> @@ -5121,6 +5156,7 @@ <translation id="8571108619753148184">Server 4</translation> <translation id="8572832761467613633">Flash فقط</translation> <translation id="8572981282494768930">عدم السماح بدخول مواقع الويب إلى الكاميرا والميكروفون</translation> +<translation id="8574234089711453001">السماح بعرض زر التنزيل عند فتح صفحة باستخدام عنوان URL للوسائط.</translation> <translation id="857779305329188634">تمكين التوافق مع بروتوكول QUIC التجريبي.</translation> <translation id="8579285237314169903">جارٍ مزامنة <ph name="NUMBER_OF_FILES" /> من البنود...</translation> <translation id="8579549103199280730">السؤال افتراضيًا</translation> @@ -5176,6 +5212,7 @@ <translation id="8656768832129462377">عدم التحقق</translation> <translation id="8656946437567854031">يُعد النقر على "متابعة" بمثابة موافقة منك على <ph name="LEGAL_DOC_LINK_TEXT_1" />، و<ph name="LEGAL_DOC_LINK_TEXT_2" />، و<ph name="LEGAL_DOC_LINK_TEXT_3" />، و<ph name="LEGAL_DOC_LINK_TEXT_4" />، و<ph name="LEGAL_DOC_LINK_TEXT_5" />، و<ph name="LEGAL_DOC_LINK_TEXT_6" />.</translation> <translation id="8658595122208653918">تغيير خيارات الطابعة...</translation> +<translation id="8658645149275195032">يشارك <ph name="APP_NAME" /> الشاشة والصوت من خلال <ph name="TAB_NAME" />.</translation> <translation id="8659716501582523573">عنوان IP:</translation> <translation id="8661290697478713397">ف&تح رابط في نافذة التصفح المتخفي</translation> <translation id="8662795692588422978">الأشخاص</translation> @@ -5381,6 +5418,7 @@ <translation id="8942416694471994740">الدخول إلى الميكروفون يخضع لتحكم المسؤول.</translation> <translation id="894360074127026135">الترقية الدولية لـ Netscape</translation> <translation id="8944779739948852228">تم اكتشاف طابعة</translation> +<translation id="8944964446326379280">يشارك <ph name="APP_NAME" /> نافذة من خلال <ph name="TAB_NAME" />.</translation> <translation id="8946359700442089734">لم يتم تمكين ميزات التصحيح كليًا على هذا الجهاز <ph name="IDS_SHORT_PRODUCT_NAME" />.</translation> <translation id="8946784827990177241">تمكين دعم WebUSB.</translation> <translation id="89515141420106838">تمكين تطبيق معرض سوق Chrome الإلكتروني لبرامج تشغيل الطابعة. يبحث التطبيق في سوق Chrome الإلكتروني عن الإضافات التي تدعم الطباعة إلى طابعة USB مع رقم تعريف USB محدد.</translation> @@ -5399,6 +5437,7 @@ <translation id="8965037249707889821">إدخال كلمة المرور القديمة</translation> <translation id="8965697826696209160">ليست هناك مساحة كافية.</translation> <translation id="8968527460726243404">كاتب الصور لنظام ChromeOS</translation> +<translation id="8970203673128054105">عرض قائمة وضع الإرسال</translation> <translation id="89720367119469899">خروج</translation> <translation id="8972513834460200407">الرجاء التحقق مع مشرف الشبكة للتأكد من عدم حظر الجدار الناري للتنزيلات من خوادم Google.</translation> <translation id="8974161578568356045">اكتشاف تلقائي</translation> @@ -5426,6 +5465,7 @@ <translation id="9011178328451474963">علامة التبويب السابقة</translation> <translation id="9013284500811652791"><ph name="UWS_NAME" />، و<ph name="UWS_NAME" />، وبرنامج واحد آخر</translation> <translation id="9013587737291179248">عفوًا، تعذّر استيراد المستخدم الذي يخضع للإدارة. يُرجى التحقق من مساحة محرك الأقراص الثابتة والأذونات، وإعادة المحاولة.</translation> +<translation id="901440679911238150">تفاصيل حسابك قديمة. <ph name="BEGIN_LINK" />سجّل الدخول مرةً أخرى<ph name="END_LINK" />.</translation> <translation id="9014987600015527693">عرض هاتف آخر</translation> <translation id="9015601075560428829">إدخال الكلام</translation> <translation id="9016164105820007189">جارٍ الاتصال بـ "<ph name="DEVICE_NAME" />".</translation> @@ -5439,6 +5479,7 @@ <translation id="9025098623496448965">حسنًا، أعدني إلى شاشة تسجيل الدخول</translation> <translation id="902638246363752736">إعدادات لوحة المفاتيح</translation> <translation id="9026731007018893674">تنزيل</translation> +<translation id="9027146684281895941">يمكنك الإشراف على هذا الشخص للتحكم في مواقع الويب التي يزورها وعرضها من حسابك في Google.</translation> <translation id="9027459031423301635">فتح الرابط في &علامة تبويب جديدة</translation> <translation id="9027603907212475920">إعداد المزامنة...</translation> <translation id="9033453977881595182">رقم تعريف الرمز المميز</translation> @@ -5554,6 +5595,7 @@ <translation id="9203478404496196495">إلغاء تجاهل علامة التبويب</translation> <translation id="9203962528777363226">عطل مشرف هذا الجهاز إمكانية إضافة مستخدمين جدد.</translation> <translation id="9205143043463108573">لوضع Launcher تطبيقات في وسط الشاشة باتجاه أفقي.</translation> +<translation id="9205160891051296441">دعم سياسة SystemTimezoneAutomaticDetection</translation> <translation id="9206487995878691001">أسلوب الإدخال لنظام Cangjie</translation> <translation id="9207194316435230304">ATOK</translation> <translation id="9208886416788010685">برنامج Adobe Reader غير محدث</translation> @@ -5575,6 +5617,7 @@ <translation id="939736085109172342">مجلد جديد</translation> <translation id="940425055435005472">حجم الخط:</translation> <translation id="941543339607623937">المفتاح الخاص غير صالح.</translation> +<translation id="942532530371314860">يشارك <ph name="APP_NAME" /> علامة تبويب متصفح Chrome والصوت.</translation> <translation id="942954117721265519">لا تتوفر أية صور في هذا الدليل.</translation> <translation id="945522503751344254">إرسال تعليقات</translation> <translation id="946810925362320585">اتباع التوصية</translation>
diff --git a/chrome/app/resources/generated_resources_bg.xtb b/chrome/app/resources/generated_resources_bg.xtb index bcd7ea08..28fc76e 100644 --- a/chrome/app/resources/generated_resources_bg.xtb +++ b/chrome/app/resources/generated_resources_bg.xtb
@@ -658,7 +658,6 @@ <translation id="1962233722219655970">Тази страница използва приложение за клиент с директно изпълнение, което не работи на компютъра ви.</translation> <translation id="1965328510789761112">Частна памет</translation> <translation id="1965624977906726414">Няма специални разрешения.</translation> -<translation id="1968720524450620475">Активиране на иконите за действия за известията от мрежата.</translation> <translation id="1970746430676306437">Преглед на информацията за страни&цата</translation> <translation id="197288927597451399">Запазване</translation> <translation id="1973491249112991739">Изтеглянето на <ph name="PLUGIN_NAME" /> не бе успешно.</translation> @@ -1420,7 +1419,6 @@ <translation id="302014277942214887">Въведете идентификационен номер на приложение или URL адрес на уеб магазин.</translation> <translation id="3020616530769498629">Активиране на презареждането без проверка при издърпване надолу за опресняване</translation> <translation id="3020990233660977256">Сериен номер: <ph name="SERIAL_NUMBER" /></translation> -<translation id="3021245547458004908">Когато функцията е активирана, лентата с инструменти ще е винаги видима при превъртане на устройства, чиято минимална плътност на екрана е по-голяма или равна на 800 dp. Лентата ще остане скрита, ако съдържанието на страницата е на цял екран.</translation> <translation id="3021678814754966447">&Преглед на изходния код на рамката</translation> <translation id="3024374909719388945">Използване на 24-часов часовник</translation> <translation id="3025022340603654002">Даване на предложения за автоматично попълване при първото кликване с мишката върху елемент от формуляр.</translation> @@ -1491,7 +1489,6 @@ <translation id="3117812041123364382">Активиране/деактивиране на плаващата виртуална клавиатура.</translation> <translation id="3118319026408854581">Помощ за <ph name="PRODUCT_NAME" /></translation> <translation id="3120430004221004537">Недостатъчно шифроване за дадена операция на: <ph name="DEVICE_NAME" />.</translation> -<translation id="3121260210578524273">Активирайте иконите в бутоните за действия за известията от мрежата.</translation> <translation id="3121793941267913344">Възстановяване на това устройство с <ph name="IDS_SHORT_PRODUCT_NAME" /></translation> <translation id="3122162841865761901">Експерименти в инструментите за програмисти</translation> <translation id="3122464029669770682">Процесор</translation> @@ -2272,6 +2269,7 @@ <translation id="421017592316736757">Трябва да сте онлайн, за да осъществите достъп до този файл.</translation> <translation id="421182450098841253">&Показване на лентата на отметките</translation> <translation id="4212108296677106246">Искате ли да имате доверие на „<ph name="CERTIFICATE_NAME" />“ като сертифициращ орган?</translation> +<translation id="42126664696688958">Експортиране</translation> <translation id="42137655013211669">Достъпът до този ресурс бе забранен от сървъра.</translation> <translation id="4215350869199060536">Ами сега! Името съдържа невалидни символи!</translation> <translation id="4215898373199266584">Не забравяйте, че режим „инкогнито“ (<ph name="INCOGNITO_MODE_SHORTCUT" />) може да е полезен следващия път.</translation> @@ -3304,7 +3302,6 @@ <translation id="577322787686508614">Операцията за четене не е разрешена на: <ph name="DEVICE_NAME" />.</translation> <translation id="5774295353725270860">Отваряне на приложението за файлове</translation> <translation id="5774515636230743468">Манифест:</translation> -<translation id="5776006986202016118">Този сайт иска да се свърже със:</translation> <translation id="577624874850706961">Търсене</translation> <translation id="5778550464785688721">Пълен контрол над MIDI устройства</translation> <translation id="5780066559993805332">(Най-добро)</translation> @@ -4193,7 +4190,6 @@ <translation id="7175353351958621980">Заредено от:</translation> <translation id="7180611975245234373">Опресняване</translation> <translation id="7180865173735832675">Персонализиране</translation> -<translation id="7184428045150946911">Деактивиране на автоматичното скриване на лентата с инструменти на големи таблети</translation> <translation id="7185690883425432021">Скрива бутоните за затваряне на неактивните раздели, когато лентата с раздели е в режим на наслагване.</translation> <translation id="7186088072322679094">Запазване в лентата с инструменти</translation> <translation id="719009910964971313">Американска (Дворак) клавиатура за програмисти</translation>
diff --git a/chrome/app/resources/generated_resources_bn.xtb b/chrome/app/resources/generated_resources_bn.xtb index 95c2cd4..e3ce076 100644 --- a/chrome/app/resources/generated_resources_bn.xtb +++ b/chrome/app/resources/generated_resources_bn.xtb
@@ -661,7 +661,6 @@ <translation id="1962233722219655970">এই পৃষ্ঠাটি একটি নেটিভ ক্লায়েন্ট অ্যাপ্লিকেশন ব্যবহার করে যা আপনার কম্পিউটারে কাজ করে না৷</translation> <translation id="1965328510789761112">ব্যক্তিগত স্মৃতি</translation> <translation id="1965624977906726414">কোনো বিশেষ অনুমতি নেই৷</translation> -<translation id="1968720524450620475">ওয়েব বিজ্ঞপ্তিগুলির জন্য ক্রিয়া আইকন সক্ষম করে।</translation> <translation id="1970746430676306437">পৃষ্ঠা &তথ্য দেখুন</translation> <translation id="197288927597451399">রাখুন</translation> <translation id="1973491249112991739"><ph name="PLUGIN_NAME" /> ডাউনলোড ব্যর্থ হয়েছে৷</translation> @@ -1423,7 +1422,6 @@ <translation id="302014277942214887">অ্যাপ্লিকেশান ID বা ওয়েব দোকানের URL লিখুন৷</translation> <translation id="3020616530769498629">রিফ্রেশ-করতে-টানুন এর সময় যাচাই-অসমর্থন করা পুনঃলোড করণ সক্ষম করে</translation> <translation id="3020990233660977256">ক্রমিক সংখ্যা: <ph name="SERIAL_NUMBER" /></translation> -<translation id="3021245547458004908">সক্ষম করা হলে, সর্বনিম্ন স্ক্রীন dp >= ৮০০ এর ডিভাইসগুলিতে স্ক্রলিংয়ের কারণে সরঞ্জামদণ্ড কখনোই লুকানো হবে না। তবে পৃষ্ঠার বিষয়বস্তু পূর্ণ স্ক্রীনে গেলে, তখন এটি আড়াল করা হবে।</translation> <translation id="3021678814754966447">ফ্রেম উৎস &দেখুন</translation> <translation id="3024374909719388945">24-ঘন্টার ঘড়ি ব্যবহার করুন</translation> <translation id="3025022340603654002">একটি উপাদানের ফর্মের উপর প্রাথমিক মাউস ক্লিক করার স্বতঃপূর্ণ পরামর্শগুলি তৈরি করুন৷</translation> @@ -1493,7 +1491,6 @@ <translation id="3117812041123364382">ভাসমান ভার্চুয়াল কীবোর্ড সক্ষম/অক্ষম করুন।</translation> <translation id="3118319026408854581"><ph name="PRODUCT_NAME" /> সহায়তা</translation> <translation id="3120430004221004537">এখানে একটি নির্দিষ্ট ক্রিয়াকলাপের জন্য অপর্যাপ্ত এনক্রিপশান: "<ph name="DEVICE_NAME" />"।</translation> -<translation id="3121260210578524273">ওয়েব বিজ্ঞপ্তির জন্য ক্রিয়া বোতামগুলিতে আইকন সক্ষম করে।</translation> <translation id="3121793941267913344">এই <ph name="IDS_SHORT_PRODUCT_NAME" /> ডিভাইসটি পুনরায় সেট করুন</translation> <translation id="3122162841865761901">বিকাশকারী সরঞ্জামগুলির পরীক্ষা</translation> <translation id="3122464029669770682">CPU</translation> @@ -2269,6 +2266,7 @@ <translation id="421017592316736757">আপনার এই ফাইলটিতে অ্যাক্সেস পেতে অনলাইন হওয়া আবশ্যক৷</translation> <translation id="421182450098841253">&বুকমার্ক দণ্ড দেখান</translation> <translation id="4212108296677106246">আপনি কি "<ph name="CERTIFICATE_NAME" />"কে শংসাপত্র কর্তৃপক্ষ হিসাবে বিশ্বাস করতে চান?</translation> +<translation id="42126664696688958">রপ্তানি</translation> <translation id="42137655013211669">এই সম্পদে অ্যাক্সেস করা সার্ভার দ্বারা নিষিদ্ধ ছিল।</translation> <translation id="4215350869199060536">উপস, নামে অবৈধ চিহ্ন রয়েছে!</translation> <translation id="4215898373199266584">চুপ! ছদ্মবেশী মোড (<ph name="INCOGNITO_MODE_SHORTCUT" />) পরের বার কাজে লাগতে পারে৷</translation> @@ -3298,7 +3296,6 @@ <translation id="577322787686508614">"<ph name="DEVICE_NAME" />" এ পড়ার ক্রিয়াকলাপ অনুমোদিত নয়।</translation> <translation id="5774295353725270860">ফাইল অ্যাপ্লিকেশন খুলুন</translation> <translation id="5774515636230743468">সুস্পষ্ট:</translation> -<translation id="5776006986202016118">এই সাইটটি এর সাথে সংযোগ করতে চায়:</translation> <translation id="577624874850706961">কুকিজ অনুসন্ধান করুন</translation> <translation id="5778550464785688721">MIDI ডিভাইসসমূহ পূর্ণ নিয়ন্ত্রণ</translation> <translation id="5780066559993805332">(সেরা)</translation> @@ -4189,7 +4186,6 @@ <translation id="7175353351958621980">এখান থেকে লোড হয়েছে:</translation> <translation id="7180611975245234373">রিফ্রেশ করুন</translation> <translation id="7180865173735832675">কাস্টমাইজ করুন</translation> -<translation id="7184428045150946911">বড় ট্যাবলেটে স্বতঃলুকানোর সরঞ্জাম দণ্ডটি অক্ষম করুন</translation> <translation id="7185690883425432021">ট্র্যাবস্ট্রিপ যখন স্ট্যাক করা মোডে থাকে তখন নিষ্ক্রিয় ট্যাবগুলির বন্ধ বোতামগুলি গোপন করে।</translation> <translation id="7186088072322679094">সরঞ্জাম দণ্ডের মধ্যে রাখুন</translation> <translation id="719009910964971313">মার্কিন যুক্তরাষ্ট্র প্রোগ্রামার ডিভোরাক কীবোর্ড</translation>
diff --git a/chrome/app/resources/generated_resources_ca.xtb b/chrome/app/resources/generated_resources_ca.xtb index cc32c98..9c47848 100644 --- a/chrome/app/resources/generated_resources_ca.xtb +++ b/chrome/app/resources/generated_resources_ca.xtb
@@ -661,7 +661,6 @@ <translation id="1962233722219655970">Aquesta pàgina fa servir una aplicació de Native Client que no funciona al vostre ordinador.</translation> <translation id="1965328510789761112">Memòria privada</translation> <translation id="1965624977906726414">No té permisos especials.</translation> -<translation id="1968720524450620475">Activa les icones d'acció per a les notificacions web.</translation> <translation id="1970746430676306437">Visualitza la &informació de la pàgina</translation> <translation id="197288927597451399">Conserva</translation> <translation id="1973491249112991739">No s'ha pogut baixar <ph name="PLUGIN_NAME" />.</translation> @@ -1422,7 +1421,6 @@ <translation id="302014277942214887">Introduïu l'ID d'aplicació o l'URL del Web Store.</translation> <translation id="3020616530769498629">Activa l'opció de tornar a carregar sense validació en la funció lliscar per actualitzar</translation> <translation id="3020990233660977256">Número de sèrie: <ph name="SERIAL_NUMBER" /></translation> -<translation id="3021245547458004908">Si s'activa, la barra d'eines no s'amaga mai quan l'usuari es desplaça per la pàgina des d'un dispositiu amb una pantalla de 800 dp com a mínim. Sí que s'amaga si el contingut de la pàgina es mostra en pantalla completa.</translation> <translation id="3021678814754966447">&Visualitza l'origen del marc</translation> <translation id="3024374909719388945">Utilitza el rellotge de 24 hores</translation> <translation id="3025022340603654002">Fer suggeriments d'emplenament automàtic en fer clic per primera vegada en un element de formulari.</translation> @@ -1493,7 +1491,6 @@ <translation id="3117812041123364382">Activa o desactiva el teclat virtual flotant.</translation> <translation id="3118319026408854581">Ajuda de <ph name="PRODUCT_NAME" /></translation> <translation id="3120430004221004537">El nivell d'encriptació no és prou alt per a una operació determinada a <ph name="DEVICE_NAME" />.</translation> -<translation id="3121260210578524273">Activa les icones als botons d'acció per a les notificacions web.</translation> <translation id="3121793941267913344">Restabliu aquest dispositiu <ph name="IDS_SHORT_PRODUCT_NAME" />.</translation> <translation id="3122162841865761901">Experiments d'Eines per a desenvolupadors</translation> <translation id="3122464029669770682">CPU</translation> @@ -2273,6 +2270,7 @@ <translation id="421017592316736757">Heu d'estar en línia per accedir a aquest fitxer.</translation> <translation id="421182450098841253">&Mostra la Barra d'adreces d'interès</translation> <translation id="4212108296677106246">Voleu confiar en "<ph name="CERTIFICATE_NAME" />" com a entitat emissora de certificats?</translation> +<translation id="42126664696688958">Exporta</translation> <translation id="42137655013211669">El servidor ha prohibit l'accés a aquest recurs.</translation> <translation id="4215350869199060536">El nom conté símbols no permesos.</translation> <translation id="4215898373199266584">El mode d'incògnit, <ph name="INCOGNITO_MODE_SHORTCUT" />, us pot resultar pràctic la propera vegada.</translation> @@ -2445,7 +2443,7 @@ <translation id="4509017836361568632">Descarta la foto</translation> <translation id="4509345063551561634">Ubicació:</translation> <translation id="4514542542275172126">Configura un usuari supervisat nou</translation> -<translation id="4514914692061505365">Força l'ús del traductor ràpid Subzero del PNaCl en tots els fitxers pexe.</translation> +<translation id="4514914692061505365">Força l'ús del traductor ràpid Subzero del PNaCl en tots els fitxers executables portables.</translation> <translation id="4518677423782794009">Us trobeu que Chrome falla o mostra pàgines d'inici poc habituals, barres d'eines o anuncis inesperats de què no us podeu desfer? Altera la vostra experiència de navegació de cap altra manera? Executeu l'Eina per netejar Chrome per mirar de solucionar el problema.</translation> <translation id="452039078290142656">dispositius desconeguts del proveïdor <ph name="VENDOR_NAME" /></translation> <translation id="4522570452068850558">Detalls</translation> @@ -2905,7 +2903,7 @@ <translation id="5227808808023563348">Cerca el text anterior</translation> <translation id="5228076606934445476">S'ha produït algun error amb el dispositiu. Per recuperar-vos d'aquest error, cal que reinicieu el dispositiu i ho torneu a provar.</translation> <translation id="5228962187251412618">Només comprovació en línia</translation> -<translation id="5229622432348746578">Desactiva l'àudio als escriptoris compartits</translation> +<translation id="5229622432348746578">Desactiva l'àudio compartit a l'escriptori</translation> <translation id="5230516054153933099">Finestra</translation> <translation id="5232178406098309195">En utilitzar les ordres d'activació de l'àudio, com ara "Ok Google" o tocar una icona de micròfon, la funció d'activitat privada de veu i d'àudio emmagatzema algunes d'aquestes activitats al vostre compte. Es desa un enregistrament de la veu o de l'àudio següent, a més d'uns quants segons anteriors.</translation> <translation id="523299859570409035">Excepcions de notificacions</translation> @@ -3302,7 +3300,6 @@ <translation id="577322787686508614">L'operació de lectura no es permet a <ph name="DEVICE_NAME" />.</translation> <translation id="5774295353725270860">Obre l'aplicació Fitxers</translation> <translation id="5774515636230743468">Manifest:</translation> -<translation id="5776006986202016118">El lloc vol connectar-se a:</translation> <translation id="577624874850706961">Cerca galetes</translation> <translation id="5778550464785688721">Control total dels dispositius MIDI</translation> <translation id="5780066559993805332">(La millor)</translation> @@ -3701,7 +3698,7 @@ <translation id="6418505248408153264">Activa l'historial de Material Design</translation> <translation id="6419288379019356534"><ph name="BEGIN_BOLD" /><ph name="DOMAIN" /><ph name="END_BOLD" /> gestiona aquest dispositiu. <ph name="LINE_BREAK" /> - Feu clic a Següent per continuar iniciant la sessió al compte del domini <ph name="BEGIN_BOLD" /><ph name="DOMAIN" /><ph name="END_BOLD" />.</translation> + Feu clic a Següent per continuar amb l'inici de sessió al compte del domini <ph name="BEGIN_BOLD" /><ph name="DOMAIN" /><ph name="END_BOLD" />.</translation> <translation id="6419902127459849040">Europa central</translation> <translation id="6420676428473580225">Afegeix a l'escriptori</translation> <translation id="6422329785618833949">Foto girada</translation> @@ -3953,7 +3950,7 @@ <translation id="6825883775269213504">Rus</translation> <translation id="6827236167376090743">La reproducció d'aquest vídeo continuarà indefinidament.</translation> <translation id="6828153365543658583">Restringeix l'inici de sessió als usuaris següents:</translation> -<translation id="6828434191343384461">Les dades seleccionades s'han suprimit de Chrome i dels dispositius sincronitzats. És possible que el vostre compte de Google tingui altres formes de l'historial de navegació, com ara les cerques i l'activitat d'altres serveis de Google a l'adreça <ph name="BEGIN_LINK" />history.google.com<ph name="END_LINK" />.</translation> +<translation id="6828434191343384461">Les dades seleccionades s'han suprimit de Chrome i dels dispositius sincronitzats. És possible que el vostre compte de Google tingui altres formes de l'historial de navegació, com ara les cerques i l'activitat d'altres serveis de Google a <ph name="BEGIN_LINK" />history.google.com<ph name="END_LINK" />.</translation> <translation id="6828860976882136098">No s'han pogut configurar actualitzacions automàtiques per a tots els usuaris (error d'execució preliminar: <ph name="ERROR_NUMBER" />)</translation> <translation id="6829250331733125857">Obteniu ajuda per al dispositiu <ph name="DEVICE_TYPE" />.</translation> <translation id="6829270497922309893">Inscripció a la vostra organització</translation> @@ -4034,7 +4031,7 @@ <translation id="6965382102122355670">D'acord</translation> <translation id="6965648386495488594">Port</translation> <translation id="6965978654500191972">Dispositiu</translation> -<translation id="6969104364835835175">Força Subzero del PNaCl</translation> +<translation id="6969104364835835175">Força Subzero de PNaCl</translation> <translation id="6970230597523682626">Búlgar</translation> <translation id="6970480684834282392">Tipus d'inici</translation> <translation id="6970856801391541997">Imprimeix pàgines específiques</translation> @@ -4192,7 +4189,6 @@ <translation id="7175353351958621980">Carregat des de:</translation> <translation id="7180611975245234373">Actualitza</translation> <translation id="7180865173735832675">Personalitza</translation> -<translation id="7184428045150946911">Desactiva l'opció per amagar automàticament la barra d'eines en tauletes grans</translation> <translation id="7185690883425432021">Amaga els botons per tancar en pestanyes inactives quan les pestanyes estan en mode apilat.</translation> <translation id="7186088072322679094">Conserva a la barra d'eines</translation> <translation id="719009910964971313">Teclat Dvorak nord-americà per a programadors</translation> @@ -5238,7 +5234,7 @@ <translation id="8737685506611670901">Obrir els enllaços del protocol <ph name="PROTOCOL" /> en lloc del gestor <ph name="REPLACED_HANDLER_TITLE" /></translation> <translation id="8737709691285775803">Shill</translation> <translation id="8741881454555234096">Defineix millor la posició d'un gest tàctil per poder compensar els tocs que tenen poca resolució en comparació amb un ratolí.</translation> -<translation id="8741995161408053644">És possible que el vostre compte de Google tingui altres formes de l'historial de navegació a l'adreça <ph name="BEGIN_LINK" />history.google.com<ph name="END_LINK" />.</translation> +<translation id="8741995161408053644">És possible que el vostre compte de Google tingui altres formes de l'historial de navegació a <ph name="BEGIN_LINK" />history.google.com<ph name="END_LINK" />.</translation> <translation id="8743712320294854924">Mostra opcions d'entrada ampliades al prestatge.</translation> <translation id="874420130893181774">Mètode d'introducció de pinyin tradicional</translation> <translation id="8744525654891896746">Selecció d'un avatar per a l'usuari supervisat</translation>
diff --git a/chrome/app/resources/generated_resources_cs.xtb b/chrome/app/resources/generated_resources_cs.xtb index 6485386e..fbc82af 100644 --- a/chrome/app/resources/generated_resources_cs.xtb +++ b/chrome/app/resources/generated_resources_cs.xtb
@@ -662,7 +662,6 @@ <translation id="1962233722219655970">Tato stránka používá aplikaci nativního klienta, která ve vašem počítači nefunguje.</translation> <translation id="1965328510789761112">Privátní paměť</translation> <translation id="1965624977906726414">Nemá žádná zvláštní oprávnění.</translation> -<translation id="1968720524450620475">Povolit ikony akcí pro oznámení Web Notifications</translation> <translation id="1970746430676306437">Zobrazit &informace o stránkách</translation> <translation id="197288927597451399">Uložit</translation> <translation id="1973491249112991739">Stahování pluginu <ph name="PLUGIN_NAME" /> selhalo. </translation> @@ -1421,7 +1420,6 @@ <translation id="302014277942214887">Zadejte identifikátor aplikace nebo URL internetového obchodu.</translation> <translation id="3020616530769498629">Aktivovat opětovné načtení bez ověření při žádostech o obnovení</translation> <translation id="3020990233660977256">Sériové číslo: <ph name="SERIAL_NUMBER" /></translation> -<translation id="3021245547458004908">Pokud je tento příznak zapnut, lišta se na zařízeních s výškou obrazovky minimálně 800 dp při posouvání nikdy neskryje. I nadále se skryje, pokud se obsah stránky zobrazí na celou obrazovku.</translation> <translation id="3021678814754966447">Zobrazit zdrojo&vý kód rámce</translation> <translation id="3024374909719388945">Použít hodiny s formátem 24 h</translation> <translation id="3025022340603654002">Provádět návrhy automatického vyplnění při prvním kliknutí na prvek formuláře.</translation> @@ -1492,7 +1490,6 @@ <translation id="3117812041123364382">Umožňuje aktivovat či zakázat plovoucí virtuální klávesnici.</translation> <translation id="3118319026408854581">Nápověda aplikace <ph name="PRODUCT_NAME" /></translation> <translation id="3120430004221004537">Šifrování je pro danou operaci na zařízení <ph name="DEVICE_NAME" /> nedostatečné.</translation> -<translation id="3121260210578524273">Povolit ikony v tlačítkách akcí oznámení Web Notifications.</translation> <translation id="3121793941267913344">Resetování tohoto zařízení <ph name="IDS_SHORT_PRODUCT_NAME" /></translation> <translation id="3122162841865761901">Experimenty v Nástrojích pro vývojáře</translation> <translation id="3122464029669770682">CPU</translation> @@ -2270,6 +2267,7 @@ <translation id="421017592316736757">Pro přístup k souboru musíte být online.</translation> <translation id="421182450098841253">&Zobrazit lištu záložek</translation> <translation id="4212108296677106246">Chcete certifikátu <ph name="CERTIFICATE_NAME" /> důvěřovat jako certifikační autoritě?</translation> +<translation id="42126664696688958">Exportovat</translation> <translation id="42137655013211669">Server zakázal přístup k tomuto zdroji.</translation> <translation id="4215350869199060536">Jejda, název obsahuje zakázané znaky!</translation> <translation id="4215898373199266584">Psst! Příště by se vám mohl hodit anonymní režim (<ph name="INCOGNITO_MODE_SHORTCUT" />).</translation> @@ -3298,7 +3296,6 @@ <translation id="577322787686508614">Operace čtení v zařízení <ph name="DEVICE_NAME" /> není povolena.</translation> <translation id="5774295353725270860">Otevřít aplikaci Soubory</translation> <translation id="5774515636230743468">Manifest:</translation> -<translation id="5776006986202016118">Web žádá o následující připojení:</translation> <translation id="577624874850706961">Prohledávat cookie</translation> <translation id="5778550464785688721">Úplná kontrola zařízení MIDI</translation> <translation id="5780066559993805332">(Nejlepší)</translation> @@ -4191,7 +4188,6 @@ <translation id="7175353351958621980">Načteno z:</translation> <translation id="7180611975245234373">Obnovit</translation> <translation id="7180865173735832675">Personalizovat</translation> -<translation id="7184428045150946911">Vypnout automatické skrývání lišty na velkých tabletech</translation> <translation id="7185690883425432021">Skryje tlačítka k zavření neaktivních karet, když je lišta karet v režimu shromáždění nad sebou.</translation> <translation id="7186088072322679094">Ponechat na liště</translation> <translation id="719009910964971313">Americká programátorská klávesnice Dvorak</translation>
diff --git a/chrome/app/resources/generated_resources_da.xtb b/chrome/app/resources/generated_resources_da.xtb index 4210d27..e26b5c4 100644 --- a/chrome/app/resources/generated_resources_da.xtb +++ b/chrome/app/resources/generated_resources_da.xtb
@@ -658,7 +658,6 @@ <translation id="1962233722219655970">Denne side bruger en Native Client-app, der ikke virker på din computer.</translation> <translation id="1965328510789761112">Privat hukommelse</translation> <translation id="1965624977906726414">Har ingen særlige tilladelser.</translation> -<translation id="1968720524450620475">Aktivér handlingsikoner for Webunderretninger.</translation> <translation id="1970746430676306437">Vis side&information</translation> <translation id="197288927597451399">Behold</translation> <translation id="1973491249112991739"><ph name="PLUGIN_NAME" /> download mislykkedes.</translation> @@ -1421,7 +1420,6 @@ <translation id="302014277942214887">Indtast et applikations-id eller webadressen for webshoppen.</translation> <translation id="3020616530769498629">Aktivér genindlæsning uden validering ved Træk for at opdatere</translation> <translation id="3020990233660977256">Serienummer: <ph name="SERIAL_NUMBER" /></translation> -<translation id="3021245547458004908">Når dette er aktiveret, forsvinder værktøjslinjen aldrig, når du ruller på enheder med en skærm med mindst 800 dp. Den skjules dog, hvis sideindholdet vises i fuld skærm.</translation> <translation id="3021678814754966447">&Vis rammens kilde</translation> <translation id="3024374909719388945">Brug 24-timers ur</translation> <translation id="3025022340603654002">Angiv forslag til autofyld ved museklik på et formularelement.</translation> @@ -1494,7 +1492,6 @@ <translation id="3117812041123364382">Aktivér/deaktiver svævende virtuelt tastatur.</translation> <translation id="3118319026408854581"><ph name="PRODUCT_NAME" /> Hjælp</translation> <translation id="3120430004221004537">Utilstrækkelig kryptering til en angivet handling på: "<ph name="DEVICE_NAME" />".</translation> -<translation id="3121260210578524273">Aktivér ikoner på handlingsknapper for Webunderretninger.</translation> <translation id="3121793941267913344">Nulstil denne <ph name="IDS_SHORT_PRODUCT_NAME" />-enhed</translation> <translation id="3122162841865761901">Eksperimenter for Udviklerværktøjer</translation> <translation id="3122464029669770682">CPU</translation> @@ -2275,6 +2272,7 @@ <translation id="421017592316736757">Du skal være online for at få adgang til denne fil.</translation> <translation id="421182450098841253">&Vis bogmærkelinjen</translation> <translation id="4212108296677106246">Har du tillid til "<ph name="CERTIFICATE_NAME" />" som certificeringsautoritet?</translation> +<translation id="42126664696688958">Eksportér</translation> <translation id="42137655013211669">Serveren har forbudt dig adgang til denne ressource.</translation> <translation id="4215350869199060536">Ups! Navnet indeholder ulovlige tegn.</translation> <translation id="4215898373199266584">Psst! Prøv at bruge Inkognitotilstand (<ph name="INCOGNITO_MODE_SHORTCUT" />) næste gang.</translation> @@ -3305,7 +3303,6 @@ <translation id="577322787686508614">Læsehandlingen er ikke tilladt på: "<ph name="DEVICE_NAME" />".</translation> <translation id="5774295353725270860">Åbn appen Filer</translation> <translation id="5774515636230743468">Manifest:</translation> -<translation id="5776006986202016118">Dette website vil oprette forbindelse til:</translation> <translation id="577624874850706961">Søg i cookies</translation> <translation id="5778550464785688721">Fuld kontrol over MIDI</translation> <translation id="5780066559993805332">(Bedst)</translation> @@ -4195,7 +4192,6 @@ <translation id="7175353351958621980">Indlæst fra:</translation> <translation id="7180611975245234373">Opdater</translation> <translation id="7180865173735832675">Tilpas</translation> -<translation id="7184428045150946911">Deaktiver Skjul værktøjslinjen automatisk på store tablets</translation> <translation id="7185690883425432021">Skjuler knapper til lukning af inaktive faner, når fanelinjen er i staktilstand.</translation> <translation id="7186088072322679094">Behold på værktøjslinjen</translation> <translation id="719009910964971313">Amerikansk (Programmer Dvorak) tastatur</translation>
diff --git a/chrome/app/resources/generated_resources_de.xtb b/chrome/app/resources/generated_resources_de.xtb index 5133ec9ca..f5990a7 100644 --- a/chrome/app/resources/generated_resources_de.xtb +++ b/chrome/app/resources/generated_resources_de.xtb
@@ -658,7 +658,6 @@ <translation id="1962233722219655970">Diese Seite verwendet eine Native Client App, die auf Ihrem Computer nicht funktioniert.</translation> <translation id="1965328510789761112">Privater Speicher</translation> <translation id="1965624977906726414">Erfordert keine besonderen Berechtigungen</translation> -<translation id="1968720524450620475">Aktionssymbole für Webbenachrichtigungen aktivieren.</translation> <translation id="1970746430676306437">Seiten&info anzeigen</translation> <translation id="197288927597451399">Behalten</translation> <translation id="1973491249112991739">Fehler beim Download von <ph name="PLUGIN_NAME" /></translation> @@ -1419,7 +1418,6 @@ <translation id="302014277942214887">Geben Sie die App-ID oder die Webstore-URL ein.</translation> <translation id="3020616530769498629">Ohne Überprüfung den Effekt "Zum Aktualisieren ziehen" aktualisieren</translation> <translation id="3020990233660977256">Seriennummer: <ph name="SERIAL_NUMBER" /></translation> -<translation id="3021245547458004908">Wenn dieses Kästchen angeklickt ist, wird die Symbolleiste auf Geräten, deren Bildschirm mindestens 800 dp hat, beim Scrollen nicht ausgeblendet. Die Symbolleiste wird weiterhin ausgeblendet, wenn Seiteninhalte im Vollbildmodus angezeigt werden.</translation> <translation id="3021678814754966447">Frame-Quelltext &anzeigen</translation> <translation id="3024374909719388945">24-Stunden-Format verwenden</translation> <translation id="3025022340603654002">Beim ersten Mausklick auf ein Formularelement AutoFill-Vervollständigungen anbieten</translation> @@ -1490,7 +1488,6 @@ <translation id="3117812041123364382">Aktiviert/deaktiviert die schwebende Bildschirmtastatur</translation> <translation id="3118319026408854581"><ph name="PRODUCT_NAME" />-Hilfe</translation> <translation id="3120430004221004537">Unzureichende Verschlüsselung für einen bestimmten Vorgang auf folgendem Gerät: "<ph name="DEVICE_NAME" />".</translation> -<translation id="3121260210578524273">Symbole in Aktionsschaltflächen für Webbenachrichtigungen aktivieren.</translation> <translation id="3121793941267913344"><ph name="IDS_SHORT_PRODUCT_NAME" />-Gerät zurücksetzen</translation> <translation id="3122162841865761901">Entwicklertool-Experimente</translation> <translation id="3122464029669770682">CPU</translation> @@ -2272,6 +2269,7 @@ <translation id="421017592316736757">Sie müssen online sein, um auf diese Datei zugreifen zu können.</translation> <translation id="421182450098841253">&Lesezeichenleiste anzeigen</translation> <translation id="4212108296677106246">Möchten Sie "<ph name="CERTIFICATE_NAME" />" als Zertifizierungsstelle vertrauen?</translation> +<translation id="42126664696688958">Exportieren</translation> <translation id="42137655013211669">Der Zugriff auf diese Ressource wurde vom Server nicht zugelassen.</translation> <translation id="4215350869199060536">Der Name enthält unzulässige Zeichen.</translation> <translation id="4215898373199266584">Geheimtipp: Verwenden Sie nächstes Mal den Inkognitomodus (<ph name="INCOGNITO_MODE_SHORTCUT" />).</translation> @@ -3299,7 +3297,6 @@ <translation id="577322787686508614">Der Lesevorgang ist auf folgendem Gerät nicht erlaubt: "<ph name="DEVICE_NAME" />".</translation> <translation id="5774295353725270860">App "Dateien" öffnen</translation> <translation id="5774515636230743468">Manifest:</translation> -<translation id="5776006986202016118">Die Website versucht, die folgenden Verbindungen herzustellen:</translation> <translation id="577624874850706961">Cookies suchen</translation> <translation id="5778550464785688721">Vollständige Kontrolle über MIDI-Geräte</translation> <translation id="5780066559993805332">(beste)</translation> @@ -4007,7 +4004,7 @@ <translation id="6918340160281024199">US-amerikanische Workman-Tastatur</translation> <translation id="6920569915859786172">Eingriff des User-Agents zum Laden von WebFonts stets auslösen.</translation> <translation id="6920989436227028121">In normalem Tab öffnen</translation> -<translation id="6922128026973287222">Mit der Google Datenkomprimierung verbrauchen Sie weniger Daten und surfen schneller. Klicken Sie hier, um mehr zu erfahren.</translation> +<translation id="6922128026973287222">Mit dem Google-Datensparmodus verbrauchen Sie weniger Daten und surfen schneller. Klicken Sie hier, um mehr zu erfahren.</translation> <translation id="6929555043669117778">Pop-ups weiterhin blockieren</translation> <translation id="6930242544192836755">Dauer</translation> <translation id="6934265752871836553">Aktiviert den neuesten experimentellen Code für ein schnelleres Rendering von Inhalten in Chrome. Aufgrund der Änderungen dieses Pfades werden viele Inhalte wahrscheinlich nicht korrekt dargestellt.</translation> @@ -4187,7 +4184,6 @@ <translation id="7175353351958621980">Geladen von:</translation> <translation id="7180611975245234373">Aktualisieren</translation> <translation id="7180865173735832675">Anpassen</translation> -<translation id="7184428045150946911">Symbolleiste auf großen Tablets nicht automatisch ausblenden</translation> <translation id="7185690883425432021">Blendet die Schaltflächen zum Schließen inaktiver Tabs aus, wenn die Tab-Leiste gestapelt ist.</translation> <translation id="7186088072322679094">In Symbolleiste behalten</translation> <translation id="719009910964971313">US-amerikanische "Programmer Dvorak"-Tastatur</translation>
diff --git a/chrome/app/resources/generated_resources_el.xtb b/chrome/app/resources/generated_resources_el.xtb index 9db5769c..52c27c5d 100644 --- a/chrome/app/resources/generated_resources_el.xtb +++ b/chrome/app/resources/generated_resources_el.xtb
@@ -664,7 +664,6 @@ <translation id="1962233722219655970">Αυτή η σελίδα χρησιμοποιεί μια εφαρμογή Native Client η οποία δεν λειτουργεί στον υπολογιστή σας.</translation> <translation id="1965328510789761112">Ιδιωτική μνήμη</translation> <translation id="1965624977906726414">Δεν έχει ειδικά δικαιώματα.</translation> -<translation id="1968720524450620475">Ενεργοποίηση εικονιδίων ενεργειών για ειδοποιήσεις ιστού.</translation> <translation id="1970746430676306437">Προβολή πληρο&φοριών σελίδας</translation> <translation id="197288927597451399">Διατήρηση</translation> <translation id="1973491249112991739">Η λήψη της προσθήκης <ph name="PLUGIN_NAME" /> απέτυχε.</translation> @@ -1429,7 +1428,6 @@ <translation id="302014277942214887">Εισαγάγετε αναγνωριστικό εφαρμογής ή διεύθυνση URL στο webstore.</translation> <translation id="3020616530769498629">Ενεργοποίηση επανάληψης φόρτωσης χωρίς επικύρωση κατά το τράβηγμα για ανανέωση</translation> <translation id="3020990233660977256">Σειριακός αριθμός: <ph name="SERIAL_NUMBER" /></translation> -<translation id="3021245547458004908">Όταν η γραμμή εργαλείων είναι ενεργοποιημένη, δεν αποκρύπτεται ποτέ εξαιτίας της κύλισης σε συσκευές με οθόνη με dp >= 800 τουλάχιστον. Θα εξακολουθήσει να αποκρύπτεται εάν τα περιεχόμενα της σελίδας προβληθούν σε πλήρη οθόνη.</translation> <translation id="3021678814754966447">&Προβολή Πηγαίου Κώδικα Πλαισίου</translation> <translation id="3024374909719388945">Χρήση ρολογιού 24 ωρών</translation> <translation id="3025022340603654002">Να γίνονται προτάσεις αυτόματης συμπλήρωσης με το αρχικό κλικ του ποντικιού σε ένα στοιχείο φόρμας.</translation> @@ -1500,7 +1498,6 @@ <translation id="3117812041123364382">Ενεργοποίηση/απενεργοποίηση κινούμενου εικονικού πληκτρολογίου.</translation> <translation id="3118319026408854581"><ph name="PRODUCT_NAME" /> Βοήθεια</translation> <translation id="3120430004221004537">Ανεπαρκής κρυπτογράφηση για συγκεκριμένη λειτουργία στη συσκευή: "<ph name="DEVICE_NAME" />".</translation> -<translation id="3121260210578524273">Ενεργοποίηση εικονιδίων σε κουμπιά ενεργειών για ειδοποιήσεις ιστού.</translation> <translation id="3121793941267913344">Επαναφορά αυτής της συσκευής <ph name="IDS_SHORT_PRODUCT_NAME" /></translation> <translation id="3122162841865761901">Πειράματα εργαλείων προγραμματιστή</translation> <translation id="3122464029669770682">Κεντρική μονάδα επεξεργασίας</translation> @@ -2286,6 +2283,7 @@ <translation id="421017592316736757">Πρέπει να είστε συνδεδεμένοι στο διαδίκτυο για να αποκτήσετε πρόσβαση σε αυτό το αρχείο.</translation> <translation id="421182450098841253">&Εμφάνιση γραμμής σελιδοδεικτών</translation> <translation id="4212108296677106246">Θέλετε να αποδέχεστε το "<ph name="CERTIFICATE_NAME" />" ως Αρχή Πιστοποίησης;</translation> +<translation id="42126664696688958">Εξαγωγή</translation> <translation id="42137655013211669">Η πρόσβαση σε αυτόν τον πόρο απαγορεύεται από το διακομιστή.</translation> <translation id="4215350869199060536">Ωχ! Υπάρχουν μη έγκυρα σύμβολα στο όνομα!</translation> <translation id="4215898373199266584">Η κατάσταση ανώνυμης περιήγησης (<ph name="INCOGNITO_MODE_SHORTCUT" />) μπορεί να είναι χρήσιμη την επόμενη φορά.</translation> @@ -3324,7 +3322,6 @@ <translation id="577322787686508614">Η λειτουργία ανάγνωσης δεν επιτρέπεται στη συσκευή: "<ph name="DEVICE_NAME" />".</translation> <translation id="5774295353725270860">Άνοιγμα εφαρμογής αρχείων</translation> <translation id="5774515636230743468">Εκδήλωση:</translation> -<translation id="5776006986202016118">Αυτός ο ιστότοπος θέλει να συνδεθεί σε:</translation> <translation id="577624874850706961">Αναζήτηση cookie</translation> <translation id="5778550464785688721">Πλήρης έλεγχος συσκευών MIDI</translation> <translation id="5780066559993805332">(Βέλτιστη)</translation> @@ -4217,7 +4214,6 @@ <translation id="7175353351958621980">Έγινε φόρτωση από:</translation> <translation id="7180611975245234373">Ανανέωση</translation> <translation id="7180865173735832675">Προσαρμογή</translation> -<translation id="7184428045150946911">Απενεργοποίηση αυτόματης απόκρυψης της γραμμής εργαλείων σε μεγάλα tablet</translation> <translation id="7185690883425432021">Αποκρύπτει τα κουμπιά κλεισίματος των ανενεργών καρτελών, όταν η γραμμή καρτελών είναι στη λειτουργία στοίβας.</translation> <translation id="7186088072322679094">Διατήρηση στη γραμμή εργαλείων</translation> <translation id="719009910964971313">Πληκτρολόγιο US Programmer Dvorak</translation>
diff --git a/chrome/app/resources/generated_resources_en-GB.xtb b/chrome/app/resources/generated_resources_en-GB.xtb index 2dd34f1..912e1e61 100644 --- a/chrome/app/resources/generated_resources_en-GB.xtb +++ b/chrome/app/resources/generated_resources_en-GB.xtb
@@ -183,16 +183,19 @@ <translation id="1259724620062607540">Shelf item 7</translation> <translation id="1260240842868558614">Show:</translation> <translation id="126710816202626562">Translation language:</translation> +<translation id="1269690813141254680">Control how Google uses your browsing history to personalise Search and other Google services from <ph name="BEGIN_LINK" />Google Activity Controls<ph name="END_LINK" />.</translation> <translation id="1272079795634619415">Stop</translation> <translation id="1272978324304772054">This user account does not belong to the domain that the device is enrolled to. If you want to enrol to a different domain you need to go through device recovery first.</translation> <translation id="127353061808977798">Fonts and Encoding</translation> <translation id="1274997165432133392">Cookies and other site data</translation> <translation id="1275718070701477396">Selected</translation> +<translation id="1277908057200820621">View device list</translation> <translation id="1278049586634282054">Inspect views:</translation> <translation id="1278813325885878377">Hungarian QWERTY keyboard</translation> <translation id="1285320974508926690">Never translate this site</translation> <translation id="1285484354230578868">Store data in your Google Drive account</translation> <translation id="1290223615328246825">Automatic sign-in failed</translation> +<translation id="1293509594570842875">The new supervised user couldn't be created. Please check your network connection and try again later.</translation> <translation id="1293556467332435079">Files</translation> <translation id="1294298200424241932">Edit trust settings:</translation> <translation id="1295794900245526845">Choose your account saved with <ph name="PASSWORD_MANAGER_BRAND" /> to sign in</translation> @@ -291,6 +294,7 @@ <translation id="1429740407920618615">Signal Strength:</translation> <translation id="143027896309062157">Read and change all your data on your computer and the websites that you visit</translation> <translation id="1430915738399379752">Print</translation> +<translation id="1433423644370450034">Media style notification</translation> <translation id="1434696352799406980">This will reset your startup page, new tab page, search engine and pinned tabs. It will also disable all extensions and clear temporary data like cookies. Your bookmarks, history and saved passwords will not be cleared.</translation> <translation id="1434886155212424586">Homepage is the New Tab page</translation> <translation id="1435550882135542937">Extension toolbar redesign</translation> @@ -379,6 +383,7 @@ <translation id="1526925867532626635">Confirm sync settings</translation> <translation id="1528372117901087631">Internet connection</translation> <translation id="1529968269513889022">the past week</translation> +<translation id="1531865825384516080">SafeSearch URLs reporting.</translation> <translation id="1532697124104874386">Enable/Disable smart deployment of the virtual keyboard.</translation> <translation id="1533897085022183721">Less than <ph name="MINUTES" />.</translation> <translation id="1533920822694388968">TV alignment</translation> @@ -662,7 +667,6 @@ <translation id="1962233722219655970">This page uses a Native Client app that doesn't work on your computer.</translation> <translation id="1965328510789761112">Private memory</translation> <translation id="1965624977906726414">Has no special permissions.</translation> -<translation id="1968720524450620475">Enable action icons for Web Notifications.</translation> <translation id="1970746430676306437">View page &info</translation> <translation id="197288927597451399">Keep</translation> <translation id="1973491249112991739"><ph name="PLUGIN_NAME" /> download failed.</translation> @@ -760,6 +764,7 @@ <translation id="212862741129535676">Frequency State Occupancy Percentage</translation> <translation id="2128691215891724419">Sync Error: Update Sync passphrase...</translation> <translation id="2129904043921227933">Sync Error: Update Sync Passphrase...</translation> +<translation id="2130053362119884302">Allow tab detaching in full screen</translation> <translation id="2131077480075264">Unable to install "<ph name="APP_NAME" />" because it is not allowed by "<ph name="IMPORT_NAME" />"</translation> <translation id="2134149231879627725">Let Google help you remotely lock, erase and locate your device.</translation> <translation id="2134986351331412790">This site doesn't accept this brand of card.</translation> @@ -772,6 +777,7 @@ <translation id="2143778271340628265">Manual proxy configuration</translation> <translation id="2143915448548023856">Display settings</translation> <translation id="2144536955299248197">Certificate Viewer: <ph name="CERTIFICATE_NAME" /></translation> +<translation id="2147827593068025794">Background Sync</translation> <translation id="2148756636027685713">Formatting finished</translation> <translation id="2148892889047469596">Cast tab</translation> <translation id="2148999191776934271">Charging @@ -1149,6 +1155,7 @@ <translation id="2665717534925640469">This page is now full screen and has disabled your mouse cursor.</translation> <translation id="2665919335226618153">Oh no! There was an error during formatting.</translation> <translation id="2668079306436607263">Overscroll history navigation</translation> +<translation id="2670102641511624474"><ph name="APP_NAME" /> is sharing a Chrome tab.</translation> <translation id="2670965183549957348">Chewing input method</translation> <translation id="2672142220933875349">Bad crx file, unpacking failed.</translation> <translation id="2672394958563893062">An error occurred. Click to restart from the beginning.</translation> @@ -1195,6 +1202,7 @@ <translation id="2733364097704495499">Do you wish to register the printer <ph name="PRINTER_NAME" /> to Google Cloud Print?</translation> <translation id="2735698359135166290">Romanian standard keyboard</translation> <translation id="2737363922397526254">Collapse...</translation> +<translation id="2737755522130570180">Block scripts loaded via document.write</translation> <translation id="2738771556149464852">Not After</translation> <translation id="2739191690716947896">Debug</translation> <translation id="2739240477418971307">Change your accessibility settings</translation> @@ -1264,6 +1272,7 @@ <translation id="2805646850212350655">Microsoft Encrypting File System</translation> <translation id="2805707493867224476">Allow all sites to show pop-ups</translation> <translation id="2805756323405976993">Apps</translation> +<translation id="2808243220963392165">Allow tabs to detach from the tabstrip when in full screen mode on Mac.</translation> <translation id="2809142985846095314">Enable offering upload of Autofilled credit cards</translation> <translation id="2809346626032021864">Reading</translation> <translation id="2809586584051668049">and <ph name="NUMBER_ADDITIONAL_DISABLED" /> more</translation> @@ -1392,6 +1401,7 @@ <translation id="2968792643335932010">Less copies</translation> <translation id="2971033837577180453"><span>ID:</span><ph name="EXTENSION_ID" /></translation> <translation id="2971213274238188218">bright down</translation> +<translation id="2971422413423640756">Download button when opening a page with media URL.</translation> <translation id="2972557485845626008">Firmware</translation> <translation id="2972581237482394796">&Redo</translation> <translation id="297870353673992530">DNS server:</translation> @@ -1424,7 +1434,6 @@ <translation id="302014277942214887">Enter application ID or web store URL.</translation> <translation id="3020616530769498629">Enable non-validating reload on pull to refresh</translation> <translation id="3020990233660977256">Serial Number: <ph name="SERIAL_NUMBER" /></translation> -<translation id="3021245547458004908">When enabled, the toolbar will never be hidden due to scrolling on devices with a minimum screen dp >= 800. It will still be hidden if page contents go full screen.</translation> <translation id="3021678814754966447">&View Frame Source</translation> <translation id="3024374909719388945">Use 24-hour clock</translation> <translation id="3025022340603654002">Make autofill suggestions on initial mouse click on a form element.</translation> @@ -1457,6 +1466,7 @@ <translation id="3057861065630527966">Backup your photos and videos</translation> <translation id="3058212636943679650">If you ever need to restore your computer's operating system, you'll need a recovery SD card or USB memory stick.</translation> <translation id="305932878998873762">The Simple Cache for HTTP is a new cache. It relies on the file system for disk space allocation.</translation> +<translation id="3062606427884046423">Use Android MediaStyle notifications for Chrome media notifications.</translation> <translation id="3064388234319122767">Transliteration (zdravo → здраво)</translation> <translation id="3065041951436100775">Tab killed feedback.</translation> <translation id="3065140616557457172">Type to search or enter a URL to navigate - everything just works.</translation> @@ -1495,7 +1505,6 @@ <translation id="3117812041123364382">Enable/Disable floating virtual keyboard.</translation> <translation id="3118319026408854581"><ph name="PRODUCT_NAME" /> Help</translation> <translation id="3120430004221004537">Insufficient encryption for a given operation on: "<ph name="DEVICE_NAME" />".</translation> -<translation id="3121260210578524273">Enable icons in action buttons for Web Notifications.</translation> <translation id="3121793941267913344">Reset this <ph name="IDS_SHORT_PRODUCT_NAME" /> device</translation> <translation id="3122162841865761901">Developer Tools experiments</translation> <translation id="3122464029669770682">CPU</translation> @@ -1540,6 +1549,7 @@ <translation id="3170072451822350649">You may also skip signing in and <ph name="LINK_START" />browse as Guest<ph name="LINK_END" />.</translation> <translation id="3170544058711792988">Keep magnifier focus centred on screen</translation> <translation id="3172213052701798825">Google Smart Lock for Passwords</translation> +<translation id="3175469972022788345">When enabled, WebRTC will use ECDSA certificates.</translation> <translation id="317583078218509884">New site permissions settings will take effect after reloading the page.</translation> <translation id="3177048931975664371">Click to hide password</translation> <translation id="3180365125572747493">Please enter a password to encrypt this certificate file.</translation> @@ -1994,6 +2004,7 @@ <translation id="3776796446459804932">This extension violates the Chrome Web Store policy.</translation> <translation id="3778152852029592020">Download was cancelled.</translation> <translation id="3778740492972734840">&Developer tools</translation> +<translation id="3780663724044634171">Select an account to manage the supervised user.</translation> <translation id="378312418865624974">Read a unique identifier for this computer</translation> <translation id="3783640748446814672">alt</translation> <translation id="3785308913036335955">Show Apps Shortcut</translation> @@ -2017,6 +2028,7 @@ <translation id="3807747707162121253">&Cancel</translation> <translation id="3809280248639369696">Moonbeam</translation> <translation id="3810973564298564668">Manage</translation> +<translation id="3811494700605067549">1 file selected</translation> <translation id="3812034401428455285"><ph name="UWS_NAME" /> and <ph name="UWS_NAME" /></translation> <translation id="3812525830114410218">Bad certificate</translation> <translation id="3813984289128269159">Ok Google</translation> @@ -2046,6 +2058,7 @@ <translation id="3838543471119263078">Cookies and other site and plug-in data</translation> <translation id="3839497635014791588">Additional touch feedback on UI components</translation> <translation id="3840053866656739575">Lost connection to your Chromebox. Please move closer, or check your device while we try to reconnect.</translation> +<translation id="3840055807562919428">Disallows fetches for third-party parser-blocking scripts inserted into the main frame via document.write.</translation> <translation id="3842552989725514455">Serif font</translation> <translation id="3846593650622216128">These settings are enforced by an extension.</translation> <translation id="3846833722648675493">Show apps windows after the first paint. Windows will be shown significantly later for heavy apps loading resources synchronously but it will be insignificant for apps that load most of their resources asynchronously.</translation> @@ -2277,6 +2290,7 @@ <translation id="421017592316736757">You must be online to access this file.</translation> <translation id="421182450098841253">&Show Bookmarks Bar</translation> <translation id="4212108296677106246">Do you want to trust "<ph name="CERTIFICATE_NAME" />" as a Certification Authority?</translation> +<translation id="42126664696688958">Export</translation> <translation id="42137655013211669">Access to this resource was forbidden by the server.</translation> <translation id="4215350869199060536">Oops, illegal symbols in name!</translation> <translation id="4215898373199266584">Psst! Incognito mode (<ph name="INCOGNITO_MODE_SHORTCUT" />) may come in handy next time.</translation> @@ -2363,6 +2377,7 @@ <translation id="4359408040881008151">Installed because of dependent extension(s).</translation> <translation id="4361190688154226069">Rect-based targeting in views</translation> <translation id="4364444725319685468"><ph name="FILE_NAME" /> downloaded</translation> +<translation id="4364567974334641491"><ph name="APP_NAME" /> is sharing a window.</translation> <translation id="4364830672918311045">Display notifications</translation> <translation id="4365673000813822030">Whoops, Sync has stopped working.</translation> <translation id="4366509400410520531">Allowed by you</translation> @@ -2432,6 +2447,7 @@ <translation id="4479639480957787382">Ethernet</translation> <translation id="4479812471636796472">US Dvorak keyboard</translation> <translation id="4481249487722541506">Load unpacked extension...</translation> +<translation id="4482194545587547824">Google may use your browsing history to personalise Search and other Google services</translation> <translation id="4487088045714738411">Belgian keyboard</translation> <translation id="4492190037599258964">Search results for '<ph name="SEARCH_STRING" />'</translation> <translation id="4495021739234344583">Unenrol and restart</translation> @@ -2475,6 +2491,7 @@ <translation id="4554591392113183336">External extension is at the same or lower version compared to the existing one.</translation> <translation id="4554796861933393312">Material Design Ink Drop Animation Speed</translation> <translation id="4555769855065597957">Shadow</translation> +<translation id="4556110439722119938">Your bookmarks, history, passwords and other settings will be synced to your Google Account so that you can use them on all your devices</translation> <translation id="4557136421275541763">Warning:</translation> <translation id="4558426062282641716">Auto-launch permission requested</translation> <translation id="4563210852471260509">Initial input language is Chinese</translation> @@ -2596,6 +2613,7 @@ <translation id="4742746985488890273">Pin to Shelf</translation> <translation id="474421578985060416">Blocked by you</translation> <translation id="4744574733485822359">Your download has completed</translation> +<translation id="4746330764136728131">Use ECDSA certificates for WebRTC</translation> <translation id="4746971725921104503">Looks like you're already managing a user by that name. Did you want to <ph name="LINK_START" />import <ph name="USER_DISPLAY_NAME" /> to this device<ph name="LINK_END" />?</translation> <translation id="4747271164117300400">Macedonian</translation> <translation id="4749157430980974800">Georgian keyboard</translation> @@ -2745,6 +2763,7 @@ <translation id="496226124210045887">The folder that you selected contains sensitive files. Are you sure that you want to grant "$1" permanent read access to this folder?</translation> <translation id="4964673849688379040">Checking...</translation> <translation id="4966802378343010715">Create a new user</translation> +<translation id="4967749818080339523">Select an account</translation> <translation id="496888482094675990">The Files app provides quick access to files that you've saved on Google Drive, external storage or your Chrome OS device.</translation> <translation id="4971412780836297815">Open when done</translation> <translation id="497244430928947428">Malayalam keyboard (Phonetic)</translation> @@ -2791,6 +2810,7 @@ <translation id="5038863510258510803">Enabling...</translation> <translation id="5039512255859636053">$1 TB</translation> <translation id="5039804452771397117">Allow</translation> +<translation id="5043851552150732346">1 directory selected</translation> <translation id="5045550434625856497">Incorrect password</translation> <translation id="5048179823246820836">Nordic</translation> <translation id="5048294425697652159">Enable Quirks Client for display calibration.</translation> @@ -2878,6 +2898,7 @@ <translation id="5170477580121653719">Google Drive space left: <ph name="SPACE_AVAILABLE" />.</translation> <translation id="5170568018924773124">Show in folder</translation> <translation id="5171045022955879922">Search or type URL</translation> +<translation id="5171343362375269016">Swapped Memory</translation> <translation id="5175870427301879686"><ph name="URL" /> wants to permanently store data on your local computer.</translation> <translation id="5177479852722101802">Continue blocking camera and microphone access</translation> <translation id="5177526793333269655">Thumbnail view</translation> @@ -3035,6 +3056,7 @@ <translation id="5380103295189760361">Hold Control, Alt, Shift or Search to see keyboard shortcuts for those modifiers.</translation> <translation id="5382392428640372740">Enable navigation tracing</translation> <translation id="5388588172257446328">Username:</translation> +<translation id="5389237414310520250">The new user couldn't be created. Please check your hard drive space and permissions and try again.</translation> <translation id="5390284375844109566">Indexed Database</translation> <translation id="5392544185395226057">Enable support for Native Client.</translation> <translation id="5396126354477659676"><ph name="PEPPER_PLUGIN_NAME" /> on <ph name="PEPPER_PLUGIN_DOMAIN" /> wants to access your computer.</translation> @@ -3102,6 +3124,7 @@ <translation id="5469954281417596308">Bookmark manager</translation> <translation id="5470838072096800024">Time Last Received</translation> <translation id="5473075389972733037">IBM</translation> +<translation id="5473279832922912143">Enable V8 to use the experimental Ignition interpreter for JavaScript execution.</translation> <translation id="5474139872592516422">When <ph name="PLUGIN_NAME" /> has finished updating, reload the page to activate it.</translation> <translation id="5480254151128201294">This device was locked by the owner.</translation> <translation id="5483785310822538350">Revoke file and device access</translation> @@ -3129,6 +3152,7 @@ <translation id="5509914365760201064">Issuer: <ph name="CERTIFICATE_AUTHORITY" /></translation> <translation id="5511823366942919280">Are you sure that you want to set up this device as a "Shark"?</translation> <translation id="5512653252560939721">User certificate must be hardware-backed.</translation> +<translation id="5513242761114685513">Context menu</translation> <translation id="5515008897660088170">Toolkit-Views App Windows.</translation> <translation id="551752069230578406">Adding the printer to your account - this may take a moment...</translation> <translation id="5518584115117143805">Email Encryption Certificate</translation> @@ -3309,7 +3333,6 @@ <translation id="577322787686508614">Read operation is not permitted on: "<ph name="DEVICE_NAME" />".</translation> <translation id="5774295353725270860">Open Files app</translation> <translation id="5774515636230743468">Manifest:</translation> -<translation id="5776006986202016118">This site wants to connect to:</translation> <translation id="577624874850706961">Search cookies</translation> <translation id="5778550464785688721">MIDI devices full control</translation> <translation id="5780066559993805332">(Best)</translation> @@ -3387,6 +3410,7 @@ <translation id="5874045675243596003">Enforce strict (hard fail if we can't get hashes)</translation> <translation id="5875858680971105888">Oops! The supervised user couldn't be imported. Please check your network connection and try again later.</translation> <translation id="5880247576487732437">Token Present</translation> +<translation id="5884474295213649357">This tab is connected to a USB device.</translation> <translation id="5885324376209859881">Manage media settings...</translation> <translation id="5889282057229379085">Maximum number of intermediate CAs: <ph name="NUM_INTERMEDIATE_CA" /></translation> <translation id="5892290200158927959">French BÉPO keyboard</translation> @@ -3478,6 +3502,8 @@ <translation id="604124094241169006">Automatic</translation> <translation id="6042308850641462728">More</translation> <translation id="604257181445267932">Smart Lock helps you quickly sign in to apps and sites using passwords you have saved with Google.</translation> +<translation id="6043317578411397101"><ph name="APP_NAME" /> is sharing a Chrome tab with <ph name="TAB_NAME" />.</translation> +<translation id="6044805581023976844"><ph name="APP_NAME" /> is sharing a Chrome tab and audio with <ph name="TAB_NAME" />.</translation> <translation id="6049065490165456785">Photo from internal camera</translation> <translation id="6051028581720248124">By printing to FedEx Office, you accept their <ph name="START_LINK" />terms of use<ph name="END_LINK" />.</translation> <translation id="6051086608691487286">Overlay Scrollbars</translation> @@ -3606,6 +3632,7 @@ <translation id="6251889282623539337"><ph name="DOMAIN" /> Terms of Service</translation> <translation id="6251924700383757765">Privacy policy</translation> <translation id="6253586523465486793">Forces pull-to-refresh trigger non-validating reload (while it usually means regular, cache-validating reload when the flag is disabled).</translation> +<translation id="6254182355913122230">Swapped memory</translation> <translation id="6254503684448816922">Key Compromise</translation> <translation id="6259104249628300056">Discover devices on your local network</translation> <translation id="6263082573641595914">Microsoft CA Version</translation> @@ -3876,6 +3903,7 @@ <translation id="6680028776254050810">Change Users</translation> <translation id="6681668084120808868">Take photo</translation> <translation id="668171684555832681">Other...</translation> +<translation id="6682083956260248340">Control how this works in <ph name="BEGIN_LINK" /></translation> <translation id="6686490380836145850">Close tabs to the right</translation> <translation id="6686817083349815241">Save your password</translation> <translation id="6689514201497896398">Bypass user engagement checks</translation> @@ -3943,10 +3971,12 @@ <translation id="6798954102094737107">Plug-in: <ph name="PLUGIN_NAME" /></translation> <translation id="6802031077390104172"><ph name="USAGE" /> (<ph name="OID" />)</translation> <translation id="6804671422566312077">Open All Bookmarks in &New Window</translation> +<translation id="6805542829187142700">Enable system timezone automatic detection device policy.</translation> <translation id="6805647936811177813">Please sign in to <ph name="TOKEN_NAME" /> to import client certificate from <ph name="HOST_NAME" />.</translation> <translation id="680572642341004180">Enable RLZ tracking on <ph name="SHORT_PRODUCT_OS_NAME" />.</translation> <translation id="6807889908376551050">Show All...</translation> <translation id="6809448577646370871">Customised Window Cycling for Chrome Apps.</translation> +<translation id="6810613314571580006">Automatically sign in to websites using stored credentials. When the feature is disabled, you will be asked for confirmation every time before signing in to a website.</translation> <translation id="6812349420832218321"><ph name="PRODUCT_NAME" /> cannot be run as root.</translation> <translation id="6812841287760418429">Keep changes</translation> <translation id="6814124696888326520">For easier switching of input methods and access to more input features: voice input, handwriting and emoji.</translation> @@ -4135,6 +4165,7 @@ <translation id="7065534935986314333">About System</translation> <translation id="7066944511817949584">Failed to connect to "<ph name="DEVICE_NAME" />".</translation> <translation id="7067725467529581407">Never show this again.</translation> +<translation id="7068609958927777019">If enabled, inappropriate URLs can be reported back to SafeSearch.</translation> <translation id="7070804685954057874">Direct input</translation> <translation id="7072010813301522126">Shortcut name</translation> <translation id="7072025625456903686">Allow all or customise</translation> @@ -4200,10 +4231,10 @@ <translation id="7170467426996704624">Transliteration (salam → ሰላም)</translation> <translation id="7172053773111046550">Estonian keyboard</translation> <translation id="7173828187784915717">Chewing Input Settings</translation> +<translation id="7173917244679555">Looks like you're already managing a user by that name. Did you want to <ph name="BEGIN_LINK" />import <ph name="PROFILE_NAME" /><ph name="END_LINK" /> to this device?</translation> <translation id="7175353351958621980">Loaded from:</translation> <translation id="7180611975245234373">Refresh</translation> <translation id="7180865173735832675">Customise</translation> -<translation id="7184428045150946911">Disable auto-hiding the toolbar on large tablets</translation> <translation id="7185690883425432021">Hides the close buttons of inactive tabs when the tabstrip is in stacked mode.</translation> <translation id="7186088072322679094">Keep in Toolbar</translation> <translation id="719009910964971313">US Programmer Dvorak keyboard</translation> @@ -4268,6 +4299,7 @@ <translation id="7280825545668757494">Wi-Fi credential sync</translation> <translation id="7280877790564589615">Permission requested</translation> <translation id="7282547042039404307">Smooth</translation> +<translation id="7284549674086796566">Experimental JavaScript Interpreter</translation> <translation id="7287143125007575591">Access denied</translation> <translation id="7288592446024861651">Your bookmarks, history, passwords and other settings will be synced to your Google Account so that you can use them on all your devices. Control what to sync in <ph name="BEGIN_LINK" /></translation> <translation id="7288676996127329262"><ph name="HORIZONTAL_DPI" />x<ph name="VERTICAL_DPI" /> dpi</translation> @@ -4290,6 +4322,7 @@ <translation id="7321545336522791733">Server unreachable</translation> <translation id="7325437708553334317">High Contrast Extension</translation> <translation id="7326565110843845436">Touchpad three-finger-click</translation> +<translation id="7327088014939803293">The new supervised user couldn't be created. Please make sure that you're signed in properly and try again.</translation> <translation id="73289266812733869">Unselected</translation> <translation id="7329154610228416156">Sign-in failed because it was configured to use a non-secure URL (<ph name="BLOCKED_URL" />). Please contact your administrator.</translation> <translation id="7331786426925973633">A web browser built for speed, simplicity and security</translation> @@ -4464,6 +4497,7 @@ <translation id="7573172247376861652">Battery Charge</translation> <translation id="7576032389798113292">6 x 4</translation> <translation id="7576690715254076113">Collate</translation> +<translation id="7580671184200851182">Play the same audio through all speakers (mono audio)</translation> <translation id="7581279002575751816">NPAPI plugins are not supported.</translation> <translation id="7581462281756524039">A cleanup tool</translation> <translation id="7582582252461552277">Prefer this network</translation> @@ -4696,6 +4730,7 @@ <translation id="7925686952655276919">Do not use mobile data for sync</translation> <translation id="7926906273904422255">Mark non-secure origins as non-secure or "dubious".</translation> <translation id="7928710562641958568">Eject device</translation> +<translation id="79312157130859720"><ph name="APP_NAME" /> is sharing your screen and audio.</translation> <translation id="7938594894617528435">Currently offline</translation> <translation id="7939374455203157513">Enable Cloud Services</translation> <translation id="7939412583708276221">Keep anyway</translation> @@ -5132,6 +5167,7 @@ <translation id="8571108619753148184">Server 4</translation> <translation id="8572832761467613633">Flash only</translation> <translation id="8572981282494768930">Do not allow sites to access your camera and microphone</translation> +<translation id="8574234089711453001">Allow a download button to show up when opening a page with media URL.</translation> <translation id="857779305329188634">Enable experimental QUIC protocol support.</translation> <translation id="8579285237314169903">Syncing <ph name="NUMBER_OF_FILES" /> items...</translation> <translation id="8579549103199280730">Ask by default</translation> @@ -5187,6 +5223,7 @@ <translation id="8656768832129462377">Do not check</translation> <translation id="8656946437567854031">By clicking Continue you agree to the <ph name="LEGAL_DOC_LINK_TEXT_1" />, <ph name="LEGAL_DOC_LINK_TEXT_2" />, <ph name="LEGAL_DOC_LINK_TEXT_3" />, <ph name="LEGAL_DOC_LINK_TEXT_4" />, <ph name="LEGAL_DOC_LINK_TEXT_5" /> and <ph name="LEGAL_DOC_LINK_TEXT_6" />.</translation> <translation id="8658595122208653918">Change printer options...</translation> +<translation id="8658645149275195032"><ph name="APP_NAME" /> is sharing your screen and audio with <ph name="TAB_NAME" />.</translation> <translation id="8659716501582523573">IP address:</translation> <translation id="8661290697478713397">Open Link in Inco&gnito Window</translation> <translation id="8662795692588422978">People</translation> @@ -5392,6 +5429,7 @@ <translation id="8942416694471994740">Access to your microphone is controlled by your administrator.</translation> <translation id="894360074127026135">Netscape International Step-Up</translation> <translation id="8944779739948852228">Printer detected</translation> +<translation id="8944964446326379280"><ph name="APP_NAME" /> is sharing a window with <ph name="TAB_NAME" />.</translation> <translation id="8946359700442089734">Debugging features were not completely enabled on this <ph name="IDS_SHORT_PRODUCT_NAME" /> device.</translation> <translation id="8946784827990177241">Enable WebUSB support.</translation> <translation id="89515141420106838">Enables Chrome Web Store Gallery app for printer drivers. The app searches Chrome Web Store for extensions that support printing to a USB printer with specific USB ID.</translation> @@ -5410,6 +5448,7 @@ <translation id="8965037249707889821">Enter old password</translation> <translation id="8965697826696209160">There is not enough space.</translation> <translation id="8968527460726243404">ChromeOS System Image Writer</translation> +<translation id="8970203673128054105">View cast mode list</translation> <translation id="89720367119469899">Escape</translation> <translation id="8972513834460200407">Please check with your network administrator to make sure that the firewall is not blocking downloads from Google servers.</translation> <translation id="8974161578568356045">Auto Detect</translation> @@ -5437,6 +5476,7 @@ <translation id="9011178328451474963">Last tab</translation> <translation id="9013284500811652791"><ph name="UWS_NAME" />, <ph name="UWS_NAME" /> and one more</translation> <translation id="9013587737291179248">Oops! The supervised user couldn't be imported. Please check your hard drive space and permissions and try again.</translation> +<translation id="901440679911238150">Your account details are out of date. <ph name="BEGIN_LINK" />Sign in again<ph name="END_LINK" />.</translation> <translation id="9014987600015527693">Show another phone</translation> <translation id="9015601075560428829">Speech input</translation> <translation id="9016164105820007189">Connecting to "<ph name="DEVICE_NAME" />".</translation> @@ -5450,6 +5490,7 @@ <translation id="9025098623496448965">OK, Take me back to sign-in screen</translation> <translation id="902638246363752736">Keyboard settings</translation> <translation id="9026731007018893674">download</translation> +<translation id="9027146684281895941">Supervise this person to control and view the websites they visit from your Google Account.</translation> <translation id="9027459031423301635">Open Link in New &Tab</translation> <translation id="9027603907212475920">Set up sync...</translation> <translation id="9033453977881595182">Token ID</translation> @@ -5565,6 +5606,7 @@ <translation id="9203478404496196495">Unmute tab</translation> <translation id="9203962528777363226">The administrator of this device has disabled new users from being added</translation> <translation id="9205143043463108573">Positions the App Launcher in the centre of the screen with a landscape aspect.</translation> +<translation id="9205160891051296441">SystemTimezoneAutomaticDetection policy support</translation> <translation id="9206487995878691001">Cangjie input method</translation> <translation id="9207194316435230304">ATOK</translation> <translation id="9208886416788010685">Adobe Reader Out Of Date</translation> @@ -5586,6 +5628,7 @@ <translation id="939736085109172342">New folder</translation> <translation id="940425055435005472">Font size:</translation> <translation id="941543339607623937">Invalid private key.</translation> +<translation id="942532530371314860"><ph name="APP_NAME" /> is sharing a Chrome tab and audio.</translation> <translation id="942954117721265519">No images in this directory.</translation> <translation id="945522503751344254">Send feedback</translation> <translation id="946810925362320585">Follow recommendation</translation>
diff --git a/chrome/app/resources/generated_resources_es-419.xtb b/chrome/app/resources/generated_resources_es-419.xtb index f01d234a..ca1b592 100644 --- a/chrome/app/resources/generated_resources_es-419.xtb +++ b/chrome/app/resources/generated_resources_es-419.xtb
@@ -658,7 +658,6 @@ <translation id="1962233722219655970">Esta página usa una aplicación con tecnología Native Client que no funciona en tu computadora.</translation> <translation id="1965328510789761112">Memoria privada</translation> <translation id="1965624977906726414">No requiere permisos especiales.</translation> -<translation id="1968720524450620475">Habilitar íconos de acción para las notificaciones web</translation> <translation id="1970746430676306437">Ver &información de la página</translation> <translation id="197288927597451399">Conservar</translation> <translation id="1973491249112991739">Error al descargar <ph name="PLUGIN_NAME" /></translation> @@ -1420,7 +1419,6 @@ <translation id="302014277942214887">Ingresa el ID de la aplicación o la URL de la tienda virtual.</translation> <translation id="3020616530769498629">Habilitar la opción no validante de volver a cargar en "Desplegar para actualizar"</translation> <translation id="3020990233660977256">Número de serie: <ph name="SERIAL_NUMBER" /></translation> -<translation id="3021245547458004908">Cuando se habilite, la barra de herramientas nunca se ocultará al desplazarse en dispositivos que tengan una pantalla de 800 dp como mínimo. Sin embargo, se ocultará si el contenido de la página se muestra en pantalla completa.</translation> <translation id="3021678814754966447">&Ver fuente del marco</translation> <translation id="3024374909719388945">Utilizar reloj de 24 horas</translation> <translation id="3025022340603654002">Realizar sugerencias de autocompletar con el clic inicial del mouse en un elemento de formulario.</translation> @@ -1491,7 +1489,6 @@ <translation id="3117812041123364382">Permite habilitar o inhabilitar el teclado virtual flotante.</translation> <translation id="3118319026408854581"><ph name="PRODUCT_NAME" /> Ayuda</translation> <translation id="3120430004221004537">La encriptación no fue suficiente para una operación en: "<ph name="DEVICE_NAME" />".</translation> -<translation id="3121260210578524273">Permite habilitar íconos en los botones de acción para las notificaciones web.</translation> <translation id="3121793941267913344">Restablecer este dispositivo <ph name="IDS_SHORT_PRODUCT_NAME" /></translation> <translation id="3122162841865761901">Experimentos en Herramientas para programadores</translation> <translation id="3122464029669770682">CPU</translation> @@ -2273,6 +2270,7 @@ <translation id="421017592316736757">Tienes que estar conectado para acceder a este archivo.</translation> <translation id="421182450098841253">Mo&strar la barra de marcadores</translation> <translation id="4212108296677106246">¿Deseas confiar en "<ph name="CERTIFICATE_NAME" />" como una Entidad de certificación?</translation> +<translation id="42126664696688958">Exportar</translation> <translation id="42137655013211669">El servidor prohibió el acceso a este recurso.</translation> <translation id="4215350869199060536">El nombre incluye símbolos no permitidos.</translation> <translation id="4215898373199266584">¡No se lo digas a nadie! El modo incógnito (<ph name="INCOGNITO_MODE_SHORTCUT" />) puede resultarte útil la próxima vez.</translation> @@ -3304,7 +3302,6 @@ <translation id="577322787686508614">No se permite la operación de lectura en: "<ph name="DEVICE_NAME" />".</translation> <translation id="5774295353725270860">Abrir aplicación de archivos</translation> <translation id="5774515636230743468">Manifiesto:</translation> -<translation id="5776006986202016118">Este sitio desea conectarse a:</translation> <translation id="577624874850706961">Buscar cookies</translation> <translation id="5778550464785688721">Control total de dispositivos MIDI</translation> <translation id="5780066559993805332">(Superior)</translation> @@ -4193,7 +4190,6 @@ <translation id="7175353351958621980">Cargados desde:</translation> <translation id="7180611975245234373">Actualizar</translation> <translation id="7180865173735832675">Personalizar</translation> -<translation id="7184428045150946911">Inhabilitar la ocultación automática de la barra de herramientas en tablets de gran tamaño</translation> <translation id="7185690883425432021">Oculta los botones de cierre de las pestañas inactivas en la barra de pestañas cuando están apiladas.</translation> <translation id="7186088072322679094">Mantener en la barra de herramientas</translation> <translation id="719009910964971313">Teclado Programmer Dvorak, EE. UU.</translation> @@ -5130,7 +5126,7 @@ <translation id="8589311641140863898">Extensión experimental API</translation> <translation id="8590375307970699841">Configurar actualizaciones automáticas</translation> <translation id="8592071947729879125">Restringe los permisos de iframe.</translation> -<translation id="8592125506633137593">Aislamiento del documento superior</translation> +<translation id="8592125506633137593">Aislamiento del documento principal</translation> <translation id="8594787581355215556">Accediste como <ph name="USER_EMAIL_ADDRESS" />. Administra tus datos sincronizados en el <ph name="BEGIN_LINK" />panel de control de Google<ph name="END_LINK" />.</translation> <translation id="8596540852772265699">Archivos personalizados</translation> <translation id="8596785155158796745">El micrófono no está disponible en este momento. <ph name="BEGIN_LINK" />Administrar micrófono<ph name="END_LINK" /></translation>
diff --git a/chrome/app/resources/generated_resources_es.xtb b/chrome/app/resources/generated_resources_es.xtb index ca6ba78..5d150992 100644 --- a/chrome/app/resources/generated_resources_es.xtb +++ b/chrome/app/resources/generated_resources_es.xtb
@@ -661,7 +661,6 @@ <translation id="1962233722219655970">Esta página utiliza una aplicación de Native Client que no funciona en tu ordenador.</translation> <translation id="1965328510789761112">Memoria privada</translation> <translation id="1965624977906726414">No tiene permisos especiales.</translation> -<translation id="1968720524450620475">Habilitar iconos de acción para las notificaciones web.</translation> <translation id="1970746430676306437">Ver &información de la página</translation> <translation id="197288927597451399">Descargar</translation> <translation id="1973491249112991739">Error al descargar <ph name="PLUGIN_NAME" /></translation> @@ -1426,7 +1425,6 @@ <translation id="302014277942214887">Introduce el identificador de la aplicación o la URL de Chrome Web Store.</translation> <translation id="3020616530769498629">Habilitar la opción de volver a cargar sin validar en la función de deslizar para actualizar</translation> <translation id="3020990233660977256">Número de serie: <ph name="SERIAL_NUMBER" /></translation> -<translation id="3021245547458004908">Si se habilita esta opción, la barra de herramientas no se ocultará nunca cuando se produzcan desplazamientos en dispositivos con una pantalla de 800 dp como mínimo. Sin embargo, se ocultará si los contenidos de una página web se muestran en pantalla completa.</translation> <translation id="3021678814754966447">&Ver fuente del marco</translation> <translation id="3024374909719388945">Usar reloj de 24 horas</translation> <translation id="3025022340603654002">Permite hacer sugerencias de autocompletado con el clic inicial del ratón en un elemento de formulario.</translation> @@ -1443,7 +1441,7 @@ Al crear un usuario supervisado, no se crea una cuenta de Google, y sus marcadores, su historial de navegación y otras preferencias no estarán disponibles en otros dispositivos con la sincronización de Chrome. Una vez que hayas creado un nuevo usuario supervisado, podrás administrar su configuración en cualquier momento y desde cualquier dispositivo en la página <ph name="BEGIN_MANAGE_LINK" /><ph name="DISPLAY_LINK" /><ph name="END_MANAGE_LINK" />. -Para obtener más información accede a nuestro <ph name="BEGIN_LINK" />Centro de Ayuda<ph name="END_LINK" />.</translation> +Para obtener más información, accede a nuestro <ph name="BEGIN_LINK" />Centro de Ayuda<ph name="END_LINK" />.</translation> <translation id="3031417829280473749">Agente X</translation> <translation id="3031557471081358569">Selecciona los elementos que quieres importar:</translation> <translation id="3033332627063280038">Habilita la implementación experimental de la directiva de control de caché stale_while_revalidate, que permite que los servidores especifiquen que se puedan revalidar algunos recursos en segundo plano para mejorar la latencia.</translation> @@ -1497,7 +1495,6 @@ <translation id="3117812041123364382">Habilita o inhabilita el teclado virtual flotante.</translation> <translation id="3118319026408854581">Ayuda de <ph name="PRODUCT_NAME" /></translation> <translation id="3120430004221004537">Cifrado insuficiente para una operación determinada de "<ph name="DEVICE_NAME" />".</translation> -<translation id="3121260210578524273">Habilitar iconos en los botones de acción para las notificaciones web.</translation> <translation id="3121793941267913344">Restablece este dispositivo <ph name="IDS_SHORT_PRODUCT_NAME" /></translation> <translation id="3122162841865761901">Experimentos de Herramientas para desarrolladores</translation> <translation id="3122464029669770682">CPU</translation> @@ -2275,6 +2272,7 @@ <translation id="421017592316736757">Tienes que conectarte a Internet para acceder a este archivo.</translation> <translation id="421182450098841253">&Mostrar barra de marcadores</translation> <translation id="4212108296677106246">¿Quieres confiar en "<ph name="CERTIFICATE_NAME" />" como una entidad emisora de certificados?</translation> +<translation id="42126664696688958">Exportar</translation> <translation id="42137655013211669">El servidor ha prohibido el acceso a este recurso.</translation> <translation id="4215350869199060536">¡Vaya! El nombre incluye símbolos que no están permitidos</translation> <translation id="4215898373199266584">¡Pst! El modo de incógnito (<ph name="INCOGNITO_MODE_SHORTCUT" />) puede serte de utilidad la próxima vez.</translation> @@ -3303,7 +3301,6 @@ <translation id="577322787686508614">No se permite la operación de lectura en "<ph name="DEVICE_NAME" />".</translation> <translation id="5774295353725270860">Abrir la aplicación Archivos</translation> <translation id="5774515636230743468">Manifiesto:</translation> -<translation id="5776006986202016118">Este sitio quiere conectarse a:</translation> <translation id="577624874850706961">Buscar cookies</translation> <translation id="5778550464785688721">Control total de dispositivos MIDI</translation> <translation id="5780066559993805332">(Mejor)</translation> @@ -3703,7 +3700,7 @@ <translation id="6418505248408153264">Habilitar el historial de Material Design</translation> <translation id="6419288379019356534">Este dispositivo está gestionado por <ph name="BEGIN_BOLD" /><ph name="DOMAIN" /><ph name="END_BOLD" />. <ph name="LINE_BREAK" /> - Haz clic en "Siguiente" para continuar iniciando sesión en tu cuenta de <ph name="BEGIN_BOLD" /><ph name="DOMAIN" /><ph name="END_BOLD" />.</translation> + Haz clic en Siguiente para continuar iniciando sesión en tu cuenta de <ph name="BEGIN_BOLD" /><ph name="DOMAIN" /><ph name="END_BOLD" />.</translation> <translation id="6419902127459849040">Europa Central</translation> <translation id="6420676428473580225">Añadir al escritorio</translation> <translation id="6422329785618833949">Foto girada</translation> @@ -4194,7 +4191,6 @@ <translation id="7175353351958621980">Cargado desde:</translation> <translation id="7180611975245234373">Actualizar</translation> <translation id="7180865173735832675">Personalizar</translation> -<translation id="7184428045150946911">Inhabilitar la opción para ocultar la barra de herramientas automáticamente en tablets de gran tamaño</translation> <translation id="7185690883425432021">Oculta botones de cierre de pestañas inactivas cuando la barra de pestañas está en modo apilado.</translation> <translation id="7186088072322679094">Mantener en la barra de herramientas</translation> <translation id="719009910964971313">Teclado Programmer Dvorak de EE. UU.</translation> @@ -4579,7 +4575,7 @@ <translation id="7786207843293321886">Salir de la sesión de invitado</translation> <translation id="7786889348652477777">&Volver a cargar aplicación</translation> <translation id="7787129790495067395">Actualmente estás utilizando una frase de contraseña. Si la has olvidado, puedes restablecer la sincronización para borrar los datos de los servidores de Google a través del panel de control de Google.</translation> -<translation id="7787308148023287649">Se muestra en otra pantalla</translation> +<translation id="7787308148023287649">Mostrar en otra pantalla</translation> <translation id="7788080748068240085">Para guardar "<ph name="FILE_NAME" />" sin conexión, debes liberar <ph name="TOTAL_FILE_SIZE" /> de espacio adicional:<ph name="MARKUP_1" /> <ph name="MARKUP_2" />Elimina archivos a los que ya no necesites acceder sin conexión.<ph name="MARKUP_3" /> <ph name="MARKUP_4" />Borra archivos de la carpeta de descargas.<ph name="MARKUP_5" /></translation> @@ -5320,7 +5316,7 @@ <translation id="8847988622838149491">USB</translation> <translation id="8848709220963126773">Cambiar a modo de tecla Mayús</translation> <translation id="8852742364582744935">Se han añadido las siguientes aplicaciones y extensiones:</translation> -<translation id="8853611566624224021">Habilita la recuperación de archivos de pantalla ICC del servidor de Quirks para calibrar el color de la pantalla.</translation> +<translation id="8853611566624224021">Habilita la recuperación de archivos de pantalla ICC de Quirks Server para calibrar el color de la pantalla.</translation> <translation id="885381502874625531">Teclado bielorruso</translation> <translation id="8856844195561710094">Error al detener la detección del dispositivo Bluetooth</translation> <translation id="885701979325669005">Almacenamiento</translation>
diff --git a/chrome/app/resources/generated_resources_et.xtb b/chrome/app/resources/generated_resources_et.xtb index 9c163ca..6d540e6 100644 --- a/chrome/app/resources/generated_resources_et.xtb +++ b/chrome/app/resources/generated_resources_et.xtb
@@ -661,7 +661,6 @@ <translation id="1962233722219655970">Leht kasutab omakliendi rakendust, mis ei tööta teie arvutis.</translation> <translation id="1965328510789761112">Privaatmälu</translation> <translation id="1965624977906726414">Pole erilubasid.</translation> -<translation id="1968720524450620475">Luba veebimärguannete toiminguikoonid.</translation> <translation id="1970746430676306437">Kuva lehekülje &andmed</translation> <translation id="197288927597451399">Jäta alles</translation> <translation id="1973491249112991739">Pistikprogrammi <ph name="PLUGIN_NAME" /> allalaadimine ebaõnnestus.</translation> @@ -1424,7 +1423,6 @@ <translation id="302014277942214887">Sisestage rakenduse ID või veebipoe URL.</translation> <translation id="3020616530769498629">Funktsiooni Tõmba värskendamiseks puhul valideerimiseta uuesti laadimise lubamine</translation> <translation id="3020990233660977256">Seerianumber: <ph name="SERIAL_NUMBER" /></translation> -<translation id="3021245547458004908">Kui see on lubatud, ei peideta tööriistariba kunagi, kui keritakse seadmetes, mille ekraani minimaalne DP on suurem kui 800 või sellega võrdne. See peidetakse siiski juhul, kui lehe sisu kuvatakse täisekraanil.</translation> <translation id="3021678814754966447">&Vaata raami allikat</translation> <translation id="3024374909719388945">Kasuta 24 h kella</translation> <translation id="3025022340603654002">Automaatse täitmise soovitusi tehakse siis, kui vormi elemendil klõpsatakse hiirega esimest korda.</translation> @@ -1495,7 +1493,6 @@ <translation id="3117812041123364382">Hõljuva virtuaalse klaviatuuri lubamine/keelamine.</translation> <translation id="3118319026408854581">Toote <ph name="PRODUCT_NAME" /> abi</translation> <translation id="3120430004221004537">Ebapiisav krüpteerimine antud toimingu puhul seadmes „<ph name="DEVICE_NAME" />”.</translation> -<translation id="3121260210578524273">Lubage veebimärguannete puhul toimingunuppude ikoonid.</translation> <translation id="3121793941267913344">Toote <ph name="IDS_SHORT_PRODUCT_NAME" /> seadme lähtestamine</translation> <translation id="3122162841865761901">Arendaja tööriistade katsed</translation> <translation id="3122464029669770682">Protsessor</translation> @@ -2277,6 +2274,7 @@ <translation id="421017592316736757">Faili juurde pääsemiseks on vaja võrguühendust.</translation> <translation id="421182450098841253">Kuva &järjehoidjariba</translation> <translation id="4212108296677106246">Kas soovite usaldada sertifikaati „<ph name="CERTIFICATE_NAME" />” sertifitseerimisorganina?</translation> +<translation id="42126664696688958">Eksportimine</translation> <translation id="42137655013211669">Server keelas juurdepääsu ressursile.</translation> <translation id="4215350869199060536">Kahjuks on nimes valed märgid.</translation> <translation id="4215898373199266584">Inkognito režiim (<ph name="INCOGNITO_MODE_SHORTCUT" />) võib järgmisel korral kasulikuks osutuda.</translation> @@ -3308,7 +3306,6 @@ <translation id="577322787686508614">Lugemistoiming pole seadmes „<ph name="DEVICE_NAME" />” lubatud.</translation> <translation id="5774295353725270860">Ava failirakendus</translation> <translation id="5774515636230743468">Manifest:</translation> -<translation id="5776006986202016118">See sait soovib ühendust luua:</translation> <translation id="577624874850706961">Otsi küpsiseid</translation> <translation id="5778550464785688721">MIDI-seadmete täielik juhtimine</translation> <translation id="5780066559993805332">(Parim)</translation> @@ -4201,7 +4198,6 @@ <translation id="7175353351958621980">Laaditud:</translation> <translation id="7180611975245234373">Värskenda</translation> <translation id="7180865173735832675">Kohandamine</translation> -<translation id="7184428045150946911">Keela tööriistariba automaatne peitmine suurtes tahvelarvutites</translation> <translation id="7185690883425432021">Peidab passiivsete vahelehtede sulgemisnupud, kui vahelehe riba on virnastamisrežiimis.</translation> <translation id="7186088072322679094">Tööriistaribale jätmine</translation> <translation id="719009910964971313">USA programmeerija Dvoraki klaviatuur</translation> @@ -5108,7 +5104,7 @@ <translation id="8545211332741562162">Lubab veebilehtedel kasutada JavaScripti katselisi funktsioone.</translation> <translation id="8545575359873600875">Vabandust, teie parooli ei saanud kinnitada. Jälgitava kasutaja haldur on võib-olla hiljuti parooli muutnud. Kui nii, rakendatakse uut parooli järgmisel korral, kui sisse logite. Proovige kasutada oma vana parooli.</translation> <translation id="8546306075665861288">Kujutise vahemälu</translation> -<translation id="854653344619327455">Selle märgistusega ei võimalda lauaarvuti jagamise valimisaken kasutajal valida, kas ta soovib heli jagada.</translation> +<translation id="854653344619327455">Selle märgistusega ei võimalda töölaua jagamise valimisaken kasutajal valida, kas ta soovib heli jagada.</translation> <translation id="8546541260734613940">[*.]example.com</translation> <translation id="8548973727659841685">Tähemärk</translation> <translation id="855081842937141170">Kinnita vaheleht</translation>
diff --git a/chrome/app/resources/generated_resources_fa.xtb b/chrome/app/resources/generated_resources_fa.xtb index cb7655af..8d13cdf 100644 --- a/chrome/app/resources/generated_resources_fa.xtb +++ b/chrome/app/resources/generated_resources_fa.xtb
@@ -659,7 +659,6 @@ <translation id="1962233722219655970">این صفحه از برنامه Native Client استفاده میکند که روی رایانه شما کار نمیکند.</translation> <translation id="1965328510789761112">حافظه خصوصی</translation> <translation id="1965624977906726414">مجوز خاصی ندارد.</translation> -<translation id="1968720524450620475">فعال کردن نمادهای عملکرد برای اعلانهای وب.</translation> <translation id="1970746430676306437">مشاهده &اطلاعات صفحه</translation> <translation id="197288927597451399">ادامه دادن</translation> <translation id="1973491249112991739">دانلود <ph name="PLUGIN_NAME" /> ناموفق بود.</translation> @@ -1420,7 +1419,6 @@ <translation id="302014277942214887">شناسه برنامه کاربردی یا نشانی وب فروشگاه وب را وارد کنید.</translation> <translation id="3020616530769498629">فعال کردن تازهسازی بدون تأیید اعتبار در «کشیدن برای بازخوانی»</translation> <translation id="3020990233660977256">شمارهٔ سریال: <ph name="SERIAL_NUMBER" /></translation> -<translation id="3021245547458004908">وقتی فعال است، نوارابزار هرگز بهدلیل پیمایش در دستگاههایی که دارای صفحه نمایش حداقل dp >= ۸۰۰ هستند پنهان نمیشود. ولی اگر محتوای صفحه به حالت تمامصفحه برود نوارابزار همچنان پنهان خواهد شد.</translation> <translation id="3021678814754966447">&نمای منبع قاب</translation> <translation id="3024374909719388945">استفاده از ساعت ۲۴ ساعته</translation> <translation id="3025022340603654002">پیشنهادات را با اولین کلیک موشواره روی عنصر فرم به صورت خودکار تکمیل کنید.</translation> @@ -1491,7 +1489,6 @@ <translation id="3117812041123364382">فعال/غیرفعال کردن صفحهکلید مجازی شناور.</translation> <translation id="3118319026408854581">راهنمای <ph name="PRODUCT_NAME" /></translation> <translation id="3120430004221004537">رمزگذاری برای عملیات موردنظر در این دستگاه کافی نیست: «<ph name="DEVICE_NAME" />».</translation> -<translation id="3121260210578524273">فعال کردن نمادها در دکمههای عملکرد برای اعلانهای وب.</translation> <translation id="3121793941267913344">این دستگاه <ph name="IDS_SHORT_PRODUCT_NAME" /> بازنشانی شود</translation> <translation id="3122162841865761901">آزمایشهای ابزار برنامهنویس</translation> <translation id="3122464029669770682">CPU</translation> @@ -2273,6 +2270,7 @@ <translation id="421017592316736757">باید آنلاین باشید تا به این فایل دسترسی داشته باشید.</translation> <translation id="421182450098841253">&نمایش نوار نشانکها</translation> <translation id="4212108296677106246">آیا میخواهید به "<ph name="CERTIFICATE_NAME" />" بهعنوان یک ارائه دهنده مجوز اعتماد کنید؟</translation> +<translation id="42126664696688958">صادر کردن</translation> <translation id="42137655013211669">سرور، دسترسی به این منبع را ممنوع کرد.</translation> <translation id="4215350869199060536">اوووه، نمادهای غیرقانونی در نام!</translation> <translation id="4215898373199266584">توجه! حالت ناشناس (<ph name="INCOGNITO_MODE_SHORTCUT" />) ممکن است بار بعد در دسترس قرار گیرد.</translation> @@ -3304,7 +3302,6 @@ <translation id="577322787686508614">عملیات خواندن در این دستگاه مجاز نیست: «<ph name="DEVICE_NAME" />».</translation> <translation id="5774295353725270860">بازکردن برنامه فایلها</translation> <translation id="5774515636230743468">اظهارنامه:</translation> -<translation id="5776006986202016118">این سایت میخواهد به این موارد متصل شود:</translation> <translation id="577624874850706961">جستجوی کوکیها</translation> <translation id="5778550464785688721">کنترل کامل دستگاههای MIDI</translation> <translation id="5780066559993805332">(بهترین)</translation> @@ -4193,7 +4190,6 @@ <translation id="7175353351958621980">بارگیری شده از:</translation> <translation id="7180611975245234373">بازخوانی</translation> <translation id="7180865173735832675">سفارشی کردن</translation> -<translation id="7184428045150946911">غیرفعال کردن پنهان شدن خودکار نوارابزار در رایانههای لوحی بزرگ</translation> <translation id="7185690883425432021">وقتی نوار برگه در حالت پشتهای است، دکمههای بستن را در برگههای غیرفعال پنهان میکند.</translation> <translation id="7186088072322679094">نگه داشتن در نوار ابزار</translation> <translation id="719009910964971313">استفاده از دووراک آمریکایی برنامهنویسها</translation>
diff --git a/chrome/app/resources/generated_resources_fi.xtb b/chrome/app/resources/generated_resources_fi.xtb index 85ca301..016dbc2 100644 --- a/chrome/app/resources/generated_resources_fi.xtb +++ b/chrome/app/resources/generated_resources_fi.xtb
@@ -661,7 +661,6 @@ <translation id="1962233722219655970">Tämä sivu käyttää Native Client -sovellusta, joka ei toimi tietokoneellasi.</translation> <translation id="1965328510789761112">Yksityinen muisti</translation> <translation id="1965624977906726414">Ei erityiskäyttöoikeuksia.</translation> -<translation id="1968720524450620475">Ota verkkoilmoitusten toimintokuvakkeet käyttöön</translation> <translation id="1970746430676306437">Näytä sivutie&dot</translation> <translation id="197288927597451399">Säilytä</translation> <translation id="1973491249112991739">Laajennuksen <ph name="PLUGIN_NAME" /> lataus epäonnistui.</translation> @@ -1424,7 +1423,6 @@ <translation id="302014277942214887">Anna sovellustunnus tai verkkomyymälän URL-osoite.</translation> <translation id="3020616530769498629">Ota käyttöön päivittäminen ilman vahvistusta vetämällä päivittämisen yhteydessä</translation> <translation id="3020990233660977256">Sarjanumero: <ph name="SERIAL_NUMBER" /></translation> -<translation id="3021245547458004908">Kun tämä asetus on käytössä, työkalupalkkia ei koskaan piiloteta vierityksen vuoksi, jos laitteen näytön tarkkuus on vähintään 800. Se piilotetaan kuitenkin, jos sivu on koko näytön tilassa.</translation> <translation id="3021678814754966447">&Näytä kehyksen lähdekoodi</translation> <translation id="3024374909719388945">Käytä 24 tunnin kelloa</translation> <translation id="3025022340603654002">Tee automaattisen täytön ehdotuksia lomake-elementissä ensimmäisen hiiren klikkauksen jälkeen.</translation> @@ -1495,7 +1493,6 @@ <translation id="3117812041123364382">Poista tai ota käyttöön kelluva virtuaalinen näppäimistö.</translation> <translation id="3118319026408854581"><ph name="PRODUCT_NAME" /> Ohje</translation> <translation id="3120430004221004537">Riittämätön annetun toiminnon salaus laitteella <ph name="DEVICE_NAME" />.</translation> -<translation id="3121260210578524273">Ota verkkoilmoitusten toimintopainikkeiden kuvakkeet käyttöön.</translation> <translation id="3121793941267913344">Palauta <ph name="IDS_SHORT_PRODUCT_NAME" />-laitteesi</translation> <translation id="3122162841865761901">Kehittäjän työkalujen kokeet</translation> <translation id="3122464029669770682">Keskusyksikkö</translation> @@ -2273,6 +2270,7 @@ <translation id="421017592316736757">Sinun täytyy olla online-tilassa käyttääksesi tätä tiedostoa.</translation> <translation id="421182450098841253">Näytä kirjanmerkkipalkki</translation> <translation id="4212108296677106246">Luotetaanko kohteeseen <ph name="CERTIFICATE_NAME" /> varmenteen myöntäjänä?</translation> +<translation id="42126664696688958">Vie</translation> <translation id="42137655013211669">Palvelin kielsi tämän resurssin käytön.</translation> <translation id="4215350869199060536">Hups, nimessä on luvattomia merkkejä!</translation> <translation id="4215898373199266584">Psst! Suosittelemme käyttämään ensi kerralla incognito-tilaa (<ph name="INCOGNITO_MODE_SHORTCUT" />).</translation> @@ -3297,7 +3295,6 @@ <translation id="577322787686508614">Lukutoiminto ei ole sallittu laitteella <ph name="DEVICE_NAME" />.</translation> <translation id="5774295353725270860">Avaa Tiedostot-sovellus</translation> <translation id="5774515636230743468">Luettelo:</translation> -<translation id="5776006986202016118">Tämä sivusto haluaa muodostaa yhteyden kohteeseen</translation> <translation id="577624874850706961">Hae evästeistä</translation> <translation id="5778550464785688721">MIDI-laitteiden täysi käyttöoikeus</translation> <translation id="5780066559993805332">(Paras)</translation> @@ -4187,7 +4184,6 @@ <translation id="7175353351958621980">Ladattu kohteesta:</translation> <translation id="7180611975245234373">Päivitä</translation> <translation id="7180865173735832675">Muokkaa</translation> -<translation id="7184428045150946911">Poista käytöstä työkalupalkin automaattinen piilottaminen suurilla tableteilla</translation> <translation id="7185690883425432021">Piilottaa ei-aktiivisten välilehtien sulkemispainikkeet välilehtipinosta.</translation> <translation id="7186088072322679094">Pidä yläpalkissa</translation> <translation id="719009910964971313">Näppäimistö: US, Dvorak ohjelmoijille</translation>
diff --git a/chrome/app/resources/generated_resources_fil.xtb b/chrome/app/resources/generated_resources_fil.xtb index 1de8b72..43fbfeb 100644 --- a/chrome/app/resources/generated_resources_fil.xtb +++ b/chrome/app/resources/generated_resources_fil.xtb
@@ -662,7 +662,6 @@ <translation id="1962233722219655970">Gumagamit ang pahinang ito ng Native Client app na hindi gumagana sa iyong computer.</translation> <translation id="1965328510789761112">Pribadong memory</translation> <translation id="1965624977906726414">Walang espesyal na pahintulot.</translation> -<translation id="1968720524450620475">I-enable ang mga icon ng pagkilos para sa Mga Notification sa Web.</translation> <translation id="1970746430676306437">Tingnan ang &impormasyon ng page</translation> <translation id="197288927597451399">Panatilihin</translation> <translation id="1973491249112991739">Nabigo ang pag-download ng <ph name="PLUGIN_NAME" />.</translation> @@ -1426,7 +1425,6 @@ <translation id="302014277942214887">Maglagay ng application id o URL ng webstore.</translation> <translation id="3020616530769498629">I-enable ang hindi nagpapatunay na pag-reload sa pull-to-refresh</translation> <translation id="3020990233660977256">Serial Number: <ph name="SERIAL_NUMBER" /></translation> -<translation id="3021245547458004908">Kapag na-enable, hindi kailanman maitatago ang toolbar dahil sa pag-i-scroll sa mga device na may minimum na screen dp na >= 800. Nakatago pa rin ito kahit na i-fullscreen ang mga content ng page.</translation> <translation id="3021678814754966447">&Tingnan ang Pinagmulan ng Frame</translation> <translation id="3024374909719388945">Gamitin ang 24-oras na orasan</translation> <translation id="3025022340603654002">Magbigay ng mga suhestyon sa autofill sa unang pag-click ng mouse sa isang elemento ng form.</translation> @@ -1497,7 +1495,6 @@ <translation id="3117812041123364382">I-enable/I-disable ang lumulutang na virtual na keyboard.</translation> <translation id="3118319026408854581"><ph name="PRODUCT_NAME" /> Help</translation> <translation id="3120430004221004537">Hindi sapat ang pag-encrypt para sa isang partikular na operation sa: "<ph name="DEVICE_NAME" />".</translation> -<translation id="3121260210578524273">I-enable ang mga icon sa mga action button para sa Mga Notification sa Web.</translation> <translation id="3121793941267913344">I-reset ang <ph name="IDS_SHORT_PRODUCT_NAME" /> device na ito</translation> <translation id="3122162841865761901">Mga eksperimento sa Mga Tool ng Developer</translation> <translation id="3122464029669770682">CPU</translation> @@ -2280,6 +2277,7 @@ <translation id="421017592316736757">Kailangan kang mag-online upang ma-access ang file na ito.</translation> <translation id="421182450098841253">&Ipakita ang Bookmarks Bar</translation> <translation id="4212108296677106246">Gusto mo bang pagkatiwalaan ang "<ph name="CERTIFICATE_NAME" />" bilang Certification Authority?</translation> +<translation id="42126664696688958">I-export</translation> <translation id="42137655013211669">Ipinagbabawal ng server ang access sa mapagkukunang ito.</translation> <translation id="4215350869199060536">Oops, mayroong mga ilegal na simbolo sa pangalan!</translation> <translation id="4215898373199266584">Psst! Maaaring maging kapaki-pakinabang ang mode na incognito (<ph name="INCOGNITO_MODE_SHORTCUT" />) sa susunod.</translation> @@ -3312,7 +3310,6 @@ <translation id="577322787686508614">Hindi pinapahintulutan ang read na operation sa: "<ph name="DEVICE_NAME" />".</translation> <translation id="5774295353725270860">App na Buksan ang Mga File</translation> <translation id="5774515636230743468">Manifest:</translation> -<translation id="5776006986202016118">Gustong kumonekta ng site na ito sa:</translation> <translation id="577624874850706961">Maghanap ng cookies</translation> <translation id="5778550464785688721">Ganap na pagkontrol sa mga MIDI device</translation> <translation id="5780066559993805332">(Pinakamahusay)</translation> @@ -4207,7 +4204,6 @@ <translation id="7175353351958621980">Nag-load mula sa:</translation> <translation id="7180611975245234373">I-refresh</translation> <translation id="7180865173735832675">I-customize</translation> -<translation id="7184428045150946911">I-disable ang awtomatikong pagtatago sa toolbar sa malalaking tablet</translation> <translation id="7185690883425432021">Itinatago ang mga button para sa pagsasara ng mga hindi aktibong window kapag nasa stacked mode ang tabstrip.</translation> <translation id="7186088072322679094">Panatilihin sa Toolbar</translation> <translation id="719009910964971313">Keyboard ng US Programmer Dvorak</translation>
diff --git a/chrome/app/resources/generated_resources_fr.xtb b/chrome/app/resources/generated_resources_fr.xtb index df27f15..2e3f9d8 100644 --- a/chrome/app/resources/generated_resources_fr.xtb +++ b/chrome/app/resources/generated_resources_fr.xtb
@@ -661,7 +661,6 @@ <translation id="1962233722219655970">Cette page utilise une application cliente native qui ne fonctionne pas sur votre ordinateur.</translation> <translation id="1965328510789761112">Mémoire privée</translation> <translation id="1965624977906726414">Ne dispose d'aucune autorisation spéciale.</translation> -<translation id="1968720524450620475">Activer les icônes d'action pour les notifications Web.</translation> <translation id="1970746430676306437">Afficher les &infos sur la page</translation> <translation id="197288927597451399">Enregistrer</translation> <translation id="1973491249112991739">Échec du téléchargement de <ph name="PLUGIN_NAME" />.</translation> @@ -1423,7 +1422,6 @@ <translation id="302014277942214887">Saisissez l'identifiant de l'application ou l'URL du Chrome Web Store.</translation> <translation id="3020616530769498629">Activer l'actualisation sans validation lors du balayage vers le bas pour actualiser l'affichage</translation> <translation id="3020990233660977256">Numéro de série : <ph name="SERIAL_NUMBER" /></translation> -<translation id="3021245547458004908">Lorsque cette option est activée, la barre d'outils n'est jamais masquée lors du défilement sur les appareils dont l'affichage de l'écran est supérieur ou égal à 800 pixels. Elle continue cependant d'être masquée si le contenu de la page est affiché en plein écran.</translation> <translation id="3021678814754966447">&Afficher le code source du cadre</translation> <translation id="3024374909719388945">Utiliser l'horloge au format 24 heures</translation> <translation id="3025022340603654002">Propose des suggestions de remplissage automatique lors du clic initial de la souris sur un élément du formulaire.</translation> @@ -1434,7 +1432,7 @@ <translation id="302781076327338683">Actualiser en ignorant le cache</translation> <translation id="3030243755303701754">Un utilisateur supervisé peut naviguer sur le Web sous votre contrôle. En tant que gestionnaire d'un tel utilisateur dans Chrome, vous pouvez : - • autoriser ou interdire certains sites Web, + • autoriser ou interdire l'accès à certains sites Web, • consulter les sites Web visités par l'utilisateur supervisé, et • gérer d'autres paramètres. @@ -1494,7 +1492,6 @@ <translation id="3117812041123364382">Activer ou désactiver le clavier virtuel flottant</translation> <translation id="3118319026408854581">Aide <ph name="PRODUCT_NAME" /></translation> <translation id="3120430004221004537">Chiffrement insuffisant pour une opération donnée sur l'appareil <ph name="DEVICE_NAME" />.</translation> -<translation id="3121260210578524273">Activer les icônes dans les boutons d'action pour les notifications Web.</translation> <translation id="3121793941267913344">Réinitialiser cet appareil <ph name="IDS_SHORT_PRODUCT_NAME" /></translation> <translation id="3122162841865761901">Tests au niveau des outils de développement</translation> <translation id="3122464029669770682">UC</translation> @@ -2276,6 +2273,7 @@ <translation id="421017592316736757">Pour accéder à ce fichier, vous devez être connecté à Internet.</translation> <translation id="421182450098841253">&Afficher la barre de favoris</translation> <translation id="4212108296677106246">Voulez-vous que "<ph name="CERTIFICATE_NAME" />" soit considérée comme une autorité de certification fiable ?</translation> +<translation id="42126664696688958">Exporter</translation> <translation id="42137655013211669">L'accès à cette ressource est interdit sur ce serveur.</translation> <translation id="4215350869199060536">Petit problème… Le nom contient des symboles non autorisés.</translation> <translation id="4215898373199266584">Conseil : Le mode navigation privée (<ph name="INCOGNITO_MODE_SHORTCUT" />) pourra vous être utile la prochaine fois.</translation> @@ -3308,7 +3306,6 @@ <translation id="577322787686508614">L'opération de lecture n'est pas autorisée sur l'appareil <ph name="DEVICE_NAME" />.</translation> <translation id="5774295353725270860">Ouvrir l'application Fichiers</translation> <translation id="5774515636230743468">Manifeste :</translation> -<translation id="5776006986202016118">Ce site tente de se connecter à :</translation> <translation id="577624874850706961">Rechercher des cookies</translation> <translation id="5778550464785688721">Contrôle total des appareils MIDI</translation> <translation id="5780066559993805332">(Idéale)</translation> @@ -4199,7 +4196,6 @@ <translation id="7175353351958621980">Chargé depuis :</translation> <translation id="7180611975245234373">Actualiser</translation> <translation id="7180865173735832675">Personnaliser</translation> -<translation id="7184428045150946911">Désactiver le masquage automatique de la barre d'outils sur les grandes tablettes</translation> <translation id="7185690883425432021">Cette option permet de masquer le bouton de fermeture des onglets inactifs lorsque la barre d'onglets est en mode empilé.</translation> <translation id="7186088072322679094">Garder dans la barre d'outils</translation> <translation id="719009910964971313">Clavier Dvorak américain pour programmeurs</translation> @@ -5254,7 +5250,7 @@ <translation id="8737685506611670901">Ouvrir les liens "<ph name="PROTOCOL" />" à la place de "<ph name="REPLACED_HANDLER_TITLE" />"</translation> <translation id="8737709691285775803">Shill</translation> <translation id="8741881454555234096">Cette option permet d'affiner la position des gestes pour compenser le fait qu'ils sont moins précis, par rapport à la souris.</translation> -<translation id="8741995161408053644">Votre compte Google conserve peut- être d'autres formes d'historique de navigation sur la page <ph name="BEGIN_LINK" />history.google.com<ph name="END_LINK" />.</translation> +<translation id="8741995161408053644">Votre compte Google conserve peut-être d'autres formes d'historique de navigation sur la page <ph name="BEGIN_LINK" />history.google.com<ph name="END_LINK" />.</translation> <translation id="8743712320294854924">Afficher les options de saisie développées sur l'étagère.</translation> <translation id="874420130893181774">Mode de saisie pinyin traditionnel</translation> <translation id="8744525654891896746">Sélectionner un avatar pour cet utilisateur supervisé</translation>
diff --git a/chrome/app/resources/generated_resources_gu.xtb b/chrome/app/resources/generated_resources_gu.xtb index 299ff16..280ddf1 100644 --- a/chrome/app/resources/generated_resources_gu.xtb +++ b/chrome/app/resources/generated_resources_gu.xtb
@@ -657,7 +657,6 @@ <translation id="1962233722219655970">આ પૃષ્ઠ મૂળ ક્લાયન્ટ એપ્લિકેશનનો ઉપયોગ કરે છે જે તમારા કમ્પ્યુટર પર કામ કરતી નથી.</translation> <translation id="1965328510789761112">ખાનગી મેમરી</translation> <translation id="1965624977906726414">તેને કોઈ વિશેષ પરવાનગીઓ નથી.</translation> -<translation id="1968720524450620475">વેબ સૂચનાઓ માટે ઍક્શન આઇકન્સ સક્ષમ કરો.</translation> <translation id="1970746430676306437">પૃષ્ઠ &માહિતી જુઓ</translation> <translation id="197288927597451399">રાખો</translation> <translation id="1973491249112991739"><ph name="PLUGIN_NAME" /> ડાઉનલોડ નિષ્ફળ થયું.</translation> @@ -1420,7 +1419,6 @@ <translation id="302014277942214887">એપ્લિકેશન id અથવા વેબસ્ટોર URL દાખલ કરો.</translation> <translation id="3020616530769498629">તાજું કરવા માટે ખેંચો પર બિન-માન્ય ફરીથી લોડ કરોને સક્ષમ કરો</translation> <translation id="3020990233660977256">સીરિયલ નંબર: <ph name="SERIAL_NUMBER" /></translation> -<translation id="3021245547458004908">સક્ષમ હોય ત્યારે, ઓછામાં ઓછા સ્ક્રીન dp >= 800 ધરાવતાં ઉપકરણો પર સ્ક્રોલિંગને કારણે ટુલબાર ક્યારેય પણ છુપાવવામાં આવશે નહીં. જો પૃષ્ઠ સામગ્રી પૂર્ણ સ્ક્રીન થશે તો તે હજીપણ છુપાયેલ રહેશે.</translation> <translation id="3021678814754966447">ફ્રેમ સ્રોત &જુઓ</translation> <translation id="3024374909719388945">24-કલાકની ઘડિયાળ વાપરો</translation> <translation id="3025022340603654002">કોઈ ફોર્મ ઘટક પરની પ્રારંભિક માઉસ ક્લિક પર સ્વતઃભરણ સૂચનો કરો.</translation> @@ -1491,7 +1489,6 @@ <translation id="3117812041123364382">ફ્લોટિંગ વર્ચ્યુઅલ કીબોર્ડને સક્ષમ/અક્ષમ કરો.</translation> <translation id="3118319026408854581"><ph name="PRODUCT_NAME" /> સહાય</translation> <translation id="3120430004221004537">આના પર આપેલ ઓપરેશન માટે અપૂરતું એન્ક્રિપ્શન: "<ph name="DEVICE_NAME" />".</translation> -<translation id="3121260210578524273">વેબ સૂચનાઓ માટે ઍક્શન બટન્સમાં આઇકન્સ સક્ષમ કરો.</translation> <translation id="3121793941267913344">આ <ph name="IDS_SHORT_PRODUCT_NAME" /> ઉપકરણ ફરીથી સેટ કરો</translation> <translation id="3122162841865761901">વિકાસકર્તા સાધનોના પ્રયોગો</translation> <translation id="3122464029669770682">CPU</translation> @@ -2273,6 +2270,7 @@ <translation id="421017592316736757">આ ફાઇલ એક્સેસ કરવા તમારું ઑનલાઇન હોવું આવશ્યક છે.</translation> <translation id="421182450098841253">બુકમાર્ક્સ બાર &બતાવો</translation> <translation id="4212108296677106246">શું તમે પ્રમાણન અધિકારી તરીકે "<ph name="CERTIFICATE_NAME" />" પર વિશ્વાસ કરો છો?</translation> +<translation id="42126664696688958">નિકાસ કરો</translation> <translation id="42137655013211669">સર્વર દ્વારા આ સંસાધનની અૅક્સેસ નિષિદ્ધ હતી.</translation> <translation id="4215350869199060536">ઉફ્ફ, નામમાં ગેરકાનૂની પ્રતીકો!</translation> <translation id="4215898373199266584">અરેરે! છુપો મોડ ( <ph name="INCOGNITO_MODE_SHORTCUT" /> ) આગલી વખતે સુલભ થઈ રહ્યો છે.</translation> @@ -3303,7 +3301,6 @@ <translation id="577322787686508614">આના પર વાંચન ઓપરેશનને મંજૂરી નથી: "<ph name="DEVICE_NAME" />".</translation> <translation id="5774295353725270860">ફાઇલ્સ એપ્લિકેશન ખોલો</translation> <translation id="5774515636230743468">સ્પષ્ટ:</translation> -<translation id="5776006986202016118">આ સાઇટ આની સાથે કનેક્ટ થવા માગે છે:</translation> <translation id="577624874850706961">કૂકીઝ શોધો</translation> <translation id="5778550464785688721">MIDI ઉપકરણોનું પૂર્ણ નિયંત્રણ</translation> <translation id="5780066559993805332">(શ્રેષ્ઠ)</translation> @@ -4194,7 +4191,6 @@ <translation id="7175353351958621980">અહીંથી લોડ કરેલું:</translation> <translation id="7180611975245234373">તાજું કરો</translation> <translation id="7180865173735832675">કસ્ટમાઇઝ કરો</translation> -<translation id="7184428045150946911">મોટા ટેબ્લેટ્સ પર ટુલબારને સ્વતઃછુપાવો અક્ષમ કરો</translation> <translation id="7185690883425432021">જ્યારે ટેબસ્ટ્રિપ સ્ટૅક્ડ મોડમાં હોય ત્યારે નિષ્ક્રિય ટેબ્સના બંધ કરો બટનોને છુપાવે છે.</translation> <translation id="7186088072322679094">ટુલબારમાં રાખો</translation> <translation id="719009910964971313">યુએસ પ્રોગ્રામર ડ્વોરેક કીબોર્ડ</translation>
diff --git a/chrome/app/resources/generated_resources_hi.xtb b/chrome/app/resources/generated_resources_hi.xtb index 0272f5e..8e2eb9b 100644 --- a/chrome/app/resources/generated_resources_hi.xtb +++ b/chrome/app/resources/generated_resources_hi.xtb
@@ -661,7 +661,6 @@ <translation id="1962233722219655970">यह पृष्ठ एक ऐसे स्थानीय क्लाइंट का उपयोग करता है जो आपके कंप्यूटर पर काम नहीं करता.</translation> <translation id="1965328510789761112">गोपनीय मेमोरी</translation> <translation id="1965624977906726414">कोई विशेष अनुमति नहीं है.</translation> -<translation id="1968720524450620475">वेब नोटिफिकेशन के लिए कार्रवाई आइकन सक्षम करें.</translation> <translation id="1970746430676306437">पृष्ठ &जानकारी देखें</translation> <translation id="197288927597451399">रखें</translation> <translation id="1973491249112991739"><ph name="PLUGIN_NAME" /> डाउनलोड विफल रहा.</translation> @@ -1423,7 +1422,6 @@ <translation id="302014277942214887">ऐप्स आईडी या वेबसाइट URL डालें.</translation> <translation id="3020616530769498629">पुल-टू-रीफ्रेश पर गैर-सत्यापन वाले पुनः लोड को सक्षम करें</translation> <translation id="3020990233660977256">क्रम संख्या: <ph name="SERIAL_NUMBER" /></translation> -<translation id="3021245547458004908">सक्षम होने पर, टूलबार को न्यूनतम dp >= 800 युक्त स्क्रीन वाले डिवाइस पर स्क्रॉलिंग के कारण कभी भी नहीं छिपाया जाएगा. यदि पृष्ठ की सामग्री पूर्ण स्क्रीन हो जाती है, तो वह अभी भी छिपा हुआ रहेगा.</translation> <translation id="3021678814754966447">फ़्रेम का स्रोत &देखें</translation> <translation id="3024374909719388945">24-घंटे की घड़ी का उपयोग करें</translation> <translation id="3025022340603654002">किसी फ़ॉर्म तत्व पर आरंभिक माउस क्लिक पर स्वत: भरण सुझाव बनाएं.</translation> @@ -1494,7 +1492,6 @@ <translation id="3117812041123364382">गतिशील वर्चुअल कीबोर्ड को सक्षम/अक्षम करें.</translation> <translation id="3118319026408854581"><ph name="PRODUCT_NAME" />सहायता</translation> <translation id="3120430004221004537">दिए गए संचालन के लिए इस पर अपर्याप्त एन्क्रिप्शन: "<ph name="DEVICE_NAME" />".</translation> -<translation id="3121260210578524273">वेब नोटिफिकेशन के लिए कार्रवाई बटन में आइकन सक्षम करें.</translation> <translation id="3121793941267913344">इस <ph name="IDS_SHORT_PRODUCT_NAME" /> डिवाइस को रीसेट करें</translation> <translation id="3122162841865761901">डेवलपर टूल प्रयोग</translation> <translation id="3122464029669770682">CPU</translation> @@ -2275,6 +2272,7 @@ <translation id="421017592316736757">इस फ़ाइल तक पहुंचने के लिए आपका ऑनलाइन होना आवश्यक है.</translation> <translation id="421182450098841253">बुकमार्क बार &दिखाएं</translation> <translation id="4212108296677106246">क्या आप "<ph name="CERTIFICATE_NAME" />" पर एक प्रमाणन प्राधिकरण के रूप में विश्वास करना चाहते हैं?</translation> +<translation id="42126664696688958">निर्यात करें</translation> <translation id="42137655013211669">इस स्रोत के लिए ऐक्सेस, सर्वर के द्वारा निषिद्ध की गई थी.</translation> <translation id="4215350869199060536">ओह, नाम में अवैध प्रतीक हैं!</translation> <translation id="4215898373199266584">श्श्श! गुप्त मोड (<ph name="INCOGNITO_MODE_SHORTCUT" />) अगली बार उपयोगी हो सकता है.</translation> @@ -3307,7 +3305,6 @@ <translation id="577322787686508614">पढ़ें कार्रवाई की इस पर अनुमति नहीं है: "<ph name="DEVICE_NAME" />".</translation> <translation id="5774295353725270860">फ़ाइल ऐप्स खोलें</translation> <translation id="5774515636230743468">मालसूची:</translation> -<translation id="5776006986202016118">साइट इससे कनेक्ट होना चाहती है:</translation> <translation id="577624874850706961">कुकी खोजें</translation> <translation id="5778550464785688721">MIDI डिवाइस पूर्ण नियंत्रण</translation> <translation id="5780066559993805332">(सर्वश्रेष्ठ)</translation> @@ -4201,7 +4198,6 @@ <translation id="7175353351958621980">यहां से लोड किया गया:</translation> <translation id="7180611975245234373">रीफ्रेश करें</translation> <translation id="7180865173735832675">कस्टमाइज़ करें</translation> -<translation id="7184428045150946911">बड़े टैबलेट पर टूलबार को स्वत: छिपाना अक्षम करें</translation> <translation id="7185690883425432021">टैबस्ट्रिप के स्टैक मोड में होने पर निष्क्रिय टैब के बंद करने के बटन छिपाता है.</translation> <translation id="7186088072322679094">टूलबार में रखें</translation> <translation id="719009910964971313">US प्रोग्रामर ड्वोरक कीबोर्ड</translation>
diff --git a/chrome/app/resources/generated_resources_hr.xtb b/chrome/app/resources/generated_resources_hr.xtb index 4f2604b..f8084d12 100644 --- a/chrome/app/resources/generated_resources_hr.xtb +++ b/chrome/app/resources/generated_resources_hr.xtb
@@ -661,7 +661,6 @@ <translation id="1962233722219655970">Ova stranica upotrebljava aplikaciju izvornog klijenta koja ne funkcionira na vašem računalu.</translation> <translation id="1965328510789761112">Privatna memorija</translation> <translation id="1965624977906726414">Nema posebne dozvole.</translation> -<translation id="1968720524450620475">Omogući ikone radnji za web-obavijesti.</translation> <translation id="1970746430676306437">Pogledaj &informacije o stranici</translation> <translation id="197288927597451399">Zadrži</translation> <translation id="1973491249112991739">Preuzimanje dodatka <ph name="PLUGIN_NAME" /> nije uspjelo.</translation> @@ -1423,7 +1422,6 @@ <translation id="302014277942214887">Unesite ID aplikacije ili URL web-trgovine.</translation> <translation id="3020616530769498629">Omogući ponovno učitavanje bez provjere za povlačenje radi osvježavanja</translation> <translation id="3020990233660977256">Serijski broj: <ph name="SERIAL_NUMBER" /></translation> -<translation id="3021245547458004908">Kada je omogućeno, alatna traka nikada neće biti skrivena zbog pomicanja na uređajima sa zaslonom od minimalno 800 dp. Ostat će skrivena ako se sadržaj stranice prikaže na cijelom zaslonu.</translation> <translation id="3021678814754966447">&Pogledaj izvor okvira</translation> <translation id="3024374909719388945">Koristi 24-satni sat</translation> <translation id="3025022340603654002">Pruži prijedloge za automatsko popunjavanje pri prvom kliku mišem na element obrasca.</translation> @@ -1494,7 +1492,6 @@ <translation id="3117812041123364382">Omogući/onemogući plutajuću virtualnu tipkovnicu.</translation> <translation id="3118319026408854581"><ph name="PRODUCT_NAME" /> Pomoć</translation> <translation id="3120430004221004537">Nedovoljna enkripcija za navedenu operaciju na uređaju: "<ph name="DEVICE_NAME" />".</translation> -<translation id="3121260210578524273">Omogući ikone na gumbima za radnju za web-obavijesti.</translation> <translation id="3121793941267913344">Vraćanje uređaja <ph name="IDS_SHORT_PRODUCT_NAME" /> na zadano</translation> <translation id="3122162841865761901">Eksperimenti Alata za razvojne programere</translation> <translation id="3122464029669770682">Procesor (CPU)</translation> @@ -2275,6 +2272,7 @@ <translation id="421017592316736757">Morate biti na mreži da biste pristupili toj datoteci.</translation> <translation id="421182450098841253">&Prikaz trake oznake</translation> <translation id="4212108296677106246">Želite li vjerovati tijelu "<ph name="CERTIFICATE_NAME" />" kao tijelu za izdavanje certifikata?</translation> +<translation id="42126664696688958">Izvezi</translation> <translation id="42137655013211669">Pristup tom resursu zabranio je poslužitelj.</translation> <translation id="4215350869199060536">Ups, nedopušteni simboli u imenu!</translation> <translation id="4215898373199266584">Psst! Sljedeći bi vam put mogao koristiti anoniman način (<ph name="INCOGNITO_MODE_SHORTCUT" />).</translation> @@ -3307,7 +3305,6 @@ <translation id="577322787686508614">Operacija čitanja nije dopuštena na uređaju: "<ph name="DEVICE_NAME" />".</translation> <translation id="5774295353725270860">Aplikacija za otvaranje datoteka</translation> <translation id="5774515636230743468">Manifest:</translation> -<translation id="5776006986202016118">Web-lokacija se želi povezati s:</translation> <translation id="577624874850706961">Pretraživanje kolačića</translation> <translation id="5778550464785688721">Potpuni nadzor nad MIDI uređajima</translation> <translation id="5780066559993805332">(Najbolje)</translation> @@ -4121,7 +4118,7 @@ <translation id="7057058088140140610">Kreditne kartice i adrese s Google Paymentsa</translation> <translation id="7059858479264779982">Postavi na automatsko pokretanje</translation> <translation id="7061692898138851896">Automatski spremi zaporke</translation> -<translation id="7062222374113411376">Dopusti nedavno zatovrenim web-lokacijama dovršetak slanja i primanja podataka</translation> +<translation id="7062222374113411376">Dopusti nedavno zatvorenim web-lokacijama dovršetak slanja i primanja podataka</translation> <translation id="7063129466199351735">Obrada prečaca...</translation> <translation id="7065223852455347715">Ovaj je uređaj zaključan u načinu koji sprječava registraciju u organizaciji. Ako želite registrirati uređaj, prvo morate izvršiti njegov oporavak.</translation> <translation id="7065534935986314333">O sustavu</translation> @@ -4195,7 +4192,6 @@ <translation id="7175353351958621980">Učitano iz:</translation> <translation id="7180611975245234373">Osvježi</translation> <translation id="7180865173735832675">Prilagodi</translation> -<translation id="7184428045150946911">Onemogući automatsko skrivanje alatne trake na velikim tabletima</translation> <translation id="7185690883425432021">Gumbi za zatvaranje skrivaju se kada je vrpca kartica u načinu nizanja.</translation> <translation id="7186088072322679094">Zadrži na alatnoj traci</translation> <translation id="719009910964971313">Američka programerska tipkovnica Dvorak</translation>
diff --git a/chrome/app/resources/generated_resources_hu.xtb b/chrome/app/resources/generated_resources_hu.xtb index e719976..a8a00090 100644 --- a/chrome/app/resources/generated_resources_hu.xtb +++ b/chrome/app/resources/generated_resources_hu.xtb
@@ -183,16 +183,19 @@ <translation id="1259724620062607540">7. polcelem</translation> <translation id="1260240842868558614">Megjelenítés:</translation> <translation id="126710816202626562">A fordítás nyelve:</translation> +<translation id="1269690813141254680">A <ph name="BEGIN_LINK" />Google Tevékenységvezérlők<ph name="END_LINK" /> funkcióval szabályozhatja, hogy miként használhatja fel a Google a böngészési előzményeket a Keresés és más Google-szolgáltatások személyre szabására.</translation> <translation id="1272079795634619415">Leállítás</translation> <translation id="1272978324304772054">Ez a felhasználói fiók nem ahhoz a domainhez tartozik, amelyhez az eszköz. Ha másik domainen kívánja regisztrálni azt, először vissza kell állítania az eszköz beállításait.</translation> <translation id="127353061808977798">Betűtípusok és karakterkódolás</translation> <translation id="1274997165432133392">Cookie-k és egyéb webhelyadatok</translation> <translation id="1275718070701477396">Kijelölt</translation> +<translation id="1277908057200820621">Eszközlista megtekintése</translation> <translation id="1278049586634282054">Nézetek megvizsgálása:</translation> <translation id="1278813325885878377">Magyar QWERTY-billentyűzet</translation> <translation id="1285320974508926690">Ezt a webhelyet soha ne fordítsa le</translation> <translation id="1285484354230578868">Adattárolás a Google Drive-fiókban</translation> <translation id="1290223615328246825">Az automatikus bejelentkezés nem sikerült</translation> +<translation id="1293509594570842875">Nem sikerült az új felügyelt felhasználó létrehozása. Kérjük, ellenőrizze a hálózati kapcsolatot, és próbálja újra később.</translation> <translation id="1293556467332435079">Fájlok</translation> <translation id="1294298200424241932">Bizalmi beállítások szerkesztése:</translation> <translation id="1295794900245526845">Válassza ki a(z) <ph name="PASSWORD_MANAGER_BRAND" /> szolgáltatással mentett fiókját a bejelentkezéshez</translation> @@ -291,6 +294,7 @@ <translation id="1429740407920618615">Jelerősség:</translation> <translation id="143027896309062157">A számítógépén és az Ön által felkeresett webhelyeken lévő adatainak olvasása és módosítása</translation> <translation id="1430915738399379752">Nyomtatás</translation> +<translation id="1433423644370450034">MediaStyle-értesítés</translation> <translation id="1434696352799406980">Ez a művelet visszaállítja a kezdőoldalt, az új lap oldalt, a keresőmotort és a rögzített lapokat. Kikapcsol továbbá minden bővítményt, és törli az ideiglenes adatokat, például a cookie-kat. Könyvjelzői, előzményei és mentett jelszavai megmaradnak.</translation> <translation id="1434886155212424586">Az Új lap oldal a kezdőoldal</translation> <translation id="1435550882135542937">Új kialakítású eszköztár</translation> @@ -378,6 +382,7 @@ <translation id="1526925867532626635">Szinkronizálás beállításainak megerősítése</translation> <translation id="1528372117901087631">Internetkapcsolat</translation> <translation id="1529968269513889022">elmúlt hét</translation> +<translation id="1531865825384516080">Biztonságos Keresés – URL-ek jelentése.</translation> <translation id="1532697124104874386">A virtuális billentyűzet intelligens telepítésének be- és kikapcsolása.</translation> <translation id="1533897085022183721">Kevesebb, mint <ph name="MINUTES" /> maradt.</translation> <translation id="1533920822694388968">TV hangolása</translation> @@ -661,7 +666,6 @@ <translation id="1962233722219655970">Az oldal olyan Natív kliensalkalmazást használ, amely nem működik a számítógépén.</translation> <translation id="1965328510789761112">Saját memória</translation> <translation id="1965624977906726414">Nem rendelkezik speciális engedélyekkel.</translation> -<translation id="1968720524450620475">A műveleti ikonok engedélyezése a webes értesítéseknél.</translation> <translation id="1970746430676306437">Oldal &információinak megtekintése</translation> <translation id="197288927597451399">Megőrzés</translation> <translation id="1973491249112991739">A(z) <ph name="PLUGIN_NAME" /> plug-in letöltése sikertelen volt.</translation> @@ -759,6 +763,7 @@ <translation id="212862741129535676">Órajel lefoglaltsága százalékban</translation> <translation id="2128691215891724419">Szinkronizálási hiba: Frissítse a szinkronizálási jelszót...</translation> <translation id="2129904043921227933">Szinkronizálási hiba: frissítse a szinkronizálási jelszót...</translation> +<translation id="2130053362119884302">Lapleválasztás engedélyezése teljes képernyős módban</translation> <translation id="2131077480075264">A(z) „<ph name="APP_NAME" />” telepítése sikertelen, mivel azt a(z) „<ph name="IMPORT_NAME" />” nem engedélyezi.</translation> <translation id="2134149231879627725">Engedélyezze, hogy a Google segíthessen az eszköz távolról történő lezárásában, törlésében és helyének beazonosításában.</translation> <translation id="2134986351331412790">Ez a webhely nem fogad el ilyen típusú kártyát.</translation> @@ -771,6 +776,7 @@ <translation id="2143778271340628265">Proxy beállítása kézzel</translation> <translation id="2143915448548023856">Megjelenítési beállítások</translation> <translation id="2144536955299248197">Tanúsítványmegtekintő: <ph name="CERTIFICATE_NAME" /></translation> +<translation id="2147827593068025794">Szinkronizálás a háttérben</translation> <translation id="2148756636027685713">A formázás elkészült</translation> <translation id="2148892889047469596">Lap átküldése</translation> <translation id="2148999191776934271">Töltés, <ph name="HOUR" />:<ph name="MINUTE" /> a teljes feltöltésig</translation> @@ -1149,6 +1155,7 @@ <translation id="2665717534925640469">Ez az oldal most teljes képernyős nézetben van, és letiltotta az egérmutatót.</translation> <translation id="2665919335226618153">Ajjaj! Hiba történt formázás közben.</translation> <translation id="2668079306436607263">Túlgörgetéses előzménynavigáció</translation> +<translation id="2670102641511624474">A(z) <ph name="APP_NAME" /> megosztja a Chrome egy lapját.</translation> <translation id="2670965183549957348">Chewing beviteli mód</translation> <translation id="2672142220933875349">Hibás crx-fájl, a kicsomagolás sikertelen.</translation> <translation id="2672394958563893062">Hiba történt. Kattintson az újrakezdéshez az elejéről.</translation> @@ -1195,6 +1202,7 @@ <translation id="2733364097704495499">Szeretné regisztrálni a(z) <ph name="PRINTER_NAME" /> nyomtatót a Google Cloud Print szolgáltatásban?</translation> <translation id="2735698359135166290">Hagyományos román billentyűzet</translation> <translation id="2737363922397526254">Listanézet...</translation> +<translation id="2737755522130570180">A document.write segítségével betöltött szkriptek letiltása</translation> <translation id="2738771556149464852">Ezután nem:</translation> <translation id="2739191690716947896">Hibakeresés</translation> <translation id="2739240477418971307">Kisegítő beállítások módosítása</translation> @@ -1264,6 +1272,7 @@ <translation id="2805646850212350655">Microsoft - fájlrendszer titkosítása</translation> <translation id="2805707493867224476">Előugró ablakok engedélyezése minden webhelyen</translation> <translation id="2805756323405976993">Alkalmazások</translation> +<translation id="2808243220963392165">A lapok lapsávról való leválasztásának engedélyezése teljes képernyős módban, Mac típusú számítógépeken.</translation> <translation id="2809142985846095314">Automatikus kitöltésű hitelkártyák feltöltésére vonatkozó felajánlás engedélyezése</translation> <translation id="2809346626032021864">Olvasás</translation> <translation id="2809586584051668049">és <ph name="NUMBER_ADDITIONAL_DISABLED" /> további</translation> @@ -1392,6 +1401,7 @@ <translation id="2968792643335932010">Kevesebb másolat</translation> <translation id="2971033837577180453"><span>Azonosító:</span><ph name="EXTENSION_ID" /></translation> <translation id="2971213274238188218">sötétítés</translation> +<translation id="2971422413423640756">Letöltés gomb média URL-lel rendelkező oldal megnyitása esetén.</translation> <translation id="2972557485845626008">Firmware</translation> <translation id="2972581237482394796">&Újra</translation> <translation id="297870353673992530">DNS szerver:</translation> @@ -1424,7 +1434,6 @@ <translation id="302014277942214887">Adja meg az alkalmazás azonosítóját vagy internetes áruházi URL-jét.</translation> <translation id="3020616530769498629">Nem érvényesítő újratöltés engedélyezése lehúzással történő frissítésnél</translation> <translation id="3020990233660977256">Sorozatszám: <ph name="SERIAL_NUMBER" /></translation> -<translation id="3021245547458004908">Ha engedélyezve van, az eszköztár nem lesz rejtett görgetés során a legalább 800 dpi méretű képernyővel rendelkező eszközökön. Ha azonban az oldal tartalma teljes nézetben jelenik meg, a böngésző továbbra is elrejti az eszköztárat.</translation> <translation id="3021678814754966447">&Keret forrásának megtekintése</translation> <translation id="3024374909719388945">24 órás megjelenítés használata</translation> <translation id="3025022340603654002">Automatikus kitöltési javaslatok megjelenítése az űrlap egy elemére való első kattintásnál.</translation> @@ -1457,6 +1466,7 @@ <translation id="3057861065630527966">Biztonsági másolat készítése a fotókról és videókról</translation> <translation id="3058212636943679650">A számítógép operációs rendszerének helyreállításához SD-kártya vagy USB-memóriakártya szükséges.</translation> <translation id="305932878998873762">Az Egyszerű gyorsítótár HTTP-hez egy új gyorsítótár. Alapja a lemezterület lefoglalásáért felelős fájlrendszer.</translation> +<translation id="3062606427884046423">Android MediaStyle-értesítések használata a Chrome-médiaértesítéseknél.</translation> <translation id="3064388234319122767">Átírás (zdravo → здраво)</translation> <translation id="3065041951436100775">Visszajelzés megszakított lapról.</translation> <translation id="3065140616557457172">Írja be a keresett kifejezést, vagy írja be a felkeresni kívánt URL-címet – mindkét lehetőség működik.</translation> @@ -1495,7 +1505,6 @@ <translation id="3117812041123364382">Lebegő virtuális billentyűzet be-/kikapcsolása</translation> <translation id="3118319026408854581"><ph name="PRODUCT_NAME" /> Súgó</translation> <translation id="3120430004221004537">Elégtelen titkosítás egy adott művelet esetében a következőn: „<ph name="DEVICE_NAME" />”.</translation> -<translation id="3121260210578524273">A műveleti gombok engedélyezése a webes értesítéseknél.</translation> <translation id="3121793941267913344">A(z) <ph name="IDS_SHORT_PRODUCT_NAME" /> eszköz visszaállítása</translation> <translation id="3122162841865761901">Fejlesztői eszközök – Kísérletek</translation> <translation id="3122464029669770682">CPU</translation> @@ -1540,6 +1549,7 @@ <translation id="3170072451822350649">Ki is hagyhatja a bejelentkezést, és <ph name="LINK_START" />böngészhet vendégként<ph name="LINK_END" />.</translation> <translation id="3170544058711792988">Nagyító fókuszának megtartása a képernyő közepén</translation> <translation id="3172213052701798825">Google Smart Lock a jelszavakhoz</translation> +<translation id="3175469972022788345">Ha engedélyezett, a WebRTC ECDSA-tanúsítványokat használ.</translation> <translation id="317583078218509884">Az új webhelyengedélyek az oldal ismételt betöltése után lépnek életbe.</translation> <translation id="3177048931975664371">Kattintson ide a jelszó elrejtéséhez</translation> <translation id="3180365125572747493">Adjon meg egy jelszót a tanúsítványfájl titkosításához.</translation> @@ -1994,6 +2004,7 @@ <translation id="3776796446459804932">A bővítmény sérti a Chrome Internetes áruház irányelvét.</translation> <translation id="3778152852029592020">Letöltés megszakítva.</translation> <translation id="3778740492972734840">Fejlesz&tői eszközök</translation> +<translation id="3780663724044634171">Válasszon fiókot a felügyelt felhasználó kezeléséhez.</translation> <translation id="378312418865624974">Egyedi azonosító olvasása ennél a számítógépnél</translation> <translation id="3783640748446814672">alt</translation> <translation id="3785308913036335955">Alkalmazások gyorsparancs megjelenítése</translation> @@ -2017,6 +2028,7 @@ <translation id="3807747707162121253">&Törlés</translation> <translation id="3809280248639369696">Alien</translation> <translation id="3810973564298564668">Szerkesztés</translation> +<translation id="3811494700605067549">1 fájl kiválasztva</translation> <translation id="3812034401428455285"><ph name="UWS_NAME" /> és <ph name="UWS_NAME" /></translation> <translation id="3812525830114410218">Helytelen tanúsítvány</translation> <translation id="3813984289128269159">OK Google</translation> @@ -2046,6 +2058,7 @@ <translation id="3838543471119263078">Cookie-k, illetve webhelyek és beépülő modulok egyéb adatai</translation> <translation id="3839497635014791588">További érintéses visszajelzés a kezelőfelületi elemeknél</translation> <translation id="3840053866656739575">Elveszett a kapcsolat Chromebox eszközével. Menjen hozzá közelebb, vagy ellenőrizze az eszközt, miközben megpróbálunk újracsatlakozni.</translation> +<translation id="3840055807562919428">Letiltja a fő dokumentumkeretbe a document.write segítségével beillesztett, harmadik felektől származó elemzőletiltó szkriptek lekéréseit.</translation> <translation id="3842552989725514455">Talpas betűtípus</translation> <translation id="3846593650622216128">Ezeket a beállításokat egy bővítmény kényszeríti ki.</translation> <translation id="3846833722648675493">Alkalmazásablakok azonnali megjelenítése. Az ablakok lényegesen később jelennek meg az olyan összetett alkalmazásoknál, amelyek az erőforrásokat szinkron módon töltik be, ám a késés elhanyagolható azoknál az alkalmazásoknál, amelyek az erőforrások nagy részét aszinkron módon töltik be.</translation> @@ -2276,6 +2289,7 @@ <translation id="421017592316736757">Online kell lennie a fájl eléréséhez.</translation> <translation id="421182450098841253">&Könyvjelzősáv megjelenítése</translation> <translation id="4212108296677106246">Tanúsítványkibocsátóként megbízik a következőben: "<ph name="CERTIFICATE_NAME" />"?</translation> +<translation id="42126664696688958">Exportálás</translation> <translation id="42137655013211669">A szerver letiltotta a hozzáférést ehhez az erőforráshoz.</translation> <translation id="4215350869199060536">Hoppá! A név helytelen szimbólumokat tartalmaz.</translation> <translation id="4215898373199266584">Pszt! Az inkognitómód (<ph name="INCOGNITO_MODE_SHORTCUT" />) hasznos lehet a következő alkalommal.</translation> @@ -2361,6 +2375,7 @@ <translation id="4359408040881008151">Telepítve az ezt nélkülözni nem tudó bővítmény(ek) miatt.</translation> <translation id="4361190688154226069">Téglalap alapú célzás a nézetekben</translation> <translation id="4364444725319685468"><ph name="FILE_NAME" /> letöltve</translation> +<translation id="4364567974334641491">A(z) <ph name="APP_NAME" /> megoszt egy ablakot.</translation> <translation id="4364830672918311045">Értesítések megjelenítése</translation> <translation id="4365673000813822030">Hoppá, a szinkronizálás leállt.</translation> <translation id="4366509400410520531">Ön által engedélyezett</translation> @@ -2430,6 +2445,7 @@ <translation id="4479639480957787382">Ethernet</translation> <translation id="4479812471636796472">Amerikai Dvorak billentyűzet</translation> <translation id="4481249487722541506">Kicsomagolt bővítmények betöltése...</translation> +<translation id="4482194545587547824">A Google felhasználhatja a böngészési előzményeket a Keresés és más Google-szolgáltatások személyre szabására.</translation> <translation id="4487088045714738411">Belga billentyűzet</translation> <translation id="4492190037599258964">Találatok a(z) „<ph name="SEARCH_STRING" />” kifejezésre</translation> <translation id="4495021739234344583">Regisztráció törlése és újraindítás</translation> @@ -2473,6 +2489,7 @@ <translation id="4554591392113183336">A külső bővítmény a meglévő bővítmény verziószintjén vagy az alatt van.</translation> <translation id="4554796861933393312">Anyagszerű megjelenésű tintafolt animációs sebessége</translation> <translation id="4555769855065597957">Árnyék</translation> +<translation id="4556110439722119938">A böngésző szinkronizálni fogja a könyvjelzőket, az előzményeket, a jelszavakat és az egyéb beállításokat Google-fiókjával, hogy bármelyik eszközén hozzájuk férjen.</translation> <translation id="4557136421275541763">Figyelmeztetés:</translation> <translation id="4558426062282641716">Automatikus indítási engedély kérelmezve</translation> <translation id="4563210852471260509">Az alapértelmezett beviteli nyelv a kínai</translation> @@ -2595,6 +2612,7 @@ <translation id="4742746985488890273">Rögzítés a polcra</translation> <translation id="474421578985060416">Ön által letiltott</translation> <translation id="4744574733485822359">A letöltés befejeződött</translation> +<translation id="4746330764136728131">Az ECDSA-tanúsítványok használata a WebRTC-nél</translation> <translation id="4746971725921104503">Úgy tűnik, hogy már felügyel egy ilyen nevű felhasználót. <ph name="LINK_START" />Importálni kívánta <ph name="USER_DISPLAY_NAME" /> felhasználót erre az eszközre<ph name="LINK_END" />?</translation> <translation id="4747271164117300400">macedón</translation> <translation id="4749157430980974800">Grúz billentyűzet</translation> @@ -2743,6 +2761,7 @@ <translation id="496226124210045887">A kiválasztott mappa érzékeny fájlokat tartalmaz. Biztosan állandó olvasási hozzáférést szeretne adni a következőnek a mappához: „$1”?</translation> <translation id="4964673849688379040">Ellenőrzés…</translation> <translation id="4966802378343010715">Új felhasználó létrehozása</translation> +<translation id="4967749818080339523">Fiók kiválasztása</translation> <translation id="496888482094675990">A Fájlok alkalmazás gyors hozzáférést kínál a Google Drive-on, külső tárolón vagy a Chrome OS-eszközön elmentett fájlokhoz.</translation> <translation id="4971412780836297815">Megnyitás, amikor kész</translation> <translation id="497244430928947428">Malajálam billentyűzet (fonetikus)</translation> @@ -2789,6 +2808,7 @@ <translation id="5038863510258510803">Engedélyezés...</translation> <translation id="5039512255859636053">$1 TB</translation> <translation id="5039804452771397117">Engedélyezés</translation> +<translation id="5043851552150732346">1 könyvtár kiválasztva</translation> <translation id="5045550434625856497">Téves jelszó</translation> <translation id="5048179823246820836">Skandináv</translation> <translation id="5048294425697652159">Quirks-ügyfél engedélyezése a kijelző kalibrálásához.</translation> @@ -2876,6 +2896,7 @@ <translation id="5170477580121653719">Szabad hely a Google Drive-on: <ph name="SPACE_AVAILABLE" />.</translation> <translation id="5170568018924773124">Megjelenítés mappában</translation> <translation id="5171045022955879922">Keressen vagy írjon be egy URL-t</translation> +<translation id="5171343362375269016">Cserememória</translation> <translation id="5175870427301879686">A(z) <ph name="URL" /> webhely állandó adatokat akar tárolni a helyi számítógépen.</translation> <translation id="5177479852722101802">A kamerához és mikrofonhoz való hozzáférés tiltásának fenntartása</translation> <translation id="5177526793333269655">Indexképnézet</translation> @@ -3033,6 +3054,7 @@ <translation id="5380103295189760361">Tartsa lenyomva a Control, Alt, Shift vagy Keresés gombokat a módosítók billentyűkódjainak megtekintéséhez.</translation> <translation id="5382392428640372740">Navigálás nyomon követésének engedélyezése</translation> <translation id="5388588172257446328">Felhasználónév:</translation> +<translation id="5389237414310520250">Nem sikerült létrehozni az új felhasználót. Kérjük, ellenőrizze a merevlemezen rendelkezésre álló helyet és az engedélyeket, majd próbálja újra.</translation> <translation id="5390284375844109566">Indexelt adatbázis</translation> <translation id="5392544185395226057">Natív kliens támogatásának engedélyezése.</translation> <translation id="5396126354477659676">A(z) <ph name="PEPPER_PLUGIN_NAME" /> webhelyen található <ph name="PEPPER_PLUGIN_DOMAIN" /> bővítmény hozzá akar férni a számítógéphez.</translation> @@ -3100,6 +3122,7 @@ <translation id="5469954281417596308">Könyvjelzőkezelő</translation> <translation id="5470838072096800024">Utolsó tokenfogadás ideje</translation> <translation id="5473075389972733037">IBM</translation> +<translation id="5473279832922912143">Engedély a V8 számára a kísérleti Ignition fordító használatára a JavaScript futtatásánál.</translation> <translation id="5474139872592516422">Miután befejeződött a(z) <ph name="PLUGIN_NAME" /> plug-in frissítése, aktiválásához frissítse az oldalt.</translation> <translation id="5480254151128201294">Az eszközt zárolta a tulajdonosa.</translation> <translation id="5483785310822538350">Fájl- és eszközhozzáférés visszavonása</translation> @@ -3127,6 +3150,7 @@ <translation id="5509914365760201064">Kiállító: <ph name="CERTIFICATE_AUTHORITY" /></translation> <translation id="5511823366942919280">Biztosan beállítja ezt az eszközt „Shark” eszközként?</translation> <translation id="5512653252560939721">A felhasználói tanúsítványnak hardvertámogatottnak kell lennie.</translation> +<translation id="5513242761114685513">Helyi menü</translation> <translation id="5515008897660088170">Toolkit-Views alkalmazásablakok.</translation> <translation id="551752069230578406">Nyomtató hozzáadása a fiókhoz; ez eltarthat egy darabig...</translation> <translation id="5518584115117143805">E-mail titkosítási tanúsítvány</translation> @@ -3308,7 +3332,6 @@ <translation id="577322787686508614">Az olvasási művelet nem engedélyezett a következőn: „<ph name="DEVICE_NAME" />”.</translation> <translation id="5774295353725270860">Fájlok alkalmazás megnyitása</translation> <translation id="5774515636230743468">Megnyilvánulás:</translation> -<translation id="5776006986202016118">A webhely csatlakozni kíván a következőhöz:</translation> <translation id="577624874850706961">Cookie-k keresése</translation> <translation id="5778550464785688721">MIDI eszközök – teljes hozzáférés</translation> <translation id="5780066559993805332">(legjobb)</translation> @@ -3386,6 +3409,7 @@ <translation id="5874045675243596003">Szigorú végrehajtás (összeomlás, ha a rendszer nem tudja lekérdezni a hash-értékeket)</translation> <translation id="5875858680971105888">Hoppá! Nem sikerült a felügyelt felhasználó importálása. Ellenőrizze a hálózati kapcsolatot, és próbálja újra később.</translation> <translation id="5880247576487732437">Token található</translation> +<translation id="5884474295213649357">Ez a lap USB-eszközhöz csatlakozik.</translation> <translation id="5885324376209859881">Médiabeállítások kezelése...</translation> <translation id="5889282057229379085">A köztes tanúsítványkibocsátók maximális száma: <ph name="NUM_INTERMEDIATE_CA" /></translation> <translation id="5892290200158927959">Francia BÉPO-billentyűzet</translation> @@ -3475,6 +3499,8 @@ <translation id="604124094241169006">Automatikus</translation> <translation id="6042308850641462728">Hosszabban</translation> <translation id="604257181445267932">A Smart Lock segítségével gyorsan beléphet különféle alkalmazásokba és webhelyekre a Google rendszerében mentett jelszavakkal.</translation> +<translation id="6043317578411397101">A(z) <ph name="APP_NAME" /> megosztja a Chrome egy lapját a következővel: <ph name="TAB_NAME" />.</translation> +<translation id="6044805581023976844">A(z) <ph name="APP_NAME" /> megosztja a Chrome egy lapját és a hangot a következővel: <ph name="TAB_NAME" />.</translation> <translation id="6049065490165456785">Fotó a belső kamerával</translation> <translation id="6051028581720248124">A FedEx Office üzletben történő nyomtatással elfogadja az ő <ph name="START_LINK" />felhasználási feltételeiket<ph name="END_LINK" />.</translation> <translation id="6051086608691487286">Fedvénygörgetősávok</translation> @@ -3603,6 +3629,7 @@ <translation id="6251889282623539337"><ph name="DOMAIN" /> – Általános szerződési feltételek</translation> <translation id="6251924700383757765">Adatvédelmi irányelvek</translation> <translation id="6253586523465486793">Arra kényszeríti a húzással történő frissítés funkciót, hogy nem érvényesítő újratöltést indítson (míg ha a jelölő le van tiltva, akkor általában a megszokott, a gyorsítótárat érvényesítő újratöltés következik be).</translation> +<translation id="6254182355913122230">Cserememória</translation> <translation id="6254503684448816922">A kulcs veszélyeztetve</translation> <translation id="6259104249628300056">Eszközök felfedezése helyi hálózatán</translation> <translation id="6263082573641595914">Microsoft CA verzió</translation> @@ -3873,6 +3900,7 @@ <translation id="6680028776254050810">Felhasználóváltás</translation> <translation id="6681668084120808868">Fényképkészítés</translation> <translation id="668171684555832681">Egyéb...</translation> +<translation id="6682083956260248340">Annak irányítása, hogy miként működik ez a következőben: <ph name="BEGIN_LINK" /></translation> <translation id="6686490380836145850">Jobbra lévő lapok bezárása</translation> <translation id="6686817083349815241">Jelszó mentése</translation> <translation id="6689514201497896398">Felhasználói tevékenység ellenőrzésének kihagyása</translation> @@ -3940,10 +3968,12 @@ <translation id="6798954102094737107">Beépülő modul: <ph name="PLUGIN_NAME" /></translation> <translation id="6802031077390104172"><ph name="USAGE" /> (<ph name="OID" />)</translation> <translation id="6804671422566312077">Összes könyvjelző megnyitása új &ablakban</translation> +<translation id="6805542829187142700">A rendszeridőzóna automatikus érzékelésére vonatkozó eszközházirend engedélyezése.</translation> <translation id="6805647936811177813">Kérjük jelentkezzen be a(z) <ph name="TOKEN_NAME" /> szolgáltatásba az ügyféltanúsítvány importálásához a(z) <ph name="HOST_NAME" /> webhelyről.</translation> <translation id="680572642341004180">RLZ-követés engedélyezése a következő esetében: <ph name="SHORT_PRODUCT_OS_NAME" />.</translation> <translation id="6807889908376551050">Összes megjelenítése...</translation> <translation id="6809448577646370871">Egyedi ablakváltás Chrome-alkalmazásoknál.</translation> +<translation id="6810613314571580006">Automatikus bejelentkezés webhelyekre a tárolt hitelesítő adatokkal. Ha a funkció ki van kapcsolva, akkor a rendszer minden alkalommal megerősítést kér Öntől, mielőtt bejelentkezne egy webhelyre.</translation> <translation id="6812349420832218321">A <ph name="PRODUCT_NAME" /> nem futtatható rootként.</translation> <translation id="6812841287760418429">Módosítások megtartása</translation> <translation id="6814124696888326520">Egyszerűbb átváltás a beviteli módszerek között, és hozzáférés további beviteli módokhoz: hangbevitel, kézírás és hangulatjelek.</translation> @@ -4129,6 +4159,7 @@ <translation id="7065534935986314333">A rendszerről</translation> <translation id="7066944511817949584">Nem sikerült csatlakozni a(z) "<ph name="DEVICE_NAME" />" eszközhöz.</translation> <translation id="7067725467529581407">Ne jelenjen meg többé.</translation> +<translation id="7068609958927777019">Ha engedélyezett, akkor a nem megfelelő URL-eket jelenteni lehet a Biztonságos Keresés szolgáltatás felé.</translation> <translation id="7070804685954057874">Közvetlen bevitel</translation> <translation id="7072010813301522126">Gyorsparancs neve</translation> <translation id="7072025625456903686">Az összes engedélyezése vagy személyre szabás</translation> @@ -4194,10 +4225,10 @@ <translation id="7170467426996704624">Átírás (salam → ሰላም)</translation> <translation id="7172053773111046550">Észt billentyűzet</translation> <translation id="7173828187784915717">Chewing beviteli beállítások</translation> +<translation id="7173917244679555">Úgy tűnik, már kezel egy ilyen nevű felhasználót. Inkább <ph name="BEGIN_LINK" />importálni szeretné <ph name="PROFILE_NAME" /><ph name="END_LINK" /> felhasználót erre az eszközre?</translation> <translation id="7175353351958621980">Betöltve innen:</translation> <translation id="7180611975245234373">Frissítés</translation> <translation id="7180865173735832675">Testreszabás</translation> -<translation id="7184428045150946911">Az eszköztár automatikus elrejtésének letiltása nagy táblagépeken</translation> <translation id="7185690883425432021">Elrejti a bezárás gombokat az inaktív lapokon, amikor a lapsáv halmozott módban van.</translation> <translation id="7186088072322679094">Gomb megtartása az eszköztáron</translation> <translation id="719009910964971313">US Dvorak programozó billentyűzet</translation> @@ -4262,6 +4293,7 @@ <translation id="7280825545668757494">Wi-Fi hitelesítő adatainak szinkronizálása</translation> <translation id="7280877790564589615">Engedély kérelmezve</translation> <translation id="7282547042039404307">Folyamatos</translation> +<translation id="7284549674086796566">Kísérleti JavaScript-fordító</translation> <translation id="7287143125007575591">Hozzáférés megtagadva.</translation> <translation id="7288592446024861651">A böngésző szinkronizálni fogja a könyvjelzőket, az előzményeket, a jelszavakat és az egyéb beállításokat Google-fiókjával, hogy bármelyik eszközén hozzájuk férjen. A következő helyen adhatja meg a szinkronizálandó elemek körét: <ph name="BEGIN_LINK" /></translation> <translation id="7288676996127329262"><ph name="HORIZONTAL_DPI" /> × <ph name="VERTICAL_DPI" /> dpi</translation> @@ -4284,6 +4316,7 @@ <translation id="7321545336522791733">A szerver nem áll rendelkezésre</translation> <translation id="7325437708553334317">Kontrasztos megjelenítés bővítmény</translation> <translation id="7326565110843845436">Háromujjas kattintás az érintőpadon</translation> +<translation id="7327088014939803293">Nem hozható létre az új felügyelt felhasználó. Ellenőrizze, hogy megfelelően van-e bejelentkezve, majd próbálkozzon újra.</translation> <translation id="73289266812733869">Nincs kijelölve</translation> <translation id="7329154610228416156">A bejelentkezés nem sikerült, mert azt egy nem biztonságos URL használatára állították be (<ph name="BLOCKED_URL" />). Kérjük, forduljon rendszergazdájához.</translation> <translation id="7331786426925973633">Egy gyors, egyszerű és biztonságos böngésző</translation> @@ -4458,6 +4491,7 @@ <translation id="7573172247376861652">Akkumulátor töltése</translation> <translation id="7576032389798113292">6×4</translation> <translation id="7576690715254076113">Szétválogatás</translation> +<translation id="7580671184200851182">Azonos hang lejátszása mindegyik hangszórón (monó hang)</translation> <translation id="7581279002575751816">Az NPAPI bővítmények nem támogatottak.</translation> <translation id="7581462281756524039">Egy karbantartó eszköz</translation> <translation id="7582582252461552277">Ezt a hálózatot részesítse előnyben</translation> @@ -4690,6 +4724,7 @@ <translation id="7925686952655276919">Ne használjon mobiladatokat a szinkronizáláshoz</translation> <translation id="7926906273904422255">A nem biztonságos eredet megjelölése nem biztonságosként vagy „gyanúsként”.</translation> <translation id="7928710562641958568">Eszköz kiadása</translation> +<translation id="79312157130859720">A(z) <ph name="APP_NAME" /> megosztja a képernyőt és a hangot.</translation> <translation id="7938594894617528435">Jelenleg offline</translation> <translation id="7939374455203157513">Felhőszolgáltatások engedélyezése</translation> <translation id="7939412583708276221">Megtartás</translation> @@ -5125,6 +5160,7 @@ <translation id="8571108619753148184">4. szerver</translation> <translation id="8572832761467613633">Csak Flash</translation> <translation id="8572981282494768930">Ne engedje, hogy webhelyek hozzáférjenek a kamerához és a mikrofonhoz</translation> +<translation id="8574234089711453001">Letöltés gomb megjelenésének engedélyezése média URL-lel rendelkező oldal megnyitása esetén.</translation> <translation id="857779305329188634">A kísérleti QUIC protokolltámogatás engedélyezése.</translation> <translation id="8579285237314169903"><ph name="NUMBER_OF_FILES" /> elem szinkronizálása…</translation> <translation id="8579549103199280730">Alapértelmezés szerint rákérdez</translation> @@ -5180,6 +5216,7 @@ <translation id="8656768832129462377">Ne ellenőrizze</translation> <translation id="8656946437567854031">A Folytatás lehetőségre kattintva elfogadja a következőket: <ph name="LEGAL_DOC_LINK_TEXT_1" />, <ph name="LEGAL_DOC_LINK_TEXT_2" />, <ph name="LEGAL_DOC_LINK_TEXT_3" />, <ph name="LEGAL_DOC_LINK_TEXT_4" />, <ph name="LEGAL_DOC_LINK_TEXT_5" /> és <ph name="LEGAL_DOC_LINK_TEXT_6" />.</translation> <translation id="8658595122208653918">Nyomtatási lehetőségek módosítása…</translation> +<translation id="8658645149275195032">A(z) <ph name="APP_NAME" /> megosztja a képernyőt és a hangot a következővel: <ph name="TAB_NAME" />.</translation> <translation id="8659716501582523573">IP-cím:</translation> <translation id="8661290697478713397">Link megnyitása inko&gnitóablakban</translation> <translation id="8662795692588422978">Személy</translation> @@ -5385,6 +5422,7 @@ <translation id="8942416694471994740">A mikrofonjához való hozzáférést a rendszergazda szabályozza.</translation> <translation id="894360074127026135">Netscape International Step-Up</translation> <translation id="8944779739948852228">Nyomtató észlelve</translation> +<translation id="8944964446326379280">A(z) <ph name="APP_NAME" /> megoszt egy ablakot a következővel: <ph name="TAB_NAME" />.</translation> <translation id="8946359700442089734">A hibakereső szolgáltatásokat nem kapcsolták be teljes körűen ezen a(z) <ph name="IDS_SHORT_PRODUCT_NAME" /> eszközön.</translation> <translation id="8946784827990177241">WebUSB-támogatás engedélyezése.</translation> <translation id="89515141420106838">Engedélyezi a Chrome Internetes áruház Galéria alkalmazást a nyomtatóillesztőknél. Az alkalmazás rákeres a Chrome Internetes áruházban azokra a bővítményekre, amelyek támogatják a nyomtatást az adott USB-azonosítóval rendelkező USB-s nyomtatókon.</translation> @@ -5403,6 +5441,7 @@ <translation id="8965037249707889821">Adja meg a régi jelszót</translation> <translation id="8965697826696209160">Nincs elég tárhely.</translation> <translation id="8968527460726243404">ChromeOS System Image Writer</translation> +<translation id="8970203673128054105">Átküldési módok listájának megtekintése</translation> <translation id="89720367119469899">Vezérlő</translation> <translation id="8972513834460200407">Kérdezze meg a hálózati rendszergazdától, hogy a tűzfal nem tiltja-e le a Google szervereiről érkező letöltéseket.</translation> <translation id="8974161578568356045">Automatikus felismerés</translation> @@ -5430,6 +5469,7 @@ <translation id="9011178328451474963">Utolsó lap</translation> <translation id="9013284500811652791"><ph name="UWS_NAME" />, <ph name="UWS_NAME" /> és még egy másik</translation> <translation id="9013587737291179248">Hoppá! Nem sikerült importálni a felügyelt felhasználót. Kérjük, ellenőrizze a merevlemezen rendelkezésre álló helyet és az engedélyeket, majd próbálja újra.</translation> +<translation id="901440679911238150">Fiókjának részletei nem elég frissek. <ph name="BEGIN_LINK" />Jelentkezzen be újra<ph name="END_LINK" />.</translation> <translation id="9014987600015527693">Másik telefon megjelenítése</translation> <translation id="9015601075560428829">Beszédbemenet</translation> <translation id="9016164105820007189">Csatlakozás a(z) <ph name="DEVICE_NAME" /> eszközhöz.</translation> @@ -5443,6 +5483,7 @@ <translation id="9025098623496448965">Rendben. Visszatérek a bejelentkezési képernyőre</translation> <translation id="902638246363752736">Billentyűzet beállításai</translation> <translation id="9026731007018893674">letöltés</translation> +<translation id="9027146684281895941">A személy felügyelete az általa megnyitott webhelyek szabályozásával és megtekintésével az Ön Google-fiókjából.</translation> <translation id="9027459031423301635">Link megnyitása új &lapon</translation> <translation id="9027603907212475920">Szinkronizálás beállítása...</translation> <translation id="9033453977881595182">Tokenazonosító</translation> @@ -5557,6 +5598,7 @@ <translation id="9203478404496196495">Lap némításának feloldása</translation> <translation id="9203962528777363226">Az eszköz rendszergazdája letiltotta az új felhasználók hozzáadását</translation> <translation id="9205143043463108573">Az alkalmazásindítót vízszintesen a képernyő közepére helyezi.</translation> +<translation id="9205160891051296441">A SystemTimezoneAutomaticDetection házirend támogatása</translation> <translation id="9206487995878691001">Cang-csie beviteli mód</translation> <translation id="9207194316435230304">ATOK</translation> <translation id="9208886416788010685">Az Adobe Reader elavult</translation> @@ -5578,6 +5620,7 @@ <translation id="939736085109172342">Új mappa</translation> <translation id="940425055435005472">Betűméret:</translation> <translation id="941543339607623937">Érvénytelen privát kulcs.</translation> +<translation id="942532530371314860">A(z) <ph name="APP_NAME" /> megosztja a Chrome egy lapját és a hangot.</translation> <translation id="942954117721265519">Nincs kép ebben a könyvtárban.</translation> <translation id="945522503751344254">Visszajelzés küldése</translation> <translation id="946810925362320585">Javaslat elfogadása</translation>
diff --git a/chrome/app/resources/generated_resources_id.xtb b/chrome/app/resources/generated_resources_id.xtb index 1c75c74..c0fb032 100644 --- a/chrome/app/resources/generated_resources_id.xtb +++ b/chrome/app/resources/generated_resources_id.xtb
@@ -661,7 +661,6 @@ <translation id="1962233722219655970">Laman ini menggunakan aplikasi Native Client yang tidak bekerja di komputer Anda.</translation> <translation id="1965328510789761112">Memori pribadi</translation> <translation id="1965624977906726414">Tidak memiliki izin khusus.</translation> -<translation id="1968720524450620475">Aktifkan ikon tindakan untuk Notifikasi Web.</translation> <translation id="1970746430676306437">Lihat &info laman</translation> <translation id="197288927597451399">Tetap Unduh</translation> <translation id="1973491249112991739">Gagal mengunduh <ph name="PLUGIN_NAME" />.</translation> @@ -1423,7 +1422,6 @@ <translation id="302014277942214887">Masukan id aplikasi atau URL toko web.</translation> <translation id="3020616530769498629">Aktifkan muat ulang non-validasi di tarik untuk menyegarkan</translation> <translation id="3020990233660977256">Nomor Seri: <ph name="SERIAL_NUMBER" /></translation> -<translation id="3021245547458004908">Jika diaktifkan, bilah alat tidak akan disembunyikan ketika menggulir di perangkat dengan tampilan layar minimum >= 800 piksel. Bilah alat tetap akan disembunyikan jika konten laman dibuka dengan layar penuh.</translation> <translation id="3021678814754966447">&Lihat Sumber Bingkai</translation> <translation id="3024374909719388945">Gunakan model waktu 24 jam</translation> <translation id="3025022340603654002">Berikan saran IsiOtomatis saat mengeklik mouse pertama kali di elemen formulir.</translation> @@ -1435,7 +1433,7 @@ <translation id="3030243755303701754">Pengguna yang dilindungi dapat menjelajahi web dengan panduan Anda. Sebagai pengelola pengguna yang dilindungi di Chrome, Anda dapat: • mengizinkan atau melarang situs web tertentu, - • meninjau situs web yang telah dikunjungi pengguna yang dilindungi, dan + • memeriksa situs web yang telah dikunjungi pengguna yang dilindungi, dan • mengelola setelan lainnya. Membuat pengguna yang dilindungi tidak akan membuat Akun Google, dan bookmark, riwayat penjelajahan, serta preferensi lainnya tidak akan ditampilkan di perangkat lainnya dengan Sinkronisasi Chrome. Setelah membuat pengguna baru yang dilindungi, Anda dapat mengelola setelannya kapan saja, dari perangkat apa saja, di <ph name="BEGIN_MANAGE_LINK" /><ph name="DISPLAY_LINK" /><ph name="END_MANAGE_LINK" />. @@ -1494,7 +1492,6 @@ <translation id="3117812041123364382">Mengaktifkan/Menonaktifkan keyboard virtual mengambang.</translation> <translation id="3118319026408854581">Bantuan <ph name="PRODUCT_NAME" /></translation> <translation id="3120430004221004537">Enkripsi tidak mencukupi untuk operasi yang diberikan di: "<ph name="DEVICE_NAME" />".</translation> -<translation id="3121260210578524273">Aktifkan ikon di tombol tindakan untuk Notifikasi Web.</translation> <translation id="3121793941267913344">Setel ulang perangkat <ph name="IDS_SHORT_PRODUCT_NAME" /> ini</translation> <translation id="3122162841865761901">Percobaan Alat Pengembang</translation> <translation id="3122464029669770682">CPU</translation> @@ -1705,7 +1702,7 @@ <translation id="3392020134425442298">Pulihkan file berbahaya</translation> <translation id="3394150261239285340"><ph name="HOST" /> ingin menggunakan kamera dan mikrofon Anda.</translation> <translation id="3394279550557729862">Aktifkan dukungan untuk menggunakan pusat notifikasi dan notifikasi toast asli di platform tempat semua ini tersedia.</translation> -<translation id="3394862755749546286">Menonaktifkan saluran pipa media terpadu (Android dan desktop) di Android.</translation> +<translation id="3394862755749546286">Menonaktifkan jalur media terpadu (Android dan desktop) di Android.</translation> <translation id="3396331542604645348">Printer yang dipilih tidak tersedia atau tidak dipasang dengan semestinya. Periksa printer Anda atau coba pilih printer lainnya.</translation> <translation id="3399597614303179694">Keyboard Makedonia</translation> <translation id="3401130144947259741">Jika diaktifkan, peristiwa pelacakan akan diekspor ke Event Tracing for Windows (ETW) dan dapat diambil oleh alat seperti UIForETW atau Xperf.</translation> @@ -2276,6 +2273,7 @@ <translation id="421017592316736757">Anda harus online untuk mengakses file ini.</translation> <translation id="421182450098841253">&Tampilkan Bilah Bookmark</translation> <translation id="4212108296677106246">Anda ingin memercayai "<ph name="CERTIFICATE_NAME" />" sebagai Otoritas Sertifikasi?</translation> +<translation id="42126664696688958">Ekspor</translation> <translation id="42137655013211669">Akses ke sumber daya ini tidak diizinkan oleh server.</translation> <translation id="4215350869199060536">Ups! Ada simbol ilegal dalam nama.</translation> <translation id="4215898373199266584">Ssst! (<ph name="INCOGNITO_MODE_SHORTCUT" />) mode penyamaran mungkin berguna suatu saat nanti.</translation> @@ -3308,7 +3306,6 @@ <translation id="577322787686508614">Operasi membaca tidak diizinkan di: "<ph name="DEVICE_NAME" />".</translation> <translation id="5774295353725270860">Membuka aplikasi File</translation> <translation id="5774515636230743468">Manifes:</translation> -<translation id="5776006986202016118">Situs ini ingin menyambungkan Anda ke:</translation> <translation id="577624874850706961">Telusuri cookie</translation> <translation id="5778550464785688721">Kontrol penuh perangkat MIDI</translation> <translation id="5780066559993805332">(Terbaik)</translation> @@ -4123,7 +4120,7 @@ <translation id="7057058088140140610">Kartu kredit dan alamat menggunakan Google Payments</translation> <translation id="7059858479264779982">Setel ke luncurkan otomatis</translation> <translation id="7061692898138851896">Otomatis simpan sandi</translation> -<translation id="7062222374113411376">Izinkan situs yang baru ditutup menyelesaikan pengiriman dan penerimaan data (disarankan)</translation> +<translation id="7062222374113411376">Izinkan situs yang baru ditutup untuk menyelesaikan pengiriman dan penerimaan data (disarankan)</translation> <translation id="7063129466199351735">Memproses pintasan...</translation> <translation id="7065223852455347715">Perangkat ini terkunci dalam mode yang mencegah pendaftaran perusahaan. Jika ingin mendaftarkan perangkat, Anda perlu memulihkan perangkat terlebih dahulu.</translation> <translation id="7065534935986314333">Tentang Sistem</translation> @@ -4197,7 +4194,6 @@ <translation id="7175353351958621980">Dimuat dari:</translation> <translation id="7180611975245234373">Segarkan</translation> <translation id="7180865173735832675">Sesuaikan</translation> -<translation id="7184428045150946911">Nonaktifkan penyembunyian bilah alat secara otomatis di tablet besar</translation> <translation id="7185690883425432021">Sembunyikan tombol tutup pada tab yang tidak aktif saat tabstrip berada dalam mode tumpukan.</translation> <translation id="7186088072322679094">Tetap sematkan di Bilah Alat</translation> <translation id="719009910964971313">Keyboard Programmer Dvorak AS</translation> @@ -4401,7 +4397,7 @@ <translation id="7489605380874780575">Periksa kelayakan</translation> <translation id="749028671485790643">Orang <ph name="VALUE" /></translation> <translation id="7491962110804786152">tab</translation> -<translation id="7493386493263658176">Ekstensi <ph name="EXTENSION_NAME" /> mungkin mengumpulkan semua teks yang Anda ketik, termasuk data pribadi seperti sandi dan nomor kartu kredit. Ingin menggunakan ekstensi ini?</translation> +<translation id="7493386493263658176">Ekstensi <ph name="EXTENSION_NAME" /> dapat mengumpulkan semua teks yang Anda ketik, termasuk data pribadi seperti sandi dan nomor kartu kredit. Ingin menggunakan ekstensi ini?</translation> <translation id="7495778526395737099">Lupa password lama?</translation> <translation id="7503191893372251637">Netscape Certificate Type</translation> <translation id="7503821294401948377">Tidak dapat memuat ikon '<ph name="ICON" />' untuk tindakan browser.</translation> @@ -4583,7 +4579,7 @@ <translation id="7786207843293321886">Keluar dari Sesi Tamu</translation> <translation id="7786889348652477777">&Muat Ulang Aplikasi</translation> <translation id="7787129790495067395">Saat ini Anda sedang menggunakan sebuah frasa sandi. Jika lupa frasa sandi Anda, Anda dapat menyetel ulang sinkronisasi untuk membersihkan data dari server Google melalui Google Dasbor.</translation> -<translation id="7787308148023287649">Tampilan di layar lain</translation> +<translation id="7787308148023287649">Tampilkan di layar lain</translation> <translation id="7788080748068240085">Untuk menyimpan "<ph name="FILE_NAME" />" secara offline, Anda harus mengosongkan ruang tambahan sebesar <ph name="TOTAL_FILE_SIZE" />:<ph name="MARKUP_1" /> <ph name="MARKUP_2" />lepas sematan file yang tidak lagi Anda gunakan untuk mengakses secara offline<ph name="MARKUP_3" /> <ph name="MARKUP_4" />hapus file dari folder Unduhan Anda<ph name="MARKUP_5" /></translation> @@ -5103,7 +5099,7 @@ <translation id="8545211332741562162">Mengaktifkan laman web untuk menggunakan fitur JavaScript eksperimental.</translation> <translation id="8545575359873600875">Maaf, sandi tidak dapat diverifikasi. Pengelola pengguna yang dilindungi ini mungkin mengubah sandi baru-baru ini. Jika demikian, sandi baru akan diterapkan saat Anda masuk lagi. Coba gunakan sandi lama.</translation> <translation id="8546306075665861288">Cache gambar</translation> -<translation id="854653344619327455">Jika tanda ini aktif, jendela pemilih berbagi dekstop tidak akan mengizinkan pengguna memilih apakah akan membagikan audio atau tidak.</translation> +<translation id="854653344619327455">Jika tanda ini aktif, jendela pemilih berbagi dekstop tidak akan mengizinkan pengguna memilih untuk membagikan audio.</translation> <translation id="8546541260734613940">[*.]example.com</translation> <translation id="8548973727659841685">Karakter</translation> <translation id="855081842937141170">Sematkan tab</translation> @@ -5476,7 +5472,7 @@ <translation id="9074739597929991885">Bluetooth</translation> <translation id="9074836595010225693">Mouse USB tersambung</translation> <translation id="9076523132036239772">Maaf, email atau sandi Anda tidak dapat diverifikasi. Coba sambungkan ke jaringan terlebih dulu.</translation> -<translation id="9077132661879924646">Menonaktifkan saluran pipa media terpadu di Android.</translation> +<translation id="9077132661879924646">Menonaktifkan jalur media terpadu di Android.</translation> <translation id="907841381057066561">Gagal membuat file zip sementara selama pengemasan</translation> <translation id="9083147368019416919">Gagal membatalkan pendaftaran</translation> <translation id="9084064520949870008">Buka sebagai Jendela</translation>
diff --git a/chrome/app/resources/generated_resources_it.xtb b/chrome/app/resources/generated_resources_it.xtb index 9303a7e8..674ce37 100644 --- a/chrome/app/resources/generated_resources_it.xtb +++ b/chrome/app/resources/generated_resources_it.xtb
@@ -661,7 +661,6 @@ <translation id="1962233722219655970">Questa pagina utilizza un'app Native Client che non funziona sul tuo computer.</translation> <translation id="1965328510789761112">Memoria privata</translation> <translation id="1965624977906726414">Non ha autorizzazioni speciali.</translation> -<translation id="1968720524450620475">Abilita icone di azione per le notifiche web.</translation> <translation id="1970746430676306437">Visualizza &informazioni pagina</translation> <translation id="197288927597451399">Conserva</translation> <translation id="1973491249112991739">Download di <ph name="PLUGIN_NAME" /> non riuscito.</translation> @@ -1421,7 +1420,6 @@ <translation id="302014277942214887">Inserisci l'ID dell'applicazione o l'URL del webstore.</translation> <translation id="3020616530769498629">Attiva il ricaricamento senza convalida al pull-to-refresh</translation> <translation id="3020990233660977256">Numero di serie: <ph name="SERIAL_NUMBER" /></translation> -<translation id="3021245547458004908">Quando l'opzione è attiva, la barra degli strumenti non viene mai nascosta quando viene eseguito lo scorrimento su dispositivi con schermo di dimensioni minime pari a dp >= 800. La barra continuerà a essere nascosta se i contenuti della pagina vengono mostrati a schermo intero.</translation> <translation id="3021678814754966447">&Visualizza sorgente frame</translation> <translation id="3024374909719388945">Usa orologio 24 ore</translation> <translation id="3025022340603654002">Consente di visualizzare suggerimenti di Compilazione automatica al clic iniziale del mouse su un elemento del modulo.</translation> @@ -1492,7 +1490,6 @@ <translation id="3117812041123364382">Attiva/Disattiva la tastiera virtuale mobile.</translation> <translation id="3118319026408854581">Guida di <ph name="PRODUCT_NAME" /></translation> <translation id="3120430004221004537">Crittografia insufficiente per un'operazione specifica su: "<ph name="DEVICE_NAME" />".</translation> -<translation id="3121260210578524273">Abilita icone nei pulsanti di azione per le notifiche web.</translation> <translation id="3121793941267913344">Ripristina questo dispositivo <ph name="IDS_SHORT_PRODUCT_NAME" /></translation> <translation id="3122162841865761901">Esperimenti Strumenti per sviluppatori</translation> <translation id="3122464029669770682">CPU</translation> @@ -2272,6 +2269,7 @@ <translation id="421017592316736757">Per poter accedere a questo file devi essere online.</translation> <translation id="421182450098841253">&Mostra barra dei Preferiti</translation> <translation id="4212108296677106246">Considerare attendibile "<ph name="CERTIFICATE_NAME" />" come autorità di certificazione?</translation> +<translation id="42126664696688958">Esporta</translation> <translation id="42137655013211669">L'accesso a questa risorsa è vietato dal server.</translation> <translation id="4215350869199060536">Spiacenti, simboli non validi nel nome.</translation> <translation id="4215898373199266584">Psst! La prossima volta potrebbe esserti utile la modalità di navigazione in incognito (<ph name="INCOGNITO_MODE_SHORTCUT" />).</translation> @@ -3301,7 +3299,6 @@ <translation id="577322787686508614">Lettura non consentita su: "<ph name="DEVICE_NAME" />".</translation> <translation id="5774295353725270860">Apri l'applicazione File</translation> <translation id="5774515636230743468">Manifest:</translation> -<translation id="5776006986202016118">Questo sito vuole collegarsi a:</translation> <translation id="577624874850706961">Cerca cookie</translation> <translation id="5778550464785688721">Controllo completo di dispositivi MIDI</translation> <translation id="5780066559993805332">(Migliore)</translation> @@ -4191,7 +4188,6 @@ <translation id="7175353351958621980">Caricamento da:</translation> <translation id="7180611975245234373">Aggiorna</translation> <translation id="7180865173735832675">Personalizza</translation> -<translation id="7184428045150946911">Disattiva la visualizzazione automatica della barra degli strumenti su tablet di grandi dimensioni</translation> <translation id="7185690883425432021">Consente di nascondere i pulsanti di chiusura delle schede non attive quando la tabstrip è in modalità sovrapposta.</translation> <translation id="7186088072322679094">Mantieni in barra degli strumenti</translation> <translation id="719009910964971313">Tastiera US Programmer Dvorak</translation>
diff --git a/chrome/app/resources/generated_resources_iw.xtb b/chrome/app/resources/generated_resources_iw.xtb index 26784f1..400d294d 100644 --- a/chrome/app/resources/generated_resources_iw.xtb +++ b/chrome/app/resources/generated_resources_iw.xtb
@@ -79,7 +79,7 @@ <translation id="1110753181581583968">{NUM_DOWNLOAD,plural, =1{המשך את ההורדה}two{המשך את ההורדות}many{המשך את ההורדות}other{המשך את ההורדות}}</translation> <translation id="1110772031432362678">לא נמצאו רשתות.</translation> <translation id="1114202307280046356">יהלום</translation> -<translation id="1114335938027186412">המחשב שלך מכיל התקן אבטחה מסוג Trusted Platform Module (TPM), המשמש ליישם תכונות אבטחה קריטיות רבות במערכת ההפעלה של Chrome. בקר במרכז העזרה של Chromebook כדי לקבל מידע נוסף: https://support.google.com/chromebook/?p=tpm</translation> +<translation id="1114335938027186412">המחשב שלך מכיל התקן אבטחה מסוג Trusted Platform Module (TPM), המשמש ליישם תכונות אבטחה קריטיות רבות במערכת ההפעלה של Chrome. היכנס למרכז העזרה של Chromebook כדי לקבל מידע נוסף: https://support.google.com/chromebook/?p=tpm</translation> <translation id="1114901192629963971">לא ניתן לאמת את הסיסמה ברשת הזו. בחר רשת אחרת.</translation> <translation id="1115018219887494029">Smart Lock for Chromebook (ביטא)</translation> <translation id="1115248033204311258">צור ספריות shim ליישומים ב-Mac בעת יצירת יישום מתארח.</translation> @@ -183,16 +183,19 @@ <translation id="1259724620062607540">פריט מדף 7</translation> <translation id="1260240842868558614">הצג:</translation> <translation id="126710816202626562">שפת תרגום:</translation> +<translation id="1269690813141254680">השתמש ב<ph name="BEGIN_LINK" />בחירת הפעילויות של Google<ph name="END_LINK" /> כדי לקבוע כיצד Google משתמשת בהיסטוריית הגלישה על מנת להתאים אישית את החיפוש ושירותים אחרים של Google.</translation> <translation id="1272079795634619415">הפסק</translation> <translation id="1272978324304772054">חשבון משתמש זה אינו שייך לדומיין שאליו רשום המכשיר. אם ברצונך להירשם לדומיין אחר, ראשית עליך לבצע שחזור מכשיר.</translation> <translation id="127353061808977798">גופנים וקידוד</translation> <translation id="1274997165432133392">קובצי Cookie ונתוני אתר נוספים</translation> <translation id="1275718070701477396">נבחר</translation> +<translation id="1277908057200820621">הצג את רשימת המכשירים</translation> <translation id="1278049586634282054">בדוק תצוגות:</translation> <translation id="1278813325885878377">מקלדת הונגרית בפריסת QWERTY</translation> <translation id="1285320974508926690">לעולם אל תתרגם אתר זה</translation> <translation id="1285484354230578868">אחסן נתונים בחשבון Google Drive</translation> <translation id="1290223615328246825">נכשל הניסיון לכניסה האוטומטית</translation> +<translation id="1293509594570842875">לא ניתן היה ליצור את המשתמש החדש בפיקוח. בדוק את חיבור הרשת ונסה שוב מאוחר יותר.</translation> <translation id="1293556467332435079">קבצים</translation> <translation id="1294298200424241932">ערוך הגדרות אמון:</translation> <translation id="1295794900245526845">בחר בחשבון שלך שנשמר ב-<ph name="PASSWORD_MANAGER_BRAND" /> כדי להיכנס</translation> @@ -290,6 +293,7 @@ <translation id="1429740407920618615">עוצמת אות:</translation> <translation id="143027896309062157">לקרוא ולשנות את כל הנתונים במחשב שלך ובאתרים שבהם אתה מבקר</translation> <translation id="1430915738399379752">הדפס</translation> +<translation id="1433423644370450034">הודעה על סגנון מדיה</translation> <translation id="1434696352799406980">פעולה זו תאפס את דף הפתיחה, את דף הכרטיסייה החדשה, את מנוע החיפוש ואת הכרטיסיות המוצמדות שלך. היא גם תשבית את כל התוספים ותמחק נתונים זמניים כגון קובצי Cookie. הסימניות, ההיסטוריה והסיסמאות השמורות לא יימחקו.</translation> <translation id="1434886155212424586">דף הבית הוא הדף 'כרטיסייה חדשה'</translation> <translation id="1435550882135542937">עיצוב מחדש לסרגל הכלים של התוסף</translation> @@ -374,6 +378,7 @@ <translation id="1526925867532626635">אשר הגדרות סנכרון</translation> <translation id="1528372117901087631">חיבור לאינטרנט</translation> <translation id="1529968269513889022">מהשבוע האחרון</translation> +<translation id="1531865825384516080">דיווח על כתובות אתרים בחיפוש בטוח.</translation> <translation id="1532697124104874386">הפעל/השבת פריסה חכמה של המקלדת הווירטואלית.</translation> <translation id="1533897085022183721">פחות מ-<ph name="MINUTES" /></translation> <translation id="1533920822694388968">יישור טלוויזיה</translation> @@ -657,7 +662,6 @@ <translation id="1962233722219655970">דף זה משתמש ביישום Native Client שאינו פועל במחשב שלך.</translation> <translation id="1965328510789761112">זיכרון פרטי</translation> <translation id="1965624977906726414">אין הרשאות מיוחדות.</translation> -<translation id="1968720524450620475">הפעל סמלי פעולה להודעות אינטרנט.</translation> <translation id="1970746430676306437">צפה בפרטי הדף</translation> <translation id="197288927597451399">שמור</translation> <translation id="1973491249112991739">הורדת <ph name="PLUGIN_NAME" /> נכשלה.</translation> @@ -755,6 +759,7 @@ <translation id="212862741129535676">אחוז תפוסה במצב תדירות</translation> <translation id="2128691215891724419">שגיאת סנכרון: עדכן משפט-סיסמה של סנכרון...</translation> <translation id="2129904043921227933">שגיאת סנכרון: עדכן את משפט-הסיסמה לסנכרון...</translation> +<translation id="2130053362119884302">התרה של ניתוק כרטיסיות במסך מלא</translation> <translation id="2131077480075264">לא ניתן להתקין את '<ph name="APP_NAME" />' מכיוון שהוא לא מאושר על ידי '<ph name="IMPORT_NAME" />'</translation> <translation id="2134149231879627725">תן ל-Google לעזור לך לנעול, למחוק ולאתר את המכשיר מרחוק.</translation> <translation id="2134986351331412790">האתר אינו מקבל כרטיסי אשראי מסוג זה.</translation> @@ -767,6 +772,7 @@ <translation id="2143778271340628265">תצורת שרת proxy ידנית</translation> <translation id="2143915448548023856">הגדרות תצוגה</translation> <translation id="2144536955299248197">מציג האישורים: <ph name="CERTIFICATE_NAME" /></translation> +<translation id="2147827593068025794">סינכרון ברקע</translation> <translation id="2148756636027685713">הפרמוט הסתיים</translation> <translation id="2148892889047469596">העבר את הכרטיסייה</translation> <translation id="2148999191776934271">טעינה <ph name="HOUR" />:<ph name="MINUTE" /> עד שמתמלא</translation> @@ -1139,13 +1145,14 @@ <translation id="2665717534925640469">דף זה מוצג כעת במסך מלא והשבית את סמן העכבר שלך.</translation> <translation id="2665919335226618153">אוי, לא! היתה שגיאה במהלך הפרמוט.</translation> <translation id="2668079306436607263">ניווט בהיסטוריה לאחר גלילת יתר</translation> +<translation id="2670102641511624474"><ph name="APP_NAME" /> משתף כרטיסיית Chrome.</translation> <translation id="2670965183549957348">שיטת קלט Chewing</translation> <translation id="2672142220933875349">קובץ crx פגום, פירוק האריזה נכשל.</translation> <translation id="2672394958563893062">אירעה שגיאה. לחץ כדי להתחיל מחדש.</translation> <translation id="267285457822962309">שנה את ההגדרות הספציפיות למכשיר ולציוד ההיקפי.</translation> <translation id="2673135533890720193">לקרוא את היסטוריית הגלישה שלך</translation> <translation id="2673589024369449924">צור קיצור דרך בשולחן העבודה למשתמש זה.</translation> -<translation id="2675358154061544447">תמיכה ניסיונית מאוד בעיבוד iframes חוצי-אתרים בתהליכים נפרדים. במצב זה, מסמכים יחלקו תהליך של מעבד רק אם הם מאותו אתר.</translation> +<translation id="2675358154061544447">תמיכה ניסיונית מאוד בעיבוד iFrames חוצי-אתרים בתהליכים נפרדים. במצב זה, מסמכים יחלקו תהליך של מעבד רק אם הם מאותו אתר.</translation> <translation id="2676946222714718093">מופעל ב-</translation> <translation id="2678063897982469759">הפוך מחדש לפעיל</translation> <translation id="2678246812096664977">כל יישומי הפלאגין</translation> @@ -1185,6 +1192,7 @@ <translation id="2733364097704495499">האם ברצונך לרשום את המדפסת <ph name="PRINTER_NAME" /> ל-Google Cloud Print?</translation> <translation id="2735698359135166290">מקלדת רומנית רגילה</translation> <translation id="2737363922397526254">כווץ...</translation> +<translation id="2737755522130570180">חסימת סקריפטים הנטענים דרך document.write</translation> <translation id="2738771556149464852">לא אחרי</translation> <translation id="2739191690716947896">ניפוי באגים</translation> <translation id="2739240477418971307">שינוי הגדרות הנגישות שלך</translation> @@ -1246,7 +1254,7 @@ לאחר ההפעלה, רוב התכונות של ניפוי הבאגים יישארו פעילות, גם לאחר ביצוע Powerwash או מחיקה של הנתונים במכשיר ארגוני מנוהל. כדי להשבית באופן מלא את כל תכונות ניפוי הבאגים, בצע את תהליך השחזור של מערכת ההפעלה של Chrome (https://support.google.com/chromebook/answer/1080595). <ph name="BR" /> <ph name="BR" /> -למידע נוסף על תכונות ניפוי הבאגים, בקר בכתובת:<ph name="BR" /> +למידע נוסף על תכונות ניפוי הבאגים, היכנס לכתובת:<ph name="BR" /> http://www.chromium.org/chromium-os/how-tos-and-troubleshooting/debugging-features <ph name="BR" /> <ph name="BR" /> @@ -1254,6 +1262,7 @@ <translation id="2805646850212350655">מערכת קבצים מצפינה של Microsoft</translation> <translation id="2805707493867224476">אפשר לכל האתרים להציג חלונות קופצים</translation> <translation id="2805756323405976993">אפליקציות</translation> +<translation id="2808243220963392165">התר ניתוק של כרטיסיות משורת הכרטיסיות במצב מסך מלא ב-Mac.</translation> <translation id="2809142985846095314">הפעל הצגת הצעה להעלאת כרטיסי אשראי שמולאו באופן אוטומטי</translation> <translation id="2809346626032021864">קריאה</translation> <translation id="2809586584051668049">ועוד <ph name="NUMBER_ADDITIONAL_DISABLED" /></translation> @@ -1382,6 +1391,7 @@ <translation id="2968792643335932010">פחות עותקים</translation> <translation id="2971033837577180453"><span>מזהה:</span><ph name="EXTENSION_ID" /></translation> <translation id="2971213274238188218">הפחתת בהירות</translation> +<translation id="2971422413423640756">לחצן הורדה בעת פתיחת דף עם כתובת אתר של מדיה.</translation> <translation id="2972557485845626008">קושחה</translation> <translation id="2972581237482394796">&בצע שנית</translation> <translation id="297870353673992530">שרת DNS:</translation> @@ -1414,7 +1424,6 @@ <translation id="302014277942214887">הזן מזהה יישום או כתובת אתר של חנות אינטרנט.</translation> <translation id="3020616530769498629">הפעל טעינה מחדש ללא אימות בעת משיכה לרענון</translation> <translation id="3020990233660977256">מספר סידורי: <ph name="SERIAL_NUMBER" /></translation> -<translation id="3021245547458004908">כשאפשרות זו פועלת, סרגל הכלים אף פעם לא יוסתר עקב גלילה במכשירים בעלי מסך של 800 dp לפחות. סרגל הכלים יוסתר בכל זאת אם התוכן יוצג במסך מלא.</translation> <translation id="3021678814754966447">&הצג את מקור המסגרת</translation> <translation id="3024374909719388945">השתמש בשעון של 24 שעות</translation> <translation id="3025022340603654002">תן הצעות למילוי אוטומטי בלחיצת עכבר ראשונית על רכיב טופס.</translation> @@ -1427,9 +1436,9 @@ • להתיר או לחסום אתרים • להציג את האתרים שבהם ביקר המשתמש בפיקוח - • לנהל הגדרות אחרות + • לנהל הגדרות נוספות -יצירה של משתמש בפיקוח אינה יוצרת חשבון Google, והסימניות, היסטוריית הגלישה וההעדפות האחרות שלו לא יהיו זמינות לו במכשירים אחרים בעזרת סינכרון Chrome. לאחר שתיצור משתמש חדש בפיקוח, תוכל לנהל את ההגדרות שלו בכל עת ומכל מכשיר בכתובת <ph name="BEGIN_MANAGE_LINK" /><ph name="DISPLAY_LINK" /><ph name="END_MANAGE_LINK" />. +יצירה של משתמש בפיקוח אינה יוצרת חשבון Google, והסימניות, היסטוריית הגלישה וההעדפות האחרות שלו לא יהיו זמינות לו במכשירים אחרים בעזרת סינכרון Chrome. לאחר שתיצור משתמש חדש בפיקוח, תוכל לנהל את ההגדרות שלו תמיד ומכל מכשיר בכתובת <ph name="BEGIN_MANAGE_LINK" /><ph name="DISPLAY_LINK" /><ph name="END_MANAGE_LINK" />. תוכל למצוא מידע נוסף <ph name="BEGIN_LINK" />במרכז העזרה<ph name="END_LINK" /> שלנו.</translation> <translation id="3031417829280473749">סוכנת X</translation> @@ -1447,6 +1456,7 @@ <translation id="3057861065630527966">גבה את התמונות והסרטונים</translation> <translation id="3058212636943679650">אם תצטרך בעתיד לשחזר את מערכת ההפעלה של המחשב, תזדקק לכרטיס SD או למקל זיכרון USB לשחזור.</translation> <translation id="305932878998873762">הקובץ השמור הפשוט עבור HTTP הוא קובץ שמור חדש. הוא מתבסס על מערכת הקבצים להקצאת שטח דיסק.</translation> +<translation id="3062606427884046423">השתמש בהודעות Android MediaStyle להודעות מדיה של Chrome.</translation> <translation id="3064388234319122767">תעתוק (zdravo → здраво)</translation> <translation id="3065041951436100775">משוב על כרטיסייה שנסגרה.</translation> <translation id="3065140616557457172">הקלד לחיפוש או הזן כתובת אתר לניווט - שניהם עובדים.</translation> @@ -1485,7 +1495,6 @@ <translation id="3117812041123364382">הפעל/השבת את המקלדת הווירטואלית הצפה.</translation> <translation id="3118319026408854581">עזרה של <ph name="PRODUCT_NAME" /></translation> <translation id="3120430004221004537">ההצפנה לא מספיקה לפעולה נתונה במכשיר: "<ph name="DEVICE_NAME" />".</translation> -<translation id="3121260210578524273">הפעל סמלים בלחצני פעולה להודעות אינטרנט.</translation> <translation id="3121793941267913344">אפס את מכשיר <ph name="IDS_SHORT_PRODUCT_NAME" /> זה</translation> <translation id="3122162841865761901">ניסויים בכלים למפתחים</translation> <translation id="3122464029669770682">CPU</translation> @@ -1529,6 +1538,7 @@ <translation id="3170072451822350649">ניתן גם לדלג על הכניסה ו<ph name="LINK_START" />לגלוש כאורח<ph name="LINK_END" />.</translation> <translation id="3170544058711792988">השאר את המיקוד של מגדיל התצוגה במרכז המסך</translation> <translation id="3172213052701798825">Google Smart Lock לסיסמאות</translation> +<translation id="3175469972022788345">כשהאפשרות הזה פועלת, WebRTC ישתמש באישורי ECDSA.</translation> <translation id="317583078218509884">הגדרות חדשות של אישורי אתר ייכנסו לתוקף לאחר טעינה מחדש של הדף.</translation> <translation id="3177048931975664371">לחץ כדי להסתיר את הסיסמה</translation> <translation id="3180365125572747493">הזן סיסמה כדי להצפין את קובץ האישור הזה.</translation> @@ -1983,6 +1993,7 @@ <translation id="3776796446459804932">התוסף מפר את המדיניות בחנות האינטרנט של Chrome.</translation> <translation id="3778152852029592020">ההורדה בוטלה.</translation> <translation id="3778740492972734840">&כלים עבור מפתחים</translation> +<translation id="3780663724044634171">בחר חשבון לניהול המשתמש בפיקוח.</translation> <translation id="378312418865624974">קריאה של מזהה ייחודי עבור מחשב זה</translation> <translation id="3783640748446814672">alt</translation> <translation id="3785308913036335955">הצג קיצור דרך אל יישומים</translation> @@ -2006,6 +2017,7 @@ <translation id="3807747707162121253">&ביטול</translation> <translation id="3809280248639369696">מר ירח</translation> <translation id="3810973564298564668">נהל</translation> +<translation id="3811494700605067549">בחרת קובץ אחד</translation> <translation id="3812034401428455285"><ph name="UWS_NAME" /> ו-<ph name="UWS_NAME" /></translation> <translation id="3812525830114410218">אישור פגום</translation> <translation id="3813984289128269159">Ok Google</translation> @@ -2035,6 +2047,7 @@ <translation id="3838543471119263078">קובצי cookie ונתוני אתר ופלאגין נוספים</translation> <translation id="3839497635014791588">משוב מגע נוסף ברכיבי ממשק המשתמש</translation> <translation id="3840053866656739575">אבד החיבור ל-Chromebox שלך. התקרב עוד או בדוק את מכשירך בזמן שאנחנו מנסים להתחבר שוב.</translation> +<translation id="3840055807562919428">אוסר אחזורים של סקריפטים חוסמי ניתוח של צד שלישי שנוספו למסגרת הראשית דרך document.write.</translation> <translation id="3842552989725514455">גופן Serif</translation> <translation id="3846593650622216128">הגדרות אלה נאכפות על ידי תוסף.</translation> <translation id="3846833722648675493">הצג חלונות של יישומים אחרי הופעת הפריט הראשון. חלונות של יישומים כבדים הטוענים משאבים באופן סנכרוני יוצגו באיחור משמעותי, אבל האיחור יהיה בלתי מורגש כמעט ביישומים שטוענים את רוב המשאבים שלהם באופן אסנכרוני.</translation> @@ -2266,13 +2279,14 @@ <translation id="421017592316736757">עליך להיות במצב מקוון כדי לגשת לקובץ זה.</translation> <translation id="421182450098841253">&הצג את סרגל הסימניות</translation> <translation id="4212108296677106246">האם ברצונך לבטוח ב-"<ph name="CERTIFICATE_NAME" />" כרשות אישורים?</translation> +<translation id="42126664696688958">יצא</translation> <translation id="42137655013211669">הגישה למשאב זה נאסרה על-ידי השרת.</translation> <translation id="4215350869199060536">אופס, יש בשם סמלים לא חוקיים!</translation> <translation id="4215898373199266584">ששש...! מצב גלישה בסתר (<ph name="INCOGNITO_MODE_SHORTCUT" />) עשוי להיות שימושי בפעם הבאה.</translation> <translation id="4218259925454408822">היכנס לחשבון אחר</translation> <translation id="4219614746733932747">אם מופעל, Blink משתמש במנגנון שינוי המרחק מהתצוגה כדי לשנות את גודל התוכן בהתאם לגודל המסך של המכשיר.</translation> <translation id="4220865787605972627">אפשר כיול צבע של המסך, אם המסך תומך בתכונה הזו.</translation> -<translation id="4232692576734035989">מצב ביצועים ניסיוני מאוד שבו iframes חוצי-אתרים נשמרים בתהליכים נפרדים מהמסמך העליון. במצב זה, iframes מאתרים שונים של צד שלישי יורשו לחלוק תהליך.</translation> +<translation id="4232692576734035989">מצב ביצועים ניסיוני מאוד שבו iFrames חוצי-אתרים נשמרים בתהליכים נפרדים מהמסמך העליון. במצב זה, iframes מאתרים שונים של צד שלישי יורשו לחלוק תהליך.</translation> <translation id="4235200303672858594">כל המסך</translation> <translation id="4235813040357936597">הוסף חשבון עבור <ph name="PROFILE_NAME" /></translation> <translation id="4240069395079660403">לא ניתן להציג את <ph name="PRODUCT_NAME" /> בשפה זו</translation> @@ -2352,6 +2366,7 @@ <translation id="4359408040881008151">הותקן מפני שיש תוספים התלויים בו.</translation> <translation id="4361190688154226069">מיקוד מבוסס-מלבן בתצוגות</translation> <translation id="4364444725319685468">ההורדה של <ph name="FILE_NAME" /> בוצעה</translation> +<translation id="4364567974334641491"><ph name="APP_NAME" /> משתף חלון.</translation> <translation id="4364830672918311045">הצגת הודעות</translation> <translation id="4365673000813822030">אופס, הסינכרון הפסיק לפעול.</translation> <translation id="4366509400410520531">מופעל על ידך</translation> @@ -2421,6 +2436,7 @@ <translation id="4479639480957787382">אתרנט</translation> <translation id="4479812471636796472">מקלדת Dvorak אנגלית (ארה"ב)</translation> <translation id="4481249487722541506">טען תוסף שלא נארז...</translation> +<translation id="4482194545587547824">Google עשויה להשתמש בהיסטוריית הגלישה שלך כדי להתאים אישית את החיפוש ושירותים אחרים של Google</translation> <translation id="4487088045714738411">מקלדת בלגית</translation> <translation id="4492190037599258964">תוצאות החיפוש עבור '<ph name="SEARCH_STRING" />'</translation> <translation id="4495021739234344583">ביטול הרשמה והפעלה מחדש</translation> @@ -2464,6 +2480,7 @@ <translation id="4554591392113183336">התוסף החיצוני הוא מגרסה זהה או קודמת לזו של התוסף הקיים.</translation> <translation id="4554796861933393312">מהירות אנימציה של טיפת דיו בעיצוב חדשני תלת-ממדי</translation> <translation id="4555769855065597957">צל</translation> +<translation id="4556110439722119938">הסימניות, ההיסטוריה, הסיסמאות והגדרות נוספות יסונכרנו עם חשבון Google, כך שתוכל להשתמש בהם בכל המכשירים שלך.</translation> <translation id="4557136421275541763">אזהרה:</translation> <translation id="4558426062282641716">התבקשה הרשאה להפעלה אוטומטית</translation> <translation id="4563210852471260509">שפת הקלט הראשונית היא סינית</translation> @@ -2585,6 +2602,7 @@ <translation id="4742746985488890273">הצמד למדף</translation> <translation id="474421578985060416">נחסם על ידך</translation> <translation id="4744574733485822359">ההורדה הסתיימה</translation> +<translation id="4746330764136728131">שימוש באישורי ECDSA ל-WebRTC</translation> <translation id="4746971725921104503">נראה שאתה כבר מנהל משתמש בשם הזה. האם רצית <ph name="LINK_START" />לייבא את <ph name="USER_DISPLAY_NAME" /> אל המכשיר הזה<ph name="LINK_END" />?</translation> <translation id="4747271164117300400">מקדונית</translation> <translation id="4749157430980974800">מקלדת גיאורגית</translation> @@ -2734,6 +2752,7 @@ <translation id="496226124210045887">התיקיה שבחרת מכילה קבצים רגישים. האם אתה בטוח שברצונך להעניק ל-"$1" גישה קבועה לקריאה בתיקיה זו?</translation> <translation id="4964673849688379040">בודק...</translation> <translation id="4966802378343010715">צור משתמש חדש</translation> +<translation id="4967749818080339523">בחר חשבון</translation> <translation id="496888482094675990">היישום 'קבצים' מספק גישה מהירה לקבצים ששמרת ב-Google Drive, באחסון חיצוני או במכשיר שלך עם מערכת הפעלה של Chrome.</translation> <translation id="4971412780836297815">פתח בסיום</translation> <translation id="497244430928947428">מקלדת מליאלאם (פונטית)</translation> @@ -2780,6 +2799,7 @@ <translation id="5038863510258510803">מפעיל...</translation> <translation id="5039512255859636053">$1 TB</translation> <translation id="5039804452771397117">אפשר</translation> +<translation id="5043851552150732346">בחרת ספרייה אחת</translation> <translation id="5045550434625856497">סיסמה שגויה</translation> <translation id="5048179823246820836">נורדית</translation> <translation id="5048294425697652159">הפעל את Quirks Client לכיול המסך.</translation> @@ -2867,6 +2887,7 @@ <translation id="5170477580121653719">שטח אחסון שנותר ב-Google Drive: <ph name="SPACE_AVAILABLE" />.</translation> <translation id="5170568018924773124">הצג בתיקייה</translation> <translation id="5171045022955879922">חפש או הקלד כתובת אתר</translation> +<translation id="5171343362375269016">זיכרון מוחלף</translation> <translation id="5175870427301879686"><ph name="URL" /> רוצה לאחסן נתונים במחשב המקומי שלך באופן קבוע.</translation> <translation id="5177479852722101802">המשך לחסום גישה אל המצלמה והמיקרופון</translation> <translation id="5177526793333269655">תצוגת תמונה ממוזערת</translation> @@ -3024,6 +3045,7 @@ <translation id="5380103295189760361">החזק את Control, Alt, Shift או 'חפש' כדי לראות מקשי קיצור עבור מקשי הצירוף האלה.</translation> <translation id="5382392428640372740">אפשר מעקב ניווט</translation> <translation id="5388588172257446328">שם משתמש:</translation> +<translation id="5389237414310520250">לא ניתן היה ליצור את המשתמש החדש. בדוק את השטח הפנוי בכונן הקשיח ואת ההרשאות שלך ונסה שוב.</translation> <translation id="5390284375844109566">מסד נתונים שנוסף לאינדקס</translation> <translation id="5392544185395226057">הפוך תמיכה ב-Native Client לפעילה.</translation> <translation id="5396126354477659676">הפלאגין <ph name="PEPPER_PLUGIN_NAME" /> ב-<ph name="PEPPER_PLUGIN_DOMAIN" /> מבקש גישה למחשב שלך.</translation> @@ -3091,6 +3113,7 @@ <translation id="5469954281417596308">מנהל הסימניות</translation> <translation id="5470838072096800024">הפעם האחרונה שהתקבל</translation> <translation id="5473075389972733037">IBM</translation> +<translation id="5473279832922912143">הפעל את V8 כדי להשתמש במפענח Ignition הניסיוני להפעלת JavaScript.</translation> <translation id="5474139872592516422">כאשר יסתיים עדכון <ph name="PLUGIN_NAME" />, טען מחדש את הדף כדי להפעיל אותו.</translation> <translation id="5480254151128201294">מכשיר זה ננעל על ידי הבעלים.</translation> <translation id="5483785310822538350">בטל גישה לקבצים ולמכשירים</translation> @@ -3118,6 +3141,7 @@ <translation id="5509914365760201064">מנפיק: <ph name="CERTIFICATE_AUTHORITY" /></translation> <translation id="5511823366942919280">האם אתה בטוח שברצונך להגדיר מכשיר זה כ'כריש'?</translation> <translation id="5512653252560939721">חובה לבצע גיבוי-חומרה לאישור המשתמש.</translation> +<translation id="5513242761114685513">תפריט הקשר</translation> <translation id="5515008897660088170">חלונות יישום בתצוגות ערכת כלים</translation> <translation id="551752069230578406">מוסיף את המדפסת לחשבון שלך - התהליך עשוי להימשך מספר רגעים...</translation> <translation id="5518584115117143805">אישור הצפנת אימייל</translation> @@ -3298,7 +3322,6 @@ <translation id="577322787686508614">פעולת קריאה אסורה במכשיר: "<ph name="DEVICE_NAME" />".</translation> <translation id="5774295353725270860">פתח את יישום הקבצים</translation> <translation id="5774515636230743468">מניפסט:</translation> -<translation id="5776006986202016118">האתר מבקש להתחבר אל:</translation> <translation id="577624874850706961">חפש קובצי Cookie</translation> <translation id="5778550464785688721">שליטה מלאה במכשירי MIDI</translation> <translation id="5780066559993805332">(מומלץ ביותר)</translation> @@ -3376,6 +3399,7 @@ <translation id="5874045675243596003">אכיפה קפדנית (קשה להיכשל אם איננו יכולים לקבל hashes)</translation> <translation id="5875858680971105888">אופס! לא הייתה אפשרות לייבא את המשתמש בפיקוח. בדוק את החיבור לרשת ונסה שוב מאוחר יותר.</translation> <translation id="5880247576487732437">אסימון קיים</translation> +<translation id="5884474295213649357">הכרטיסייה הזו מחוברת להתקן USB.</translation> <translation id="5885324376209859881">נהל הגדרות מדיה...</translation> <translation id="5889282057229379085">המספר המרבי של רשויות אישורים ברמת ביניים: <ph name="NUM_INTERMEDIATE_CA" /></translation> <translation id="5892290200158927959">מקלדת צרפתית בפריסת BÉPO</translation> @@ -3465,6 +3489,8 @@ <translation id="604124094241169006">אוטומטי</translation> <translation id="6042308850641462728">עוד</translation> <translation id="604257181445267932">התכונה Smart Lock עוזרת לך להיכנס במהירות לאפליקציות ולאתרים באמצעות סיסמאות ששמרת ב-Google.</translation> +<translation id="6043317578411397101"><ph name="APP_NAME" /> משתף כרטיסיית Chrome עם <ph name="TAB_NAME" />.</translation> +<translation id="6044805581023976844"><ph name="APP_NAME" /> משתף כרטיסייה ואודיו של Chrome עם <ph name="TAB_NAME" />.</translation> <translation id="6049065490165456785">תמונה מהמצלמה הפנימית</translation> <translation id="6051028581720248124">על ידי הדפסה ל-FedEx Office, אתה מקבל את <ph name="START_LINK" />תנאי השימוש<ph name="END_LINK" /> שלהם.</translation> <translation id="6051086608691487286">סרגלי גלילה בשכבות על</translation> @@ -3593,6 +3619,7 @@ <translation id="6251889282623539337">תנאים והגבלות של <ph name="DOMAIN" /></translation> <translation id="6251924700383757765">מדיניות פרטיות</translation> <translation id="6253586523465486793">מאלץ טעינה מחדש ללא אימות למפעיל משיכה לרענון (כשהסימון מושבת, מתבצעת טעינה מחדש רגילה עם אימות הקובץ השמור).</translation> +<translation id="6254182355913122230">זיכרון מוחלף</translation> <translation id="6254503684448816922">המפתח בסכנה</translation> <translation id="6259104249628300056">גילוי מכשירים ברשת המקומית שלך</translation> <translation id="6263082573641595914">גרסת רשות אישורים של Microsoft</translation> @@ -3612,7 +3639,7 @@ <translation id="6277105963844135994">תם הזמן הקצוב לתפוגה של הרשת</translation> <translation id="6277518330158259200">צלם מסך</translation> <translation id="6279183038361895380">הקש על |<ph name="ACCELERATOR" />| כדי להציג את הסמן</translation> -<translation id="6280215091796946657">היכנס עם חשבון אחר</translation> +<translation id="6280215091796946657">היכנס באמצעות חשבון אחר</translation> <translation id="6281743458679673853">ניסוי שמטרתו לגרום לכך שכל ממשקי ה-API ישקפו את אזור התצוגה של הפריסה. פעולה זו תהפוך את מאפייני window.scroll ליחסיים לאזור התצוגה של הפריסה.</translation> <translation id="6285120908535925801">{NUM_PRINTER,plural, =1{מדפסת חדשה ברשת שלך}two{מדפסות חדשות ברשת שלך}many{מדפסות חדשות ברשת שלך}other{מדפסות חדשות ברשת שלך}}</translation> <translation id="6285395082104474418">מגש הסטטוס מציג לך את המצב הנוכחי של הרשת, הסוללה ועוד.</translation> @@ -3863,6 +3890,7 @@ <translation id="6680028776254050810">החלף משתמשים</translation> <translation id="6681668084120808868">צלם תמונה</translation> <translation id="668171684555832681">אחר...</translation> +<translation id="6682083956260248340">קבע כיצד זה פועל ב<ph name="BEGIN_LINK" /></translation> <translation id="6686490380836145850">סגור את הכרטיסיות משמאל</translation> <translation id="6686817083349815241">שמור את הסיסמה שלך</translation> <translation id="6689514201497896398">עקיפת הבדיקות של מעורבות המשתמש</translation> @@ -3930,10 +3958,12 @@ <translation id="6798954102094737107">פלאגין: <ph name="PLUGIN_NAME" /></translation> <translation id="6802031077390104172"><ph name="USAGE" /> (<ph name="OID" />)</translation> <translation id="6804671422566312077">פתח את כל הסימניות ב&חלון חדש</translation> +<translation id="6805542829187142700">הפעל את מדיניות המכשיר לזיהוי אוטומטי של אזור זמן המערכת.</translation> <translation id="6805647936811177813">היכנס אל <ph name="TOKEN_NAME" /> כדי לייבא אישור לקוח מ-<ph name="HOST_NAME" />.</translation> <translation id="680572642341004180">הפעל מעקב RLZ ב-<ph name="SHORT_PRODUCT_OS_NAME" />.</translation> <translation id="6807889908376551050">הצג הכל...</translation> <translation id="6809448577646370871">מחזור חלונות בהתאמה אישית בשביל יישומי Chrome.</translation> +<translation id="6810613314571580006">היכנס באופן אוטומטי לאתרים באמצעות פרטי כניסה שמורים. כשהתכונה הזו מושבתת, תתבקש לאשר לפני כל כניסה לאתר.</translation> <translation id="6812349420832218321">לא ניתן להפעיל את <ph name="PRODUCT_NAME" /> בתור בסיס.</translation> <translation id="6812841287760418429">השאר שינויים</translation> <translation id="6814124696888326520">להחלפה קלה יותר של שיטות קלט ולקבלת גישה לתכונות קלט נוספות, לקלט קולי, לכתב יד ולאמוג'י.</translation> @@ -3949,7 +3979,7 @@ <translation id="6825883775269213504">רוסית</translation> <translation id="6827236167376090743">סרטון זה ימשיך לפעול ללא הפסקה.</translation> <translation id="6828153365543658583">הגבל כניסה של המשתמשים הבאים:</translation> -<translation id="6828434191343384461">הנתונים שבחרת הוסרו מ-Chrome והמכשירים המסונכרנים. ייתכן שעדיין תוכל לגשת לסוגים אחרים של היסטוריית גלישה בחשבון Google שלך בכתובת <ph name="BEGIN_LINK" />history.google.com<ph name="END_LINK" />, כמו חיפושים ופעילות משירותי Google אחרים.</translation> +<translation id="6828434191343384461">הנתונים שבחרת הוסרו מ-Chrome ומהמכשירים המסונכרנים. ייתכן שעדיין תוכל לגשת לסוגים אחרים של היסטוריית גלישה בחשבון Google שלך בכתובת <ph name="BEGIN_LINK" />history.google.com<ph name="END_LINK" />, כמו חיפושים ופעילות משירותי Google אחרים.</translation> <translation id="6828860976882136098">הגדרת עדכונים אוטומטיים לכל המשתמשים נכשלה (שגיאת קדם-הפעלה: <ph name="ERROR_NUMBER" />)</translation> <translation id="6829250331733125857">קבל עזרה בשביל ה-<ph name="DEVICE_TYPE" />.</translation> <translation id="6829270497922309893">הירשם לארגון שלך</translation> @@ -4118,6 +4148,7 @@ <translation id="7065534935986314333">על המערכת</translation> <translation id="7066944511817949584">נכשלה ההתחברות אל "<ph name="DEVICE_NAME" />".</translation> <translation id="7067725467529581407">לעולם אל תציג זאת שוב.</translation> +<translation id="7068609958927777019">אם אפשרות זו מופעלת, תוכל לדווח לחיפוש בטוח על כתובות אתרים בלתי הולמות.</translation> <translation id="7070804685954057874">קלט ישיר</translation> <translation id="7072010813301522126">שם קיצור הדרך</translation> <translation id="7072025625456903686">התר הכל או התאם אישית</translation> @@ -4183,10 +4214,10 @@ <translation id="7170467426996704624">תעתוק (salam → ሰላም)</translation> <translation id="7172053773111046550">מקלדת אסטונית</translation> <translation id="7173828187784915717">הגדרות קלט Chewing</translation> +<translation id="7173917244679555">נראה שאתה כבר מנהל משתמש עם השם הזה. האם רצית <ph name="BEGIN_LINK" />לייבא את <ph name="PROFILE_NAME" /> אל המכשיר הזה<ph name="END_LINK" />?</translation> <translation id="7175353351958621980">נטען מתוך:</translation> <translation id="7180611975245234373">רענן</translation> <translation id="7180865173735832675">התאם אישית</translation> -<translation id="7184428045150946911">השבת הסתרה אוטומטית של סרגל הכלים בטאבלטים גדולים</translation> <translation id="7185690883425432021">מסתיר את לחצני הסגירה בכרטיסיות לא פעילות כשסרגל הכרטיסיות במצב ערימה.</translation> <translation id="7186088072322679094">השאר בסרגל הכלים</translation> <translation id="719009910964971313">מקלדת US Programmer Dvorak</translation> @@ -4251,6 +4282,7 @@ <translation id="7280825545668757494">סנכרון פרטי כניסה ב-WiFi</translation> <translation id="7280877790564589615">התבקשה הרשאה</translation> <translation id="7282547042039404307">חלקה</translation> +<translation id="7284549674086796566">מפענח JavaScript ניסיוני</translation> <translation id="7287143125007575591">הגישה נדחתה.</translation> <translation id="7288592446024861651">הסימניות, ההיסטוריה, הסיסמאות והגדרות נוספות יסונכרנו עם חשבון Google שלך, כך שתוכל להשתמש בהם בכל המכשירים שלך. תוכל להגדיר מה לסנכרן ב-<ph name="BEGIN_LINK" /></translation> <translation id="7288676996127329262"><ph name="HORIZONTAL_DPI" />x<ph name="VERTICAL_DPI" /> dpi</translation> @@ -4273,6 +4305,7 @@ <translation id="7321545336522791733">השרת אינו נגיש</translation> <translation id="7325437708553334317">תוסף ניגודיות גבוהה</translation> <translation id="7326565110843845436">לחיצה בשלוש אצבעות על לוח המגע</translation> +<translation id="7327088014939803293">לא ניתן היה ליצור את המשתמש החדש בפיקוח. ודא שאתה מחובר כראוי למערכת ונסה שוב.</translation> <translation id="73289266812733869">לא נבחר</translation> <translation id="7329154610228416156">הכניסה נכשלה מפני שהוגדר שימוש בכתובת אתר לא מאובטחת (<ph name="BLOCKED_URL" />). צור קשר עם מנהל המערכת.</translation> <translation id="7331786426925973633">דפדפן שמיועד לעבודה מהירה, פשוטה ובטוחה</translation> @@ -4439,6 +4472,7 @@ <translation id="7573172247376861652">טעינת סוללה</translation> <translation id="7576032389798113292">6x4</translation> <translation id="7576690715254076113">אסוף</translation> +<translation id="7580671184200851182">השמע את אותו אודיו מכל הרמקולים (אודיו מונו)</translation> <translation id="7581279002575751816">יישומי פלאגין מסוג NPAPI אינם נתמכים.</translation> <translation id="7581462281756524039">כלי לניקוי</translation> <translation id="7582582252461552277">העדף רשת זו</translation> @@ -4671,6 +4705,7 @@ <translation id="7925686952655276919">אין להשתמש בנתונים ניידים עבור סנכרון</translation> <translation id="7926906273904422255">סמן מקורות לא מאובטחים כ'לא מאובטחים' או כ'מפוקפקים'.</translation> <translation id="7928710562641958568">הוצא את המכשיר</translation> +<translation id="79312157130859720"><ph name="APP_NAME" /> משתף את המסך והאודיו שלך.</translation> <translation id="7938594894617528435">לא מקוונת כעת</translation> <translation id="7939374455203157513">הפעלת שירותי ענן</translation> <translation id="7939412583708276221">שמור בכל מקרה</translation> @@ -5084,7 +5119,7 @@ <translation id="8545211332741562162">מאפשר לדפי אינטרנט להשתמש בתכונות ניסיוניות של JavaScript.</translation> <translation id="8545575359873600875">מצטערים, לא ניתן לאמת את הסיסמה שלך. ייתכן שהמנהל של המשתמש בפיקוח שינה את הסיסמה לאחרונה. במצב כזה הסיסמה החדשה תחול בפעם הבאה שתבצע כניסה. נסה להשתמש בסיסמה הישנה שלך.</translation> <translation id="8546306075665861288">קובץ תמונה שמור</translation> -<translation id="854653344619327455">כשהסימון הזה פועל, החלון לבחירה של שיתוף שולחן העבודה לא יאפשר למשתמש לבחור האם לשתף אודיו.</translation> +<translation id="854653344619327455">כשהסימון הזה פועל, החלון לבחירה של שיתוף שולחן העבודה לא יאפשר למשתמש לבחור אם לשתף אודיו.</translation> <translation id="8546541260734613940">[*.]example.com</translation> <translation id="8548973727659841685">תו</translation> <translation id="855081842937141170">הצמד כרטיסייה</translation> @@ -5105,6 +5140,7 @@ <translation id="8571108619753148184">שרת 4</translation> <translation id="8572832761467613633">Flash בלבד</translation> <translation id="8572981282494768930">אל תאפשר לאתרים לגשת למצלמה ולמיקרופון</translation> +<translation id="8574234089711453001">התר הצגה של לחצן הורדה בעת פתיחת דף עם כתובת אתר של מדיה.</translation> <translation id="857779305329188634">הפעל תמיכה בפרוטוקול QUIC ניסיוני.</translation> <translation id="8579285237314169903">מבצע סנכרון ל-<ph name="NUMBER_OF_FILES" /> פריטים...</translation> <translation id="8579549103199280730">שאל כברירת מחדל</translation> @@ -5160,6 +5196,7 @@ <translation id="8656768832129462377">אל תבדוק</translation> <translation id="8656946437567854031">בלחיצה על 'המשך', אתה מביע הסכמה ל<ph name="LEGAL_DOC_LINK_TEXT_1" />, <ph name="LEGAL_DOC_LINK_TEXT_2" />, <ph name="LEGAL_DOC_LINK_TEXT_3" />, <ph name="LEGAL_DOC_LINK_TEXT_4" />,<ph name="LEGAL_DOC_LINK_TEXT_5" /> ול<ph name="LEGAL_DOC_LINK_TEXT_6" />.</translation> <translation id="8658595122208653918">שנה אפשרויות מדפסת...</translation> +<translation id="8658645149275195032"><ph name="APP_NAME" /> משתף את המסך והאודיו שלך עם <ph name="TAB_NAME" />.</translation> <translation id="8659716501582523573">כתובת IP:</translation> <translation id="8661290697478713397">פתח קישור בחלון &נסתר</translation> <translation id="8662795692588422978">אנשים</translation> @@ -5246,7 +5283,7 @@ <translation id="8757640015637159332">היכנס לפעילות ציבורית באתר</translation> <translation id="8757742102600829832">מחר Chromebox שאליו ברצונך להתחבר</translation> <translation id="8757803915342932642">מכשיר ב-Google Cloud Devices</translation> -<translation id="8758895886513993540">הסימון הזה קובע האם משתמשים יכולים לבחור כרטיסייה בשיתוף של שולחן עבודה.</translation> +<translation id="8758895886513993540">הסימון הזה קובע אם משתמשים יכולים לבחור כרטיסייה בשיתוף של שולחן עבודה.</translation> <translation id="8759408218731716181">לא ניתן להגדיר כניסה עם מספר חשבונות</translation> <translation id="8759753423332885148">למידע נוסף</translation> <translation id="8761567432415473239">גלישה בטוחה של Google <ph name="BEGIN_LINK" />איתרה לאחרונה תוכניות מזיקות<ph name="END_LINK" /> באתר <ph name="SITE" />.</translation> @@ -5365,6 +5402,7 @@ <translation id="8942416694471994740">הגישה למיקרופון שלך נשלטת על ידי מנהל המערכת שלך.</translation> <translation id="894360074127026135">הגברה בינלאומית של Netscape</translation> <translation id="8944779739948852228">אותרה מדפסת</translation> +<translation id="8944964446326379280"><ph name="APP_NAME" /> משתף חלון עם <ph name="TAB_NAME" />.</translation> <translation id="8946359700442089734">תכונות לניפוי באגים לא הופעלו באופן מלא במכשיר <ph name="IDS_SHORT_PRODUCT_NAME" /> זה.</translation> <translation id="8946784827990177241">הפעל תמיכה ב-WebUSB.</translation> <translation id="89515141420106838">מפעיל את הגלריה של חנות האינטרנט של Chrome למנהלי התקן למדפסות. היישום מחפש בחנות האינטרנט של Chrome תוספים שתומכים בהדפסה למדפסת USB עם מזהה USB ספציפי.</translation> @@ -5383,6 +5421,7 @@ <translation id="8965037249707889821">הזן את הסיסמה הישנה</translation> <translation id="8965697826696209160">אין מספיק שטח.</translation> <translation id="8968527460726243404">כותב תמונת המערכת של מערכת ההפעלה של Chrome</translation> +<translation id="8970203673128054105">הצג רשימה של מצבי העברה</translation> <translation id="89720367119469899">Esc</translation> <translation id="8972513834460200407">פנה אל מנהל המערכת של הרשת שלך כדי לוודא שחומת האש אינה חוסמת הורדות משרתי Google.</translation> <translation id="8974161578568356045">אתר באופן אוטומטי</translation> @@ -5410,6 +5449,7 @@ <translation id="9011178328451474963">הכרטיסייה האחרונה</translation> <translation id="9013284500811652791"><ph name="UWS_NAME" />, <ph name="UWS_NAME" /> ואחת נוספת</translation> <translation id="9013587737291179248">אופס! לא הייתה אפשרות לייבא את המשתמש בפיקוח. בדוק את השטח הפנוי בכונן הקשיח ואת ההרשאות שלך ונסה שוב.</translation> +<translation id="901440679911238150">פרטי החשבון שלך לא עדכניים. <ph name="BEGIN_LINK" />היכנס שוב<ph name="END_LINK" />.</translation> <translation id="9014987600015527693">הצג טלפון אחר</translation> <translation id="9015601075560428829">קלט דיבור</translation> <translation id="9016164105820007189">מתחבר אל "<ph name="DEVICE_NAME" />".</translation> @@ -5423,6 +5463,7 @@ <translation id="9025098623496448965">בסדר, החזר אותי למסך הכניסה</translation> <translation id="902638246363752736">הגדרות מקלדת</translation> <translation id="9026731007018893674">הורד</translation> +<translation id="9027146684281895941">השתמש בחשבון Google שלך כדי לפקח על המשתמש הזה על מנת לשלוט באתרים שבהם הוא מבקר ולהציג אותם.</translation> <translation id="9027459031423301635">פתח קישור בכרטיסייה &חדשה</translation> <translation id="9027603907212475920">הגדר סנכרון...</translation> <translation id="9033453977881595182">מזהה אסימון</translation> @@ -5537,6 +5578,7 @@ <translation id="9203478404496196495">בטל השתקת כרטיסייה</translation> <translation id="9203962528777363226">מנהל המערכת של מכשיר זה השבית את ההוספה של משתמשים חדשים</translation> <translation id="9205143043463108573">ממקם את מפעיל היישומים במרכז המסך עם יחס של מסך לרוחב.</translation> +<translation id="9205160891051296441">תמיכה במדיניות SystemTimezoneAutomaticDetection</translation> <translation id="9206487995878691001">שיטת קלט Cangjie</translation> <translation id="9207194316435230304">ATOK</translation> <translation id="9208886416788010685">Adobe Reader לא מעודכן</translation> @@ -5558,6 +5600,7 @@ <translation id="939736085109172342">תיקייה חדשה</translation> <translation id="940425055435005472">גודל גופן:</translation> <translation id="941543339607623937">מפתח פרטי לא חוקי.</translation> +<translation id="942532530371314860"><ph name="APP_NAME" /> משתף כרטיסייה ואודיו של Chrome.</translation> <translation id="942954117721265519">אין תמונות בספריה הזו.</translation> <translation id="945522503751344254">שלח משוב</translation> <translation id="946810925362320585">פעל בהתאם להמלצה</translation>
diff --git a/chrome/app/resources/generated_resources_ja.xtb b/chrome/app/resources/generated_resources_ja.xtb index 6668bf55..b6a8f1b 100644 --- a/chrome/app/resources/generated_resources_ja.xtb +++ b/chrome/app/resources/generated_resources_ja.xtb
@@ -662,7 +662,6 @@ <translation id="1962233722219655970">このページは、お使いのパソコンでは動作しないネイティブ クライアント アプリを使用しています。</translation> <translation id="1965328510789761112">専有メモリ</translation> <translation id="1965624977906726414">特別な権限はありません。</translation> -<translation id="1968720524450620475">ウェブ通知の操作アイコンを有効にする。</translation> <translation id="1970746430676306437">ページ情報を表示(&I)</translation> <translation id="197288927597451399">保存</translation> <translation id="1973491249112991739"><ph name="PLUGIN_NAME" /> のダウンロードに失敗しました。</translation> @@ -1424,7 +1423,6 @@ <translation id="302014277942214887">アプリケーション ID またはウェブストアの URL を入力します。</translation> <translation id="3020616530769498629">「スクロールして更新」で検証なし再読み込みを有効にする</translation> <translation id="3020990233660977256">シリアル番号: <ph name="SERIAL_NUMBER" /></translation> -<translation id="3021245547458004908">有効にした場合、画面の最小解像度が 800 dp 以上の端末ではスクロール中もツールバーが表示されたままになります。ただし、ページのコンテンツを全画面表示にした場合はツールバーは非表示になります。</translation> <translation id="3021678814754966447">フレームのソースを表示(&V)</translation> <translation id="3024374909719388945">24 時間形式を使用する</translation> <translation id="3025022340603654002">フォーム要素で最初にマウスがクリックされたときに自動入力の候補を表示します。</translation> @@ -1495,7 +1493,6 @@ <translation id="3117812041123364382">フローティング仮想キーボードを有効または無効にします。</translation> <translation id="3118319026408854581"><ph name="PRODUCT_NAME" /> ヘルプ</translation> <translation id="3120430004221004537">「<ph name="DEVICE_NAME" />」で、指定された操作に必要な暗号化が行われていません。</translation> -<translation id="3121260210578524273">操作ボタンでウェブ通知のアイコンを有効にする</translation> <translation id="3121793941267913344">この <ph name="IDS_SHORT_PRODUCT_NAME" /> 搭載デバイスをリセットします</translation> <translation id="3122162841865761901">デベロッパー ツールの試験運用版機能</translation> <translation id="3122464029669770682">CPU</translation> @@ -2277,6 +2274,7 @@ <translation id="421017592316736757">このファイルにアクセスするには、オンライン接続が必要です。</translation> <translation id="421182450098841253">ブックマーク バーを表示(&S)</translation> <translation id="4212108296677106246">「<ph name="CERTIFICATE_NAME" />」を認証局として信頼しますか?</translation> +<translation id="42126664696688958">エクスポート</translation> <translation id="42137655013211669">このリソースへのアクセスはサーバーにより禁止されています。</translation> <translation id="4215350869199060536">名前に間違った記号が含まれています。</translation> <translation id="4215898373199266584">次回からシークレット モード(<ph name="INCOGNITO_MODE_SHORTCUT" />)をおすすめします。</translation> @@ -3309,7 +3307,6 @@ <translation id="577322787686508614">「<ph name="DEVICE_NAME" />」での読み取り操作は許可されていません。</translation> <translation id="5774295353725270860">ファイルのアプリを開く</translation> <translation id="5774515636230743468">マニフェスト:</translation> -<translation id="5776006986202016118">このサイトの接続先:</translation> <translation id="577624874850706961">Cookie を検索</translation> <translation id="5778550464785688721">MIDI デバイスのフル コントロール</translation> <translation id="5780066559993805332">(最良)</translation> @@ -4199,7 +4196,6 @@ <translation id="7175353351958621980">ロード元:</translation> <translation id="7180611975245234373">更新</translation> <translation id="7180865173735832675">カスタマイズ</translation> -<translation id="7184428045150946911">大型タブレットでツールバーの自動非表示を無効にする</translation> <translation id="7185690883425432021">タブバーがスタックモードのときに、アクティブでないタブの [閉じる] ボタンを非表示にします。</translation> <translation id="7186088072322679094">ツールバーに残す</translation> <translation id="719009910964971313">US Programmer Dvorak キーボード</translation>
diff --git a/chrome/app/resources/generated_resources_kn.xtb b/chrome/app/resources/generated_resources_kn.xtb index 9e33745..2ed177b 100644 --- a/chrome/app/resources/generated_resources_kn.xtb +++ b/chrome/app/resources/generated_resources_kn.xtb
@@ -662,7 +662,6 @@ <translation id="1962233722219655970">ನಿಮ್ಮ ಕಂಪ್ಯೂಟರ್ನಲ್ಲಿ ಕಾರ್ಯನಿರ್ವಹಿಸದೇ ಇರುವಂತಹ ಸ್ಥಳೀಯ ಕ್ಲೈಂಟ್ ಅಪ್ಲಿಕೇಶನ್ ಅನ್ನು ಈ ಪುಟವು ಬಳಸುತ್ತದೆ.</translation> <translation id="1965328510789761112">ಖಾಸಗಿ ಸ್ಮರಣೆ</translation> <translation id="1965624977906726414">ಯಾವುದೇ ವಿಶೇಷ ಅನುಮತಿಗಳನ್ನು ಹೊಂದಿಲ್ಲ.</translation> -<translation id="1968720524450620475">ವೆಬ್ ಅಧಿಸೂಚನೆಗಳಿಗೆ ಕ್ರಿಯೆ ಐಕಾನ್ಗಳನ್ನು ಸಕ್ರಿಯಗೊಳಿಸಿ.</translation> <translation id="1970746430676306437">ಪುಟ &ಮಾಹಿತಿಯನ್ನು ವೀಕ್ಷಿಸಿ</translation> <translation id="197288927597451399">ಇರಿಸಿ</translation> <translation id="1973491249112991739"><ph name="PLUGIN_NAME" /> ಡೌನ್ಲೋಡ್ ವಿಫಲಗೊಂಡಿದೆ.</translation> @@ -1424,7 +1423,6 @@ <translation id="302014277942214887">ಅಪ್ಲಿಕೇಶನ್ ಐಡಿ ಅಥವಾ ವೆಬ್ಅಂಗಡಿ URL ನಮೂದಿಸಿ.</translation> <translation id="3020616530769498629">ರಿಫ್ರೆಶ್-ಮಾಡಲು ಎಳೆದಾಗ ಪ್ರಮಾಣೀಕರಿಸದ ರಿಲೋಡ್ ಸಕ್ರಿಯಗೊಳಿಸಿ</translation> <translation id="3020990233660977256">ಕ್ರಮ ಸಂಖ್ಯೆ: <ph name="SERIAL_NUMBER" /></translation> -<translation id="3021245547458004908">ಸಕ್ರಿಯಗೊಳಿಸಿದಾಗ, ಸಾಧನಗಳಲ್ಲಿನ ಸ್ಕ್ರಾಲಿಂಗ್ನಿಂದಾಗಿ ಕನಿಷ್ಟ ಪರದೆ ಡಿಪಿ >= 800 ಮೂಲಕ ಪರಿಕರಪಟ್ಟಿಯನ್ನು ಎಂದಿಗೂ ಮರೆಮಾಡಲಾಗುವುದಿಲ್ಲ. ಪುಟದ ವಿಷಯಗಳು ಪೂರ್ಣಪರದೆಗೆ ಹೋದರೆ ಅದನ್ನು ಈಗಲೂ ಮರೆ ಮಾಡಲಾಗುತ್ತದೆ.</translation> <translation id="3021678814754966447">ಫ್ರೇಮ್ ಮೂಲವನ್ನು &ವೀಕ್ಷಿಸಿ</translation> <translation id="3024374909719388945">24-ಗಂಟೆಯ ಕ್ಲಾಕ್ ಬಳಸಿ</translation> <translation id="3025022340603654002">ಫಾರ್ಮ್ ಅಂಶಗಳ ಮೇಲೆ ಪ್ರಾರಂಭಿಕ ಮೌಸ್ ಕ್ಲಿಕ್ ಕುರಿತು ಸ್ವಯಂತುಂಬುವಿಕೆ ಸಲಹೆಗಳನ್ನ ಮಾಡಿ.</translation> @@ -1495,7 +1493,6 @@ <translation id="3117812041123364382">ಫ್ಲೋಟಿಂಗ್ ವರ್ಚುವಲ್ ಕೀಬೋರ್ಡ್ ಅನ್ನು ಸಕ್ರಿಯಗೊಳಿಸಿ/ನಿಷ್ಕ್ರಿಯಗೊಳಿಸಿ.</translation> <translation id="3118319026408854581"><ph name="PRODUCT_NAME" /> ಸಹಾಯ</translation> <translation id="3120430004221004537">ನೀಡಿರುವ ಕಾರ್ಯಾಚರಣೆಗೆ ಈ ಸಾಧನದಲ್ಲಿ ಎನ್ಕ್ರಿಪ್ಶನ್ ಸಾಕಷ್ಟಿಲ್ಲ: "<ph name="DEVICE_NAME" />".</translation> -<translation id="3121260210578524273">ವೆಬ್ ಅಧಿಸೂಚನೆಗಳಿಗೆ ಕ್ರಿಯೆ ಬಟನ್ಗಳಲ್ಲಿ ಐಕಾನ್ಗಳನ್ನು ಸಕ್ರಿಯಗೊಳಿಸಿ.</translation> <translation id="3121793941267913344">ಈ <ph name="IDS_SHORT_PRODUCT_NAME" /> ಸಾಧನವನ್ನು ಮರುಹೊಂದಿಸಿ</translation> <translation id="3122162841865761901">ಡೆವಲಪರ್ ಪರಿಕರಗಳ ಪ್ರಯೋಗಗಳು</translation> <translation id="3122464029669770682">CPU</translation> @@ -2275,6 +2272,7 @@ <translation id="421017592316736757">ಈ ಫೈಲ್ ಅನ್ನು ಪ್ರವೇಶಿಸಲು ನೀವು ಆನ್ಲೈನ್ನಲ್ಲಿರಬೇಕು.</translation> <translation id="421182450098841253">&ಬುಕ್ಮಾರ್ಕ್ಗಳ ಪಟ್ಟಿಯನ್ನು ತೋರಿಸಿ</translation> <translation id="4212108296677106246">ಪ್ರಮಾಣೀಕರಣದ ಪ್ರಾಧಿಕಾರದಂತೆ "<ph name="CERTIFICATE_NAME" />" ರ ಮೇಲೆ ವಿಶ್ವಾಸವಿಡಲು ಬಯಸುತ್ತೀರಾ?</translation> +<translation id="42126664696688958">ರಫ್ತು</translation> <translation id="42137655013211669">ಈ ಸಂಪನ್ಮೂಲಕ್ಕೆ ಪ್ರವೇಶವನ್ನು ಸರ್ವರ್ ಮೂಲಕ ನಿಷೇಧಿಸಲಾಗಿದೆ.</translation> <translation id="4215350869199060536">ಓಹ್, ಹೆಸರಿನಲ್ಲಿ ಅಕ್ರಮ ಸಂಕೇತಗಳಿವೆ!</translation> <translation id="4215898373199266584">ಛೆ! ಅಜ್ಞಾತ ಮೋಡ್ (<ph name="INCOGNITO_MODE_SHORTCUT" />) ಮುಂದಿನ ಬಾರಿ ಕೈಗೆಟಕುವಂತಿರಬಹುದು.</translation> @@ -3311,7 +3309,6 @@ <translation id="577322787686508614">ಈ ಸಾಧನದಲ್ಲಿ ಓದುವಿಕೆ ಕಾರ್ಯಾಚರಣೆಯನ್ನು ಅನುಮತಿಸಲಾಗಿಲ್ಲ: "<ph name="DEVICE_NAME" />".</translation> <translation id="5774295353725270860">ಫೈಲ್ಗಳ ಅಪ್ಲಿಕೇಶನ್ ಅನ್ನು ತೆರೆಯಿರಿ</translation> <translation id="5774515636230743468">ಮ್ಯಾನಿಫೆಸ್ಟ್:</translation> -<translation id="5776006986202016118">ಈ ಸೈಟ್ ಇದಕ್ಕೆ ಸಂಪರ್ಕಿಸಲು ಬಯಸುತ್ತದೆ:</translation> <translation id="577624874850706961">ಕುಕೀಗಳನ್ನು ಹುಡುಕಿ</translation> <translation id="5778550464785688721">MIDI ಸಾಧನಗಳು ಸಂಪೂರ್ಣ ನಿಯಂತ್ರಣ</translation> <translation id="5780066559993805332">(ಅತ್ಯುತ್ತಮ)</translation> @@ -4201,7 +4198,6 @@ <translation id="7175353351958621980">ಇದರಿಂದ ಲೋಡ್ ಮಾಡಲಾಗಿದೆ:</translation> <translation id="7180611975245234373">ರೀಫ್ರೆಶ್ ಮಾಡಿ</translation> <translation id="7180865173735832675">ಕಸ್ಟಮೈಸ್</translation> -<translation id="7184428045150946911">ದೊಡ್ಡ ಟ್ಯಾಬ್ಲೆಟ್ಗಳಲ್ಲಿ ಸ್ವಯಂ-ಮರೆಮಾಡುವ ಪರಿಕರಪಟ್ಟಿಯನ್ನು ನಿಷ್ಕ್ರಿಯಗೊಳಿಸಿ</translation> <translation id="7185690883425432021">ಸ್ಟ್ಯಾಕ್ ಮಾಡಲಾದ ಮೋಡ್ನಲ್ಲಿ ಟ್ಯಾಬ್ಸ್ಟ್ರಿಪ್ ಇರುವಾಗ ನಿಷ್ಕ್ರಿಯ ಟ್ಯಾಬ್ಗಳ ಮುಚ್ಚುವ ಬಟನ್ಗಳನ್ನು ಮರೆಮಾಡುತ್ತದೆ.</translation> <translation id="7186088072322679094">ಪರಿಕರಪಟ್ಟಿಯಲ್ಲಿ ಇರಿಸು</translation> <translation id="719009910964971313">US ಪ್ರೊಗ್ರಾಮರ್ ಡಿವೊರಾಕ್ ಕೀಬೋರ್ಡ್</translation> @@ -5104,7 +5100,7 @@ <translation id="8545211332741562162">ಪ್ರಾಯೋಗಿಕ JavaScript ವೈಶಿಷ್ಟ್ಯಗಳನ್ನು ಬಳಸಲು ವೆಬ್ ಪುಟಗಳನ್ನು ಸಕ್ರಿಯಗೊಳಿಸಿ.</translation> <translation id="8545575359873600875">ಕ್ಷಮಿಸಿ, ನಿಮ್ಮ ಪಾಸ್ವರ್ಡ್ ಅನ್ನು ಪರಿಶೀಲಿಸಲು ಸಾಧ್ಯವಾಗಲಿಲ್ಲ. ಈ ಮೇಲ್ವಿಚಾರಣೆ ಬಳಕೆದಾರರ ನಿರ್ವಾಹಕರು ಬಹುಃಶ ಇತ್ತೀಚಿಗೆ ಪಾಸ್ವರ್ಡ್ ಅನ್ನು ಬದಲಾಯಿಸಿರಬಹುದು. ಹಾಗಿದ್ದರೆ, ಹೊಸ ಪಾಸ್ವರ್ಡ್ ಅನ್ನು ನೀವು ಮುಂದಿನ ಬಾರಿ ಸೈನ್ ಇನ್ ಮಾಡುವಾಗ ಅನ್ವಯವಾಗುತ್ತದೆ. ನಿಮ್ಮ ಹಳೆಯ ಪಾಸ್ವರ್ಡ್ ಬಳಸಲು ಪ್ರಯತ್ನಿಸಿ.</translation> <translation id="8546306075665861288">ಇಮೇಜ್ ಸಂಗ್ರಹ</translation> -<translation id="854653344619327455">ಈ ಫ್ಲ್ಯಾಗ್ ಆನ್ ಆಗಿರುವುದರೊಂದಿಗೆ, ಆಡಿಯೋವನ್ನು ಹಂಚಿಕೊಳ್ಳಬೇಕೇ ಎಂಬ ಆಯ್ಕೆಯನ್ನು ಆರಿಸಿಕೊಳ್ಳಲು ಬಳಕೆದಾರರಿಗೆ ಡೆಸ್ಕ್ಟಾಪ್ ಹಂಚಿಕೆ ಪಿಕರ್ ವಿಂಡೋ ಅನುಮತಿಸುವುದಿಲ್ಲ.</translation> +<translation id="854653344619327455">ಈ ಫ್ಲ್ಯಾಗ್ ಆನ್ ಆಗಿರುವುದರಿಂದ, ಆಡಿಯೋವನ್ನು ಹಂಚಿಕೊಳ್ಳಬೇಕೇ ಎಂಬ ಆಯ್ಕೆಯನ್ನು ಆರಿಸಿಕೊಳ್ಳಲು ಬಳಕೆದಾರರಿಗೆ ಡೆಸ್ಕ್ಟಾಪ್ ಹಂಚಿಕೆ ಪಿಕರ್ ವಿಂಡೋ ಅನುಮತಿಸುವುದಿಲ್ಲ.</translation> <translation id="8546541260734613940">[*.]example.com</translation> <translation id="8548973727659841685">ಅಕ್ಷರ</translation> <translation id="855081842937141170">ಪಿನ್ ಟ್ಯಾಬ್</translation>
diff --git a/chrome/app/resources/generated_resources_ko.xtb b/chrome/app/resources/generated_resources_ko.xtb index 7067b16..8d08fb9 100644 --- a/chrome/app/resources/generated_resources_ko.xtb +++ b/chrome/app/resources/generated_resources_ko.xtb
@@ -662,7 +662,6 @@ <translation id="1962233722219655970">이 페이지에서 사용자 컴퓨터에서 작동하지 않는 Native Client 앱을 사용합니다.</translation> <translation id="1965328510789761112">개별 메모리</translation> <translation id="1965624977906726414">특별한 권한이 필요하지 않습니다.</translation> -<translation id="1968720524450620475">웹 알림에 작업 아이콘 사용</translation> <translation id="1970746430676306437">페이지 정보 보기(&I)</translation> <translation id="197288927597451399">계속</translation> <translation id="1973491249112991739"><ph name="PLUGIN_NAME" />을(를) 다운로드하지 못했습니다.</translation> @@ -1156,7 +1155,7 @@ <translation id="267285457822962309">사용 중인 기기와 주변 기기에 대한 설정을 변경합니다.</translation> <translation id="2673135533890720193">인터넷 사용 기록 확인</translation> <translation id="2673589024369449924">이 사용자에 대한 바로가기를 바탕화면에 표시합니다.</translation> -<translation id="2675358154061544447">별도의 프로세스에서 교차 사이트 iframe 렌더링에 실험 단계의 지원을 제공합니다. 이 모드에서는 같은 웹사이트의 문서인 경우에만 렌더러 프로세스를 공유합니다.</translation> +<translation id="2675358154061544447">별도의 프로세스를 통해 교차 사이트 iframe 렌더링에 실험 단계의 지원을 제공합니다. 이 모드에서는 같은 웹사이트의 문서인 경우에만 렌더러 프로세스를 공유합니다.</translation> <translation id="2676946222714718093">재생 중:</translation> <translation id="2678063897982469759">다시 사용</translation> <translation id="2678246812096664977">모든 플러그인</translation> @@ -1425,7 +1424,6 @@ <translation id="302014277942214887">애플리케이션 ID 또는 웹 스토어 URL을 입력하세요.</translation> <translation id="3020616530769498629">당겨서 새로고침 시 비검증 새로고침 사용</translation> <translation id="3020990233660977256">일련번호: <ph name="SERIAL_NUMBER" /></translation> -<translation id="3021245547458004908">사용 설정하면 화면 dp가 800 이상인 기기에서 스크롤해도 툴바가 숨겨지지 않으며 페이지 콘텐츠가 전체화면으로 표시되는 경우에는 숨겨집니다.</translation> <translation id="3021678814754966447">프레임 소스 보기(&V)</translation> <translation id="3024374909719388945">24시간 단위 사용</translation> <translation id="3025022340603654002">양식 요소를 처음 마우스로 클릭하면 권장 항목이 자동완성됩니다.</translation> @@ -1496,7 +1494,6 @@ <translation id="3117812041123364382">플로팅 가상 키보드를 사용 설정/사용 중지합니다.</translation> <translation id="3118319026408854581"><ph name="PRODUCT_NAME" /> 도움말</translation> <translation id="3120430004221004537">기기(<ph name="DEVICE_NAME" />)에서 해당 작업에 필요한 암호화가 수행되지 않았습니다.</translation> -<translation id="3121260210578524273">웹 알림에 작업 버튼의 아이콘을 사용합니다.</translation> <translation id="3121793941267913344"><ph name="IDS_SHORT_PRODUCT_NAME" /> 기기 재설정</translation> <translation id="3122162841865761901">개발자 도구 실험</translation> <translation id="3122464029669770682">CPU</translation> @@ -2277,6 +2274,7 @@ <translation id="421017592316736757">이 파일에 액세스하려면 온라인 상태여야 합니다.</translation> <translation id="421182450098841253">북마크바 표시(&S)</translation> <translation id="4212108296677106246">'<ph name="CERTIFICATE_NAME" />'을(를) 인증 기관으로 신뢰하시겠습니까?</translation> +<translation id="42126664696688958">내보내기</translation> <translation id="42137655013211669">서버에서 이 리소스에 대한 액세스를 금지했습니다.</translation> <translation id="4215350869199060536">이름에 사용할 수 없는 기호가 포함되어 있습니다.</translation> <translation id="4215898373199266584">다음에는 시크릿 모드(<ph name="INCOGNITO_MODE_SHORTCUT" />)를 사용해 보세요.</translation> @@ -2803,7 +2801,7 @@ <translation id="5062930723426326933">로그인하지 못했습니다. 인터넷에 연결한 후 다시 시도하세요.</translation> <translation id="5063180925553000800">새 PIN:</translation> <translation id="5067867186035333991"><ph name="HOST" />에서 마이크에 액세스하려는 경우 메시지 표시</translation> -<translation id="5068918910148307423">최근에 닫은 사이트에서 데이터 전송 및 수신을 완료하도록 허용하지 않음</translation> +<translation id="5068918910148307423">최근에 닫은 사이트에서 데이터 전송 및 수신을 완료하는 것을 허용하지 않음</translation> <translation id="507075806566596212">Google에 <ph name="DEVICE_TYPE" />을(를) 등록하면 기기를 원격으로 찾고, 기기의 데이터를 삭제하고, 기기를 잠그는 기능을 사용할 수 있습니다. 등록한 후에는 재부팅해야 합니다. 계속하시겠습니까?</translation> <translation id="5072836811783999860">관리 북마크 표시</translation> <translation id="5074318175948309511">새로운 설정을 적용하기 전에 페이지를 다시 로드해야 할 수도 있습니다.</translation> @@ -3309,7 +3307,6 @@ <translation id="577322787686508614">기기(<ph name="DEVICE_NAME" />)에서 읽기 작업이 허용되지 않습니다.</translation> <translation id="5774295353725270860">파일 열기 앱</translation> <translation id="5774515636230743468">매니페스트:</translation> -<translation id="5776006986202016118">이 사이트에서 연결할 항목:</translation> <translation id="577624874850706961">쿠키 검색</translation> <translation id="5778550464785688721">MIDI 기기 전체 제어</translation> <translation id="5780066559993805332">(최고 해상도)</translation> @@ -4202,7 +4199,6 @@ <translation id="7175353351958621980">로드 위치:</translation> <translation id="7180611975245234373">새로고침</translation> <translation id="7180865173735832675">맞춤설정</translation> -<translation id="7184428045150946911">대형 태블릿에서 툴바 자동 숨김 사용 중지</translation> <translation id="7185690883425432021">탭 스트림이 겹침 모드일 때 비활성 탭의 닫기 버튼을 숨깁니다.</translation> <translation id="7186088072322679094">툴바에 보관</translation> <translation id="719009910964971313">US 프로그래머 드보락 키보드</translation> @@ -5023,7 +5019,7 @@ <translation id="839736845446313156">등록</translation> <translation id="8398790343843005537">휴대전화 찾기</translation> <translation id="8398877366907290961">무시하고 계속하기</translation> -<translation id="8399276228600040370"><ph name="PASSWORD_MANAGER_BRAND" />(으)로 저장된 계정으로 로그인</translation> +<translation id="8399276228600040370"><ph name="PASSWORD_MANAGER_BRAND" />(으)로 저장된 계정에 로그인</translation> <translation id="8401363965527883709">확인란 선택 안함</translation> <translation id="8408402540408758445">검색결과 미리 가져오기</translation> <translation id="8410073653152358832">이 휴대전화 사용</translation> @@ -5272,7 +5268,7 @@ <translation id="8757640015637159332">공개 세션 시작하기</translation> <translation id="8757742102600829832">연결할 Chromebox 선택</translation> <translation id="8757803915342932642">Google 클라우드 기기에서 사용하는 기기</translation> -<translation id="8758895886513993540">이 플래그는 사용자에게 데스크톱 공유를 위해 탭을 선택할 수 있도록 허용할지를 관리합니다.</translation> +<translation id="8758895886513993540">이 플래그는 사용자가 데스크톱 공유를 위해 탭을 선택하는 것을 허용할지 여부를 관리합니다.</translation> <translation id="8759408218731716181">멀티 로그인을 설정할 수 없음</translation> <translation id="8759753423332885148">자세히 알아보기</translation> <translation id="8761567432415473239">Google 세이프 브라우징 결과 <ph name="SITE" />에서 최근 <ph name="BEGIN_LINK" />악성 프로그램이 발견<ph name="END_LINK" />되었습니다.</translation>
diff --git a/chrome/app/resources/generated_resources_lt.xtb b/chrome/app/resources/generated_resources_lt.xtb index 2b2181f..b5a8ad4 100644 --- a/chrome/app/resources/generated_resources_lt.xtb +++ b/chrome/app/resources/generated_resources_lt.xtb
@@ -661,7 +661,6 @@ <translation id="1962233722219655970">Šiame puslapyje naudojama programa „Native Client“, kuri neveikia jūsų kompiuteryje.</translation> <translation id="1965328510789761112">Privati atmintis</translation> <translation id="1965624977906726414">Nėra specialių leidimų.</translation> -<translation id="1968720524450620475">Įgalinti žiniatinklio pranešimų veiksmų piktogramas.</translation> <translation id="1970746430676306437">Rodyti puslapio &informaciją</translation> <translation id="197288927597451399">Palikti</translation> <translation id="1973491249112991739">Nepavyko atsisiųsti „<ph name="PLUGIN_NAME" />“.</translation> @@ -1424,7 +1423,6 @@ <translation id="302014277942214887">Įveskite programos ID arba žiniatinklio parduotuvės URL.</translation> <translation id="3020616530769498629">Įgalinti nepatvirtinantį įkėlimą iš naujo, kai patraukiama norint atnaujinti</translation> <translation id="3020990233660977256">Serijos numeris: <ph name="SERIAL_NUMBER" /></translation> -<translation id="3021245547458004908">Įgalinus šią parinktį įrankių juosta niekada nebus paslėpta slenkant įrenginiuose, kurių ekrano tankis ne mažesnis nei 800 taškų colyje. Ji vis tiek bus paslėpta, jei puslapio turinys bus pateiktas viso ekrano režimu.</translation> <translation id="3021678814754966447">&Žiūrėti rėmelio šaltinį</translation> <translation id="3024374909719388945">Naudoti 24 val. laikrodį</translation> <translation id="3025022340603654002">Automatinio pildymo pasiūlymai bus teikiami pirmą kartą spustelėjus formos elementą pele.</translation> @@ -1435,13 +1433,13 @@ <translation id="302781076327338683">Iš naujo įkelti talpyklos apėjimą</translation> <translation id="3030243755303701754">Prižiūrimas naudotojas gali naršyti žiniatinklį su jūsų priežiūra. Jei esate prižiūrimo naudotojo valdytojas „Chrome“, galite: - • leisti arba drausti lankytis tam tikrose svetainėse, - • peržiūrėti svetaines, kuriose lankėsi prižiūrimas naudotojas, + • leisti arba drausti lankytis tam tikrose svetainėse; + • peržiūrėti svetaines, kuriose lankėsi prižiūrimas naudotojas; • tvarkyti kitus nustatymus. Sukūrus prižiūrimą naudotoją „Google“ paskyra nesukuriama. Visos prižiūrimo naudotojos žymės, naršymo istorija ir kitos nuostatos nebus perkeltos į kitus įrenginius naudojant „Chrome“ sinchronizavimo funkciją. Sukūrę prižiūrimą naudotoją, galėsite bet kada bet kokiame įrenginyje tvarkyti jo nustatymus apsilankę adresu <ph name="BEGIN_MANAGE_LINK" /><ph name="DISPLAY_LINK" /><ph name="END_MANAGE_LINK" />. -Jei reikia daugiau informacijos, apsilankykite <ph name="BEGIN_LINK" />Pagalbos centre<ph name="END_LINK" />.</translation> +Jei reikia daugiau informacijos, apsilankykite <ph name="BEGIN_LINK" />pagalbos centre<ph name="END_LINK" />.</translation> <translation id="3031417829280473749">Slaptasis agentas</translation> <translation id="3031557471081358569">Pasirinkite elementus importuoti:</translation> <translation id="3033332627063280038">Įgalinti eksperimentinį talpyklos valdymo: neaktyvios būsenos pakartotinai tvirtinant direktyvos diegimą. Taip leidžiama nurodyti serveriams, kad tam tikrus išteklius galima pakartotinai patvirtinti fone, kad būtų sumažinta delsa.</translation> @@ -1495,7 +1493,6 @@ <translation id="3117812041123364382">Įgalinama / išjungiama slankioji virtualioji klaviatūra.</translation> <translation id="3118319026408854581">„<ph name="PRODUCT_NAME" />“ pagalba</translation> <translation id="3120430004221004537">Nepakankama nurodytos operacijos šifruotė įrenginyje „<ph name="DEVICE_NAME" />“.</translation> -<translation id="3121260210578524273">Įgalinkite žiniatinklio pranešimų veiksmų mygtukų piktogramas.</translation> <translation id="3121793941267913344">Nustatyti iš naujo šį „<ph name="IDS_SHORT_PRODUCT_NAME" />“ įrenginį</translation> <translation id="3122162841865761901">Kūrėjo įrankių eksperimentai</translation> <translation id="3122464029669770682">Centrinis procesorius</translation> @@ -2276,6 +2273,7 @@ <translation id="421017592316736757">Jei norite pasiekti šį failą, turite prisijungti.</translation> <translation id="421182450098841253">&Rodyti žymių juostą</translation> <translation id="4212108296677106246">Ar norite pasitikėti „<ph name="CERTIFICATE_NAME" />“ kaip sertifikavimo institucija?</translation> +<translation id="42126664696688958">Eksportuoti</translation> <translation id="42137655013211669">Prieigą prie šio ištekliaus uždraudė serveris.</translation> <translation id="4215350869199060536">Oi, pavadinime yra netinkamų simbolių.</translation> <translation id="4215898373199266584">Ei! Kitą kartą gali būti naudinga naudoti inkognito režimą (<ph name="INCOGNITO_MODE_SHORTCUT" />).</translation> @@ -3308,7 +3306,6 @@ <translation id="577322787686508614">Skaitymo operacija neleidžiama įrenginyje „<ph name="DEVICE_NAME" />“.</translation> <translation id="5774295353725270860">Atidaryti failų programą</translation> <translation id="5774515636230743468">„Manifest“:</translation> -<translation id="5776006986202016118">Ši svetainė nori prisijungti prie:</translation> <translation id="577624874850706961">Ieškoti slapukų</translation> <translation id="5778550464785688721">MIDI įrenginių visateisis valdymas</translation> <translation id="5780066559993805332">(Geriausia)</translation> @@ -4203,7 +4200,6 @@ <translation id="7175353351958621980">Įkelta iš:</translation> <translation id="7180611975245234373">Atnaujinti</translation> <translation id="7180865173735832675">Tinkinti</translation> -<translation id="7184428045150946911">Išjungti automatinį įrankių juostos slėpimą dideliuose planšetiniuose kompiuteriuose</translation> <translation id="7185690883425432021">Slepiami neaktyvių skirtukų uždarymo mygtukai, kai skirtukų juostelėje įjungtas krūvos režimas.</translation> <translation id="7186088072322679094">Laikyti įrankių juostoje</translation> <translation id="719009910964971313">Programuotojų JAV Dvorako klaviatūra</translation>
diff --git a/chrome/app/resources/generated_resources_lv.xtb b/chrome/app/resources/generated_resources_lv.xtb index 90d84d9b..0e5ffb0 100644 --- a/chrome/app/resources/generated_resources_lv.xtb +++ b/chrome/app/resources/generated_resources_lv.xtb
@@ -661,7 +661,6 @@ <translation id="1962233722219655970">Šajā lapā tiek izmantota Native Client lietotne, kas nedarbojas jūsu datorā.</translation> <translation id="1965328510789761112">Privāta atmiņa</translation> <translation id="1965624977906726414">Nav īpašu atļauju.</translation> -<translation id="1968720524450620475">Darbību ikonu iespējošana tīmekļa paziņojumiem.</translation> <translation id="1970746430676306437">Skatīt lapas informāciju</translation> <translation id="197288927597451399">Paturēt</translation> <translation id="1973491249112991739">Spraudņa <ph name="PLUGIN_NAME" /> lejupielāde neizdevās.</translation> @@ -1424,7 +1423,6 @@ <translation id="302014277942214887">Ievadiet lietojumprogrammas ID vai interneta veikala URL.</translation> <translation id="3020616530769498629">Atkārtotas ielādes iespējošana bez pārbaudes, kad tiek vilkts, lai atsvaidzinātu</translation> <translation id="3020990233660977256">Sērijas numurs: <ph name="SERIAL_NUMBER" /></translation> -<translation id="3021245547458004908">Ja šī opcija ir iespējota, rīkjosla nekad netiek paslēpta, ritinot ierīcēs, kuru ekrāna minimālais blīvums ir >= 800. Tā joprojām tiek slēpta, ja lapas saturs tiek rādīts pilnekrāna režīmā.</translation> <translation id="3021678814754966447">Skatīt rāmja a&votu</translation> <translation id="3024374909719388945">Lietot 24 stundu pulksteni</translation> <translation id="3025022340603654002">Ieteikt automātiski aizpildāmo tekstu pēc pirmā peles klikšķa uz veidlapas elementa.</translation> @@ -1495,7 +1493,6 @@ <translation id="3117812041123364382">Iespējot/atspējot peldošo virtuālo tastatūru.</translation> <translation id="3118319026408854581"><ph name="PRODUCT_NAME" /> palīdzība</translation> <translation id="3120430004221004537">Nepietiekams attiecīgās darbības šifrējums šajā ierīcē: “<ph name="DEVICE_NAME" />”.</translation> -<translation id="3121260210578524273">Ikonu iespējošana darbību pogās tīmekļa paziņojumiem.</translation> <translation id="3121793941267913344">Atiestatiet šo <ph name="IDS_SHORT_PRODUCT_NAME" /> ierīci.</translation> <translation id="3122162841865761901">Izstrādātāju rīku eksperimenti</translation> <translation id="3122464029669770682">Maksa par daļas vienību</translation> @@ -2278,6 +2275,7 @@ <translation id="421017592316736757">Lai piekļūtu šim failam, jums ir jābūt tiešsaistē.</translation> <translation id="421182450098841253">&Rādīt grāmatzīmju joslu</translation> <translation id="4212108296677106246">Vai vēlaties uzticēties “<ph name="CERTIFICATE_NAME" />” kā sertifikāta izdevējiestādei?</translation> +<translation id="42126664696688958">Eksportēt</translation> <translation id="42137655013211669">Serveris neatļāva piekļūt šim resursam.</translation> <translation id="4215350869199060536">Diemžēl nosaukumā ir ietverti neatļauti simboli.</translation> <translation id="4215898373199266584">Nākamreiz jums varētu noderēt inkognito režīms (<ph name="INCOGNITO_MODE_SHORTCUT" />).</translation> @@ -3310,7 +3308,6 @@ <translation id="577322787686508614">Lasīšanas darbība nav atļauta šajā ierīcē: “<ph name="DEVICE_NAME" />”.</translation> <translation id="5774295353725270860">Atvērt lietotni Faili</translation> <translation id="5774515636230743468">Manifests:</translation> -<translation id="5776006986202016118">Šī vietne vēlas izveidot savienojumu ar:</translation> <translation id="577624874850706961">Meklēt sīkfailus</translation> <translation id="5778550464785688721">Pilnīga MIDI ierīču pārvaldība</translation> <translation id="5780066559993805332">(Vislabākā)</translation> @@ -4204,7 +4201,6 @@ <translation id="7175353351958621980">Ielādēts no:</translation> <translation id="7180611975245234373">Atsvaidzināt</translation> <translation id="7180865173735832675">Piemērot</translation> -<translation id="7184428045150946911">Atspējot rīkjoslas automātisku paslēpšanu lielizmēra planšetdatoros</translation> <translation id="7185690883425432021">Neaktīvo ciļņu aizvēršanas pogas tiek paslēptas, ja ciļņu josla ir kaskādes režīmā.</translation> <translation id="7186088072322679094">Saglabāšana rīkjoslā</translation> <translation id="719009910964971313">US Programmer Dvorak tastatūra</translation>
diff --git a/chrome/app/resources/generated_resources_ml.xtb b/chrome/app/resources/generated_resources_ml.xtb index 779b3b6..1e5ac8c 100644 --- a/chrome/app/resources/generated_resources_ml.xtb +++ b/chrome/app/resources/generated_resources_ml.xtb
@@ -659,7 +659,6 @@ <translation id="1962233722219655970">ഈ പേജ് നിങ്ങളുടെ കമ്പ്യൂട്ടറിൽ പ്രവർത്തിക്കാത്ത ഒരു നേറ്റീവ് ക്ലയന്റ് അപ്ലിക്കേഷൻ ഉപയോഗിക്കുന്നു.</translation> <translation id="1965328510789761112">സ്വകാര്യ മെമ്മറി</translation> <translation id="1965624977906726414">പ്രത്യേക അനുമതികളൊന്നുമില്ല.</translation> -<translation id="1968720524450620475">വെബ് അറിയിപ്പുകൾക്കായി പ്രവർത്തന ഐക്കണുകൾ പ്രവർത്തനക്ഷമമാക്കുക.</translation> <translation id="1970746430676306437">പേജ് &വിവരം കാണുക</translation> <translation id="197288927597451399">സൂക്ഷിക്കുക</translation> <translation id="1973491249112991739"><ph name="PLUGIN_NAME" /> ഡൗൺലോഡ് പരാജയപ്പെട്ടു.</translation> @@ -1423,7 +1422,6 @@ <translation id="302014277942214887">അപ്ലിക്കേഷൻ ഐഡി അല്ലെങ്കിൽ വെബ്സ്റ്റോർ URL നൽകുക.</translation> <translation id="3020616530769498629">'പുതുക്കാൻ വലിച്ചിടുക' എന്നതിൽ സാധൂകരിക്കാത്ത റീലോഡ് പ്രവർത്തനക്ഷമമാക്കുക</translation> <translation id="3020990233660977256">സീരിയല് നമ്പര്: <ph name="SERIAL_NUMBER" /></translation> -<translation id="3021245547458004908">പ്രവർത്തനക്ഷമമാക്കിയിരിക്കുമ്പോൾ, ഏറ്റവും കുറഞ്ഞ സ്ക്രീൻ dp >= 800 ഉള്ള ഉപകരണങ്ങളിലേക്ക് സ്ക്രോൾ ചെയ്യുന്നതിനാൽ ടൂൾബാർ ഒരിക്കലും മറയ്ക്കുന്നതല്ല. പേജ് ഉള്ളടക്കങ്ങൾ പൂർണ്ണ സ്ക്രീനാകുകയാണെങ്കിൽ, ഇത് മറച്ചിരിക്കുന്ന രീതിയിൽ തന്നെ തുടരും.</translation> <translation id="3021678814754966447">&ഫ്രെയിം ഉറവിടം കാണുക</translation> <translation id="3024374909719388945">24 മണിക്കൂര് ക്ലോക്ക് ഉപയോഗിക്കുക</translation> <translation id="3025022340603654002">ഒരു ഫോം ഘടകത്തിലെ പ്രാരംഭ മൗസ് ക്ലിക്കിലൂടെ ഓട്ടോഫിൽ നിർദ്ദേശങ്ങൾ നിർമ്മിക്കുക.</translation> @@ -1494,7 +1492,6 @@ <translation id="3117812041123364382">ഫ്ലോട്ടിംഗ് വെർച്വൽ കീബോർഡ് പ്രവർത്തനക്ഷമമാക്കുക/പ്രവർത്തനരഹിതമാക്കുക.</translation> <translation id="3118319026408854581"><ph name="PRODUCT_NAME" /> സഹായം</translation> <translation id="3120430004221004537">ഇനി പറയുന്നതിൽ നൽകിയിരിക്കുന്ന പ്രവർത്തനത്തിന് എൻക്രിപ്ഷൻ അപര്യാപ്തമാണ്: "<ph name="DEVICE_NAME" />".</translation> -<translation id="3121260210578524273">വെബ് അറിയിപ്പുകൾക്കായി പ്രവർത്തന ബട്ടണുകളിലെ ഐക്കണുകൾ പ്രവർത്തനക്ഷമമാക്കുക.</translation> <translation id="3121793941267913344">ഈ <ph name="IDS_SHORT_PRODUCT_NAME" /> ഉപകരണം പുനഃസജ്ജീകരിക്കുക</translation> <translation id="3122162841865761901">ഡവലപ്പർ ഉപകരണങ്ങളുടെ പരീക്ഷണങ്ങൾ</translation> <translation id="3122464029669770682">CPU</translation> @@ -2274,6 +2271,7 @@ <translation id="421017592316736757">ഈ ഫയൽ ആക്സസ്സുചെയ്യുന്നതിന് നിങ്ങൾ ഓൺലൈനിലായിരിക്കണം.</translation> <translation id="421182450098841253">ബുക്ക്മാർക്കുകൾ ബാർ &കാണിക്കുക</translation> <translation id="4212108296677106246">"<ph name="CERTIFICATE_NAME" />" എന്നതിനെ ഒരു സര്ട്ടിഫിക്കേഷന് അതോറിറ്റിയായി വിശ്വസിക്കാന് താല്പ്പര്യപ്പെടുന്നോ?</translation> +<translation id="42126664696688958">എക്സ്പോർട്ടുചെയ്യുക</translation> <translation id="42137655013211669">ഈ ഉറവിടത്തിലേക്കുള്ള ആക്സസ്സ് സെർവർ തടഞ്ഞു.</translation> <translation id="4215350869199060536">ക്ഷമിക്കണം, പേരിൽ നിയമവിരുദ്ധ ചിഹ്നങ്ങളുണ്ട്!</translation> <translation id="4215898373199266584">ശ്രദ്ധിക്കൂ! ആൾമാറാട്ട മോഡ് (<ph name="INCOGNITO_MODE_SHORTCUT" />) അടുത്ത തവണ കൈകാര്യം ചെയ്യുന്നത് എളുപ്പമാകാനിടയുണ്ട്.</translation> @@ -3307,7 +3305,6 @@ <translation id="577322787686508614">ഇനി പറയുന്നതിൽ വായിക്കാൻ അനുമതിയില്ല: "<ph name="DEVICE_NAME" />".</translation> <translation id="5774295353725270860">ഓപ്പൺ ഫയലുകൾ അപ്ലിക്കേഷൻ</translation> <translation id="5774515636230743468">മാനിഫെസ്റ്റ്:</translation> -<translation id="5776006986202016118">ഈ സൈറ്റ് ഇതിലേക്ക് കണക്റ്റുചെയ്യാൻ താൽപ്പര്യപ്പെടുന്നു:</translation> <translation id="577624874850706961">കുക്കീസ് തിരയുക</translation> <translation id="5778550464785688721">MIDI ഉപകരണങ്ങളുടെ പൂർണ നിയന്ത്രണം</translation> <translation id="5780066559993805332">(മികച്ചത്)</translation> @@ -3960,7 +3957,7 @@ <translation id="6825883775269213504">റഷ്യന്</translation> <translation id="6827236167376090743">ഈ വീഡിയോ ദീർഘ നേരം പ്ലേ ചെയ്യും.</translation> <translation id="6828153365543658583">ഇനിപ്പറയുന്ന ഉപയോക്താക്കള്ക്കായി പ്രവേശനം നിയന്ത്രിക്കുക:</translation> -<translation id="6828434191343384461">തിരഞ്ഞെടുത്ത ഡാറ്റയെ Chrome-ൽ നിന്നും സമന്വയിപ്പിച്ച ഉപകരണങ്ങളിൽ നിന്നും നീക്കംചെയ്തു. നിങ്ങളുടെ Google അക്കൗണ്ടിൽ <ph name="BEGIN_LINK" />history.google.com<ph name="END_LINK" /> എന്നതിലെ മറ്റ് Google സേവനങ്ങളിൽ നിന്നുള്ള തിരയലുകൾ, പ്രവൃത്തി എന്നിങ്ങനെ മറ്റ് തരത്തിലുള്ള ബ്രൗസിംഗ് ചരിത്രമുണ്ടായിരിക്കാം.</translation> +<translation id="6828434191343384461">തിരഞ്ഞെടുത്ത ഡാറ്റയെ Chrome-ൽ നിന്നും സമന്വയിപ്പിച്ച ഉപകരണങ്ങളിൽ നിന്നും നീക്കംചെയ്തു. നിങ്ങളുടെ Google അക്കൗണ്ടിൽ <ph name="BEGIN_LINK" />history.google.com<ph name="END_LINK" /> എന്നതിൽ മറ്റ് Google സേവനങ്ങളിൽ നിന്നുള്ള തിരയലുകൾ, പ്രവൃത്തി എന്നിങ്ങനെ മറ്റ് തരത്തിലുള്ള ബ്രൗസിംഗ് ചരിത്രമുണ്ടായിരിക്കാം.</translation> <translation id="6828860976882136098">എല്ലാ ഉപയോക്താക്കൾക്കുമായി സ്വയമേയുള്ള അപ്ഡേറ്റുകൾ സജ്ജമാക്കാനായില്ല (പ്രീഫ്ലൈറ്റ് എക്സിക്യൂഷൻ പിശക്: <ph name="ERROR_NUMBER" />)</translation> <translation id="6829250331733125857"><ph name="DEVICE_TYPE" /> ഉപയോഗിച്ച് സഹായം സ്വന്തമാക്കുക.</translation> <translation id="6829270497922309893">നിങ്ങളുടെ ഓർഗനൈസേഷനിൽ എൻറോൾ ചെയ്യുക</translation> @@ -4201,7 +4198,6 @@ <translation id="7175353351958621980">ഇതില്നിന്ന് ലോഡ് ചെയ്തത്:</translation> <translation id="7180611975245234373">പുതുക്കുക</translation> <translation id="7180865173735832675">ഇച്ഛാനുസൃതമാക്കുക</translation> -<translation id="7184428045150946911">വലിയ ടാബ്ലെറ്റുകളിൽ, ടൂൾബാർ സ്വയമേവ മറയ്ക്കുന്നത് പ്രവർത്തനരഹിതമാക്കുക</translation> <translation id="7185690883425432021">ടാബ്സ്ട്രിപ്പ് അടുക്കൽ മോഡിലായിരിക്കുമ്പോൾ നിഷ്ക്രിയമായ ടാബുകളുടെ 'അടയ്ക്കുക' ബട്ടണുകൾ മറയ്ക്കുന്നു.</translation> <translation id="7186088072322679094">ടൂൾബാറിൽ സൂക്ഷിക്കുക</translation> <translation id="719009910964971313">യുഎസ് പ്രോഗ്രാമർ ഡൊറാക്ക് കീബോർഡ്</translation> @@ -5109,7 +5105,7 @@ <translation id="8545211332741562162">പരീക്ഷണാത്മക JavaScript സവിശേഷതകൾ ഉപയോഗിക്കാൻ വെബ് പേജുകൾ പ്രാപ്തമാക്കുക.</translation> <translation id="8545575359873600875">ക്ഷമിക്കണം, നിങ്ങളുടെ പാസ്വേഡ് പരിശോധിച്ചുറപ്പിക്കാനായില്ല. ഈ സൂപ്പർവൈസുചെയ്ത ഉപയോക്താവിന്റെ മാനേജർ അടുത്തിടെ പാസ്വേഡ് മാറ്റിയിരിക്കാം. അങ്ങനെയാണെങ്കിൽ അടുത്ത തവണ നിങ്ങൾ സൈൻ ഇൻ ചെയ്യുമ്പോൾ പുതിയ പാസ്വേഡ് ബാധകമാകും. നിങ്ങളുടെ പഴയ പാസ്വേഡ് ഉപയോഗിക്കുന്നത് പരീക്ഷിച്ചുനോക്കൂ.</translation> <translation id="8546306075665861288">ചിത്ര കാഷേ</translation> -<translation id="854653344619327455">ഈ ഓണായിരിക്കുന്ന ഫ്ലാഗ് ഉപയോഗിച്ച്, ഓഡിയോ പങ്കിടണോ എന്ന് തിരഞ്ഞെടുക്കാൻ ഉപയോക്താവിനെ ഡെസ്ക്ടോപ്പ് പങ്കിടൽ പിക്കർ വിൻഡോ അനുവദിക്കില്ല.</translation> +<translation id="854653344619327455">ഈ ഫ്ലാഗ് ഓണായിരിക്കുമ്പോൾ, ഓഡിയോ പങ്കിടണോ എന്ന് തിരഞ്ഞെടുക്കാൻ ഉപയോക്താവിനെ ഡെസ്ക്ടോപ്പ് പങ്കിടൽ പിക്കർ വിൻഡോ അനുവദിക്കില്ല.</translation> <translation id="8546541260734613940">[*.]example.com</translation> <translation id="8548973727659841685">പ്രതീകം</translation> <translation id="855081842937141170">ടാബ് പിൻ ചെയ്യുക</translation>
diff --git a/chrome/app/resources/generated_resources_mr.xtb b/chrome/app/resources/generated_resources_mr.xtb index 39aa11d..a4a8fe5 100644 --- a/chrome/app/resources/generated_resources_mr.xtb +++ b/chrome/app/resources/generated_resources_mr.xtb
@@ -501,7 +501,7 @@ <translation id="169515659049020177">Shift</translation> <translation id="1697068104427956555">प्रतिमेचा चौरस भाग निवडा.</translation> <translation id="1697532407822776718">आपण पूर्ण सज्ज आहात!</translation> -<translation id="1697988819212986149">संदर्भ मेनू आयटम पुढील Google सेवांद्वारे समर्थित Google icon दर्शविते.</translation> +<translation id="1697988819212986149">Google सेवांद्वारे समर्थित संदर्भ मेनू आयटम पुढे Google चिन्ह दर्शविते.</translation> <translation id="1699274548822076330">हे trace-upload-url ध्वजासह संयुक्तपणे वापरण्यासाठी आहे. चेतावणी: सक्षम केले असल्यास, Chrome प्रत्येक नॅव्हिगेशनसाठी कार्यप्रदर्शन डेटा रेकॉर्ड करेल आणि trace-upload-url ध्वजाद्वारे निर्दिष्ट केलेल्या URL वर अपलोड करेल. ट्रेसमध्ये वैयक्तिकरित्या ओळखता येणाऱ्या माहितीचा (PII) समावेश असू शकतो जसे की आपण भेट देत असलेल्या वेबसाइटची शीर्षके आणि URL.</translation> <translation id="1699395855685456105">हार्डवेअर पुनरावृत्ती:</translation> @@ -660,7 +660,6 @@ <translation id="1962233722219655970">हे पृष्ठ एक मूळ क्लायंट अॅप वापरते जो आपल्या संगणकावर कार्य करत नाही.</translation> <translation id="1965328510789761112">खासगी मेमरी</translation> <translation id="1965624977906726414">यास विशेष परवानग्या नाहीत.</translation> -<translation id="1968720524450620475">वेब सूचनांसाठी क्रिया चिन्हे सक्षम करा.</translation> <translation id="1970746430676306437">पृष्ठ &माहिती पहा</translation> <translation id="197288927597451399">ठेवा</translation> <translation id="1973491249112991739"><ph name="PLUGIN_NAME" /> डाउनलोड अयशस्वी.</translation> @@ -1422,7 +1421,6 @@ <translation id="302014277942214887">अनुप्रयोग id किंवा वेबस्टोअर URL प्रविष्ट करा.</translation> <translation id="3020616530769498629">रीफ्रेश करण्यासाठी-ओढा वरील प्रमाणित-नसलेले रीलोड सक्षम करा</translation> <translation id="3020990233660977256">अनुक्रमांक: <ph name="SERIAL_NUMBER" /></translation> -<translation id="3021245547458004908">सक्षम केले असताना, किमान स्क्रीन dp >= 800 असलेल्या डिव्हाइसेसवर स्क्रोल करण्यामुळे टूलबार कधीही लपविला जात नाही. पृष्ठ सामग्री पूर्ण स्क्रीनवर असली तरीही तो लपलेला असेल.</translation> <translation id="3021678814754966447">फ्रेम स्त्रोत &पहा</translation> <translation id="3024374909719388945">24-तासांचे घड्याळ वापरा</translation> <translation id="3025022340603654002">फॉर्म घटकावरील सुरुवातीच्या माउस क्लिक वर स्वयं-भरण सूचना करा.</translation> @@ -1489,7 +1487,6 @@ <translation id="3117812041123364382">अस्थायी व्हर्च्युअल कीबोर्ड सक्षम/अक्षम करा.</translation> <translation id="3118319026408854581"><ph name="PRODUCT_NAME" /> मदत</translation> <translation id="3120430004221004537">दिलेल्या ऑपरेशनसाठी यावर अपुरे कूटबद्धीकरण: "<ph name="DEVICE_NAME" />".</translation> -<translation id="3121260210578524273">वेब सूचनांसाठी क्रिया बटणांमधील चिन्हे सक्षम करा.</translation> <translation id="3121793941267913344">हा <ph name="IDS_SHORT_PRODUCT_NAME" /> डिव्हाइस रीसेट करा</translation> <translation id="3122162841865761901">विकासक साधने प्रयोग</translation> <translation id="3122464029669770682">CPU</translation> @@ -2270,6 +2267,7 @@ <translation id="421017592316736757">या फाइलमध्ये प्रवेश करण्यासाठी आपण ऑनलाइन असणे आवश्यक आहे.</translation> <translation id="421182450098841253">बुकमार्क बार &दर्शवा</translation> <translation id="4212108296677106246">प्रमाणन अधिकृतता म्हणून आपण "<ph name="CERTIFICATE_NAME" />" वर विश्वास ठेवू इच्छिता?</translation> +<translation id="42126664696688958">निर्यात</translation> <translation id="42137655013211669">सर्व्हरद्वारे या स्त्रोतामधील प्रवेश निषिद्ध केला होता.</translation> <translation id="4215350869199060536">अरेरे, नावात बेकायदेशीर चिन्हे आहेत!</translation> <translation id="4215898373199266584">हं! गुप्त मोड (<ph name="INCOGNITO_MODE_SHORTCUT" />) पुढील वेळी आटोपशीर दिसू शकतो.</translation> @@ -3302,7 +3300,6 @@ <translation id="577322787686508614">वाचा ऑपरेशनला यावर परवानगी नाही: " <ph name="DEVICE_NAME" /> ".</translation> <translation id="5774295353725270860">फायलीचा अनुप्रयोग उघडा</translation> <translation id="5774515636230743468">मॅनिफेस्ट:</translation> -<translation id="5776006986202016118">ही साइट यास कनेक्ट करू इच्छित आहे:</translation> <translation id="577624874850706961">कुकीज शोधा</translation> <translation id="5778550464785688721">MIDI डिव्हाइसेस पूर्ण नियंत्रण</translation> <translation id="5780066559993805332">(सर्वोत्तम)</translation> @@ -4192,7 +4189,6 @@ <translation id="7175353351958621980">येथून लोड केले:</translation> <translation id="7180611975245234373">रीफ्रेश करा</translation> <translation id="7180865173735832675">सानुकूल करा</translation> -<translation id="7184428045150946911">मोठ्या टॅब्लेटवर टूलबार स्वयं-लपवा अक्षम करा</translation> <translation id="7185690883425432021">टॅबस्ट्रिप स्टॅक केलेल्या मोडमध्ये असते तेव्हा निष्क्रिय टॅबची बंद बटणे लपविते.</translation> <translation id="7186088072322679094">टूलबारमध्ये ठेवा</translation> <translation id="719009910964971313">यूएस प्रोग्रामर द्वोराक कीबोर्ड</translation>
diff --git a/chrome/app/resources/generated_resources_ms.xtb b/chrome/app/resources/generated_resources_ms.xtb index 1349a24..31ca06f 100644 --- a/chrome/app/resources/generated_resources_ms.xtb +++ b/chrome/app/resources/generated_resources_ms.xtb
@@ -183,16 +183,19 @@ <translation id="1259724620062607540">Item rak 7</translation> <translation id="1260240842868558614">Papar:</translation> <translation id="126710816202626562">Bahasa terjemahan:</translation> +<translation id="1269690813141254680">Kawal cara Google menggunakan sejarah penyemakan imbas anda untuk memperibadikan Carian dan perkhidmatan Google lain daripada <ph name="BEGIN_LINK" />Kawalan Aktiviti Google<ph name="END_LINK" />.</translation> <translation id="1272079795634619415">Berhenti</translation> <translation id="1272978324304772054">Akaun pengguna ini tidak tergolong dalam domain tempat peranti anda didaftarkan. Jika anda ingin mendaftar untuk domain yang berbeza, anda perlu melalui pemulihan peranti terlebih dahulu.</translation> <translation id="127353061808977798">Fon dan Pengekodan</translation> <translation id="1274997165432133392">Kuki dan data tapak yang lain</translation> <translation id="1275718070701477396">Dipilih</translation> +<translation id="1277908057200820621">Lihat senarai peranti</translation> <translation id="1278049586634282054">Periksa paparan:</translation> <translation id="1278813325885878377">Papan kekunci QWERTY Hungary</translation> <translation id="1285320974508926690">Jangan sekali-kali menterjemahkan tapak ini</translation> <translation id="1285484354230578868">Simpan data dalam akaun Google Drive anda</translation> <translation id="1290223615328246825">Log masuk automatik gagal</translation> +<translation id="1293509594570842875">Pengguna di bawah seliaan baharu tidak dapat dibuat. Sila semak sambungan rangkaian anda dan cuba sebentar lagi.</translation> <translation id="1293556467332435079">Fail</translation> <translation id="1294298200424241932">Edit tetapan kepercayaan:</translation> <translation id="1295794900245526845">Pilih akaun anda yang disimpan dengan <ph name="PASSWORD_MANAGER_BRAND" /> untuk log masuk</translation> @@ -291,6 +294,7 @@ <translation id="1429740407920618615">Kekuatan Isyarat:</translation> <translation id="143027896309062157">Baca dan ubah semua data anda pada komputer anda dan tapak web yang anda lawati</translation> <translation id="1430915738399379752">Cetak</translation> +<translation id="1433423644370450034">Pemberitahuan gaya media</translation> <translation id="1434696352799406980">Ini akan menetapkan semula halaman permulaan, halaman tab baharu, enjin carian dan tab tersemat anda. Selain itu, semua sambungan akan dilumpuhkan dan data sementara seperti kuki akan dikosongkan. Sejarah penanda halaman anda dan kata laluan yang disimpan tidak akan dikosongkan.</translation> <translation id="1434886155212424586">Halaman utama ialah halaman Tab Baharu</translation> <translation id="1435550882135542937">Reka semula bar alat sambungan</translation> @@ -378,6 +382,7 @@ <translation id="1526925867532626635">Sahkan tetapan penyegerakan</translation> <translation id="1528372117901087631">Sambungan internet</translation> <translation id="1529968269513889022">minggu yang lalu</translation> +<translation id="1531865825384516080">Pelaporan URL SafeSearch.</translation> <translation id="1532697124104874386">Dayakan/Lumpuhkan penggunaan pintar papan kekunci maya.</translation> <translation id="1533897085022183721">Kurang daripada <ph name="MINUTES" />.</translation> <translation id="1533920822694388968">Penjajaran TV</translation> @@ -661,7 +666,6 @@ <translation id="1962233722219655970">Halaman ini menggunakan aplikasi Native Client yang tidak berfungsi pada komputer anda.</translation> <translation id="1965328510789761112">Memori peribadi</translation> <translation id="1965624977906726414">Tidak mempunyai kebenaran khas.</translation> -<translation id="1968720524450620475">Dayakan ikon tindakan untuk Pemberitahuan Web.</translation> <translation id="1970746430676306437">Lihat maklumat &halaman</translation> <translation id="197288927597451399">Simpan</translation> <translation id="1973491249112991739">Muat turun <ph name="PLUGIN_NAME" /> gagal.</translation> @@ -759,6 +763,7 @@ <translation id="212862741129535676">Peratusan Penggunaan Keadaan Kekerapan</translation> <translation id="2128691215891724419">Ralat Segerak: Kemas kini frasa laluan Segerak...</translation> <translation id="2129904043921227933">Ralat Segerak: Kemas Kini Frasa Laluan Segerak...</translation> +<translation id="2130053362119884302">Benarkan pengasingan tab dalam skrin penuh</translation> <translation id="2131077480075264">Tidak dapat memasang "<ph name="APP_NAME" />" kerana tidak dibenarkan oleh "<ph name="IMPORT_NAME" />"</translation> <translation id="2134149231879627725">Benarkan Google membantu anda mengunci, memadam dan mengesan peranti anda dari jauh.</translation> <translation id="2134986351331412790">Tapak ini tidak menerima kad jenama ini.</translation> @@ -771,6 +776,7 @@ <translation id="2143778271340628265">Konfigurasi proksi manual</translation> <translation id="2143915448548023856">Tetapan paparan</translation> <translation id="2144536955299248197">Pemapar Sijil: <ph name="CERTIFICATE_NAME" /></translation> +<translation id="2147827593068025794">Penyegerakan Latar Belakang</translation> <translation id="2148756636027685713">Selesai memformat</translation> <translation id="2148892889047469596">Hantar tab</translation> <translation id="2148999191776934271">Mengecas <ph name="HOUR" /> : <ph name="MINUTE" /> sehingga penuh</translation> @@ -1149,6 +1155,7 @@ <translation id="2665717534925640469">Halaman ini kini dalam skrin penuh dan telah melumpuhkan kursor tetikus anda.</translation> <translation id="2665919335226618153">Oh, Tidak! Terdapat ralat semasa memformat.</translation> <translation id="2668079306436607263">Navigasi sejarah tatal lampau</translation> +<translation id="2670102641511624474"><ph name="APP_NAME" /> berkongsi tab Chrome.</translation> <translation id="2670965183549957348">Kaedah input Chewing</translation> <translation id="2672142220933875349">Fail crx rosak, pemunggahan gagal.</translation> <translation id="2672394958563893062">Ralat telah berlaku. Klik untuk memulakan semula dari permulaan.</translation> @@ -1195,6 +1202,7 @@ <translation id="2733364097704495499">Adakah anda ingin mendaftarkan pencetak <ph name="PRINTER_NAME" /> dengan Google Cloud Print?</translation> <translation id="2735698359135166290">Papan kekunci standard Romania</translation> <translation id="2737363922397526254">Runtuhkan...</translation> +<translation id="2737755522130570180">Sekat skrip yang dimuatkan melalui document.write</translation> <translation id="2738771556149464852">Bukan Selepas</translation> <translation id="2739191690716947896">Nyahpepijat</translation> <translation id="2739240477418971307">Ubah tetapan kebolehaksesan anda</translation> @@ -1264,6 +1272,7 @@ <translation id="2805646850212350655">Sistem Fail Penyulitan Microsoft</translation> <translation id="2805707493867224476">Membenarkan semua tapak untuk memaparkan pop muncul</translation> <translation id="2805756323405976993">Apl</translation> +<translation id="2808243220963392165">Benarkan tab untuk diasingkan daripada jaluran tab semasa dalam mod skrin penuh pada Mac.</translation> <translation id="2809142985846095314">Dayakan penawaran muat naik Kad kredit autolengkap</translation> <translation id="2809346626032021864">Membaca</translation> <translation id="2809586584051668049">dan <ph name="NUMBER_ADDITIONAL_DISABLED" /> lagi</translation> @@ -1392,6 +1401,7 @@ <translation id="2968792643335932010">Kurang salinan</translation> <translation id="2971033837577180453"><span>ID:</span><ph name="EXTENSION_ID" /></translation> <translation id="2971213274238188218">kurangkan kecerahan</translation> +<translation id="2971422413423640756">Butang muat turun semasa membuka halaman dengan url media.</translation> <translation id="2972557485845626008">Perisian tegar</translation> <translation id="2972581237482394796">&Buat Semula</translation> <translation id="297870353673992530">Pelayan DNS:</translation> @@ -1424,7 +1434,6 @@ <translation id="302014277942214887">Masukkan id sambungan atau URL kedai web.</translation> <translation id="3020616530769498629">Dayakan muat semula bukan pengesahan pada tarik untuk muat semula</translation> <translation id="3020990233660977256">Nombor Siri: <ph name="SERIAL_NUMBER" /></translation> -<translation id="3021245547458004908">Apabila didayakan, bar alat tidak sekali-kali akan disembunyikan semasa penatalan pada peranti dengan skrin minimum dp >= 800. Bar alat tetap akan disembunyikan jika kandungan halaman dipaparkan dalam skrin penuh.</translation> <translation id="3021678814754966447">&Lihat Sumber Bingkai</translation> <translation id="3024374909719388945">Gunakan jam 24 jam</translation> <translation id="3025022340603654002">Buat cadangan autolengkap pada klik tetikus awal pada elemen borang.</translation> @@ -1457,6 +1466,7 @@ <translation id="3057861065630527966">Sandarkan foto dan video anda</translation> <translation id="3058212636943679650">Jika anda perlu memulihkan sistem pengendalian komputer anda, anda memerlukan kad SD pemulihan atau batang memori USB.</translation> <translation id="305932878998873762">Cache Mudah untuk HTTP merupakan cache baharu. Cache ini bergantung pada sistem fail untuk peruntukan ruang cakera.</translation> +<translation id="3062606427884046423">Gunakan pemberitahuan Android MediaStyle untuk pemberitahuan media Chrome.</translation> <translation id="3064388234319122767">Pengalihan huruf (zdravo → здраво)</translation> <translation id="3065041951436100775">Maklum balas tab dibunuh.</translation> <translation id="3065140616557457172">Taip untuk mencari atau memasukkan URL untuk menavigasi - semua boleh digunakan.</translation> @@ -1495,7 +1505,6 @@ <translation id="3117812041123364382">Dayakan/Lumpuhkan papan kekunci maya terapung.</translation> <translation id="3118319026408854581"><ph name="PRODUCT_NAME" /> Bantuan</translation> <translation id="3120430004221004537">Penyulitan tidak mencukupi untuk pengendalian yang dinyatakan pada: "<ph name="DEVICE_NAME" />".</translation> -<translation id="3121260210578524273">Dayakan ikon dalam butang tindakan untuk Pemberitahuan Web.</translation> <translation id="3121793941267913344">Tetapkan semula peranti <ph name="IDS_SHORT_PRODUCT_NAME" /> ini</translation> <translation id="3122162841865761901">Percubaan Alat Pembangun</translation> <translation id="3122464029669770682">CPU</translation> @@ -1540,6 +1549,7 @@ <translation id="3170072451822350649">Anda juga boleh melangkau log masuk dan <ph name="LINK_START" />menyemak imbas sebagai tetamu<ph name="LINK_END" />.</translation> <translation id="3170544058711792988">Pastikan fokus kanta pembesar di pusat skrin</translation> <translation id="3172213052701798825">Google Smart Lock untuk Kata Laluan</translation> +<translation id="3175469972022788345">Apabila didayakan, WebRTC akan menggunakan sijil ECDSA.</translation> <translation id="317583078218509884">Tetapan kebenaran tapak baharu akan dilaksanakan selepas memuatkan semula halaman.</translation> <translation id="3177048931975664371">Klik untuk sembunyikan kata laluan</translation> <translation id="3180365125572747493">Sila masukkan kata laluan untuk menyulitkan fail sijil ini.</translation> @@ -1994,6 +2004,7 @@ <translation id="3776796446459804932">Sambungan ini melanggar dasar Kedai Web Chrome.</translation> <translation id="3778152852029592020">Muat turun telah dibatalkan.</translation> <translation id="3778740492972734840">&Alat pembangun</translation> +<translation id="3780663724044634171">Pilih akaun untuk mengurus pengguna di bawah seliaan.</translation> <translation id="378312418865624974">Baca pengecam unik untuk komputer ini</translation> <translation id="3783640748446814672">alt</translation> <translation id="3785308913036335955">Paparkan Pintasan Apl</translation> @@ -2017,6 +2028,7 @@ <translation id="3807747707162121253">&Batal</translation> <translation id="3809280248639369696">Cahaya bulan</translation> <translation id="3810973564298564668">Urus</translation> +<translation id="3811494700605067549">1 fail dipilih</translation> <translation id="3812034401428455285"><ph name="UWS_NAME" /> dan <ph name="UWS_NAME" /></translation> <translation id="3812525830114410218">Sijil tidak sah</translation> <translation id="3813984289128269159">Ok Google</translation> @@ -2046,6 +2058,7 @@ <translation id="3838543471119263078">Kuki, data tapak lain dan data pemalam</translation> <translation id="3839497635014791588">Maklum balas sentuh tambahan pada komponen UI</translation> <translation id="3840053866656739575">Sambungan ke Chromebox anda terputus. Sila bergerak lebih dekat atau periksa peranti anda sementara kami cuba untuk bersambung semula.</translation> +<translation id="3840055807562919428">Tidak membenarkan pengambilan untuk skrip menyekat penghurai pihak ketiga dimasukkan ke dalam bingkai utama melalui document.write.</translation> <translation id="3842552989725514455">Fon Serif</translation> <translation id="3846593650622216128">Tetapan ini dikuatkuasakan oleh sambungan.</translation> <translation id="3846833722648675493">Paparkan tetingkap apl selepas cat pertama. Tetingkap akan dipaparkan lebih lambat untuk apl berat yang memuatkan sumber secara serentak tetapi tidak ketara bagi apl yang memuatkan kebanyakan sumbernya secara berasingan.</translation> @@ -2277,6 +2290,7 @@ <translation id="421017592316736757">Anda mesti berada dalam talian untuk mengakses fail ini.</translation> <translation id="421182450098841253">&Tunjukkan Bar Penanda Halaman</translation> <translation id="4212108296677106246">Adakah anda mahu mempercayai "<ph name="CERTIFICATE_NAME" />" sebagai Pihak Berkuasa Pensijilan?</translation> +<translation id="42126664696688958">Eksport</translation> <translation id="42137655013211669">Akses kepada sumber ini dilarang oleh pelayan.</translation> <translation id="4215350869199060536">Alamak, simbol tidak sah terdapat dalam nama!</translation> <translation id="4215898373199266584">Psst! Mod inkognito (<ph name="INCOGNITO_MODE_SHORTCUT" />) mungkin berguna pada masa akan datang.</translation> @@ -2363,6 +2377,7 @@ <translation id="4359408040881008151">Dipasang kerana sambungan yang bergantung.</translation> <translation id="4361190688154226069">Sasaran berasaskan segi empat tepat dalam paparan</translation> <translation id="4364444725319685468"><ph name="FILE_NAME" /> dimuat turun</translation> +<translation id="4364567974334641491"><ph name="APP_NAME" /> berkongsi tingkap.</translation> <translation id="4364830672918311045">Paparkan pemberitahuan</translation> <translation id="4365673000813822030">Alamak, Penyegerakan telah berhenti berfungsi.</translation> <translation id="4366509400410520531">Dibenarkan oleh anda</translation> @@ -2432,6 +2447,7 @@ <translation id="4479639480957787382">Ethernet</translation> <translation id="4479812471636796472">Papan kekunci Dvorak AS</translation> <translation id="4481249487722541506">Muatkan sambungan yang dinyahpek...</translation> +<translation id="4482194545587547824">Google boleh menggunakan sejarah penyemakan imbas anda untuk memperibadikan Carian dan perkhidmatan Google lain.</translation> <translation id="4487088045714738411">Papan Kekunci Belgium</translation> <translation id="4492190037599258964">Hasil carian untuk '<ph name="SEARCH_STRING" />'</translation> <translation id="4495021739234344583">Batalkan pendaftaran dan mulakan semula</translation> @@ -2475,6 +2491,7 @@ <translation id="4554591392113183336">Sambungan luar ialah versi yang sama atau lebih rendah berbanding yang sedia ada.</translation> <translation id="4554796861933393312">Kelajuan Animasi Titisan Dakwat Reka Bentuk Bahan</translation> <translation id="4555769855065597957">Bayang</translation> +<translation id="4556110439722119938">Penanda halaman, sejarah, kata laluan dan tetapan anda yang lain akan disegerakkan ke Akaun Google supaya anda dapat menggunakannya pada semua peranti anda.</translation> <translation id="4557136421275541763">Amaran:</translation> <translation id="4558426062282641716">Kebenaran autolancar diminta</translation> <translation id="4563210852471260509">Bahasa input permulaan adalah bahasa Cina</translation> @@ -2596,6 +2613,7 @@ <translation id="4742746985488890273">Sematkan pada Rak</translation> <translation id="474421578985060416">Disekat oleh anda</translation> <translation id="4744574733485822359">Muat turun anda telah selesai</translation> +<translation id="4746330764136728131">Gunakan sijil ECDSA untuk WebRTC</translation> <translation id="4746971725921104503">Nampaknya anda sudah mengurus pengguna dengan nama tersebut. Adakah anda ingin <ph name="LINK_START" />mengimport<ph name="USER_DISPLAY_NAME" /> ke peranti ini<ph name="LINK_END" />?</translation> <translation id="4747271164117300400">Macedonia</translation> <translation id="4749157430980974800">Papan kekunci bahasa Georgia</translation> @@ -2745,6 +2763,7 @@ <translation id="496226124210045887">Folder yang anda pilih mengandungi fail sensitif. Adakah anda pasti mahu memberikan "$1" akses membaca tetap kepada folder ini?</translation> <translation id="4964673849688379040">Menyemak...</translation> <translation id="4966802378343010715">Buat pengguna baharu</translation> +<translation id="4967749818080339523">Pilih akaun</translation> <translation id="496888482094675990">Apl Fail memberikan akses pantas kepada fail yang telah anda simpan di Google Drive, storan luaran atau peranti OS Chrome anda.</translation> <translation id="4971412780836297815">Buka apabila selesai</translation> <translation id="497244430928947428">Papan kekunci bahasa Malayalam (Fonetik)</translation> @@ -2791,6 +2810,7 @@ <translation id="5038863510258510803">Mendayakan...</translation> <translation id="5039512255859636053">$1 TB</translation> <translation id="5039804452771397117">Benarkan</translation> +<translation id="5043851552150732346">1 direktori dipilih</translation> <translation id="5045550434625856497">Kata laluan tidak sah</translation> <translation id="5048179823246820836">Nordic</translation> <translation id="5048294425697652159">Dayakan Klien Quirks untuk penentukuran paparan.</translation> @@ -2878,6 +2898,7 @@ <translation id="5170477580121653719">Ruang Google Drive yang tinggal: <ph name="SPACE_AVAILABLE" />.</translation> <translation id="5170568018924773124">Paparkan dalam folder</translation> <translation id="5171045022955879922">Buat carian atau taipkan URL</translation> +<translation id="5171343362375269016">Memori Ditukar</translation> <translation id="5175870427301879686"><ph name="URL" /> mahu menyimpan data anda secara kekal pada komputer setempat anda.</translation> <translation id="5177479852722101802">Teruskan menyekat akses kamera dan mikrofon</translation> <translation id="5177526793333269655">Paparan lakaran kenit</translation> @@ -3035,6 +3056,7 @@ <translation id="5380103295189760361">Tahan Control, Alt, Shift, atau Search untuk melihat pintasan papan kekunci bagi pengubah suai tersebut.</translation> <translation id="5382392428640372740">Dayakan penjejakan navigasi</translation> <translation id="5388588172257446328">Nama pengguna:</translation> +<translation id="5389237414310520250">Pengguna baharu tidak dapat dibuat. Sila semak ruang cakera keras serta kebenaran anda dan cuba lagi.</translation> <translation id="5390284375844109566">Pangkalan data berindeks</translation> <translation id="5392544185395226057">Dayakan sokongan untuk Pelanggan Asli.</translation> <translation id="5396126354477659676">Pemalam <ph name="PEPPER_PLUGIN_NAME" /> di <ph name="PEPPER_PLUGIN_DOMAIN" /> ingin mengakses komputer anda.</translation> @@ -3102,6 +3124,7 @@ <translation id="5469954281417596308">Pengurus penanda halaman</translation> <translation id="5470838072096800024">Masa Terakhir Diterima</translation> <translation id="5473075389972733037">IBM</translation> +<translation id="5473279832922912143">Dayakan V8 untuk menggunakan pentafsir Ignition percubaan untuk pelaksanaan JavaScript.</translation> <translation id="5474139872592516422">Apabila <ph name="PLUGIN_NAME" /> telah selesai dikemas kini, muat semula halaman untuk mengaktifkannya.</translation> <translation id="5480254151128201294">Peranti ini telah dikunci oleh pemiliknya.</translation> <translation id="5483785310822538350">Batalkan akses fail dan peranti</translation> @@ -3129,6 +3152,7 @@ <translation id="5509914365760201064">Pengeluar: <ph name="CERTIFICATE_AUTHORITY" /></translation> <translation id="5511823366942919280">Adakah anda pasti ingin menyediakan peranti ini sebagai "Shark"?</translation> <translation id="5512653252560939721">Sijil pengguna hendaklah disokong perkakasan.</translation> +<translation id="5513242761114685513">Menu konteks</translation> <translation id="5515008897660088170">Tetingkap Apl Paparan Kit Alat.</translation> <translation id="551752069230578406">Menambah pencetak pada akaun anda - proses ini mungkin mengambil sedikit masa...</translation> <translation id="5518584115117143805">Sijil Penyulitan E-mel</translation> @@ -3309,7 +3333,6 @@ <translation id="577322787686508614">Pengendalian baca tidak dibenarkan pada: "<ph name="DEVICE_NAME" />".</translation> <translation id="5774295353725270860">Buka apl Fail</translation> <translation id="5774515636230743468">Ketara:</translation> -<translation id="5776006986202016118">Tapak ini mahu menyambung ke:</translation> <translation id="577624874850706961">Cari kuki</translation> <translation id="5778550464785688721">Kawalan penuh peranti MIDI</translation> <translation id="5780066559993805332">(Terbaik)</translation> @@ -3387,6 +3410,7 @@ <translation id="5874045675243596003">Kuat kuasakan tegas (kegagalan perkakasan jika kami tidak boleh mendapatkan cincangan)</translation> <translation id="5875858680971105888">Op! Pengguna diselia tidak boleh diimport. Sila periksa sambungan rangkaian anda dan cuba lagi kemudian.</translation> <translation id="5880247576487732437">Token Ada</translation> +<translation id="5884474295213649357">Tab ini disambungkan ke peranti USB.</translation> <translation id="5885324376209859881">Uruskan tetapan media...</translation> <translation id="5889282057229379085">Bilangan maksimum CA pengantara: <ph name="NUM_INTERMEDIATE_CA" /></translation> <translation id="5892290200158927959">Papan kekunci BEPO Perancis</translation> @@ -3476,6 +3500,8 @@ <translation id="604124094241169006">Automatik</translation> <translation id="6042308850641462728">Lagi</translation> <translation id="604257181445267932">Smart Lock membantu anda log masuk ke apl dan tapak web dengan cepat menggunakan kata laluan yang telah anda simpan di Google.</translation> +<translation id="6043317578411397101"><ph name="APP_NAME" /> berkongsi tab Chrome dengan <ph name="TAB_NAME" />.</translation> +<translation id="6044805581023976844"><ph name="APP_NAME" /> berkongsi tab dan audio Chrome dengan <ph name="TAB_NAME" />.</translation> <translation id="6049065490165456785">Foto dari kamera dalaman</translation> <translation id="6051028581720248124">Dengan mencetak ke Pejabat FedEx, anda menerima <ph name="START_LINK" />syarat penggunaan<ph name="END_LINK" /> mereka.</translation> <translation id="6051086608691487286">Bar Tatal Tindanan</translation> @@ -3604,6 +3630,7 @@ <translation id="6251889282623539337">Syarat Perkhidmatan <ph name="DOMAIN" /></translation> <translation id="6251924700383757765">Dasar privasi</translation> <translation id="6253586523465486793">Memaksa tarik untuk muat semula mencetuskan muat semula bukan pengesahan (walaupun ini biasanya bermaksud muat semula pengesahan cache biasa apabila bendera dilumpuhkan).</translation> +<translation id="6254182355913122230">Memori ditukar</translation> <translation id="6254503684448816922">Kompromi Penting</translation> <translation id="6259104249628300056">Temui peranti pada rangkaian tempatan anda</translation> <translation id="6263082573641595914">Versi Microsoft CA</translation> @@ -3874,6 +3901,7 @@ <translation id="6680028776254050810">Tukar Pengguna</translation> <translation id="6681668084120808868">Ambil foto</translation> <translation id="668171684555832681">Lain-lain...</translation> +<translation id="6682083956260248340">Kawal cara ciri ini berfungsi dalam <ph name="BEGIN_LINK" /></translation> <translation id="6686490380836145850">Tutup tab di sebelah kanan</translation> <translation id="6686817083349815241">Simpan kata laluan anda</translation> <translation id="6689514201497896398">Pintas semakan penglibatan pengguna</translation> @@ -3941,10 +3969,12 @@ <translation id="6798954102094737107">Pemalam: <ph name="PLUGIN_NAME" /></translation> <translation id="6802031077390104172"><ph name="USAGE" /> (<ph name="OID" />)</translation> <translation id="6804671422566312077">Buka Semua Penanda Halaman dalam Tetingkap &Baharu</translation> +<translation id="6805542829187142700">Dayakan dasar peranti pengesanan automatik zon waktu sistem.</translation> <translation id="6805647936811177813">Sila log masuk ke <ph name="TOKEN_NAME" /> untuk mengimport sijil klien daripada <ph name="HOST_NAME" />.</translation> <translation id="680572642341004180">Dayakan pengesan RLZ pada <ph name="SHORT_PRODUCT_OS_NAME" />.</translation> <translation id="6807889908376551050">Paparkan Semua...</translation> <translation id="6809448577646370871">Pengitaran Tetingkap Tersesuai untuk Apl Chrome.</translation> +<translation id="6810613314571580006">Log masuk secara automatik ke tapak web menggunakan bukti kelayakan yang disimpan. Apabila ciri ini dilumpuhkan, anda akan diminta memberikan pengesahan setiap kali sebelum mengelog masuk ke tapak web.</translation> <translation id="6812349420832218321"><ph name="PRODUCT_NAME" /> tidak dapat dijalankan sebagai akar.</translation> <translation id="6812841287760418429">Simpan perubahan</translation> <translation id="6814124696888326520">Untuk bertukar kaedah input dengan lebih mudah dan akses kepada lebih banyak ciri input: input suara, tulisan tangan dan emoji.</translation> @@ -3960,7 +3990,7 @@ <translation id="6825883775269213504">Bahasa Rusia</translation> <translation id="6827236167376090743">Video ini akan terus dimainkan untuk tempoh yang lama.</translation> <translation id="6828153365543658583">Hadkan log masuk bagi pengguna berikut:</translation> -<translation id="6828434191343384461">Data yang dipilih telah dialih keluar daripada Chrome dan peranti yang disegerakkan. Akaun Google anda mungkin mempunyai sejarah penyemakan imbas dalam bentuk lain seperti carian dan aktiviti daripada perkhidmatan Google lain di <ph name="BEGIN_LINK" />history.google.com<ph name="END_LINK" />.</translation> +<translation id="6828434191343384461">Data yang dipilih telah dialih keluar daripada Chrome dan peranti yang disegerakkan. Akaun Google anda mungkin mempunyai sejarah penyemakan imbas dalam bentuk lain seperti carian dan aktiviti daripada perkhidmatan Google yang lain di <ph name="BEGIN_LINK" />history.google.com<ph name="END_LINK" />.</translation> <translation id="6828860976882136098">Gagal menyediakan kemas kini automatik untuk semua pengguna (ralat sebelum pelaksanaan: <ph name="ERROR_NUMBER" />)</translation> <translation id="6829250331733125857">Dapatkan bantuan berhubung <ph name="DEVICE_TYPE" /> anda.</translation> <translation id="6829270497922309893">Daftar dalam organisasi anda</translation> @@ -4131,6 +4161,7 @@ <translation id="7065534935986314333">Mengenai Sistem</translation> <translation id="7066944511817949584">Gagal untuk bersambung ke "<ph name="DEVICE_NAME" />".</translation> <translation id="7067725467529581407">Jangan sekali-kali tunjukkan ini lagi.</translation> +<translation id="7068609958927777019">Jika didayakan, URL yang tidak sesuai boleh dilaporkan kembali ke SafeSearch.</translation> <translation id="7070804685954057874">Input langsung</translation> <translation id="7072010813301522126">Nama pintasan</translation> <translation id="7072025625456903686">Benarkan semua atau peribadikan</translation> @@ -4196,10 +4227,10 @@ <translation id="7170467426996704624">Pengalihan huruf (salam → ሰላም)</translation> <translation id="7172053773111046550">Papan kekunci Estonia</translation> <translation id="7173828187784915717">Tetapan pengunyahan input</translation> +<translation id="7173917244679555">Nampaknya anda sudah pun mengurus pengguna yang menggunakan nama itu. Adakah anda ingin <ph name="BEGIN_LINK" />mengimport <ph name="PROFILE_NAME" /><ph name="END_LINK" /> ke peranti ini?</translation> <translation id="7175353351958621980">Dimuatkan daripada:</translation> <translation id="7180611975245234373">Muat semula</translation> <translation id="7180865173735832675">Peribadikan</translation> -<translation id="7184428045150946911">Lumpuhkan autosembunyikan bar alat pada tablet besar</translation> <translation id="7185690883425432021">Menyembunyikan butang tutup pada tab tidak aktif apabila jalur tab berada dalam mod tindanan.</translation> <translation id="7186088072322679094">Simpan dalam Bar Alat</translation> <translation id="719009910964971313">Papan kekunci Dvorak Pengatur Cara AS</translation> @@ -4264,6 +4295,7 @@ <translation id="7280825545668757494">Penyegerakan bukti kelayakan Wi-Fi</translation> <translation id="7280877790564589615">Kebenaran diminta</translation> <translation id="7282547042039404307">Lancar</translation> +<translation id="7284549674086796566">Pentafsir JavaScript Percubaan</translation> <translation id="7287143125007575591">Akses ditolak.</translation> <translation id="7288592446024861651">Penanda halaman, sejarah, kata laluan dan tetapan anda yang lain akan disegerakkan ke Akaun Google supaya anda dapat menggunakannya pada semua peranti. Kawal perkara yang akan disegerakkan di <ph name="BEGIN_LINK" /></translation> <translation id="7288676996127329262"><ph name="HORIZONTAL_DPI" />x<ph name="VERTICAL_DPI" /> dpi</translation> @@ -4286,6 +4318,7 @@ <translation id="7321545336522791733">Pelayan tidak dapat dihubungi</translation> <translation id="7325437708553334317">Sambungan Kontras Tinggi</translation> <translation id="7326565110843845436">Klik tiga jari pad sentuh</translation> +<translation id="7327088014939803293">Pengguna di bawah seliaan yang baharu tidak dapat dibuat. Sila pastikan anda dilog masuk dengan betul dan cuba lagi.</translation> <translation id="73289266812733869">Nyahpilih</translation> <translation id="7329154610228416156">Log masuk gagal kerana telah dikonfigurasikan untuk menggunakan URL tidak selamat (<ph name="BLOCKED_URL" />). Sila hubungi pentadbir anda.</translation> <translation id="7331786426925973633">Penyemak imbas web dibina untuk kelajuan, kesederhanaan dan keselamatan</translation> @@ -4459,6 +4492,7 @@ <translation id="7573172247376861652">Cas Bateri</translation> <translation id="7576032389798113292">6x4</translation> <translation id="7576690715254076113">Kumpul semak</translation> +<translation id="7580671184200851182">Mainkan audio yang sama melalui semua pembesar suara (audio mono)</translation> <translation id="7581279002575751816">Pemalam NPAPI tidak disokong.</translation> <translation id="7581462281756524039">Pembersih</translation> <translation id="7582582252461552277">Lebih suka rangkaian ini</translation> @@ -4691,6 +4725,7 @@ <translation id="7925686952655276919">Jangan gunakan data mudah alih untuk penyegerakan</translation> <translation id="7926906273904422255">Tandai asal tidak selamat sebagai tidak selamat atau sebagai "meragukan".</translation> <translation id="7928710562641958568">Keluarkan peranti</translation> +<translation id="79312157130859720"><ph name="APP_NAME" /> berkongsi skrin dan audio anda.</translation> <translation id="7938594894617528435">Di luar talian pada masa ini</translation> <translation id="7939374455203157513">Dayakan Perkhidmatan Awan</translation> <translation id="7939412583708276221">Simpan juga</translation> @@ -5019,7 +5054,7 @@ <translation id="839736845446313156">Daftar</translation> <translation id="8398790343843005537">Cari telefon anda</translation> <translation id="8398877366907290961">Teruskan juga</translation> -<translation id="8399276228600040370">Log masuk dengan akaun anda yang disimpan dengan <ph name="PASSWORD_MANAGER_BRAND" /></translation> +<translation id="8399276228600040370">Log masuk menggunakan akaun anda yang disimpan dengan <ph name="PASSWORD_MANAGER_BRAND" /></translation> <translation id="8401363965527883709">Nyahpilih kotak pilihan</translation> <translation id="8408402540408758445">Praambil hasil carian</translation> <translation id="8410073653152358832">Gunakan telefon ini</translation> @@ -5127,6 +5162,7 @@ <translation id="8571108619753148184">Pelayan 4</translation> <translation id="8572832761467613633">Flash sahaja</translation> <translation id="8572981282494768930">Jangan benarkan tapak mengakses kamera dan mikrofon anda</translation> +<translation id="8574234089711453001">Benarkan butang muat turun dipaparkan semasa membuka halaman dengan url media.</translation> <translation id="857779305329188634">Dayakan sokongan protokol QUIC percubaan.</translation> <translation id="8579285237314169903">Menyegerakkan <ph name="NUMBER_OF_FILES" /> item...</translation> <translation id="8579549103199280730">Ditanya secara lalai</translation> @@ -5182,6 +5218,7 @@ <translation id="8656768832129462377">Jangan periksa</translation> <translation id="8656946437567854031">Apabila Teruskan diklik, bermakna anda bersetuju menerima <ph name="LEGAL_DOC_LINK_TEXT_1" />, <ph name="LEGAL_DOC_LINK_TEXT_2" />, <ph name="LEGAL_DOC_LINK_TEXT_3" />, <ph name="LEGAL_DOC_LINK_TEXT_4" />, <ph name="LEGAL_DOC_LINK_TEXT_5" /> dan <ph name="LEGAL_DOC_LINK_TEXT_6" />.</translation> <translation id="8658595122208653918">Tukar pilihan pencetak...</translation> +<translation id="8658645149275195032"><ph name="APP_NAME" /> berkongsi skrin dan audio anda dengan <ph name="TAB_NAME" />.</translation> <translation id="8659716501582523573">Alamat IP:</translation> <translation id="8661290697478713397">Buka Pautan dalam Tetingkap Inko&gnito</translation> <translation id="8662795692588422978">Orang</translation> @@ -5387,6 +5424,7 @@ <translation id="8942416694471994740">Akses kepada mikrofon anda dikawal oleh pentadbir anda.</translation> <translation id="894360074127026135">Peningkatan Antarabangsa Netscape</translation> <translation id="8944779739948852228">Pencetak dikesan</translation> +<translation id="8944964446326379280"><ph name="APP_NAME" /> berkongsi tetingkap dengan <ph name="TAB_NAME" />.</translation> <translation id="8946359700442089734">Ciri penyahpepijatan tidak didayakan sepenuhnya pada peranti ini <ph name="IDS_SHORT_PRODUCT_NAME" />.</translation> <translation id="8946784827990177241">Dayakan sokongan WebUSB.</translation> <translation id="89515141420106838">Mendayakan apl Galeri Gedung Web Chrome untuk pemacu pencetak. Apl ini menggelintar Gedung Web Chrome untuk mencari sambungan yang menyokong pencetakan ke pencetak USB dengan ID USB khas.</translation> @@ -5405,6 +5443,7 @@ <translation id="8965037249707889821">Masukkan kata laluan lama</translation> <translation id="8965697826696209160">Tiada ruang yang mencukupi.</translation> <translation id="8968527460726243404">Penulis Imej Sistem ChromeOS</translation> +<translation id="8970203673128054105">Lihat senarai mod hantar</translation> <translation id="89720367119469899">Lepas</translation> <translation id="8972513834460200407">Sila semak dengan pentadbir rangkaian anda bagi memastikan bahawa tembok api tidak menyekat muat turun dari pelayan Google.</translation> <translation id="8974161578568356045">Auto Kesan</translation> @@ -5432,6 +5471,7 @@ <translation id="9011178328451474963">Tab lalu</translation> <translation id="9013284500811652791"><ph name="UWS_NAME" />, <ph name="UWS_NAME" /> dan satu lagi</translation> <translation id="9013587737291179248">Op! Pengguna diselia tidak boleh diimport. Sila semak ruang cakera keras dan kebenaran anda, kemudian cuba lagi.</translation> +<translation id="901440679911238150">Butiran akaun anda sudah lapuk. <ph name="BEGIN_LINK" />Log masuk semula<ph name="END_LINK" />.</translation> <translation id="9014987600015527693">Tunjukkan telefon lain</translation> <translation id="9015601075560428829">Input ucapan</translation> <translation id="9016164105820007189">Menyambung ke "<ph name="DEVICE_NAME" />".</translation> @@ -5445,6 +5485,7 @@ <translation id="9025098623496448965">OK, Bawa saya kembali ke skrin log masuk</translation> <translation id="902638246363752736">Tetapan papan kekunci</translation> <translation id="9026731007018893674">muat turun</translation> +<translation id="9027146684281895941">Selia orang ini untuk mengawal dan melihat tapak web yang mereka lawati daripada Akaun Google anda.</translation> <translation id="9027459031423301635">Buka Pautan dalam Tab &Baharu</translation> <translation id="9027603907212475920">Sediakan segerak...</translation> <translation id="9033453977881595182">ID Token</translation> @@ -5559,6 +5600,7 @@ <translation id="9203478404496196495">Nyahredam Tab</translation> <translation id="9203962528777363226">Pentadbir peranti ini telah melumpuhkan pengguna baharu daripada ditambah</translation> <translation id="9205143043463108573">Meletakkan Pelancar Apl di tengah-tengah skrin dengan aspek landskap.</translation> +<translation id="9205160891051296441">Sokongan dasar SystemTimezoneAutomaticDetection</translation> <translation id="9206487995878691001">Kaedah input Cangjie</translation> <translation id="9207194316435230304">ATOK</translation> <translation id="9208886416788010685">Adobe Reader Sudah Lapuk</translation> @@ -5580,6 +5622,7 @@ <translation id="939736085109172342">Folder baharu</translation> <translation id="940425055435005472">Saiz fon:</translation> <translation id="941543339607623937">Kunci persendirian tidak sah.</translation> +<translation id="942532530371314860"><ph name="APP_NAME" /> berkongsi tab dan audio Chrome.</translation> <translation id="942954117721265519">Tiada imej dalam direktori ini.</translation> <translation id="945522503751344254">Hantar maklum balas</translation> <translation id="946810925362320585">Ikut cadangan</translation>
diff --git a/chrome/app/resources/generated_resources_nl.xtb b/chrome/app/resources/generated_resources_nl.xtb index 0dc2a46a..78f24176 100644 --- a/chrome/app/resources/generated_resources_nl.xtb +++ b/chrome/app/resources/generated_resources_nl.xtb
@@ -661,7 +661,6 @@ <translation id="1962233722219655970">Deze pagina gebruikt een Native Client-app die niet werkt op je computer.</translation> <translation id="1965328510789761112">Privégeheugen</translation> <translation id="1965624977906726414">Heeft geen speciale rechten.</translation> -<translation id="1968720524450620475">Actiepictogrammen voor webmeldingen inschakelen.</translation> <translation id="1970746430676306437">&Paginagegevens weergeven</translation> <translation id="197288927597451399">Behouden</translation> <translation id="1973491249112991739">Downloaden van <ph name="PLUGIN_NAME" /> mislukt.</translation> @@ -1424,7 +1423,6 @@ <translation id="302014277942214887">Geef de app-ID of URL voor Web Store op.</translation> <translation id="3020616530769498629">Opnieuw laden zonder validatie inschakelen voor 'omlaag trekken om te vernieuwen'</translation> <translation id="3020990233660977256">Serienummer: <ph name="SERIAL_NUMBER" /></translation> -<translation id="3021245547458004908">Wanneer deze functie is ingeschakeld, wordt de werkbalk nooit verborgen tijdens het scrollen op apparaten met een minimale schermwaarde van 800 dp. De werkbalk wordt nog wel verborgen als de pagina op volledig scherm wordt bekeken.</translation> <translation id="3021678814754966447">&Framebron weergeven</translation> <translation id="3024374909719388945">24-uurs klok gebruiken</translation> <translation id="3025022340603654002">Suggesties voor automatisch aanvullen doen bij eerste muisklik op een formulierelement.</translation> @@ -1495,7 +1493,6 @@ <translation id="3117812041123364382">Het zwevende virtuele toetsenbord in-/uitschakelen.</translation> <translation id="3118319026408854581"><ph name="PRODUCT_NAME" /> Help</translation> <translation id="3120430004221004537">Onvoldoende versleuteling voor een bepaalde bewerking op: <ph name="DEVICE_NAME" />.</translation> -<translation id="3121260210578524273">Pictogrammen in actieknoppen voor webmeldingen inschakelen.</translation> <translation id="3121793941267913344">Dit <ph name="IDS_SHORT_PRODUCT_NAME" />-apparaat herstellen</translation> <translation id="3122162841865761901">Experimenten met Ontwikkelaarstools</translation> <translation id="3122464029669770682">CPU</translation> @@ -2277,6 +2274,7 @@ <translation id="421017592316736757">Je moet online zijn om dit bestand te openen.</translation> <translation id="421182450098841253">&Bladwijzerbalk weergeven</translation> <translation id="4212108296677106246">Wil je '<ph name="CERTIFICATE_NAME" />' vertrouwen als certificeringsinstantie?</translation> +<translation id="42126664696688958">Exporteren</translation> <translation id="42137655013211669">De toegang tot deze bron is verboden door de server.</translation> <translation id="4215350869199060536">Er staan niet-toegestane gegevens in de naam.</translation> <translation id="4215898373199266584">De volgende keer kan het handig zijn de incognitomodus (<ph name="INCOGNITO_MODE_SHORTCUT" />) te gebruiken.</translation> @@ -3307,7 +3305,6 @@ <translation id="577322787686508614">Leesbewerking is niet toegestaan op: <ph name="DEVICE_NAME" />.</translation> <translation id="5774295353725270860">App Bestanden openen</translation> <translation id="5774515636230743468">Manifest:</translation> -<translation id="5776006986202016118">Deze site wil verbinding maken met:</translation> <translation id="577624874850706961">Cookies zoeken</translation> <translation id="5778550464785688721">Volledige controle voor MIDI-apparaten</translation> <translation id="5780066559993805332">(Beste)</translation> @@ -4201,7 +4198,6 @@ <translation id="7175353351958621980">Geladen via:</translation> <translation id="7180611975245234373">Vernieuwen</translation> <translation id="7180865173735832675">Aanpassen</translation> -<translation id="7184428045150946911">Automatisch verbergen van de werkbalk uitschakelen op grote tablets</translation> <translation id="7185690883425432021">De knoppen voor het sluiten van inactieve tabbladen worden verborgen wanneer de tabbladstrook zich in de gestapelde modus bevindt.</translation> <translation id="7186088072322679094">In werkbalk houden</translation> <translation id="719009910964971313">Amerikaans Programmer Dvorak-toetsenbord</translation>
diff --git a/chrome/app/resources/generated_resources_no.xtb b/chrome/app/resources/generated_resources_no.xtb index 5136ac1..f255a5b8 100644 --- a/chrome/app/resources/generated_resources_no.xtb +++ b/chrome/app/resources/generated_resources_no.xtb
@@ -658,7 +658,6 @@ <translation id="1962233722219655970">Denne siden bruker en Native Client-app som ikke fungerer på datamaskinen din.</translation> <translation id="1965328510789761112">Privat minne</translation> <translation id="1965624977906726414">Har ingen spesielle tillatelser.</translation> -<translation id="1968720524450620475">Slå på handlingsikonene for nettvarsler.</translation> <translation id="1970746430676306437">Vis side&informasjon</translation> <translation id="197288927597451399">Behold</translation> <translation id="1973491249112991739">Nedlasting av <ph name="PLUGIN_NAME" /> mislyktes.</translation> @@ -1150,7 +1149,7 @@ <translation id="267285457822962309">Endre innstillinger som er spesifikke for enheten din og eksterne enheter.</translation> <translation id="2673135533890720193">lese nettleserloggen din</translation> <translation id="2673589024369449924">Opprett en skrivebordssnarvei for denne brukeren</translation> -<translation id="2675358154061544447">Svært eksperimentell støtte for gjengivelse av iframes med koblinger til andre nettsteder i separate prosesser. I denne modusen deler dokumenter en gjengivelsesprosess, men bare hvis de er fra samme nettsted.</translation> +<translation id="2675358154061544447">Svært eksperimentell støtte for gjengivelse av iframes med koblinger til andre nettsteder i separate prosesser. I denne modusen blir gjengivelsesprosesser bare delt mellom dokumenter fra samme nettsted.</translation> <translation id="2676946222714718093">Spilles av på</translation> <translation id="2678063897982469759">Aktiver på nytt</translation> <translation id="2678246812096664977">Alle programtillegg</translation> @@ -1419,7 +1418,6 @@ <translation id="302014277942214887">Skriv inn app-ID-en eller nettadressen til nettbutikken.</translation> <translation id="3020616530769498629">Slå på ikke-validerende ny innlasting ved «trekk for å laste inn på nytt»</translation> <translation id="3020990233660977256">Serienummer: <ph name="SERIAL_NUMBER" /></translation> -<translation id="3021245547458004908">Når dette er slått på, fører rulling aldri til at verktøyraden skjules på enheter med en dp-verdi for skjermen på minst 800. Den skjules likevel hvis sideinnholdet vises i fullskjerm.</translation> <translation id="3021678814754966447">&Vis rammekilde</translation> <translation id="3024374909719388945">Bruk 24-timersklokke</translation> <translation id="3025022340603654002">Tilby autofyllforslag for det første museklikket på et skjemaelement.</translation> @@ -1490,7 +1488,6 @@ <translation id="3117812041123364382">Slår det flytende virtuelle tastaturet på/av.</translation> <translation id="3118319026408854581">Hjelp for <ph name="PRODUCT_NAME" /></translation> <translation id="3120430004221004537">Utilstrekkelig kryptering for en angitt operasjon på: «<ph name="DEVICE_NAME" />».</translation> -<translation id="3121260210578524273">Vis ikoner på handlingsknappene for nettvarsler.</translation> <translation id="3121793941267913344">Tilbakestill denne <ph name="IDS_SHORT_PRODUCT_NAME" />-enheten</translation> <translation id="3122162841865761901">Eksperimenter i utviklerverktøyene</translation> <translation id="3122464029669770682">Prosessor</translation> @@ -2268,6 +2265,7 @@ <translation id="421017592316736757">Du må ha Internett-tilkobling for å få tilgang til denne filen.</translation> <translation id="421182450098841253">&Vis bokmerkerad</translation> <translation id="4212108296677106246">Vil du stole på «<ph name="CERTIFICATE_NAME" />» som en sertifiseringsinstans?</translation> +<translation id="42126664696688958">Eksportér</translation> <translation id="42137655013211669">Tilgangen til denne ressursen ble avvist av tjeneren.</translation> <translation id="4215350869199060536">Ojsann – det er ulovlige symboler i navnet!</translation> <translation id="4215898373199266584">Forresten: Inkognitomodus (<ph name="INCOGNITO_MODE_SHORTCUT" />) kan være hendig neste gang.</translation> @@ -2440,7 +2438,7 @@ <translation id="4509017836361568632">Slett bilde</translation> <translation id="4509345063551561634">Plassering:</translation> <translation id="4514542542275172126">Konfigurer en ny administrert bruker</translation> -<translation id="4514914692061505365">Tving bruk av PNaCls raske Subzero-oversetter for alle pexe-filer.</translation> +<translation id="4514914692061505365">Tving bruk av den raske PNaCl Subzero-oversetteren for alle pexe-filer.</translation> <translation id="4518677423782794009">Krasjer Chrome? Ser du uvanlige oppstartssider, verktøyrader eller uventede annonser du ikke blir kvitt? Eller blir nettleserbruken endret på annen måte? Det kan hende du kan løse problemet ved å kjøre opprydningsverktøyet for Chrome.</translation> <translation id="452039078290142656">ukjente enheter fra <ph name="VENDOR_NAME" /></translation> <translation id="4522570452068850558">Detaljer</translation> @@ -3296,7 +3294,6 @@ <translation id="577322787686508614">Leseoperasjonen er ikke tillatt på: «<ph name="DEVICE_NAME" />».</translation> <translation id="5774295353725270860">Åpne Filer-appen</translation> <translation id="5774515636230743468">Manifest:</translation> -<translation id="5776006986202016118">Dette nettstedet vil koble til</translation> <translation id="577624874850706961">Søk i informasjonskapsler</translation> <translation id="5778550464785688721">Full kontroll av MIDI-enheter</translation> <translation id="5780066559993805332">(Best)</translation> @@ -3946,7 +3943,7 @@ <translation id="6825883775269213504">Russisk</translation> <translation id="6827236167376090743">Denne videoen fortsetter å spilles av til Dovre faller.</translation> <translation id="6828153365543658583">Begrens pålogging til følgende brukere:</translation> -<translation id="6828434191343384461">De merkede dataene er fjernet fra Chrome og alle synkroniserte enheter. Det kan hende at Google-kontoen din har andre typer nettlesingslogger, for eksempel for søk og aktivitet fra andre Google-tjenester, på <ph name="BEGIN_LINK" /> history.google.com <ph name="END_LINK" /> .</translation> +<translation id="6828434191343384461">De valgte dataene er fjernet fra Chrome og alle synkroniserte enheter. Det kan hende at Google-kontoen din har andre typer nettlesingslogger, for eksempel for søk og aktivitet fra andre Google-tjenester, på <ph name="BEGIN_LINK" /> history.google.com <ph name="END_LINK" /> .</translation> <translation id="6828860976882136098">Kunne ikke konfigurere automatiske oppdateringer for alle brukerne (feil ved kjøring av forhåndskontroll: <ph name="ERROR_NUMBER" />)</translation> <translation id="6829250331733125857">Få hjelp med <ph name="DEVICE_TYPE" />.</translation> <translation id="6829270497922309893">Registrer deg for organisasjonen din</translation> @@ -4185,7 +4182,6 @@ <translation id="7175353351958621980">Lastet fra:</translation> <translation id="7180611975245234373">Last inn på nytt</translation> <translation id="7180865173735832675">Tilpass</translation> -<translation id="7184428045150946911">Slå av automatisk skjuling av verktøylinjen på store nettbrett</translation> <translation id="7185690883425432021">Skjuler lukkeknappene på inaktive faner når fanestripen er i stablet modus.</translation> <translation id="7186088072322679094">Behold i verktøyraden</translation> <translation id="719009910964971313">Amerikansk programmeringstastatur (Dvorak)</translation>
diff --git a/chrome/app/resources/generated_resources_pl.xtb b/chrome/app/resources/generated_resources_pl.xtb index 43a647f..a042605 100644 --- a/chrome/app/resources/generated_resources_pl.xtb +++ b/chrome/app/resources/generated_resources_pl.xtb
@@ -661,7 +661,6 @@ <translation id="1962233722219655970">Ta strona używa aplikacji klienta natywnego, która nie działa na Twoim komputerze.</translation> <translation id="1965328510789761112">Pamięć prywatna</translation> <translation id="1965624977906726414">Nie ma specjalnych uprawnień.</translation> -<translation id="1968720524450620475">Włącz ikony czynności w powiadomieniach internetowych.</translation> <translation id="1970746430676306437">Wyświetl &informacje o stronie</translation> <translation id="197288927597451399">Zachowaj</translation> <translation id="1973491249112991739">Błąd pobierania <ph name="PLUGIN_NAME" />.</translation> @@ -1423,7 +1422,6 @@ <translation id="302014277942214887">Wpisz ID aplikacji lub URL sklepu internetowego.</translation> <translation id="3020616530769498629">Włącz ponowne ładowanie stron jednym ruchem palca bez sprawdzania poprawności</translation> <translation id="3020990233660977256">Numer seryjny: <ph name="SERIAL_NUMBER" /></translation> -<translation id="3021245547458004908">Po włączeniu tej opcji pasek narzędzi nie będzie już ukrywany w wyniku przewijania na urządzeniach z ekranem mającym 800 dp lub więcej. Zostanie jednak ukryty, gdy strona wyświetli się w trybie pełnoekranowym.</translation> <translation id="3021678814754966447">&Wyświetl źródło ramki</translation> <translation id="3024374909719388945">Zegar 24-godzinny</translation> <translation id="3025022340603654002">Wyświetlaj sugestie autouzupełniania przy pierwszym kliknięciu elementu formularza.</translation> @@ -1494,7 +1492,6 @@ <translation id="3117812041123364382">Włącz/wyłącz swobodną klawiaturę wirtualną.</translation> <translation id="3118319026408854581"><ph name="PRODUCT_NAME" /> – pomoc</translation> <translation id="3120430004221004537">Zbyt słabe szyfrowanie tej operacji na: „<ph name="DEVICE_NAME" />”.</translation> -<translation id="3121260210578524273">Włącz ikony w przyciskach polecenia w powiadomieniach internetowych.</translation> <translation id="3121793941267913344">Zresetuj to urządzenie z <ph name="IDS_SHORT_PRODUCT_NAME" /></translation> <translation id="3122162841865761901">Eksperymenty na platformie Developer Tools</translation> <translation id="3122464029669770682">Procesor</translation> @@ -2276,6 +2273,7 @@ <translation id="421017592316736757">Musisz być w trybie online, by uzyskać dostęp do tego pliku.</translation> <translation id="421182450098841253">&Pokaż pasek zakładek</translation> <translation id="4212108296677106246">Czy chcesz zaufać certyfikatowi „<ph name="CERTIFICATE_NAME" />” jako urzędowi certyfikacji?</translation> +<translation id="42126664696688958">Eksportuj</translation> <translation id="42137655013211669">Serwer zabronił dostępu do tego zasobu.</translation> <translation id="4215350869199060536">Ups! W nazwie są niedozwolone znaki.</translation> <translation id="4215898373199266584">Psst! Następnym razem możesz użyć trybu incognito (<ph name="INCOGNITO_MODE_SHORTCUT" />).</translation> @@ -3306,7 +3304,6 @@ <translation id="577322787686508614">Nie jest dozwolona operacja odczytu na: „<ph name="DEVICE_NAME" />”.</translation> <translation id="5774295353725270860">Otwórz aplikację Pliki</translation> <translation id="5774515636230743468">Manifest:</translation> -<translation id="5776006986202016118">Ta strona chce nawiązać połączenie z:</translation> <translation id="577624874850706961">Szukaj plików cookie</translation> <translation id="5778550464785688721">Pełne sterowanie urządzeniami MIDI</translation> <translation id="5780066559993805332">(Najlepsza)</translation> @@ -4194,7 +4191,6 @@ <translation id="7175353351958621980">Załadowane z:</translation> <translation id="7180611975245234373">Odśwież</translation> <translation id="7180865173735832675">Dostosuj</translation> -<translation id="7184428045150946911">Wyłącz autoukrywanie paska narzędzi na dużych tabletach</translation> <translation id="7185690883425432021">Ukrywa przyciski zamykania nieaktywnych kart, gdy pasek kart jest w trybie stosu.</translation> <translation id="7186088072322679094">Zachowaj na pasku narzędzi</translation> <translation id="719009910964971313">Klawiatura amerykańska programisty (Dvorak)</translation>
diff --git a/chrome/app/resources/generated_resources_pt-BR.xtb b/chrome/app/resources/generated_resources_pt-BR.xtb index 5d81d44a..5d222b06 100644 --- a/chrome/app/resources/generated_resources_pt-BR.xtb +++ b/chrome/app/resources/generated_resources_pt-BR.xtb
@@ -183,16 +183,19 @@ <translation id="1259724620062607540">Item 7 da estante</translation> <translation id="1260240842868558614">Exibir:</translation> <translation id="126710816202626562">Idioma de tradução:</translation> +<translation id="1269690813141254680">Controla a maneira como o Google usa seu histórico de navegação para personalizar a Pesquisa e outros serviços nossos nos <ph name="BEGIN_LINK" />Controles de atividades do Google<ph name="END_LINK" />.</translation> <translation id="1272079795634619415">Parar</translation> <translation id="1272978324304772054">Esta conta de usuário não pertence ao domínio no qual o dispositivo está inscrito. Para se inscrever em um domínio diferente, é preciso passar pela recuperação do dispositivo primeiro.</translation> <translation id="127353061808977798">Fontes e codificação</translation> <translation id="1274997165432133392">Cookies e outros dados do site</translation> <translation id="1275718070701477396">Selecionado</translation> +<translation id="1277908057200820621">Ver lista de dispositivos</translation> <translation id="1278049586634282054">Inspecionar visualizações:</translation> <translation id="1278813325885878377">Teclado QWERTY húngaro</translation> <translation id="1285320974508926690">Nunca traduzir este site</translation> <translation id="1285484354230578868">Armazenar dados em sua conta do Google Drive</translation> <translation id="1290223615328246825">Falha no login automático</translation> +<translation id="1293509594570842875">Não foi possível criar o novo usuário supervisionado. Verifique sua conexão de rede e tente novamente mais tarde.</translation> <translation id="1293556467332435079">Arquivos</translation> <translation id="1294298200424241932">Editar configurações de confiança:</translation> <translation id="1295794900245526845">Selecionar sua conta salva com o <ph name="PASSWORD_MANAGER_BRAND" /> para fazer login</translation> @@ -291,6 +294,7 @@ <translation id="1429740407920618615">Intensidade do sinal:</translation> <translation id="143027896309062157">Ler e modificar todos os dados no seu computador e nos sites que você visitar</translation> <translation id="1430915738399379752">Imprimir</translation> +<translation id="1433423644370450034">Notificação de estilo de mídia</translation> <translation id="1434696352799406980">Esta função irá redefinir sua página de inicialização, a página "Nova guia", o mecanismo de pesquisa e as guias fixadas. Além disso, desativará todas as extensões e limpará dados temporários, como cookies. Seus favoritos, histórico e senhas salvas não serão limpos.</translation> <translation id="1434886155212424586">A página inicial é a página "Nova guia"</translation> <translation id="1435550882135542937">Reformulação da barra de ferramentas da extensão.</translation> @@ -378,6 +382,7 @@ <translation id="1526925867532626635">Confirmar configurações de sincronização</translation> <translation id="1528372117901087631">Conexão com a Internet</translation> <translation id="1529968269513889022">a última semana</translation> +<translation id="1531865825384516080">Denunciar URLs para o SafeSearch</translation> <translation id="1532697124104874386">Ativar/desativar implantação inteligente do teclado virtual.</translation> <translation id="1533897085022183721">Menos de <ph name="MINUTES" />.</translation> <translation id="1533920822694388968">Alinhamento da TV</translation> @@ -661,7 +666,6 @@ <translation id="1962233722219655970">Esta página usa um aplicativo de cliente nativo que não funciona em seu computador.</translation> <translation id="1965328510789761112">Memória particular</translation> <translation id="1965624977906726414">Sem permissões especiais.</translation> -<translation id="1968720524450620475">Ativar ícones de ação para notificações da Web.</translation> <translation id="1970746430676306437">Visualizar &informações da página</translation> <translation id="197288927597451399">Manter</translation> <translation id="1973491249112991739">Erro no download do <ph name="PLUGIN_NAME" />.</translation> @@ -759,6 +763,7 @@ <translation id="212862741129535676">Porcentagem de ocupação em estado de frequência</translation> <translation id="2128691215891724419">Erro de sincronização: atualize a senha de sincronização...</translation> <translation id="2129904043921227933">Erro de sincronização: atualize a senha de sincronização...</translation> +<translation id="2130053362119884302">Permitir liberação de guia em tela cheia</translation> <translation id="2131077480075264">Não foi possível instalar o app "<ph name="APP_NAME" />" porque ele não é permitido por "<ph name="IMPORT_NAME" />"</translation> <translation id="2134149231879627725">Permite que o Google ajude você a bloquear, limpar e localizar remotamente seu dispositivo.</translation> <translation id="2134986351331412790">Este site não aceita a bandeira deste cartão.</translation> @@ -771,6 +776,7 @@ <translation id="2143778271340628265">Configuração manual de proxy</translation> <translation id="2143915448548023856">Configurações de exibição</translation> <translation id="2144536955299248197">Visualizador do certificado: <ph name="CERTIFICATE_NAME" /></translation> +<translation id="2147827593068025794">Sincronização em segundo plano</translation> <translation id="2148756636027685713">Formatação concluída</translation> <translation id="2148892889047469596">Transmitir guia</translation> <translation id="2148999191776934271">Carregamento completo em <ph name="HOUR" />:<ph name="MINUTE" /></translation> @@ -1148,6 +1154,7 @@ <translation id="2665717534925640469">Esta página está em modo de tela inteira e desativou o cursor do mouse.</translation> <translation id="2665919335226618153">Ah, não! Ocorreu um erro durante a formatação.</translation> <translation id="2668079306436607263">Histórico de navegação a partir da rolagem</translation> +<translation id="2670102641511624474">O app <ph name="APP_NAME" /> está compartilhando uma guia do Chrome.</translation> <translation id="2670965183549957348">Método de entrada Chewing</translation> <translation id="2672142220933875349">Arquivo crx defeituoso, a descompactação falhou.</translation> <translation id="2672394958563893062">Ocorreu um erro. Clique para voltar ao início.</translation> @@ -1194,6 +1201,7 @@ <translation id="2733364097704495499">Você deseja registrar a impressora <ph name="PRINTER_NAME" /> no Google Cloud Print?</translation> <translation id="2735698359135166290">Teclado romeno padrão</translation> <translation id="2737363922397526254">Recolher...</translation> +<translation id="2737755522130570180">Bloquear scripts carregados via document.write</translation> <translation id="2738771556149464852">Não depois</translation> <translation id="2739191690716947896">Depurar</translation> <translation id="2739240477418971307">Modificar suas configurações de acessibilidade</translation> @@ -1263,6 +1271,7 @@ <translation id="2805646850212350655">Sistema de arquivos com criptografia da Microsoft</translation> <translation id="2805707493867224476">Permitir que todos os sites exibam pop-ups</translation> <translation id="2805756323405976993">Apps</translation> +<translation id="2808243220963392165">Permite que guias sejam liberadas da faixa de guias quando o usuário estiver no modo tela cheia no Mac.</translation> <translation id="2809142985846095314">Ativar o upload de ofertas de cartões de crédito preenchidos automaticamente</translation> <translation id="2809346626032021864">Leitura</translation> <translation id="2809586584051668049">e mais <ph name="NUMBER_ADDITIONAL_DISABLED" /></translation> @@ -1391,6 +1400,7 @@ <translation id="2968792643335932010">Menos cópias</translation> <translation id="2971033837577180453"><span>Código:</span><ph name="EXTENSION_ID" /></translation> <translation id="2971213274238188218">diminuir brilho</translation> +<translation id="2971422413423640756">Botão de download ao abrir uma página com URL de mídia.</translation> <translation id="2972557485845626008">Firmware</translation> <translation id="2972581237482394796">&Refazer</translation> <translation id="297870353673992530">Servidor DNS:</translation> @@ -1423,7 +1433,6 @@ <translation id="302014277942214887">Insira o ID do aplicativo ou o URL da loja on-line.</translation> <translation id="3020616530769498629">Ativar atualização de não validação na configuração puxar para atualizar</translation> <translation id="3020990233660977256">Número de série: <ph name="SERIAL_NUMBER" /></translation> -<translation id="3021245547458004908">Quando ativada, a barra de ferramentas nunca fica oculta devido à rolagem em dispositivos com um dp de tela de no mínimo >= 800. No entanto, ela fica oculta se o conteúdo da página entra no modo tela cheia.</translation> <translation id="3021678814754966447">&Exibir código fonte do frame</translation> <translation id="3024374909719388945">Usar relógio no formato 24 horas</translation> <translation id="3025022340603654002">Fazer sugestões de preenchimento automático com um clique inicial do mouse em um elemento de formulário.</translation> @@ -1456,6 +1465,7 @@ <translation id="3057861065630527966">Fazer backup de suas fotos e seus vídeos</translation> <translation id="3058212636943679650">Se alguma vez tiver que restaurar o sistema operacional do seu computador, você precisará de um cartão SD de recuperação ou um cartão de memória USB.</translation> <translation id="305932878998873762">O Cache simples para HTTP é um novo cache. Ele conta com o sistema de arquivos para alocação do espaço em disco.</translation> +<translation id="3062606427884046423">Usar notificações MediaStyle do Android para notificações de mídia do Chrome.</translation> <translation id="3064388234319122767">Transliteração (zdravo → здраво)</translation> <translation id="3065041951436100775">Feedback para guia desativada.</translation> <translation id="3065140616557457172">Digite para pesquisar ou insira um URL para navegar - o que você preferir.</translation> @@ -1494,7 +1504,6 @@ <translation id="3117812041123364382">Ativar/Desativar teclado virtual flutuante.</translation> <translation id="3118319026408854581">Ajuda do <ph name="PRODUCT_NAME" /></translation> <translation id="3120430004221004537">Criptografia insuficiente para uma determinada operação em "<ph name="DEVICE_NAME" />".</translation> -<translation id="3121260210578524273">Ativa ícones em botões de ação para notificações da Web.</translation> <translation id="3121793941267913344">Restaurar este dispositivo <ph name="IDS_SHORT_PRODUCT_NAME" /></translation> <translation id="3122162841865761901">Experiências das ferramentas do desenvolvedor</translation> <translation id="3122464029669770682">CPU</translation> @@ -1539,6 +1548,7 @@ <translation id="3170072451822350649">Também é possível ignorar o login e <ph name="LINK_START" />navegar como visitante<ph name="LINK_END" />.</translation> <translation id="3170544058711792988">Manter foco da lupa centralizado na tela</translation> <translation id="3172213052701798825">Google Smart Lock para senhas</translation> +<translation id="3175469972022788345">Quando ativada, o WebRTC usa certificados ECDSA.</translation> <translation id="317583078218509884">As novas configurações de permissões de site entrarão em vigor quando a página for atualizada.</translation> <translation id="3177048931975664371">Clique para ocultar senha</translation> <translation id="3180365125572747493">Digite uma senha para criptografar este arquivo de certificado.</translation> @@ -1993,6 +2003,7 @@ <translation id="3776796446459804932">Esta extensão viola a política da Chrome Web Store.</translation> <translation id="3778152852029592020">O download foi cancelado.</translation> <translation id="3778740492972734840">Ferramentas do &desenvolvedor</translation> +<translation id="3780663724044634171">Selecione uma conta para administrar o usuário supervisionado.</translation> <translation id="378312418865624974">Ler o identificador exclusivo deste computador</translation> <translation id="3783640748446814672">alt</translation> <translation id="3785308913036335955">Mostrar atalho para aplicativos</translation> @@ -2016,6 +2027,7 @@ <translation id="3807747707162121253">&Cancelar</translation> <translation id="3809280248639369696">Lunar</translation> <translation id="3810973564298564668">Gerenciar</translation> +<translation id="3811494700605067549">1 arquivo selecionado</translation> <translation id="3812034401428455285"><ph name="UWS_NAME" /> e <ph name="UWS_NAME" /></translation> <translation id="3812525830114410218">Certificado inválido</translation> <translation id="3813984289128269159">Ok Google</translation> @@ -2045,6 +2057,7 @@ <translation id="3838543471119263078">Cookies e outros dados de site e plug-in</translation> <translation id="3839497635014791588">Feedback de toque adicional sobre componentes de interface do usuário</translation> <translation id="3840053866656739575">Conexão com o Chromebox perdida. Aproxime ou verifique seu dispositivo enquanto tentamos reconectar.</translation> +<translation id="3840055807562919428">Proíbe buscas por scripts bloqueadores de analisadores de terceiros inseridos no frame principal via document.write.</translation> <translation id="3842552989725514455">Fonte Serif</translation> <translation id="3846593650622216128">Estas configurações são aplicadas por uma extensão.</translation> <translation id="3846833722648675493">Mostra janelas dos aplicativos após primeira a detecção ("show-on-first-paint"). As janelas serão mostradas bastante tempo depois para aplicativos pesados que estejam carregando recursos de modo síncrono. No entanto, esse tempo é insignificativo para aplicativos que carregam recursos de forma assíncrona.</translation> @@ -2276,6 +2289,7 @@ <translation id="421017592316736757">É necessário estar conectado para acessar este arquivo.</translation> <translation id="421182450098841253">&Exibir barra de favoritos</translation> <translation id="4212108296677106246">Deseja confiar em "<ph name="CERTIFICATE_NAME" />" como uma Autoridade de certificação?</translation> +<translation id="42126664696688958">Exportar</translation> <translation id="42137655013211669">O acesso a este recurso foi proibido pelo servidor.</translation> <translation id="4215350869199060536">Ops, o nome contém símbolos inválidos.</translation> <translation id="4215898373199266584">Psiu! O modo anônimo (<ph name="INCOGNITO_MODE_SHORTCUT" />) pode ser útil na próxima vez.</translation> @@ -2361,6 +2375,7 @@ <translation id="4359408040881008151">Instalada devido a extensões dependentes.</translation> <translation id="4361190688154226069">Segmentação baseada em retângulo para visualizações</translation> <translation id="4364444725319685468"><ph name="FILE_NAME" /> transferido por download</translation> +<translation id="4364567974334641491">O app <ph name="APP_NAME" /> está compartilhando uma janela.</translation> <translation id="4364830672918311045">Exibir notificações</translation> <translation id="4365673000813822030">Ops, a sincronização parou de funcionar.</translation> <translation id="4366509400410520531">Permitida pelo usuário</translation> @@ -2430,6 +2445,7 @@ <translation id="4479639480957787382">Ethernet</translation> <translation id="4479812471636796472">Teclado americano Dvorak</translation> <translation id="4481249487722541506">Carregar extensão expandida...</translation> +<translation id="4482194545587547824">O Google pode usar seu histórico de navegação para personalizar a Pesquisa e outros serviços Google</translation> <translation id="4487088045714738411">Teclado belga</translation> <translation id="4492190037599258964">Resultados de pesquisa para "<ph name="SEARCH_STRING" />"</translation> <translation id="4495021739234344583">Cancelar inscrição e reiniciar</translation> @@ -2473,6 +2489,7 @@ <translation id="4554591392113183336">A extensão externa está na mesma versão ou em uma versão anterior à existente.</translation> <translation id="4554796861933393312">Velocidade de animação da gota de tinta do Material design</translation> <translation id="4555769855065597957">Shadow</translation> +<translation id="4556110439722119938">Seus favoritos, histórico, senhas e outras configurações serão sincronizados com sua Conta do Google para que seja possível usá-los em todos os seus dispositivos</translation> <translation id="4557136421275541763">Aviso:</translation> <translation id="4558426062282641716">Permissão de inicialização automática solicitada</translation> <translation id="4563210852471260509">O idioma de entrada inicial é o chinês</translation> @@ -2593,6 +2610,7 @@ <translation id="4742746985488890273">Fixar na estante</translation> <translation id="474421578985060416">Bloqueada pelo usuário</translation> <translation id="4744574733485822359">O download foi concluído</translation> +<translation id="4746330764136728131">Usar certificados ECDSA para WebRTC</translation> <translation id="4746971725921104503">Parece que você já está gerenciando um usuário com esse nome. Deseja <ph name="LINK_START" />importar <ph name="USER_DISPLAY_NAME" /> para este dispositivo<ph name="LINK_END" />?</translation> <translation id="4747271164117300400">Macedônio</translation> <translation id="4749157430980974800">Teclado georgiano</translation> @@ -2741,6 +2759,7 @@ <translation id="496226124210045887">A pasta selecionada contém arquivos confidenciais. Tem certeza de que deseja conceder a "$1" acesso permanente de leitura a esta pasta?</translation> <translation id="4964673849688379040">Verificando...</translation> <translation id="4966802378343010715">Criar um novo usuário</translation> +<translation id="4967749818080339523">Selecionar uma conta</translation> <translation id="496888482094675990">O aplicativo Arquivos fornece acesso rápido a arquivos que foram salvos no Google Drive, em armazenamento externo ou no seu dispositivo Chrome OS.</translation> <translation id="4971412780836297815">Abrir quando estiver concluído</translation> <translation id="497244430928947428">Teclado malaiala (fonético)</translation> @@ -2787,6 +2806,7 @@ <translation id="5038863510258510803">Ativando...</translation> <translation id="5039512255859636053">$1 TB</translation> <translation id="5039804452771397117">Permitir</translation> +<translation id="5043851552150732346">1 diretório selecionado</translation> <translation id="5045550434625856497">Senha incorreta</translation> <translation id="5048179823246820836">Nórdico</translation> <translation id="5048294425697652159">Ativa a calibragem de tela para o Cliente Quirks.</translation> @@ -2874,6 +2894,7 @@ <translation id="5170477580121653719">Espaço restante no Google Drive: <ph name="SPACE_AVAILABLE" />.</translation> <translation id="5170568018924773124">Mostrar na pasta</translation> <translation id="5171045022955879922">Pesquisar ou digitar URL</translation> +<translation id="5171343362375269016">Memória trocada</translation> <translation id="5175870427301879686"><ph name="URL" /> quer armazenar permanentemente os dados no computador local.</translation> <translation id="5177479852722101802">Continuar bloqueando acesso à câmera e ao microfone</translation> <translation id="5177526793333269655">Visualização em miniatura</translation> @@ -3031,6 +3052,7 @@ <translation id="5380103295189760361">Pressione Control, Alt, Shift ou "Pesquisar" para visualizar os atalhos do teclado para estes modificadores.</translation> <translation id="5382392428640372740">Ativar o rastreamento de navegação</translation> <translation id="5388588172257446328">Nome de usuário:</translation> +<translation id="5389237414310520250">Não foi possível criar o novo usuário. Verifique o espaço no seu disco rígido e suas permissões e tente novamente.</translation> <translation id="5390284375844109566">Banco de dados indexado</translation> <translation id="5392544185395226057">Ativa o suporte para o Cliente nativo.</translation> <translation id="5396126354477659676">O plug-in <ph name="PEPPER_PLUGIN_NAME" /> do domínio <ph name="PEPPER_PLUGIN_DOMAIN" /> deseja acessar seu computador.</translation> @@ -3098,6 +3120,7 @@ <translation id="5469954281417596308">Gerenciador de favoritos</translation> <translation id="5470838072096800024">Horário do último recebimento</translation> <translation id="5473075389972733037">IBM</translation> +<translation id="5473279832922912143">Ativa o V8 para usar o intérprete Ignition experimental para execução de JavaScript.</translation> <translation id="5474139872592516422">Quando a atualização do <ph name="PLUGIN_NAME" /> terminar, atualize a página para ativá-lo.</translation> <translation id="5480254151128201294">Este dispositivo foi bloqueado pelo proprietário.</translation> <translation id="5483785310822538350">Revogar acesso ao arquivo e ao dispositivo</translation> @@ -3125,6 +3148,7 @@ <translation id="5509914365760201064">Emissor: <ph name="CERTIFICATE_AUTHORITY" /></translation> <translation id="5511823366942919280">Tem certeza de que deseja configurar este dispositivo como um "Shark"?</translation> <translation id="5512653252560939721">O certificado de usuário deve ter proteção por hardware.</translation> +<translation id="5513242761114685513">Menu de contexto</translation> <translation id="5515008897660088170">Janelas de apps com visualizações do kit de ferramentas.</translation> <translation id="551752069230578406">Adicionando a impressora a sua conta. Isso pode demorar um pouco...</translation> <translation id="5518584115117143805">Certificado de criptografia de e-mail</translation> @@ -3306,7 +3330,6 @@ <translation id="577322787686508614">A operação de leitura não é permitida em "<ph name="DEVICE_NAME" />".</translation> <translation id="5774295353725270860">Abrir aplicativo Arquivos</translation> <translation id="5774515636230743468">Manifesto:</translation> -<translation id="5776006986202016118">Este site quer se conectar a:</translation> <translation id="577624874850706961">Pesquisar cookies</translation> <translation id="5778550464785688721">Controle total de dispositivos MIDI</translation> <translation id="5780066559993805332">(Melhor)</translation> @@ -3384,6 +3407,7 @@ <translation id="5874045675243596003">Aplicar modo restrito (falha de equipamento se não conseguirmos hashes)</translation> <translation id="5875858680971105888">Ops, não foi possível importar o usuário supervisionado. Verifique sua conexão de rede e tente novamente mais tarde.</translation> <translation id="5880247576487732437">Token presente</translation> +<translation id="5884474295213649357">Esta guia está conectada a um dispositivo USB.</translation> <translation id="5885324376209859881">Gerenciar configurações de mídia...</translation> <translation id="5889282057229379085">Número máximo de autoridades de certificação intermediárias: <ph name="NUM_INTERMEDIATE_CA" /></translation> <translation id="5892290200158927959">Teclado BÉPO francês</translation> @@ -3473,6 +3497,8 @@ <translation id="604124094241169006">Automático</translation> <translation id="6042308850641462728">Mais</translation> <translation id="604257181445267932">O Smart Lock ajuda você a fazer login rapidamente em aplicativos e sites usando senhas salvas com o Google.</translation> +<translation id="6043317578411397101">O app <ph name="APP_NAME" /> está compartilhando uma guia do Chrome com <ph name="TAB_NAME" />.</translation> +<translation id="6044805581023976844">O app <ph name="APP_NAME" /> está compartilhando áudio e uma guia do Chrome com <ph name="TAB_NAME" />.</translation> <translation id="6049065490165456785">Foto da câmera interna</translation> <translation id="6051028581720248124">Ao imprimir no FedEx Office, você aceita os <ph name="START_LINK" />termos de uso<ph name="END_LINK" />.</translation> <translation id="6051086608691487286">Barras de rolagem de sobreposição</translation> @@ -3602,6 +3628,7 @@ <translation id="6251889282623539337">Termos de Serviço de <ph name="DOMAIN" /></translation> <translation id="6251924700383757765">Política de Privacidade</translation> <translation id="6253586523465486793">Força a opção puxar para atualizar a acionar a atualização de não validação (embora isso geralmente signifique uma atualização normal de validação de cache quando a sinalização está desativada).</translation> +<translation id="6254182355913122230">Memória trocada</translation> <translation id="6254503684448816922">Compromisso da chave</translation> <translation id="6259104249628300056">Descobrir dispositivos na sua rede local</translation> <translation id="6263082573641595914">Versão da autoridade de certificação da Microsoft</translation> @@ -3872,6 +3899,7 @@ <translation id="6680028776254050810">Trocar usuários</translation> <translation id="6681668084120808868">Tirar foto</translation> <translation id="668171684555832681">Outro...</translation> +<translation id="6682083956260248340">Controlar como esse recurso funciona em <ph name="BEGIN_LINK" /></translation> <translation id="6686490380836145850">Fechar guias à direita</translation> <translation id="6686817083349815241">Salvar sua senha</translation> <translation id="6689514201497896398">Ignorar verificações de envolvimento dos usuários</translation> @@ -3939,10 +3967,12 @@ <translation id="6798954102094737107">Plug-in: <ph name="PLUGIN_NAME" /></translation> <translation id="6802031077390104172"><ph name="USAGE" /> (<ph name="OID" />)</translation> <translation id="6804671422566312077">Abrir todos os favoritos em &nova janela</translation> +<translation id="6805542829187142700">Ativa a política do dispositivo de detecção automática do fuso horário do sistema.</translation> <translation id="6805647936811177813">Faça login para que o <ph name="TOKEN_NAME" /> importe o certificado do cliente de <ph name="HOST_NAME" />.</translation> <translation id="680572642341004180">Ativar rastreamento RLZ no <ph name="SHORT_PRODUCT_OS_NAME" />.</translation> <translation id="6807889908376551050">Mostrar todos...</translation> <translation id="6809448577646370871">Alternância entre janelas personalizada para aplicativos do Google Chrome.</translation> +<translation id="6810613314571580006">Faça login automaticamente nos websites que usam credenciais armazenadas. Quando o recurso estiver desativado, será necessário fornecer uma confirmação todas as vezes antes de fazer login em um website.</translation> <translation id="6812349420832218321"><ph name="PRODUCT_NAME" /> não pode ser executado como raiz.</translation> <translation id="6812841287760418429">Manter alterações</translation> <translation id="6814124696888326520">Facilita a alternância entre os métodos de entrada e o acesso a mais recursos de entrada: entrada de texto por voz, manuscrito e emoticons.</translation> @@ -4129,6 +4159,7 @@ <translation id="7065534935986314333">Sobre o sistema</translation> <translation id="7066944511817949584">Falha ao conectar-se a "<ph name="DEVICE_NAME" />".</translation> <translation id="7067725467529581407">Nunca mostrar isso novamente.</translation> +<translation id="7068609958927777019">Se ativada, os URLs impróprios podem ser denunciados para o SafeSearch.</translation> <translation id="7070804685954057874">Entrada direta</translation> <translation id="7072010813301522126">Nome do atalho</translation> <translation id="7072025625456903686">Permitir tudo ou personalizar</translation> @@ -4194,10 +4225,10 @@ <translation id="7170467426996704624">Transliteração (salam → ሰላም)</translation> <translation id="7172053773111046550">Teclado estoniano</translation> <translation id="7173828187784915717">Configurações de entrada Chewing</translation> +<translation id="7173917244679555">Parece que você já está administrando um usuário com esse nome. Deseja <ph name="BEGIN_LINK" />importar <ph name="PROFILE_NAME" /><ph name="END_LINK" /> para este dispositivo?</translation> <translation id="7175353351958621980">Carregado de:</translation> <translation id="7180611975245234373">Atualizar</translation> <translation id="7180865173735832675">Personalizar</translation> -<translation id="7184428045150946911">Desativar ocultação automática da barra de ferramentas em tablets grandes</translation> <translation id="7185690883425432021">Oculta os botões de fechamento de guias inativas quando a faixa de guias está em modo empilhado.</translation> <translation id="7186088072322679094">Manter na barra de ferramentas</translation> <translation id="719009910964971313">Teclado Programmer Dvorak americano</translation> @@ -4262,6 +4293,7 @@ <translation id="7280825545668757494">Sincronização das credenciais de Wi-Fi</translation> <translation id="7280877790564589615">Permissão solicitada</translation> <translation id="7282547042039404307">Suave</translation> +<translation id="7284549674086796566">Intérprete de JavaScript experimental</translation> <translation id="7287143125007575591">Acesso negado.</translation> <translation id="7288592446024861651">Seus favoritos, histórico, senhas e outras configurações serão sincronizados com sua Conta do Google para que você possa usá-los em todos os seus dispositivos. Controle o que é sincronizado em <ph name="BEGIN_LINK" /></translation> <translation id="7288676996127329262"><ph name="HORIZONTAL_DPI" />x<ph name="VERTICAL_DPI" /> dpi</translation> @@ -4284,6 +4316,7 @@ <translation id="7321545336522791733">Servidor inacessível</translation> <translation id="7325437708553334317">Extensão de alto contraste</translation> <translation id="7326565110843845436">Clique com três dedos no touchpad</translation> +<translation id="7327088014939803293">Não foi possível criar o novo usuário supervisionado. Verifique se você fez login corretamente e tente novamente.</translation> <translation id="73289266812733869">Desmarcado</translation> <translation id="7329154610228416156">O login falhou porque foi configurado para usar um URL não seguro (<ph name="BLOCKED_URL" />). Entre em contato com o administrador.</translation> <translation id="7331786426925973633">Um navegador da Web construído para fornecer velocidade, simplicidade e segurança</translation> @@ -4459,6 +4492,7 @@ <translation id="7573172247376861652">Carga da bateria</translation> <translation id="7576032389798113292">6x4</translation> <translation id="7576690715254076113">Agrupar</translation> +<translation id="7580671184200851182">Reproduzir o mesmo áudio pelos alto-falantes (áudio mono)</translation> <translation id="7581279002575751816">Os plugi-ns NPAPI não são suportados.</translation> <translation id="7581462281756524039">Uma ferramenta de limpeza</translation> <translation id="7582582252461552277">Preferir esta rede</translation> @@ -4691,6 +4725,7 @@ <translation id="7925686952655276919">Não usar dados móveis na sincronização</translation> <translation id="7926906273904422255">Marcar origens não seguras como "não seguras" ou "duvidosas".</translation> <translation id="7928710562641958568">Ejetar dispositivo</translation> +<translation id="79312157130859720">O app <ph name="APP_NAME" /> está compartilhando sua tela e áudio.</translation> <translation id="7938594894617528435">Atualmente off-line</translation> <translation id="7939374455203157513">Ativar serviços em nuvem</translation> <translation id="7939412583708276221">Manter assim mesmo</translation> @@ -5125,6 +5160,7 @@ <translation id="8571108619753148184">Servidor 4</translation> <translation id="8572832761467613633">Somente Flash</translation> <translation id="8572981282494768930">Não permitir que os sites acessem sua câmera e seu microfone</translation> +<translation id="8574234089711453001">Permite que um botão de download seja exibido ao abrir uma página com URL de mídia.</translation> <translation id="857779305329188634">Ativar o suporte ao protocolo QUIC experimental.</translation> <translation id="8579285237314169903">Sincronizando <ph name="NUMBER_OF_FILES" /> itens...</translation> <translation id="8579549103199280730">Perguntar por padrão</translation> @@ -5180,6 +5216,7 @@ <translation id="8656768832129462377">Não verificar</translation> <translation id="8656946437567854031">Ao clicar em "Continuar", você aceita os seguintes documentos legais: <ph name="LEGAL_DOC_LINK_TEXT_1" />, <ph name="LEGAL_DOC_LINK_TEXT_2" />, <ph name="LEGAL_DOC_LINK_TEXT_3" />, <ph name="LEGAL_DOC_LINK_TEXT_4" />, <ph name="LEGAL_DOC_LINK_TEXT_5" /> e <ph name="LEGAL_DOC_LINK_TEXT_6" />.</translation> <translation id="8658595122208653918">Alterar opções da impressora...</translation> +<translation id="8658645149275195032">O app <ph name="APP_NAME" /> está compartilhando sua tela e áudio com <ph name="TAB_NAME" />.</translation> <translation id="8659716501582523573">Endereço IP:</translation> <translation id="8661290697478713397">Abrir link na janela &anônima</translation> <translation id="8662795692588422978">Pessoas</translation> @@ -5385,6 +5422,7 @@ <translation id="8942416694471994740">O acesso ao seu microfone é controlado pelo seu administrador.</translation> <translation id="894360074127026135">Netscape International Step-Up</translation> <translation id="8944779739948852228">Impressora detectada</translation> +<translation id="8944964446326379280">O app <ph name="APP_NAME" /> está compartilhando uma janela com <ph name="TAB_NAME" />.</translation> <translation id="8946359700442089734">Os recursos de depuração não foram completamente ativados neste dispositivo <ph name="IDS_SHORT_PRODUCT_NAME" />.</translation> <translation id="8946784827990177241">Ativa a compatibilidade com WebUSB.</translation> <translation id="89515141420106838">Ativa o aplicativo Galeria da Chrome Web Store para drivers de impressora. O aplicativo procura na Chrome Web Store por extensões que sejam compatíveis com a impressão a partir de uma impressora USB com código USB específico.</translation> @@ -5403,6 +5441,7 @@ <translation id="8965037249707889821">Digite a senha antiga</translation> <translation id="8965697826696209160">Não há espaço suficiente.</translation> <translation id="8968527460726243404">Gravador de imagem do sistema Chrome OS</translation> +<translation id="8970203673128054105">Ver lista do modo de transmissão</translation> <translation id="89720367119469899">Escape</translation> <translation id="8972513834460200407">Verifique com seu administrador de rede se o firewall não está bloqueando downloads dos servidores do Google.</translation> <translation id="8974161578568356045">Detecção automática</translation> @@ -5430,6 +5469,7 @@ <translation id="9011178328451474963">Última guia</translation> <translation id="9013284500811652791"><ph name="UWS_NAME" />, <ph name="UWS_NAME" /> e mais um</translation> <translation id="9013587737291179248">Ops, não foi possível importar o usuário supervisionado. Verifique o espaço em seu disco rígido e suas permissões e tente novamente.</translation> +<translation id="901440679911238150">Os detalhes da sua conta estão desatualizados. <ph name="BEGIN_LINK" />Faça login novamente<ph name="END_LINK" />.</translation> <translation id="9014987600015527693">Mostrar outro smartphone</translation> <translation id="9015601075560428829">Entrada de voz</translation> <translation id="9016164105820007189">Conectando-se a "<ph name="DEVICE_NAME" />".</translation> @@ -5443,6 +5483,7 @@ <translation id="9025098623496448965">Ok, leve-me de volta à tela de login</translation> <translation id="902638246363752736">Configurações do teclado</translation> <translation id="9026731007018893674">download</translation> +<translation id="9027146684281895941">Supervisionar esta pessoa para controlar e ver os websites que ela visita usando a Conta do Google.</translation> <translation id="9027459031423301635">Abrir link em uma nova &guia</translation> <translation id="9027603907212475920">Configurar a sincronização...</translation> <translation id="9033453977881595182">ID do token</translation> @@ -5557,6 +5598,7 @@ <translation id="9203478404496196495">Ativar o som da guia</translation> <translation id="9203962528777363226">O administrador deste dispositivo desativou a adição de novos usuários</translation> <translation id="9205143043463108573">Posiciona o Acesso rápido aos apps no centro da tela em modo paisagem.</translation> +<translation id="9205160891051296441">Compatibilidade com a política SystemTimezoneAutomaticDetection</translation> <translation id="9206487995878691001">Método de entrada Cangjie</translation> <translation id="9207194316435230304">ATOK</translation> <translation id="9208886416788010685">Adobe Reader desatualizado</translation> @@ -5578,6 +5620,7 @@ <translation id="939736085109172342">Nova pasta</translation> <translation id="940425055435005472">Tamanho da fonte:</translation> <translation id="941543339607623937">Chave privada inválida.</translation> +<translation id="942532530371314860">O app <ph name="APP_NAME" /> está compartilhando áudio e uma guia do Chrome.</translation> <translation id="942954117721265519">Não há imagens neste diretório.</translation> <translation id="945522503751344254">Enviar comentários</translation> <translation id="946810925362320585">Seguir recomendação</translation>
diff --git a/chrome/app/resources/generated_resources_pt-PT.xtb b/chrome/app/resources/generated_resources_pt-PT.xtb index 1e0d8bc..1273c8e0 100644 --- a/chrome/app/resources/generated_resources_pt-PT.xtb +++ b/chrome/app/resources/generated_resources_pt-PT.xtb
@@ -183,16 +183,19 @@ <translation id="1259724620062607540">Artigo de prateleira 7</translation> <translation id="1260240842868558614">Mostrar:</translation> <translation id="126710816202626562">Idioma de tradução:</translation> +<translation id="1269690813141254680">Controle a forma como a Google utiliza o seu histórico de navegação para personalizar a Pesquisa Google e outros serviços Google em <ph name="BEGIN_LINK" />Controlos de atividade Google<ph name="END_LINK" />.</translation> <translation id="1272079795634619415">Parar</translation> <translation id="1272978324304772054">Esta conta de utilizador não pertence ao domínio no qual o dispositivo está inscrito. Se pretender inscrever-se num outro domínio, necessita de efetuar a recuperação do dispositivo em primeiro lugar.</translation> <translation id="127353061808977798">Tipos de letra e codificação</translation> <translation id="1274997165432133392">Cookies e outros dados do site</translation> <translation id="1275718070701477396">Selecionado</translation> +<translation id="1277908057200820621">Ver lista de dispositivos</translation> <translation id="1278049586634282054">Inspecionar vistas:</translation> <translation id="1278813325885878377">Teclado QWERTY húngaro</translation> <translation id="1285320974508926690">Nunca traduzir este site</translation> <translation id="1285484354230578868">Armazenar dados na sua conta Google Drive</translation> <translation id="1290223615328246825">O início de sessão automático falhou</translation> +<translation id="1293509594570842875">Não foi possível criar o novo utilizador supervisionado. Verifique a ligação de rede e tente novamente mais tarde.</translation> <translation id="1293556467332435079">Ficheiros</translation> <translation id="1294298200424241932">Editar definições fidedignas:</translation> <translation id="1295794900245526845">Escolha a conta guardada com o <ph name="PASSWORD_MANAGER_BRAND" /> para iniciar sessão</translation> @@ -291,6 +294,7 @@ <translation id="1429740407920618615">Intensidade do Sinal:</translation> <translation id="143027896309062157">Ler e alterar todos os dados no computador e os Websites que visita</translation> <translation id="1430915738399379752">Imprimir</translation> +<translation id="1433423644370450034">Notificação de estilo multimédia</translation> <translation id="1434696352799406980">Repõe a página inicial, a página novo separador, o motor de pesquisa e os separadores fixos. Também desativa todas as extensões e limpa os dados temporários como os cookies. Os marcadores, o histórico e as palavras-passe guardadas não são limpos.</translation> <translation id="1434886155212424586">A Página inicial é a página Novo separador</translation> <translation id="1435550882135542937">Reformulação da barra de ferramentas de extensões</translation> @@ -379,6 +383,7 @@ <translation id="1526925867532626635">Confirmar definições de sincronização</translation> <translation id="1528372117901087631">Ligação à internet</translation> <translation id="1529968269513889022">semana passada</translation> +<translation id="1531865825384516080">Relatórios de URLs para a Pesquisa segura.</translation> <translation id="1532697124104874386">Ativar/desativar a implementação inteligente do teclado virtual.</translation> <translation id="1533897085022183721">Menos de <ph name="MINUTES" /></translation> <translation id="1533920822694388968">Alinhamento da televisão</translation> @@ -503,7 +508,7 @@ <translation id="169515659049020177">Shift</translation> <translation id="1697068104427956555">Selecione um quadrado da imagem.</translation> <translation id="1697532407822776718">O processo está concluído!</translation> -<translation id="1697988819212986149">Mostra um ícone da Google junto aos itens do menu de contexto com tecnologia dos serviços Google.</translation> +<translation id="1697988819212986149">Mostra um símbolo da Google junto aos itens do menu de contexto com tecnologia dos serviços Google.</translation> <translation id="1699274548822076330">Destina-se a ser utilizado em conjunto com o sinalizador trace-upload-url. AVISO: quando está ativado, o Chrome regista dados de desempenho de todas as navegações e carrega-os para o URL especificado pelo sinalizador trace-upload-url. O rastreio pode incluir informações de identificação pessoal (PII) como os títulos e os URLs dos Websites visitados por si.</translation> <translation id="1699395855685456105">Revisão do hardware:</translation> @@ -662,7 +667,6 @@ <translation id="1962233722219655970">Esta página utiliza uma aplicação Native Client que não funciona no computador.</translation> <translation id="1965328510789761112">Memória privada</translation> <translation id="1965624977906726414">Não tem permissões especiais.</translation> -<translation id="1968720524450620475">Ativar ícones de ação para Notificações Web.</translation> <translation id="1970746430676306437">Ver &informações da página</translation> <translation id="197288927597451399">Manter</translation> <translation id="1973491249112991739">A transferência do <ph name="PLUGIN_NAME" /> falhou.</translation> @@ -760,6 +764,7 @@ <translation id="212862741129535676">Percentagem de ocupação no estado de frequência</translation> <translation id="2128691215891724419">Erro de Sincronização: atualizar a frase de acesso de Sincronização...</translation> <translation id="2129904043921227933">Erro de Sincronização: atualizar a Frase de Acesso de Sincronização...</translation> +<translation id="2130053362119884302">Permitir desanexação dos separadores em ecrã inteiro</translation> <translation id="2131077480075264">Não é possível instalar "<ph name="APP_NAME" />", pois não é permitido por "<ph name="IMPORT_NAME" />"</translation> <translation id="2134149231879627725">Permita que o Google o(a) ajude a bloquear, apagar e localizar remotamente o seu dispositivo.</translation> <translation id="2134986351331412790">Este site não aceita este tipo de cartão.</translation> @@ -772,6 +777,7 @@ <translation id="2143778271340628265">Configuração manual do proxy</translation> <translation id="2143915448548023856">Definições de visualização</translation> <translation id="2144536955299248197">Visualizador de certificados: <ph name="CERTIFICATE_NAME" /></translation> +<translation id="2147827593068025794">Sincronização em segundo plano</translation> <translation id="2148756636027685713">Formatação concluída</translation> <translation id="2148892889047469596">Transmitir separador</translation> <translation id="2148999191776934271"><ph name="HOUR" />:<ph name="MINUTE" /> até ficar totalmente carregada</translation> @@ -1149,6 +1155,7 @@ <translation id="2665717534925640469">Esta página está agora em ecrã inteiro e desativou o cursor do rato.</translation> <translation id="2665919335226618153">Ah, bolas! Ocorreu um erro durante a formatação.</translation> <translation id="2668079306436607263">Navegação no histórico de deslocamento</translation> +<translation id="2670102641511624474"><ph name="APP_NAME" /> está a partilhar um separador do Chrome.</translation> <translation id="2670965183549957348">Método de introdução Chewing</translation> <translation id="2672142220933875349">Ficheiro crx em mau estado. Falha ao descompactar.</translation> <translation id="2672394958563893062">Ocorreu um erro. Clique para começar do início.</translation> @@ -1195,6 +1202,7 @@ <translation id="2733364097704495499">Pretende registar a impressora <ph name="PRINTER_NAME" /> no Google Cloud Print?</translation> <translation id="2735698359135166290">Teclado padrão romeno</translation> <translation id="2737363922397526254">Reduzir...</translation> +<translation id="2737755522130570180">Bloquear scripts carregados através de document.write</translation> <translation id="2738771556149464852">Não posterior a</translation> <translation id="2739191690716947896">Depurar</translation> <translation id="2739240477418971307">Alterar as definições de acessibilidade</translation> @@ -1264,6 +1272,7 @@ <translation id="2805646850212350655">Sistema de encriptação de ficheiros Microsoft</translation> <translation id="2805707493867224476">Permitir que todos os sites mostrem pop-ups</translation> <translation id="2805756323405976993">Aplicações</translation> +<translation id="2808243220963392165">Permitir a desanexação dos separadores da faixa de separadores ao utilizar o modo de ecrã inteiro no Mac.</translation> <translation id="2809142985846095314">Ativar opção de Preenchimento automático de cartões de crédito</translation> <translation id="2809346626032021864">Leitura</translation> <translation id="2809586584051668049">e mais <ph name="NUMBER_ADDITIONAL_DISABLED" /></translation> @@ -1393,6 +1402,7 @@ <translation id="2968792643335932010">Menos cópias</translation> <translation id="2971033837577180453"><span>ID:</span><ph name="EXTENSION_ID" /></translation> <translation id="2971213274238188218">diminuir brilho</translation> +<translation id="2971422413423640756">Botão de transferência ao abrir uma página com um URL de multimédia.</translation> <translation id="2972557485845626008">Firmware</translation> <translation id="2972581237482394796">&Repetir</translation> <translation id="297870353673992530">Servidor DNS:</translation> @@ -1425,7 +1435,6 @@ <translation id="302014277942214887">Introduza o ID de aplicação ou o URL da loja online.</translation> <translation id="3020616530769498629">Ativar a atualização de não validação em arrastar para atualizar</translation> <translation id="3020990233660977256">Número de série: <ph name="SERIAL_NUMBER" /></translation> -<translation id="3021245547458004908">Quando ativada, a barra de ferramentas nunca é oculta devido ao deslocamento em dispositivos com ecrãs com um tamanho mínimo >= 800 dp. Contudo, continua a ser oculta se os conteúdos da página passarem para ecrã inteiro.</translation> <translation id="3021678814754966447">&Ver Origem da Moldura</translation> <translation id="3024374909719388945">Utilizar relógio de 24h</translation> <translation id="3025022340603654002">Fazer sugestões de preenchimento automático no clique inicial do rato num elemento de formulário.</translation> @@ -1458,6 +1467,7 @@ <translation id="3057861065630527966">Fazer uma cópia de segurança de fotografias e vídeos</translation> <translation id="3058212636943679650">Se precisar de restaurar o sistema operativo do computador, será necessário um cartão SD ou memory stick USB de recuperação.</translation> <translation id="305932878998873762">A Cache Simples para HTTP é uma nova cache. Depende do sistema de ficheiros para a atribuição do espaço em disco.</translation> +<translation id="3062606427884046423">Utilizar notificações Android MediaStyle para notificações de multimédia do Chrome.</translation> <translation id="3064388234319122767">Transliteração (zdravo → здраво)</translation> <translation id="3065041951436100775">Comentários acerca de separador desativado.</translation> <translation id="3065140616557457172">Escreva para pesquisar ou introduza um URL para navegar, tudo resulta aqui.</translation> @@ -1496,7 +1506,6 @@ <translation id="3117812041123364382">Ative/desative o teclado virtual flutuante.</translation> <translation id="3118319026408854581">Ajuda do <ph name="PRODUCT_NAME" /></translation> <translation id="3120430004221004537">Encriptação insuficiente para uma operação indicada em: "<ph name="DEVICE_NAME" />".</translation> -<translation id="3121260210578524273">Ativar ícones em botões de ação para Notificações Web.</translation> <translation id="3121793941267913344">Repor este dispositivo <ph name="IDS_SHORT_PRODUCT_NAME" /></translation> <translation id="3122162841865761901">Experiências das Ferramentas do programador</translation> <translation id="3122464029669770682">CPU</translation> @@ -1541,6 +1550,7 @@ <translation id="3170072451822350649">Também pode ignorar o início de sessão e <ph name="LINK_START" />navegar como Convidado<ph name="LINK_END" />.</translation> <translation id="3170544058711792988">Manter o foco da lupa centrado no ecrã</translation> <translation id="3172213052701798825">Smart Lock para palavras-passe da Google</translation> +<translation id="3175469972022788345">Quando está ativado, o WebRTC utiliza certificados ECDSA.</translation> <translation id="317583078218509884">As novas definições relativas às permissões do Website terão efeito depois de atualizar a página.</translation> <translation id="3177048931975664371">Clicar para ocultar a palavra-passe</translation> <translation id="3180365125572747493">Introduza uma palavra-passe para encriptar este ficheiro de certificado.</translation> @@ -1994,6 +2004,7 @@ <translation id="3776796446459804932">Esta extensão viola a política da Chrome Web Store.</translation> <translation id="3778152852029592020">A transferência foi cancelada.</translation> <translation id="3778740492972734840">Ferramentas &do programador</translation> +<translation id="3780663724044634171">Selecione uma conta para gerir o utilizador supervisionado.</translation> <translation id="378312418865624974">Ler um identificador único para este computador</translation> <translation id="3783640748446814672">alt</translation> <translation id="3785308913036335955">Mostrar Atalho das Aplicações</translation> @@ -2017,6 +2028,7 @@ <translation id="3807747707162121253">&Cancelar</translation> <translation id="3809280248639369696">Raio lunar</translation> <translation id="3810973564298564668">Gerir</translation> +<translation id="3811494700605067549">1 ficheiro selecionado</translation> <translation id="3812034401428455285"><ph name="UWS_NAME" /> e <ph name="UWS_NAME" /></translation> <translation id="3812525830114410218">Certificado incorreto</translation> <translation id="3813984289128269159">OK Google</translation> @@ -2046,6 +2058,7 @@ <translation id="3838543471119263078">Cookies e outros dados de sites e plug-ins</translation> <translation id="3839497635014791588">Respostas táteis adicionais nos componentes da IU</translation> <translation id="3840053866656739575">A ligação ao Chromebox foi perdida. Aproxime-se ou verifique o dispositivo enquanto tentamos restabelecer a ligação.</translation> +<translation id="3840055807562919428">Não permite a obtenção de scripts de bloqueio do analisador de terceiros inseridos no frame principal através de document.write.</translation> <translation id="3842552989725514455">Tipo de letra Serif</translation> <translation id="3846593650622216128">Estas definições são aplicadas por uma extensão.</translation> <translation id="3846833722648675493">Mostrar janelas de aplicações após a primeira execução. Serão apresentadas janelas bastante tempo depois para aplicações exigentes que carreguem recursos sincronicamente, mas não será significativo para aplicações que carreguem a maior parte dos seus recursos de forma assíncrona.</translation> @@ -2277,6 +2290,7 @@ <translation id="421017592316736757">Tem de estar online para aceder a este ficheiro.</translation> <translation id="421182450098841253">&Mostrar Barra de Marcadores</translation> <translation id="4212108296677106246">Pretende confiar em "<ph name="CERTIFICATE_NAME" />" como uma Autoridade de certificação?</translation> +<translation id="42126664696688958">Exportar</translation> <translation id="42137655013211669">O acesso a este recurso foi proibido pelo servidor.</translation> <translation id="4215350869199060536">Existem símbolos ilegais no nome.</translation> <translation id="4215898373199266584">O modo de navegação anónima (<ph name="INCOGNITO_MODE_SHORTCUT" />) pode ser útil da próxima vez.</translation> @@ -2363,6 +2377,7 @@ <translation id="4359408040881008151">Instalada devido a extensão(ões) dependente(s).</translation> <translation id="4361190688154226069">Atribuição do destino com base no retângulo nas vistas</translation> <translation id="4364444725319685468"><ph name="FILE_NAME" /> transferido</translation> +<translation id="4364567974334641491"><ph name="APP_NAME" /> está a partilhar uma janela.</translation> <translation id="4364830672918311045">Apresentar notificações</translation> <translation id="4365673000813822030">Ups, a Sincronização deixou de funcionar.</translation> <translation id="4366509400410520531">Permitido por si</translation> @@ -2432,6 +2447,7 @@ <translation id="4479639480957787382">Ethernet</translation> <translation id="4479812471636796472">Teclado americano (Dvorak)</translation> <translation id="4481249487722541506">Carregar extensão descomprimida...</translation> +<translation id="4482194545587547824">A Google pode utilizar o seu histórico de navegação para personalizar a Pesquisa Google e outros serviços Google</translation> <translation id="4487088045714738411">Teclado belga</translation> <translation id="4492190037599258964">Resultados da pesquisa para "<ph name="SEARCH_STRING" />"</translation> <translation id="4495021739234344583">Anular a inscrição e reiniciar</translation> @@ -2475,6 +2491,7 @@ <translation id="4554591392113183336">A extensão externa tem a mesma versão ou uma versão inferior à existente.</translation> <translation id="4554796861933393312">Velocidade de animação da gota de tinta do material design</translation> <translation id="4555769855065597957">Sombra</translation> +<translation id="4556110439722119938">Os marcadores, o histórico, as palavras-passe e outras definições são sincronizados com a sua Conta Google para que os possa utilizar em todos os dispositivos</translation> <translation id="4557136421275541763">Aviso:</translation> <translation id="4558426062282641716">Permissão para início automático solicitado</translation> <translation id="4563210852471260509">O idioma de introdução inicial é chinês</translation> @@ -2595,6 +2612,7 @@ <translation id="4742746985488890273">Afixar na prateleira</translation> <translation id="474421578985060416">Bloqueado por si</translation> <translation id="4744574733485822359">A transferência foi concluída</translation> +<translation id="4746330764136728131">Utilizar certificados ECDSA para WebRTC</translation> <translation id="4746971725921104503">Parece que já está a gerir um utilizador com esse nome. Pretendia <ph name="LINK_START" />importá-lo <ph name="USER_DISPLAY_NAME" /> para este dispositivo<ph name="LINK_END" />?</translation> <translation id="4747271164117300400">Macedónio</translation> <translation id="4749157430980974800">Teclado em georgiano</translation> @@ -2744,6 +2762,7 @@ <translation id="496226124210045887">A pasta que selecionou contém ficheiros sensíveis. Tem a certeza de que pretende conceder a "$1" o acesso permanente de leitura a esta pasta?</translation> <translation id="4964673849688379040">A verificar...</translation> <translation id="4966802378343010715">Criar um utilizador novo</translation> +<translation id="4967749818080339523">Selecionar uma conta</translation> <translation id="496888482094675990">A aplicação Ficheiros fornece um acesso rápido aos ficheiros que guardou no Google Drive, no armazenamento externo ou no dispositivo SO Chrome.</translation> <translation id="4971412780836297815">Abrir quando estiver concluído</translation> <translation id="497244430928947428">Teclado malaialo (fonético)</translation> @@ -2790,6 +2809,7 @@ <translation id="5038863510258510803">A ativar...</translation> <translation id="5039512255859636053">$1 TB</translation> <translation id="5039804452771397117">Permitir</translation> +<translation id="5043851552150732346">1 diretório selecionado</translation> <translation id="5045550434625856497">Palavra-passe incorreta</translation> <translation id="5048179823246820836">Nórdico</translation> <translation id="5048294425697652159">Ativar Cliente Quirks para calibração do ecrã.</translation> @@ -2877,6 +2897,7 @@ <translation id="5170477580121653719">Espaço restante no Google Drive: <ph name="SPACE_AVAILABLE" />.</translation> <translation id="5170568018924773124">Mostrar numa pasta</translation> <translation id="5171045022955879922">Pesquisar ou escrever URL</translation> +<translation id="5171343362375269016">Memória trocada</translation> <translation id="5175870427301879686"><ph name="URL" /> quer armazenar permanentemente os dados no seu computador local.</translation> <translation id="5177479852722101802">Continuar a bloquear o acesso à câmara e ao microfone</translation> <translation id="5177526793333269655">Vista de miniatura</translation> @@ -3034,6 +3055,7 @@ <translation id="5380103295189760361">Mantenha premido Control, Alt, Shift ou a Tecla de Pesquisa para ver atalhos de teclado para esses modificadores.</translation> <translation id="5382392428640372740">Ativar rastreio da navegação</translation> <translation id="5388588172257446328">Nome de utilizador:</translation> +<translation id="5389237414310520250">Não foi possível criar o novo utilizador. Verifique o espaço no disco rígido e as autorizações e tente novamente.</translation> <translation id="5390284375844109566">Base de dados indexada</translation> <translation id="5392544185395226057">Ative o suporte do Native Client.</translation> <translation id="5396126354477659676">O <ph name="PEPPER_PLUGIN_NAME" /> em <ph name="PEPPER_PLUGIN_DOMAIN" /> pretende aceder ao seu computador.</translation> @@ -3101,6 +3123,7 @@ <translation id="5469954281417596308">Gestor de marcadores</translation> <translation id="5470838072096800024">Hora da última receção</translation> <translation id="5473075389972733037">IBM</translation> +<translation id="5473279832922912143">Ativar o V8 para utilizar o intérprete Ignition experimental para execução de JavaScript.</translation> <translation id="5474139872592516422">Quando a atualização do <ph name="PLUGIN_NAME" /> estiver concluída, atualize a página para o ativar.</translation> <translation id="5480254151128201294">Este dispositivo foi bloqueado pelo proprietário.</translation> <translation id="5483785310822538350">Revogar o acesso a ficheiros e a dispositivos</translation> @@ -3128,6 +3151,7 @@ <translation id="5509914365760201064">Emissor: <ph name="CERTIFICATE_AUTHORITY" /></translation> <translation id="5511823366942919280">Tem a certeza de que pretende configurar este dispositivo como um "Tubarão"?</translation> <translation id="5512653252560939721">O certificado de utilizador tem de ter uma garantia de hardware.</translation> +<translation id="5513242761114685513">Menu de contexto</translation> <translation id="5515008897660088170">Janelas das aplicações baseadas nas visualizações do conjunto de ferramentas.</translation> <translation id="551752069230578406">A adicionar a impressora à sua conta – poderá demorar um momento…</translation> <translation id="5518584115117143805">Certificado de encriptação de email</translation> @@ -3309,7 +3333,6 @@ <translation id="577322787686508614">A operação de leitura não é permitida em: "<ph name="DEVICE_NAME" />".</translation> <translation id="5774295353725270860">Aplicação Abrir Ficheiros</translation> <translation id="5774515636230743468">Manifesto:</translation> -<translation id="5776006986202016118">Este site pretende estabelecer ligação a:</translation> <translation id="577624874850706961">Pesquisar cookies</translation> <translation id="5778550464785688721">Controlo total de dispositivos MIDI</translation> <translation id="5780066559993805332">(A melhor)</translation> @@ -3387,6 +3410,7 @@ <translation id="5874045675243596003">Aplicar modo estrito (falha do disco rígido caso não se obtenham hashes)</translation> <translation id="5875858680971105888">Não foi possível importar o utilizador supervisionado. Verifique a ligação de rede e tente novamente mais tarde.</translation> <translation id="5880247576487732437">Símbolo Presente</translation> +<translation id="5884474295213649357">Este separador está associado a um dispositivo USB.</translation> <translation id="5885324376209859881">Gerir definições de multimédia...</translation> <translation id="5889282057229379085">Número máximo de ACs intermédias:<ph name="NUM_INTERMEDIATE_CA" /></translation> <translation id="5892290200158927959">Teclado BÉPO francês</translation> @@ -3476,6 +3500,8 @@ <translation id="604124094241169006">Automático</translation> <translation id="6042308850641462728">Mais</translation> <translation id="604257181445267932">O Smart Lock ajuda-o a iniciar sessão rapidamente em aplicações e sites com palavras-passe que guardou com o Google.</translation> +<translation id="6043317578411397101"><ph name="APP_NAME" /> está a partilhar um separador do Chrome com <ph name="TAB_NAME" />.</translation> +<translation id="6044805581023976844"><ph name="APP_NAME" /> está a partilhar um separador do Chrome e o áudio com <ph name="TAB_NAME" />.</translation> <translation id="6049065490165456785">Fotografia tirada com a câmara interna</translation> <translation id="6051028581720248124">Ao imprimir para a FedEx Office, aceita os seus <ph name="START_LINK" />termos de utilização<ph name="END_LINK" />.</translation> <translation id="6051086608691487286">Barras de deslocamento de sobreposição</translation> @@ -3604,6 +3630,7 @@ <translation id="6251889282623539337">Termos de Utilização de <ph name="DOMAIN" /></translation> <translation id="6251924700383757765">Política de privacidade</translation> <translation id="6253586523465486793">Força a atualização de não validação do acionador de arrastar para atualizar (enquanto, normalmente, significa a atualização de validação da cache normal quando o sinalizador está desativado).</translation> +<translation id="6254182355913122230">Memória trocada</translation> <translation id="6254503684448816922">Chave violada</translation> <translation id="6259104249628300056">Procurar dispositivos na rede local</translation> <translation id="6263082573641595914">Versão de AC Microsoft</translation> @@ -3874,6 +3901,7 @@ <translation id="6680028776254050810">Mudar Utilizadores</translation> <translation id="6681668084120808868">Tirar fotografia</translation> <translation id="668171684555832681">Outros...</translation> +<translation id="6682083956260248340">Controle esta funcionalidade em <ph name="BEGIN_LINK" /></translation> <translation id="6686490380836145850">Fechar separadores à direita</translation> <translation id="6686817083349815241">Guardar a sua palavra-passe</translation> <translation id="6689514201497896398">Ignorar verificações de envolvimento do utilizador</translation> @@ -3941,10 +3969,12 @@ <translation id="6798954102094737107">Plug-in: <ph name="PLUGIN_NAME" /></translation> <translation id="6802031077390104172"><ph name="USAGE" /> (<ph name="OID" />)</translation> <translation id="6804671422566312077">Abrir Todos os Marcadores numa &Nova Janela</translation> +<translation id="6805542829187142700">Ativar a política do dispositivo para a deteção automática do fuso horário do sistema.</translation> <translation id="6805647936811177813">Inicie sessão no <ph name="TOKEN_NAME" /> para importar o certificado de cliente de <ph name="HOST_NAME" />.</translation> <translation id="680572642341004180">Ativar o controlo RLZ em <ph name="SHORT_PRODUCT_OS_NAME" />.</translation> <translation id="6807889908376551050">Mostrar todos...</translation> <translation id="6809448577646370871">Focagem de janelas personalizada para Aplicações do Chrome.</translation> +<translation id="6810613314571580006">Iniciar sessão automaticamente nos Websites com as credenciais armazenadas. Quando a funcionalidade está desativada, é-lhe pedida sempre uma confirmação antes de iniciar sessão num Website.</translation> <translation id="6812349420832218321">O <ph name="PRODUCT_NAME" /> não pode ser executado como raiz.</translation> <translation id="6812841287760418429">Manter alterações</translation> <translation id="6814124696888326520">Para alternar mais facilmente entre os métodos de introdução e aceder a mais funcionalidades de introdução: entrada de texto por voz, escrita manual e emoji.</translation> @@ -4130,6 +4160,7 @@ <translation id="7065534935986314333">Acerca do sistema</translation> <translation id="7066944511817949584">Falha ao ligar a "<ph name="DEVICE_NAME" />".</translation> <translation id="7067725467529581407">Não voltar a mostrar.</translation> +<translation id="7068609958927777019">Se estiver ativado, é possível denunciar os URLs impróprios à Pesquisa segura.</translation> <translation id="7070804685954057874">Introdução directa</translation> <translation id="7072010813301522126">Nome do atalho</translation> <translation id="7072025625456903686">Permitir tudo ou personalizar</translation> @@ -4195,10 +4226,10 @@ <translation id="7170467426996704624">Transliteração (salam → ሰላም)</translation> <translation id="7172053773111046550">Teclado estónio</translation> <translation id="7173828187784915717">Definições de introdução Chewing</translation> +<translation id="7173917244679555">Aparentemente, já está a fazer a gestão de um utilizador com esse nome. Pretendia <ph name="BEGIN_LINK" />importar <ph name="PROFILE_NAME" /><ph name="END_LINK" /> para este dispositivo?</translation> <translation id="7175353351958621980">Carregado de:</translation> <translation id="7180611975245234373">Atualizar</translation> <translation id="7180865173735832675">Personalizar</translation> -<translation id="7184428045150946911">Desativar ocultação automática da barra de ferramentas em tablets grandes</translation> <translation id="7185690883425432021">Oculta os botões fechar dos separadores inativos quando a faixa de separadores está em modo empilhado.</translation> <translation id="7186088072322679094">Manter na Barra de ferramentas</translation> <translation id="719009910964971313">Teclado Dvorak de programador americano</translation> @@ -4263,6 +4294,7 @@ <translation id="7280825545668757494">Sincronização de credenciais de Wi-Fi</translation> <translation id="7280877790564589615">Autorização solicitada</translation> <translation id="7282547042039404307">Suave</translation> +<translation id="7284549674086796566">Intérprete de JavaScript experimental</translation> <translation id="7287143125007575591">Acesso negado.</translation> <translation id="7288592446024861651">Os marcadores, o histórico, as palavras-passe e outras definições são sincronizados com a sua Conta Google para que os possa utilizar em todos os dispositivos. Controle o que é sincronizado em <ph name="BEGIN_LINK" /></translation> <translation id="7288676996127329262"><ph name="HORIZONTAL_DPI" />x<ph name="VERTICAL_DPI" /> ppp</translation> @@ -4285,6 +4317,7 @@ <translation id="7321545336522791733">Servidor inacessível</translation> <translation id="7325437708553334317">Extensão Alto Contraste</translation> <translation id="7326565110843845436">Clique de três dedos no touchpad</translation> +<translation id="7327088014939803293">Não foi possível criar o novo utilizador supervisionado. Certifique-se de iniciou sessão corretamente e tente novamente.</translation> <translation id="73289266812733869">Selecção anulada</translation> <translation id="7329154610228416156">O início de sessão falhou porque foi configurado para utilizar um URL não seguro (<ph name="BLOCKED_URL" />). Contacte o administrador.</translation> <translation id="7331786426925973633">Um navegador de internet construído para oferecer velocidade, simplicidade e segurança</translation> @@ -4459,6 +4492,7 @@ <translation id="7573172247376861652">Carga da bateria</translation> <translation id="7576032389798113292">6 x 4</translation> <translation id="7576690715254076113">Agrupar</translation> +<translation id="7580671184200851182">Reproduzir o mesmo áudio em todas as colunas (áudio mono)</translation> <translation id="7581279002575751816">Os plug-ins NPAPI não são suportados.</translation> <translation id="7581462281756524039">Uma ferramenta de limpeza</translation> <translation id="7582582252461552277">Preferir esta rede</translation> @@ -4691,6 +4725,7 @@ <translation id="7925686952655276919">Não utilizar dados móveis para sincronização</translation> <translation id="7926906273904422255">Marque as origens não seguras como não seguras ou como "duvidosas".</translation> <translation id="7928710562641958568">Ejetar aparelho</translation> +<translation id="79312157130859720"><ph name="APP_NAME" /> está a partilhar o ecrã e o áudio.</translation> <translation id="7938594894617528435">Atualmente offline</translation> <translation id="7939374455203157513">Ativar serviços na nuvem</translation> <translation id="7939412583708276221">Manter na mesma</translation> @@ -5125,6 +5160,7 @@ <translation id="8571108619753148184">Servidor 4</translation> <translation id="8572832761467613633">Apenas Flash</translation> <translation id="8572981282494768930">Não permitir que os sites acedam à sua câmara e ao seu microfone</translation> +<translation id="8574234089711453001">Permitir a apresentação de um botão de transferência ao abrir uma página com um URL de multimédia.</translation> <translation id="857779305329188634">Ativar suporte de protocolo QUIC experimental.</translation> <translation id="8579285237314169903">A sincronizar <ph name="NUMBER_OF_FILES" /> itens...</translation> <translation id="8579549103199280730">Perguntar por predefinição</translation> @@ -5180,6 +5216,7 @@ <translation id="8656768832129462377">Não verificar</translation> <translation id="8656946437567854031">Ao clicar em Continuar, aceita os <ph name="LEGAL_DOC_LINK_TEXT_1" />, os <ph name="LEGAL_DOC_LINK_TEXT_2" />, os <ph name="LEGAL_DOC_LINK_TEXT_3" />, os <ph name="LEGAL_DOC_LINK_TEXT_4" />, os <ph name="LEGAL_DOC_LINK_TEXT_5" /> e os <ph name="LEGAL_DOC_LINK_TEXT_6" />.</translation> <translation id="8658595122208653918">Alterar opções da impressora…</translation> +<translation id="8658645149275195032"><ph name="APP_NAME" /> está a partilhar o ecrã e o áudio com <ph name="TAB_NAME" />.</translation> <translation id="8659716501582523573">Endereço IP:</translation> <translation id="8661290697478713397">Abrir Link numa Janela de Nave&gação Anónima</translation> <translation id="8662795692588422978">Pessoas</translation> @@ -5385,6 +5422,7 @@ <translation id="8942416694471994740">O acesso ao microfone é controlado pelo administrador.</translation> <translation id="894360074127026135">Step-Up Internacional Netscape</translation> <translation id="8944779739948852228">Impressora detetada</translation> +<translation id="8944964446326379280"><ph name="APP_NAME" /> está a partilhar uma janela com <ph name="TAB_NAME" />.</translation> <translation id="8946359700442089734">As funcionalidades de depuração não foram totalmente ativadas neste dispositivo <ph name="IDS_SHORT_PRODUCT_NAME" />.</translation> <translation id="8946784827990177241">Ativar suporte para WebUSB.</translation> <translation id="89515141420106838">Ativa a aplicação Galeria da Web Store do Chrome para controladores de impressora. A aplicação procura na Web Store do Chrome extensões que suportem a impressão numa impressora USB com um ID USB específico.</translation> @@ -5403,6 +5441,7 @@ <translation id="8965037249707889821">Introduzir palavra-passe antiga</translation> <translation id="8965697826696209160">Não existe espaço suficiente.</translation> <translation id="8968527460726243404">Criador de imagem do sistema do SO Chrome</translation> +<translation id="8970203673128054105">Ver lista do modo de transmissão</translation> <translation id="89720367119469899">Escape</translation> <translation id="8972513834460200407">Consulte o seu administrador de rede para ter a certeza de que a firewall não está a bloquear as transferências dos servidores da Google.</translation> <translation id="8974161578568356045">Detectar Automaticamente</translation> @@ -5430,6 +5469,7 @@ <translation id="9011178328451474963">Último separador</translation> <translation id="9013284500811652791"><ph name="UWS_NAME" />, <ph name="UWS_NAME" /> e mais um</translation> <translation id="9013587737291179248">Não foi possível importar o utilizador supervisionado. Verifique o espaço disponível no disco rígido e as autorizações e tente novamente.</translation> +<translation id="901440679911238150">Os detalhes da conta estão desatualizados. <ph name="BEGIN_LINK" />Inicie sessão novamente<ph name="END_LINK" />.</translation> <translation id="9014987600015527693">Mostrar outro telemóvel</translation> <translation id="9015601075560428829">Entrada de voz</translation> <translation id="9016164105820007189">A estabelecer ligação a "<ph name="DEVICE_NAME" />".</translation> @@ -5443,6 +5483,7 @@ <translation id="9025098623496448965">Regressar ao ecrã de início de sessão</translation> <translation id="902638246363752736">Definições do teclado</translation> <translation id="9026731007018893674">transferir</translation> +<translation id="9027146684281895941">Supervisione esta pessoa para controlar e ver os Websites visitados pela mesma a partir da sua Conta Google.</translation> <translation id="9027459031423301635">Abrir Link num Novo &Separador</translation> <translation id="9027603907212475920">Configurar sincronização...</translation> <translation id="9033453977881595182">ID do token</translation> @@ -5557,6 +5598,7 @@ <translation id="9203478404496196495">Reativar som do separador</translation> <translation id="9203962528777363226">O administrador deste dispositivo desativou a adição de novos utilizadores</translation> <translation id="9205143043463108573">Posiciona o Iniciador de Aplicações no centro do ecrã com um aspeto de paisagem.</translation> +<translation id="9205160891051296441">Suporte para a política SystemTimezoneAutomaticDetection</translation> <translation id="9206487995878691001">Método de introdução cangjie</translation> <translation id="9207194316435230304">ATOK</translation> <translation id="9208886416788010685">Adobe Reader desactualizado</translation> @@ -5578,6 +5620,7 @@ <translation id="939736085109172342">Nova pasta</translation> <translation id="940425055435005472">Tamanho do tipo de letra:</translation> <translation id="941543339607623937">Chave privada inválida.</translation> +<translation id="942532530371314860"><ph name="APP_NAME" /> está a partilhar um separador do Chrome e o áudio.</translation> <translation id="942954117721265519">Não existem imagens neste diretório.</translation> <translation id="945522503751344254">Enviar comentários</translation> <translation id="946810925362320585">Seguir a recomendação</translation>
diff --git a/chrome/app/resources/generated_resources_ro.xtb b/chrome/app/resources/generated_resources_ro.xtb index f606a76..eef3a429 100644 --- a/chrome/app/resources/generated_resources_ro.xtb +++ b/chrome/app/resources/generated_resources_ro.xtb
@@ -661,7 +661,6 @@ <translation id="1962233722219655970">Această pagină utilizează o aplicație Client nativ care nu funcționează pe computerul dvs.</translation> <translation id="1965328510789761112">Memorie privată</translation> <translation id="1965624977906726414">Nu are permisiuni speciale.</translation> -<translation id="1968720524450620475">Activează pictogramele de acțiune pentru Notificările web.</translation> <translation id="1970746430676306437">Afișează &informații despre pagină</translation> <translation id="197288927597451399">Păstrează</translation> <translation id="1973491249112991739">Descărcarea pluginului <ph name="PLUGIN_NAME" /> a eșuat.</translation> @@ -1423,7 +1422,6 @@ <translation id="302014277942214887">Introduceți ID-ul aplicației sau adresa URL a magazinului web.</translation> <translation id="3020616530769498629">Activează reîncărcarea fără validare în urma acțiunii „trage pentru a actualiza”</translation> <translation id="3020990233660977256">Numărul de serie: <ph name="SERIAL_NUMBER" /></translation> -<translation id="3021245547458004908">Când este activat, bara de instrumente nu va fi niciodată ascunsă din cauza derulării pe dispozitive cu ecran de minimum 800 dp. Aceasta va fi în continuare ascunsă când conținutul paginii se afișează pe tot ecranul.</translation> <translation id="3021678814754966447">&Afișează sursa cadrului</translation> <translation id="3024374909719388945">Utilizează formatul de 24 de ore</translation> <translation id="3025022340603654002">Sugerează completări automate la primul clic cu mouse-ul pe un element dintr-un formular.</translation> @@ -1494,7 +1492,6 @@ <translation id="3117812041123364382">Activează/Dezactivează tastatură virtuală mobilă.</translation> <translation id="3118319026408854581">Ajutor <ph name="PRODUCT_NAME" /></translation> <translation id="3120430004221004537">Criptare insuficientă pentru o operațiune pe: „<ph name="DEVICE_NAME" />”.</translation> -<translation id="3121260210578524273">Activează pictogramele în butoanele de acțiune pentru Notificările web.</translation> <translation id="3121793941267913344">Resetați acest dispozitiv <ph name="IDS_SHORT_PRODUCT_NAME" /></translation> <translation id="3122162841865761901">Experimente cu Instrumentele pentru dezvoltatori</translation> <translation id="3122464029669770682">CPU</translation> @@ -1704,7 +1701,7 @@ <translation id="3392020134425442298">Recuperați fișierul rău-intenționat</translation> <translation id="3394150261239285340"><ph name="HOST" /> dorește să utilizeze camera foto și microfonul.</translation> <translation id="3394279550557729862">Activează compatibilitatea pentru folosirea notificărilor native și a centrului de notificări pe platformele unde acestea sunt disponibile.</translation> -<translation id="3394862755749546286">Dezactivează canalul media unificat (Android sau desktop) pe Android.</translation> +<translation id="3394862755749546286">Dezactivează canalul media unificat (Android și desktop) pe Android.</translation> <translation id="3396331542604645348">Imprimanta selectată nu este disponibilă sau nu este instalată corect. Verificați imprimanta sau încercați să selectați altă imprimantă.</translation> <translation id="3399597614303179694">Tastatură macedoneană</translation> <translation id="3401130144947259741">Dacă este activat, evenimentele de urmărire vor fi exportate în Urmărirea evenimentelor Windows (ETW) și pot fi apoi capturate de instrumente cum ar fi UIForETW sau Xperf.</translation> @@ -2275,6 +2272,7 @@ <translation id="421017592316736757">Trebuie să fiți online pentru a accesa acest fișier.</translation> <translation id="421182450098841253">&Afișați bara de marcaje</translation> <translation id="4212108296677106246">Ai încredere în „<ph name="CERTIFICATE_NAME" />” ca autoritate de certificare?</translation> +<translation id="42126664696688958">Exportă</translation> <translation id="42137655013211669">Accesul la această resursă a fost interzis de server.</translation> <translation id="4215350869199060536">Hopa, în nume apar simboluri nepermise!</translation> <translation id="4215898373199266584">Data viitoare ați putea utiliza modul incognito (<ph name="INCOGNITO_MODE_SHORTCUT" />).</translation> @@ -3306,7 +3304,6 @@ <translation id="577322787686508614">Operațiunea de citire nu este permisă pe: „<ph name="DEVICE_NAME" />”.</translation> <translation id="5774295353725270860">Deschideți aplicația Fișiere</translation> <translation id="5774515636230743468">Manifest:</translation> -<translation id="5776006986202016118">Acest site dorește să se conecteze la:</translation> <translation id="577624874850706961">Caută cookie-uri</translation> <translation id="5778550464785688721">Control complet asupra dispozitivelor MIDI</translation> <translation id="5780066559993805332">(Cea mai bună)</translation> @@ -4195,7 +4192,6 @@ <translation id="7175353351958621980">Încărcată de la:</translation> <translation id="7180611975245234373">Actualizați</translation> <translation id="7180865173735832675">Personalizează</translation> -<translation id="7184428045150946911">Dezactivează ascunderea automată a barei de instrumente pe tabletele mari</translation> <translation id="7185690883425432021">Ascunde butoanele de închidere din filele inactive atunci când bara cu file se află în modul Stivuite.</translation> <translation id="7186088072322679094">Păstrează în bara de instrumente</translation> <translation id="719009910964971313">Tastatura pentru programatori S.U.A Dvorak</translation>
diff --git a/chrome/app/resources/generated_resources_ru.xtb b/chrome/app/resources/generated_resources_ru.xtb index 30268a55..06169c62 100644 --- a/chrome/app/resources/generated_resources_ru.xtb +++ b/chrome/app/resources/generated_resources_ru.xtb
@@ -183,16 +183,19 @@ <translation id="1259724620062607540">7-й объект на панели запуска</translation> <translation id="1260240842868558614">Показать:</translation> <translation id="126710816202626562">Перевести на:</translation> +<translation id="1269690813141254680">Google может использовать историю просмотров для персонализации Поиска и других сервисов. Чтобы настроить эту функцию, перейдите на страницу <ph name="BEGIN_LINK" />Отслеживание действий<ph name="END_LINK" />.</translation> <translation id="1272079795634619415">Остановить</translation> <translation id="1272978324304772054">Этот аккаунт не относится к домену, в котором зарегистрировано устройство. Чтобы зарегистрироваться в другом домене, сначала восстановите настройки устройства.</translation> <translation id="127353061808977798">Шрифты и кодировка</translation> <translation id="1274997165432133392">Файлы cookie и другие данные сайтов</translation> <translation id="1275718070701477396">Выбрано</translation> +<translation id="1277908057200820621">Просмотреть список устройств</translation> <translation id="1278049586634282054">Отладка страниц:</translation> <translation id="1278813325885878377">Венгерская QWERTY-клавиатура</translation> <translation id="1285320974508926690">Никогда не переводить этот сайт</translation> <translation id="1285484354230578868">Сохранение данных на вашем Google Диске</translation> <translation id="1290223615328246825">Автоматический вход не выполнен</translation> +<translation id="1293509594570842875">Не удалось создать контролируемый профиль. Проверьте подключение к сети и повторите попытку позже.</translation> <translation id="1293556467332435079">Файлы</translation> <translation id="1294298200424241932">Изменить настройки доверия:</translation> <translation id="1295794900245526845">Чтобы войти, выберите нужный аккаунт в <ph name="PASSWORD_MANAGER_BRAND" /></translation> @@ -291,6 +294,7 @@ <translation id="1429740407920618615">Мощность сигнала:</translation> <translation id="143027896309062157">Просмотр и изменение данных на вашем компьютере и посещаемых сайтах</translation> <translation id="1430915738399379752">Печать</translation> +<translation id="1433423644370450034">Уведомления MediaStyle</translation> <translation id="1434696352799406980">Будут сброшены настройки главной страницы, страницы быстрого доступа и поисковой системы, а также откреплены все вкладки. Кроме того, система отключит все расширения и удалит все временные данные, такие как файлы cookie. Ваши закладки, история просмотров и пароли будут сохранены.</translation> <translation id="1434886155212424586">В качестве главной страницы установлена страница быстрого доступа.</translation> <translation id="1435550882135542937">Новое оформление панели инструментов расширений</translation> @@ -377,6 +381,7 @@ <translation id="1526925867532626635">Подтверждение настроек синхронизации</translation> <translation id="1528372117901087631">Подключение к Интернету</translation> <translation id="1529968269513889022">за прошлую неделю</translation> +<translation id="1531865825384516080">Отчеты об URL для Безопасного поиска</translation> <translation id="1532697124104874386">Включает/отключает автоматическое развертывание виртуальной клавиатуры.</translation> <translation id="1533897085022183721">Меньше <ph name="MINUTES" />.</translation> <translation id="1533920822694388968">Выравнивание рамки экрана</translation> @@ -661,7 +666,6 @@ <translation id="1962233722219655970">На этой странице используется приложение Native Client, не поддерживаемое вашим компьютером.</translation> <translation id="1965328510789761112">Частная память</translation> <translation id="1965624977906726414">Без специальных разрешений.</translation> -<translation id="1968720524450620475">Включить значки действий для Web Notifications</translation> <translation id="1970746430676306437">Просмотр &сведений о странице</translation> <translation id="197288927597451399">Сохранить</translation> <translation id="1973491249112991739">Не удалось скачать плагин <ph name="PLUGIN_NAME" />.</translation> @@ -759,6 +763,7 @@ <translation id="212862741129535676">Продолжительность работы процессора на разных ступенях частоты в процентах</translation> <translation id="2128691215891724419">Ошибка синхронизации. Обновите кодовую фразу.</translation> <translation id="2129904043921227933">Ошибка синхронизации. Обновите кодовую фразу.</translation> +<translation id="2130053362119884302">Открепление вкладок в полноэкранном режиме</translation> <translation id="2131077480075264">Невозможно установить <ph name="APP_NAME" />: нет разрешения от <ph name="IMPORT_NAME" /></translation> <translation id="2134149231879627725">Разрешить удаленно осуществлять блокировку устройства, удаление с него данных и определение его местоположения</translation> <translation id="2134986351331412790">На этом сайте карты такого типа не принимаются.</translation> @@ -771,6 +776,7 @@ <translation id="2143778271340628265">Настройка прокси-сервера вручную</translation> <translation id="2143915448548023856">Настройки экрана</translation> <translation id="2144536955299248197">Инструмент просмотра сертификатов: <ph name="CERTIFICATE_NAME" /></translation> +<translation id="2147827593068025794">Фоновая синхронизация</translation> <translation id="2148756636027685713">Форматирование завершено</translation> <translation id="2148892889047469596">Трансляция содержимого вкладки</translation> <translation id="2148999191776934271">Батарея будет полностью заряжена через <ph name="HOUR" />:<ph name="MINUTE" /></translation> @@ -1150,6 +1156,7 @@ <translation id="2665717534925640469">Страница отображается в полноэкранном режиме и пытается скрыть курсор.</translation> <translation id="2665919335226618153">Произошла ошибка форматирования.</translation> <translation id="2668079306436607263">Перемещение по истории просмотра при достижении конца прокрутки</translation> +<translation id="2670102641511624474">Приложение "<ph name="APP_NAME" />" предоставило доступ к вкладке Chrome.</translation> <translation id="2670965183549957348">раскладка чжуинь</translation> <translation id="2672142220933875349">Файл CRX поврежден, распаковать его не удалось.</translation> <translation id="2672394958563893062">Произошла ошибка. Нажмите, чтобы воспроизвести сначала.</translation> @@ -1196,6 +1203,7 @@ <translation id="2733364097704495499">Зарегистрировать принтер <ph name="PRINTER_NAME" /> в приложении "Виртуальный принтер Google"?</translation> <translation id="2735698359135166290">Cтандартная румынская клавиатура</translation> <translation id="2737363922397526254">Свернуть...</translation> +<translation id="2737755522130570180">Блокировка скриптов, загруженных с помощью метода document.write</translation> <translation id="2738771556149464852">Не позже</translation> <translation id="2739191690716947896">Отладка</translation> <translation id="2739240477418971307">Изменение настроек специальных возможностей</translation> @@ -1265,6 +1273,7 @@ <translation id="2805646850212350655">Зашифрованная файловая система (EFS) Microsoft</translation> <translation id="2805707493867224476">Разрешить открытие всплывающих окон на всех сайтах</translation> <translation id="2805756323405976993">Сервисы</translation> +<translation id="2808243220963392165">Разрешает открепление вкладок от панели в полноэкранном режиме на компьютерах Mac.</translation> <translation id="2809142985846095314">Предлагать загрузку сохраненных карт</translation> <translation id="2809346626032021864">Книги</translation> <translation id="2809586584051668049">и ещё <ph name="NUMBER_ADDITIONAL_DISABLED" /></translation> @@ -1393,6 +1402,7 @@ <translation id="2968792643335932010">Скрыть</translation> <translation id="2971033837577180453"><span>Идентификатор:</span> <ph name="EXTENSION_ID" /></translation> <translation id="2971213274238188218">уменьшить яркость</translation> +<translation id="2971422413423640756">Кнопка скачивания на странице с URL мультимедиа</translation> <translation id="2972557485845626008">Микропрограмма</translation> <translation id="2972581237482394796">&Повторить</translation> <translation id="297870353673992530">DNS-сервер:</translation> @@ -1425,7 +1435,6 @@ <translation id="302014277942214887">Введите идентификатор приложения или URL интернет-магазина.</translation> <translation id="3020616530769498629">Обновлять страницу без подтверждения, когда пользователь тянет ее вниз</translation> <translation id="3020990233660977256">Серийный номер: <ph name="SERIAL_NUMBER" /></translation> -<translation id="3021245547458004908">Показывает панель инструментов на экранах, у которых не менее 800 dp, даже при прокрутке. Скрывает ее при переходе в полноэкранный режим.</translation> <translation id="3021678814754966447">Просмотр кода фрейма</translation> <translation id="3024374909719388945">Использовать 24-часовой формат</translation> <translation id="3025022340603654002">Предлагает варианты автозаполнения при нажатии кнопкой мыши на элемент формы.</translation> @@ -1458,6 +1467,7 @@ <translation id="3057861065630527966">Создать резервные копии фото и видео</translation> <translation id="3058212636943679650">Для восстановления операционной системы вам понадобится SD-карта или USB-накопитель.</translation> <translation id="305932878998873762">Simple Cache для HTTP – это новая система кеширования, в которой место на диске выделяется средствами файловой системы.</translation> +<translation id="3062606427884046423">Разрешает использование уведомлений MediaStyle (Android) для мультимедийных уведомлений Chrome.</translation> <translation id="3064388234319122767">Транслитерация (zdravo → здраво)</translation> <translation id="3065041951436100775">Сообщение о вкладке, закрытой из-за отсутствия ответа.</translation> <translation id="3065140616557457172">Введите поисковый запрос или напечатайте URL, по которому надо перейти, – все просто работает.</translation> @@ -1496,7 +1506,6 @@ <translation id="3117812041123364382">Позволяет включить/отключить всплывающую виртуальную клавиатуру.</translation> <translation id="3118319026408854581">Справка <ph name="PRODUCT_NAME" /></translation> <translation id="3120430004221004537">Неполное шифрование операции на устройстве <ph name="DEVICE_NAME" />.</translation> -<translation id="3121260210578524273">Включает значки действий для Web Notifications.</translation> <translation id="3121793941267913344">Сбросить настройки устройства <ph name="IDS_SHORT_PRODUCT_NAME" /></translation> <translation id="3122162841865761901">Функция экспериментов для разработчиков</translation> <translation id="3122464029669770682">ЦПУ</translation> @@ -1541,6 +1550,7 @@ <translation id="3170072451822350649">Можно пропустить это действие и начать <ph name="LINK_START" />гостевой сеанс<ph name="LINK_END" />.</translation> <translation id="3170544058711792988">Установить лупу в центре экрана</translation> <translation id="3172213052701798825">Smart Lock для паролей</translation> +<translation id="3175469972022788345">Разрешает использование сертификатов ECDSA для WebRTC.</translation> <translation id="317583078218509884">Новые настройки разрешений для сайта вступят в силу после обновления страницы.</translation> <translation id="3177048931975664371">Нажмите, чтобы скрыть пароль</translation> <translation id="3180365125572747493">Введите пароль для шифрования этого файла сертификата.</translation> @@ -1994,6 +2004,7 @@ <translation id="3776796446459804932">Это расширение нарушает правила Интернет-магазина Chrome.</translation> <translation id="3778152852029592020">Скачивание отменено.</translation> <translation id="3778740492972734840">&Инструменты разработчика</translation> +<translation id="3780663724044634171">Выберите аккаунт для управления контролируемым профилем.</translation> <translation id="378312418865624974">Просмотр уникального идентификатора этого компьютера</translation> <translation id="3783640748446814672">alt</translation> <translation id="3785308913036335955">Отображение ярлыков приложений</translation> @@ -2017,6 +2028,7 @@ <translation id="3807747707162121253">&Отмена</translation> <translation id="3809280248639369696">Пришелец</translation> <translation id="3810973564298564668">Настроить</translation> +<translation id="3811494700605067549">Выбран 1 файл</translation> <translation id="3812034401428455285"><ph name="UWS_NAME" /> и <ph name="UWS_NAME" /></translation> <translation id="3812525830114410218">Недопустимый сертификат</translation> <translation id="3813984289128269159">Поиск по команде "О'кей, Google"</translation> @@ -2046,6 +2058,7 @@ <translation id="3838543471119263078">Файлы cookie, а также другие данные сайтов и плагинов</translation> <translation id="3839497635014791588">Дополнительный отклик на прикосновение к элементам интерфейса</translation> <translation id="3840053866656739575">Соединение с Chromebox потеряно, и мы пытаемся его восстановить. Вы пока можете подойти поближе и проверить устройство.</translation> +<translation id="3840055807562919428">Запрещает загружать сторонние скрипты, блокирующие синтаксические анализаторы. Эти скрипты вставлены в главный фрейм с помощью метода document.write.</translation> <translation id="3842552989725514455">Шрифты с засечками</translation> <translation id="3846593650622216128">Эти настройки определяются расширением.</translation> <translation id="3846833722648675493">Показывать окна приложений, после того как контент будет готов к отображению. Окна объемных приложений, загружающих ресурсы в синхронном режиме, будут открываться со значительной задержкой. Параметр практически не повлияет на приложения с асинхронной загрузкой большей части ресурсов.</translation> @@ -2277,6 +2290,7 @@ <translation id="421017592316736757">Для доступа к файлу необходимо подключение к Интернету.</translation> <translation id="421182450098841253">Показывать панель &закладок</translation> <translation id="4212108296677106246">Доверять "<ph name="CERTIFICATE_NAME" />" в качестве Центра сертификации?</translation> +<translation id="42126664696688958">Экспортировать</translation> <translation id="42137655013211669">Доступ к этому ресурсу запрещен сервером.</translation> <translation id="4215350869199060536">Имя содержит недопустимые символы!</translation> <translation id="4215898373199266584">Кстати: в режиме инкогнито (<ph name="INCOGNITO_MODE_SHORTCUT" />) история не сохраняется.</translation> @@ -2363,6 +2377,7 @@ <translation id="4359408040881008151">Установлено, так как есть зависимые расширения.</translation> <translation id="4361190688154226069">Прямоугольная область касания</translation> <translation id="4364444725319685468">Файл <ph name="FILE_NAME" /> скачан</translation> +<translation id="4364567974334641491">Приложение "<ph name="APP_NAME" />" предоставило доступ к окну.</translation> <translation id="4364830672918311045">Показывать оповещения</translation> <translation id="4365673000813822030">К сожалению, выполнить синхронизацию не удалось.</translation> <translation id="4366509400410520531">Разрешено вами</translation> @@ -2432,6 +2447,7 @@ <translation id="4479639480957787382">Ethernet</translation> <translation id="4479812471636796472">Американская раскладка (Дворак)</translation> <translation id="4481249487722541506">Загрузить распакованное расширение...</translation> +<translation id="4482194545587547824">Google может использовать историю просмотров для персонализации Поиска и других сервисов.</translation> <translation id="4487088045714738411">Бельгийская раскладка</translation> <translation id="4492190037599258964">Результаты поиска по запросу "<ph name="SEARCH_STRING" />"</translation> <translation id="4495021739234344583">Отменить регистрацию и перезагрузить</translation> @@ -2475,6 +2491,7 @@ <translation id="4554591392113183336">Внешнее расширение не новее существующего.</translation> <translation id="4554796861933393312">Скорость анимации для чернильного пятна в Material Design</translation> <translation id="4555769855065597957">Тень</translation> +<translation id="4556110439722119938">Пароли, закладки, история и другие параметры будут синхронизированы с аккаунтом Google, чтобы у вас был доступ к ним на любом устройстве.</translation> <translation id="4557136421275541763">Внимание!</translation> <translation id="4558426062282641716">Требуется разрешение на автозапуск</translation> <translation id="4563210852471260509">Первоначальный язык ввода – китайский</translation> @@ -2596,6 +2613,7 @@ <translation id="4742746985488890273">Закрепить на панели запуска</translation> <translation id="474421578985060416">Заблокировано вами</translation> <translation id="4744574733485822359">Скачивание завершено</translation> +<translation id="4746330764136728131">Сертификаты ECDSA для WebRTC</translation> <translation id="4746971725921104503">Похоже, здесь уже есть пользователь с таким именем. <ph name="LINK_START" />Импортировать данные пользователя <ph name="USER_DISPLAY_NAME" /> на это устройство<ph name="LINK_END" />?</translation> <translation id="4747271164117300400">Македонская</translation> <translation id="4749157430980974800">Грузинская раскладка клавиатуры</translation> @@ -2745,6 +2763,7 @@ <translation id="496226124210045887">Выбранный каталог содержит конфиденциальные файлы. Предоставить пользователю "$1" постоянный доступ на чтение данных в этом каталоге?</translation> <translation id="4964673849688379040">Проверка...</translation> <translation id="4966802378343010715">Создать профиль</translation> +<translation id="4967749818080339523">Выберите аккаунт</translation> <translation id="496888482094675990">С помощью приложения "Файлы" можно быстро открыть документы с Google Диска, устройства под управлением Chrome OS или из внешнего хранилища.</translation> <translation id="4971412780836297815">Открыть по завершении</translation> <translation id="497244430928947428">Раскладка малаялам (фонетическая)</translation> @@ -2791,6 +2810,7 @@ <translation id="5038863510258510803">Активация...</translation> <translation id="5039512255859636053">$1 ТБ</translation> <translation id="5039804452771397117">Разрешить</translation> +<translation id="5043851552150732346">Выбран 1 каталог</translation> <translation id="5045550434625856497">Неправильный пароль</translation> <translation id="5048179823246820836">Нордическая</translation> <translation id="5048294425697652159">Включение Quirks Client для калибровки дисплея</translation> @@ -2878,6 +2898,7 @@ <translation id="5170477580121653719">Свободно на Диске Google: <ph name="SPACE_AVAILABLE" />.</translation> <translation id="5170568018924773124">Показать в папке</translation> <translation id="5171045022955879922">Введите запрос или URL</translation> +<translation id="5171343362375269016">Память подкачки</translation> <translation id="5175870427301879686"><ph name="URL" /> запрашивает постоянное хранение данных на вашем компьютере.</translation> <translation id="5177479852722101802">Всегда блокировать доступ к веб-камере и микрофону</translation> <translation id="5177526793333269655">Уменьшенные изображения</translation> @@ -3035,6 +3056,7 @@ <translation id="5380103295189760361">Нажмите Control, Alt, Shift или Search, чтобы увидеть соответствующие быстрые клавиши.</translation> <translation id="5382392428640372740">Включить отслеживание веб-навигации</translation> <translation id="5388588172257446328">Имя пользователя:</translation> +<translation id="5389237414310520250">Не удалось создать контролируемый профиль. Убедитесь, что у вас есть необходимые разрешения и свободное место на жестком диске, а затем повторите попытку.</translation> <translation id="5390284375844109566">Индексированная база данных</translation> <translation id="5392544185395226057">Включить поддержку Native Client.</translation> <translation id="5396126354477659676">Плагин <ph name="PEPPER_PLUGIN_NAME" /> в домене <ph name="PEPPER_PLUGIN_DOMAIN" /> пытается получить доступ к вашему компьютеру.</translation> @@ -3102,6 +3124,7 @@ <translation id="5469954281417596308">Диспетчер закладок</translation> <translation id="5470838072096800024">Последнее получение</translation> <translation id="5473075389972733037">IBM</translation> +<translation id="5473279832922912143">Включает V8, чтобы использовать экспериментальный интерпретатор Ignition для выполнения JavaScript.</translation> <translation id="5474139872592516422">После завершения обновления плагина <ph name="PLUGIN_NAME" /> обновите страницу, чтобы активировать его.</translation> <translation id="5480254151128201294">Устройство заблокировано владельцем.</translation> <translation id="5483785310822538350">Запретить доступ к файлам и устройствам</translation> @@ -3129,6 +3152,7 @@ <translation id="5509914365760201064">Поставщик сертификата: <ph name="CERTIFICATE_AUTHORITY" /></translation> <translation id="5511823366942919280">Использовать это устройство как Shark?</translation> <translation id="5512653252560939721">Сертификат пользователя должен поддерживаться аппаратным обеспечением.</translation> +<translation id="5513242761114685513">Контекстное меню</translation> <translation id="5515008897660088170">Окна приложений на базе Toolkit-Views</translation> <translation id="551752069230578406">Добавление принтера в аккаунт. Это может занять несколько минут...</translation> <translation id="5518584115117143805">Сертификат шифрования электронной почты</translation> @@ -3309,7 +3333,6 @@ <translation id="577322787686508614">Чтение данных на устройстве <ph name="DEVICE_NAME" /> запрещено.</translation> <translation id="5774295353725270860">Открыть приложение "Файлы"</translation> <translation id="5774515636230743468">Манифест:</translation> -<translation id="5776006986202016118">Сайт запрашивает доступ к:</translation> <translation id="577624874850706961">Поиск файлов cookie</translation> <translation id="5778550464785688721">Полный контроль над MIDI-устройствами</translation> <translation id="5780066559993805332">(Максимальное)</translation> @@ -3387,6 +3410,7 @@ <translation id="5874045675243596003">Строгий режим (жесткий отказ при невозможности получить хеши)</translation> <translation id="5875858680971105888">Не удалось импортировать контролируемый профиль. Проверьте подключение к сети и повторите попытку позже.</translation> <translation id="5880247576487732437">Наличие токена</translation> +<translation id="5884474295213649357">Эта вкладка подключена к USB-устройству</translation> <translation id="5885324376209859881">Управление настройками мультимедийных устройств...</translation> <translation id="5889282057229379085">Максимальное количество промежуточных ЦС: <ph name="NUM_INTERMEDIATE_CA" /></translation> <translation id="5892290200158927959">Французская раскладка (BÉPO)</translation> @@ -3476,6 +3500,8 @@ <translation id="604124094241169006">Автоматически</translation> <translation id="6042308850641462728">Подробнее...</translation> <translation id="604257181445267932">Функция Smart Lock, которая использует сохраненные в Google пароли, позволяет быстро входить в аккаунты на сайтах и в приложениях.</translation> +<translation id="6043317578411397101">Приложение "<ph name="APP_NAME" />" предоставило сайту <ph name="TAB_NAME" /> доступ к вкладке Chrome.</translation> +<translation id="6044805581023976844">Приложение "<ph name="APP_NAME" />" предоставило сайту <ph name="TAB_NAME" /> доступ к вкладке Chrome и к аудио.</translation> <translation id="6049065490165456785">Фотография с устройства</translation> <translation id="6051028581720248124">Выполняя печать в отделении FedEx, вы принимаете <ph name="START_LINK" />Условия использования<ph name="END_LINK" />.</translation> <translation id="6051086608691487286">Наложение полос прокрутки</translation> @@ -3604,6 +3630,7 @@ <translation id="6251889282623539337"><ph name="DOMAIN" /> – Условия использования</translation> <translation id="6251924700383757765">Политика конфиденциальности</translation> <translation id="6253586523465486793">Перезагружать страницу без подтверждения, когда пользователь тянет ее вниз. Если функция отключена, страницы перезагружаются в обычном режиме (с проверкой кеша).</translation> +<translation id="6254182355913122230">Память подкачки</translation> <translation id="6254503684448816922">Ключ скомпрометирован</translation> <translation id="6259104249628300056">обнаружение устройств в вашей локальной сети</translation> <translation id="6263082573641595914">Версия ЦС Microsoft</translation> @@ -3874,6 +3901,7 @@ <translation id="6680028776254050810">Смена пользователя</translation> <translation id="6681668084120808868">Сфотографировать</translation> <translation id="668171684555832681">Другой...</translation> +<translation id="6682083956260248340">Изменить эти параметры можно на странице <ph name="BEGIN_LINK" /></translation> <translation id="6686490380836145850">Закрыть вкладки справа</translation> <translation id="6686817083349815241">Сохранить пароль</translation> <translation id="6689514201497896398">Пропускать проверку вовлеченности пользователей</translation> @@ -3941,10 +3969,12 @@ <translation id="6798954102094737107">Плагин: <ph name="PLUGIN_NAME" /></translation> <translation id="6802031077390104172"><ph name="USAGE" /> (<ph name="OID" />)</translation> <translation id="6804671422566312077">Открыть все закладки в &новом окне</translation> +<translation id="6805542829187142700">Включает автоматическое определение часового пояса на устройстве.</translation> <translation id="6805647936811177813">Чтобы импортировать сертификат с <ph name="HOST_NAME" />, войдите в <ph name="TOKEN_NAME" />.</translation> <translation id="680572642341004180">Включить отслеживание RLZ-идентификатора для <ph name="SHORT_PRODUCT_OS_NAME" />.</translation> <translation id="6807889908376551050">Показать все…</translation> <translation id="6809448577646370871">Нестандартное переключение между окнами приложений Chrome</translation> +<translation id="6810613314571580006">Входить на веб-сайты с помощью сохраненного имени пользователя и пароля. Когда функция отключена, эти данные нужно указывать при каждом входе.</translation> <translation id="6812349420832218321">Нельзя запускать <ph name="PRODUCT_NAME" /> от имени суперпользователя.</translation> <translation id="6812841287760418429">Сохранить изменения</translation> <translation id="6814124696888326520">Легкое переключение между раскладками клавиатуры, а также доступ к смайлам, голосовому и рукописному вводу</translation> @@ -4131,6 +4161,7 @@ <translation id="7065534935986314333">О системе</translation> <translation id="7066944511817949584">Не удалось подключиться к устройству "<ph name="DEVICE_NAME" />".</translation> <translation id="7067725467529581407">Больше не показывать</translation> +<translation id="7068609958927777019">Включает отправку данных о недопустимых URL в Безопасный поиск.</translation> <translation id="7070804685954057874">Прямой ввод</translation> <translation id="7072010813301522126">Название ярлыка</translation> <translation id="7072025625456903686">Разрешить все или настроить</translation> @@ -4196,10 +4227,10 @@ <translation id="7170467426996704624">Транслитерация (salam → ሰላም)</translation> <translation id="7172053773111046550">Эстонская раскладка</translation> <translation id="7173828187784915717">Настройки для метода чжуинь</translation> +<translation id="7173917244679555">У вас уже есть контролируемый профиль с именем "<ph name="PROFILE_NAME" />". <ph name="BEGIN_LINK" />Импортировать его<ph name="END_LINK" /> на это устройство?</translation> <translation id="7175353351958621980">Загружено из:</translation> <translation id="7180611975245234373">Обновить</translation> <translation id="7180865173735832675">Настроить</translation> -<translation id="7184428045150946911">Не скрывать панель инструментов автоматически на больших планшетах</translation> <translation id="7185690883425432021">Скрывать значки для закрытия неактивных вкладок, расположенных каскадом.</translation> <translation id="7186088072322679094">Сохранить на Панели инструментов</translation> <translation id="719009910964971313">Клавиатура Дворака для программистов (США)</translation> @@ -4264,6 +4295,7 @@ <translation id="7280825545668757494">Синхронизировать учетные данные Wi-Fi</translation> <translation id="7280877790564589615">Требуется разрешение</translation> <translation id="7282547042039404307">Плавный переход</translation> +<translation id="7284549674086796566">Экспериментальный движок JavaScript</translation> <translation id="7287143125007575591">Доступ запрещен.</translation> <translation id="7288592446024861651">Пароли, закладки, история и другие параметры синхронизируются с аккаунтом Google. Это значит, что они будут доступны вам на любом устройстве. Выбрать данные для синхронизации можно здесь: <ph name="BEGIN_LINK" />.</translation> <translation id="7288676996127329262"><ph name="HORIZONTAL_DPI" /> x <ph name="VERTICAL_DPI" /> dpi</translation> @@ -4286,6 +4318,7 @@ <translation id="7321545336522791733">Сервер недоступен</translation> <translation id="7325437708553334317">Расширение высокой контрастности</translation> <translation id="7326565110843845436">Трехпальцевый жест для сенсорной панели</translation> +<translation id="7327088014939803293">Не удалось создать контролируемый профиль. Убедитесь, что вы вошли в аккаунт, и повторите попытку.</translation> <translation id="73289266812733869">Не выбрано</translation> <translation id="7329154610228416156">Не удалось выполнить вход из-за перенаправления на небезопасный URL (<ph name="BLOCKED_URL" />). Обратитесь к администратору.</translation> <translation id="7331786426925973633">Простой, быстрый и безопасный браузер</translation> @@ -4460,6 +4493,7 @@ <translation id="7573172247376861652">Заряд батареи</translation> <translation id="7576032389798113292">6x4</translation> <translation id="7576690715254076113">Разобрать по копиям</translation> +<translation id="7580671184200851182">Воспроизводить одно и то же аудио через все динамики (моноаудио)</translation> <translation id="7581279002575751816">Плагины NPAPI не поддерживаются.</translation> <translation id="7581462281756524039">Инструмент очистки</translation> <translation id="7582582252461552277">Предпочитать эту сеть</translation> @@ -4692,6 +4726,7 @@ <translation id="7925686952655276919">Не используйте синхронизацию данных с мобильных устройств</translation> <translation id="7926906273904422255">Незащищенные источники будут помечены как небезопасные или сомнительные.</translation> <translation id="7928710562641958568">Извлечь устройство</translation> +<translation id="79312157130859720">Приложение "<ph name="APP_NAME" />" предоставило доступ к экрану и аудио.</translation> <translation id="7938594894617528435">Сейчас не в Сети</translation> <translation id="7939374455203157513">Включить облачные сервисы Google</translation> <translation id="7939412583708276221">Все равно продолжить</translation> @@ -5126,6 +5161,7 @@ <translation id="8571108619753148184">Сервер 4</translation> <translation id="8572832761467613633">Только Flash</translation> <translation id="8572981282494768930">Запретить сайтам доступ к камере и микрофону</translation> +<translation id="8574234089711453001">Показывает кнопку скачивания про просмотре страницы с URL мультимедиа.</translation> <translation id="857779305329188634">Поддержка экспериментального протокола QUIC.</translation> <translation id="8579285237314169903">Синхронизация файлов (<ph name="NUMBER_OF_FILES" />)...</translation> <translation id="8579549103199280730">Спрашивать по умолчанию</translation> @@ -5181,6 +5217,7 @@ <translation id="8656768832129462377">Не проверять</translation> <translation id="8656946437567854031">Нажимая "Продолжить", вы принимаете следующие правила и условия: <ph name="LEGAL_DOC_LINK_TEXT_1" />, <ph name="LEGAL_DOC_LINK_TEXT_2" />, <ph name="LEGAL_DOC_LINK_TEXT_3" />, <ph name="LEGAL_DOC_LINK_TEXT_4" />, <ph name="LEGAL_DOC_LINK_TEXT_5" /> и <ph name="LEGAL_DOC_LINK_TEXT_6" />.</translation> <translation id="8658595122208653918">Изменить настройки принтера</translation> +<translation id="8658645149275195032">Приложение "<ph name="APP_NAME" />" предоставило сайту <ph name="TAB_NAME" /> доступ к экрану и аудио.</translation> <translation id="8659716501582523573">IP-адрес:</translation> <translation id="8661290697478713397">Открыть ссылку в режиме инкогнито</translation> <translation id="8662795692588422978">Пользователи</translation> @@ -5386,6 +5423,7 @@ <translation id="8942416694471994740">Доступ к микрофону предоставляет администратор.</translation> <translation id="894360074127026135">Netscape International Step-Up</translation> <translation id="8944779739948852228">Принтер найден</translation> +<translation id="8944964446326379280">Приложение "<ph name="APP_NAME" />" предоставило сайту <ph name="TAB_NAME" /> доступ к окну.</translation> <translation id="8946359700442089734">На устройстве <ph name="IDS_SHORT_PRODUCT_NAME" /> включены не все функции отладки.</translation> <translation id="8946784827990177241">Включает поддержку WebUSB.</translation> <translation id="89515141420106838">Включает приложение "Галерея Интернет-магазина Chrome" для драйверов принтера. Это приложение находит в Интернет-магазине Chrome расширения, поддерживающие печать через USB-принтер со специальным идентификатором USB.</translation> @@ -5404,6 +5442,7 @@ <translation id="8965037249707889821">Введите старый пароль</translation> <translation id="8965697826696209160">Недостаточно свободного места.</translation> <translation id="8968527460726243404">Системное средство записи изображений в Chrome OS</translation> +<translation id="8970203673128054105">Просмотреть список режимов трансляции</translation> <translation id="89720367119469899">Отключить</translation> <translation id="8972513834460200407">Уточните у администратора сети, не блокирует ли брандмауэр скачивание файлов с серверов Google.</translation> <translation id="8974161578568356045">Определять автоматически</translation> @@ -5431,6 +5470,7 @@ <translation id="9011178328451474963">Последняя вкладка</translation> <translation id="9013284500811652791"><ph name="UWS_NAME" />, <ph name="UWS_NAME" /> и ещё 1</translation> <translation id="9013587737291179248">Не удалось импортировать контролируемый профиль. Проверьте объем пространства на жестком диске и наличие разрешений и повторите попытку.</translation> +<translation id="901440679911238150">Данные аккаунта устарели. <ph name="BEGIN_LINK" />Войдите ещё раз<ph name="END_LINK" />.</translation> <translation id="9014987600015527693">Другой телефон</translation> <translation id="9015601075560428829">Голосовой ввод</translation> <translation id="9016164105820007189">Подключение к устройству "<ph name="DEVICE_NAME" />".</translation> @@ -5444,6 +5484,7 @@ <translation id="9025098623496448965">ОК. Вернуться на экран входа.</translation> <translation id="902638246363752736">Настройки клавиатуры</translation> <translation id="9026731007018893674">скачанные файлы</translation> +<translation id="9027146684281895941">Просматривать сайты, открытые этим пользователем, и контролировать его действия через аккаунт Google.</translation> <translation id="9027459031423301635">Открыть ссылку в новой вкладке</translation> <translation id="9027603907212475920">Настройка синхронизации...</translation> <translation id="9033453977881595182">Идентификатор токена</translation> @@ -5558,6 +5599,7 @@ <translation id="9203478404496196495">Включение звука на вкладке</translation> <translation id="9203962528777363226">Администратор этого устройства отключил возможность добавлять новых пользователей</translation> <translation id="9205143043463108573">Показывать Панель запуска приложений в центре экрана при горизонтальной ориентации</translation> +<translation id="9205160891051296441">Поддержка правила SystemTimezoneAutomaticDetection</translation> <translation id="9206487995878691001">Цан-цзе</translation> <translation id="9207194316435230304">ATOK</translation> <translation id="9208886416788010685">Версия Adobe Reader устарела</translation> @@ -5579,6 +5621,7 @@ <translation id="939736085109172342">Новая папка</translation> <translation id="940425055435005472">Размер шрифта:</translation> <translation id="941543339607623937">Недопустимый открытый ключ.</translation> +<translation id="942532530371314860">Приложение "<ph name="APP_NAME" />" предоставило доступ к вкладке Chrome и к аудио.</translation> <translation id="942954117721265519">В этом каталоге нет изображений.</translation> <translation id="945522503751344254">Отправить отзыв</translation> <translation id="946810925362320585">Следовать рекомендациям</translation>
diff --git a/chrome/app/resources/generated_resources_sk.xtb b/chrome/app/resources/generated_resources_sk.xtb index f1a567b..560c71e1 100644 --- a/chrome/app/resources/generated_resources_sk.xtb +++ b/chrome/app/resources/generated_resources_sk.xtb
@@ -183,16 +183,19 @@ <translation id="1259724620062607540">7. položka na poličke</translation> <translation id="1260240842868558614">Zobraziť:</translation> <translation id="126710816202626562">Jazyk prekladu:</translation> +<translation id="1269690813141254680">V časti <ph name="BEGIN_LINK" />Riadenie aktivity Google<ph name="END_LINK" /> môžete ovládať, ako bude Google používať vašu históriu prehliadania na prispôsobenie Vyhľadávania a ďalších služieb Google.</translation> <translation id="1272079795634619415">Zastaviť</translation> <translation id="1272978324304772054">Tento používateľský účet nepatrí do domény, do ktorej je zaregistrované toto zariadenie. Ak sa chcete zaregistrovať do inej domény, musíte najprv zariadenie obnoviť.</translation> <translation id="127353061808977798">Písma a kódovanie</translation> <translation id="1274997165432133392">Súbory cookie a ďalšie dáta webov</translation> <translation id="1275718070701477396">Vybraté</translation> +<translation id="1277908057200820621">Zobraziť zoznam zariadení</translation> <translation id="1278049586634282054">Skontrolovať zobrazenia:</translation> <translation id="1278813325885878377">Maďarská klávesnica QWERTY</translation> <translation id="1285320974508926690">Nikdy neprekladať tieto webové stránky</translation> <translation id="1285484354230578868">Ukladať údaje v účte na Disku Google</translation> <translation id="1290223615328246825">Automatické prihlásenie zlyhalo</translation> +<translation id="1293509594570842875">Nepodarilo sa vytvoriť nového kontrolovaného používateľa. Skontrolujte pripojenie k sieti a skúste to znova neskôr.</translation> <translation id="1293556467332435079">Súbory</translation> <translation id="1294298200424241932">Upraviť nastavenia dôveryhodnosti:</translation> <translation id="1295794900245526845">Ak sa chcete prihlásiť, vyberte svoj účet uložený v aplikácii <ph name="PASSWORD_MANAGER_BRAND" /></translation> @@ -291,6 +294,7 @@ <translation id="1429740407920618615">Sila signálu:</translation> <translation id="143027896309062157">Čítať a meniť všetky údaje na počítači a navštevovaných weboch</translation> <translation id="1430915738399379752">Tlačiť</translation> +<translation id="1433423644370450034">Upozornenie v štýle médií</translation> <translation id="1434696352799406980">Týmto sa obnoví vaša stránka pri spustení, stránka na novej karte, vyhľadávač a pripnuté karty. Zakážu sa aj všetky rozšírenia a vymažú dočasné dáta, ako napríklad súbory cookie. Záložky, história a uložené heslá sa nevymažú.</translation> <translation id="1434886155212424586">Domovská stránka predstavuje stránku Nová karta</translation> <translation id="1435550882135542937">Zmena vzhľadu panela rozšírení</translation> @@ -378,6 +382,7 @@ <translation id="1526925867532626635">Potvrdiť nastavenia synchronizácie</translation> <translation id="1528372117901087631">Pripojenie k internetu</translation> <translation id="1529968269513889022">posledný týždeň</translation> +<translation id="1531865825384516080">Odosielanie webových adries Bezpečného vyhľadávania</translation> <translation id="1532697124104874386">Povolenie/zakázanie inteligentného nasadenia virtuálnej klávesnice.</translation> <translation id="1533897085022183721">Menej ako <ph name="MINUTES" />.</translation> <translation id="1533920822694388968">Zarovnanie televízie</translation> @@ -502,7 +507,7 @@ <translation id="169515659049020177">Shift</translation> <translation id="1697068104427956555">Vyberte štvorcovú oblasť obrázka.</translation> <translation id="1697532407822776718">Všetko je nastavené!</translation> -<translation id="1697988819212986149">Umožňuje zobraziť ikonu Google vedľa položiek kontextovej ponuky používajúcu technológiu služieb Google.</translation> +<translation id="1697988819212986149">Umožňuje zobraziť ikonu Google vedľa položiek kontextovej ponuky používajúcich technológiu služieb Google.</translation> <translation id="1699274548822076330">Tento príznak je určený na použitie v spojení s príznakom trace-upload-url. UPOZORNENIE: Keď ho povolíte, Chrome bude zaznamenávať údaje o výkonnosti každej navigácie a nahrá ich na webovú adresu určenú príznakom trace-upload-url. Sledovací záznam môže zahrnovať informácie umožňujúce identifikáciu osôb, ako sú názvy a webové adresy stránok, ktoré navštívite.</translation> <translation id="1699395855685456105">Revízia hardvéru:</translation> @@ -661,7 +666,6 @@ <translation id="1962233722219655970">Táto stránka používa aplikáciu Native Client, ktorá na vašom počítači nefunguje.</translation> <translation id="1965328510789761112">Súkromná pamäť</translation> <translation id="1965624977906726414">Nemá zvláštne povolenia.</translation> -<translation id="1968720524450620475">Povolenie ikon akcií pre webové upozornenia</translation> <translation id="1970746430676306437">Zobraziť i&nformácie o stránke</translation> <translation id="197288927597451399">Uložiť</translation> <translation id="1973491249112991739">Sťahovanie doplnku <ph name="PLUGIN_NAME" /> zlyhalo.</translation> @@ -760,6 +764,7 @@ <translation id="212862741129535676">Percento obsadenia priestoru údajmi stavu frekvencie</translation> <translation id="2128691215891724419">Chyba synchronizácie: Aktualizujte prístupovú frázu pre synchronizáciu...</translation> <translation id="2129904043921227933">Chyba synchronizácie: Aktualizujte prístupovú frázu synchronizácie...</translation> +<translation id="2130053362119884302">Povolenie uvoľnenia kariet v režime celej obrazovky</translation> <translation id="2131077480075264">Aplikáciu <ph name="APP_NAME" /> nie je možné nainštalovať, pretože nie je povolená v importe <ph name="IMPORT_NAME" /></translation> <translation id="2134149231879627725">Umožní službe Google pomôcť vám so vzdialeným uzamknutím, vymazaním alebo vyhľadaním zariadenia.</translation> <translation id="2134986351331412790">Je nám to ľúto, ale na týchto stránkach sa neakceptuje táto značka karty.</translation> @@ -772,6 +777,7 @@ <translation id="2143778271340628265">Ručná konfigurácia servera proxy</translation> <translation id="2143915448548023856">Nastavenia obrazovky</translation> <translation id="2144536955299248197">Zobrazovač certifikátov: <ph name="CERTIFICATE_NAME" /></translation> +<translation id="2147827593068025794">Synchronizácia na pozadí</translation> <translation id="2148756636027685713">Formátovanie bolo dokončené</translation> <translation id="2148892889047469596">Prenášanie karty</translation> <translation id="2148999191776934271">Nabíjanie @@ -1150,6 +1156,7 @@ <translation id="2665717534925640469">Táto stránka je zobrazená na celú obrazovku a zakázala kurzor myši.</translation> <translation id="2665919335226618153">Ojoj! Pri formátovaní sa vyskytla chyba.</translation> <translation id="2668079306436607263">Navigácia v histórii posúvaním</translation> +<translation id="2670102641511624474"><ph name="APP_NAME" /> zdieľa kartu Chromu.</translation> <translation id="2670965183549957348">Metóda vstupu Chewing</translation> <translation id="2672142220933875349">Neplatný súbor crx, rozbalenie zlyhalo</translation> <translation id="2672394958563893062">Vyskytla sa chyba. Kliknutím spustíte prehrávanie od začiatku.</translation> @@ -1196,6 +1203,7 @@ <translation id="2733364097704495499">Chcete zaregistrovať tlačiareň <ph name="PRINTER_NAME" /> do služby Google Cloud Print?</translation> <translation id="2735698359135166290">Rumunská štandardná klávesnica</translation> <translation id="2737363922397526254">Zbaliť...</translation> +<translation id="2737755522130570180">Blokovať skripty načítané prostredníctvom prvku document.write</translation> <translation id="2738771556149464852">Nie po</translation> <translation id="2739191690716947896">Ladiť</translation> <translation id="2739240477418971307">Zmeniť nastavenia dostupnosti</translation> @@ -1265,6 +1273,7 @@ <translation id="2805646850212350655">Systém šifrovania súborov spoločnosti Microsoft</translation> <translation id="2805707493867224476">Povoliť všetkým webovým stránkam zobrazovať kontextové okná</translation> <translation id="2805756323405976993">Aplikácie</translation> +<translation id="2808243220963392165">Umožní uvoľnenie kariet z pruhu kariet v režime celej obrazovky na počítači Mac.</translation> <translation id="2809142985846095314">Povoliť ponúkanie nahrávania automaticky doplnených kreditných kariet</translation> <translation id="2809346626032021864">Čítanie</translation> <translation id="2809586584051668049">a ďalšie (počet: <ph name="NUMBER_ADDITIONAL_DISABLED" />)</translation> @@ -1393,6 +1402,7 @@ <translation id="2968792643335932010">Menej kópií</translation> <translation id="2971033837577180453"><span>ID:</span><ph name="EXTENSION_ID" /></translation> <translation id="2971213274238188218">znížiť jas</translation> +<translation id="2971422413423640756">Tlačidlo Stiahnuť pri otváraní stránky s webovou adresou médií.</translation> <translation id="2972557485845626008">Firmvér</translation> <translation id="2972581237482394796">&Dopredu</translation> <translation id="297870353673992530">Server DNS:</translation> @@ -1425,7 +1435,6 @@ <translation id="302014277942214887">Zadajte ID aplikácie alebo webovú adresu webového obchodu.</translation> <translation id="3020616530769498629">Povolenie opätovného načítania bez overenia na základe obnovenia potiahnutím</translation> <translation id="3020990233660977256">Sériové číslo: <ph name="SERIAL_NUMBER" /></translation> -<translation id="3021245547458004908">Keď je táto možnosť povolená, pri posúvaní na zariadeniach s veľkosťou obrazovky väčšou alebo rovnajúcou sa hodnote 800 dp sa panel s nástrojmi nikdy neskryje. Vždy sa však skryje, keď sa zobrazí obsah stránky na celej obrazovke.</translation> <translation id="3021678814754966447">&Zobraziť zdrojový kód rámca</translation> <translation id="3024374909719388945">Použiť 24-hodinový režim hodín</translation> <translation id="3025022340603654002">Ponúkať návrhy automatického dopĺňania pri prvom kliknutí na prvok formulára.</translation> @@ -1437,7 +1446,7 @@ <translation id="3030243755303701754">Kontrolovaný používateľ môže preskúmavať web pod vaším dohľadom. Ako správca kontrolovaného používateľa v Chrome môžete: • povoliť alebo zakázať konkrétne weby; - • kontrolovať weby, ktoré kontrolovaný používateľ navštívil; a + • pozrieť si weby, ktoré kontrolovaný používateľ navštívil; a • spravovať ďalšie nastavenia. Pri vytvorení kontrolovaného používateľa sa nevytvorí účet Google a jeho záložky, história prehliadania ani ďalšie predvoľby sa neprenesú na ďalšie zariadenia pomocou Synchronizácie Chrome. Po vytvorení nového kontrolovaného používateľa môžete kedykoľvek spravovať nastavenia z akéhokoľvek zariadenia na adrese <ph name="BEGIN_MANAGE_LINK" /><ph name="DISPLAY_LINK" /><ph name="END_MANAGE_LINK" />. @@ -1458,6 +1467,7 @@ <translation id="3057861065630527966">Zálohovať fotky a videá</translation> <translation id="3058212636943679650">Ak budete niekedy musieť obnoviť operačný systém počítača, budete potrebovať SD kartu na obnovenie alebo pamäťový kľúč USB.</translation> <translation id="305932878998873762">Pamäť Simple Cache pre protokol HTTP bude novou vyrovnávacou pamäťou. Prideľovanie diskového priestoru prenecháva systému súborov.</translation> +<translation id="3062606427884046423">Používať upozornenia MediaStyle systému Android pre upozornenia médií Chromu.</translation> <translation id="3064388234319122767">Prepis (zdravo → здраво)</translation> <translation id="3065041951436100775">Spätná väzba týkajúca sa vynútene ukončenej karty</translation> <translation id="3065140616557457172">Zadajte text na vyhľadávanie alebo webovú adresu – funguje všetko.</translation> @@ -1496,7 +1506,6 @@ <translation id="3117812041123364382">Povolenie/zakázanie plávajúcej virtuálnej klávesnice.</translation> <translation id="3118319026408854581">Pomocník aplikácie <ph name="PRODUCT_NAME" /></translation> <translation id="3120430004221004537">Nedostatočné šifrovanie pre danú operáciu na zariadení <ph name="DEVICE_NAME" />.</translation> -<translation id="3121260210578524273">Povoliť ikony v tlačidlách akcií pre webové upozornenia.</translation> <translation id="3121793941267913344">Obnovenie tohto zariadenia <ph name="IDS_SHORT_PRODUCT_NAME" /></translation> <translation id="3122162841865761901">Experimenty Nástrojov pre vývojárov</translation> <translation id="3122464029669770682">CPU</translation> @@ -1541,6 +1550,7 @@ <translation id="3170072451822350649">Môžete tiež preskočiť prihlásenie a <ph name="LINK_START" />prehliadať ako hosť<ph name="LINK_END" />.</translation> <translation id="3170544058711792988">Ponechať zameranie lupy v strede obrazovky</translation> <translation id="3172213052701798825">Google Smart Lock na heslá</translation> +<translation id="3175469972022788345">Keď je tento príznak povolený, WebRTC bude používať certifikáty ECDSA.</translation> <translation id="317583078218509884">Nové nastavenia povolení webových stránok sa prejavia po opätovnom načítaní stránky.</translation> <translation id="3177048931975664371">Kliknutím skryjete heslo</translation> <translation id="3180365125572747493">Zadajte heslo na zašifrovanie tohto certifikačného súboru.</translation> @@ -1994,6 +2004,7 @@ <translation id="3776796446459804932">Toto rozšírenie porušuje pravidlá Internetového obchodu Chrome.</translation> <translation id="3778152852029592020">Sťahovanie bolo zrušené.</translation> <translation id="3778740492972734840">&Nástroje pre vývojárov</translation> +<translation id="3780663724044634171">Vyberte účet na správu kontrolovaného používateľa.</translation> <translation id="378312418865624974">Čítať jedinečný identifikátor pre tento počítač</translation> <translation id="3783640748446814672">alt</translation> <translation id="3785308913036335955">Zobraziť skratku Aplikácií</translation> @@ -2017,6 +2028,7 @@ <translation id="3807747707162121253">&Zrušiť</translation> <translation id="3809280248639369696">Mesačný lúč</translation> <translation id="3810973564298564668">Spravovať</translation> +<translation id="3811494700605067549">1 vybratý súbor</translation> <translation id="3812034401428455285"><ph name="UWS_NAME" /> a <ph name="UWS_NAME" /></translation> <translation id="3812525830114410218">Nesprávny certifikát</translation> <translation id="3813984289128269159">Ok Google</translation> @@ -2046,6 +2058,7 @@ <translation id="3838543471119263078">Súbory cookie a ďalšie dáta webov a doplnkov</translation> <translation id="3839497635014791588">Dodatočná dotyková spätná väzba pre komponenty používateľského rozhrania</translation> <translation id="3840053866656739575">Pripojenie k vášmu zariadeniu Chromebox bolo stratené. Priblížte sa alebo skontrolujte svoje zariadenie, zatiaľ čo prebehne pokus o opätovné pripojenie.</translation> +<translation id="3840055807562919428">Zakázať načítavania skriptov na blokovanie analyzátora od tretích strán vložených do hlavného rámca prostredníctvom prvku document.write.</translation> <translation id="3842552989725514455">Pätkové písmo</translation> <translation id="3846593650622216128">Tieto nastavenia sú vynútené rozšírením.</translation> <translation id="3846833722648675493">Zobrazenie okien aplikácií po prvom vykreslení. Okná sa zobrazia s výrazným oneskorením, pretože veľké aplikácie načítavajú zdroje synchrónne. Oneskorenie bude bezvýznamné v prípade aplikácií, ktoré načítavajú väčšinu svojich zdrojov asynchrónne.</translation> @@ -2277,6 +2290,7 @@ <translation id="421017592316736757">Ak chcete pristupovať k tomuto súboru, musíte byť online.</translation> <translation id="421182450098841253">&Zobraziť panel so záložkami</translation> <translation id="4212108296677106246">Chcete dôverovať „<ph name="CERTIFICATE_NAME" />“ ako certifikačnej autorite?</translation> +<translation id="42126664696688958">Exportovať</translation> <translation id="42137655013211669">Server zakázal prístup k tomuto zdroju</translation> <translation id="4215350869199060536">Hops, v mene sú nepovolené symboly!</translation> <translation id="4215898373199266584">Nabudúce by sa vám mohol hodiť režim inkognito (<ph name="INCOGNITO_MODE_SHORTCUT" />).</translation> @@ -2363,6 +2377,7 @@ <translation id="4359408040881008151">Nainštalované pre závislé rozšírenia.</translation> <translation id="4361190688154226069">Zacielenie prostredníctvom plochy v tvare obdĺžnika v zobrazeniach</translation> <translation id="4364444725319685468">Súbor <ph name="FILE_NAME" /> je stiahnutý</translation> +<translation id="4364567974334641491"><ph name="APP_NAME" /> zdieľa okno.</translation> <translation id="4364830672918311045">Zobrazovať upozornenia</translation> <translation id="4365673000813822030">Synchronizácia prestala pracovať.</translation> <translation id="4366509400410520531">Povolené vami</translation> @@ -2432,6 +2447,7 @@ <translation id="4479639480957787382">Ethernet</translation> <translation id="4479812471636796472">americká klávesnica s rozložením klávesov Dvorak</translation> <translation id="4481249487722541506">Načítať rozbalené rozšírenie...</translation> +<translation id="4482194545587547824">Google môže používať vašu históriu prehliadania na prispôsobenie Vyhľadávania a ďalších služieb Google</translation> <translation id="4487088045714738411">belgická klávesnica</translation> <translation id="4492190037599258964">Výsledky vyhľadávania pre dopyt „<ph name="SEARCH_STRING" />“</translation> <translation id="4495021739234344583">Zrušiť registráciu a reštartovať</translation> @@ -2475,6 +2491,7 @@ <translation id="4554591392113183336">Verzia externého rozšírenia je rovnaká alebo nižšia ako existujúca verzia</translation> <translation id="4554796861933393312">Rýchlosť animácie vzhľadu Material Design Ink Drop</translation> <translation id="4555769855065597957">Tieň</translation> +<translation id="4556110439722119938">Záložky, história, heslá a ďalšie nastavenia budú synchronizované s vaším účtom Google a budete ich môcť použiť na všetkých zariadeniach</translation> <translation id="4557136421275541763">Upozornenie:</translation> <translation id="4558426062282641716">Požaduje sa povolenie na automatické spustenie</translation> <translation id="4563210852471260509">Úvodný jazyk vstupu: čínština</translation> @@ -2595,6 +2612,7 @@ <translation id="4742746985488890273">Pripnúť na poličku</translation> <translation id="474421578985060416">Blokované vami</translation> <translation id="4744574733485822359">Sťahovanie bolo dokončené</translation> +<translation id="4746330764136728131">Používať certifikáty ECDSA pre WebRTC</translation> <translation id="4746971725921104503">Zdá sa, že používateľa s týmto menom už spravujete. Chcete <ph name="LINK_START" />používateľa <ph name="USER_DISPLAY_NAME" /> importovať do tohto zariadenia<ph name="LINK_END" />?</translation> <translation id="4747271164117300400">Macedónčina</translation> <translation id="4749157430980974800">Gruzínska klávesnica</translation> @@ -2744,6 +2762,7 @@ <translation id="496226124210045887">Vybratý priečinok obsahuje citlivé súbory. Naozaj chcete aplikácii $1 povoliť trvalý prístup na čítanie pre tento priečinok?</translation> <translation id="4964673849688379040">Prebieha kontrola...</translation> <translation id="4966802378343010715">Vytvoriť nového používateľa</translation> +<translation id="4967749818080339523">Vyberte účet</translation> <translation id="496888482094675990">Aplikácia Súbory poskytuje rýchly prístup k súborom, ktoré ste uložili na Disk Google, do externého úložiska alebo do zariadenia so systémom OS Chrome.</translation> <translation id="4971412780836297815">Otvoriť po stiahnutí</translation> <translation id="497244430928947428">Malajálamska klávesnica (fonetický prepis)</translation> @@ -2790,6 +2809,7 @@ <translation id="5038863510258510803">Prebieha povoľovanie...</translation> <translation id="5039512255859636053">$1 TB</translation> <translation id="5039804452771397117">Povoliť</translation> +<translation id="5043851552150732346">1 vybratý adresár</translation> <translation id="5045550434625856497">Nesprávne heslo</translation> <translation id="5048179823246820836">Severské</translation> <translation id="5048294425697652159">Povolenie klienta Quirks na zobrazenie kalibrácie</translation> @@ -2877,6 +2897,7 @@ <translation id="5170477580121653719">Voľné miesto v službe Disk Google: <ph name="SPACE_AVAILABLE" /></translation> <translation id="5170568018924773124">Zobraziť v priečinku</translation> <translation id="5171045022955879922">Vyhľadajte alebo zadajte webovú adresu</translation> +<translation id="5171343362375269016">Swapovaná pamäť</translation> <translation id="5175870427301879686">Stránky <ph name="URL" /> chcú natrvalo ukladať údaje v miestnom počítači.</translation> <translation id="5177479852722101802">Aj naďalej blokovať prístup ku kamere a mikrofónu</translation> <translation id="5177526793333269655">Zobrazenie miniatúr</translation> @@ -3034,6 +3055,7 @@ <translation id="5380103295189760361">Stlačením klávesov Ctrl, Alt, Shift alebo Hľadať zobrazíte klávesové skratky pre tieto modifikátory.</translation> <translation id="5382392428640372740">Povoliť sledovanie navigácie</translation> <translation id="5388588172257446328">Používateľské meno:</translation> +<translation id="5389237414310520250">Nového používateľa sa nepodarilo vytvoriť. Skontrolujte priestor na pevnom disku a povolenia a skúste to znova.</translation> <translation id="5390284375844109566">Indexovaná databáza</translation> <translation id="5392544185395226057">Povolí podporu pre technológiu Native Client.</translation> <translation id="5396126354477659676">Doplnok <ph name="PEPPER_PLUGIN_NAME" /> na stránkach <ph name="PEPPER_PLUGIN_DOMAIN" /> chce získať prístup k vášmu počítaču.</translation> @@ -3101,6 +3123,7 @@ <translation id="5469954281417596308">Správca záložiek</translation> <translation id="5470838072096800024">Čas posledného prijatia</translation> <translation id="5473075389972733037">IBM</translation> +<translation id="5473279832922912143">Povoliť V8 na používanie experimentálneho tlmočníka Ignition na spúšťanie JavaScriptu.</translation> <translation id="5474139872592516422">Po dokončení aktualizácie doplnku <ph name="PLUGIN_NAME" /> ho aktivujete opätovným načítaním stránky.</translation> <translation id="5480254151128201294">Toto zariadenie uzamkol jeho vlastník.</translation> <translation id="5483785310822538350">Odvolať prístup k súborom a zariadeniam</translation> @@ -3128,6 +3151,7 @@ <translation id="5509914365760201064">Vydavateľ: <ph name="CERTIFICATE_AUTHORITY" /></translation> <translation id="5511823366942919280">Naozaj chcete toto zariadenie nastaviť ako zariadenie Shark?</translation> <translation id="5512653252560939721">Certifikát používateľa musí byť hardvérový.</translation> +<translation id="5513242761114685513">Kontextová ponuka</translation> <translation id="5515008897660088170">Okná aplikácie založené na prvku Toolkit-Views</translation> <translation id="551752069230578406">Tlačiareň sa pridáva do vášho účtu. Môže to chvíľu trvať...</translation> <translation id="5518584115117143805">Certifikát na šifrovanie e-mailov</translation> @@ -3308,7 +3332,6 @@ <translation id="577322787686508614">Operácia čítania je na zariadení <ph name="DEVICE_NAME" /> zakázaná.</translation> <translation id="5774295353725270860">Otvoriť aplikáciu Súbory</translation> <translation id="5774515636230743468">Manifest:</translation> -<translation id="5776006986202016118">Tento web sa chce pripojiť k:</translation> <translation id="577624874850706961">Hľadať súbory cookie</translation> <translation id="5778550464785688721">Úplné ovládanie zariadení MIDI</translation> <translation id="5780066559993805332">(Najlepšie)</translation> @@ -3386,6 +3409,7 @@ <translation id="5874045675243596003">Vynútenie prísneho overenia (ak nemôžeme získať kódy hash, dôjde k zlyhaniu)</translation> <translation id="5875858680971105888">Ojoj! Nepodarilo sa importovať kontrolovaného používateľa. Skontrolujte sieťové pripojenie a skúste to znova neskôr.</translation> <translation id="5880247576487732437">Token je k dispozícii</translation> +<translation id="5884474295213649357">Táto karta je pripojená k zariadeniu USB.</translation> <translation id="5885324376209859881">Spravovať nastavenia médií...</translation> <translation id="5889282057229379085">Maximálny počet sprostredkujúcich certifikačných autorít: <ph name="NUM_INTERMEDIATE_CA" /></translation> <translation id="5892290200158927959">Francúzska klávesnica BÉPO</translation> @@ -3477,6 +3501,8 @@ <translation id="604124094241169006">Automatické</translation> <translation id="6042308850641462728">Viac</translation> <translation id="604257181445267932">Funkcia Smart Lock vám umožňuje rýchlo sa prihlásiť do aplikácií a na webových stránkach pomocou hesiel uložených na Googli.</translation> +<translation id="6043317578411397101"><ph name="APP_NAME" /> zdieľa kartu Chromu s kartou <ph name="TAB_NAME" />.</translation> +<translation id="6044805581023976844"><ph name="APP_NAME" /> zdieľa kartu Chromu a zvuk s kartou <ph name="TAB_NAME" />.</translation> <translation id="6049065490165456785">Fotografia z vnútorného fotoaparátu</translation> <translation id="6051028581720248124">Ak tlačíte v službe FedEx Office, súhlasíte s jej <ph name="START_LINK" />zmluvnými podmienkami<ph name="END_LINK" />.</translation> <translation id="6051086608691487286">Prekryvné posúvače</translation> @@ -3605,6 +3631,7 @@ <translation id="6251889282623539337"><ph name="DOMAIN" /> – Zmluvné podmienky</translation> <translation id="6251924700383757765">Pravidlá ochrany súkromia</translation> <translation id="6253586523465486793">Vynúti opätovné načítanie bez overenia spustené obnovením po potiahnutí (keď je tento príznak deaktivovaný, zvyčajne to znamená bežné opätovné načítanie s overením vyrovnávacej pamäte).</translation> +<translation id="6254182355913122230">Swapovaná pamäť</translation> <translation id="6254503684448816922">Ohrozenie zabezpečenia kľúča</translation> <translation id="6259104249628300056">Objavovať zariadenia vo vašej miestnej sieti</translation> <translation id="6263082573641595914">Certifikačná autorita spoločnosti Microsoft – verzia</translation> @@ -3875,6 +3902,7 @@ <translation id="6680028776254050810">Prepnutie používateľov</translation> <translation id="6681668084120808868">Zaznamenať fotografiu</translation> <translation id="668171684555832681">Iný...</translation> +<translation id="6682083956260248340">Túto funkciu môžete ovládať v časti <ph name="BEGIN_LINK" /></translation> <translation id="6686490380836145850">Zatvoriť karty vpravo</translation> <translation id="6686817083349815241">Uloženie hesla</translation> <translation id="6689514201497896398">Vynechať kontroly interakcie používateľov</translation> @@ -3942,10 +3970,12 @@ <translation id="6798954102094737107">Doplnok: <ph name="PLUGIN_NAME" /></translation> <translation id="6802031077390104172"><ph name="USAGE" /> (<ph name="OID" />)</translation> <translation id="6804671422566312077">Otvoriť všetky záložky v &novom okne</translation> +<translation id="6805542829187142700">Povolenie pravidla zariadenia pre automatické zisťovanie časového pásma systému.</translation> <translation id="6805647936811177813">Ak chcete importovať certifikát klienta z adresy <ph name="HOST_NAME" />, prihláste sa do <ph name="TOKEN_NAME" />.</translation> <translation id="680572642341004180">Povoliť v aplikácii <ph name="SHORT_PRODUCT_OS_NAME" /> sledovanie RLZ.</translation> <translation id="6807889908376551050">Zobraziť všetky...</translation> <translation id="6809448577646370871">Vlastné prepínanie okien pre aplikácie Chrome</translation> +<translation id="6810613314571580006">Prihlasovať sa na weby automaticky pomocou uložených poverení. Keď je táto funkcia zakázaná, zobrazí sa pred každým prihlásením na web výzva s potvrdením.</translation> <translation id="6812349420832218321"><ph name="PRODUCT_NAME" /> sa nepodarilo spustiť v mene používateľa root.</translation> <translation id="6812841287760418429">Zachovať zmeny</translation> <translation id="6814124696888326520">Ľahšie prepínanie metód vstupu a jednoduchší prístup k ďalším funkciám vstupu: hlasovému vstupu, ručnému písaniu a ikonám emodži.</translation> @@ -3961,7 +3991,7 @@ <translation id="6825883775269213504">Ruština</translation> <translation id="6827236167376090743">Toto video sa bude prehrávať počas neurčitej doby.</translation> <translation id="6828153365543658583">Obmedziť prihlásenie na nasledujúcich používateľov:</translation> -<translation id="6828434191343384461">Vybraté údaje boli odstránené z Chromu a synchronizovaných zariadení. Váš účet Google môže mať ďalšie formy histórie prehliadania na adrese <ph name="BEGIN_LINK" />history.google.com<ph name="END_LINK" />, ako napríklad vyhľadávania a aktivity v iných službách Google.</translation> +<translation id="6828434191343384461">Vybraté údaje boli odstránené z Chromu a synchronizovaných zariadení. Váš účet Google môže mať ďalšie formy histórie prehliadania na adrese <ph name="BEGIN_LINK" />history.google.com<ph name="END_LINK" /> (napríklad vyhľadávania a aktivity v iných službách Google).</translation> <translation id="6828860976882136098">Nepodarilo sa nastaviť automatické aktualizácie pre všetkých používateľov (chyba pri vykonávaní predbežnej kontroly: <ph name="ERROR_NUMBER" />)</translation> <translation id="6829250331733125857">Získajte pomoc so zariadením <ph name="DEVICE_TYPE" />.</translation> <translation id="6829270497922309893">Registrácia vo vašej organizácii</translation> @@ -4133,6 +4163,7 @@ <translation id="7065534935986314333">O systéme</translation> <translation id="7066944511817949584">Nepodarilo sa pripojiť k zariadeniu „<ph name="DEVICE_NAME" />“.</translation> <translation id="7067725467529581407">Túto výzvu už nezobrazovať</translation> +<translation id="7068609958927777019">Ak je tento príznak povolený, nevhodné webové adresy je možné nahlásiť späť Bezpečnému vyhľadávaniu.</translation> <translation id="7070804685954057874">Priamy vstup</translation> <translation id="7072010813301522126">Názov skratky</translation> <translation id="7072025625456903686">Povoliť všetky alebo prispôsobiť</translation> @@ -4198,10 +4229,10 @@ <translation id="7170467426996704624">Prepis (salam → ሰላም)</translation> <translation id="7172053773111046550">estónska klávesnica</translation> <translation id="7173828187784915717">Nastavenia vstupu Chewing</translation> +<translation id="7173917244679555">Zdá sa, že používateľa s týmto menom už spravujete. Chcete používateľa <ph name="PROFILE_NAME" /> <ph name="BEGIN_LINK" />importovať do tohto zariadenia<ph name="END_LINK" />?</translation> <translation id="7175353351958621980">Načítané z:</translation> <translation id="7180611975245234373">Obnoviť</translation> <translation id="7180865173735832675">Prispôsobiť</translation> -<translation id="7184428045150946911">Zakázanie automatického skrývania panela s nástrojmi</translation> <translation id="7185690883425432021">Skryje tlačidlá na zatvorenie neaktívnych kariet počas ich zoskupovania na paneli kariet.</translation> <translation id="7186088072322679094">Ponechať na paneli s nástrojmi</translation> <translation id="719009910964971313">Klávesnica US Programmer Dvorak</translation> @@ -4266,6 +4297,7 @@ <translation id="7280825545668757494">Synchronizácia poverení siete Wi-Fi</translation> <translation id="7280877790564589615">Vyžaduje sa povolenie</translation> <translation id="7282547042039404307">Plynulá</translation> +<translation id="7284549674086796566">Experimentálny tlmočník JavaScriptu</translation> <translation id="7287143125007575591">Prístup bol odmietnutý</translation> <translation id="7288592446024861651">Záložky, história, heslá a ďalšie nastavenia budú synchronizované do vášho účtu Google a budete ich môcť použiť na všetkých zariadeniach. Položky, ktoré sa majú synchronizovať, môžete zmeniť na adrese <ph name="BEGIN_LINK" /></translation> <translation id="7288676996127329262"><ph name="HORIZONTAL_DPI" />x<ph name="VERTICAL_DPI" /> dpi</translation> @@ -4288,6 +4320,7 @@ <translation id="7321545336522791733">Server je nedostupný</translation> <translation id="7325437708553334317">Rozšírenie Vysoký kontrast</translation> <translation id="7326565110843845436">Klepnutie na touchpad troma prstami</translation> +<translation id="7327088014939803293">Nového kontrolovaného používateľa sa nepodarilo vytvoriť. Skontrolujte, či ste správne prihlásený/-á, a skúste to znova.</translation> <translation id="73289266812733869">Nevybraté</translation> <translation id="7329154610228416156">Prihlásenie zlyhalo, pretože bolo nakonfigurované tak, aby použilo nezabezpečenú webovú adresu (<ph name="BLOCKED_URL" />). Kontaktuje svojho správcu.</translation> <translation id="7331786426925973633">Webový prehliadač navrhnutý s ohľadom na rýchlosť, jednoduchosť a bezpečnosť</translation> @@ -4462,6 +4495,7 @@ <translation id="7573172247376861652">Nabíjanie batérie</translation> <translation id="7576032389798113292">6x4</translation> <translation id="7576690715254076113">Kompletovať</translation> +<translation id="7580671184200851182">Prehrávajte rovnaký zvuk zo všetkých reproduktorov (monofónny zvuk)</translation> <translation id="7581279002575751816">Doplnky NPAPI nie sú podporované.</translation> <translation id="7581462281756524039">Nástroj na čistenie</translation> <translation id="7582582252461552277">Preferovať túto sieť</translation> @@ -4694,6 +4728,7 @@ <translation id="7925686952655276919">Nepoužívať mobilné dátové prenosy na synchronizáciu</translation> <translation id="7926906273904422255">Označiť nezabezpečené zdroje ako Nezabezpečené alebo Pochybné.</translation> <translation id="7928710562641958568">Vysunúť zariadenie</translation> +<translation id="79312157130859720"><ph name="APP_NAME" /> zdieľa vašu obrazovku a zvuk.</translation> <translation id="7938594894617528435">Momentálne offline</translation> <translation id="7939374455203157513">Povoliť cloudové služby</translation> <translation id="7939412583708276221">Aj tak ponechať</translation> @@ -5129,6 +5164,7 @@ <translation id="8571108619753148184">Server 4</translation> <translation id="8572832761467613633">Iba Flash</translation> <translation id="8572981282494768930">Nepovoliť webovým stránkam používať vašu kameru a mikrofón</translation> +<translation id="8574234089711453001">Povolí zobrazenie tlačidla Stiahnuť pri otváraní stránky s webovou adresou médií.</translation> <translation id="857779305329188634">Povolí podporu experimentálneho protokolu QUIC.</translation> <translation id="8579285237314169903">Synchronizujú sa položky (počet: <ph name="NUMBER_OF_FILES" />)...</translation> <translation id="8579549103199280730">Opýtať sa v predvolenom nastavení</translation> @@ -5184,6 +5220,7 @@ <translation id="8656768832129462377">Nekontrolovať</translation> <translation id="8656946437567854031">Kliknutím na položku Pokračovať vyjadrujete súhlas s dokumentmi <ph name="LEGAL_DOC_LINK_TEXT_1" />, <ph name="LEGAL_DOC_LINK_TEXT_2" />, <ph name="LEGAL_DOC_LINK_TEXT_3" />, <ph name="LEGAL_DOC_LINK_TEXT_4" />, <ph name="LEGAL_DOC_LINK_TEXT_5" /> a <ph name="LEGAL_DOC_LINK_TEXT_6" />.</translation> <translation id="8658595122208653918">Zmeniť možnosti tlačiarne...</translation> +<translation id="8658645149275195032"><ph name="APP_NAME" /> zdieľa vašu obrazovku a zvuk s kartou <ph name="TAB_NAME" />.</translation> <translation id="8659716501582523573">Adresa IP:</translation> <translation id="8661290697478713397">Otvoriť odkaz v okne inko&gnito</translation> <translation id="8662795692588422978">Osoby</translation> @@ -5389,6 +5426,7 @@ <translation id="8942416694471994740">Prístup k mikrofónu je ovládaný správcom.</translation> <translation id="894360074127026135">Netscape – medzinárodný prestup na vyššiu edíciu</translation> <translation id="8944779739948852228">Našla sa tlačiareň</translation> +<translation id="8944964446326379280"><ph name="APP_NAME" /> zdieľa okno s kartou <ph name="TAB_NAME" />.</translation> <translation id="8946359700442089734">Na tomto zariadení <ph name="IDS_SHORT_PRODUCT_NAME" /> neboli úplne povolené funkcie ladenia</translation> <translation id="8946784827990177241">Povoľte podporu protokolu WebUSB.</translation> <translation id="89515141420106838">Povolí aplikáciu Galéria Internetového obchodu Chrome pre ovládače tlačiarní. Aplikácia hľadá v Internetovom obchode Chrome rozšírenia, ktoré podporujú tlač do tlačiarní s rozhraním USB a konkrétnym identifikátorom USB.</translation> @@ -5407,6 +5445,7 @@ <translation id="8965037249707889821">Zadajte staré heslo</translation> <translation id="8965697826696209160">Nedostatok miesta</translation> <translation id="8968527460726243404">ChromeOS System Image Writer</translation> +<translation id="8970203673128054105">Zobraziť zoznam režimov prenosu</translation> <translation id="89720367119469899">Escape</translation> <translation id="8972513834460200407">Kontaktujte správcu siete a uistite sa, že brána firewall neblokuje sťahovanie súborov zo serverov Google.</translation> <translation id="8974161578568356045">Zistiť automaticky</translation> @@ -5434,6 +5473,7 @@ <translation id="9011178328451474963">Posledná karta</translation> <translation id="9013284500811652791"><ph name="UWS_NAME" />, <ph name="UWS_NAME" /> a ďalšie (počet: 1)</translation> <translation id="9013587737291179248">Ojoj! Kontrolovaný používateľ sa nedá importovať. Skontrolujte priestor na pevnom disku a povolenia a skúste to znova.</translation> +<translation id="901440679911238150">Podrobnosti o vašom účte sú zastarané. <ph name="BEGIN_LINK" />Znova sa prihlásiť<ph name="END_LINK" /></translation> <translation id="9014987600015527693">Zobraziť ďalší telefón</translation> <translation id="9015601075560428829">Hlasový vstup</translation> <translation id="9016164105820007189">Pripája sa k zariadeniu „<ph name="DEVICE_NAME" />“.</translation> @@ -5447,6 +5487,7 @@ <translation id="9025098623496448965">OK, prejsť späť na obrazovku prihlásenia</translation> <translation id="902638246363752736">Nastavenia klávesnice</translation> <translation id="9026731007018893674">stiahnuť</translation> +<translation id="9027146684281895941">Dozerajte na túto osobu a zo svojho účtu Google ovládajte a kontrolujte webové stránky, ktoré navštevuje.</translation> <translation id="9027459031423301635">Otvoriť odkaz na novej &karte</translation> <translation id="9027603907212475920">Nastaviť synchronizáciu...</translation> <translation id="9033453977881595182">ID tokenu</translation> @@ -5561,6 +5602,7 @@ <translation id="9203478404496196495">Obnoviť zvuk karty</translation> <translation id="9203962528777363226">Správca tohto zariadenia zakázal pridávanie nových používateľov</translation> <translation id="9205143043463108573">Umiestni nástroj Spúšťač aplikácií na šírku do stredu obrazovky.</translation> +<translation id="9205160891051296441">Podpora pravidla SystemTimezoneAutomaticDetection</translation> <translation id="9206487995878691001">Metóda vstupu Cangjie</translation> <translation id="9207194316435230304">ATOK</translation> <translation id="9208886416788010685">Program Adobe Reader je zastaraný</translation> @@ -5582,6 +5624,7 @@ <translation id="939736085109172342">Nový priečinok</translation> <translation id="940425055435005472">Veľkosť písma:</translation> <translation id="941543339607623937">Neplatný súkromný kľúč.</translation> +<translation id="942532530371314860"><ph name="APP_NAME" /> zdieľa kartu a zvuk Chromu.</translation> <translation id="942954117721265519">V tomto adresári nie sú žiadne obrázky.</translation> <translation id="945522503751344254">Poslať spätnú väzbu</translation> <translation id="946810925362320585">Dodržiavať odporúčanie</translation>
diff --git a/chrome/app/resources/generated_resources_sl.xtb b/chrome/app/resources/generated_resources_sl.xtb index cfc9dea..96f0c09 100644 --- a/chrome/app/resources/generated_resources_sl.xtb +++ b/chrome/app/resources/generated_resources_sl.xtb
@@ -662,7 +662,6 @@ <translation id="1962233722219655970">Ta stran uporablja aplikacijo s tehnologijo Native Client, ki ne deluje v vašem računalniku.</translation> <translation id="1965328510789761112">Zasebni pomnilnik</translation> <translation id="1965624977906726414">Nima posebnih dovoljenj.</translation> -<translation id="1968720524450620475">Omogoči ikone dejanj za spletna obvestila</translation> <translation id="1970746430676306437">Poglej informacije o &strani</translation> <translation id="197288927597451399">Obdrži</translation> <translation id="1973491249112991739">Prenos vtičnika <ph name="PLUGIN_NAME" /> ni uspel.</translation> @@ -1425,7 +1424,6 @@ <translation id="302014277942214887">Vnos ID-ja aplikacije ali URL-ja spletne trgovine.</translation> <translation id="3020616530769498629">Omogočanje vnovičnega nalaganja brez preverjanja pri osveževanju z vlečenjem</translation> <translation id="3020990233660977256">Serijska številka: <ph name="SERIAL_NUMBER" /></translation> -<translation id="3021245547458004908">Ko je to omogočeno, v napravah, v katerih je najmanjša vrednost »dp« za zaslon enaka 800 ali večja, orodna vrstica nikoli ne bo skrita zaradi drsenja. Še vedno bo skrita, če bo vsebina strani prikazana v celozaslonskem načinu.</translation> <translation id="3021678814754966447">&Prikaz izvorne kode okvirja</translation> <translation id="3024374909719388945">Uporabi 24-urno obliko ure</translation> <translation id="3025022340603654002">Prikaz predlogov za samodejni vnos pri prvem kliku elementa obrazca z miško.</translation> @@ -1496,7 +1494,6 @@ <translation id="3117812041123364382">Omogoči/onemogoči plavajočo navidezno tipkovnico</translation> <translation id="3118319026408854581">Pomoč za <ph name="PRODUCT_NAME" /> </translation> <translation id="3120430004221004537">Nezadostno šifriranje za dano dejanje v tej napravi: »<ph name="DEVICE_NAME" />«.</translation> -<translation id="3121260210578524273">Omogočanje ikon v gumbih dejanj za spletna obvestila.</translation> <translation id="3121793941267913344">Ponastavitev te naprave <ph name="IDS_SHORT_PRODUCT_NAME" /></translation> <translation id="3122162841865761901">Poskusi v orodjih za razvijalce</translation> <translation id="3122464029669770682">CPE</translation> @@ -2278,6 +2275,7 @@ <translation id="421017592316736757">Če želite dostopati do datoteke, mora biti vzpostavljena povezava z internetom.</translation> <translation id="421182450098841253">&Pokaži vrstico z zaznamki</translation> <translation id="4212108296677106246">Ali želite zaupati »<ph name="CERTIFICATE_NAME" />« kot overitelju potrdil?</translation> +<translation id="42126664696688958">Izvozi</translation> <translation id="42137655013211669">Strežnik je onemogočil dostop do tega vira.</translation> <translation id="4215350869199060536">Ojoj, neveljavni znaki v imenu.</translation> <translation id="4215898373199266584">Pst! Naslednjič vam lahko pride prav način brez beleženja zgodovine (<ph name="INCOGNITO_MODE_SHORTCUT" />).</translation> @@ -3311,7 +3309,6 @@ <translation id="577322787686508614">V tej napravi ni dovoljeno dejanje branja: »<ph name="DEVICE_NAME" />«.</translation> <translation id="5774295353725270860">Odpiranje aplikacije Datoteke</translation> <translation id="5774515636230743468">Manifest:</translation> -<translation id="5776006986202016118">Spletno mesto se želi povezati s tem:</translation> <translation id="577624874850706961">Preišči piškotke</translation> <translation id="5778550464785688721">Popolni nadzor naprav MIDI</translation> <translation id="5780066559993805332">(Najboljša)</translation> @@ -4201,7 +4198,6 @@ <translation id="7175353351958621980">Naloženo iz:</translation> <translation id="7180611975245234373">Osveži</translation> <translation id="7180865173735832675">Prilagodi</translation> -<translation id="7184428045150946911">Onemogoči samodejno skrivanje orodne vrstice v velikih tabličnih računalnikih</translation> <translation id="7185690883425432021">Skrije gumbe za zapiranje na nedejavnih zavihkih, ko je vrstica zavihkov v zloženem načinu.</translation> <translation id="7186088072322679094">Ohrani v orodni vrstici</translation> <translation id="719009910964971313">ameriška tpkovnica Dvorak za programerje</translation>
diff --git a/chrome/app/resources/generated_resources_sr.xtb b/chrome/app/resources/generated_resources_sr.xtb index c9ee82e0..e367e8a 100644 --- a/chrome/app/resources/generated_resources_sr.xtb +++ b/chrome/app/resources/generated_resources_sr.xtb
@@ -658,7 +658,6 @@ <translation id="1962233722219655970">Ова страница користи Native Client апликацију која не функционише на вашем рачунару.</translation> <translation id="1965328510789761112">Приватна меморија</translation> <translation id="1965624977906726414">Нема посебних дозвола.</translation> -<translation id="1968720524450620475">Омогући иконе за радњу за Веб-обавештења.</translation> <translation id="1970746430676306437">Прикажи &информације о страници</translation> <translation id="197288927597451399">Задржи</translation> <translation id="1973491249112991739">Преузимање додатне компоненте <ph name="PLUGIN_NAME" /> није успело.</translation> @@ -1420,7 +1419,6 @@ <translation id="302014277942214887">Унесите ИД апликације или URL веб-продавнице.</translation> <translation id="3020616530769498629">Омогући поновно учитавање без провере при превлачењу ради освежавања</translation> <translation id="3020990233660977256">Серијски број: <ph name="SERIAL_NUMBER" /></translation> -<translation id="3021245547458004908">Када се ова опција омогући, трака с алаткама се никад неће сакривати током померања када минимална густина екрана износи 800 dp или више. И даље ће се сакривати ако се садржај странице прикаже преко целог екрана.</translation> <translation id="3021678814754966447">&Прикажи извор оквира</translation> <translation id="3024374909719388945">Користи 24-часовни сат</translation> <translation id="3025022340603654002">Приказивање предлога за аутоматско попуњавање када први пут кликнете мишем на елемент обрасца.</translation> @@ -1491,7 +1489,6 @@ <translation id="3117812041123364382">Омогућава или онемогућава плутајућу виртуелну тастатуру.</translation> <translation id="3118319026408854581"><ph name="PRODUCT_NAME" /> – помоћ</translation> <translation id="3120430004221004537">Недовољно шифровање за дату операцију на: „<ph name="DEVICE_NAME" />“.</translation> -<translation id="3121260210578524273">Омогућава иконе у дугмади за радњу за Веб-обавештења.</translation> <translation id="3121793941267913344">Ресетовање овог <ph name="IDS_SHORT_PRODUCT_NAME" /> уређаја</translation> <translation id="3122162841865761901">Експерименти са Алаткама за програмере</translation> <translation id="3122464029669770682">CPU</translation> @@ -2273,6 +2270,7 @@ <translation id="421017592316736757">Морате да будете на мрежи да бисте приступили овој датотеци.</translation> <translation id="421182450098841253">&Прикажи траку са обележивачима</translation> <translation id="4212108296677106246">Желите да верујете ауторитету „<ph name="CERTIFICATE_NAME" />“ као ауторитету за издавање сертификата?</translation> +<translation id="42126664696688958">Извези</translation> <translation id="42137655013211669">Сервер је забранио приступ овом ресурсу.</translation> <translation id="4215350869199060536">Упс, имате недозвољене симболе у имену!</translation> <translation id="4215898373199266584">Псст! Следећи пут режим Без архивирања (<ph name="INCOGNITO_MODE_SHORTCUT" />) може да вам буде од користи.</translation> @@ -3307,7 +3305,6 @@ <translation id="577322787686508614">Операција читања није дозвољена на: „<ph name="DEVICE_NAME" />“.</translation> <translation id="5774295353725270860">Отварање апликације Датотеке</translation> <translation id="5774515636230743468">Манифест:</translation> -<translation id="5776006986202016118">Овај сајт жели да се повеже са:</translation> <translation id="577624874850706961">Претражите колачиће</translation> <translation id="5778550464785688721">Потпуна контрола над MIDI уређајима</translation> <translation id="5780066559993805332">(Најбоља)</translation> @@ -3623,7 +3620,7 @@ <translation id="6277105963844135994">Временско ограничење мреже</translation> <translation id="6277518330158259200">С&ними екран</translation> <translation id="6279183038361895380">Притисните |<ph name="ACCELERATOR" />| да бисте приказали показивач</translation> -<translation id="6280215091796946657">Пријави ме помоћу другог налога</translation> +<translation id="6280215091796946657">Пријави ме на други налог</translation> <translation id="6281743458679673853">Обавите експеримент у ком ће сви API-ји приказивати целокупну област приказа. На тај начин ће window.scroll својства бити повезана са целокупном облашћу приказа.</translation> <translation id="6285120908535925801">{NUM_PRINTER,plural, =1{Нов штампач на мрежи}one{Нови штампачи на мрежи}few{Нови штампачи на мрежи}other{Нови штампачи на мрежи}}</translation> <translation id="6285395082104474418">Палета статуса вам приказује актуелни статус мреже, батерије и других ствари.</translation> @@ -4130,7 +4127,7 @@ <translation id="7065223852455347715">Овај уређај је закључан и налази се у режиму који спречава регистрацију за предузећа. Ако желите да региструјете уређај, прво морате да обавите опоравак уређаја.</translation> <translation id="7065534935986314333">О систему</translation> <translation id="7066944511817949584">Повезивање са уређајем „<ph name="DEVICE_NAME" />“ није успело.</translation> -<translation id="7067725467529581407">Никада не приказуј ово поново.</translation> +<translation id="7067725467529581407">Никада више не приказуј ово.</translation> <translation id="7070804685954057874">Директни унос</translation> <translation id="7072010813301522126">Назив пречице</translation> <translation id="7072025625456903686">Омогући све или прилагоди</translation> @@ -4199,7 +4196,6 @@ <translation id="7175353351958621980">Учитава се са:</translation> <translation id="7180611975245234373">Освежи</translation> <translation id="7180865173735832675">Прилагоди</translation> -<translation id="7184428045150946911">Онемогући аутоматско сакривање траке с алаткама на великим таблетима</translation> <translation id="7185690883425432021">Крије дугмад за затварање на неактивним картицама када је трака са картицама у режиму групе.</translation> <translation id="7186088072322679094">Задржи на траци с алаткама</translation> <translation id="719009910964971313">Америчка Дворак тастатура за програмере</translation>
diff --git a/chrome/app/resources/generated_resources_sv.xtb b/chrome/app/resources/generated_resources_sv.xtb index 2263c28..31a335e 100644 --- a/chrome/app/resources/generated_resources_sv.xtb +++ b/chrome/app/resources/generated_resources_sv.xtb
@@ -660,7 +660,6 @@ <translation id="1962233722219655970">Denna sida använder en Native Client-app som inte fungerar på din dator.</translation> <translation id="1965328510789761112">Privat minne</translation> <translation id="1965624977906726414">Har inga speciella behörigheter.</translation> -<translation id="1968720524450620475">Aktivera åtgärdsikoner för webbaviseringar.</translation> <translation id="1970746430676306437">Visa sid&info</translation> <translation id="197288927597451399">Behåll</translation> <translation id="1973491249112991739">Det gick inte att ladda ned <ph name="PLUGIN_NAME" />.</translation> @@ -1425,7 +1424,6 @@ <translation id="302014277942214887">Ange program-ID eller adress till webbutik.</translation> <translation id="3020616530769498629">Aktivera återinläsning utan validering vid effekten dra för att uppdatera</translation> <translation id="3020990233660977256">Serienummer: <ph name="SERIAL_NUMBER" /></translation> -<translation id="3021245547458004908">När funktionen är aktiverad döljs aldrig verktygsfältet vid rullning på skärmar med en lägsta pixeltäthet på >= 800 dp. Däremot döljs det när sidan visas i helskärmsläge.</translation> <translation id="3021678814754966447">&Visa ramkälla</translation> <translation id="3024374909719388945">Använd 24-timmars klocka</translation> <translation id="3025022340603654002">Skapa förslag för Autofyll vid första musklicket på ett formulärelement.</translation> @@ -1496,7 +1494,6 @@ <translation id="3117812041123364382">Aktivera/inaktivera flytande virtuellt tangentbord</translation> <translation id="3118319026408854581">Hjälp för <ph name="PRODUCT_NAME" /></translation> <translation id="3120430004221004537">Otillräcklig kryptering för angiven åtgärd på: <ph name="DEVICE_NAME" />.</translation> -<translation id="3121260210578524273">Aktivera ikoner i åtgärdsknappar för webbaviseringar.</translation> <translation id="3121793941267913344">Återställ den här <ph name="IDS_SHORT_PRODUCT_NAME" />-enheten</translation> <translation id="3122162841865761901">Experiment i utvecklarverktygen</translation> <translation id="3122464029669770682">CPU</translation> @@ -2278,6 +2275,7 @@ <translation id="421017592316736757">Du måste vara online för att kunna öppna filen.</translation> <translation id="421182450098841253">&Visa bokmärkesfältet</translation> <translation id="4212108296677106246">Vill du ange <ph name="CERTIFICATE_NAME" /> som en betrodd certifikatutfärdare?</translation> +<translation id="42126664696688958">Exportera</translation> <translation id="42137655013211669">Åtkomsten till den här resursen blockerades av servern.</translation> <translation id="4215350869199060536">Det finns ogiltiga symboler i namnet!</translation> <translation id="4215898373199266584">Psst! Inkognitoläge (<ph name="INCOGNITO_MODE_SHORTCUT" />) kanske kan vara bra nästa gång.</translation> @@ -3310,7 +3308,6 @@ <translation id="577322787686508614">Läsbehörigheten för åtgärden saknas på: <ph name="DEVICE_NAME" />.</translation> <translation id="5774295353725270860">Appen Öppna filer</translation> <translation id="5774515636230743468">Manifest:</translation> -<translation id="5776006986202016118">Webbplatsen vill ansluta till:</translation> <translation id="577624874850706961">Sök efter cookies</translation> <translation id="5778550464785688721">MIDI-enheter – fullständig kontroll</translation> <translation id="5780066559993805332">(Bästa)</translation> @@ -4201,7 +4198,6 @@ <translation id="7175353351958621980">Överförd från:</translation> <translation id="7180611975245234373">Uppdatera</translation> <translation id="7180865173735832675">Anpassa</translation> -<translation id="7184428045150946911">Inaktivera att verktygsfältet döljs automatiskt på större surfplattor</translation> <translation id="7185690883425432021">Döljer stängningsknappen på inaktiva flikar när de är staplade.</translation> <translation id="7186088072322679094">Spara i verktygsfältet</translation> <translation id="719009910964971313">Dvorak-tangentbord för programmerare i USA</translation>
diff --git a/chrome/app/resources/generated_resources_sw.xtb b/chrome/app/resources/generated_resources_sw.xtb index 0d0355b..7df7015a 100644 --- a/chrome/app/resources/generated_resources_sw.xtb +++ b/chrome/app/resources/generated_resources_sw.xtb
@@ -183,16 +183,19 @@ <translation id="1259724620062607540">Kipengee cha kabati cha 7</translation> <translation id="1260240842868558614">Onyesha:</translation> <translation id="126710816202626562">Lugha ya kutafsiri:</translation> +<translation id="1269690813141254680">Tembelea <ph name="BEGIN_LINK" />Vidhibiti vya Shughuli za Google<ph name="END_LINK" /> udhibiti namna Google inavyotumia historia yako ya mambo uliyovinjari kuweka mapendeleo ya huduma za Tafuta na Google na huduma nyingine za Google.</translation> <translation id="1272079795634619415">Simamisha</translation> <translation id="1272978324304772054">Akaunti hii ya mtumiaji siyo ya kikoa ambacho kifaa kimesajiliwa. Ikiwa unataka kujisajili kwenye kikoa tofauti unahitaji kuenda katika ufufuaji wa kifaa kwanza.</translation> <translation id="127353061808977798">Fonti na usimbaji</translation> <translation id="1274997165432133392">Vidakuzi na data ya tovuti nyingine</translation> <translation id="1275718070701477396">Imechaguliwa</translation> +<translation id="1277908057200820621">Angalia orodha ya vifaa</translation> <translation id="1278049586634282054">Kagua maoni:</translation> <translation id="1278813325885878377">Kibodi ya QWERTY ya Kihungaria</translation> <translation id="1285320974508926690">Kamwe usitafsiri tovuti hii</translation> <translation id="1285484354230578868">Hifadhi data katika akaunti yako ya Hifadhi ya Google</translation> <translation id="1290223615328246825">Imeshindwa kuingia katika akaunti kiotomatiki</translation> +<translation id="1293509594570842875">Mtumiaji mpya anayesimamiwa hakuweza kuundwa. Tafadhali angalia muunganisho wa mtandao wako na ujaribu tena baadaye.</translation> <translation id="1293556467332435079">Faili</translation> <translation id="1294298200424241932">Hariri mipangilio ya kuamini:</translation> <translation id="1295794900245526845">Chagua akaunti yako iliyohifadhiwa kwa kutumia <ph name="PASSWORD_MANAGER_BRAND" /> kuingia katika akaunti</translation> @@ -291,6 +294,7 @@ <translation id="1429740407920618615">Nguvu za Ishara:</translation> <translation id="143027896309062157">Kusoma na kubadilisha data yako yote kwenye kompyuta yako na tovuti unazozitembelea</translation> <translation id="1430915738399379752">Chapisha</translation> +<translation id="1433423644370450034">Arifa za mtindo wa maudhui</translation> <translation id="1434696352799406980">Hatua hii itaweka upya ukurasa wako unaoanza, ukurasa wa kichupo kipya, mtambo wa kutafuta na vichupo vilivyobandikwa. Pia itazima viendelezi na kufuta data ya muda kama vile vidakuzi. Alamisho, historia na manenosiri yako yaliyohifadhiwa hayatafutwa.</translation> <translation id="1434886155212424586">Ukurasa wa Mwanzo ndio ukurasa wa kichupo kipya</translation> <translation id="1435550882135542937">Uundaji upya wa upau wa vidhibiti wa viendelezi</translation> @@ -376,6 +380,7 @@ <translation id="1526925867532626635">Thibitisha mipangilio ya usawazishaji</translation> <translation id="1528372117901087631">Muunganisho wa mtandao</translation> <translation id="1529968269513889022">wiki iliyopita</translation> +<translation id="1531865825384516080">Kuripoti URL kwenye SafeSearch.</translation> <translation id="1532697124104874386">Washa/Zima utumiaji mahiri wa kibodi pepe.</translation> <translation id="1533897085022183721">Chini ya <ph name="MINUTES" />.</translation> <translation id="1533920822694388968">Mpangilio wa Runinga</translation> @@ -659,7 +664,6 @@ <translation id="1962233722219655970">Ukurasa huu unatumia programu ya Mteja Halisi isiyofanya kazi kwenye kompyuta yako.</translation> <translation id="1965328510789761112">Kumbukukumbu ya faragha</translation> <translation id="1965624977906726414">Haina ruhusa maalum.</translation> -<translation id="1968720524450620475">Washa aikoni za vitendo kwa ajili ya Arifa za Wavuti</translation> <translation id="1970746430676306437">Tazama &maelezo ya ukurasa</translation> <translation id="197288927597451399">Weka</translation> <translation id="1973491249112991739">Upakuaji wa <ph name="PLUGIN_NAME" /> umeshindikana.</translation> @@ -757,6 +761,7 @@ <translation id="212862741129535676">Asilimia ya Ukaaji wa Hali ya Masafa</translation> <translation id="2128691215891724419">Hitilafu ya Kulinganisha: Sasisha kaulisiri ya Kulinganisha...</translation> <translation id="2129904043921227933">Hitilafu ya Kulinganisha: Sasisha kaulisiri ya Kulinganisha...</translation> +<translation id="2130053362119884302">Ruhusu kuondoa kichupo kwenye skrini nzima</translation> <translation id="2131077480075264">Imeshindwa kusakinisha "<ph name="APP_NAME" />" kwa sababu hairuhusiwa na "<ph name="IMPORT_NAME" />"</translation> <translation id="2134149231879627725">Iwezeshe Google ikusaidie kufunga, kufuta, na kupata kifaa chako kwa mbali.</translation> <translation id="2134986351331412790">Tovuti hii haikubali kadi ya malipo ya aina hii.</translation> @@ -769,6 +774,7 @@ <translation id="2143778271340628265">Usanidi wa proksi na mtumiaji</translation> <translation id="2143915448548023856">Onyesha mipangilio</translation> <translation id="2144536955299248197">Kitazama Cheti: <ph name="CERTIFICATE_NAME" /></translation> +<translation id="2147827593068025794">Usawazishaji wa Chini Chini</translation> <translation id="2148756636027685713">Uumbizaji umekamilika</translation> <translation id="2148892889047469596">Tuma kichupo</translation> <translation id="2148999191776934271">Inachaji @@ -1146,6 +1152,7 @@ <translation id="2665717534925640469">Ukurasa huu sasa uko kwenye skrini nzima na umelemaza kishale cha kipanya chako.</translation> <translation id="2665919335226618153">Lo! Kulikuwa na hitilafu wakati wa uumbizaji.</translation> <translation id="2668079306436607263">Tembeza zaidi uendeshaji wa historia</translation> +<translation id="2670102641511624474"><ph name="APP_NAME" /> inashiriki kichupo cha Chrome.</translation> <translation id="2670965183549957348">Mbinu ya uingizaji wa Kichewi</translation> <translation id="2672142220933875349">Faili mbaya ya CRX, imeshindwa kutenganishwa.</translation> <translation id="2672394958563893062">Hitilafu imetokea. Bofya ili kuanzisha tena kutoka mwanzoni.</translation> @@ -1192,6 +1199,7 @@ <translation id="2733364097704495499">Je, ungependa kusajili printa <ph name="PRINTER_NAME" /> kwenye Google Cloud Print?</translation> <translation id="2735698359135166290">Kibodi wastani ya Kiromania</translation> <translation id="2737363922397526254">Kunja...</translation> +<translation id="2737755522130570180">Zuia hati zilizopakiwa kupitia document.write</translation> <translation id="2738771556149464852">Sio Baadaye</translation> <translation id="2739191690716947896">Tatua</translation> <translation id="2739240477418971307">Badilisha mipangilio yako ya ufikiaji</translation> @@ -1261,6 +1269,7 @@ <translation id="2805646850212350655">Mfumo wa Microsoft wa Usimbaji wa Faili</translation> <translation id="2805707493867224476">Ruhusu tovuti zote zionyeshe madirisha ibukizi</translation> <translation id="2805756323405976993">Programu</translation> +<translation id="2808243220963392165">Ruhusu kuondoa vichupo kwenye ukanda wa vichupo unapokuwa kwenye hali ya skrini nzima kwenye Mac.</translation> <translation id="2809142985846095314">Washa kipengele cha kutoa upakiaji wa kadi za mikopo Zilizojazwa Kiotomatiki</translation> <translation id="2809346626032021864">Kusoma</translation> <translation id="2809586584051668049">na <ph name="NUMBER_ADDITIONAL_DISABLED" /> zaidi</translation> @@ -1389,6 +1398,7 @@ <translation id="2968792643335932010">Nakala chache</translation> <translation id="2971033837577180453"><span>Kitambulisho:</span><ph name="EXTENSION_ID" /></translation> <translation id="2971213274238188218">elekeza mwangaza chini</translation> +<translation id="2971422413423640756">Kitufe cha kupakua unapofungua ukurasa wenye url ya maudhui.</translation> <translation id="2972557485845626008">Programu dhibiti</translation> <translation id="2972581237482394796">&Rudia</translation> <translation id="297870353673992530">Seva ya DNS:</translation> @@ -1421,7 +1431,6 @@ <translation id="302014277942214887">Ingiza kitambulisho cha programu au URL ya duka la wavuti.</translation> <translation id="3020616530769498629">Washa upakiaji upya usio wa kuthibitisha kwa kuvuta ili kuonyesha upya</translation> <translation id="3020990233660977256">Nambari ya Kufuatilia: <ph name="SERIAL_NUMBER" /></translation> -<translation id="3021245547458004908">Ukiwashwa, upau wa vidhibiti hautawahi kufichwa kwa sababu ya kusogeza kwenye vifaa vyenye skrini ya chini ya dp >= 800. Bado utafichwa ikiwa maudhui ya ukurasa yataonyeshwa kwenye skrini nzima.</translation> <translation id="3021678814754966447">&Ona Asili ya Fremu</translation> <translation id="3024374909719388945">Tumia mfumo wa saa 24</translation> <translation id="3025022340603654002">Toa mapendekezo ya kujaza otomatiki kwa mbofyo wa kwanza wa kipanya kwenye muundo wa kipengee.</translation> @@ -1454,6 +1463,7 @@ <translation id="3057861065630527966">Weka hifadhi rudufu ya picha na video zako</translation> <translation id="3058212636943679650">Ikiwa unahitaji kabisa kurejesha upya mfumo wako wa uendeshaji kompyuta utahitaji kadi ya ufufuaji ya SD au kijiti kumbukumbu cha USB.</translation> <translation id="305932878998873762">Akiba Rahisi ya HTTP ni akiba mpya. Inategemea mfumo wa faili kwa ugawaji wa nafasi ya diski.</translation> +<translation id="3062606427884046423">Tumia arifa za Android MediaStyle kwa arifa za maudhui ya Chrome.</translation> <translation id="3064388234319122767">Unukuzi wa mfumo wa kuandika (zdravo → здраво)</translation> <translation id="3065041951436100775">Majibu ya kichupo kilichoangamizwa.</translation> <translation id="3065140616557457172">Chapa ili kutafuta au uweke URL ili upitie - yote yanafanya kazi.</translation> @@ -1492,7 +1502,6 @@ <translation id="3117812041123364382">Washa/Zima kibodi pepe inayoelea.</translation> <translation id="3118319026408854581">Usaidizi wa <ph name="PRODUCT_NAME" /></translation> <translation id="3120430004221004537">Usimbaji fiche usiotosha kwa shughuli maalum kwenye: "<ph name="DEVICE_NAME" />".</translation> -<translation id="3121260210578524273">Washa aikoni katika vitufe vya vitendo kwa ajili ya Arifa za Wavuti.</translation> <translation id="3121793941267913344">Weka kifaa hiki cha <ph name="IDS_SHORT_PRODUCT_NAME" /> upya</translation> <translation id="3122162841865761901">Majaribio ya Zana za Wasanidi Programu</translation> <translation id="3122464029669770682">CPU</translation> @@ -1537,6 +1546,7 @@ <translation id="3170072451822350649">Pia unaweza kuruka kuingia na <ph name="LINK_START" />uvinjari kama Mgeni<ph name="LINK_END" />.</translation> <translation id="3170544058711792988">Weka kikuza skrini katikati ya skrini</translation> <translation id="3172213052701798825">Google Smart Lock ya Manenosiri</translation> +<translation id="3175469972022788345">Ikiwashwa, WebRTC itatumia vyeti vya ECDSA.</translation> <translation id="317583078218509884">Mipangilio mipya ya vibali vya tovuti itaanza kufanya kazi baada ya kupakia upya ukurasa huu.</translation> <translation id="3177048931975664371">Bofya ili kuficha nenosiri</translation> <translation id="3180365125572747493">Tafadhali ongeza nenosiri ili kusimbua faili hii ya cheti kwa njia fiche.</translation> @@ -1987,6 +1997,7 @@ <translation id="3776796446459804932">Kiendelezi hiki kinakiuka sera ya Duka la Wavuti ya Chrome.</translation> <translation id="3778152852029592020">Upakuaji ulighairiwa.</translation> <translation id="3778740492972734840">Zana za &Wasanidi Programu</translation> +<translation id="3780663724044634171">Chagua akaunti ya kudhibiti mtumiaji anayesimamiwa.</translation> <translation id="378312418865624974">Soma kitambulisho cha kipekee cha kompyuta hii</translation> <translation id="3783640748446814672">alt</translation> <translation id="3785308913036335955">Onyesha Mkato wa Programu</translation> @@ -2010,6 +2021,7 @@ <translation id="3807747707162121253">&Ghairi</translation> <translation id="3809280248639369696">Moonbeam</translation> <translation id="3810973564298564668">Dhibiti</translation> +<translation id="3811494700605067549">Faili 1 imechaguliwa</translation> <translation id="3812034401428455285"><ph name="UWS_NAME" /> na <ph name="UWS_NAME" /></translation> <translation id="3812525830114410218">Cheti kina tatizo</translation> <translation id="3813984289128269159">Ok Google</translation> @@ -2039,6 +2051,7 @@ <translation id="3838543471119263078">Vidakuzi na data nyingine ya tovuti na programu-jalizi</translation> <translation id="3839497635014791588">Maoni ya ziada ya kugusa kuhusu vipengele vya Kiolesura</translation> <translation id="3840053866656739575">Imepoteza muunganisho wa Chromebox yako. Tafadhali songa karibu, au angalia kifaa chako huku tukijaribu kuunganisha tena.</translation> +<translation id="3840055807562919428">Hairuhusu kuleta hati za kuzuia kichanganuzi cha mtu mwingine kuwekwa katika fremu kuu kupitia document.write.</translation> <translation id="3842552989725514455">Fonti ya Serif</translation> <translation id="3846593650622216128">Mipangilio hii inatekelezwa kwa kiendelezi.</translation> <translation id="3846833722648675493">Onyesha madirisha ya programu baada ya mchoro wa kwanza. Madirisha yataonyeshwa kwa kiasi kikubwa baadaye kwa ajili ya programu zinazopakia rasilimali ambazo zinasawazisha lakini haitakuwa na umuhimu kwa programu ambazo hupakia rasilimali bila kusawazisha.</translation> @@ -2267,6 +2280,7 @@ <translation id="421017592316736757">Sharti uwe mtandaoni ili kufikia faili hii.</translation> <translation id="421182450098841253">&Onyesha Upau wa Alamisho</translation> <translation id="4212108296677106246">Je, unataka kuamini "<ph name="CERTIFICATE_NAME" />" kama Mamlaka ya Uthibitishaji?</translation> +<translation id="42126664696688958">Hamisha</translation> <translation id="42137655013211669">Idhini ya kufikia rasilimali hii ilizuiwa na seva.</translation> <translation id="4215350869199060536">Lo!, alama batili katika jina!</translation> <translation id="4215898373199266584">Hebu! Huenda hali fiche (<ph name="INCOGNITO_MODE_SHORTCUT" />) ikakufaa wakati ujao.</translation> @@ -2353,6 +2367,7 @@ <translation id="4359408040881008151">Kilisakinishwa kwa sababu ya kiendelezi au viendelezi vinavyotegemea.</translation> <translation id="4361190688154226069">Kulenga katika mionekano kulingana na rect</translation> <translation id="4364444725319685468"><ph name="FILE_NAME" /> imepakuliwa</translation> +<translation id="4364567974334641491"><ph name="APP_NAME" /> inashiriki dirisha.</translation> <translation id="4364830672918311045">Onyesha arifa</translation> <translation id="4365673000813822030">Lo, Usawazishaji umekatizwa.</translation> <translation id="4366509400410520531">Kimeruhusiwa na wewe</translation> @@ -2422,6 +2437,7 @@ <translation id="4479639480957787382">Ethernet</translation> <translation id="4479812471636796472">Kibodi ya Dvorak ya Marekani</translation> <translation id="4481249487722541506">Pakia kiendelezi kilichofunguliwa...</translation> +<translation id="4482194545587547824">Google inaweza kutumia historia yako ya mambo uliyovinjari kuweka mapendeleo ya huduma za Tafuta na huduma nyingine za Google.</translation> <translation id="4487088045714738411">Kibodi ya Kibelgiji</translation> <translation id="4492190037599258964">Matokeo ya utafutaji wa '<ph name="SEARCH_STRING" />'</translation> <translation id="4495021739234344583">Ondoa usajili kisha uzime halafu uwashe</translation> @@ -2465,6 +2481,7 @@ <translation id="4554591392113183336">Kiendelezi cha nje ni sawa na au toleo la chini likilinganishwa na toleo lililopo.</translation> <translation id="4554796861933393312">Kasi ya Uhuishaji wa Kuweka Wino wa Usanifu Bora</translation> <translation id="4555769855065597957">Kivuli</translation> +<translation id="4556110439722119938">Alamisho, historia, manenosiri na mipangilio yako mingine itasawazishwa kwenye Akaunti yako ya Google ili uitumie katika vifaa vyako vyote</translation> <translation id="4557136421275541763">Ilani</translation> <translation id="4558426062282641716">Ombi la ruhusa ya kuzindua kiotomatiki</translation> <translation id="4563210852471260509">Lugha ingizo ya kwanza ni Kichina</translation> @@ -2585,6 +2602,7 @@ <translation id="4742746985488890273">Bandika kwenye Rafu</translation> <translation id="474421578985060416">Imefungwa na wewe</translation> <translation id="4744574733485822359">Upakuaji wako umekamilika</translation> +<translation id="4746330764136728131">Tumia vyeti vya ECDSA kwa WebRTC</translation> <translation id="4746971725921104503">Inaonekana tayari unasimamia mtumiaji mwenye jina hilo. Je, ulitaka <ph name="LINK_START" /> kuingiza kwa kifaa hiki<ph name="USER_DISPLAY_NAME" /> <ph name="LINK_END" />?</translation> <translation id="4747271164117300400">Kimasedonia</translation> <translation id="4749157430980974800">Kibodi ya Kijojia</translation> @@ -2733,6 +2751,7 @@ <translation id="496226124210045887">Folda uliyochagua ina faili nyeti. Je, una uhakika unataka kutoa uwezo wa kudumu wa kufikia kuandika folda hii kwa "$1"?</translation> <translation id="4964673849688379040">Inakagua...</translation> <translation id="4966802378343010715">Weka mtumiaji mpya</translation> +<translation id="4967749818080339523">Chagua akaunti</translation> <translation id="496888482094675990">Programu ya Faili inatoa ufikiaji wa haraka kwenye faili ambazo umeweka kwenye Hifadhi ya Google, nafasi ya nje, au kifaa chako cha Chrome OS.</translation> <translation id="4971412780836297815">Fungua baada ya kukamilisha</translation> <translation id="497244430928947428">Kibodi ya Malayalam (Fonetiki)</translation> @@ -2779,6 +2798,7 @@ <translation id="5038863510258510803">Inawezesha...</translation> <translation id="5039512255859636053">$1 TB</translation> <translation id="5039804452771397117">Ruhusu</translation> +<translation id="5043851552150732346">Saraka 1 imechaguliwa</translation> <translation id="5045550434625856497">Nenosiri lisilo sahihi</translation> <translation id="5048179823246820836">Kinodiki</translation> <translation id="5048294425697652159">Washa kipengele cha Quirks Client kwa upimaji wa mwonekano.</translation> @@ -2866,6 +2886,7 @@ <translation id="5170477580121653719">Nafasi iliyosalia ya Hifadhi ya Google: <ph name="SPACE_AVAILABLE" />.</translation> <translation id="5170568018924773124">Onyesha katika folda</translation> <translation id="5171045022955879922">Tafuta au charaza URL</translation> +<translation id="5171343362375269016">Hifadhi Iliyobadilishwa</translation> <translation id="5175870427301879686"><ph name="URL" /> inataka kuhifadhi kabisa data kwenye kompyuta yako ya karibu.</translation> <translation id="5177479852722101802">Endelea kuzuia ufikiaji wa kamera na maikrofoni</translation> <translation id="5177526793333269655">Mwonekano wa vijipicha</translation> @@ -3023,6 +3044,7 @@ <translation id="5380103295189760361">Shikilia "Control", "Alt", "Shift", au "Search" ili kuona mikato ya kibodi ya virekebishi hivyo.</translation> <translation id="5382392428640372740">Washa kipengee cha kufuatilia mawasiliano</translation> <translation id="5388588172257446328">Jina la mtumiaji:</translation> +<translation id="5389237414310520250">Mtumiaji mpya hakuweza kuundwa. Tafadhali angalia ruhusa na nafasi ya hifadhi ya diski kuu kisha ujaribu tena.</translation> <translation id="5390284375844109566">Hifadhidata iliyoorodheshwa</translation> <translation id="5392544185395226057">Wezesha uhimili wa Mteja Halisi.</translation> <translation id="5396126354477659676"><ph name="PEPPER_PLUGIN_NAME" /> kwenye <ph name="PEPPER_PLUGIN_DOMAIN" /> inataka kufikia kompyuta yako.</translation> @@ -3090,6 +3112,7 @@ <translation id="5469954281417596308">Meneja alamisho</translation> <translation id="5470838072096800024">Wakati wa Mwisho Tokeni Kupokelewa</translation> <translation id="5473075389972733037">IBM</translation> +<translation id="5473279832922912143">Washa V8 ili utumie jaribio la Kuwasha Kitafsiri cha utekelezaji wa JavaScript.</translation> <translation id="5474139872592516422">Wakati <ph name="PLUGIN_NAME" /> imekamilisha kusasisha, pakia upya ukurasa ili kuiamilisha.</translation> <translation id="5480254151128201294">Mmiliki alifunga kifaa hiki.</translation> <translation id="5483785310822538350">Batilisha idhini ya kufikia faili na kifaa</translation> @@ -3117,6 +3140,7 @@ <translation id="5509914365760201064">Mtoaji: <ph name="CERTIFICATE_AUTHORITY" /></translation> <translation id="5511823366942919280">Je, una uhakika unataka kusanidi kifaa hiki kama "Shark"?</translation> <translation id="5512653252560939721">Lazima cheti cha mtumiaji kiwe cha maunzi yaliyochelezwa.</translation> +<translation id="5513242761114685513">Menyu</translation> <translation id="5515008897660088170">Toolkit-Views App Windows.</translation> <translation id="551752069230578406">Inaongeza printa kwenye akaunti yako - hii inaweza kuchukua muda...</translation> <translation id="5518584115117143805">Cheti cha Usimbaji wa Barua Pepe</translation> @@ -3297,7 +3321,6 @@ <translation id="577322787686508614">Shughuli za kusoma haziruhusiwi kwenye: " <ph name="DEVICE_NAME" /> ".</translation> <translation id="5774295353725270860">Fungua programu ya Faili</translation> <translation id="5774515636230743468">Dhihirisha</translation> -<translation id="5776006986202016118">Tovuti hii inataka kuunganisha kwenye:</translation> <translation id="577624874850706961">Tafuta vidakuzi</translation> <translation id="5778550464785688721">Udhibiti kamili wa vifaa vya MIDI</translation> <translation id="5780066559993805332">(Bora)</translation> @@ -3375,6 +3398,7 @@ <translation id="5874045675243596003">Tekeleza kikwazo (hitilafu ya programu ikiwa hatuwezi kupata alama za reli)</translation> <translation id="5875858680971105888">Lo! Mtumiaji anayesimamiwa hakuweza kuundwa. Tafadhali angalia muunganisho wa mtandao wako na ujaribu tena baadaye.</translation> <translation id="5880247576487732437">Tokeni Ipo</translation> +<translation id="5884474295213649357">Kompyuta kibao hii imeunganishwa kwenye kifaa cha USB.</translation> <translation id="5885324376209859881">Dhibiti mipangilio ya mawasiliano...</translation> <translation id="5889282057229379085">Upeo wa idadi ya mamlaka ya kati ya cheti: <ph name="NUM_INTERMEDIATE_CA" /></translation> <translation id="5892290200158927959">Kibodi ya BEPO ya Kifaransa</translation> @@ -3466,6 +3490,8 @@ <translation id="604124094241169006">Otomatiki</translation> <translation id="6042308850641462728">Zaidi</translation> <translation id="604257181445267932">Smart Lock hukusaidia kuingia katika programu na tovuti kwa haraka kwa kutumia manenosiri ambayo umehifadhi kwenye Google.</translation> +<translation id="6043317578411397101"><ph name="APP_NAME" /> inashiriki kichupo cha Chrome na <ph name="TAB_NAME" />.</translation> +<translation id="6044805581023976844"><ph name="APP_NAME" /> inashiriki kichupo cha Chrome na sauti pamoja na <ph name="TAB_NAME" />.</translation> <translation id="6049065490165456785">Picha kutoka kamera ya ndani</translation> <translation id="6051028581720248124">Kwa kuchapisha katika FedEx Office, unakubali sheria na masharti <ph name="START_LINK" />ya<ph name="END_LINK" />.</translation> <translation id="6051086608691487286">Wekelea Pau za kusogeza</translation> @@ -3594,6 +3620,7 @@ <translation id="6251889282623539337"><ph name="DOMAIN" /> Sheria na Masharti</translation> <translation id="6251924700383757765">Sera ya faragha</translation> <translation id="6253586523465486793">Hulazimisha kianzishi cha kuvuta ili kuonyesha upya cha upakiaji upya usio wa kuthibitisha (ingawa humaanisha ya kawaida, upakiaji upya wa kuthibitisha kuwa sahihi wakati alama imezimwa).</translation> +<translation id="6254182355913122230">Hifadhi iliyobadilishwa</translation> <translation id="6254503684448816922">Kuvurugika kwa Ufunguo</translation> <translation id="6259104249628300056">Gundua vifaa kwenye mtandao wako wa karibu</translation> <translation id="6263082573641595914">Toleo la Mamlaka ya Cheti la Microsoft</translation> @@ -3864,6 +3891,7 @@ <translation id="6680028776254050810">Badili Watumiaji</translation> <translation id="6681668084120808868">Piga picha</translation> <translation id="668171684555832681">Mengine...</translation> +<translation id="6682083956260248340">Dhibiti namna kiungo hiki kinavyotumika katika <ph name="BEGIN_LINK" /></translation> <translation id="6686490380836145850">Funga vichupo vilivyo upande wa kulia</translation> <translation id="6686817083349815241">Hifadhi nenosiri lako</translation> <translation id="6689514201497896398">Kwepa ukaguzi wa ushirikishaji wa watumiaji</translation> @@ -3931,10 +3959,12 @@ <translation id="6798954102094737107">Progoramu-jalizi: <ph name="PLUGIN_NAME" /></translation> <translation id="6802031077390104172"><ph name="USAGE" /> (<ph name="OID" />)</translation> <translation id="6804671422566312077">Fungua Alamisho Zote katika &Dirisha Jipya</translation> +<translation id="6805542829187142700">Washa sera ya kifaa cha ugunduzi kiotomatiki wa mfumo wa saa za eneo.</translation> <translation id="6805647936811177813">Tafadhali ingia kwenye <ph name="TOKEN_NAME" /> ili kuleta cheti cha mteja kutoka kwenye <ph name="HOST_NAME" />.</translation> <translation id="680572642341004180">Washa ufuatiliaji wa RLZ kwenye <ph name="SHORT_PRODUCT_OS_NAME" />.</translation> <translation id="6807889908376551050">Onyesha Zote...</translation> <translation id="6809448577646370871">Uzungushaji Maalum wa Dirisha kwa Programu za Chrome.</translation> +<translation id="6810613314571580006">Ingia katika tovuti kiotomatiki ukitumia kitambulisho kilichohifadhiwa. Kipengele kikizimwa, utaombwa kuthibitisha kila wakati kabla ya kuingia katika tovuti.</translation> <translation id="6812349420832218321"><ph name="PRODUCT_NAME" /> haiwezi kuendeshwa kama kina.</translation> <translation id="6812841287760418429">Weka mabadiliko</translation> <translation id="6814124696888326520">Kwa urahisi wa kubadilisha mbinu za kuingiza data na ufikiaji wa vipengele zaidi vya kuingiza data: kuweka data kwa kutamka, mwandiko na emoji.</translation> @@ -4023,7 +4053,7 @@ <translation id="6949306908218145636">Alamisha Kurasa Zilizowazi...</translation> <translation id="695164542422037736">Chaguo hili likiwashwa, na ikiwa kina kinatumia mtindo wa kiambatisho cha mandhari:hakibadiliki, mandhari itakuwa na safu mchanganyiko.</translation> <translation id="6955446738988643816">Kagua Dirisha Ibukizi</translation> -<translation id="695755122858488207">Kitufe cha redio kilichoondolewa tiki</translation> +<translation id="695755122858488207">Kitufe cha mviringo ambacho hakijachaguliwa</translation> <translation id="6960277925159781810">Ingia katika akaunti kiotomatiki kwenye kifaa hiki</translation> <translation id="696036063053180184">Seti 3 (Hakuna kuhamisha)</translation> <translation id="696203921837389374">Washa inasawazisha kwenye data ya kifaa cha mkononi</translation> @@ -4122,6 +4152,7 @@ <translation id="7065534935986314333">Kuhusu Mfumo</translation> <translation id="7066944511817949584">Imeshindwa kuunganisha kwenye "<ph name="DEVICE_NAME" />".</translation> <translation id="7067725467529581407">Usiwahi kuonyesha kiputo hiki tena.</translation> +<translation id="7068609958927777019">Ikiwashwa, URL ambazo hazifai zinaweza kuripotiwa kwenye SafeSearch.</translation> <translation id="7070804685954057874">Ingizo la moja kwa moja</translation> <translation id="7072010813301522126">Jina la njia ya mkato</translation> <translation id="7072025625456903686">Ruhusu zote au badilisha kukufaa</translation> @@ -4187,10 +4218,10 @@ <translation id="7170467426996704624">Unukuzi wa mfumo wa kuandika (salam → ሰላም)</translation> <translation id="7172053773111046550">Kibodi ya Kiestoni</translation> <translation id="7173828187784915717">Inatekeleza mipangilio ingizo</translation> +<translation id="7173917244679555">Inaonekana tayari unasimamia mtumiaji aliye na jina hilo. Je, ulitaka <ph name="BEGIN_LINK" />kuleta <ph name="PROFILE_NAME" /><ph name="END_LINK" /> kwenye kifaa hiki?</translation> <translation id="7175353351958621980">Imepakiwa kutoka:</translation> <translation id="7180611975245234373">Onyesha upya</translation> <translation id="7180865173735832675">Binafsisha</translation> -<translation id="7184428045150946911">Zima kuficha kiotomatiki upau wa vidhibiti kwenye kompyuta kibao kubwa</translation> <translation id="7185690883425432021">Huficha vitufe vya kufunga vya vichupo visivyotumika kidhibiti kikiwa katika hali ya kupangwa kwa rafu.</translation> <translation id="7186088072322679094">Weka katika Upau wa Vidhibiti</translation> <translation id="719009910964971313">Kibodi ya Programmer Dvorak, Marekani</translation> @@ -4255,6 +4286,7 @@ <translation id="7280825545668757494">Usawazishaji wa kitambulisho cha WiFi</translation> <translation id="7280877790564589615">Ruhusa imeombwa</translation> <translation id="7282547042039404307">Laini</translation> +<translation id="7284549674086796566">Jaribio la Kitafsiri JavaScript</translation> <translation id="7287143125007575591">Umenyimwa idhini ya kufikia.</translation> <translation id="7288592446024861651">Alamisho, historia, manenosiri na mipangilio yako mingine itasawazishwa kwenye Akaunti yako ya Google ili uweze kuitumia kwenye vifaa vyako vyote. Dhibiti kipengee cha kusawazisha katika <ph name="BEGIN_LINK" />.</translation> <translation id="7288676996127329262">Dpi <ph name="HORIZONTAL_DPI" /> x <ph name="VERTICAL_DPI" /></translation> @@ -4277,6 +4309,7 @@ <translation id="7321545336522791733">Seva haifikiki</translation> <translation id="7325437708553334317">Kiendelezi Kilinganushi Kikuu</translation> <translation id="7326565110843845436">Mbofyo wa vidole vitatu kwenye padi ya kugusa</translation> +<translation id="7327088014939803293">Mtumiaji mpya anayesimamiwa hakuweza kuundwa. Tafadhali hakikisha kuwa umeingia katika akaunti kwa njia sahihi kisha ujaribu tena.</translation> <translation id="73289266812733869">Imeondolewa tiki</translation> <translation id="7329154610228416156">Haikufaulu kuingia katika akaunti kwa sababu ilisanidiwa ili itumie URL isiyo salama (<ph name="BLOCKED_URL" />). Tafadhali wasiliana na msimamizi wako.</translation> <translation id="7331786426925973633">Kivinjari kilichojengwa kufanya kazi kwa kasi, wepesi, na usalama</translation> @@ -4451,6 +4484,7 @@ <translation id="7573172247376861652">Chaji ya Betri</translation> <translation id="7576032389798113292">6x4</translation> <translation id="7576690715254076113">Kusanya</translation> +<translation id="7580671184200851182">Cheza sauti moja kupitia spika zote (sauti ya mono)</translation> <translation id="7581279002575751816">Programu jalizi za NPAPI hazihimiliwi.</translation> <translation id="7581462281756524039">Zana ya kusafisha</translation> <translation id="7582582252461552277">Pendelea mtandao huu</translation> @@ -4683,6 +4717,7 @@ <translation id="7925686952655276919">Usitumie data ya simu kwa ulinganishaji</translation> <translation id="7926906273904422255">Alamisha asili zisizo salama kama zisizo salama, au kama "mbaya".</translation> <translation id="7928710562641958568">Ondoa kifaa</translation> +<translation id="79312157130859720"><ph name="APP_NAME" /> inashiriki skrini na sauti yako.</translation> <translation id="7938594894617528435">Nje ya mtandao kwa sasa</translation> <translation id="7939374455203157513">Washa Huduma za Wingu</translation> <translation id="7939412583708276221">Hata hivyo weka</translation> @@ -5120,6 +5155,7 @@ <translation id="8571108619753148184">Seva 4</translation> <translation id="8572832761467613633">Flash pekee</translation> <translation id="8572981282494768930">Usiruhusu tovuti zifikie kamera na maikrofoni yako</translation> +<translation id="8574234089711453001">Ruhusu kitufe cha kupakua kionekane unapofungua ukurasa wenye url ya maudhui.</translation> <translation id="857779305329188634">Washa matumizi ya itifaki ya majaribio ya QUIC.</translation> <translation id="8579285237314169903">Inasasisha vipengee <ph name="NUMBER_OF_FILES" />...</translation> <translation id="8579549103199280730">Uliza kwa chaguo-msingi</translation> @@ -5167,7 +5203,7 @@ <translation id="8651324101757295372">Piga gumzo na mtu huyu</translation> <translation id="8651585100578802546">Lazimisha Ukurasa Huu Upakiwe Tena</translation> <translation id="8652139471850419555">Mitandao Inayopendelewa</translation> -<translation id="8652487083013326477">kitufe redio cha kiwango cha ukurasa</translation> +<translation id="8652487083013326477">kitufe cha mviringo cha kurasa zilizochaguliwa</translation> <translation id="8654151524613148204">Faili hii ni kubwa sana kwa kompyuta yako kuishughulikia. Samahani.</translation> <translation id="8655295600908251630">Kituo</translation> <translation id="8655319619291175901">Lo! hitilafu fulani imetokea.</translation> @@ -5175,6 +5211,7 @@ <translation id="8656768832129462377">Usikague</translation> <translation id="8656946437567854031">Kwa kubofya Endelea unakubaliana na <ph name="LEGAL_DOC_LINK_TEXT_1" />, <ph name="LEGAL_DOC_LINK_TEXT_2" />, <ph name="LEGAL_DOC_LINK_TEXT_3" />, <ph name="LEGAL_DOC_LINK_TEXT_4" />, <ph name="LEGAL_DOC_LINK_TEXT_5" />, na <ph name="LEGAL_DOC_LINK_TEXT_6" />.</translation> <translation id="8658595122208653918">Badilisha chaguo za printa...</translation> +<translation id="8658645149275195032"><ph name="APP_NAME" /> inashiriki skrini na sauti yako pamoja na <ph name="TAB_NAME" />.</translation> <translation id="8659716501582523573">Anwani ya Itifaki Wavuti:</translation> <translation id="8661290697478713397">Fungua Kiungo katika Dirisha &Fiche</translation> <translation id="8662795692588422978">Watu</translation> @@ -5380,6 +5417,7 @@ <translation id="8942416694471994740">Ufikiaji wa maikrofoni yako unadhibitiwa na msimamizi wako.</translation> <translation id="894360074127026135">Netscape International Step-Up</translation> <translation id="8944779739948852228">Printa imegunduliwa</translation> +<translation id="8944964446326379280"><ph name="APP_NAME" /> inashiriki dirisha na <ph name="TAB_NAME" />.</translation> <translation id="8946359700442089734">Vipengele vya kutatua havikuwashwa kikamilifu kwenye kifaa hiki cha <ph name="IDS_SHORT_PRODUCT_NAME" />.</translation> <translation id="8946784827990177241">Washa matumizi ya WebUSB.</translation> <translation id="89515141420106838">Huwasha programu ya Ghala la Duka la Chrome kwenye Wavuti kwa viendeshaji vya printa. Programu hutafuta Duka la Chrome kwenye Wavuti kwa viendelezi vinavyotumia uchapishaji kwenye printa ya USB yenye Kitambulisho mahususi cha USB.</translation> @@ -5398,6 +5436,7 @@ <translation id="8965037249707889821">Weka nenosiri la zamani</translation> <translation id="8965697826696209160">Hakuna nafasi ya kutosha.</translation> <translation id="8968527460726243404">Kiandikaji cha Picha za Mfumo wa ChromeOS</translation> +<translation id="8970203673128054105">Angalia orodha ya hali ya kutuma</translation> <translation id="89720367119469899">Ondoka</translation> <translation id="8972513834460200407">Tafadhali wasiliana na msimamzi wako wa mtandao ili uhakikishe kuwa ngome haizuii vipakuliwa kutoka seva za Google.</translation> <translation id="8974161578568356045">Gundua Kiotomatiki</translation> @@ -5425,6 +5464,7 @@ <translation id="9011178328451474963">Kichupo cha mwisho</translation> <translation id="9013284500811652791"><ph name="UWS_NAME" />, <ph name="UWS_NAME" />, na moja zaidi</translation> <translation id="9013587737291179248">Lo! Mtumiaji anayesimamiwa hakuweza kuingizwa. Tafadhali angalia nafasi kwenye diski yako kuu na ruhusa na ujaribu tena.</translation> +<translation id="901440679911238150">Muda wa kutumika kwa maelezo ya akaunti yako umekwisha. <ph name="BEGIN_LINK" />Ingia katika akaunti tena<ph name="END_LINK" />.</translation> <translation id="9014987600015527693">Onyesha simu nyingine</translation> <translation id="9015601075560428829">Vifaa vya kuingiza sauti</translation> <translation id="9016164105820007189">Inaunganisha kwenye "<ph name="DEVICE_NAME" />".</translation> @@ -5438,6 +5478,7 @@ <translation id="9025098623496448965">Sawa, Nirudishe nyuma hadi kwenye skrini ya kuingia katika akaunti</translation> <translation id="902638246363752736">Mipangilio ya kibodi</translation> <translation id="9026731007018893674">pakua</translation> +<translation id="9027146684281895941">Msimamie mtu huyu ili udhibiti na uangalie tovuti anazotembelea kwenye Akaunti yako ya Google.</translation> <translation id="9027459031423301635">Fungua Kiungo katika Kichupo &Kipya</translation> <translation id="9027603907212475920">Sanidi usawazishaji...</translation> <translation id="9033453977881595182">KITAMBULISHO cha Tokeni</translation> @@ -5553,6 +5594,7 @@ <translation id="9203478404496196495">Rejesha sauti ya kichupo</translation> <translation id="9203962528777363226">Msimamizi wa kifaa hiki amelemaza kuongezwa kwa watumiaji wapya</translation> <translation id="9205143043463108573">Inaweka Kifungua Programu katikati ya skrini na kukipanua.</translation> +<translation id="9205160891051296441">Sera ya usaidizi ya SystemTimezoneAutomaticDetection</translation> <translation id="9206487995878691001">Mbinu ya kuingiza data ya Cangjie</translation> <translation id="9207194316435230304">ATOK</translation> <translation id="9208886416788010685">Toleo hili la Adobe Reader halitumiki tena</translation> @@ -5574,6 +5616,7 @@ <translation id="939736085109172342">Folda mpya</translation> <translation id="940425055435005472">Ukubwa wa fonti:</translation> <translation id="941543339607623937">Ufunguo binafsi sio halali.</translation> +<translation id="942532530371314860"><ph name="APP_NAME" /> inashiriki kichupo cha Chrome na sauti.</translation> <translation id="942954117721265519">Hakuna picha katika saraka hii.</translation> <translation id="945522503751344254">Tuma maoni</translation> <translation id="946810925362320585">Fuata pendekezo</translation>
diff --git a/chrome/app/resources/generated_resources_ta.xtb b/chrome/app/resources/generated_resources_ta.xtb index d2b4c1a..4e6cd55 100644 --- a/chrome/app/resources/generated_resources_ta.xtb +++ b/chrome/app/resources/generated_resources_ta.xtb
@@ -502,7 +502,7 @@ <translation id="169515659049020177">Shift</translation> <translation id="1697068104427956555">படத்தில் ஒரு சதுர பகுதியைத் தேர்ந்தெடுக்கவும்.</translation> <translation id="1697532407822776718">எல்லாவற்றையும் அமைத்துவிட்டீர்கள்!</translation> -<translation id="1697988819212986149">Google சேவைகளால் வழங்கப்படும் சூழல் மெனு உருப்படிகளுக்கு அடுத்துள்ள Google ஐகானைக் காட்டும்.</translation> +<translation id="1697988819212986149">Google சேவைகளால் வழங்கப்படும் சூழல் மெனு உருப்படிகளுக்கு அருகில் Google ஐகானைக் காட்டும்.</translation> <translation id="1699274548822076330">இது பதிவேற்ற-url-தடமறி கொடியுடன் சேர்ந்து பயன்படுத்தப்பட வேண்டும். எச்சரிக்கை: இயக்கப்படும் போது, ஒவ்வொரு வழிசெலுத்தலுக்கும் செயல்திறன் தரவை Chrome பதிவுசெய்து பதிவேற்ற-url-தடமறி கொடியால் குறிப்பிடப்பட்ட URLக்கு அதனை ஏற்றும். தடமறிதலில் நீங்கள் செல்லும் இணையதளங்களின் தலைப்புகள், URLகள் போன்ற தனிப்பட்ட அடையாளத் தகவல் (PII) சேர்க்கப்படலாம்.</translation> <translation id="1699395855685456105">வன்பொருள் திருத்தம்:</translation> @@ -661,7 +661,6 @@ <translation id="1962233722219655970">உங்கள் கணினியில் பணியாற்றாத நேட்டிவ் க்ளையன்ட் பயன்பாட்டை இந்தப் பக்கம் பயன்படுத்துகிறது.</translation> <translation id="1965328510789761112">தனிப்பட்ட நினைவகம்</translation> <translation id="1965624977906726414">எந்தச் சிறப்பு அனுமதிகளும் இல்லை.</translation> -<translation id="1968720524450620475">இணைய அறிவிப்புகளுக்கான செயல் ஐகான்களை இயக்கு.</translation> <translation id="1970746430676306437">பக்கத்தின் &தகவலைக் காட்டு</translation> <translation id="197288927597451399">வைத்திரு</translation> <translation id="1973491249112991739"><ph name="PLUGIN_NAME" /> பதிவிறக்கம் தோல்வியடைந்தது.</translation> @@ -1424,7 +1423,6 @@ <translation id="302014277942214887">பயன்பாட்டு ஐடி அல்லது இணைய அங்காடி URL ஐ உள்ளிடவும்.</translation> <translation id="3020616530769498629">புதுப்பிக்க இழு என்கிற செயல் மூலம் சரிபார்க்காத மீள் ஏற்றத்தை இயக்கு</translation> <translation id="3020990233660977256">வரிசை எண்: <ph name="SERIAL_NUMBER" /></translation> -<translation id="3021245547458004908">இயக்கப்பட்டால், dp >= 800 என்கிற குறைந்தபட்ச திரையைக் கொண்ட சாதனங்களில் உருட்டல்களின் காரணமாக, கருவிப்பட்டி ஒருபோதும் மறைக்கப்படாது. ஆனால், பக்கத்தின் உள்ளடக்கம் முழுத்திரைக்கு மாற்றப்பட்டால் அது தொடர்ந்து மறைக்கப்படும்.</translation> <translation id="3021678814754966447">சட்டக ஆதாரங்களைக் &காண்க</translation> <translation id="3024374909719388945">24-மணிநேர கடிகாரத்தைப் பயன்படுத்து</translation> <translation id="3025022340603654002">படிவ உறுப்பில் முதலில் கிளிக் செய்யும்போதே, பரிந்துரைகளைத் தானாக நிரப்பும்.</translation> @@ -1436,10 +1434,10 @@ <translation id="3030243755303701754">கண்காணிக்கப்படும் பயனர் உங்கள் வழிகாட்டுதல் மூலம் இணையத்தில் உலாவலாம். கண்காணிக்கப்படும் பயனரின் நிர்வாகியாக, நீங்கள் Chrome இல் பின்வருவனவற்றைச் செய்யலாம்: • குறிப்பிட்ட இணையதளங்களை அனுமதிக்கலாம் அல்லது தடைசெய்யலாம், - • கண்காணிக்கப்படும் பயனர் பார்வையிட்ட இணையதளங்களை மதிப்பாய்வு செய்யலாம், + • கண்காணிக்கப்படும் பயனர் பார்வையிட்ட இணையதளங்களை மறுபார்வையிடலாம், • பிற அமைப்புகளை நிர்வகிக்கலாம். -கண்காணிக்கப்படும் பயனரை உருவாக்குவதால் Google கணக்கை உருவாக்கப்படாது, மேலும் அவர்களின் புக்மார்க்குகள், உலாவல் வரலாறு மற்றும் பிற விருப்பத்தேர்வுகள் ஆகியவை Chrome ஒத்திசைவு மூலம் பிற சாதனங்களில் ஒத்திசைக்கப்படாது. புதிய கண்காணிக்கப்படும் பயனரை உருவாக்கிய பின், எந்தச் சாதனத்திலும் எப்போது வேண்டுமானாலும் அவர்களின் அமைப்புகளை <ph name="BEGIN_MANAGE_LINK" /><ph name="DISPLAY_LINK" /><ph name="END_MANAGE_LINK" /> இல் நிர்வகிக்கலாம். +கண்காணிக்கப்படும் பயனரை உருவாக்குவதால் Google கணக்கு உருவாக்கப்படாது, மேலும் அவர்களின் புக்மார்க்குகள், உலாவல் வரலாறு மற்றும் பிற விருப்பத்தேர்வுகள் ஆகியவை Chrome ஒத்திசைவு மூலம் பிற சாதனங்களில் ஒத்திசைக்கப்படாது. புதிய கண்காணிக்கப்படும் பயனரை உருவாக்கிய பின், எந்தச் சாதனத்திலும் எப்போது வேண்டுமானாலும் அவர்களின் அமைப்புகளை <ph name="BEGIN_MANAGE_LINK" /><ph name="DISPLAY_LINK" /><ph name="END_MANAGE_LINK" /> இல் நிர்வகிக்கலாம். மேலும் தகவலுக்கு, எங்கள் <ph name="BEGIN_LINK" />உதவி மையத்திற்குச்<ph name="END_LINK" /> செல்லவும்.</translation> <translation id="3031417829280473749">ஏஜென்ட் X</translation> @@ -1495,7 +1493,6 @@ <translation id="3117812041123364382">மிதக்கும் விர்ச்சுவல் விசைப்பலகையை இயக்கும்/முடக்கும்.</translation> <translation id="3118319026408854581"><ph name="PRODUCT_NAME" /> உதவி</translation> <translation id="3120430004221004537">குறிப்பிட்ட செயல்பாட்டுக்குப் போதுமான முறைமையாக்கம் இல்லாத சாதனம்: "<ph name="DEVICE_NAME" />".</translation> -<translation id="3121260210578524273">இணைய அறிவிப்புகளுக்கான செயல் பொத்தான்களில் ஐகான்களை இயக்கவும்.</translation> <translation id="3121793941267913344">இந்த <ph name="IDS_SHORT_PRODUCT_NAME" /> சாதனத்தை மீட்டமைக்கவும்</translation> <translation id="3122162841865761901">டெவெலப்பர் கருவிகளின் பரிசோதனைகள்</translation> <translation id="3122464029669770682">CPU</translation> @@ -2276,13 +2273,14 @@ <translation id="421017592316736757">இந்த கோப்பை அணுக ஆன்லைனில் இருக்க வேண்டும்.</translation> <translation id="421182450098841253">புக்மார்க்ஸ் பட்டியைக் &காண்பி</translation> <translation id="4212108296677106246">"<ph name="CERTIFICATE_NAME" />" ஐ ஒரு சான்றளிக்கும் மையமாக நம்ப விரும்புகிறீர்களா?</translation> +<translation id="42126664696688958">ஏற்றுமதி செய்</translation> <translation id="42137655013211669">இந்த ஆதாரத்திற்கான அணுகல் சேவையகத்தால் தடுக்கப்பட்டிருக்கிறது.</translation> <translation id="4215350869199060536">அச்சச்சோ, பெயரில் சட்டவிரோத சின்னங்கள் உள்ளன!</translation> <translation id="4215898373199266584">பிஸ்ட்! மறைநிலைப் பயன்முறை (<ph name="INCOGNITO_MODE_SHORTCUT" />) அடுத்த முறை பயனுள்ளதாக இருக்கலாம்.</translation> <translation id="4218259925454408822">இன்னொரு கணக்கில் உள்நுழைக</translation> <translation id="4219614746733932747">இயக்கப்பட்டால், சாதன அளவிடல் காரணிக்கு உள்ளடக்கத்தை அளவிட அதன் பெரிதாக்கல் நுட்பத்தை Blink பயன்படுத்தும்.</translation> <translation id="4220865787605972627">காட்சியானது அம்சத்தை ஆதரித்தால் அதன் வண்ணத்தைத் அளவுத்திருத்தம் செய்வதை அனுமதிக்கும்.</translation> -<translation id="4232692576734035989">உயர் சோதனை செயல்திறன் பயன்முறை (கிராஸ் சைட் iframes, சிறந்த ஆவணத்திலிருந்து தனித்தனிச் செயல்பாடுகளில் வைக்கப்படும்). இந்தப் பயன்முறையில், செயல்முறையைப் பகிர மூன்றாம் தரப்புத் தளங்களிலிருந்து iframes அனுமதிக்கப்படும்.</translation> +<translation id="4232692576734035989">உயர் சோதனை செயல்திறன் பயன்முறை (கிராஸ் சைட் iframes, மேல்மட்ட ஆவணத்திலிருந்து தனித்தனிச் செயல்பாடுகளில் வைக்கப்படும்). இந்தப் பயன்முறையில், செயல்முறையைப் பகிர மூன்றாம் தரப்புத் தளங்களிலிருந்து iframes அனுமதிக்கப்படும்.</translation> <translation id="4235200303672858594">திரை முழுவதும்</translation> <translation id="4235813040357936597"><ph name="PROFILE_NAME" /> க்கான கணக்கைச் சேர்</translation> <translation id="4240069395079660403"><ph name="PRODUCT_NAME" /> ஐ இந்த மொழியில் காண்பிக்க முடியாது</translation> @@ -3304,7 +3302,6 @@ <translation id="577322787686508614">படித்தல் செயல்பாடு இந்தச் சாதனத்தில் அனுமதிக்கப்படவில்லை: "<ph name="DEVICE_NAME" />".</translation> <translation id="5774295353725270860">கோப்புகள் பயன்பாட்டைத் திற</translation> <translation id="5774515636230743468">வெளிக்காட்டு:</translation> -<translation id="5776006986202016118">இந்தத் தளம் இதனுடன் இணைக்கப்பட வேண்டும்:</translation> <translation id="577624874850706961">குக்கீகளைத் தேடு</translation> <translation id="5778550464785688721">MIDI சாதனங்கள் முழுக்கட்டுப்பாடு</translation> <translation id="5780066559993805332">(சிறந்தது)</translation> @@ -4119,7 +4116,7 @@ <translation id="7057058088140140610">Google Paymentsஐப் பயன்படுத்தும் கிரெடிட் கார்டுகளும் முகவரிகளும்</translation> <translation id="7059858479264779982">தானியங்கு துவக்கியை அமை</translation> <translation id="7061692898138851896">கடவுச்சொற்களைத் தானாகச் சேமி</translation> -<translation id="7062222374113411376">தரவை அனுப்புவதையும் பெறுவதையும் முடிக்க சமீபத்தில் மூடப்பட்ட தளங்களை அனுமதி (பரிந்துரைத்தது)</translation> +<translation id="7062222374113411376">தரவை அனுப்புவதையும் பெறுவதையும் முடிக்க சமீபத்தில் மூடப்பட்ட தளங்களை அனுமதி (பரிந்துரைக்கப்படுகிறது)</translation> <translation id="7063129466199351735">குறுக்குவழிகளைச் செயல்படுத்துகிறது...</translation> <translation id="7065223852455347715">நிறுவன பதிவைத் தடுக்கும் பயன்முறையில் இந்தச் சாதனம் பூட்டப்பட்டுள்ளது. சாதனத்தைப் பதிவுசெய்ய விரும்பினால், முதலில் சாதனத்தை மீட்டெடுக்கவும்.</translation> <translation id="7065534935986314333">முறைமையைப் பற்றி</translation> @@ -4193,7 +4190,6 @@ <translation id="7175353351958621980">இதிலிருந்து ஏற்றப்பட்டது:</translation> <translation id="7180611975245234373">புதுப்பி</translation> <translation id="7180865173735832675">தனிப்பயனாக்கு</translation> -<translation id="7184428045150946911">பெரிய டேப்லெட்களில் கருவிப்பட்டியைத் தானாக மறைப்பதை முடக்கு</translation> <translation id="7185690883425432021">தாவல் பட்டியல் அடுக்கப்பட்ட பயன்முறையில் இருக்கும் போது, செயலற்ற தாவல்களின் மூடு பொத்தான்களை மறைக்கும்.</translation> <translation id="7186088072322679094">கருவிப்பட்டியில் வை</translation> <translation id="719009910964971313">US புரோகிராமர் டிவோரக் விசைப்பலகை</translation>
diff --git a/chrome/app/resources/generated_resources_te.xtb b/chrome/app/resources/generated_resources_te.xtb index 56592da..d961d027 100644 --- a/chrome/app/resources/generated_resources_te.xtb +++ b/chrome/app/resources/generated_resources_te.xtb
@@ -661,7 +661,6 @@ <translation id="1962233722219655970">ఈ పేజీ మీ కంప్యూటర్లో పని చేయని స్థానిక క్లయింట్ అనువర్తనాన్ని ఉపయోగిస్తుంది.</translation> <translation id="1965328510789761112">ప్రైవేట్ మెమరీ</translation> <translation id="1965624977906726414">ప్రత్యేక అనుమతులు లేవు.</translation> -<translation id="1968720524450620475">వెబ్ నోటిఫికేషన్ల కోసం చర్య చిహ్నాలను ప్రారంభించండి.</translation> <translation id="1970746430676306437">పేజీ యొక్క &సమాచారాన్ని చూడండి</translation> <translation id="197288927597451399">ఉంచు</translation> <translation id="1973491249112991739"><ph name="PLUGIN_NAME" /> డౌన్లోడ్ విఫలమైంది.</translation> @@ -1423,7 +1422,6 @@ <translation id="302014277942214887">అనువర్తన id లేదా వెబ్స్టోర్ URLను నమోదు చేయండి.</translation> <translation id="3020616530769498629">రీఫ్రెష్ చేయడానికి లాగండి చర్యపై ప్రామాణీకరణ-యేతర రీలోడ్ను ప్రారంభించండి</translation> <translation id="3020990233660977256">క్రమ సంఖ్య: <ph name="SERIAL_NUMBER" /></translation> -<translation id="3021245547458004908">ప్రారంభించినప్పుడు, కనిష్ట స్క్రీన్ dp >= 800 ఉండే పరికరాల్లో స్క్రోల్ చేయడం వలన సాధనపట్టీ ఎప్పటికీ దాచబడదు. అయితే పేజీ కంటెంట్లను పూర్తి స్క్రీన్లో చూసినప్పుడు ఇది దాచబడుతుంది.</translation> <translation id="3021678814754966447">ఫ్రేమ్ మూలాన్ని &వీక్షించండి</translation> <translation id="3024374909719388945">24-గంటల గడియారాన్ని ఉపయోగించండి</translation> <translation id="3025022340603654002">ఫారమ్ మూలకంలో మౌస్ క్లిక్ చేసిన ప్రారంభంలో స్వీయపూర్తి సూచనలు అందించబడతాయి.</translation> @@ -1494,7 +1492,6 @@ <translation id="3117812041123364382">తేలియాడే వర్చువల్ కీబోర్డ్ను ప్రారంభించండి/నిలిపివేయండి.</translation> <translation id="3118319026408854581"><ph name="PRODUCT_NAME" /> సహాయం</translation> <translation id="3120430004221004537">దీనిలో నిర్దిష్ట చర్య కోసం తగిన గుప్తీకరణ లేదు: "<ph name="DEVICE_NAME" />".</translation> -<translation id="3121260210578524273">వెబ్ నోటిఫికేషన్ల కోసం చర్య బటన్ల్లో చిహ్నాలను ప్రారంభిస్తుంది.</translation> <translation id="3121793941267913344">ఈ <ph name="IDS_SHORT_PRODUCT_NAME" /> పరికరాన్ని రీసెట్ చేయండి</translation> <translation id="3122162841865761901">డెవలపర్ సాధనాల ప్రయోగాలు</translation> <translation id="3122464029669770682">CPU</translation> @@ -2276,6 +2273,7 @@ <translation id="421017592316736757">ఈ ఫైల్ను ప్రాప్యత చేయడానికి మీరు తప్పనిసరిగా ఆన్లైన్లో ఉండాలి.</translation> <translation id="421182450098841253"> &బుక్మార్క్ల బార్ను చూపు</translation> <translation id="4212108296677106246">మీరు "<ph name="CERTIFICATE_NAME" />"ని ప్రమాణపత్రం అధికారిగా నమ్మాలనుకుంటున్నారా?</translation> +<translation id="42126664696688958">ఎగుమతి చేయి</translation> <translation id="42137655013211669">సర్వర్ ఈ వనరుకు ప్రాప్యతను నిషేధించింది.</translation> <translation id="4215350869199060536">అయ్యో, పేరులో చట్టవ్యతిరేక చిహ్నాలు ఉన్నాయి!</translation> <translation id="4215898373199266584">అయ్యో! అజ్ఞాత మోడ్ (<ph name="INCOGNITO_MODE_SHORTCUT" />) తదుపరిసారి అందుబాటులోకి రావచ్చు.</translation> @@ -3308,7 +3306,6 @@ <translation id="577322787686508614">దీనిలో చదివే చర్యకు అనుమతి లేదు: "<ph name="DEVICE_NAME" />".</translation> <translation id="5774295353725270860">ఫైల్ల అనువర్తనాన్ని తెరువు</translation> <translation id="5774515636230743468">మానిఫెస్ట్:</translation> -<translation id="5776006986202016118">ఈ సైట్ వీటికి కనెక్ట్ చేయాలనుకుంటోంది:</translation> <translation id="577624874850706961">కుకీలను శోధించు</translation> <translation id="5778550464785688721">MIDI పరికరాల పూర్తి నియంత్రణ</translation> <translation id="5780066559993805332">(ఉత్తమమైనది)</translation> @@ -4198,7 +4195,6 @@ <translation id="7175353351958621980">దీని నుండి లోడ్ అయ్యింది:</translation> <translation id="7180611975245234373">రీఫ్రెష్ చేయి</translation> <translation id="7180865173735832675">అనుకూలీకరించు</translation> -<translation id="7184428045150946911">పెద్ద టాబ్లెట్ల్లో సాధనపట్టీని స్వయంచాలకంగా దాచడాన్ని నిలిపివేయండి</translation> <translation id="7185690883425432021">ట్యాబ్స్ట్రిప్ స్టాక్ చేసిన మోడ్లో ఉన్నప్పుడు నిష్క్రియ ట్యాబ్ల మూసివేత బటన్లను దాస్తుంది.</translation> <translation id="7186088072322679094">సాధనపట్టీలో ఉంచండి</translation> <translation id="719009910964971313">US ప్రోగ్రామర్ డ్వోరక్ కీబోర్డ్</translation>
diff --git a/chrome/app/resources/generated_resources_th.xtb b/chrome/app/resources/generated_resources_th.xtb index 9e13006..d19b692d 100644 --- a/chrome/app/resources/generated_resources_th.xtb +++ b/chrome/app/resources/generated_resources_th.xtb
@@ -661,7 +661,6 @@ <translation id="1962233722219655970">หน้าเว็บนี้ใช้แอปพลิเคชัน Native Client ซึ่งไม่สามารถทำงานบนคอมพิวเตอร์ของคุณ</translation> <translation id="1965328510789761112">หน่วยความจำส่วนตัว</translation> <translation id="1965624977906726414">ไม่มีสิทธิ์พิเศษใดๆ</translation> -<translation id="1968720524450620475">เปิดใช้ไอคอนการทำงานสำหรับการแจ้งเตือนในเว็บ</translation> <translation id="1970746430676306437">ดู&ข้อมูลหน้าเว็บ</translation> <translation id="197288927597451399">เก็บไว้</translation> <translation id="1973491249112991739">การดาวน์โหลด <ph name="PLUGIN_NAME" /> ล้มเหลว</translation> @@ -1423,7 +1422,6 @@ <translation id="302014277942214887">ป้อน ID แอปพลิเคชันหรือ URL เว็บสโตร์</translation> <translation id="3020616530769498629">เปิดใช้การโหลดซ้ำแบบไม่ตรวจสอบเมื่อดึงเพื่อรีเฟรช</translation> <translation id="3020990233660977256">หมายเลขซีเรียล: <ph name="SERIAL_NUMBER" /></translation> -<translation id="3021245547458004908">เมื่อเปิดใช้ ระบบจะไม่ซ่อนแถบเครื่องมือหากเลื่อนบนอุปกรณ์ต่างๆ ที่มีขนาดหน้าจออย่างน้อย dp >= 800 แถบเครื่องมือจะยังคงซ่อนอยู่หากเปิดเนื้อหาในหน้าแบบเต็มหน้าจอ</translation> <translation id="3021678814754966447">&ดูแหล่งที่มาของเฟรม</translation> <translation id="3024374909719388945">ใช้เวลารูปแบบ 24 ชั่วโมง</translation> <translation id="3025022340603654002">สร้างคำแนะนำการป้อนอัตโนมัติในการคลิกเมาส์ครั้งแรกบนองค์ประกอบแบบฟอร์ม</translation> @@ -1494,7 +1492,6 @@ <translation id="3117812041123364382">เปิดหรือปิดใช้แป้นพิมพ์เสมือนแบบลอย</translation> <translation id="3118319026408854581">ความช่วยเหลือของ <ph name="PRODUCT_NAME" /></translation> <translation id="3120430004221004537">การเข้ารหัสสำหรับการดำเนินการที่ระบุไม่เพียงพอใน "<ph name="DEVICE_NAME" />"</translation> -<translation id="3121260210578524273">เปิดใช้ไอคอนในปุ่มการทำงานสำหรับการแจ้งเตือนในเว็บ</translation> <translation id="3121793941267913344">รีเซ็ตอุปกรณ์ <ph name="IDS_SHORT_PRODUCT_NAME" /></translation> <translation id="3122162841865761901">การทดสอบเครื่องมือสำหรับนักพัฒนาซอฟต์แวร์</translation> <translation id="3122464029669770682">CPU</translation> @@ -2275,6 +2272,7 @@ <translation id="421017592316736757">คุณจะต้องออนไลน์เพื่อเข้าถึงไฟล์นี้</translation> <translation id="421182450098841253">&แสดงแถบบุ๊กมาร์ก</translation> <translation id="4212108296677106246">คุณต้องการให้ความเชื่อถือ "<ph name="CERTIFICATE_NAME" />" ในฐานะผู้ออกใบรับรองหรือไม่</translation> +<translation id="42126664696688958">ส่งออก</translation> <translation id="42137655013211669">เซิร์ฟเวอร์ได้ห้ามการเข้าถึงทรัพยากรนี้</translation> <translation id="4215350869199060536">อ๊ะ มีสัญลักษณ์ที่ไม่ถูกต้องในชื่อ!</translation> <translation id="4215898373199266584">รู้หรือไม่! โหมดไม่ระบุตัวตน (<ph name="INCOGNITO_MODE_SHORTCUT" />) อาจมีประโยชน์ต่อการใช้งานในครั้งถัดไป</translation> @@ -3306,7 +3304,6 @@ <translation id="577322787686508614">ไม่อนุญาตให้อ่านใน "<ph name="DEVICE_NAME" />"</translation> <translation id="5774295353725270860">เปิดแอปพลิเคชันไฟล์</translation> <translation id="5774515636230743468">จัดการ:</translation> -<translation id="5776006986202016118">เว็บไซต์นี้ต้องการเชื่อมต่อกับ:</translation> <translation id="577624874850706961">ค้นหาคุกกี้</translation> <translation id="5778550464785688721">การควบคุมอุปกรณ์ MIDI เต็มรูปแบบ</translation> <translation id="5780066559993805332">(ดีที่สุด)</translation> @@ -4195,7 +4192,6 @@ <translation id="7175353351958621980">โหลดจาก:</translation> <translation id="7180611975245234373">รีเฟรช</translation> <translation id="7180865173735832675">กำหนดค่า</translation> -<translation id="7184428045150946911">ปิดใช้การซ่อนแถบเครื่องมืออัตโนมัติบนแท็บเล็ตขนาดใหญ่</translation> <translation id="7185690883425432021">ซ่อนปุ่มปิดของแท็บที่ไม่ได้ใช้งานเมื่อแถบแท็บอยู่ในโหมดเรียงกันเป็นกลุ่ม</translation> <translation id="7186088072322679094">เก็บในแถบเครื่องมือ</translation> <translation id="719009910964971313">แป้นพิมพ์ดีโวรักโปรแกรมเมอร์สหรัฐอเมริกา</translation>
diff --git a/chrome/app/resources/generated_resources_tr.xtb b/chrome/app/resources/generated_resources_tr.xtb index e0bc9f39..b0ad97b 100644 --- a/chrome/app/resources/generated_resources_tr.xtb +++ b/chrome/app/resources/generated_resources_tr.xtb
@@ -502,7 +502,7 @@ <translation id="169515659049020177">ÜstKrktr</translation> <translation id="1697068104427956555">Resimde kare şeklinde bir alan seçin.</translation> <translation id="1697532407822776718">Artık hazırsınız!</translation> -<translation id="1697988819212986149">Google hizmetleri tarafından desteklenen içerik menüsü öğelerinin yanında bir Google simgesi gösterir.</translation> +<translation id="1697988819212986149">Google hizmetleri tarafından desteklenen bağlam menüsü öğelerinin yanında bir Google simgesi gösterir.</translation> <translation id="1699274548822076330">Bu, trace-upload-url (yükleme URL'sini izle) işaretiyle birlikte kullanılmak içindir. UYARI: Bu politika etkinleştirildiğinde, Chrome her gezinme için performans verilerini kaydeder ve onları trace-upload-url (yükleme URL'sini izle) işaretinin belirttiği URL'ye yükler. İz; ziyaret ettiğiniz web sitelerin başlıkları ve URL'leri gibi kimlik bilgilerini (PII) içerebilir.</translation> <translation id="1699395855685456105">Donanım düzeltmesi:</translation> @@ -661,7 +661,6 @@ <translation id="1962233722219655970">Bu sayfada, bilgisayarınızda çalışmayan bir Native Client uygulaması kullanılmaktadır.</translation> <translation id="1965328510789761112">Özel bellek</translation> <translation id="1965624977906726414">Özel bir izni yok.</translation> -<translation id="1968720524450620475">Web Bildirimleri için işlem simgelerini etkinleştir.</translation> <translation id="1970746430676306437">Sayfa &bilgisini görüntüle</translation> <translation id="197288927597451399">Sakla</translation> <translation id="1973491249112991739"><ph name="PLUGIN_NAME" /> indirilemedi.</translation> @@ -1382,7 +1381,7 @@ <translation id="2960393411257968125">Şifre yöneticisinin, senkronizasyon kimlik bilgilerine ilişkin otomatik doldurma özelliğini işleme şekli.</translation> <translation id="29611076221683977">Şu anda <ph name="BEGIN_BOLD" /><ph name="SITE" /><ph name="END_BOLD" /> sitesinde bulunan saldırganlar, Mac makinenize bilgilerinizi (örneğin fotoğraflar, şifreler, mesajlar ve kredi kartları) çalacak veya silecek tehlikeli programlar yüklemeyi deneyebilir.</translation> <translation id="2961695502793809356">İlerlemek için tıkla, geçmişi görmek için tıklayıp tut</translation> -<translation id="296216853343927883">İçerik menüsünde Google markası</translation> +<translation id="296216853343927883">Bağlam menüsünde Google markası</translation> <translation id="2963151496262057773">Aşağıdaki eklenti yanıt vermiyor: <ph name="PLUGIN_NAME" />Durdurmak ister misiniz?</translation> <translation id="2963783323012015985">Türkçe klavye</translation> <translation id="2964193600955408481">Kablosuz bağlantıyı devre dışı bırak</translation> @@ -1424,7 +1423,6 @@ <translation id="302014277942214887">Uygulama kimliğini veya Web mağazası URL'sini girin.</translation> <translation id="3020616530769498629">Yenilemek için çekme yapıldığında, doğrulama yapılmayan yeniden yükleme işlevini etkinleştir</translation> <translation id="3020990233660977256">Seri Numarası: <ph name="SERIAL_NUMBER" /></translation> -<translation id="3021245547458004908">Etkinleştirildiğinde, ekranın yoğunluktan bağımsız piksel (dp) boyutu en az 800 veya daha yüksek olan cihazlarda araç çubuğu hiçbir zaman kaydırma nedeniyle gizlenmez. Sayfa içeriği tam ekrana geçerse araç çubuğu gizlenmeye devam eder.</translation> <translation id="3021678814754966447">Çerçeve Kaynağını &Görüntüle</translation> <translation id="3024374909719388945">24 saatlik biçimi kullan</translation> <translation id="3025022340603654002">Bir form öğesinin ilk fare tıklamasında otomatik doldurma önerilerinde bulunun.</translation> @@ -1495,7 +1493,6 @@ <translation id="3117812041123364382">Kayan sanal klavyeyi etkinleştirin/devre dışı bırakın.</translation> <translation id="3118319026408854581"><ph name="PRODUCT_NAME" /> Yardım</translation> <translation id="3120430004221004537">Şu cihazda belirli bir işlem için yetersiz şifreleme: "<ph name="DEVICE_NAME" />".</translation> -<translation id="3121260210578524273">Web Bildirimleri için işlem düğmelerinde simgeleri etkinleştirin.</translation> <translation id="3121793941267913344">Bu <ph name="IDS_SHORT_PRODUCT_NAME" /> cihazını sıfırla</translation> <translation id="3122162841865761901">Geliştirici Araçları denemeleri</translation> <translation id="3122464029669770682">CPU</translation> @@ -2277,6 +2274,7 @@ <translation id="421017592316736757">Bu dosyaya erişebilmek için çevrimiçi olmalısınız.</translation> <translation id="421182450098841253">Yer İşaretleri Ç&ubuğunu Göster</translation> <translation id="4212108296677106246">"<ph name="CERTIFICATE_NAME" />" sertifikasına bir Sertifika Yetkilisi olarak güvenmek istiyor musunuz?</translation> +<translation id="42126664696688958">Dışa Aktar</translation> <translation id="42137655013211669">Bu kaynağa erişim sunucu tarafından yasaklandı.</translation> <translation id="4215350869199060536">Hata! Adda geçersiz simgeler var!</translation> <translation id="4215898373199266584">Hatırlatma! Bir dahaki sefere Gizli mod (<ph name="INCOGNITO_MODE_SHORTCUT" />) kullanışlı olabilir.</translation> @@ -3310,7 +3308,6 @@ <translation id="577322787686508614">Şu cihazda okuma işlemine izin verilmiyor: "<ph name="DEVICE_NAME" />".</translation> <translation id="5774295353725270860">Dosyalar uygulamasını aç</translation> <translation id="5774515636230743468">Bildirim:</translation> -<translation id="5776006986202016118">Bu site şuraya bağlanmak istiyor:</translation> <translation id="577624874850706961">Çerezlerde ara</translation> <translation id="5778550464785688721">MIDI cihazları tam denetimi</translation> <translation id="5780066559993805332">(En iyi)</translation> @@ -3708,7 +3705,7 @@ <translation id="6418505248408153264">Materyal Tasarım geçmişini etkinleştir</translation> <translation id="6419288379019356534">Bu cihaz <ph name="BEGIN_BOLD" /><ph name="DOMAIN" /><ph name="END_BOLD" /> tarafından yönetiliyor. <ph name="LINE_BREAK" /> - <ph name="BEGIN_BOLD" /><ph name="DOMAIN" /><ph name="END_BOLD" /> hesabınızda oturum açmaya devam etmek için lütfen "Sonraki"yi tıklayın.</translation> + <ph name="BEGIN_BOLD" /><ph name="DOMAIN" /><ph name="END_BOLD" /> hesabınızda oturum açmaya devam etmek için lütfen "İleri"yi tıklayın.</translation> <translation id="6419902127459849040">Orta Avrupa</translation> <translation id="6420676428473580225">Masaüstüne ekleyin</translation> <translation id="6422329785618833949">Fotoğraf arkaya gönderildi</translation> @@ -4199,7 +4196,6 @@ <translation id="7175353351958621980">Yükleme kaynağı:</translation> <translation id="7180611975245234373">Yenile</translation> <translation id="7180865173735832675">Özelleştir</translation> -<translation id="7184428045150946911">Büyük tabletlerde araç çubuğunu otomatik gizlemeyi devre dışı bırak</translation> <translation id="7185690883425432021">Sekme şeridi yığın modunda olduğunda etkin olmayan sekmelerin kapatma düğmelerini gizler.</translation> <translation id="7186088072322679094">Araç Çubuğunda Tut</translation> <translation id="719009910964971313">ABD Programcı Dvorak klavye</translation>
diff --git a/chrome/app/resources/generated_resources_uk.xtb b/chrome/app/resources/generated_resources_uk.xtb index 48f3015..4675c6c 100644 --- a/chrome/app/resources/generated_resources_uk.xtb +++ b/chrome/app/resources/generated_resources_uk.xtb
@@ -183,16 +183,19 @@ <translation id="1259724620062607540">Елемент полиці 7</translation> <translation id="1260240842868558614">Показати:</translation> <translation id="126710816202626562">Мова перекладу:</translation> +<translation id="1269690813141254680">Керуйте тим, як Google використовує вашу історію веб-перегляду, щоб персоналізувати Пошук та інші служби Google на сторінці <ph name="BEGIN_LINK" />Керування активністю в продуктах Google<ph name="END_LINK" />.</translation> <translation id="1272079795634619415">Зупинити</translation> <translation id="1272978324304772054">Цей обліковий запис користувача не належить домену, в якому зареєстровано пристрій. Якщо ви хочете зареєструватися в іншому домені, спершу потрібно виконати процедуру відновлення пристрою.</translation> <translation id="127353061808977798">Шрифти та кодування</translation> <translation id="1274997165432133392">Файли cookie та інші дані із сайтів</translation> <translation id="1275718070701477396">Вибрано</translation> +<translation id="1277908057200820621">Переглянути список пристроїв</translation> <translation id="1278049586634282054">Перевірити перегляди:</translation> <translation id="1278813325885878377">Угорська клавіатура QWERTY</translation> <translation id="1285320974508926690">Ніколи не перекладати цей сайт</translation> <translation id="1285484354230578868">Зберігати дані в обліковому записі Google Диска</translation> <translation id="1290223615328246825">Помилка автоматичного входу</translation> +<translation id="1293509594570842875">Не вдалося створити нового контрольованого користувача. Перевірте з’єднання з мережею та повторіть спробу.</translation> <translation id="1293556467332435079">Файли</translation> <translation id="1294298200424241932">Редагувати налаштування довіри:</translation> <translation id="1295794900245526845">Виберіть обліковий запис, збережений за допомогою <ph name="PASSWORD_MANAGER_BRAND" /></translation> @@ -291,6 +294,7 @@ <translation id="1429740407920618615">Сила сигналу:</translation> <translation id="143027896309062157">Читати й змінювати всі ваші дані на комп’ютері та веб-сайтах, які ви відвідуєте</translation> <translation id="1430915738399379752">Друк</translation> +<translation id="1433423644370450034">Сповіщення MediaStyle</translation> <translation id="1434696352799406980">Стартову сторінку, сторінку нової вкладки, пошукову систему та закріплені вкладки буде скинуто. Також буде вимкнено всі розширення та видалено тимчасові дані, як-от файли cookie. Історія закладок і збережені паролі не видалятимуться.</translation> <translation id="1434886155212424586">Домашня сторінка – це сторінка нової вкладки</translation> <translation id="1435550882135542937">Новий дизайн панелі інструментів розширень</translation> @@ -378,6 +382,7 @@ <translation id="1526925867532626635">Підтвердження налаштувань синхронізації</translation> <translation id="1528372117901087631">Інтернет-з’єднання</translation> <translation id="1529968269513889022">останній тиждень</translation> +<translation id="1531865825384516080">Надсилання звітів про URL-адреси в Безпечний пошук.</translation> <translation id="1532697124104874386">Увімкнути або вимкнути інтелектуальне розгортання віртуальної клавіатури.</translation> <translation id="1533897085022183721">Менше <ph name="MINUTES" />.</translation> <translation id="1533920822694388968">Вирівнювання, як ТБ</translation> @@ -661,7 +666,6 @@ <translation id="1962233722219655970">На цій сторінці використовується програма Native Client, яка не працює на вашому комп’ютері.</translation> <translation id="1965328510789761112">Приватна пам’ять</translation> <translation id="1965624977906726414">Спеціальні дозволи не потрібні.</translation> -<translation id="1968720524450620475">Увімкнути командні значки для веб-сповіщень.</translation> <translation id="1970746430676306437">Переглянути &інформацію про сторінку</translation> <translation id="197288927597451399">Зберегти</translation> <translation id="1973491249112991739">Помилка завантаження плагіна <ph name="PLUGIN_NAME" />.</translation> @@ -759,6 +763,7 @@ <translation id="212862741129535676">Відсоток заряду акумулятора, який використовує стан частоти</translation> <translation id="2128691215891724419">Помилка синхронізації. Оновіть парольну фразу для синхронізації...</translation> <translation id="2129904043921227933">Помилка синхронізації. Оновіть парольну фразу для синхронізації...</translation> +<translation id="2130053362119884302">Дозволити від’єднання вкладки в повноекранному режимі</translation> <translation id="2131077480075264">Не вдається встановити додаток <ph name="APP_NAME" />, оскільки він заборонений в <ph name="IMPORT_NAME" /></translation> <translation id="2134149231879627725">Дозволити Google віддалено блокувати та знаходити пристрій, а також стирати дані на ньому.</translation> <translation id="2134986351331412790">Цей сайт не приймає картки цього типу.</translation> @@ -771,6 +776,7 @@ <translation id="2143778271340628265">Ручна конфігурація проксі-сервера</translation> <translation id="2143915448548023856">Налаштування відображення</translation> <translation id="2144536955299248197">Перегляд сертифіката: <ph name="CERTIFICATE_NAME" /></translation> +<translation id="2147827593068025794">Фонова синхронізація</translation> <translation id="2148756636027685713">Форматування закінчено</translation> <translation id="2148892889047469596">Вкладка трансляції</translation> <translation id="2148999191776934271">Заряджається: <ph name="HOUR" />:<ph name="MINUTE" /> до повного зарядження</translation> @@ -1148,6 +1154,7 @@ <translation id="2665717534925640469">Ця сторінка зараз відображається в повноекранному режимі та вимкнула курсор миші.</translation> <translation id="2665919335226618153">От халепа! Сталася помилка під час форматування.</translation> <translation id="2668079306436607263">Навігація в історії за допомогою прокручування</translation> +<translation id="2670102641511624474"><ph name="APP_NAME" /> транслює вкладку Chrome.</translation> <translation id="2670965183549957348">Метод введення для стандарту чжуїнь китайської мови</translation> <translation id="2672142220933875349">Неправильний файл .crx. Помилка розпакування.</translation> <translation id="2672394958563893062">Сталася помилка. Натисніть, щоб знову запустити з початку.</translation> @@ -1194,6 +1201,7 @@ <translation id="2733364097704495499">Зареєструвати принтер <ph name="PRINTER_NAME" /> у Google Cloud Print?</translation> <translation id="2735698359135166290">Стандартна румунська клавіатура</translation> <translation id="2737363922397526254">Згорнути...</translation> +<translation id="2737755522130570180">Блокувати сценарії, завантажені через команду document.write</translation> <translation id="2738771556149464852">Не пізніше</translation> <translation id="2739191690716947896">Налагоджувати</translation> <translation id="2739240477418971307">Змінювати налаштування доступності</translation> @@ -1263,6 +1271,7 @@ <translation id="2805646850212350655">Система шифрування файлів Microsoft</translation> <translation id="2805707493867224476">Дозволяти всім сайтам показувати спливаючі вікна</translation> <translation id="2805756323405976993">Додатки</translation> +<translation id="2808243220963392165">Дозволити від’єднувати вкладки від панелі вкладок у повноекранному режимі на комп’ютерах Mac.</translation> <translation id="2809142985846095314">Пропонувати додавати автозаповнені дані кредитних карток</translation> <translation id="2809346626032021864">Читання</translation> <translation id="2809586584051668049">і ще <ph name="NUMBER_ADDITIONAL_DISABLED" /></translation> @@ -1391,6 +1400,7 @@ <translation id="2968792643335932010">Менше екземплярів</translation> <translation id="2971033837577180453"><span>Ідентифікатор:</span><ph name="EXTENSION_ID" /></translation> <translation id="2971213274238188218">зменшити яскравість</translation> +<translation id="2971422413423640756">Показувати кнопку "Завантажити", коли відкривається сторінка з URL-адресою медіафайлу.</translation> <translation id="2972557485845626008">Мікропрограма</translation> <translation id="2972581237482394796">&Повторити</translation> <translation id="297870353673992530">DNS-сервер:</translation> @@ -1423,7 +1433,6 @@ <translation id="302014277942214887">Введіть ідентифікатор програми або URL-адресу веб-магазину.</translation> <translation id="3020616530769498629">Увімкнути автоматичне перезавантаження способом "потягнути, щоб оновити"</translation> <translation id="3020990233660977256">Серійний номер: <ph name="SERIAL_NUMBER" /></translation> -<translation id="3021245547458004908">Коли цю опцію ввімкнено, панель інструментів не ховається, якщо прокручувати сторінку на пристроях із розміром екрана 800 або більше апаратно-незалежних пікселів. Але панель ховається, якщо розгорнути вміст сторінки на весь екран.</translation> <translation id="3021678814754966447">&Переглянути джерело фрейму</translation> <translation id="3024374909719388945">Використовувати 24-годинний формат</translation> <translation id="3025022340603654002">Автоматично заповнювати пропозиції під час першого натискання мишею елемента форми.</translation> @@ -1456,6 +1465,7 @@ <translation id="3057861065630527966">Створити резервні копії фотографій і відео</translation> <translation id="3058212636943679650">Щоб відновити операційну систему комп’ютера, вам знадобиться карта SD чи карта флеш-пам’яті USB для відновлення.</translation> <translation id="305932878998873762">Simple Cache для HTTP – це новий кеш. Він виконує розподіл місця на диску, використовуючи файлову систему.</translation> +<translation id="3062606427884046423">Використовувати сповіщення Android MediaStyle для медійних сповіщень у Chrome.</translation> <translation id="3064388234319122767">Транслітерація (zdravo → здраво)</translation> <translation id="3065041951436100775">Відповідь "Вкладка закрилась".</translation> <translation id="3065140616557457172">Введіть пошуковий запит або URL-адресу – усе працює чудово.</translation> @@ -1494,7 +1504,6 @@ <translation id="3117812041123364382">Вмикається або вимикається плаваюча віртуальна клавіатура.</translation> <translation id="3118319026408854581">Довідка <ph name="PRODUCT_NAME" /></translation> <translation id="3120430004221004537">Недостатнє шифрування для цієї операції на пристрої <ph name="DEVICE_NAME" />.</translation> -<translation id="3121260210578524273">Увімкнути значки командних кнопок для веб-сповіщень.</translation> <translation id="3121793941267913344">Скинути налаштування цього пристрою <ph name="IDS_SHORT_PRODUCT_NAME" /></translation> <translation id="3122162841865761901">Експерименти в Інструментах розробника</translation> <translation id="3122464029669770682">ЦП</translation> @@ -1539,6 +1548,7 @@ <translation id="3170072451822350649">Можна також пропустити вхід і <ph name="LINK_START" />працювати в режимі "Гість"<ph name="LINK_END" />.</translation> <translation id="3170544058711792988">Розмістити лупу в центрі екрана</translation> <translation id="3172213052701798825">Google Smart Lock для паролів</translation> +<translation id="3175469972022788345">Коли цю функцію ввімкнено, WebRTC використовує сертифікати ECDSA.</translation> <translation id="317583078218509884">Нові налаштування дозволів сайту почнуть діяти після перезавантаження сторінки.</translation> <translation id="3177048931975664371">Натисніть, щоб сховати пароль</translation> <translation id="3180365125572747493">Введіть пароль, щоб зашифрувати цей файл сертифіката.</translation> @@ -1992,6 +2002,7 @@ <translation id="3776796446459804932">Це розширення порушує політику Веб-магазину Chrome.</translation> <translation id="3778152852029592020">Завантаження скасовано.</translation> <translation id="3778740492972734840">&Інструменти розробника</translation> +<translation id="3780663724044634171">Виберіть обліковий запис, який керуватиме контрольованим користувачем.</translation> <translation id="378312418865624974">Читати унікальний ідентифікатор для цього комп’ютера</translation> <translation id="3783640748446814672">alt</translation> <translation id="3785308913036335955">Показувати ярлики додатків</translation> @@ -2015,6 +2026,7 @@ <translation id="3807747707162121253">&Скасувати</translation> <translation id="3809280248639369696">Інопланетянин</translation> <translation id="3810973564298564668">Змінити</translation> +<translation id="3811494700605067549">Вибрано 1 файл</translation> <translation id="3812034401428455285"><ph name="UWS_NAME" /> і <ph name="UWS_NAME" /></translation> <translation id="3812525830114410218">Недійсний сертифікат</translation> <translation id="3813984289128269159">Ok Google</translation> @@ -2044,6 +2056,7 @@ <translation id="3838543471119263078">Файли cookie й інші дані із сайтів і плагінів</translation> <translation id="3839497635014791588">Додаткова реакція на торкання компонентів інтерфейсу користувача</translation> <translation id="3840053866656739575">Утрачено з’єднання з Chromebox. Підійдіть ближче або перевірте пристрій, поки ми намагатимемося відновити з’єднання.</translation> +<translation id="3840055807562919428">Заборонити стороннім сценаріям блокування аналізаторів отримувати дані, вставлені в мейнфрейм через команду document.write.</translation> <translation id="3842552989725514455">Шрифт Serif</translation> <translation id="3846593650622216128">Ці налаштування встановлюються розширенням.</translation> <translation id="3846833722648675493">Показувати вікна програм після першого забарвлення. Вікна громіздких програм, які синхронно завантажують ресурси, відкриватимуться значно пізніше, тоді як програми, які завантажують більшість своїх ресурсів асинхронно, відкриватимуться майже одразу.</translation> @@ -2275,6 +2288,7 @@ <translation id="421017592316736757">Щоб отримати доступ до цього файлу, потрібно перебувати в режимі онлайн.</translation> <translation id="421182450098841253">&Показати панель закладок</translation> <translation id="4212108296677106246">Ви хочете довіряти "<ph name="CERTIFICATE_NAME" />" як Центру сертифікації?</translation> +<translation id="42126664696688958">Експортувати</translation> <translation id="42137655013211669">Сервер заборонив доступ до цього ресурсу.</translation> <translation id="4215350869199060536">Помилка. Заборонені символи в імені.</translation> <translation id="4215898373199266584">Наступного разу скористайтеся режимом анонімного перегляду (<ph name="INCOGNITO_MODE_SHORTCUT" />).</translation> @@ -2361,6 +2375,7 @@ <translation id="4359408040881008151">Установлено, оскільки є залежні розширення.</translation> <translation id="4361190688154226069">Натискати елементи в прямокутній області дотику</translation> <translation id="4364444725319685468">Файл "<ph name="FILE_NAME" />" завантажено</translation> +<translation id="4364567974334641491"><ph name="APP_NAME" /> транслює вікно.</translation> <translation id="4364830672918311045">Показувати сповіщення</translation> <translation id="4365673000813822030">На жаль, синхронізація перестала працювати.</translation> <translation id="4366509400410520531">Дозволено користувачем</translation> @@ -2430,6 +2445,7 @@ <translation id="4479639480957787382">Ethernet</translation> <translation id="4479812471636796472">Розкладка Дворака (США)</translation> <translation id="4481249487722541506">Завантажити розпаковане розширення...</translation> +<translation id="4482194545587547824">Google може використовувати вашу історію веб-перегляду, щоб персоналізувати Пошук та інші служби Google</translation> <translation id="4487088045714738411">Бельгійська розкладка</translation> <translation id="4492190037599258964">Результати пошуку для запиту "<ph name="SEARCH_STRING" />"</translation> <translation id="4495021739234344583">Скасувати реєстрацію та перезавантажити</translation> @@ -2473,6 +2489,7 @@ <translation id="4554591392113183336">Зовнішнє розширення має таку саму або нижчу версію порівняно з наявним.</translation> <translation id="4554796861933393312">Швидкість анімації чорнильної плями матеріального дизайну</translation> <translation id="4555769855065597957">Shadow</translation> +<translation id="4556110439722119938">Ваші закладки, історія, паролі й інші налаштування синхронізуватимуться з обліковим записом Google, щоб ви могли користуватися ними на всіх своїх пристроях</translation> <translation id="4557136421275541763">Застереження:</translation> <translation id="4558426062282641716">Потрібен дозвіл на автозапуск</translation> <translation id="4563210852471260509">Початкова мова введення – китайська</translation> @@ -2594,6 +2611,7 @@ <translation id="4742746985488890273">Закріпити на полиці</translation> <translation id="474421578985060416">Заблоковано користувачем</translation> <translation id="4744574733485822359">Ваше завантаження завершено</translation> +<translation id="4746330764136728131">Використовувати сертифікати ECDSA для WebRTC</translation> <translation id="4746971725921104503">Схоже, ви вже керуєте користувачем із таким іменем. <ph name="LINK_START" />Імпортувати ім’я <ph name="USER_DISPLAY_NAME" /> на цей пристрій<ph name="LINK_END" />?</translation> <translation id="4747271164117300400">Македонська</translation> <translation id="4749157430980974800">Грузинська клавіатура</translation> @@ -2743,6 +2761,7 @@ <translation id="496226124210045887">У вибраній папці містяться файли з приватною інформацією. Справді надати програмі "$1" постійний доступ для читання з цієї папки?</translation> <translation id="4964673849688379040">Перевірка…</translation> <translation id="4966802378343010715">Створити нового користувача</translation> +<translation id="4967749818080339523">Виберіть обліковий запис</translation> <translation id="496888482094675990">Додаток Файли надає швидкий доступ до файлів, збережених на Google Диску, у зовнішній пам’яті або на пристрої з ОС Chrome.</translation> <translation id="4971412780836297815">Відкрити після завантаження</translation> <translation id="497244430928947428">Малаяламська клавіатура (фонетична)</translation> @@ -2789,6 +2808,7 @@ <translation id="5038863510258510803">Увімкнення...</translation> <translation id="5039512255859636053">$1 Тб</translation> <translation id="5039804452771397117">Дозволити</translation> +<translation id="5043851552150732346">Вибрано 1 каталог</translation> <translation id="5045550434625856497">Неправильний пароль</translation> <translation id="5048179823246820836">Скандинавська</translation> <translation id="5048294425697652159">Увімкнути Quirks Client для калібрування дисплея.</translation> @@ -2876,6 +2896,7 @@ <translation id="5170477580121653719">Вільне місце на Диску Google: <ph name="SPACE_AVAILABLE" />.</translation> <translation id="5170568018924773124">Показати в папці</translation> <translation id="5171045022955879922">Знайдіть або введіть URL-адресу</translation> +<translation id="5171343362375269016">Замінена пам’ять</translation> <translation id="5175870427301879686"><ph name="URL" /> хоче постійно зберігати дані на вашому локальному комп’ютері.</translation> <translation id="5177479852722101802">Продовжити блокувати доступ до камери та мікрофона</translation> <translation id="5177526793333269655">Перегляд ескізів</translation> @@ -3033,6 +3054,7 @@ <translation id="5380103295189760361">Утримуйте клавіші Control, Alt, Shift або клавішу Пошук, щоб побачити комбінації клавіш для цих модифікаторів.</translation> <translation id="5382392428640372740">Увімкнути відстеження навігації</translation> <translation id="5388588172257446328">Ім’я користувача:</translation> +<translation id="5389237414310520250">Не вдалося створити нового користувача. Перевірте наявність місця на жорсткому диску та дозволи, а потім повторіть спробу.</translation> <translation id="5390284375844109566">Проіндексована база даних</translation> <translation id="5392544185395226057">Увімкнути підтримку для Native Client.</translation> <translation id="5396126354477659676">Плагін <ph name="PEPPER_PLUGIN_NAME" /> у домені <ph name="PEPPER_PLUGIN_DOMAIN" /> хоче отримати доступ до вашого комп’ютера.</translation> @@ -3100,6 +3122,7 @@ <translation id="5469954281417596308">Диспетчер закладок</translation> <translation id="5470838072096800024">Час останнього отримання</translation> <translation id="5473075389972733037">IBM</translation> +<translation id="5473279832922912143">Увімкніть V8, щоб користуватись експериментальним інтерпретатором Ignition для виконання JavaScript.</translation> <translation id="5474139872592516422">Коли оновлення плагіна <ph name="PLUGIN_NAME" /> закінчиться, перезавантажте сторінку, щоб його активувати.</translation> <translation id="5480254151128201294">Власник заблокував цей пристрій.</translation> <translation id="5483785310822538350">Скасувати доступ до файлу та пристрою</translation> @@ -3127,6 +3150,7 @@ <translation id="5509914365760201064">Видавець: <ph name="CERTIFICATE_AUTHORITY" /></translation> <translation id="5511823366942919280">Налаштувати цей пристрій як "Shark"?</translation> <translation id="5512653252560939721">Сертифікату користувача потрібна апаратна підтримка.</translation> +<translation id="5513242761114685513">Контекстне меню</translation> <translation id="5515008897660088170">Вікна додатка для перегляду інструментів.</translation> <translation id="551752069230578406">Додавання принтера в обліковий запис. Це може тривати деякий час…</translation> <translation id="5518584115117143805">Сертифікат шифрування електронної пошти</translation> @@ -3307,7 +3331,6 @@ <translation id="577322787686508614">Операцію перегляду заборонено на пристрої <ph name="DEVICE_NAME" />.</translation> <translation id="5774295353725270860">Відкрити програму файлів</translation> <translation id="5774515636230743468">Маніфест:</translation> -<translation id="5776006986202016118">Цей сайт хоче під’єднатися до:</translation> <translation id="577624874850706961">Пошук файлів cookie</translation> <translation id="5778550464785688721">Повний контроль пристроїв MIDI</translation> <translation id="5780066559993805332">(Найкраща)</translation> @@ -3385,6 +3408,7 @@ <translation id="5874045675243596003">Застосувати строгий фільтр (стійка помилка, якщо не вдається отримати хеші)</translation> <translation id="5875858680971105888">На жаль, не вдалось імпортувати нового контрольованого користувача. Перевірте з’єднання з мережею та повторіть спробу.</translation> <translation id="5880247576487732437">Маркер присутній</translation> +<translation id="5884474295213649357">Цю вкладку під’єднано до пристрою USB.</translation> <translation id="5885324376209859881">Керувати налаштуваннями засобів зв’язку…</translation> <translation id="5889282057229379085">Максимальна кількість проміжних ЦС: <ph name="NUM_INTERMEDIATE_CA" /></translation> <translation id="5892290200158927959">Французька клавіатура BÉPO</translation> @@ -3474,6 +3498,8 @@ <translation id="604124094241169006">Автоматично</translation> <translation id="6042308850641462728">Більше</translation> <translation id="604257181445267932">Завдяки Smart Lock можна швидко входити в додатки й на сайти за допомогою паролів, збережених у Google.</translation> +<translation id="6043317578411397101"><ph name="APP_NAME" /> транслює вкладку Chrome на вкладку <ph name="TAB_NAME" />.</translation> +<translation id="6044805581023976844"><ph name="APP_NAME" /> транслює вкладку Chrome і аудіо на вкладку <ph name="TAB_NAME" />.</translation> <translation id="6049065490165456785">Фотографія з внутрішньої камери</translation> <translation id="6051028581720248124">Друкуючи в службу FedEx Office, ви приймаєте її <ph name="START_LINK" />Загальні положення та умови<ph name="END_LINK" />.</translation> <translation id="6051086608691487286">Панелі прокручування в накладанні</translation> @@ -3602,6 +3628,7 @@ <translation id="6251889282623539337">Загальні положення та умови <ph name="DOMAIN" /></translation> <translation id="6251924700383757765">Політика конфіденційності</translation> <translation id="6253586523465486793">Примусово активує автоматичне перезавантаження сторінки способом "потягнути, щоб оновити" (якщо вимкнено, оновлення підтверджується в кеші).</translation> +<translation id="6254182355913122230">Замінена пам’ять</translation> <translation id="6254503684448816922">Дискредитація ключа</translation> <translation id="6259104249628300056">Пошук пристроїв у локальній мережі</translation> <translation id="6263082573641595914">Версія ЦС Microsoft</translation> @@ -3872,6 +3899,7 @@ <translation id="6680028776254050810">Змінити користувача</translation> <translation id="6681668084120808868">Зробити фото</translation> <translation id="668171684555832681">Інший...</translation> +<translation id="6682083956260248340">Цим параметром можна керувати на сторінці <ph name="BEGIN_LINK" /></translation> <translation id="6686490380836145850">Закрити вкладки праворуч</translation> <translation id="6686817083349815241">Зберегти пароль</translation> <translation id="6689514201497896398">Пропускати перевірки зацікавленості користувачів</translation> @@ -3939,10 +3967,12 @@ <translation id="6798954102094737107">Плагін: <ph name="PLUGIN_NAME" /></translation> <translation id="6802031077390104172"><ph name="USAGE" /> (<ph name="OID" />)</translation> <translation id="6804671422566312077">Відкрити всі закладки в &новому вікні</translation> +<translation id="6805542829187142700">Увімкнути правило пристрою щодо системи автоматичного визначення часового поясу.</translation> <translation id="6805647936811177813">Увійдіть у <ph name="TOKEN_NAME" />, щоб імпортувати сертифікат клієнта з <ph name="HOST_NAME" />.</translation> <translation id="680572642341004180">Увімкнути відстеження RLZ в <ph name="SHORT_PRODUCT_OS_NAME" />.</translation> <translation id="6807889908376551050">Показати всі...</translation> <translation id="6809448577646370871">Спеціальне чергування вікон додатків Chrome.</translation> +<translation id="6810613314571580006">Автоматично входити в облікові записи на веб-сайтах за допомогою збережених даних. Якщо цю функцію вимкнено, потрібно підтверджувати облікові дані під час кожного входу на сайтах.</translation> <translation id="6812349420832218321"><ph name="PRODUCT_NAME" /> неможливо запустити з кореневого каталогу.</translation> <translation id="6812841287760418429">Залишити зміни</translation> <translation id="6814124696888326520">Щоб легше змінювати методи введення й мати доступ до інших функцій: голосового чи рукописного вводу та смайлів.</translation> @@ -4129,6 +4159,7 @@ <translation id="7065534935986314333">Про систему</translation> <translation id="7066944511817949584">Не вдалося під’єднатися до пристрою "<ph name="DEVICE_NAME" />".</translation> <translation id="7067725467529581407">Більше не показувати.</translation> +<translation id="7068609958927777019">Якщо ввімкнути це налаштування, дані невідповідні URL-адреси повідомлятимуться в Безпечний пошук.</translation> <translation id="7070804685954057874">Пряме введення</translation> <translation id="7072010813301522126">Назва ярлика</translation> <translation id="7072025625456903686">Дозволити всі або налаштувати</translation> @@ -4194,10 +4225,10 @@ <translation id="7170467426996704624">Транслітерація (salam → ሰላም)</translation> <translation id="7172053773111046550">Естонська розкладка</translation> <translation id="7173828187784915717">Налаштування введення даних для стандарту чжуїнь</translation> +<translation id="7173917244679555">Схоже, ви вже керуєте користувачем із таким іменем.<ph name="BEGIN_LINK" />Імпортувати дані користувача <ph name="PROFILE_NAME" /> на цей пристрій<ph name="END_LINK" />?</translation> <translation id="7175353351958621980">Завантажено з:</translation> <translation id="7180611975245234373">Оновити</translation> <translation id="7180865173735832675">Налаштувати</translation> -<translation id="7184428045150946911">Не ховати панель інструментів автоматично на великих планшетах</translation> <translation id="7185690883425432021">Кнопка "Закрити" на неактивних вкладках ховається, коли для панелі вкладок увімкнено режим накладання.</translation> <translation id="7186088072322679094">Залишити на панелі інструментів</translation> <translation id="719009910964971313">Розкладка Дворака для програмістів (США)</translation> @@ -4262,6 +4293,7 @@ <translation id="7280825545668757494">Синхронізація облікових даних Wi-Fi</translation> <translation id="7280877790564589615">Потрібен дозвіл</translation> <translation id="7282547042039404307">Плавно</translation> +<translation id="7284549674086796566">Експериментальний інтерпретатор JavaScript</translation> <translation id="7287143125007575591">У доступі відмовлено.</translation> <translation id="7288592446024861651">Ваші закладки, історія, паролі й інші налаштування синхронізуватимуться з обліковим записом Google, щоб ви могли користуватися ними на всіх своїх пристроях. Виберіть дані для синхронізації на сторінці <ph name="BEGIN_LINK" /></translation> <translation id="7288676996127329262">Роздільна здатність: <ph name="HORIZONTAL_DPI" />x<ph name="VERTICAL_DPI" /></translation> @@ -4284,6 +4316,7 @@ <translation id="7321545336522791733">Сервер недоступний</translation> <translation id="7325437708553334317">Розширення "Високий контраст"</translation> <translation id="7326565110843845436">Натискання трьома пальцями на сенсорній панелі</translation> +<translation id="7327088014939803293">Не вдалося створити нового керованого користувача. Переконайтеся, що ви ввійшли правильно, і повторіть спробу.</translation> <translation id="73289266812733869">Невиділений</translation> <translation id="7329154610228416156">Не вдалося ввійти, оскільки вас було переспрямовано на незахищену URL-адресу (<ph name="BLOCKED_URL" />). Зв’яжіться з адміністратором.</translation> <translation id="7331786426925973633">Веб-переглядач для швидкої, простої й надійної роботи</translation> @@ -4458,6 +4491,7 @@ <translation id="7573172247376861652">Заряджання акумулятора</translation> <translation id="7576032389798113292">6x4</translation> <translation id="7576690715254076113">Сортувати за копіями</translation> +<translation id="7580671184200851182">Відтворювати один аудіозапис на всіх динаміках (монофонічне аудіо)</translation> <translation id="7581279002575751816">Плагіни NPAPI не підтримуються.</translation> <translation id="7581462281756524039">Інструмент очищення</translation> <translation id="7582582252461552277">Віддавати перевагу цій мережі</translation> @@ -4690,6 +4724,7 @@ <translation id="7925686952655276919">Не використовувати мобільне передавання даних для синхронізації</translation> <translation id="7926906273904422255">Позначати незахищені джерела як ненадійні або сумнівні.</translation> <translation id="7928710562641958568">Витягнути пристрій</translation> +<translation id="79312157130859720"><ph name="APP_NAME" /> транслює ваш екран і аудіо.</translation> <translation id="7938594894617528435">Зараз офлайн</translation> <translation id="7939374455203157513">Увімкнути хмарні служби</translation> <translation id="7939412583708276221">Усе ж зберегти</translation> @@ -5124,6 +5159,7 @@ <translation id="8571108619753148184">Сервер 4</translation> <translation id="8572832761467613633">Лише Flash</translation> <translation id="8572981282494768930">Заборонити сайтам отримувати доступ до вашої камери та мікрофону</translation> +<translation id="8574234089711453001">Показувати кнопку "Завантажити", коли відкривається сторінка з URL-адресою медіафайлу.</translation> <translation id="857779305329188634">Увімкнути підтримку експериментального протоколу QUIC.</translation> <translation id="8579285237314169903">Синхронізація стількох елементів: <ph name="NUMBER_OF_FILES" />…</translation> <translation id="8579549103199280730">Запитувати за умовчанням</translation> @@ -5179,6 +5215,7 @@ <translation id="8656768832129462377">Не перевіряти</translation> <translation id="8656946437567854031">Натискаючи "Продовжити", ви приймаєте такі документи: <ph name="LEGAL_DOC_LINK_TEXT_1" />, <ph name="LEGAL_DOC_LINK_TEXT_2" />, <ph name="LEGAL_DOC_LINK_TEXT_3" />, <ph name="LEGAL_DOC_LINK_TEXT_4" />, <ph name="LEGAL_DOC_LINK_TEXT_5" /> і <ph name="LEGAL_DOC_LINK_TEXT_6" />.</translation> <translation id="8658595122208653918">Змінити параметри принтера…</translation> +<translation id="8658645149275195032"><ph name="APP_NAME" /> транслює ваш екран і аудіо на вкладку <ph name="TAB_NAME" />.</translation> <translation id="8659716501582523573">IP-адреса:</translation> <translation id="8661290697478713397">Відкрити посилання в аноні&мному вікні</translation> <translation id="8662795692588422978">Користувачі</translation> @@ -5384,6 +5421,7 @@ <translation id="8942416694471994740">Доступ до вашого мікрофона контролюється адміністратором.</translation> <translation id="894360074127026135">Програма підвищення до міжнародного рівня Netscape</translation> <translation id="8944779739948852228">Виявлено принтер</translation> +<translation id="8944964446326379280"><ph name="APP_NAME" /> транслює вікно на вкладку <ph name="TAB_NAME" />.</translation> <translation id="8946359700442089734">Функції налагодження не повністю ввімкнено на цьому пристрої <ph name="IDS_SHORT_PRODUCT_NAME" />.</translation> <translation id="8946784827990177241">Увімкнути підтримку WebUSB.</translation> <translation id="89515141420106838">Вмикає додаток Галерея Веб-магазину Chrome для драйверів принтера. Додаток шукає у Веб-магазині Chrome розширення, які підтримують друк через USB-принтер із відповідним ідентифікатором USB.</translation> @@ -5402,6 +5440,7 @@ <translation id="8965037249707889821">Введіть старий пароль</translation> <translation id="8965697826696209160">Недостатньо місця.</translation> <translation id="8968527460726243404">Засіб створення образів ОС Chrome</translation> +<translation id="8970203673128054105">Переглянути список режиму трансляції</translation> <translation id="89720367119469899">Escape</translation> <translation id="8972513834460200407">Зверніться до адміністратора мережі, щоб переконатися, що брандмауер не блокує завантаження із серверів Google.</translation> <translation id="8974161578568356045">Автоматичне визначення</translation> @@ -5429,6 +5468,7 @@ <translation id="9011178328451474963">Остання вкладка</translation> <translation id="9013284500811652791"><ph name="UWS_NAME" />, <ph name="UWS_NAME" /> і ще 1</translation> <translation id="9013587737291179248">На жаль, не вдалось імпортувати нового користувача. Перевірте наявність місця на жорсткому диску та дозволи, а потім повторіть спробу.</translation> +<translation id="901440679911238150">Дані для входу в обліковий запис застаріли. <ph name="BEGIN_LINK" />Увійти знову<ph name="END_LINK" />.</translation> <translation id="9014987600015527693">Показати інший телефон</translation> <translation id="9015601075560428829">Голосове введення</translation> <translation id="9016164105820007189">Під’єднання до "<ph name="DEVICE_NAME" />".</translation> @@ -5442,6 +5482,7 @@ <translation id="9025098623496448965">ОК, повернутися до екрана входу</translation> <translation id="902638246363752736">Налаштування клавіатури</translation> <translation id="9026731007018893674">завантаження</translation> +<translation id="9027146684281895941">Щоб контролювати й переглядати веб-сайти, які цей користувач відвідує з облікового запису Google, ви маєте стати його адміністратором.</translation> <translation id="9027459031423301635">Відкрити посилання в новій &вкладці</translation> <translation id="9027603907212475920">Налаштувати синхронізацію...</translation> <translation id="9033453977881595182">Ідентифікатор маркера</translation> @@ -5556,6 +5597,7 @@ <translation id="9203478404496196495">Увімкнути звук на вкладці</translation> <translation id="9203962528777363226">Адміністратор цього пристрою вимкнув можливість додавати нових користувачів</translation> <translation id="9205143043463108573">Розміщує панель запуску додатків у центрі екрана в альбомній орієнтації.</translation> +<translation id="9205160891051296441">Підтримка правила SystemTimezoneAutomaticDetection</translation> <translation id="9206487995878691001">Метод введення для стандарту цанцзє</translation> <translation id="9207194316435230304">ATOK</translation> <translation id="9208886416788010685">Версія Adobe Reader застаріла</translation> @@ -5577,6 +5619,7 @@ <translation id="939736085109172342">Нова папка</translation> <translation id="940425055435005472">Розмір шрифту:</translation> <translation id="941543339607623937">Недійсний секретний ключ.</translation> +<translation id="942532530371314860"><ph name="APP_NAME" /> транслює вкладку Chrome і аудіо.</translation> <translation id="942954117721265519">У цьому каталозі немає зображень.</translation> <translation id="945522503751344254">Надіслати відгук</translation> <translation id="946810925362320585">Дотримуватися рекомендації</translation>
diff --git a/chrome/app/resources/generated_resources_vi.xtb b/chrome/app/resources/generated_resources_vi.xtb index b086d443..67a437cf 100644 --- a/chrome/app/resources/generated_resources_vi.xtb +++ b/chrome/app/resources/generated_resources_vi.xtb
@@ -662,7 +662,6 @@ <translation id="1962233722219655970">Trang này sử dụng ứng dụng Native Client không hoạt động trên máy tính của bạn.</translation> <translation id="1965328510789761112">Bộ nhớ riêng</translation> <translation id="1965624977906726414">Không có đặc quyền.</translation> -<translation id="1968720524450620475">Bật biểu tượng tác vụ cho Thông báo trên web.</translation> <translation id="1970746430676306437">Xem thông t&in trang</translation> <translation id="197288927597451399">Giữ</translation> <translation id="1973491249112991739">Không thể tải xuống <ph name="PLUGIN_NAME" />.</translation> @@ -1425,7 +1424,6 @@ <translation id="302014277942214887">Nhập id ứng dụng hoặc URL cửa hàng trực tuyến.</translation> <translation id="3020616530769498629">Bật tính năng tải lại không xác thực khi kéo để làm mới</translation> <translation id="3020990233660977256">Số Sê-ri: <ph name="SERIAL_NUMBER" /></translation> -<translation id="3021245547458004908">Khi được bật, thanh công cụ sẽ không bao giờ bị ẩn do thao tác cuộn trên thiết bị có chiều cao màn hình tối thiểu >= 800. Thanh công cụ sẽ vẫn bị ẩn nếu nội dung trang ở chế độ toàn màn hình.</translation> <translation id="3021678814754966447">&Xem Nguồn Khung</translation> <translation id="3024374909719388945">Sử dụng đồng hồ 24 giờ</translation> <translation id="3025022340603654002">Đưa ra đề xuất tự động điền bằng cú nhấp chuột đầu tiên trên phần tử biểu mẫu.</translation> @@ -1496,7 +1494,6 @@ <translation id="3117812041123364382">Bật/tắt bàn phím ảo nổi.</translation> <translation id="3118319026408854581">Trợ giúp <ph name="PRODUCT_NAME" /></translation> <translation id="3120430004221004537">Mã hóa không đầy đủ đối với một tác vụ cụ thể trên: "<ph name="DEVICE_NAME" />".</translation> -<translation id="3121260210578524273">Bật các biểu tượng trong nút tác vụ cho Thông báo trên web.</translation> <translation id="3121793941267913344">Đặt lại thiết bị <ph name="IDS_SHORT_PRODUCT_NAME" /> này</translation> <translation id="3122162841865761901">Thử nghiệm trong Công cụ dành cho nhà phát triển</translation> <translation id="3122464029669770682">CPU</translation> @@ -2278,13 +2275,14 @@ <translation id="421017592316736757">Bạn phải trực tuyến để truy cập tệp này.</translation> <translation id="421182450098841253">&Hiển thị thanh dấu trang</translation> <translation id="4212108296677106246">Ban có muốn tin tưởng "<ph name="CERTIFICATE_NAME" />" là Tổ chức phát hành chứng chỉ không?</translation> +<translation id="42126664696688958">Xuất</translation> <translation id="42137655013211669">Máy chủ cấm truy cập vào tài nguyên này.</translation> <translation id="4215350869199060536">Rất tiếc, ký tự không hợp lệ trong tên!</translation> <translation id="4215898373199266584">Lưu ý! Chế độ ẩn danh (<ph name="INCOGNITO_MODE_SHORTCUT" />) có thể hữu ích vào lần sau.</translation> <translation id="4218259925454408822">Đăng nhập tài khoản khác</translation> <translation id="4219614746733932747">Nếu được bật, Blink sẽ sử dụng cơ chế thu phóng để mở rộng nội dung cho yếu tố phạm vi thiết bị.</translation> <translation id="4220865787605972627">Cho phép hiệu chỉnh màu của màn hình nếu màn hình hỗ trợ tính năng này.</translation> -<translation id="4232692576734035989">Chế độ thực hiện mang tính thử nghiệm cao trong đó iframe giữa các trang web được lưu giữ trong quá trình riêng biệt từ tài liệu quan trọng nhất. Ở chế độ này, iframe từ các trang web bên thứ ba khác sẽ được cho phép chia sẻ quá trình.</translation> +<translation id="4232692576734035989">Chế độ thực hiện mang tính thử nghiệm cao trong đó iframe giữa các trang web được lưu giữ trong quá trình riêng biệt từ tài liệu trên cùng. Ở chế độ này, iframe từ các trang web bên thứ ba khác sẽ được cho phép chia sẻ quá trình.</translation> <translation id="4235200303672858594">Toàn màn hình</translation> <translation id="4235813040357936597">Thêm tài khoản cho <ph name="PROFILE_NAME" /></translation> <translation id="4240069395079660403">Không thể hiển thị <ph name="PRODUCT_NAME" /> bằng ngôn ngữ này</translation> @@ -3310,7 +3308,6 @@ <translation id="577322787686508614">Tác vụ đọc không được phép trên: "<ph name="DEVICE_NAME" />".</translation> <translation id="5774295353725270860">Mở ứng dụng tệp</translation> <translation id="5774515636230743468">Manifest:</translation> -<translation id="5776006986202016118">Trang web này muốn kết nối với:</translation> <translation id="577624874850706961">Tìm kiếm cookie</translation> <translation id="5778550464785688721">Điều khiển toàn bộ thiết bị MIDI</translation> <translation id="5780066559993805332">(Cao nhất)</translation> @@ -4203,7 +4200,6 @@ <translation id="7175353351958621980">Được tải từ:</translation> <translation id="7180611975245234373">Làm mới</translation> <translation id="7180865173735832675">Tùy chỉnh</translation> -<translation id="7184428045150946911">Tắt tính năng tự động ẩn thanh công cụ trên máy tính bảng lớn</translation> <translation id="7185690883425432021">Ẩn nút đóng của các tab không hoạt động khi thanh tab ở chế độ xếp chồng.</translation> <translation id="7186088072322679094">Giữ trong thanh công cụ</translation> <translation id="719009910964971313">Bàn phím US Programmer Dvorak</translation>
diff --git a/chrome/app/resources/generated_resources_zh-CN.xtb b/chrome/app/resources/generated_resources_zh-CN.xtb index 81c4c1f..4864893 100644 --- a/chrome/app/resources/generated_resources_zh-CN.xtb +++ b/chrome/app/resources/generated_resources_zh-CN.xtb
@@ -658,7 +658,6 @@ <translation id="1962233722219655970">此页使用了您的计算机不支持的 Native Client 应用。</translation> <translation id="1965328510789761112">专用内存</translation> <translation id="1965624977906726414">无需特殊权限。</translation> -<translation id="1968720524450620475">为网络通知启用操作图标。</translation> <translation id="1970746430676306437">查看网页信息(&I)</translation> <translation id="197288927597451399">保留</translation> <translation id="1973491249112991739"><ph name="PLUGIN_NAME" /> 下载失败。</translation> @@ -1418,7 +1417,6 @@ <translation id="302014277942214887">请输入应用 ID 或网上应用店网址。</translation> <translation id="3020616530769498629">启用“不必验证即可重新加载(下拉即可刷新)”</translation> <translation id="3020990233660977256">序列号:<ph name="SERIAL_NUMBER" /></translation> -<translation id="3021245547458004908">当此项处于启用状态时,在最低屏幕 dp 不低于 800 的设备上,工具栏在用户滚动网页时将不会隐藏。但如果网页内容以全屏模式显示,工具栏仍会隐藏。</translation> <translation id="3021678814754966447">查看框架的源代码(&V)</translation> <translation id="3024374909719388945">使用24小时制</translation> <translation id="3025022340603654002">在表单元素上点击一下鼠标,即自动填充建议的内容。</translation> @@ -1426,7 +1424,7 @@ <translation id="3025729795978504041">右键点击上方的按钮,即可查看其他用户。</translation> <translation id="3026050830483105579">无限精彩,尽在其中。</translation> <translation id="302620147503052030">显示按钮</translation> -<translation id="302781076327338683">重新加载(忽略缓存)</translation> +<translation id="302781076327338683">忽略缓存重新加载</translation> <translation id="3030243755303701754">受监管用户可以在您的指导下浏览网页。作为 Chrome 中受监管用户的管理员,您可以: • 允许或禁止受监管用户访问某些网站; @@ -1489,7 +1487,6 @@ <translation id="3117812041123364382">启用/停用浮动虚拟键盘。</translation> <translation id="3118319026408854581"><ph name="PRODUCT_NAME" />帮助</translation> <translation id="3120430004221004537">“<ph name="DEVICE_NAME" />”上某项指定操作的加密强度不足。</translation> -<translation id="3121260210578524273">为网络通知启用操作按钮中的图标。</translation> <translation id="3121793941267913344">重置这台<ph name="IDS_SHORT_PRODUCT_NAME" />设备</translation> <translation id="3122162841865761901">开发者工具实验性功能</translation> <translation id="3122464029669770682">CPU</translation> @@ -2267,6 +2264,7 @@ <translation id="421017592316736757">您必须在线访问此文件。</translation> <translation id="421182450098841253">显示书签栏(&S)</translation> <translation id="4212108296677106246">您要信任“<ph name="CERTIFICATE_NAME" />”并将其作为证书授权中心吗?</translation> +<translation id="42126664696688958">导出</translation> <translation id="42137655013211669">服务器禁止访问此资源。</translation> <translation id="4215350869199060536">糟糕,名称中包含非法符号!</translation> <translation id="4215898373199266584">嘘!下次您可以使用隐身模式(快捷键为 <ph name="INCOGNITO_MODE_SHORTCUT" />)。</translation> @@ -2896,7 +2894,7 @@ <translation id="5227808808023563348">查找上一文字</translation> <translation id="5228076606934445476">设备出现问题。要从此错误下恢复,您需要重启设备,然后重试。</translation> <translation id="5228962187251412618">只能在线检查</translation> -<translation id="5229622432348746578">停用桌面共享音频功能</translation> +<translation id="5229622432348746578">禁止桌面共享功能共享音频</translation> <translation id="5230516054153933099">窗口</translation> <translation id="5232178406098309195">当您发出音频功能启动指令(例如说“Ok Google”或触摸麦克风图标)后,语音和音频活动记录功能会将部分语音和其他音频存储在您帐户名下(这部分记录只有您本人能看到)。Google 会将接下来(以及在您发出指令前的几秒内)的语音/音频录音存储起来。</translation> <translation id="523299859570409035">通知例外情况</translation> @@ -3292,7 +3290,6 @@ <translation id="577322787686508614">禁止在“<ph name="DEVICE_NAME" />”上执行读取操作。</translation> <translation id="5774295353725270860">打开文件应用</translation> <translation id="5774515636230743468">网址:</translation> -<translation id="5776006986202016118">此网站想要连接到:</translation> <translation id="577624874850706961">搜索 Cookie</translation> <translation id="5778550464785688721">完全控制 MIDI 设备</translation> <translation id="5780066559993805332">(最佳)</translation> @@ -4180,7 +4177,6 @@ <translation id="7175353351958621980">加载来源:</translation> <translation id="7180611975245234373">刷新</translation> <translation id="7180865173735832675">自定义</translation> -<translation id="7184428045150946911">在大型平板电脑上禁止自动隐藏工具栏</translation> <translation id="7185690883425432021">当标签栏处于堆叠模式时,隐藏不活动标签页上的关闭按钮。</translation> <translation id="7186088072322679094">固定在工具栏中</translation> <translation id="719009910964971313">美式 Programmer Dvorak 键盘</translation>
diff --git a/chrome/app/resources/generated_resources_zh-TW.xtb b/chrome/app/resources/generated_resources_zh-TW.xtb index ea75535..40c5eb698 100644 --- a/chrome/app/resources/generated_resources_zh-TW.xtb +++ b/chrome/app/resources/generated_resources_zh-TW.xtb
@@ -661,7 +661,6 @@ <translation id="1962233722219655970">這個網頁使用無法在您電腦上運行的 Native Client 應用程式。</translation> <translation id="1965328510789761112">專用記憶體</translation> <translation id="1965624977906726414">沒有特殊權限。</translation> -<translation id="1968720524450620475">為網路通知啟用動作圖示。</translation> <translation id="1970746430676306437">檢視網頁資訊(&I)</translation> <translation id="197288927597451399">保留</translation> <translation id="1973491249112991739"><ph name="PLUGIN_NAME" /> 下載失敗。</translation> @@ -1423,7 +1422,6 @@ <translation id="302014277942214887">請輸入應用程式 ID 或線上應用程式網址。</translation> <translation id="3020616530769498629">啟用不驗證重新載入 (拉動即可重新整理)</translation> <translation id="3020990233660977256">序號:<ph name="SERIAL_NUMBER" /></translation> -<translation id="3021245547458004908">啟用後,即使在裝置 (最低螢幕 dp 不低於 800) 上捲動網頁也不會隱藏工具列。不過,以全螢幕顯示網頁內容時仍會隱藏工具列。</translation> <translation id="3021678814754966447">檢視頁框原始碼(&V)</translation> <translation id="3024374909719388945">使用 24 小時制時鐘</translation> <translation id="3025022340603654002">一旦使用滑鼠點選表單元素立即提供自動填入建議。</translation> @@ -1438,7 +1436,7 @@ • 查看受監管使用者瀏覽過的網站;以及 • 管理其他設定。 -建立受監管的使用者時並不會建立 Google 帳戶,且這類使用者的書籤、瀏覽紀錄和其他偏好設定都不會透過 Chrome Sync 在其他裝置上保持同步。建立新的受監管使用者之後,您隨時都可以使用任何裝置前往 <ph name="BEGIN_MANAGE_LINK" /><ph name="DISPLAY_LINK" /><ph name="END_MANAGE_LINK" /> 管理設定。 +建立受監管的使用者時並不會同時建立該使用者的 Google 帳戶,且這類使用者的書籤、瀏覽紀錄和其他偏好設定都不會透過 Chrome Sync 在其他裝置上保持同步。建立新的受監管使用者之後,您隨時都可以使用任何裝置前往 <ph name="BEGIN_MANAGE_LINK" /><ph name="DISPLAY_LINK" /><ph name="END_MANAGE_LINK" /> 管理設定。 如需進一步資訊,請造訪<ph name="BEGIN_LINK" />說明中心<ph name="END_LINK" />。</translation> <translation id="3031417829280473749">特務 X</translation> @@ -1494,7 +1492,6 @@ <translation id="3117812041123364382">啟用/停用浮動虛擬鍵盤。</translation> <translation id="3118319026408854581"><ph name="PRODUCT_NAME" />說明</translation> <translation id="3120430004221004537">在以下裝置上指定的作業的加密強度不足:「<ph name="DEVICE_NAME" />」。</translation> -<translation id="3121260210578524273">為網路通知啟用動作按鈕的圖示。</translation> <translation id="3121793941267913344">重設這個 <ph name="IDS_SHORT_PRODUCT_NAME" /> 裝置</translation> <translation id="3122162841865761901">開發人員工具實驗功能</translation> <translation id="3122464029669770682">CPU</translation> @@ -1704,7 +1701,7 @@ <translation id="3392020134425442298">還原惡意檔案</translation> <translation id="3394150261239285340"><ph name="HOST" /> 要求使用相機和麥克風。</translation> <translation id="3394279550557729862">啟用原生快顯通知和通知中心支援功能,在適用的平台上使用。</translation> -<translation id="3394862755749546286">針對 Android 裝置停用整合 (Android 和桌面) 媒體管道。</translation> +<translation id="3394862755749546286">針對 Android 裝置停用整合 (Android 和桌機) 媒體管道。</translation> <translation id="3396331542604645348">選取的印表機無法使用或未正確安裝。請檢查您的印表機,或改選其他印表機。</translation> <translation id="3399597614303179694">馬其頓文鍵盤</translation> <translation id="3401130144947259741">啟用後,追蹤事件將匯出到 Windows 事件追蹤 (ETW),並可使用 UIForETW 或 Xperf 等工具擷取。</translation> @@ -2274,6 +2271,7 @@ <translation id="421017592316736757">您必須連上網路才能存取這個檔案。</translation> <translation id="421182450098841253">顯示書籤列(&S)</translation> <translation id="4212108296677106246">您要信任「<ph name="CERTIFICATE_NAME" />」做為憑證授權單位嗎?</translation> +<translation id="42126664696688958">匯出</translation> <translation id="42137655013211669">伺服器禁止存取這個資源。</translation> <translation id="4215350869199060536">糟糕,名稱中有非法符號!</translation> <translation id="4215898373199266584">建議您下次試試看好用的無痕模式 (<ph name="INCOGNITO_MODE_SHORTCUT" />)。</translation> @@ -2796,7 +2794,7 @@ <translation id="5062930723426326933">無法登入,請重新連線至網際網路並再試一次。</translation> <translation id="5063180925553000800">新 PIN:</translation> <translation id="5067867186035333991">當 <ph name="HOST" /> 要求存取麥克風時詢問我。</translation> -<translation id="5068918910148307423">禁止最近關閉的網站停止傳送及接收資料</translation> +<translation id="5068918910148307423">禁止最近關閉的網站完成資料的傳送及接收</translation> <translation id="507075806566596212">您即將向 Google 註冊這台 <ph name="DEVICE_TYPE" />,以啟用遠端定位、清除及鎖定裝置的功能。這項設定需要重新啟動後才會生效,您要繼續嗎?</translation> <translation id="5072836811783999860">顯示受管理書籤</translation> <translation id="5074318175948309511">您可能需要重新載入這個網頁,新設定才會生效。</translation> @@ -3301,7 +3299,6 @@ <translation id="577322787686508614">無法在以下裝置上執行讀取作業:「<ph name="DEVICE_NAME" />」。</translation> <translation id="5774295353725270860">開啟「檔案」應用程式</translation> <translation id="5774515636230743468">資訊:</translation> -<translation id="5776006986202016118">這個網站要求連線至:</translation> <translation id="577624874850706961">搜尋 Cookie</translation> <translation id="5778550464785688721">MIDI 裝置完整控制</translation> <translation id="5780066559993805332">(最佳)</translation> @@ -4115,7 +4112,7 @@ <translation id="7057058088140140610">使用 Google Payments 儲存的信用卡和地址資訊。</translation> <translation id="7059858479264779982">設為自動啟動</translation> <translation id="7061692898138851896">自動儲存密碼</translation> -<translation id="7062222374113411376">允許最近關閉的網站停止傳送及接收資料 (建議)</translation> +<translation id="7062222374113411376">允許最近關閉的網站完成資料的傳送及接收 (建議)</translation> <translation id="7063129466199351735">正在處理捷徑...</translation> <translation id="7065223852455347715">這個裝置已鎖定,目前處於禁止企業註冊模式。您必須先完成裝置還原程序,才能註冊這個裝置。</translation> <translation id="7065534935986314333">關於系統</translation> @@ -4189,7 +4186,6 @@ <translation id="7175353351958621980">載入來源:</translation> <translation id="7180611975245234373">重新整理</translation> <translation id="7180865173735832675">自訂</translation> -<translation id="7184428045150946911">禁止在大型平板電腦自動隱藏工具列</translation> <translation id="7185690883425432021">在分頁列處於堆疊模式時隱藏閒置分頁的關閉按鈕。</translation> <translation id="7186088072322679094">固定在工具列中</translation> <translation id="719009910964971313">美式 Programmer Dvorak 鍵盤</translation>
diff --git a/chrome/app/resources/google_chrome_strings_am.xtb b/chrome/app/resources/google_chrome_strings_am.xtb index d1a8a20..64d68fd 100644 --- a/chrome/app/resources/google_chrome_strings_am.xtb +++ b/chrome/app/resources/google_chrome_strings_am.xtb
@@ -233,6 +233,7 @@ <translation id="8556340503434111824">አዲስ የGoogle Chrome ስሪት አለ፣ እና ከመቼውም በበለጠ ፈጣን ነው።</translation> <translation id="8568392309447938879">መተግበሪያዎችን ለመጠቀም ወደ Chrome በመለያ መግባት አለብዎት። ይህ Chrome መተግበሪያዎችዎን፣ ዕልባቶችዎን፣ ታሪክዎን፣ የይለፍ ቃላትዎን እና ሌሎች ቅንብሮችዎን በተለያዩ መሣሪያዎች ላይ እንዲያመሳስል ያስችለዋል።</translation> <translation id="8614913330719544658">Google Chrome መልስ አይሰጥም። አሁን ዳግም ይጀምር?</translation> +<translation id="8667808506758191620">የእርስዎ <ph name="DEVICE_TYPE" /> የተዘመነ ነው።</translation> <translation id="8669527147644353129">Google Chrome አጋዥ</translation> <translation id="8679801911857917785">እንዲሁም Chromeን ሲጀምሩት የሚታየውን ገጽ ይቆጣጠራል።</translation> <translation id="870251953148363156">&Google Chromeን አዘምን</translation> @@ -241,6 +242,7 @@ <translation id="8851136666856101339">main</translation> <translation id="8862326446509486874">ለስርዓተ-ደረጃ ጭነት ተገቢ መብቶች የሉዎትም። ጫኚውን እንደ አስተዳዳሪ በማሄድ እንደገና ይሞክሩ።</translation> <translation id="9026991721384951619">የመለያዎ መግቢያ ዝርዝሮች ጊዜያቸው ያለፈባቸው ስለሆኑ Chrome OS ውሂብዎን ማመሳሰል አልቻለም።</translation> +<translation id="9067395829937117663">Google Chrome Windows 7 ወይም ከዚያ በላይ ያስፈልገዋል።</translation> <translation id="9102715433345326100">ይህ ፋይል ተንኮል-አዘል ነው፣ እና Chrome አግዶታል።</translation> <translation id="9107728822479888688"><ph name="BEGIN_BOLD" />ማስጠንቀቂያ፦<ph name="END_BOLD" /> Google Chrome ቅጥያዎች የአሰሳ ታሪክዎን እንዳይመዘግቡ መከልከል አይችልም። ይህን ቅጥያ በማንነትን የማያሳውቅ ሁነታ ላይ ለማሰናከል ይህን አማራጭ አይምረጡ።</translation> <translation id="911206726377975832">የአሰሳ ውሂብዎም ይሰረዝ?</translation>
diff --git a/chrome/app/resources/google_chrome_strings_ar.xtb b/chrome/app/resources/google_chrome_strings_ar.xtb index 6c9d0459..92875e6e 100644 --- a/chrome/app/resources/google_chrome_strings_ar.xtb +++ b/chrome/app/resources/google_chrome_strings_ar.xtb
@@ -229,6 +229,7 @@ <translation id="8556340503434111824">يتوفر إصدار جديد من Google Chrome، وهو أسرع بكثير من ذي قبل.</translation> <translation id="8568392309447938879">يلزمك تسجيل الدخول إلى Chrome لتتمكن من استخدام التطبيقات. سيتيح هذا للمتصفح Chrome مزامنة تطبيقاتك والإشارات المرجعية والسجل وكلمات المرور وغير ذلك من الإعدادات عبر الأجهزة.</translation> <translation id="8614913330719544658">لا يستجيب Google Chrome. هل تريد إعادة التشغيل الآن؟</translation> +<translation id="8667808506758191620">جهاز <ph name="DEVICE_TYPE" /> مُحدّث.</translation> <translation id="8669527147644353129">مساعد Google Chrome</translation> <translation id="8679801911857917785">كما أنها تتحكم في الصفحة التي تظهر عند تشغيل Chrome.</translation> <translation id="870251953148363156">&تحديث Google Chrome</translation> @@ -237,6 +238,7 @@ <translation id="8851136666856101339">main</translation> <translation id="8862326446509486874">لا تملك الحقوق الكافية للتثبيت على مستوى النظام. جرّب تشغيل المثبِّت بصفة مشرف.</translation> <translation id="9026991721384951619">تعذر على نظام التشغيل Chrome مزامنة البيانات نظرًا لأن تفاصيل تسجيل الدخول إلى حسابك قديمة.</translation> +<translation id="9067395829937117663">يتطلب متصفح Google Chrome نظام التشغيل Windows 7 أو إصدارًا أحدث.</translation> <translation id="9102715433345326100">يُعد الملف برنامجًا ضارًا، وقد أجرى Chrome حظره.</translation> <translation id="9107728822479888688"><ph name="BEGIN_BOLD" />تحذير:<ph name="END_BOLD" /> لا يستطيع Google Chrome منع الإضافات من تسجيل سجل التصفح الخاص بك. لتعطيل هذا الإضافة في وضع التصفح المتخفي، ألغ تحديد هذا الخيار.</translation> <translation id="911206726377975832">هل تريد أيضًا حذف بيانات التصفح؟</translation>
diff --git a/chrome/app/resources/google_chrome_strings_bg.xtb b/chrome/app/resources/google_chrome_strings_bg.xtb index 03993528..cb1c06c 100644 --- a/chrome/app/resources/google_chrome_strings_bg.xtb +++ b/chrome/app/resources/google_chrome_strings_bg.xtb
@@ -235,6 +235,7 @@ <translation id="8851136666856101339">основен елемент</translation> <translation id="8862326446509486874">Нямате подходящи права за инсталация на ниво система. Опитайте да стартирате отново инсталационната програма като администратор.</translation> <translation id="9026991721384951619">Chrome OS не можа да синхронизира данните ви, защото потребителското име и паролата за вход в профила ви не са актуални.</translation> +<translation id="9067395829937117663">За Google Chrome се изисква Windows 7 или по-нова версия.</translation> <translation id="9102715433345326100">Този файл е злонамерен и е блокиран от Chrome.</translation> <translation id="9107728822479888688"><ph name="BEGIN_BOLD" />Предупреждение<ph name="END_BOLD" />: Google Chrome не може да попречи на разширенията да записват историята ви на сърфиране. За да деактивирате това разширение в режим „инкогнито“, премахнете отметката от тази опция.</translation> <translation id="911206726377975832">Да се изтрият ли и данните от сърфирането?</translation>
diff --git a/chrome/app/resources/google_chrome_strings_bn.xtb b/chrome/app/resources/google_chrome_strings_bn.xtb index 1821e222..c14a6a2 100644 --- a/chrome/app/resources/google_chrome_strings_bn.xtb +++ b/chrome/app/resources/google_chrome_strings_bn.xtb
@@ -237,6 +237,7 @@ <translation id="8851136666856101339">প্রধান</translation> <translation id="8862326446509486874">সিস্টেম-স্তরীয় ইনস্টলের জন্য আপনার কাছে যথাযথ অধিকারগুলি নেই৷ প্রশাসক হিসাবে আবার ইনস্টলারটি চালনার চেষ্টা করুন৷</translation> <translation id="9026991721384951619">আপনার অ্যাকাউন্টের সাইন ইনের বিবরণটি সেকেলে হওয়ায় Chrome OS আপনার ডেটা সিঙ্ক করতে পারেনি৷</translation> +<translation id="9067395829937117663">Google Chrome এর জন্য Windows 7 বা উচ্চতর সংস্করণ প্রয়োজন।</translation> <translation id="9102715433345326100">এই ফাইলটি ক্ষতিকারক, এবং Chrome এটিকে অবরুদ্ধ করেছে৷</translation> <translation id="9107728822479888688"><ph name="BEGIN_BOLD" /> সতর্কতা: <ph name="END_BOLD" /> Google Chrome আপনার ব্রাউজিং ইতিহাস নথিবদ্ধ থেকে এক্সটেনশনগুলি সংরক্ষণ করতে পারেনা৷ এই এক্সটেনশন অজ্ঞাত মোডে অক্ষম করতে, এই বিকল্প নির্বাচন মুক্ত করুন৷</translation> <translation id="911206726377975832">আপনার ব্রাউজিং ডেটাও মুছে দেবেন?</translation>
diff --git a/chrome/app/resources/google_chrome_strings_ca.xtb b/chrome/app/resources/google_chrome_strings_ca.xtb index 71ee9a7..d7790e6 100644 --- a/chrome/app/resources/google_chrome_strings_ca.xtb +++ b/chrome/app/resources/google_chrome_strings_ca.xtb
@@ -233,6 +233,7 @@ <translation id="8851136666856101339">principal</translation> <translation id="8862326446509486874">No disposeu dels drets necessaris per instal·lar aplicacions al sistema. Proveu de tornar a executar l'instal·lador com a administrador.</translation> <translation id="9026991721384951619">Chrome OS no ha pogut sincronitzar les vostres dades perquè les dades d'inici de sessió del compte no estan actualitzades.</translation> +<translation id="9067395829937117663">Google Chrome requereix Windows 7 o una versió posterior.</translation> <translation id="9102715433345326100">Aquest fitxer és maliciós i Chrome l'ha bloquejat.</translation> <translation id="9107728822479888688"><ph name="BEGIN_BOLD" />Advertiment:<ph name="END_BOLD" /> Google Chrome no pot evitar que les extensions registrin l'historial de navegació. Per desactivar l'extensió en mode d'incògnit, anul·leu la selecció de l'opció corresponent.</translation> <translation id="911206726377975832">També voleu suprimir les dades de navegació?</translation>
diff --git a/chrome/app/resources/google_chrome_strings_cs.xtb b/chrome/app/resources/google_chrome_strings_cs.xtb index 888bba3b..3bc2f24 100644 --- a/chrome/app/resources/google_chrome_strings_cs.xtb +++ b/chrome/app/resources/google_chrome_strings_cs.xtb
@@ -241,6 +241,7 @@ <translation id="8851136666856101339">hlavní</translation> <translation id="8862326446509486874">Nemáte práva nutná k provádění instalací na úrovni systému. Zkuste spustit instalační program jako správce.</translation> <translation id="9026991721384951619">Chrome OS vaše data nemohl synchronizovat, protože vaše přihlašovací údaje nejsou aktuální.</translation> +<translation id="9067395829937117663">Google Chrome vyžaduje systém Windows 7 nebo vyšší.</translation> <translation id="9102715433345326100">Tento soubor je škodlivý a prohlížeč Chrome jej zablokoval.</translation> <translation id="9107728822479888688"><ph name="BEGIN_BOLD" />Upozornění:<ph name="END_BOLD" /> Google Chrome nemůže rozšířením zabránit v zaznamenávání vaší historie procházení. Chcete-li toto rozšíření v anonymním režimu deaktivovat, zrušte výběr této možnosti.</translation> <translation id="911206726377975832">Vymazat také všechna data procházení?</translation>
diff --git a/chrome/app/resources/google_chrome_strings_da.xtb b/chrome/app/resources/google_chrome_strings_da.xtb index 2ee60e8..18bdf69 100644 --- a/chrome/app/resources/google_chrome_strings_da.xtb +++ b/chrome/app/resources/google_chrome_strings_da.xtb
@@ -233,6 +233,7 @@ <translation id="8851136666856101339">hovd</translation> <translation id="8862326446509486874">Du har ikke de nødvendige rettigheder til en installation på systemniveau. Prøv at køre installationsprogrammet igen som administrator.</translation> <translation id="9026991721384951619">Chrome OS kunne ikke synkronisere dine data, fordi loginoplysningerne til din konto er forældede.</translation> +<translation id="9067395829937117663">Google Chrome kræver Windows 7 eller nyere.</translation> <translation id="9102715433345326100">Denne fil er skadelig, og Chrome har blokeret den.</translation> <translation id="9107728822479888688"><ph name="BEGIN_BOLD" />Advarsel!<ph name="END_BOLD" /> Google Chrome kan ikke forhindre udvidelser i at registrere din browserhistorik. Fjern markeringen for at deaktivere denne udvidelse i inkognitotilstand.</translation> <translation id="911206726377975832">Slet også dine browserdata?</translation>
diff --git a/chrome/app/resources/google_chrome_strings_de.xtb b/chrome/app/resources/google_chrome_strings_de.xtb index 8f214f3..71b229b 100644 --- a/chrome/app/resources/google_chrome_strings_de.xtb +++ b/chrome/app/resources/google_chrome_strings_de.xtb
@@ -233,6 +233,7 @@ <translation id="8851136666856101339">main</translation> <translation id="8862326446509486874">Sie verfügen nicht über die erforderlichen Rechte für eine systemweite Installation. Starten Sie das Installationsprogramm als Administrator.</translation> <translation id="9026991721384951619">Chrome OS konnte Ihre Daten nicht synchronisieren, da die Anmeldedaten Ihres Kontos veraltet sind.</translation> +<translation id="9067395829937117663">Für Google Chrome ist Windows 7 oder höher erforderlich.</translation> <translation id="9102715433345326100">Diese Datei ist schädlich und wurde von Chrome blockiert.</translation> <translation id="9107728822479888688"><ph name="BEGIN_BOLD" />Achtung:<ph name="END_BOLD" /> Google Chrome kann nicht verhindern, dass Ihr Browserverlauf von Erweiterungen protokolliert wird. Deaktivieren Sie diese Erweiterung für den Inkognitomodus, indem Sie das entsprechende Kästchen deaktivieren.</translation> <translation id="911206726377975832">Auch die Browserdaten löschen?</translation>
diff --git a/chrome/app/resources/google_chrome_strings_el.xtb b/chrome/app/resources/google_chrome_strings_el.xtb index a0cbb6ae..856ee87 100644 --- a/chrome/app/resources/google_chrome_strings_el.xtb +++ b/chrome/app/resources/google_chrome_strings_el.xtb
@@ -237,6 +237,7 @@ <translation id="8851136666856101339">κύριο</translation> <translation id="8862326446509486874">Δεν έχετε τα απαραίτητα δικαιώματα για εγκατάσταση σε επίπεδο συστήματος. Δοκιμάστε να εκτελέσετε ξανά το πρόγραμμα εγκατάστασης ως Διαχειριστής.</translation> <translation id="9026991721384951619">Το Chrome OS δεν μπόρεσε να συγχρονίσει τα δεδομένα σας, επειδή τα στοιχεία σύνδεσης στο λογαριασμό σας δεν είναι ενημερωμένα.</translation> +<translation id="9067395829937117663">Το Google Chrome απαιτεί Windows 7 ή νεότερη έκδοση.</translation> <translation id="9102715433345326100">Αυτό το αρχείο είναι κακόβουλο και έχει αποκλειστεί από το Chrome.</translation> <translation id="9107728822479888688"><ph name="BEGIN_BOLD" />Προειδοποιήση:<ph name="END_BOLD" /> το Google Chrome δεν μπορεί να αποτρέψει τις επεκτάσεις από την καταγραφή του ιστορικού περιήγησης. Για την απενεργοποίηση αυτής της επέκτασης στη λειτουργία ανώνυμης περιήγησης, καταργήστε αυτήν την επιλογή.</translation> <translation id="911206726377975832">Να γίνει διαγραφή και των δεδομένων περιήγησης;</translation>
diff --git a/chrome/app/resources/google_chrome_strings_en-GB.xtb b/chrome/app/resources/google_chrome_strings_en-GB.xtb index dad7a01..325a1be 100644 --- a/chrome/app/resources/google_chrome_strings_en-GB.xtb +++ b/chrome/app/resources/google_chrome_strings_en-GB.xtb
@@ -233,6 +233,7 @@ <translation id="8556340503434111824">There's a new version of Google Chrome available and it's faster than ever.</translation> <translation id="8568392309447938879">You need to be signed in to Chrome to use apps. This allows Chrome to sync your apps, bookmarks, history, passwords and other settings across devices.</translation> <translation id="8614913330719544658">Google Chrome is unresponsive. Relaunch now?</translation> +<translation id="8667808506758191620">Your <ph name="DEVICE_TYPE" /> is up to date.</translation> <translation id="8669527147644353129">Google Chrome Helper</translation> <translation id="8679801911857917785">It also controls what page is shown when you start Chrome.</translation> <translation id="870251953148363156">Update &Google Chrome</translation> @@ -241,6 +242,7 @@ <translation id="8851136666856101339">main</translation> <translation id="8862326446509486874">You do not have appropriate rights for system-level installation. Try running the installer again as Administrator.</translation> <translation id="9026991721384951619">Chrome OS could not sync your data because your account sign-in details are out of date.</translation> +<translation id="9067395829937117663">Google Chrome requires Windows 7 or higher.</translation> <translation id="9102715433345326100">This file is malicious and Chrome has blocked it.</translation> <translation id="9107728822479888688"><ph name="BEGIN_BOLD" />Warning:<ph name="END_BOLD" /> Google Chrome cannot prevent extensions from recording your browsing history. To disable this extension in incognito mode, unselect this option.</translation> <translation id="911206726377975832">Also delete your browsing data?</translation>
diff --git a/chrome/app/resources/google_chrome_strings_es-419.xtb b/chrome/app/resources/google_chrome_strings_es-419.xtb index 76f350c..ec157c8 100644 --- a/chrome/app/resources/google_chrome_strings_es-419.xtb +++ b/chrome/app/resources/google_chrome_strings_es-419.xtb
@@ -233,6 +233,7 @@ <translation id="8851136666856101339">ppal</translation> <translation id="8862326446509486874">No tienes los derechos que se requieren para realizar la instalación al nivel del sistema. Intenta ejecutar el instalador nuevamente como Administrador.</translation> <translation id="9026991721384951619">El Sistema operativo Chrome no pudo sincronizar los datos porque la información de acceso de la cuenta está desactualizada.</translation> +<translation id="9067395829937117663">Para usar Google Chrome, se requiere Windows 7 o versiones superiores.</translation> <translation id="9102715433345326100">Chrome bloqueó este archivo porque es malicioso.</translation> <translation id="9107728822479888688"><ph name="BEGIN_BOLD" />Advertencia:<ph name="END_BOLD" /> Google Chrome no puede evitar que las extensiones registren tu historial de búsqueda. Para desactivar la extensión en modo incógnito, desactiva la casilla de esta opción.</translation> <translation id="911206726377975832">¿También eliminar datos de navegación?</translation>
diff --git a/chrome/app/resources/google_chrome_strings_es.xtb b/chrome/app/resources/google_chrome_strings_es.xtb index 32b0f471..7928d7b2 100644 --- a/chrome/app/resources/google_chrome_strings_es.xtb +++ b/chrome/app/resources/google_chrome_strings_es.xtb
@@ -241,6 +241,7 @@ <translation id="8851136666856101339">principal</translation> <translation id="8862326446509486874">No dispones de los derechos necesarios para la instalación en el sistema. Intenta ejecutar de nuevo el programa de instalación como administrador.</translation> <translation id="9026991721384951619">Chrome OS no ha podido sincronizar los datos porque la información de inicio de sesión de tu cuenta está obsoleta.</translation> +<translation id="9067395829937117663">Google Chrome requiere Windows 7 o una versión posterior.</translation> <translation id="9102715433345326100">Este archivo es malicioso y Chrome lo ha bloqueado.</translation> <translation id="9107728822479888688"><ph name="BEGIN_BOLD" />Advertencia:<ph name="END_BOLD" /> Google Chrome no puede evitar que las extensiones registren el historial de búsqueda. Para inhabilitar la ejecución de la extensión en modo incógnito, desactiva la casilla correspondiente a esta opción.</translation> <translation id="911206726377975832">¿Quieres borrar también los datos de navegación?</translation>
diff --git a/chrome/app/resources/google_chrome_strings_et.xtb b/chrome/app/resources/google_chrome_strings_et.xtb index b8f1d84..55929bd 100644 --- a/chrome/app/resources/google_chrome_strings_et.xtb +++ b/chrome/app/resources/google_chrome_strings_et.xtb
@@ -237,6 +237,7 @@ <translation id="8851136666856101339">pea</translation> <translation id="8862326446509486874">Teil ei ole süsteemi tasemel installimiseks sobivaid õigusi. Proovige installijat administraatorina uuesti käivitada.</translation> <translation id="9026991721384951619">Chrome OS ei saanud andmeid sünkroonida, sest teie konto sisselogimisandmed on aegunud.</translation> +<translation id="9067395829937117663">Google Chrome vajab operatsioonisüsteemi Windows 7 või uuemat versiooni.</translation> <translation id="9102715433345326100">See fail on pahatahtlik ja Chrome on selle blokeerinud.</translation> <translation id="9107728822479888688"><ph name="BEGIN_BOLD" />Hoiatus:<ph name="END_BOLD" /> Google Chrome ei saa takistada rakendusi teie sirvimisajalugu talletamast. Kui soovite laienduse inkognitorežiimis keelata, siis tühistage see valik.</translation> <translation id="911206726377975832">Kas kustutada ka teie sirvimisandmed?</translation>
diff --git a/chrome/app/resources/google_chrome_strings_fa.xtb b/chrome/app/resources/google_chrome_strings_fa.xtb index 8524828..cd93ed7d 100644 --- a/chrome/app/resources/google_chrome_strings_fa.xtb +++ b/chrome/app/resources/google_chrome_strings_fa.xtb
@@ -211,7 +211,7 @@ <translation id="8032142183999901390">پس از حذف حسابتان از Chrome، ممکن است لازم باشد برای اعمال تغییرات، برگههای بازتان را تازهسازی کنید.</translation> <translation id="8037887340639533879">هیچ مورد نصب شدهای از Google Chrome برای بهروزرسانی یافت نشد.</translation> <translation id="8129812357326543296">درباره &Google Chrome</translation> -<translation id="8183957050892517584">Chrome بهطور امن جزئیات شخصیتان را ذخیره خواهد کرد، بنابراین نیازی نیست دوباره آنها را تایپ کنید.</translation> +<translation id="8183957050892517584">Chrome بهطور امن جزئیات شخصیتان را ذخیره خواهد کرد تا نیازی نباشد دوباره آنها را تایپ کنید.</translation> <translation id="8205111949707227942">اختیاری: با ارسال خودکار آمار کاربرد و گزارشهای خرابی برنامه به Google، به پیشرفت سیستم عامل Chrome کمک کنید.</translation> <translation id="8227755444512189073">برای کار با پیوندهای <ph name="SCHEME" />، Google Chrome باید برنامه خارجی را راهاندازی کند. پیوند <ph name="PROTOLINK" /> مورد نیاز است.</translation> <translation id="8255190535488645436">Google Chrome درحال استفاده از دوربین و میکروفون شما است.</translation> @@ -234,6 +234,7 @@ <translation id="8851136666856101339">اصلی</translation> <translation id="8862326446509486874">شما حقوق لازم برای نصب در سطح سیستم را ندارید. دوباره بهعنوان سرپرست نصب کننده را اجرا کنید.</translation> <translation id="9026991721384951619">سیستمعامل Chrome قادر به همگامسازی دادههایتان نبود زیرا جزئیات ورود به سیستم حساب شما بهروز نیست.</translation> +<translation id="9067395829937117663">Google Chrome به Windows 7 یا بالاتر نیاز دارد.</translation> <translation id="9102715433345326100">این فایل خرابکار است و Chrome آن را مسدود کرده است.</translation> <translation id="9107728822479888688"><ph name="BEGIN_BOLD" />هشدار:<ph name="END_BOLD" /> Google Chrome نمیتواند مانع از ثبت سابقه مرور شما توسط افزونهها شود. برای غیرفعال کردن این افزونه در حالت ناشناس، این گزینه را از حالت انتخاب خارج کنید.</translation> <translation id="911206726377975832">دادههای مرور شما نیز حذف شود؟</translation>
diff --git a/chrome/app/resources/google_chrome_strings_fi.xtb b/chrome/app/resources/google_chrome_strings_fi.xtb index 3e4ce2a9..dd1be8c 100644 --- a/chrome/app/resources/google_chrome_strings_fi.xtb +++ b/chrome/app/resources/google_chrome_strings_fi.xtb
@@ -234,6 +234,7 @@ <translation id="8851136666856101339">pää</translation> <translation id="8862326446509486874">Sinulla ei ole käyttöoikeuksia järjestelmätason asennukseen. Kokeile asennusohjelman suorittamista uudelleen järjestelmänvalvojana.</translation> <translation id="9026991721384951619">Chrome-käyttöjärjestelmä ei voi synkronoida tietoja, sillä tilin kirjautumistiedot ovat vanhentuneet.</translation> +<translation id="9067395829937117663">Google Chrome vaatii Windows 7:n tai uudemman version.</translation> <translation id="9102715433345326100">Tämä tiedosto on haitallinen, ja Chrome on estänyt sen.</translation> <translation id="9107728822479888688"><ph name="BEGIN_BOLD" />Varoitus:<ph name="END_BOLD" /> Google Chrome ei voi estää laajennuksia tallentamasta selaushistoriaasi. Voit poistaa tämän laajennuksen käytöstä incognito-tilassa poistamalla tämän valinnan.</translation> <translation id="911206726377975832">Poistetaanko myös selailutiedot?</translation>
diff --git a/chrome/app/resources/google_chrome_strings_fil.xtb b/chrome/app/resources/google_chrome_strings_fil.xtb index 0966244..0f09eedd 100644 --- a/chrome/app/resources/google_chrome_strings_fil.xtb +++ b/chrome/app/resources/google_chrome_strings_fil.xtb
@@ -241,6 +241,7 @@ <translation id="8851136666856101339">main</translation> <translation id="8862326446509486874">Wala kang naaangkop na mga karapatan para sa pag-install sa antas ng system. Subukan muling patakbuhin ang installer bilang Administrator.</translation> <translation id="9026991721384951619">Hindi ma-sync ng Chrome OS ang iyong data dahil hindi napapanahon ang mga detalye sa pag-sign in sa iyong account.</translation> +<translation id="9067395829937117663">Kailangan ng Google Chrome ng Windows 7 o mas bago.</translation> <translation id="9102715433345326100">Nakakahamak ang file na ito, at na-block ito ng Chrome.</translation> <translation id="9107728822479888688"><ph name="BEGIN_BOLD" />Babala:<ph name="END_BOLD" /> Hindi mapipigilan ng Google Chrome ang pagtatala ng mga extension ng iyong history sa pagba-browse. Upang i-disable ang extension na ito sa incognito mode, alisin sa pagkakapili ang opsyong ito. </translation>
diff --git a/chrome/app/resources/google_chrome_strings_fr.xtb b/chrome/app/resources/google_chrome_strings_fr.xtb index 0c1f3626..cf49cce 100644 --- a/chrome/app/resources/google_chrome_strings_fr.xtb +++ b/chrome/app/resources/google_chrome_strings_fr.xtb
@@ -241,6 +241,7 @@ <translation id="8851136666856101339">principal</translation> <translation id="8862326446509486874">Vous ne disposez pas des droits requis pour installer la version système. Relancez l'installation en vous connectant comme administrateur.</translation> <translation id="9026991721384951619">Impossible de synchroniser vos données dans Chrome OS, car les informations de connexion de votre compte ne sont plus à jour.</translation> +<translation id="9067395829937117663">Vous devez disposer de Windows 7 ou version ultérieure pour utiliser Google Chrome.</translation> <translation id="9102715433345326100">Ce fichier est malveillant. Il a donc été bloqué dans Chrome.</translation> <translation id="9107728822479888688"><ph name="BEGIN_BOLD" />Avertissement<ph name="END_BOLD" /> : Google Chrome ne peut pas empêcher les extensions d'enregistrer votre historique de navigation. Pour désactiver cette extension en mode navigation privée, désélectionnez-la.</translation> <translation id="911206726377975832">Supprimer également vos données de navigation ?</translation>
diff --git a/chrome/app/resources/google_chrome_strings_gu.xtb b/chrome/app/resources/google_chrome_strings_gu.xtb index cc56635..a1a7b04 100644 --- a/chrome/app/resources/google_chrome_strings_gu.xtb +++ b/chrome/app/resources/google_chrome_strings_gu.xtb
@@ -241,6 +241,7 @@ <translation id="8851136666856101339">મુખ્ય</translation> <translation id="8862326446509486874">તમારી પાસે સિસ્ટમ-સ્તરનાં ઇન્સ્ટોલ માટે ઉચિત અધિકારો નથી. વ્યવસ્થાપક તરીકે ઇન્સ્ટોલરને ફરીથી ચલાવવનો પ્રયાસ કરો.</translation> <translation id="9026991721384951619">સાઇન ઇન વિગતો જૂની હોવાને કારણે Chrome OS તમારા ડેટાને સમન્વયિત કરી શક્યું નથી.</translation> +<translation id="9067395829937117663">Google Chrome માટે Windows 7 અથવા તે પછીનું સંસ્કરણ આવશ્યક છે.</translation> <translation id="9102715433345326100">આ ફાઇલ દૂષિત છે અને Chrome એ તેને અવરોધિત કરી છે.</translation> <translation id="9107728822479888688"><ph name="BEGIN_BOLD" />ચેતવણી:<ph name="END_BOLD" /> Google Chrome એક્સ્ટેંશનને તમારો બ્રાઉઝિંગ ઇતિહાસ રેકોર્ડ કરવાથી રોકી શકતું નથી. છૂપા મોડમાં આ એક્સ્ટેંશનને અક્ષમ કરવા માટે, આ વિકલ્પને પસંદ ન કરો.</translation> <translation id="911206726377975832">તમારો બ્રાઉઝિંગ ડેટા પણ કાઢી નાખીએ?</translation>
diff --git a/chrome/app/resources/google_chrome_strings_hi.xtb b/chrome/app/resources/google_chrome_strings_hi.xtb index efa0776..07e24287d 100644 --- a/chrome/app/resources/google_chrome_strings_hi.xtb +++ b/chrome/app/resources/google_chrome_strings_hi.xtb
@@ -235,6 +235,7 @@ <translation id="8851136666856101339">मुख्य</translation> <translation id="8862326446509486874">सिस्टम-स्तर स्थापना के लिए आपके पास उचित अधिकार नहीं हैं. इंस्टॉलर को व्यवस्थापक के रूप में फिर से चलाने का प्रयास करें.</translation> <translation id="9026991721384951619">Chrome OS आपका डेटा समन्वयित नहीं कर सका क्योंकि आपके खाता प्रवेश विवरण पुराने हो चुके हैं.</translation> +<translation id="9067395829937117663">Google Chrome के लिए Windows 7 या उसके बाद के वर्शन की आवश्यकता होती है.</translation> <translation id="9102715433345326100">यह फ़ाइल दुर्भावनापूर्ण है, और Chrome ने इसे अवरुद्ध कर दिया है.</translation> <translation id="9107728822479888688"><ph name="BEGIN_BOLD" />चेतावनी:<ph name="END_BOLD" /> Google Chrome एक्सटेंशन को आपका ब्राउज़िंग इतिहास रिकॉर्ड करने से रोक नहीं सकता. गुप्त मोड में यह एक्सटेंशन अक्षम करने के लिए, इस विकल्प को ना चनें.</translation> <translation id="911206726377975832">अपने ब्राउज़िंग डेटा भी हटाएं?</translation>
diff --git a/chrome/app/resources/google_chrome_strings_hr.xtb b/chrome/app/resources/google_chrome_strings_hr.xtb index 0676163..fe546c1d 100644 --- a/chrome/app/resources/google_chrome_strings_hr.xtb +++ b/chrome/app/resources/google_chrome_strings_hr.xtb
@@ -233,6 +233,7 @@ <translation id="8851136666856101339">glav</translation> <translation id="8862326446509486874">Nemate odgovarajuća prava za instaliranje na razini sustava. Pokušajte ponovno pokrenuti program za instalaciju kao administrator.</translation> <translation id="9026991721384951619">OS Chrome nije mogao sinkronizirati vaše podatke jer su vaši podaci za prijavu na račun zastarjeli.</translation> +<translation id="9067395829937117663">Google Chrome zahtijeva Windows 7 ili noviju verziju.</translation> <translation id="9102715433345326100">Datoteka je zlonamjerna i Chrome ju je blokirao.</translation> <translation id="9107728822479888688"><ph name="BEGIN_BOLD" />Upozorenje:<ph name="END_BOLD" /> Google Chrome ne može spriječiti proširenja da evidentiraju vašu povijest pregledavanja. Da biste onemogućili proširenje u anonimnom načinu, isključite tu opciju.</translation> <translation id="911206726377975832">Izbrisati i podatke o pregledavanju?</translation>
diff --git a/chrome/app/resources/google_chrome_strings_hu.xtb b/chrome/app/resources/google_chrome_strings_hu.xtb index 99a6328..105564c 100644 --- a/chrome/app/resources/google_chrome_strings_hu.xtb +++ b/chrome/app/resources/google_chrome_strings_hu.xtb
@@ -225,6 +225,7 @@ <translation id="8556340503434111824">Elérhető a Google Chrome új verziója, amely gyorsabb, mint ezelőtt bármikor.</translation> <translation id="8568392309447938879">Be kell jelentkeznie a Chrome-ba az alkalmazások használatához. Ez lehetővé teszi a Chrome számára, hogy szinkronizálja alkalmazásait, könyvjelzőit, előzményeit, jelszavait és egyéb beállításait a különböző eszközök között.</translation> <translation id="8614913330719544658">A Google Chrome nem válaszol. Újraindítja most?</translation> +<translation id="8667808506758191620"><ph name="DEVICE_TYPE" /> eszköze naprakész.</translation> <translation id="8669527147644353129">Google Chrome segéd</translation> <translation id="8679801911857917785">Továbbá azt is szabályozza, hogy melyik oldal jelenik meg a Chrome indításakor.</translation> <translation id="870251953148363156">A &Google Chrome frissítése</translation> @@ -233,6 +234,7 @@ <translation id="8851136666856101339">fő</translation> <translation id="8862326446509486874">Nincsenek meg a megfelelő jogai a rendszerszintű telepítéshez. Indítsa újra a telepítőt rendszergazdaként.</translation> <translation id="9026991721384951619">A Chrome OS nem tudta szinkronizálni az adatokat, mert a fiók bejelentkezési adatai elavultak.</translation> +<translation id="9067395829937117663">A Google Chrome futtatásához Windows 7 vagy újabb verzió szükséges.</translation> <translation id="9102715433345326100">Ez a fájl rosszindulatú, ezért a Chrome letiltotta.</translation> <translation id="9107728822479888688"><ph name="BEGIN_BOLD" />Figyelmeztetés:<ph name="END_BOLD" /> A Google Chrome nem tudja megakadályozni, hogy a bővítmények rögzítsék a böngészési előzményeit. A bővítmény inkognitómódban való használatának letiltásához törölje e lehetőség bejelölését.</translation> <translation id="911206726377975832">Törli a böngészési adatait is?</translation>
diff --git a/chrome/app/resources/google_chrome_strings_id.xtb b/chrome/app/resources/google_chrome_strings_id.xtb index 258a242f..ba35999a 100644 --- a/chrome/app/resources/google_chrome_strings_id.xtb +++ b/chrome/app/resources/google_chrome_strings_id.xtb
@@ -210,7 +210,7 @@ <translation id="8032142183999901390">Setelah membuang akun dari Chrome, Anda mungkin perlu memuat ulang tab terbuka untuk menerapkannya.</translation> <translation id="8037887340639533879">Tidak ditemukan pemasangan Google Chrome untuk diperbarui.</translation> <translation id="8129812357326543296">Tentang &Google Chrome</translation> -<translation id="8183957050892517584">Chrome akan meyimpan detail pribadi Anda secara aman sehingga Anda tidak perlu mengetiknya lagi.</translation> +<translation id="8183957050892517584">Chrome akan meyimpan informasi pribadi Anda dengan aman sehingga Anda tidak perlu mengetiknya lagi.</translation> <translation id="8205111949707227942">Opsional: Bantu kami membuat Chrome OS lebih baik dengan mengirim statistik penggunaan dan laporan kerusakan ke Google secara otomatis.</translation> <translation id="8227755444512189073">Google Chrome harus menjalankan aplikasi eksternal untuk menangani link <ph name="SCHEME" />. Link yang diminta adalah <ph name="PROTOLINK" />.</translation> <translation id="8255190535488645436">Google Chrome menggunakan kamera dan mikrofon Anda.</translation> @@ -233,6 +233,7 @@ <translation id="8851136666856101339">main</translation> <translation id="8862326446509486874">Anda tidak memiliki hak yang diperlukan untuk pemasangan tingkat sistem. Coba jalankan lagi pemasang saat masuk sebagai Administrator.</translation> <translation id="9026991721384951619">Chrome OS tidak dapat menyinkronkan data karena detail ID masuk akun Anda belum diperbarui.</translation> +<translation id="9067395829937117663">Google Chrome memerlukan Windows 7 atau lebih tinggi.</translation> <translation id="9102715433345326100">File ini berbahaya dan Chrome memblokirnya.</translation> <translation id="9107728822479888688"><ph name="BEGIN_BOLD" />Peringatan:<ph name="END_BOLD" /> Google Chrome tidak dapat mencegah ekstensi merekam riwayat penjelajahan Anda. Untuk menonaktifkan ekstensi ini dalam mode penyamaran, batalkan pilihan opsi ini.</translation> <translation id="911206726377975832">Hapus juga data rambanan Anda?</translation>
diff --git a/chrome/app/resources/google_chrome_strings_it.xtb b/chrome/app/resources/google_chrome_strings_it.xtb index f4916fe..298eef6 100644 --- a/chrome/app/resources/google_chrome_strings_it.xtb +++ b/chrome/app/resources/google_chrome_strings_it.xtb
@@ -233,6 +233,7 @@ <translation id="8851136666856101339">main</translation> <translation id="8862326446509486874">Non disponi dei diritti appropriati per l'installazione a livello di sistema. Prova a eseguire nuovamente il programma di installazione come Amministratore.</translation> <translation id="9026991721384951619">Impossibile sincronizzare i dati in Chrome OS perché i dati di accesso dell'account sono obsoleti.</translation> +<translation id="9067395829937117663">Google Chrome richiede Windows 7 o versioni successive.</translation> <translation id="9102715433345326100">Il file è dannoso ed è stato bloccato da Chrome.</translation> <translation id="9107728822479888688"><ph name="BEGIN_BOLD" />Avviso.<ph name="END_BOLD" /> Google Chrome non è in grado di impedire alle estensioni di registrare la tua cronologia di navigazione. Per disattivare questa estensione in modalità di navigazione in incognito, deseleziona questa opzione.</translation> <translation id="911206726377975832">Eliminare anche i tuoi dati di navigazione?</translation>
diff --git a/chrome/app/resources/google_chrome_strings_iw.xtb b/chrome/app/resources/google_chrome_strings_iw.xtb index a62bc52..76717d5d 100644 --- a/chrome/app/resources/google_chrome_strings_iw.xtb +++ b/chrome/app/resources/google_chrome_strings_iw.xtb
@@ -210,7 +210,7 @@ <translation id="8032142183999901390">לאחר הסרת החשבון שלך מ-Chrome, ייתכן שתידרש לטעון מחדש את הכרטיסיות הפתוחות שלך כדי שההסרה תיושם בפועל.</translation> <translation id="8037887340639533879">לא נמצאה התקנה של Google Chrome שיש לעדכן.</translation> <translation id="8129812357326543296">מידע על Google Chrome&</translation> -<translation id="8183957050892517584">Chrome יאחסן את הפרטים האישיים שלך באופן מאובטח כך שלא תידרש להקליד אותם שוב.</translation> +<translation id="8183957050892517584">Chrome יאחסן את הפרטים האישיים שלך באופן מאובטח כדי שלא תידרש להקליד אותם שוב.</translation> <translation id="8205111949707227942">אופציונלי: עזור לנו לשפר את Chrome OS על ידי שליחת נתוני שימוש ודוחות קריסה אל Google באופן אוטומטי.</translation> <translation id="8227755444512189073">Google Chrome חייב לבצע יישום חיצוני על מנת לנהל <ph name="SCHEME" /> קישורים הקישור המבוקש הוא <ph name="PROTOLINK" />.</translation> <translation id="8255190535488645436">Google Chrome משתמש במצלמה ובמיקרופון שלך.</translation> @@ -225,6 +225,7 @@ <translation id="8556340503434111824">גרסה חדשה של Google Chrome זמינה, והיא מהירה יותר מאי פעם.</translation> <translation id="8568392309447938879">עליך להיות מחובר ל-Chrome כדי להשתמש ביישומים. כך Chrome יכול לסנכרן את היישומים, הסימניות, ההיסטוריה, הסיסמאות והגדרות נוספות בין מכשירים שונים.</translation> <translation id="8614913330719544658">Google Chrome אינו מגיב. להפעיל מחדש עכשיו?</translation> +<translation id="8667808506758191620">ה-<ph name="DEVICE_TYPE" /> שלך מעודכן.</translation> <translation id="8669527147644353129">Google Chrome Helper</translation> <translation id="8679801911857917785">הגדרה זו גם קובעת איזה דף מוצג כשאתה מפעיל את Chrome.</translation> <translation id="870251953148363156">עדכן את Google Chrome&</translation> @@ -233,6 +234,7 @@ <translation id="8851136666856101339">main</translation> <translation id="8862326446509486874">אין לך זכויות שמתאימות להתקנה ברמת המערכת. נסה להפעיל שוב את המתקין כמנהל מערכת.</translation> <translation id="9026991721384951619">מערכת ההפעלה של Chrome לא הצליחה לסנכרן את הנתונים שלך מפני שפרטי הכניסה של חשבונך אינם מעודכנים.</translation> +<translation id="9067395829937117663">כדי להשתמש ב-Google Chrome יש צורך ב-Windows מגירסה 7 ואילך.</translation> <translation id="9102715433345326100">הקובץ הזה זדוני, ו-Chrome חסם אותו</translation> <translation id="9107728822479888688"><ph name="BEGIN_BOLD" />אזהרה:<ph name="END_BOLD" /> Google Chrome אינו יכול למנוע מתוספים לתעד את היסטוריית הגלישה שלך. כדי להשבית תוסף זה במצב גלישה פרטית, בטל אפשרות זו.</translation> <translation id="911206726377975832">למחוק גם את נתוני הגלישה שלך?</translation>
diff --git a/chrome/app/resources/google_chrome_strings_ja.xtb b/chrome/app/resources/google_chrome_strings_ja.xtb index 0b4957d..869548f 100644 --- a/chrome/app/resources/google_chrome_strings_ja.xtb +++ b/chrome/app/resources/google_chrome_strings_ja.xtb
@@ -233,6 +233,7 @@ <translation id="8851136666856101339">本文</translation> <translation id="8862326446509486874">権限が不十分なためシステムレベルのインストールができません。管理者権限でインストールしてください。</translation> <translation id="9026991721384951619">アカウントのログイン情報が最新ではないため、Chrome OS はデータを同期できませんでした。</translation> +<translation id="9067395829937117663">Google Chrome のご利用には Windows 7 以上が必要です。</translation> <translation id="9102715433345326100">不正なファイルです。Chrome はこのファイルをブロックしました。</translation> <translation id="9107728822479888688"><ph name="BEGIN_BOLD" />警告:<ph name="END_BOLD" /> 拡張機能による閲覧履歴の記録は Google Chrome で停止することができません。シークレット モードでこの拡張機能を無効にするには、このオプションの選択を解除してください。</translation> <translation id="911206726377975832">閲覧データも削除しますか?</translation>
diff --git a/chrome/app/resources/google_chrome_strings_kn.xtb b/chrome/app/resources/google_chrome_strings_kn.xtb index 83dd5c9..579cb76 100644 --- a/chrome/app/resources/google_chrome_strings_kn.xtb +++ b/chrome/app/resources/google_chrome_strings_kn.xtb
@@ -236,6 +236,7 @@ <translation id="8851136666856101339">ಮುಖ್ಯ</translation> <translation id="8862326446509486874">ಸಿಸ್ಟಂ ಮಟ್ಟದ ಸ್ಥಾಪನೆಗಾಗಿ ನೀವು ಸರಿಯಾದ ಹಕ್ಕುಗಳನ್ನು ಹೊಂದಿಲ್ಲ. ನಿರ್ವಾಹಕರಂತೆ ಮತ್ತೆ ಸ್ಥಾಪಕವನ್ನು ಚಲಿಸಲು ಪ್ರಯತ್ನಿಸಿ.</translation> <translation id="9026991721384951619">ನಿಮ್ಮ ಖಾತೆಯ ಸೈನ್ ಇನ್ ವಿವರಗಳು ಹಳೆಯದಾಗಿರುವ ಕಾರಣ ನಿಮ್ಮ ಡೇಟಾವನ್ನು ಸಿಂಕ್ ಮಾಡಲು Chrome OS ಗೆ ಸಾಧ್ಯವಾಗುತ್ತಿಲ್ಲ.</translation> +<translation id="9067395829937117663">Google Chrome ಗೆ Windows 7 ಅಥವಾ ಹೆಚ್ಚಿನ ಆವೃತ್ತಿಯ ಅಗತ್ಯವಿರುತ್ತದೆ.</translation> <translation id="9102715433345326100">ಈ ಫೈಲ್ ದೋಷಪೂರಿತವಾಗಿದೆ, ಮತ್ತು Chrome ಇದನ್ನು ನಿರ್ಬಂಧಿಸಿದೆ.</translation> <translation id="9107728822479888688"><ph name="BEGIN_BOLD" />ಎಚ್ಚರಿಕೆ:<ph name="END_BOLD" /> ನಿಮ್ಮ ಬ್ರೌಸಿಂಗ್ ಇತಿಹಾಸವನ್ನು ರೆಕಾರ್ಡ್ ಮಾಡುವುದರಿಂದ ವಿಸ್ತರಣೆಗಳನ್ನು Google Chrome ತಡೆಯುವುದಿಲ್ಲ. ಅಜ್ಞಾತ ಮೋಡ್ನಲ್ಲಿ ಈ ವಿಸ್ತರಣೆಯನ್ನು ನಿಷ್ಕ್ರಿಯಗೊಳಿಸಲು ಈ ಆಯ್ಕೆಯನ್ನು ರದ್ದುಗೊಳಿಸಿ.</translation> <translation id="911206726377975832">ನಿಮ್ಮ ಬ್ರೌಸಿಂಗ್ ಡೇಟಾವನ್ನು ಸಹ ಅಳಿಸುವುದೇ?</translation>
diff --git a/chrome/app/resources/google_chrome_strings_ko.xtb b/chrome/app/resources/google_chrome_strings_ko.xtb index 232186f..a5fdf07 100644 --- a/chrome/app/resources/google_chrome_strings_ko.xtb +++ b/chrome/app/resources/google_chrome_strings_ko.xtb
@@ -241,6 +241,7 @@ <translation id="8851136666856101339">main</translation> <translation id="8862326446509486874">시스템 수준의 설치 권한이 없습니다. 관리자 권한으로 설치 프로그램을 다시 실행해 보세요.</translation> <translation id="9026991721384951619">계정의 로그인 세부정보가 오래되어 Chrome OS에서 데이터를 동기화하지 못했습니다.</translation> +<translation id="9067395829937117663">Chrome은 Windows 7 이상에서 사용할 수 있습니다.</translation> <translation id="9102715433345326100">이 파일은 악성 파일이므로 Chrome에서 차단했습니다.</translation> <translation id="9107728822479888688"><ph name="BEGIN_BOLD" />경고:<ph name="END_BOLD" /> Chrome에서는 확장 프로그램에 인터넷 사용기록이 저장될 수 있습니다. 시크릿 모드에서 이 확장 프로그램을 사용 중지하려면 옵션을 선택 취소하세요.</translation> <translation id="911206726377975832">인터넷 사용정보도 삭제하시겠습니까?</translation>
diff --git a/chrome/app/resources/google_chrome_strings_lt.xtb b/chrome/app/resources/google_chrome_strings_lt.xtb index 31d1284d..c5ae532 100644 --- a/chrome/app/resources/google_chrome_strings_lt.xtb +++ b/chrome/app/resources/google_chrome_strings_lt.xtb
@@ -242,6 +242,7 @@ <translation id="8851136666856101339">main</translation> <translation id="8862326446509486874">Neturite reikiamų teisių sistemai įdiegti. Pamėginkite įdiegimo priemonę dar kartą paleisti kaip administratorius.</translation> <translation id="9026991721384951619">„Chrome“ OS negali sinchronizuoti duomenų, nes paskyros išsami prisijungimo informacija yra pasenusi.</translation> +<translation id="9067395829937117663">Kad būtų galima naudoti „Google Chrome“, reikalinga 7 ar naujesnės versijos „Windows“.</translation> <translation id="9102715433345326100">Šis failas yra kenkėjiškas, todėl „Chrome“ jį užblokavo.</translation> <translation id="9107728822479888688"><ph name="BEGIN_BOLD" />Įspėjimas:<ph name="END_BOLD" /> „Google Chrome“ negali neleisti plėtiniams įrašyti jūsų naršymo istorijos. Jei norite neleisti šio plėtinio inkognito režimu, panaikinkite šios parinkties pasirinkimą.</translation> <translation id="911206726377975832">Ar ištrinti naršymo duomenis?</translation>
diff --git a/chrome/app/resources/google_chrome_strings_lv.xtb b/chrome/app/resources/google_chrome_strings_lv.xtb index a5e713c..63f4c7b 100644 --- a/chrome/app/resources/google_chrome_strings_lv.xtb +++ b/chrome/app/resources/google_chrome_strings_lv.xtb
@@ -237,6 +237,7 @@ <translation id="8851136666856101339">galvenais</translation> <translation id="8862326446509486874">Jums nav vajadzīgo tiesību, lai instalētu sistēmas līmenī. Mēģiniet vēlreiz palaist instalēšanas programmu kā administrators.</translation> <translation id="9026991721384951619">Chrome OS nevarēja sinhronizēt jūsu datus, jo jūsu konta pierakstīšanās informācija ir novecojusi.</translation> +<translation id="9067395829937117663">Pārlūka Google Chrome izmantošanai nepieciešama operētājsistēma Windows 7 vai jaunāka versija.</translation> <translation id="9102715433345326100">Šis fails ir ļaunprātīgs, un Chrome to bloķēja.</translation> <translation id="9107728822479888688"><ph name="BEGIN_BOLD" />Brīdinājums!<ph name="END_BOLD" /> Google Chrome nevar novērst to, ka paplašinājumi ieraksta jūsu pārlūkošanas vēsturi. Lai atspējotu šo paplašinājumu inkognito režīmā, noņemiet atzīmi šai opcijai.</translation> <translation id="911206726377975832">Vai dzēst arī pārlūkošanas datus?</translation>
diff --git a/chrome/app/resources/google_chrome_strings_ml.xtb b/chrome/app/resources/google_chrome_strings_ml.xtb index 2651099..a77590fb 100644 --- a/chrome/app/resources/google_chrome_strings_ml.xtb +++ b/chrome/app/resources/google_chrome_strings_ml.xtb
@@ -241,6 +241,7 @@ <translation id="8851136666856101339">main</translation> <translation id="8862326446509486874">സിസ്റ്റം-ലെവല് ഇന്സ്റ്റാള് ചെയ്യുന്നതിന് നിങ്ങള്ക്ക് ഉചിതമായ അവകാശങ്ങളില്ല. അഡ്മിനിസ്ട്രേറ്ററായി ഇന്സ്റ്റാളര് പ്രവര്ത്തിപ്പിക്കാന് വീണ്ടും ശ്രമിക്കൂ.</translation> <translation id="9026991721384951619">നിങ്ങളുടെ അക്കൗണ്ടിന്റെ സൈൻ ഇൻ വിശദാംശങ്ങൾ കാലഹരണപ്പെട്ടതിനാൽ Chrome OS-ന് നിങ്ങളുടെ ഡാറ്റ സമന്വയിപ്പിക്കാനായില്ല.</translation> +<translation id="9067395829937117663">Google Chrome-ന് Windows 7 അല്ലെങ്കിൽ അതിനുശേഷമുള്ള പതിപ്പ് ആവശ്യമാണ്.</translation> <translation id="9102715433345326100">ഈ ഫയൽ ക്ഷുദ്രകരമായതിനാൽ Chrome അത് തടഞ്ഞു.</translation> <translation id="9107728822479888688"><ph name="BEGIN_BOLD" />മുന്നറിയിപ്പ്:<ph name="END_BOLD" /> വിപുലീകരണങ്ങളെ നിങ്ങളുടെ ബ്രൗസിംഗ് ചരിത്രം രേഖപ്പെടുത്തുന്നതിൽ നിന്നും തടയാൻ Google Chrome-ന് കഴിയില്ല. ആൾമാറാട്ട മോഡിൽ ഈ വിപുലീകരണത്തെ അപ്രാപ്തമാക്കുന്നതിന് , ഈ ഓപ്ഷൻ തിരഞ്ഞെടുത്തത് ഒഴിവാക്കുക.</translation> <translation id="911206726377975832">നിങ്ങളുടെ ബ്രൌസിംഗ് ഡാറ്റയും ഇതോടൊപ്പം ഇല്ലാതാക്കണോ?</translation>
diff --git a/chrome/app/resources/google_chrome_strings_mr.xtb b/chrome/app/resources/google_chrome_strings_mr.xtb index 61a0463a..552e983a 100644 --- a/chrome/app/resources/google_chrome_strings_mr.xtb +++ b/chrome/app/resources/google_chrome_strings_mr.xtb
@@ -239,6 +239,7 @@ <translation id="8851136666856101339">मुख्य</translation> <translation id="8862326446509486874">आपल्याकडे सिस्टम-स्तर स्थापनेसाठी उचित अधिकार नाहीत. प्रशासक म्हणून पुन्हा इन्स्टॉलर चालविण्याचा प्रयत्न करा.</translation> <translation id="9026991721384951619">आपले खाते साइन इन तपशील कालबाह्य झाल्यामुळे Chrome OS आपला डेटा संकालित करू शकले नाही.</translation> +<translation id="9067395829937117663">Google Chrome साठी Windows 7 किंवा त्यानंतरची आवृत्ती आवश्यक आहे.</translation> <translation id="9102715433345326100">ही फाईल दुर्भावनापूर्ण आहे आणि Chrome ने ती अवरोधित केली आहे.</translation> <translation id="9107728822479888688"><ph name="BEGIN_BOLD" />चेतावणी:<ph name="END_BOLD" /> Google Chrome आपला ब्राउझिंग इतिहास रेकॉर्ड करण्यापासून विस्तारांना प्रतिबंध करू शकत नाही. हा विस्तार गुप्त मोडमध्ये अक्षम करण्यासाठी, या पर्यायाची निवड रद्द करा.</translation> <translation id="911206726377975832">आपला ब्राउझिंग डेटा देखील हटवायचा?</translation>
diff --git a/chrome/app/resources/google_chrome_strings_ms.xtb b/chrome/app/resources/google_chrome_strings_ms.xtb index abe955b..ddba3b5 100644 --- a/chrome/app/resources/google_chrome_strings_ms.xtb +++ b/chrome/app/resources/google_chrome_strings_ms.xtb
@@ -225,6 +225,7 @@ <translation id="8556340503434111824">Terdapat versi baharu Google Chrome yang tersedia, dan ia lebih pantas daripada biasa.</translation> <translation id="8568392309447938879">Anda perlu melog masuk ke Chrome untuk menggunakan apl. Ini membenarkan Chrome menyegerakkan apl, penanda halaman, sejarah, kata laluan dan tetapan anda yang lain pada semua peranti.</translation> <translation id="8614913330719544658">Google Chrome tidak responsif. Lancarkan semula sekarang?</translation> +<translation id="8667808506758191620"><ph name="DEVICE_TYPE" /> anda sudah dikemas kini.</translation> <translation id="8669527147644353129">Pembantu Google Chrome</translation> <translation id="8679801911857917785">Sambungan turut mengawal halaman yang ditunjukkan apabila anda memulakan Chrome.</translation> <translation id="870251953148363156">Kemas kini &Google Chrome</translation> @@ -233,6 +234,7 @@ <translation id="8851136666856101339">utama</translation> <translation id="8862326446509486874">Anda tidak mempunyai hak wajar untuk pemasangan peringkat sistem. Cuba jalankan pemasang semula sebagai Pentadbir.</translation> <translation id="9026991721384951619">OS Chrome tidak dapat menyegerakkan data anda kerana butiran log masuk akaun anda sudah lapuk.</translation> +<translation id="9067395829937117663">Google Chrome memerlukan Windows 7 atau lebih tinggi.</translation> <translation id="9102715433345326100">Fail ini bersifat hasad dan Chrome telah menyekatnya.</translation> <translation id="9107728822479888688"><ph name="BEGIN_BOLD" />Amaran:<ph name="END_BOLD" /> Google Chrome tidak dapat menghalang sambungan daripada merekodkan sejarah penyemakan imbas anda. Untuk melumpuhkan sambungan ini dalam mod inkognito, nyahpilih pilihan ini.</translation> <translation id="911206726377975832">Padamkan juga data menyemak imbas anda?</translation>
diff --git a/chrome/app/resources/google_chrome_strings_nl.xtb b/chrome/app/resources/google_chrome_strings_nl.xtb index bb60a41d..25beced 100644 --- a/chrome/app/resources/google_chrome_strings_nl.xtb +++ b/chrome/app/resources/google_chrome_strings_nl.xtb
@@ -239,6 +239,7 @@ <translation id="8851136666856101339">hoofd</translation> <translation id="8862326446509486874">Je hebt geen rechten om op systeemniveau te installeren. Meld je aan als beheerder en voer het installatieprogramma opnieuw uit.</translation> <translation id="9026991721384951619">Chrome OS kan je gegevens niet synchroniseren omdat de inloggegevens voor je account zijn verouderd.</translation> +<translation id="9067395829937117663">Voor Google Chrome is Windows 7 of hoger vereist.</translation> <translation id="9102715433345326100">Dit bestand is schadelijk en is daarom door Chrome geblokkeerd.</translation> <translation id="9107728822479888688"><ph name="BEGIN_BOLD" />Waarschuwing:<ph name="END_BOLD" /> Google Chrome kan niet voorkomen dat extensies je browsegeschiedenis registreren. Als je deze extensie in de incognitomodus wilt uitschakelen, verwijder je het vinkje bij deze optie.</translation> <translation id="911206726377975832">Ook browsegegevens wissen?</translation>
diff --git a/chrome/app/resources/google_chrome_strings_no.xtb b/chrome/app/resources/google_chrome_strings_no.xtb index a7dc675..1fa63fe 100644 --- a/chrome/app/resources/google_chrome_strings_no.xtb +++ b/chrome/app/resources/google_chrome_strings_no.xtb
@@ -233,6 +233,7 @@ <translation id="8851136666856101339">main</translation> <translation id="8862326446509486874">Du har ikke de nødvendige rettighetene for å installere på systemnivå. Prøv å kjøre installasjonsprogrammet som administrator.</translation> <translation id="9026991721384951619">Chrome OS kunne ikke synkronisere dataene fordi påloggingsopplysningene dine er foreldede.</translation> +<translation id="9067395829937117663">Google Chrome krever Windows 7 eller nyere.</translation> <translation id="9102715433345326100">Denne filen er skadelig, og Chrome har blokkert den.</translation> <translation id="9107728822479888688"><ph name="BEGIN_BOLD" />Advarsel:<ph name="END_BOLD" /> Google Chrome kan ikke forhindre utvidelser fra å lagre nettleserloggen din. Du kan deaktivere denne utvidelsen i inkognitomodus ved å oppheve merkingen av dette alternativet.</translation> <translation id="911206726377975832">Vil du slette all nettleserdata også?</translation>
diff --git a/chrome/app/resources/google_chrome_strings_pl.xtb b/chrome/app/resources/google_chrome_strings_pl.xtb index 8161e75..42ced933c 100644 --- a/chrome/app/resources/google_chrome_strings_pl.xtb +++ b/chrome/app/resources/google_chrome_strings_pl.xtb
@@ -234,6 +234,7 @@ <translation id="8851136666856101339">główny</translation> <translation id="8862326446509486874">Nie masz odpowiednich uprawnień do przeprowadzenia instalacji na poziomie systemowym. Uruchom ponownie program instalacyjny jako administrator.</translation> <translation id="9026991721384951619">Google Chrome nie może zsynchronizować danych, ponieważ dane logowania na Twoje konto są nieaktualne.</translation> +<translation id="9067395829937117663">Google Chrome wymaga systemu Windows 7 lub nowszego.</translation> <translation id="9102715433345326100">Ten plik jest złośliwy i został zablokowany przez Chrome.</translation> <translation id="9107728822479888688"><ph name="BEGIN_BOLD" />Uwaga:<ph name="END_BOLD" /> Google Chrome nie może uniemożliwić rozszerzeniom zapisywania historii przeglądania. Aby wyłączyć to rozszerzenie w trybie incognito, usuń zaznaczenie tej opcji.</translation> <translation id="911206726377975832">Czy usunąć także dane przeglądania?</translation>
diff --git a/chrome/app/resources/google_chrome_strings_pt-BR.xtb b/chrome/app/resources/google_chrome_strings_pt-BR.xtb index 67349db..f37d3b0c 100644 --- a/chrome/app/resources/google_chrome_strings_pt-BR.xtb +++ b/chrome/app/resources/google_chrome_strings_pt-BR.xtb
@@ -226,6 +226,7 @@ <translation id="8556340503434111824">Há uma nova versão ainda mais rápida do Google Chrome disponível.</translation> <translation id="8568392309447938879">É necessário fazer login no Google Chrome para usar aplicativos. Isso permite que o Chrome sincronize seus aplicativos, favoritos, histórico, senhas e outras configurações entre os dispositivos.</translation> <translation id="8614913330719544658">O Google Chrome não responde. Reiniciar agora?</translation> +<translation id="8667808506758191620">Seu dispositivo <ph name="DEVICE_TYPE" /> está atualizado.</translation> <translation id="8669527147644353129">Auxiliar do Google Chrome</translation> <translation id="8679801911857917785">Controla também qual página deve ser exibida quando você inicia o Chrome.</translation> <translation id="870251953148363156">Atualizar o Google Chrome</translation> @@ -234,6 +235,7 @@ <translation id="8851136666856101339">main</translation> <translation id="8862326446509486874">Você não tem os direitos adequados para instalação no nível do sistema. Tente executar o instalador novamente como administrador.</translation> <translation id="9026991721384951619">O Chrome OS não pôde sincronizar seus dados porque os detalhes de login da sua conta estão desatualizados.</translation> +<translation id="9067395829937117663">O Google Chrome requer o Windows 7 ou versão superior.</translation> <translation id="9102715433345326100">Este arquivo é malicioso e foi bloqueado pelo Google Chrome.</translation> <translation id="9107728822479888688"><ph name="BEGIN_BOLD" />Aviso:<ph name="END_BOLD" /> O Google Chrome não impede que as extensões gravem seu histórico de navegação. Para desativar esta extensão no modo anônimo, desmarque esta opção.</translation> <translation id="911206726377975832">Excluir também dados de navegação?</translation>
diff --git a/chrome/app/resources/google_chrome_strings_pt-PT.xtb b/chrome/app/resources/google_chrome_strings_pt-PT.xtb index 57f0d3f..18ed6fb 100644 --- a/chrome/app/resources/google_chrome_strings_pt-PT.xtb +++ b/chrome/app/resources/google_chrome_strings_pt-PT.xtb
@@ -225,6 +225,7 @@ <translation id="8556340503434111824">Está disponível uma nova versão do Google Chrome, mais rápida do que nunca.</translation> <translation id="8568392309447938879">Tem de ter sessão iniciada no Chrome para utilizar aplicações. Deste modo, o Chrome pode sincronizar as aplicações, os marcadores, o histórico, as palavras-passe e outras definições entre dispositivos.</translation> <translation id="8614913330719544658">O Google Chrome não responde. Reiniciar agora?</translation> +<translation id="8667808506758191620">O seu <ph name="DEVICE_TYPE" /> está atualizado.</translation> <translation id="8669527147644353129">Ajudante do Google Chrome</translation> <translation id="8679801911857917785">Também controla a página apresentada quando inicia o Chrome.</translation> <translation id="870251953148363156">Atualizar o &Google Chrome</translation> @@ -233,6 +234,7 @@ <translation id="8851136666856101339">main</translation> <translation id="8862326446509486874">Não tem os direitos adequados para uma instalação ao nível do sistema. Tente executar o programa de instalação novamente como Administrador.</translation> <translation id="9026991721384951619">O SO Chrome não conseguiu sincronizar os dados porque os detalhes de início de sessão da sua conta estão desatualizados.</translation> +<translation id="9067395829937117663">O Google Chrome requer o Windows 7 ou superior.</translation> <translation id="9102715433345326100">Este ficheiro é malicioso e o Chrome bloqueou-o.</translation> <translation id="9107728822479888688"><ph name="BEGIN_BOLD" />Aviso:<ph name="END_BOLD" /> o Google Chrome não consegue impedir que as extensões gravem o seu histórico de navegação. Para desativar esta extensão no modo de navegação anónima, desmarque esta opção.</translation> <translation id="911206726377975832">Eliminar também os seus dados de navegação?</translation>
diff --git a/chrome/app/resources/google_chrome_strings_ro.xtb b/chrome/app/resources/google_chrome_strings_ro.xtb index 71cff1d..001d06d0 100644 --- a/chrome/app/resources/google_chrome_strings_ro.xtb +++ b/chrome/app/resources/google_chrome_strings_ro.xtb
@@ -233,6 +233,7 @@ <translation id="8851136666856101339">principal</translation> <translation id="8862326446509486874">Nu ai drepturile adecvate pentru instalarea la nivel de sistem. Încearcă să rulezi din nou programul de instalare ca Administrator.</translation> <translation id="9026991721384951619">Sistemul de operare Chrome nu a putut sincroniza datele, deoarece detaliile de conectare pentru contul dvs. nu sunt actualizate.</translation> +<translation id="9067395829937117663">Google Chrome necesită Windows 7 sau o versiune ulterioară.</translation> <translation id="9102715433345326100">Acest fișier este rău-intenționat și a fost blocat de Chrome.</translation> <translation id="9107728822479888688"><ph name="BEGIN_BOLD" />Avertisment:<ph name="END_BOLD" /> Google Chrome nu poate împiedica extensiile să înregistreze istoricul navigării. Pentru a dezactiva această extensie în modul incognito, debifează această opțiune.</translation> <translation id="911206726377975832">Ștergi și datele de navigare?</translation>
diff --git a/chrome/app/resources/google_chrome_strings_ru.xtb b/chrome/app/resources/google_chrome_strings_ru.xtb index 70fad62b..a28fa44 100644 --- a/chrome/app/resources/google_chrome_strings_ru.xtb +++ b/chrome/app/resources/google_chrome_strings_ru.xtb
@@ -225,6 +225,7 @@ <translation id="8556340503434111824">Доступна новая версия Google Chrome, которая стала еще быстрее.</translation> <translation id="8568392309447938879">Для работы с приложениями необходимо выполнить вход в Chrome. Это обеспечит синхронизацию приложений, закладок, истории, паролей и настроек, сохраненных на всех ваших устройствах.</translation> <translation id="8614913330719544658">Google Chrome не отвечает. Перезапустить сейчас?</translation> +<translation id="8667808506758191620">На устройстве <ph name="DEVICE_TYPE" /> используется последняя версия Chromium OS.</translation> <translation id="8669527147644353129">Google Chrome Helper</translation> <translation id="8679801911857917785">Кроме того, расширение изменило стартовую страницу Chrome.</translation> <translation id="870251953148363156">Обновить &Google Chrome</translation> @@ -233,6 +234,7 @@ <translation id="8851136666856101339">main</translation> <translation id="8862326446509486874">У вас нет прав, необходимых для установки на системном уровне. Запустите программу установки еще раз в качестве администратора.</translation> <translation id="9026991721384951619">Не удалось выполнить синхронизацию, так как учетные данные устарели.</translation> +<translation id="9067395829937117663">Для работы Google Chrome необходима ОС Windows 7 или более поздней версии.</translation> <translation id="9102715433345326100">Chrome заблокировал этот файл как вредоносный.</translation> <translation id="9107728822479888688"><ph name="BEGIN_BOLD" />Внимание!<ph name="END_BOLD" /> Google Chrome не может запретить расширениям записывать историю браузера. Чтобы отключить это расширение в режиме инкогнито, снимите этот флажок.</translation> <translation id="911206726377975832">Также удалить данные о работе в браузере?</translation>
diff --git a/chrome/app/resources/google_chrome_strings_sk.xtb b/chrome/app/resources/google_chrome_strings_sk.xtb index 9e162b463..673fbc8 100644 --- a/chrome/app/resources/google_chrome_strings_sk.xtb +++ b/chrome/app/resources/google_chrome_strings_sk.xtb
@@ -231,6 +231,7 @@ <translation id="8556340503434111824">K dispozícii je nová verzia prehliadača Google Chrome, ktorá je rýchlejšia ako kedykoľvek predtým.</translation> <translation id="8568392309447938879">Aplikácie môžete používať až po prihlásení do prehliadača Chrome. Prehliadaču Chrome tým umožníte synchronizovať vaše aplikácie, záložky, históriu, heslá a ďalšie nastavenia na všetkých zariadeniach.</translation> <translation id="8614913330719544658">Google Chrome nereaguje. Chcete ho spustiť znova?</translation> +<translation id="8667808506758191620">Vaše zariadenie <ph name="DEVICE_TYPE" /> je aktuálne.</translation> <translation id="8669527147644353129">Google Chrome Helper</translation> <translation id="8679801911857917785">Tiež určuje, ktorá stránka sa zobrazí pri spustení prehliadača Chrome.</translation> <translation id="870251953148363156">Aktualizácia prehliadača &Google Chrome</translation> @@ -239,6 +240,7 @@ <translation id="8851136666856101339">hlavné</translation> <translation id="8862326446509486874">Nemáte potrebné práva na inštaláciu na úrovni systému. Skúste inštalátor spustiť znova ako správca.</translation> <translation id="9026991721384951619">Systému OS Chrome sa nepodarilo synchronizovať vaše údaje, pretože vaše prihlasovacie údaje účtu sú zastarané.</translation> +<translation id="9067395829937117663">Google Chrome vyžaduje systém Windows 7 alebo vyšší.</translation> <translation id="9102715433345326100">Tento súbor je škodlivý, a preto ho prehliadač Chrome zablokoval.</translation> <translation id="9107728822479888688"><ph name="BEGIN_BOLD" />Upozornenie:<ph name="END_BOLD" /> Prehliadač Google Chrome nemôže zabrániť rozšíreniam v zaznamenávaní vašej histórie prehliadania. Ak chcete toto rozšírenie v režime inkognito zakázať, zrušte výber tejto možnosti.</translation> <translation id="911206726377975832">Chcete tiež odstrániť svoje údaje prehliadania?</translation>
diff --git a/chrome/app/resources/google_chrome_strings_sl.xtb b/chrome/app/resources/google_chrome_strings_sl.xtb index e951374..8d57800 100644 --- a/chrome/app/resources/google_chrome_strings_sl.xtb +++ b/chrome/app/resources/google_chrome_strings_sl.xtb
@@ -241,6 +241,7 @@ <translation id="8851136666856101339">glavn</translation> <translation id="8862326446509486874">Nimate ustreznih pravic za namestitev na ravni sistema. Poskusite znova zagnati namestitveni program kot skrbnik.</translation> <translation id="9026991721384951619">Chrome OS ni mogel sinhronizirati podatkov, ker so podatki za prijavo v račun zastareli.</translation> +<translation id="9067395829937117663">Google Chrome zahteva operacijski sistem Windows 7 ali novejši.</translation> <translation id="9102715433345326100">Ta datoteka je zlonamerna, zato jo je Chrome blokiral.</translation> <translation id="9107728822479888688"><ph name="BEGIN_BOLD" />Opozorilo:<ph name="END_BOLD" /> Google Chrome razširitvam ne more preprečiti beleženja zgodovine brskanja. Če želite onemogočiti to razširitev v načinu brez beleženja zgodovine, počistite to možnost.</translation> <translation id="911206726377975832">Ali želite izbrisati tudi podatke brskanja?</translation>
diff --git a/chrome/app/resources/google_chrome_strings_sr.xtb b/chrome/app/resources/google_chrome_strings_sr.xtb index 76a39d7..589ebde 100644 --- a/chrome/app/resources/google_chrome_strings_sr.xtb +++ b/chrome/app/resources/google_chrome_strings_sr.xtb
@@ -218,7 +218,7 @@ <translation id="8032142183999901390">Када уклоните налог из Chrome-а, можда ћете морати поново да учитате отворене картице да би то ступило на снагу.</translation> <translation id="8037887340639533879">Није пронађена ниједна инсталација Google Chrome-а за ажурирање.</translation> <translation id="8129812357326543296">О &Google Chrome-у</translation> -<translation id="8183957050892517584">Chrome ће безбедно складиштити личне податке да не бисте морали да их поново уносите.</translation> +<translation id="8183957050892517584">Chrome ће безбедно складиштити личне податке да не бисте морали поново да их уносите.</translation> <translation id="8205111949707227942">Опционално: Помозите да побољшамо Chrome ОС аутоматским слањем статистике о коришћењу и извештаја о отказивању Google-у.</translation> <translation id="8227755444512189073">Google Chrome мора да покрене спољну апликацију за управљање <ph name="SCHEME" /> везама. Тражена веза је <ph name="PROTOLINK" />.</translation> <translation id="8255190535488645436">Google Chrome користи камеру и микрофон.</translation> @@ -241,6 +241,7 @@ <translation id="8851136666856101339">main</translation> <translation id="8862326446509486874">Немате одговарајућа права за инсталацију на нивоу система. Покушајте поново да покренете програм за инсталацију, овога пута као администратор.</translation> <translation id="9026991721384951619">Chrome ОС не може да синхронизује податке зато што су подаци за пријављивање на налог застарели.</translation> +<translation id="9067395829937117663">За Google Chrome је потребан Windows 7 или новија верзија.</translation> <translation id="9102715433345326100">Ова датотека је злонамерна, па ју је Chrome блокирао.</translation> <translation id="9107728822479888688"><ph name="BEGIN_BOLD" />Упозорење:<ph name="END_BOLD" /> Google Chrome не може да спречи додатке да снимају историју прегледања. Да бисте онемогућили овај додатак у режиму без архивирања, опозовите избор ове опције.</translation> <translation id="911206726377975832">Желите ли да избришете и податке прегледања?</translation>
diff --git a/chrome/app/resources/google_chrome_strings_sv.xtb b/chrome/app/resources/google_chrome_strings_sv.xtb index 06b0b92..8404f55 100644 --- a/chrome/app/resources/google_chrome_strings_sv.xtb +++ b/chrome/app/resources/google_chrome_strings_sv.xtb
@@ -241,6 +241,7 @@ <translation id="8851136666856101339">huvud</translation> <translation id="8862326446509486874">Du har inte behörighet att göra en installation på systemnivå. Försök köra installationsprogrammet igen som administratör.</translation> <translation id="9026991721384951619">Det gick inte att synkronisera data med Chrome OS eftersom inloggningsuppgifterna för kontot är inaktuella.</translation> +<translation id="9067395829937117663">För Google Chrome krävs Windows 7 eller senare.</translation> <translation id="9102715433345326100">Filen är skadlig och har blockerats av Chrome.</translation> <translation id="9107728822479888688"><ph name="BEGIN_BOLD" />Varning!<ph name="END_BOLD" /> Google Chrome kan inte förhindra tillägg från att registrera din webbhistorik. Om du vill inaktivera det här tillägget i inkognitoläge avmarkerar du detta tillval.</translation> <translation id="911206726377975832">Vill du även ta bort din webbinformation?</translation>
diff --git a/chrome/app/resources/google_chrome_strings_sw.xtb b/chrome/app/resources/google_chrome_strings_sw.xtb index 66189c4..4751c3f7 100644 --- a/chrome/app/resources/google_chrome_strings_sw.xtb +++ b/chrome/app/resources/google_chrome_strings_sw.xtb
@@ -233,6 +233,7 @@ <translation id="8556340503434111824">Kuna toleo jipya linalopatikana la Google Chrome, na ni la kasi kuliko la awali.</translation> <translation id="8568392309447938879">Unahitajika kuingia katika akaunti ya Chrome ili utumie programu hizi. Hii huruhusu Chrome kusawazisha programu zako, alamisho, historia, manenosiri na mipangilio mingine katika vifaa vyote.</translation> <translation id="8614913330719544658">Google Chrome imelemazwa. Izindue upya sasa?</translation> +<translation id="8667808506758191620">Kifaa chako cha <ph name="DEVICE_TYPE" /> kimesasishwa.</translation> <translation id="8669527147644353129">Msaidizi wa Google Chrome</translation> <translation id="8679801911857917785">Pia inadhibiti ukurasa unaoonyeshwa unapoanzisha Chrome.</translation> <translation id="870251953148363156">Sasisha &Google Chrome</translation> @@ -241,6 +242,7 @@ <translation id="8851136666856101339">kuu</translation> <translation id="8862326446509486874">Huna haki zifaazo ili kufanya usakinishaji wa kiwango cha mfumo. Jaribu kutumia kisakinishi kama msimamiaji kompyuta.</translation> <translation id="9026991721384951619">Mfumo wa Uendeshaji wa Chrome haukuweza kusawazisha data yako kwa sababu maelezo yako ya kuingia katika akaunti yanahitaji kusasishwa.</translation> +<translation id="9067395829937117663">Google Chrome inahitaji Windows 7 au toleo jipya zaidi.</translation> <translation id="9102715433345326100">Faili hii ni hasidi, na Chrome imeizuia.</translation> <translation id="9107728822479888688"><ph name="BEGIN_BOLD" />Onyo:<ph name="END_BOLD" /> Google Chrome haiwezi kuzuia viendelezi kurekodi historia yako ya utafutaji. Ili kuzima kiendelezi hiki katika hali fiche, acha kuchagua hiari hii.</translation> <translation id="911206726377975832">Futa historia yako ya kuvinjari pia?</translation>
diff --git a/chrome/app/resources/google_chrome_strings_ta.xtb b/chrome/app/resources/google_chrome_strings_ta.xtb index 5578282..509197f1 100644 --- a/chrome/app/resources/google_chrome_strings_ta.xtb +++ b/chrome/app/resources/google_chrome_strings_ta.xtb
@@ -233,6 +233,7 @@ <translation id="8851136666856101339">முதன்மை</translation> <translation id="8862326446509486874">கணினி-சார்ந்த நிறுவலுக்கான முறையான உரிமைகள் உங்களிடம் இல்லை. அதனால் நிர்வாகியாக மீண்டும் நிறுவலை இயக்க முயற்சி செய்க.</translation> <translation id="9026991721384951619">உங்கள் கணக்கின் உள்நுழைவு விவரங்கள் காலாவதியாகிவிட்டதால், உங்கள் தரவை Chrome OS ஆல் ஒத்திசைக்க முடியவில்லை.</translation> +<translation id="9067395829937117663">Windows 7 அல்லது அதற்குப் பிந்தைய பதிப்புகளில் மட்டுமே Google Chrome இயங்கும்.</translation> <translation id="9102715433345326100">இது தீங்கிழைக்கும் கோப்பு , இதை Chrome தடுத்துள்ளது.</translation> <translation id="9107728822479888688"><ph name="BEGIN_BOLD" />எச்சரிக்கை:<ph name="END_BOLD" /> நீட்டிப்புகள் உங்கள் உலாவல் வரலாற்றைப் பதிவுசெய்வதை Google Chrome ஆல் தடுக்க முடியவில்லை. மறைநிலைப் பயன்முறையில் இந்த நீட்டிப்பை முடக்க, இந்த விருப்பத்தைத் தேர்வுநீக்கம் செய்க.</translation> <translation id="911206726377975832">உங்கள் உலாவுதல் தரவையும் நீக்க வேண்டுமா?</translation>
diff --git a/chrome/app/resources/google_chrome_strings_te.xtb b/chrome/app/resources/google_chrome_strings_te.xtb index ce7fc33..683ad5f 100644 --- a/chrome/app/resources/google_chrome_strings_te.xtb +++ b/chrome/app/resources/google_chrome_strings_te.xtb
@@ -233,6 +233,7 @@ <translation id="8851136666856101339">main</translation> <translation id="8862326446509486874">సిస్టమ్-స్థాయిలో ఇన్స్టాల్ చెయ్యడానికి మీకు సరైన హక్కులు లేవు. నిర్వాహకుడి లాగ ఇన్స్టాలర్ను మళ్ళీ రన్ చెయ్యడానికి ప్రయత్నించండి.</translation> <translation id="9026991721384951619">మీ ఖాతా సైన్-ఇన్ వివరాల గడువు ముగిసినందున Chrome OS మీ డేటాను సమకాలీకరించలేకపోయింది.</translation> +<translation id="9067395829937117663">Google Chromeకి Windows 7 లేదా అంతకంటే ఆధునికమైనది ఉండటం ఆవశ్యకం.</translation> <translation id="9102715433345326100">ఈ ఫైల్ హానికరమైనది మరియు Chrome దీన్ని బ్లాక్ చేసింది.</translation> <translation id="9107728822479888688"><ph name="BEGIN_BOLD" />హెచ్చరిక:<ph name="END_BOLD" /> Google Chrome మీ బ్రౌజింగ్ చరిత్రను రికార్డ్ చేయకుండా పొడిగింపుని నిరోధించలేదు. ఈ పొడిగింపుని అజ్ఞాత మోడ్లో ఆపివేయడానికి, ఈ ఎంపికను రద్దు చేయండి.</translation> <translation id="911206726377975832">మీ బ్రౌజింగ్ డేటాని కూడా తొలగించాలా?</translation>
diff --git a/chrome/app/resources/google_chrome_strings_th.xtb b/chrome/app/resources/google_chrome_strings_th.xtb index c5b5b19..86e49303 100644 --- a/chrome/app/resources/google_chrome_strings_th.xtb +++ b/chrome/app/resources/google_chrome_strings_th.xtb
@@ -234,6 +234,7 @@ <translation id="8851136666856101339">หลัก</translation> <translation id="8862326446509486874">คุณไม่มีสิทธิ์ในการติดตั้งระดับระบบ ทดลองใช้งานโปรแกรมติดตั้งอีกครั้งโดยกำหนดให้เป็นผู้ดูแลระบบ</translation> <translation id="9026991721384951619">Chrome OS ไม่สามารถซิงค์ข้อมูลของคุณเนื่องจากรายละเอียดการลงชื่อเข้าใช้บัญชีของคุณล้าสมัย</translation> +<translation id="9067395829937117663">Google Chrome ต้องใช้ Windows 7 ขึ้นไป</translation> <translation id="9102715433345326100">ไฟล์นี้เป็นอันตรายและ Chrome ได้บล็อกไฟล์ดังกล่าวไว้</translation> <translation id="9107728822479888688"><ph name="BEGIN_BOLD" />คำเตือน:<ph name="END_BOLD" /> Google Chrome ไม่สามารถป้องกันส่วนขยายจากการบันทึกประวัติการเรียกดู หากต้องการปิดใช้งานส่วนขยายนี้ในโหมดไม่ระบุตัวตน ให้ยกเลิกการเลือกตัวเลือกนี้</translation> <translation id="911206726377975832">ลบข้อมูลการท่องเว็บด้วยหรือไม่</translation>
diff --git a/chrome/app/resources/google_chrome_strings_tr.xtb b/chrome/app/resources/google_chrome_strings_tr.xtb index 0cdd200..650b3b13 100644 --- a/chrome/app/resources/google_chrome_strings_tr.xtb +++ b/chrome/app/resources/google_chrome_strings_tr.xtb
@@ -235,6 +235,7 @@ <translation id="8851136666856101339">main</translation> <translation id="8862326446509486874">Sistem düzeyinde yükleme için gerekli haklara sahip değilsiniz. Yükleyiciyi Yönetici olarak tekrar çalıştırmayı deneyin.</translation> <translation id="9026991721384951619">Hesap oturum açma ayrıntılarınız güncel olmadığından Chrome OS, verilerinizi senkronize edemedi.</translation> +<translation id="9067395829937117663">Google Chrome, Windows 7 veya daha yeni bir sürümünü gerektirir.</translation> <translation id="9102715433345326100">Bu dosya kötü amaçlı ve Chrome tarafından engellendi.</translation> <translation id="9107728822479888688"><ph name="BEGIN_BOLD" />Uyarı:<ph name="END_BOLD" /> Google Chrome, uzantıların göz atma geçmişinizi kaydetmesini önleyemez. Gizli modda bu uzantıyı devre dışı bırakmak için, bu seçeneğin onay işaretini kaldırın.</translation> <translation id="911206726377975832">Tarama verileriniz de silinsin mi?</translation>
diff --git a/chrome/app/resources/google_chrome_strings_uk.xtb b/chrome/app/resources/google_chrome_strings_uk.xtb index 6c82d96..b03e684 100644 --- a/chrome/app/resources/google_chrome_strings_uk.xtb +++ b/chrome/app/resources/google_chrome_strings_uk.xtb
@@ -225,6 +225,7 @@ <translation id="8556340503434111824">Доступна нова версія Google Chrome – швидша, ніж будь-коли.</translation> <translation id="8568392309447938879">Щоб користуватися програмами, потрібно ввійти в Chrome. Це дозволяє веб-переглядачу Chrome синхронізувати ваші програми, закладки, історію, паролі й інші налаштування на різних пристроях.</translation> <translation id="8614913330719544658">Google Chrome не відповідає. Перезапустити зараз?</translation> +<translation id="8667808506758191620">Ваш пристрій <ph name="DEVICE_TYPE" /> оновлено.</translation> <translation id="8669527147644353129">Помічник Google Chrome</translation> <translation id="8679801911857917785">Розширення також змінило сторінку, яка відкривається під час запуску Chrome.</translation> <translation id="870251953148363156">Оновити &Google Chrome</translation> @@ -233,6 +234,7 @@ <translation id="8851136666856101339">головний</translation> <translation id="8862326446509486874">У вас немає відповідних прав для встановлення на рівні системи. Спробуйте запустити програму встановлення, увійшовши з правами адміністратора.</translation> <translation id="9026991721384951619">ОС Chrome не вдалося синхронізувати ваші дані, оскільки дані для входу в обліковий запис застаріли.</translation> +<translation id="9067395829937117663">Для роботи Google Chrome потрібно мати ОС Windows 7 або новішої версії.</translation> <translation id="9102715433345326100">Цей файл шкідливий, тому Chrome заблокував його.</translation> <translation id="9107728822479888688"><ph name="BEGIN_BOLD" />Застереження:<ph name="END_BOLD" /> Google Chrome не може заборонити розширенням реєструвати вашу історію веб-перегляду. Щоб вимкнути це розширення в режимі анонімного перегляду, зніміть прапорець поруч із цим параметром.</translation> <translation id="911206726377975832">Також видалити дані веб-перегляду?</translation>
diff --git a/chrome/app/resources/google_chrome_strings_vi.xtb b/chrome/app/resources/google_chrome_strings_vi.xtb index b26360c..3062531 100644 --- a/chrome/app/resources/google_chrome_strings_vi.xtb +++ b/chrome/app/resources/google_chrome_strings_vi.xtb
@@ -238,6 +238,7 @@ <translation id="8851136666856101339">chính</translation> <translation id="8862326446509486874">Bạn không có quyền thích hợp để cài đặt cấp hệ thống. Thử chạy lại trình cài đặt với vai trò Quản trị viên.</translation> <translation id="9026991721384951619">Chrome OS không thể đồng bộ hóa dữ liệu của bạn do chi tiết đăng nhập tài khoản của bạn đã lỗi thời.</translation> +<translation id="9067395829937117663">Google Chrome yêu cầu Windows 7 trở lên.</translation> <translation id="9102715433345326100">Đây là tệp độc hại và Chrome đã chặn tệp này.</translation> <translation id="9107728822479888688"><ph name="BEGIN_BOLD" />Cảnh báo:<ph name="END_BOLD" /> Google Chrome không thể ngăn các tiện ích ghi lại lịch sử duyệt web của bạn. Để tắt tiện ích này trong chế độ ẩn danh, hãy bỏ chọn tùy chọn này.</translation> <translation id="911206726377975832">Bạn cũng muốn xóa dữ liệu duyệt web của mình?</translation>
diff --git a/chrome/app/resources/google_chrome_strings_zh-CN.xtb b/chrome/app/resources/google_chrome_strings_zh-CN.xtb index 540126c7..1057ad79 100644 --- a/chrome/app/resources/google_chrome_strings_zh-CN.xtb +++ b/chrome/app/resources/google_chrome_strings_zh-CN.xtb
@@ -234,6 +234,7 @@ <translation id="8851136666856101339">主体内容</translation> <translation id="8862326446509486874">您的权限不足,无法进行系统级安装。请尝试以管理员身份再次运行安装程序。</translation> <translation id="9026991721384951619">您的帐户登录详细信息已过期,Chrome操作系统无法同步您的数据。</translation> +<translation id="9067395829937117663">Google Chrome 要求操作系统必须为 Windows 7 或更高版本。</translation> <translation id="9102715433345326100">这是恶意文件,Chrome 已将其拦截。</translation> <translation id="9107728822479888688"><ph name="BEGIN_BOLD" />警告<ph name="END_BOLD" />:Google Chrome 浏览器无法阻止扩展程序记录您的浏览记录。要在隐身模式下停用此扩展程序,请取消选中此选项。</translation> <translation id="911206726377975832">同时删除您的浏览数据吗?</translation>
diff --git a/chrome/app/resources/google_chrome_strings_zh-TW.xtb b/chrome/app/resources/google_chrome_strings_zh-TW.xtb index be51269..e26e391 100644 --- a/chrome/app/resources/google_chrome_strings_zh-TW.xtb +++ b/chrome/app/resources/google_chrome_strings_zh-TW.xtb
@@ -235,6 +235,7 @@ <translation id="8851136666856101339">主要元素</translation> <translation id="8862326446509486874">您沒有在系統層級進行安裝的權限,請以管理員的身分執行安裝檔。</translation> <translation id="9026991721384951619">您的帳戶登入詳細資料尚未更新,因此 Chrome 作業系統無法同步處理您的資料。</translation> +<translation id="9067395829937117663">Google Chrome 僅支援 Windows 7 以上版本的作業系統。</translation> <translation id="9102715433345326100">這個檔案是惡意軟體,因此已遭到 Chrome 封鎖。</translation> <translation id="9107728822479888688"><ph name="BEGIN_BOLD" />警告:<ph name="END_BOLD" />Google Chrome 無法阻止擴充功能記錄您的瀏覽紀錄,如要在無痕模式中停用這個擴充功能,請取消選取這個選項。 </translation> <translation id="911206726377975832">您要一併刪除瀏覽資料嗎?</translation>
diff --git a/chrome/app/settings_strings.grdp b/chrome/app/settings_strings.grdp index 76dc943..1a4d087 100644 --- a/chrome/app/settings_strings.grdp +++ b/chrome/app/settings_strings.grdp
@@ -1208,9 +1208,18 @@ <message name="IDS_SETTINGS_DISPLAY_MAKE_PRIMARY" desc="In Device Settings > Displays, the label for the control for making a display primary."> Make primary </message> - <message name="IDS_SETTINGS_DISPLAY_RESOLUTION" desc="In Device Settings > Displays, the label for the control for changing a display's resolution."> + <message name="IDS_SETTINGS_DISPLAY_RESOLUTION_TITLE" desc="In Device Settings > Displays, the label for the section for changing a display's resolution."> Resolution </message> + <message name="IDS_SETTINGS_DISPLAY_RESOLUTION_TEXT" desc="In Device Settings > Displays, the text describing the display's resolution."> + <ph name="WIDTH">$1<ex>1600</ex></ph> x <ph name="HEIGHT">$2<ex>1200</ex></ph> + </message> + <message name="IDS_SETTINGS_DISPLAY_RESOLUTION_TEXT_BEST" desc="In Device Settings > Displays, the text describing the display's resolution when it is the 'best' resolution."> + <ph name="WIDTH">$1<ex>1600</ex></ph> x <ph name="HEIGHT">$2<ex>1200</ex></ph> (Best) + </message> + <message name="IDS_SETTINGS_DISPLAY_RESOLUTION_TEXT_NATIVE" desc="In Device Settings > Displays, the text describing the display's resolution when it is the native resolution."> + <ph name="WIDTH">$1<ex>1600</ex></ph> x <ph name="HEIGHT">$2<ex>1200</ex></ph> (Native) + </message> <message name="IDS_SETTINGS_DISPLAY_ORIENTATION" desc="In Device Settings > Displays, the label for the control for changing a display's orientation."> Orientation </message>
diff --git a/chrome/app_shim/chrome_main_app_mode_mac.mm b/chrome/app_shim/chrome_main_app_mode_mac.mm index 72e751b..af4b62a 100644 --- a/chrome/app_shim/chrome_main_app_mode_mac.mm +++ b/chrome/app_shim/chrome_main_app_mode_mac.mm
@@ -141,7 +141,7 @@ void Close(); base::FilePath user_data_dir_; - scoped_ptr<IPC::ChannelProxy> channel_; + std::unique_ptr<IPC::ChannelProxy> channel_; base::scoped_nsobject<AppShimDelegate> delegate_; bool launch_app_done_; bool ping_chrome_reply_received_;
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index c38fad4..39ca6ce 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc
@@ -1191,12 +1191,6 @@ IDS_NOTIFICATIONS_NATIVE_FLAG_DESCRIPTION, kOsMac, SINGLE_VALUE_TYPE(switches::kEnableNativeNotifications)}, #endif -#if defined(ENABLE_NOTIFICATIONS) - {"enable-notification-action-icons", - IDS_FLAGS_ENABLE_NOTIFICATION_ACTION_ICONS_NAME, - IDS_FLAGS_ENABLE_NOTIFICATION_ACTION_ICONS_DESCRIPTION, kOsAll, - SINGLE_VALUE_TYPE(switches::kEnableNotificationActionIcons)}, -#endif #if defined(TOOLKIT_VIEWS) {"disable-views-rect-based-targeting", // FLAGS:RECORD_UMA IDS_FLAGS_VIEWS_RECT_BASED_TARGETING_NAME, @@ -1788,6 +1782,10 @@ IDS_FLAGS_PROTECT_SYNC_CREDENTIAL_ON_REAUTH_DESCRIPTION, kOsAll, FEATURE_VALUE_TYPE( password_manager::features::kProtectSyncCredentialOnReauth)}, + {"password-import-export", IDS_FLAGS_PASSWORD_IMPORT_EXPORT_NAME, + IDS_FLAGS_PASSWORD_IMPORT_EXPORT_DESCRIPTION, + kOsWin | kOsMac | kOsCrOS | kOsLinux, + FEATURE_VALUE_TYPE(password_manager::features::kPasswordImportExport)}, #if defined(OS_CHROMEOS) {"enable-experimental-accessibility-features", IDS_FLAGS_EXPERIMENTAL_ACCESSIBILITY_FEATURES_NAME,
diff --git a/chrome/browser/android/OWNERS b/chrome/browser/android/OWNERS index f63c73e..d15b81aa 100644 --- a/chrome/browser/android/OWNERS +++ b/chrome/browser/android/OWNERS
@@ -1,6 +1,7 @@ bauerb@chromium.org dfalcantara@chromium.org dtrainor@chromium.org +mariakhomenko@chromium.org miguelg@chromium.org newt@chromium.org nyquist@chromium.org
diff --git a/chrome/browser/android/mojo/chrome_service_registrar_android.cc b/chrome/browser/android/mojo/chrome_service_registrar_android.cc index c7749ad..80b48f45 100644 --- a/chrome/browser/android/mojo/chrome_service_registrar_android.cc +++ b/chrome/browser/android/mojo/chrome_service_registrar_android.cc
@@ -7,6 +7,7 @@ #include "base/android/context_utils.h" #include "base/android/jni_android.h" #include "content/public/browser/android/service_registry_android.h" +#include "content/public/browser/web_contents.h" #include "jni/ChromeServiceRegistrar_jni.h" // static @@ -16,9 +17,12 @@ // static void ChromeServiceRegistrarAndroid::RegisterRenderFrameMojoServices( - content::ServiceRegistry* registry) { + content::ServiceRegistry* registry, + content::RenderFrameHost* render_frame_host) { Java_ChromeServiceRegistrar_registerRenderFrameMojoServices( base::android::AttachCurrentThread(), content::ServiceRegistryAndroid::Create(registry)->GetObj().obj(), - base::android::GetApplicationContext()); + content::WebContents::FromRenderFrameHost(render_frame_host) + ->GetJavaWebContents() + .obj()); }
diff --git a/chrome/browser/android/mojo/chrome_service_registrar_android.h b/chrome/browser/android/mojo/chrome_service_registrar_android.h index e7b5feb6..63520a0 100644 --- a/chrome/browser/android/mojo/chrome_service_registrar_android.h +++ b/chrome/browser/android/mojo/chrome_service_registrar_android.h
@@ -8,6 +8,7 @@ #include <jni.h> namespace content { +class RenderFrameHost; class ServiceRegistry; } @@ -15,7 +16,8 @@ public: static bool Register(JNIEnv* env); static void RegisterRenderFrameMojoServices( - content::ServiceRegistry* registry); + content::ServiceRegistry* registry, + content::RenderFrameHost* render_frame_host); private: ChromeServiceRegistrarAndroid() {}
diff --git a/chrome/browser/android/ntp/most_visited_sites.cc b/chrome/browser/android/ntp/most_visited_sites.cc index 6a42bd4..d09a368b 100644 --- a/chrome/browser/android/ntp/most_visited_sites.cc +++ b/chrome/browser/android/ntp/most_visited_sites.cc
@@ -25,7 +25,6 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_android.h" #include "chrome/browser/search/suggestions/suggestions_service_factory.h" -#include "chrome/browser/search/suggestions/suggestions_source.h" #include "chrome/browser/supervised_user/supervised_user_service.h" #include "chrome/browser/supervised_user/supervised_user_service_factory.h" #include "chrome/browser/supervised_user/supervised_user_url_filter.h" @@ -223,10 +222,7 @@ : profile_(profile), num_sites_(0), received_most_visited_sites_(false), received_popular_sites_(false), recorded_uma_(false), scoped_observer_(this), weak_ptr_factory_(this) { - // Register the debugging page for the Suggestions Service and the thumbnails - // debugging page. - content::URLDataSource::Add(profile_, - new suggestions::SuggestionsSource(profile_)); + // Register the thumbnails debugging page. content::URLDataSource::Add(profile_, new ThumbnailListSource(profile_)); SupervisedUserService* supervised_user_service =
diff --git a/chrome/browser/android/ntp/ntp_snippets_bridge.cc b/chrome/browser/android/ntp/ntp_snippets_bridge.cc index b1154ceb..ac248694 100644 --- a/chrome/browser/android/ntp/ntp_snippets_bridge.cc +++ b/chrome/browser/android/ntp/ntp_snippets_bridge.cc
@@ -36,19 +36,27 @@ NTPSnippetsServiceFactory::GetForProfile(profile)->FetchSnippets(); } +// Reschedules the fetching of snippets. Used to support different fetching +// intervals for different times of day. +static void RescheduleFetching(JNIEnv* env, + const JavaParamRef<jclass>& caller) { + Profile* profile = ProfileManager::GetLastUsedProfile(); + NTPSnippetsServiceFactory::GetForProfile(profile)->RescheduleFetching(); +} + NTPSnippetsBridge::NTPSnippetsBridge(JNIEnv* env, const JavaParamRef<jobject>& j_profile) : snippet_service_observer_(this) { Profile* profile = ProfileAndroid::FromProfileAndroid(j_profile); ntp_snippets_service_ = NTPSnippetsServiceFactory::GetForProfile(profile); + snippet_service_observer_.Add(ntp_snippets_service_); } void NTPSnippetsBridge::SetObserver(JNIEnv* env, const JavaParamRef<jobject>& obj, const JavaParamRef<jobject>& j_observer) { observer_.Reset(env, j_observer); - // This will call NTPSnippetsServiceLoaded. - snippet_service_observer_.Add(ntp_snippets_service_); + NTPSnippetsServiceLoaded(); } NTPSnippetsBridge::~NTPSnippetsBridge() {} @@ -65,7 +73,8 @@ } void NTPSnippetsBridge::NTPSnippetsServiceLoaded() { - DCHECK(!observer_.is_null()); + if (observer_.is_null()) + return; std::vector<std::string> titles; std::vector<std::string> urls;
diff --git a/chrome/browser/android/ntp/ntp_snippets_launcher.cc b/chrome/browser/android/ntp/ntp_snippets_launcher.cc index d09ee99..4fb2641 100644 --- a/chrome/browser/android/ntp/ntp_snippets_launcher.cc +++ b/chrome/browser/android/ntp/ntp_snippets_launcher.cc
@@ -30,13 +30,15 @@ bool NTPSnippetsLauncher::Schedule(base::TimeDelta period_wifi_charging, base::TimeDelta period_wifi, - base::TimeDelta period_fallback) { + base::TimeDelta period_fallback, + base::Time reschedule_time) { DCHECK_CURRENTLY_ON(BrowserThread::UI); JNIEnv* env = base::android::AttachCurrentThread(); return Java_SnippetsLauncher_schedule( env, java_launcher_.obj(), period_wifi_charging.InSeconds(), - period_wifi.InSeconds(), period_fallback.InSeconds()); + period_wifi.InSeconds(), period_fallback.InSeconds(), + reschedule_time.ToJavaTime()); } bool NTPSnippetsLauncher::Unschedule() {
diff --git a/chrome/browser/android/ntp/ntp_snippets_launcher.h b/chrome/browser/android/ntp/ntp_snippets_launcher.h index 0d509dec..2c77ac2 100644 --- a/chrome/browser/android/ntp/ntp_snippets_launcher.h +++ b/chrome/browser/android/ntp/ntp_snippets_launcher.h
@@ -23,7 +23,8 @@ // ntp_snippets::NTPSnippetsScheduler implementation. bool Schedule(base::TimeDelta period_wifi_charging, base::TimeDelta period_wifi, - base::TimeDelta period_fallback) override; + base::TimeDelta period_fallback, + base::Time reschedule_time) override; bool Unschedule() override; private:
diff --git a/chrome/browser/android/offline_pages/recent_tab_helper.cc b/chrome/browser/android/offline_pages/recent_tab_helper.cc new file mode 100644 index 0000000..13983db --- /dev/null +++ b/chrome/browser/android/offline_pages/recent_tab_helper.cc
@@ -0,0 +1,18 @@ +// Copyright (c) 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/android/offline_pages/recent_tab_helper.h" + +DEFINE_WEB_CONTENTS_USER_DATA_KEY(offline_pages::RecentTabHelper); + +namespace offline_pages { + +RecentTabHelper::RecentTabHelper(content::WebContents* web_contents) + : content::WebContentsObserver(web_contents) { +} + +RecentTabHelper::~RecentTabHelper() { +} + +} // namespace offline_pages
diff --git a/chrome/browser/android/offline_pages/recent_tab_helper.h b/chrome/browser/android/offline_pages/recent_tab_helper.h new file mode 100644 index 0000000..00e1d24 --- /dev/null +++ b/chrome/browser/android/offline_pages/recent_tab_helper.h
@@ -0,0 +1,31 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_ANDROID_OFFLINE_PAGES_RECENT_TAB_HELPER_H_ +#define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_RECENT_TAB_HELPER_H_ + +#include "content/public/browser/web_contents_observer.h" +#include "content/public/browser/web_contents_user_data.h" + +namespace offline_pages { + +// Attaches to every WebContent shown in a tab. Waits until the WebContent is +// loaded to proper degree and then makes a snapshot of the page. Removes the +// oldest snapshot in the 'ring buffer'. As a result, there is always up to N +// snapshots of recent pages on the device. +class RecentTabHelper + : public content::WebContentsObserver, + public content::WebContentsUserData<RecentTabHelper> { + public: + ~RecentTabHelper() override; + + private: + explicit RecentTabHelper(content::WebContents* web_contents); + friend class content::WebContentsUserData<RecentTabHelper>; + + DISALLOW_COPY_AND_ASSIGN(RecentTabHelper); +}; + +} // namespace offline_pages +#endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_RECENT_TAB_HELPER_H_
diff --git a/chrome/browser/android/offline_pages/recent_tab_helper_unittest.cc b/chrome/browser/android/offline_pages/recent_tab_helper_unittest.cc new file mode 100644 index 0000000..ea689d0d --- /dev/null +++ b/chrome/browser/android/offline_pages/recent_tab_helper_unittest.cc
@@ -0,0 +1,40 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/android/offline_pages/recent_tab_helper.h" + +#include "chrome/test/base/chrome_render_view_host_test_harness.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace offline_pages { + +class RecentTabHelperTest : public ChromeRenderViewHostTestHarness { + public: + RecentTabHelperTest() {} + ~RecentTabHelperTest() override {} + + void SetUp() override; + + RecentTabHelper* recent_tab_helper() const { + return recent_tab_helper_; + } + + private: + RecentTabHelper* recent_tab_helper_; // Owned by WebContents. + + DISALLOW_COPY_AND_ASSIGN(RecentTabHelperTest); +}; + +void RecentTabHelperTest::SetUp() { + content::RenderViewHostTestHarness::SetUp(); + RecentTabHelper::CreateForWebContents(web_contents()); + recent_tab_helper_ = + RecentTabHelper::FromWebContents(web_contents()); +} + +TEST_F(RecentTabHelperTest, Basic) { + EXPECT_NE(nullptr, recent_tab_helper()); +} + +} // namespace offline_pages
diff --git a/chrome/browser/android/url_utilities.cc b/chrome/browser/android/url_utilities.cc index b07b802..f945b61 100644 --- a/chrome/browser/android/url_utilities.cc +++ b/chrome/browser/android/url_utilities.cc
@@ -96,8 +96,9 @@ const JavaParamRef<jclass>& clazz, const JavaParamRef<jstring>& url) { return base::android::ConvertUTF16ToJavaString( - env, url_formatter::FormatUrlForSecurityDisplayOmitScheme( - ConvertJavaStringToGURL(env, url))); + env, url_formatter::FormatUrlForSecurityDisplay( + ConvertJavaStringToGURL(env, url), + url_formatter::SchemeDisplay::OMIT_HTTP_AND_HTTPS)); } static jboolean IsGoogleHomePageUrl(JNIEnv* env,
diff --git a/chrome/browser/browsing_data/browsing_data_remover_unittest.cc b/chrome/browser/browsing_data/browsing_data_remover_unittest.cc index 62fc5f4d..821a5c1 100644 --- a/chrome/browser/browsing_data/browsing_data_remover_unittest.cc +++ b/chrome/browser/browsing_data/browsing_data_remover_unittest.cc
@@ -2293,7 +2293,7 @@ EXPECT_EQ(CLEAR_CONTEXTS, tester.last_clear_mode()); } -// TODO(ttuttle): This isn't actually testing the no-monitor case, since +// TODO(juliatuttle): This isn't actually testing the no-monitor case, since // BrowsingDataRemoverTest now creates one unconditionally, since it's needed // for some unrelated test cases. This should be fixed so it tests the no- // monitor case again.
diff --git a/chrome/browser/browsing_data/cookies_tree_model.h b/chrome/browser/browsing_data/cookies_tree_model.h index e54d927..5a050bf 100644 --- a/chrome/browser/browsing_data/cookies_tree_model.h +++ b/chrome/browser/browsing_data/cookies_tree_model.h
@@ -9,12 +9,12 @@ // inline code (which shouldn't be inline). #include <list> +#include <memory> #include <string> #include <vector> #include "base/macros.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/observer_list.h" #include "base/strings/string16.h"
diff --git a/chrome/browser/browsing_data/mock_browsing_data_channel_id_helper.cc b/chrome/browser/browsing_data/mock_browsing_data_channel_id_helper.cc index 5c4a040..357d9c89 100644 --- a/chrome/browser/browsing_data/mock_browsing_data_channel_id_helper.cc +++ b/chrome/browser/browsing_data/mock_browsing_data_channel_id_helper.cc
@@ -4,10 +4,10 @@ #include "chrome/browser/browsing_data/mock_browsing_data_channel_id_helper.h" +#include <memory> #include <utility> #include "base/logging.h" -#include "base/memory/scoped_ptr.h" #include "base/stl_util.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/chrome/browser/browsing_data/mock_browsing_data_cookie_helper.cc b/chrome/browser/browsing_data/mock_browsing_data_cookie_helper.cc index f6dfebc..7183661 100644 --- a/chrome/browser/browsing_data/mock_browsing_data_cookie_helper.cc +++ b/chrome/browser/browsing_data/mock_browsing_data_cookie_helper.cc
@@ -4,8 +4,9 @@ #include "chrome/browser/browsing_data/mock_browsing_data_cookie_helper.h" +#include <memory> + #include "base/logging.h" -#include "base/memory/scoped_ptr.h" #include "base/stl_util.h" #include "base/time/time.h" #include "net/cookies/cookie_options.h"
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc index 1d00e40..b4f6894c 100644 --- a/chrome/browser/chrome_browser_main.cc +++ b/chrome/browser/chrome_browser_main.cc
@@ -211,7 +211,6 @@ #include "chrome/installer/util/shell_util.h" #include "components/startup_metric_utils/common/pre_read_field_trial_utils_win.h" #include "ui/base/l10n/l10n_util_win.h" -#include "ui/gfx/win/dpi.h" #include "ui/shell_dialogs/select_file_dialog.h" #endif // defined(OS_WIN)
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc index 2a8495a..19839f7 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc
@@ -2785,7 +2785,8 @@ } #if BUILDFLAG(ANDROID_JAVA_UI) - ChromeServiceRegistrarAndroid::RegisterRenderFrameMojoServices(registry); + ChromeServiceRegistrarAndroid::RegisterRenderFrameMojoServices( + registry, render_frame_host); #endif }
diff --git a/chrome/browser/chromeos/app_mode/kiosk_app_manager.cc b/chrome/browser/chromeos/app_mode/kiosk_app_manager.cc index 8a6d7b0..d3c295f 100644 --- a/chrome/browser/chromeos/app_mode/kiosk_app_manager.cc +++ b/chrome/browser/chromeos/app_mode/kiosk_app_manager.cc
@@ -15,8 +15,9 @@ #include "base/logging.h" #include "base/memory/ptr_util.h" #include "base/path_service.h" -#include "base/stl_util.h" +#include "base/strings/stringprintf.h" #include "base/sys_info.h" +#include "base/version.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/chromeos/app_mode/app_session.h" #include "chrome/browser/chromeos/app_mode/kiosk_app_data.h" @@ -48,6 +49,7 @@ #include "components/user_manager/user_manager.h" #include "content/public/browser/browser_thread.h" #include "extensions/common/extension_urls.h" +#include "extensions/common/manifest_handlers/kiosk_mode_info.h" namespace chromeos { @@ -134,6 +136,16 @@ pool->GetSequenceToken(), base::SequencedWorkerPool::SKIP_ON_SHUTDOWN); } +base::Version GetPlatformVersion() { + int32_t major_version; + int32_t minor_version; + int32_t bugfix_version; + base::SysInfo::OperatingSystemVersionNumbers(&major_version, &minor_version, + &bugfix_version); + return base::Version(base::StringPrintf("%d.%d.%d", major_version, + minor_version, bugfix_version)); +} + } // namespace // static @@ -568,6 +580,48 @@ external_cache_->PutExternalExtension(app_id, crx_path, version, callback); } +bool KioskAppManager::IsPlatformCompliant( + const std::string& required_platform_version) const { + // Empty required version is compliant with any platform version. + if (required_platform_version.empty()) + return true; + + // Not compliant for bad formatted required versions. + const base::Version required_version(required_platform_version); + if (!required_version.IsValid() || + required_version.components().size() > 3u) { + LOG(ERROR) << "Bad formatted required platform version: " + << required_platform_version; + return false; + } + + // Not compliant if the platform version components do not match. + const size_t count = required_version.components().size(); + const base::Version platform_version = GetPlatformVersion(); + const auto& platform_version_components = platform_version.components(); + const auto& required_version_components = required_version.components(); + for (size_t i = 0; i < count; ++i) { + if (platform_version_components[i] != required_version_components[i]) + return false; + } + + return true; +} + +bool KioskAppManager::IsPlatformCompliantWithApp( + const extensions::Extension* app) const { + // Compliant if the app is not the auto launched with zero delay app. + if (currently_auto_launched_with_zero_delay_app_ != app->id()) + return true; + + // Compliant if the app does not specify required platform version. + const extensions::KioskModeInfo* info = extensions::KioskModeInfo::Get(app); + if (info == nullptr) + return true; + + return IsPlatformCompliant(info->required_platform_version); +} + KioskAppManager::KioskAppManager() : ownership_established_(false), external_loader_created_(false),
diff --git a/chrome/browser/chromeos/app_mode/kiosk_app_manager.h b/chrome/browser/chromeos/app_mode/kiosk_app_manager.h index 7d45ad6..6c8e2ae2 100644 --- a/chrome/browser/chromeos/app_mode/kiosk_app_manager.h +++ b/chrome/browser/chromeos/app_mode/kiosk_app_manager.h
@@ -218,10 +218,12 @@ const std::string& version, const ExternalCache::PutExternalExtensionCallback& callback); - bool external_loader_created() const { return external_loader_created_; } - bool secondary_app_external_loader_created() const { - return secondary_app_external_loader_created_; - } + // Whether the current platform is compliant with the given required + // platform version. + bool IsPlatformCompliant(const std::string& required_platform_version) const; + + // Whether the platform is compliant for the given app. + bool IsPlatformCompliantWithApp(const extensions::Extension* app) const; // Notifies the KioskAppManager that a given app was auto-launched // automatically with no delay on startup. Certain privacy-sensitive @@ -233,6 +235,10 @@ void InitSession(Profile* profile, const std::string& app_id); AppSession* app_session() { return app_session_.get(); } + bool external_loader_created() const { return external_loader_created_; } + bool secondary_app_external_loader_created() const { + return secondary_app_external_loader_created_; + } private: friend struct base::DefaultLazyInstanceTraits<KioskAppManager>;
diff --git a/chrome/browser/chromeos/app_mode/kiosk_app_manager_browsertest.cc b/chrome/browser/chromeos/app_mode/kiosk_app_manager_browsertest.cc index 1be9ce7..9d850f44 100644 --- a/chrome/browser/chromeos/app_mode/kiosk_app_manager_browsertest.cc +++ b/chrome/browser/chromeos/app_mode/kiosk_app_manager_browsertest.cc
@@ -15,6 +15,8 @@ #include "base/macros.h" #include "base/path_service.h" #include "base/strings/stringprintf.h" +#include "base/sys_info.h" +#include "base/time/time.h" #include "base/values.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/chromeos/app_mode/fake_cws.h" @@ -99,7 +101,10 @@ scripts->AppendString("main.js"); value.Set("app.background.scripts", std::move(scripts)); value.SetBoolean("kiosk_enabled", true); - value.SetString("kiosk.required_platform_version", required_platform_version); + if (!required_platform_version.empty()) { + value.SetString("kiosk.required_platform_version", + required_platform_version); + } std::string err; scoped_refptr<extensions::Extension> app = @@ -114,6 +119,12 @@ return app; } +void SetPlatformVersion(const std::string& platform_version) { + const std::string lsb_release = base::StringPrintf( + "CHROMEOS_RELEASE_VERSION=%s", platform_version.c_str()); + base::SysInfo::SetChromeOSVersionInfoForTest(lsb_release, base::Time::Now()); +} + class AppDataLoadWaiter : public KioskAppManagerObserver { public: AppDataLoadWaiter(KioskAppManager* manager, int expected_data_change) @@ -580,9 +591,10 @@ base::FilePath test_dir; ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_dir)); base::FilePath data_dir = - test_dir.AppendASCII("chromeos/app_mode/offline_enabled_kiosk_app"); - base::FilePath crx_file = - data_dir.AppendASCII("v2_required_platform_version_added.crx"); + test_dir.AppendASCII("chromeos/app_mode/webstore/downloads/"); + base::FilePath crx_file = data_dir.AppendASCII( + "ajoggoflpgplnnjkjamcmbepjdjdnpdp_v2_required_platform_version_added." + "crx"); crx_file = CopyFileToTempDir(crx_file); ExternalCachePutWaiter put_waiter; @@ -874,4 +886,62 @@ manager()->GetAutoLaunchAppRequiredPlatformVersion()); } +IN_PROC_BROWSER_TEST_F(KioskAppManagerTest, IsPlatformCompliant) { + SetPlatformVersion("1234.1.2"); + + EXPECT_TRUE(manager()->IsPlatformCompliant("")); + EXPECT_TRUE(manager()->IsPlatformCompliant("1234")); + EXPECT_TRUE(manager()->IsPlatformCompliant("1234.1")); + EXPECT_TRUE(manager()->IsPlatformCompliant("1234.1.2")); + + EXPECT_FALSE(manager()->IsPlatformCompliant("123")); + EXPECT_FALSE(manager()->IsPlatformCompliant("1234.2")); + EXPECT_FALSE(manager()->IsPlatformCompliant("1234.1.1")); + EXPECT_FALSE(manager()->IsPlatformCompliant("1234.1.3")); + + EXPECT_FALSE(manager()->IsPlatformCompliant("1234.1.2.3")); + EXPECT_FALSE(manager()->IsPlatformCompliant("bad version")); +} + +IN_PROC_BROWSER_TEST_F(KioskAppManagerTest, IsPlatformCompliantWithApp) { + SetPlatformVersion("1234.1.2"); + + const char kAppId[] = "app_id"; + SetExistingApp(kAppId, "App Name", "red16x16.png", ""); + + manager()->SetAutoLaunchApp(kAppId, owner_settings_service_.get()); + manager()->SetEnableAutoLaunch(true); + manager()->SetAppWasAutoLaunchedWithZeroDelay(kAppId); + + struct { + const std::string required_platform_version; + const bool expected_compliant; + } kTestCases[] = { + {"", true}, {"1234", true}, {"1234.1", true}, + {"1234.1.2", true}, {"123", false}, {"1234.2", false}, + {"1234.1.1", false}, {"1234.1.3", false}, + }; + + for (size_t i = 0; i < arraysize(kTestCases); ++i) { + scoped_refptr<extensions::Extension> app = MakeKioskApp( + "App Name", "1.0", kAppId, kTestCases[i].required_platform_version); + EXPECT_EQ(kTestCases[i].expected_compliant, + manager()->IsPlatformCompliantWithApp(app.get())) + << "Test case: " << i << ", required_platform_version=" + << kTestCases[i].required_platform_version; + } + + // If an app is not auto launched with zero delay, it is always compliant. + const char kNoneAutoLaucnhedAppId[] = "none_auto_launch_app_id"; + for (size_t i = 0; i < arraysize(kTestCases); ++i) { + scoped_refptr<extensions::Extension> app = + MakeKioskApp("App Name", "1.0", kNoneAutoLaucnhedAppId, + kTestCases[i].required_platform_version); + EXPECT_TRUE(manager()->IsPlatformCompliantWithApp(app.get())) + << "Test case for non auto launch app: " << i + << ", required_platform_version=" + << kTestCases[i].required_platform_version; + } +} + } // namespace chromeos
diff --git a/chrome/browser/chromeos/app_mode/kiosk_app_update_install_gate.cc b/chrome/browser/chromeos/app_mode/kiosk_app_update_install_gate.cc new file mode 100644 index 0000000..333f6fb3 --- /dev/null +++ b/chrome/browser/chromeos/app_mode/kiosk_app_update_install_gate.cc
@@ -0,0 +1,42 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/chromeos/app_mode/kiosk_app_update_install_gate.h" + +#include "base/logging.h" +#include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" +#include "chrome/browser/profiles/profile.h" +#include "extensions/browser/extension_registry.h" +#include "extensions/common/extension.h" + +namespace chromeos { + +KioskAppUpdateInstallGate::KioskAppUpdateInstallGate(Profile* profile) + : profile_(profile), + registry_(extensions::ExtensionRegistry::Get(profile)) {} + +KioskAppUpdateInstallGate::~KioskAppUpdateInstallGate() {} + +extensions::InstallGate::Action KioskAppUpdateInstallGate::ShouldDelay( + const extensions::Extension* extension, + bool install_immediately) { + // Install if this is the first install or the required platform version is + // compliant with the current platform version. + const bool first_install = !registry_->GetInstalledExtension(extension->id()); + const bool platform_compliant = + KioskAppManager::Get()->IsPlatformCompliantWithApp(extension); + if (first_install || platform_compliant) { + LOG_IF(WARNING, first_install && !platform_compliant) + << "Install on an incompliant platform for the first install."; + return INSTALL; + } + + // Otherwise, delay install but update the required platform version meta data + // to allow update engine to move on to the new platform version. + KioskAppManager::Get()->UpdateAppDataFromProfile(extension->id(), profile_, + extension); + return DELAY; +} + +} // namespace chromeos
diff --git a/chrome/browser/chromeos/app_mode/kiosk_app_update_install_gate.h b/chrome/browser/chromeos/app_mode/kiosk_app_update_install_gate.h new file mode 100644 index 0000000..5602039 --- /dev/null +++ b/chrome/browser/chromeos/app_mode/kiosk_app_update_install_gate.h
@@ -0,0 +1,38 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_CHROMEOS_APP_MODE_KIOSK_APP_UPDATE_INSTALL_GATE_H_ +#define CHROME_BROWSER_CHROMEOS_APP_MODE_KIOSK_APP_UPDATE_INSTALL_GATE_H_ + +#include "base/macros.h" +#include "chrome/browser/extensions/install_gate.h" + +namespace extensions { +class Extension; +class ExtensionRegistry; +} + +class Profile; + +namespace chromeos { + +class KioskAppUpdateInstallGate : public extensions::InstallGate { + public: + explicit KioskAppUpdateInstallGate(Profile* profile); + ~KioskAppUpdateInstallGate() override; + + // InstallGate: + Action ShouldDelay(const extensions::Extension* extension, + bool install_immediately) override; + + private: + Profile* const profile_; + extensions::ExtensionRegistry* const registry_; + + DISALLOW_COPY_AND_ASSIGN(KioskAppUpdateInstallGate); +}; + +} // namespace chromeos + +#endif // CHROME_BROWSER_CHROMEOS_APP_MODE_KIOSK_APP_UPDATE_INSTALL_GATE_H_
diff --git a/chrome/browser/chromeos/app_mode/kiosk_crash_restore_browsertest.cc b/chrome/browser/chromeos/app_mode/kiosk_crash_restore_browsertest.cc new file mode 100644 index 0000000..b76dfe2 --- /dev/null +++ b/chrome/browser/chromeos/app_mode/kiosk_crash_restore_browsertest.cc
@@ -0,0 +1,203 @@ +// 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 <memory> +#include <string> + +#include "base/base64.h" +#include "base/command_line.h" +#include "base/files/file_util.h" +#include "base/path_service.h" +#include "base/run_loop.h" +#include "chrome/browser/chromeos/app_mode/fake_cws.h" +#include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" +#include "chrome/browser/chromeos/login/test/app_window_waiter.h" +#include "chrome/browser/chromeos/net/network_portal_detector_test_impl.h" +#include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos_factory.h" +#include "chrome/browser/chromeos/policy/device_local_account.h" +#include "chrome/browser/chromeos/policy/device_policy_builder.h" +#include "chrome/browser/profiles/profile_manager.h" +#include "chrome/common/chrome_constants.h" +#include "chrome/common/chrome_paths.h" +#include "chrome/common/pref_names.h" +#include "chrome/test/base/in_process_browser_test.h" +#include "chromeos/chromeos_paths.h" +#include "chromeos/chromeos_switches.h" +#include "chromeos/dbus/dbus_thread_manager.h" +#include "chromeos/dbus/fake_session_manager_client.h" +#include "chromeos/dbus/fake_shill_manager_client.h" +#include "components/ownership/mock_owner_key_util.h" +#include "extensions/browser/app_window/app_window.h" +#include "extensions/browser/app_window/app_window_registry.h" +#include "extensions/browser/app_window/native_app_window.h" +#include "extensions/common/value_builder.h" +#include "extensions/test/extension_test_message_listener.h" +#include "net/dns/mock_host_resolver.h" + +namespace em = enterprise_management; + +namespace chromeos { + +namespace { + +const char kTestKioskApp[] = "ggbflgnkafappblpkiflbgpmkfdpnhhe"; + +void CreateAndInitializeLocalCache() { + base::FilePath extension_cache_dir; + CHECK(PathService::Get(chromeos::DIR_DEVICE_EXTENSION_LOCAL_CACHE, + &extension_cache_dir)); + base::FilePath cache_init_file = extension_cache_dir.Append( + extensions::LocalExtensionCache::kCacheReadyFlagFileName); + EXPECT_EQ(base::WriteFile(cache_init_file, "", 0), 0); +} + +} // namespace + +class KioskCrashRestoreTest : public InProcessBrowserTest { + public: + KioskCrashRestoreTest() + : owner_key_util_(new ownership::MockOwnerKeyUtil()), + fake_cws_(new FakeCWS) {} + + // InProcessBrowserTest + void SetUp() override { + ASSERT_TRUE(embedded_test_server()->InitializeAndListen()); + InProcessBrowserTest::SetUp(); + } + + bool SetUpUserDataDirectory() override { + SetUpExistingKioskApp(); + return true; + } + + void SetUpInProcessBrowserTestFixture() override { + host_resolver()->AddRule("*", "127.0.0.1"); + SimulateNetworkOnline(); + + OverrideDevicePolicy(); + } + + void SetUpCommandLine(base::CommandLine* command_line) override { + const AccountId account_id = AccountId::FromUserEmail(GetTestAppUserId()); + const cryptohome::Identification cryptohome_id(account_id); + + command_line->AppendSwitchASCII(switches::kLoginUser, cryptohome_id.id()); + command_line->AppendSwitchASCII( + switches::kLoginProfile, + CryptohomeClient::GetStubSanitizedUsername(cryptohome_id)); + + fake_cws_->Init(embedded_test_server()); + fake_cws_->SetUpdateCrx(test_app_id_, test_app_id_ + ".crx", "1.0.0"); + } + + void SetUpOnMainThread() override { + CreateAndInitializeLocalCache(); + + embedded_test_server()->StartAcceptingConnections(); + } + + const std::string GetTestAppUserId() const { + return policy::GenerateDeviceLocalAccountUserId( + test_app_id_, policy::DeviceLocalAccount::TYPE_KIOSK_APP); + } + + const std::string& test_app_id() const { return test_app_id_; } + + private: + void SetUpExistingKioskApp() { + // Create policy data that contains the test app as an existing kiosk app. + em::DeviceLocalAccountsProto* const device_local_accounts = + device_policy_.payload().mutable_device_local_accounts(); + + em::DeviceLocalAccountInfoProto* const account = + device_local_accounts->add_account(); + account->set_account_id(test_app_id_); + account->set_type( + em::DeviceLocalAccountInfoProto_AccountType_ACCOUNT_TYPE_KIOSK_APP); + account->mutable_kiosk_app()->set_app_id(test_app_id_); + device_policy_.Build(); + + // Prepare the policy data to store in device policy cache. + em::PolicyData policy_data; + CHECK(device_policy_.payload().SerializeToString( + policy_data.mutable_policy_value())); + const std::string policy_data_string = policy_data.SerializeAsString(); + std::string encoded; + base::Base64Encode(policy_data_string, &encoded); + + // Store policy data and existing device local accounts in local state. + const std::string local_state_json = + extensions::DictionaryBuilder() + .Set(prefs::kDeviceSettingsCache, encoded) + .Set("PublicAccounts", + extensions::ListBuilder().Append(GetTestAppUserId()).Build()) + .ToJSON(); + + base::FilePath local_state_file; + CHECK(PathService::Get(chrome::DIR_USER_DATA, &local_state_file)); + local_state_file = local_state_file.Append(chrome::kLocalStateFilename); + base::WriteFile(local_state_file, local_state_json.data(), + local_state_json.size()); + } + + void SimulateNetworkOnline() { + NetworkPortalDetectorTestImpl* const network_portal_detector = + new NetworkPortalDetectorTestImpl(); + // Takes ownership of |network_portal_detector|. + network_portal_detector::InitializeForTesting(network_portal_detector); + network_portal_detector->SetDefaultNetworkForTesting( + FakeShillManagerClient::kFakeEthernetNetworkGuid); + + NetworkPortalDetector::CaptivePortalState online_state; + online_state.status = NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_ONLINE; + online_state.response_code = 204; + network_portal_detector->SetDetectionResultsForTesting( + FakeShillManagerClient::kFakeEthernetNetworkGuid, online_state); + } + + void OverrideDevicePolicy() { + OwnerSettingsServiceChromeOSFactory::GetInstance() + ->SetOwnerKeyUtilForTesting(owner_key_util_); + owner_key_util_->SetPublicKeyFromPrivateKey( + *device_policy_.GetSigningKey()); + + session_manager_client_ = new FakeSessionManagerClient; + session_manager_client_->set_device_policy(device_policy_.GetBlob()); + + DBusThreadManager::GetSetterForTesting()->SetSessionManagerClient( + std::unique_ptr<SessionManagerClient>(session_manager_client_)); + } + + std::string test_app_id_ = kTestKioskApp; + + policy::DevicePolicyBuilder device_policy_; + scoped_refptr<ownership::MockOwnerKeyUtil> owner_key_util_; + FakeSessionManagerClient* session_manager_client_; + std::unique_ptr<FakeCWS> fake_cws_; + + DISALLOW_COPY_AND_ASSIGN(KioskCrashRestoreTest); +}; + +IN_PROC_BROWSER_TEST_F(KioskCrashRestoreTest, Basic) { + ExtensionTestMessageListener launch_data_check_listener( + "launchData.isKioskSession = true", false); + + Profile* const app_profile = ProfileManager::GetPrimaryUserProfile(); + ASSERT_TRUE(app_profile); + extensions::AppWindowRegistry* const app_window_registry = + extensions::AppWindowRegistry::Get(app_profile); + extensions::AppWindow* const window = + AppWindowWaiter(app_window_registry, test_app_id()).Wait(); + ASSERT_TRUE(window); + + window->GetBaseWindow()->Close(); + + // Wait until the app terminates if it is still running. + if (!app_window_registry->GetAppWindowsForApp(test_app_id()).empty()) + base::RunLoop().Run(); + + EXPECT_TRUE(launch_data_check_listener.was_satisfied()); +} + +} // namespace chromeos
diff --git a/chrome/browser/chromeos/app_mode/startup_app_launcher.cc b/chrome/browser/chromeos/app_mode/startup_app_launcher.cc index 2f67c0e9..3eb88a0 100644 --- a/chrome/browser/chromeos/app_mode/startup_app_launcher.cc +++ b/chrome/browser/chromeos/app_mode/startup_app_launcher.cc
@@ -269,7 +269,8 @@ extensions::ExtensionSystem::Get(profile_) ->extension_service() ->updater(); - if (!delegate_->IsNetworkReady() || !updater) { + if (!delegate_->IsNetworkReady() || !updater || + PrimaryAppHasPendingUpdate()) { MaybeLaunchApp(); return; } @@ -405,6 +406,12 @@ return extensions::KioskModeInfo::HasSecondaryApps(extension); } +bool StartupAppLauncher::PrimaryAppHasPendingUpdate() const { + return !!extensions::ExtensionSystem::Get(profile_) + ->extension_service() + ->GetPendingExtensionUpdate(app_id_); +} + bool StartupAppLauncher::DidPrimaryOrSecondaryAppFailedToInstall( bool success, const std::string& id) const { @@ -536,11 +543,16 @@ void StartupAppLauncher::OnReadyToLaunch() { ready_to_launch_ = true; - UpdateAppData(); + MaybeUpdateAppData(); delegate_->OnReadyToLaunch(); } -void StartupAppLauncher::UpdateAppData() { +void StartupAppLauncher::MaybeUpdateAppData() { + // Skip copying meta data from the current installed primary app when + // there is a pending update. + if (PrimaryAppHasPendingUpdate()) + return; + KioskAppManager::Get()->ClearAppData(app_id_); KioskAppManager::Get()->UpdateAppDataFromProfile(app_id_, profile_, NULL); }
diff --git a/chrome/browser/chromeos/app_mode/startup_app_launcher.h b/chrome/browser/chromeos/app_mode/startup_app_launcher.h index 4f4770bd..49a7f62 100644 --- a/chrome/browser/chromeos/app_mode/startup_app_launcher.h +++ b/chrome/browser/chromeos/app_mode/startup_app_launcher.h
@@ -90,7 +90,7 @@ void BeginInstall(); void OnReadyToLaunch(); - void UpdateAppData(); + void MaybeUpdateAppData(); void InitializeTokenService(); void MaybeInitializeNetwork(); @@ -115,6 +115,9 @@ // Returns true if secondary apps are declared in manifest. bool HasSecondaryApps() const; + // Returns true if the primary app has a pending update. + bool PrimaryAppHasPendingUpdate() const; + // Returns true if the app with |id| failed, and it is the primary or one of // the secondary apps. bool DidPrimaryOrSecondaryAppFailedToInstall(bool success,
diff --git a/chrome/browser/chromeos/arc/arc_policy_bridge.cc b/chrome/browser/chromeos/arc/arc_policy_bridge.cc index 54d4c91..84ab6407 100644 --- a/chrome/browser/chromeos/arc/arc_policy_bridge.cc +++ b/chrome/browser/chromeos/arc/arc_policy_bridge.cc
@@ -29,21 +29,41 @@ // invert_bool_value: If the Chrome policy and the ARC policy with boolean value // have opposite semantics, set this to true so the bool is inverted before // being added. Otherwise, set it to false. -void AddPolicy(const std::string& arc_policy_name, - const std::string& policy_name, - const policy::PolicyMap& policy_map, - bool invert_bool_value, - base::DictionaryValue* filtered_policies) { +void MapBoolToBool(const std::string& arc_policy_name, + const std::string& policy_name, + const policy::PolicyMap& policy_map, + bool invert_bool_value, + base::DictionaryValue* filtered_policies) { const base::Value* const policy_value = policy_map.GetValue(policy_name); - if (policy_value) { - if (invert_bool_value && policy_value->IsType(base::Value::TYPE_BOOLEAN)) { - bool bool_value; - policy_value->GetAsBoolean(&bool_value); - filtered_policies->SetBoolean(arc_policy_name, !bool_value); - } else { - filtered_policies->Set(arc_policy_name, policy_value->CreateDeepCopy()); - } + if (!policy_value) + return; + if (!policy_value->IsType(base::Value::TYPE_BOOLEAN)) { + LOG(ERROR) << "Policy " << policy_name << " is not a boolean."; + return; } + bool bool_value; + policy_value->GetAsBoolean(&bool_value); + filtered_policies->SetBoolean(arc_policy_name, + bool_value != invert_bool_value); +} + +// int_true: value of Chrome OS policy for which arc policy is set to true. +// It is set to false for all other values. +void MapIntToBool(const std::string& arc_policy_name, + const std::string& policy_name, + const policy::PolicyMap& policy_map, + int int_true, + base::DictionaryValue* filtered_policies) { + const base::Value* const policy_value = policy_map.GetValue(policy_name); + if (!policy_value) + return; + if (!policy_value->IsType(base::Value::TYPE_INTEGER)) { + LOG(ERROR) << "Policy " << policy_name << " is not an integer."; + return; + } + int int_value; + policy_value->GetAsInteger(&int_value); + filtered_policies->SetBoolean(arc_policy_name, int_value == int_true); } void AddGlobalAppRestriction(const std::string& arc_app_restriction_name, @@ -87,12 +107,14 @@ } // Keep them sorted by the ARC policy names. - AddPolicy("cameraDisabled", policy::key::kVideoCaptureAllowed, policy_map, - true, &filtered_policies); - AddPolicy("screenCaptureDisabled", policy::key::kDisableScreenshots, - policy_map, false, &filtered_policies); - AddPolicy("unmuteMicrophoneDisabled", policy::key::kAudioCaptureAllowed, - policy_map, true, &filtered_policies); + MapBoolToBool("cameraDisabled", policy::key::kVideoCaptureAllowed, policy_map, + true, &filtered_policies); + MapBoolToBool("screenCaptureDisabled", policy::key::kDisableScreenshots, + policy_map, false, &filtered_policies); + MapIntToBool("shareLocationDisabled", policy::key::kDefaultGeolocationSetting, + policy_map, 2 /*BlockGeolocation*/, &filtered_policies); + MapBoolToBool("unmuteMicrophoneDisabled", policy::key::kAudioCaptureAllowed, + policy_map, true, &filtered_policies); // Add global app restrictions. AddGlobalAppRestriction("com.android.browser:URLBlacklist",
diff --git a/chrome/browser/chromeos/arc/arc_policy_bridge_unittest.cc b/chrome/browser/chromeos/arc/arc_policy_bridge_unittest.cc index f04a340..1c4b4a2 100644 --- a/chrome/browser/chromeos/arc/arc_policy_bridge_unittest.cc +++ b/chrome/browser/chromeos/arc/arc_policy_bridge_unittest.cc
@@ -137,6 +137,27 @@ PolicyStringCallback("{\"unmuteMicrophoneDisabled\":true}")); } +TEST_F(ArcPolicyBridgeTest, DefaultGeolocationSettingTest) { + policy_map().Set(policy::key::kDefaultGeolocationSetting, + policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER, + policy::POLICY_SOURCE_CLOUD, new base::FundamentalValue(1), + nullptr); + policy_bridge()->GetPolicies( + PolicyStringCallback("{\"shareLocationDisabled\":false}")); + policy_map().Set(policy::key::kDefaultGeolocationSetting, + policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER, + policy::POLICY_SOURCE_CLOUD, new base::FundamentalValue(2), + nullptr); + policy_bridge()->GetPolicies( + PolicyStringCallback("{\"shareLocationDisabled\":true}")); + policy_map().Set(policy::key::kDefaultGeolocationSetting, + policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER, + policy::POLICY_SOURCE_CLOUD, new base::FundamentalValue(3), + nullptr); + policy_bridge()->GetPolicies( + PolicyStringCallback("{\"shareLocationDisabled\":false}")); +} + TEST_F(ArcPolicyBridgeTest, URLBlacklistTest) { base::ListValue blacklist; blacklist.Append(new base::StringValue("www.blacklist1.com"));
diff --git a/chrome/browser/chromeos/background/ash_user_wallpaper_delegate.cc b/chrome/browser/chromeos/background/ash_user_wallpaper_delegate.cc index d91d717b..670ab59 100644 --- a/chrome/browser/chromeos/background/ash_user_wallpaper_delegate.cc +++ b/chrome/browser/chromeos/background/ash_user_wallpaper_delegate.cc
@@ -6,6 +6,7 @@ #include "ash/desktop_background/user_wallpaper_delegate.h" #include "ash/shell.h" +#include "ash/wm/common/window_animation_types.h" #include "ash/wm/window_animations.h" #include "base/command_line.h" #include "base/logging.h" @@ -48,9 +49,9 @@ ~UserWallpaperDelegate() override {} int GetAnimationType() override { - return ShouldShowInitialAnimation() ? - ash::WINDOW_VISIBILITY_ANIMATION_TYPE_BRIGHTNESS_GRAYSCALE : - static_cast<int>(wm::WINDOW_VISIBILITY_ANIMATION_TYPE_FADE); + return ShouldShowInitialAnimation() + ? ash::wm::WINDOW_VISIBILITY_ANIMATION_TYPE_BRIGHTNESS_GRAYSCALE + : static_cast<int>(::wm::WINDOW_VISIBILITY_ANIMATION_TYPE_FADE); } int GetAnimationDurationOverride() override {
diff --git a/chrome/browser/chromeos/chrome_browser_main_chromeos.cc b/chrome/browser/chromeos/chrome_browser_main_chromeos.cc index 9921c46..8aae6436 100644 --- a/chrome/browser/chromeos/chrome_browser_main_chromeos.cc +++ b/chrome/browser/chromeos/chrome_browser_main_chromeos.cc
@@ -534,7 +534,7 @@ user_manager::UserManager* user_manager = user_manager::UserManager::Get(); - if (policy::IsDeviceLocalAccountUser(account_id.GetUserEmail(), NULL) && + if (policy::IsDeviceLocalAccountUser(account_id.GetUserEmail(), nullptr) && !user_manager->IsKnownUser(account_id)) { // When a device-local account is removed, its policy is deleted from disk // immediately. If a session using this account happens to be in progress, @@ -665,7 +665,7 @@ manager->SetState(session_manager->GetDefaultIMEState(profile())); - bool is_running_test = parameters().ui_task != NULL; + bool is_running_test = parameters().ui_task != nullptr; g_browser_process->platform_part()->InitializeSessionManager( parsed_command_line(), profile(), is_running_test); g_browser_process->platform_part()->SessionManager()->Start();
diff --git a/chrome/browser/chromeos/drive/debug_info_collector.h b/chrome/browser/chromeos/drive/debug_info_collector.h index 2e1ad481..71cc78f 100644 --- a/chrome/browser/chromeos/drive/debug_info_collector.h +++ b/chrome/browser/chromeos/drive/debug_info_collector.h
@@ -8,7 +8,7 @@ #include "base/callback_forward.h" #include "base/macros.h" #include "base/threading/thread_checker.h" -#include "components/drive/file_system_interface.h" +#include "components/drive/chromeos/file_system_interface.h" namespace drive {
diff --git a/chrome/browser/chromeos/drive/download_handler.cc b/chrome/browser/chromeos/drive/download_handler.cc index 7d24a88..e2fd146 100644 --- a/chrome/browser/chromeos/drive/download_handler.cc +++ b/chrome/browser/chromeos/drive/download_handler.cc
@@ -19,8 +19,8 @@ #include "chrome/browser/download/download_history.h" #include "chrome/browser/download/download_service.h" #include "chrome/browser/download/download_service_factory.h" +#include "components/drive/chromeos/file_system_interface.h" #include "components/drive/drive.pb.h" -#include "components/drive/file_system_interface.h" #include "content/public/browser/browser_thread.h" using content::BrowserThread;
diff --git a/chrome/browser/chromeos/drive/download_handler_unittest.cc b/chrome/browser/chromeos/drive/download_handler_unittest.cc index 6fe5e85f..0789778 100644 --- a/chrome/browser/chromeos/drive/download_handler_unittest.cc +++ b/chrome/browser/chromeos/drive/download_handler_unittest.cc
@@ -10,7 +10,7 @@ #include "base/run_loop.h" #include "chrome/browser/chromeos/drive/file_system_util.h" #include "chrome/test/base/testing_profile.h" -#include "components/drive/dummy_file_system.h" +#include "components/drive/chromeos/dummy_file_system.h" #include "components/drive/file_system_core_util.h" #include "content/public/test/mock_download_item.h" #include "content/public/test/mock_download_manager.h"
diff --git a/chrome/browser/chromeos/drive/drive_file_stream_reader.cc b/chrome/browser/chromeos/drive/drive_file_stream_reader.cc index 7494e75..233857b 100644 --- a/chrome/browser/chromeos/drive/drive_file_stream_reader.cc +++ b/chrome/browser/chromeos/drive/drive_file_stream_reader.cc
@@ -12,8 +12,8 @@ #include "base/callback_helpers.h" #include "base/logging.h" #include "base/sequenced_task_runner.h" +#include "components/drive/chromeos/file_system_interface.h" #include "components/drive/drive.pb.h" -#include "components/drive/file_system_interface.h" #include "components/drive/local_file_reader.h" #include "content/public/browser/browser_thread.h" #include "google_apis/drive/task_util.h"
diff --git a/chrome/browser/chromeos/drive/drive_file_stream_reader_unittest.cc b/chrome/browser/chromeos/drive/drive_file_stream_reader_unittest.cc index d03648ec..2163606 100644 --- a/chrome/browser/chromeos/drive/drive_file_stream_reader_unittest.cc +++ b/chrome/browser/chromeos/drive/drive_file_stream_reader_unittest.cc
@@ -14,8 +14,8 @@ #include "base/files/scoped_temp_dir.h" #include "base/run_loop.h" #include "base/threading/thread.h" -#include "components/drive/drive_test_util.h" -#include "components/drive/fake_file_system.h" +#include "components/drive/chromeos/drive_test_util.h" +#include "components/drive/chromeos/fake_file_system.h" #include "components/drive/file_system_core_util.h" #include "components/drive/local_file_reader.h" #include "components/drive/service/fake_drive_service.h"
diff --git a/chrome/browser/chromeos/drive/drive_integration_service.cc b/chrome/browser/chromeos/drive/drive_integration_service.cc index e6bde73..96f922bc 100644 --- a/chrome/browser/chromeos/drive/drive_integration_service.cc +++ b/chrome/browser/chromeos/drive/drive_integration_service.cc
@@ -26,15 +26,15 @@ #include "chrome/browser/signin/signin_manager_factory.h" #include "chrome/common/pref_names.h" #include "chrome/grit/generated_resources.h" +#include "components/drive/chromeos/file_cache.h" +#include "components/drive/chromeos/file_system.h" +#include "components/drive/chromeos/resource_metadata.h" #include "components/drive/drive_api_util.h" #include "components/drive/drive_app_registry.h" #include "components/drive/drive_notification_manager.h" #include "components/drive/drive_pref_names.h" #include "components/drive/event_logger.h" -#include "components/drive/file_cache.h" -#include "components/drive/file_system.h" #include "components/drive/job_scheduler.h" -#include "components/drive/resource_metadata.h" #include "components/drive/resource_metadata_storage.h" #include "components/drive/service/drive_api_service.h" #include "components/keyed_service/content/browser_context_dependency_manager.h"
diff --git a/chrome/browser/chromeos/drive/drive_integration_service_unittest.cc b/chrome/browser/chromeos/drive/drive_integration_service_unittest.cc index 3348d8d..d1d77e7 100644 --- a/chrome/browser/chromeos/drive/drive_integration_service_unittest.cc +++ b/chrome/browser/chromeos/drive/drive_integration_service_unittest.cc
@@ -7,7 +7,7 @@ #include "chrome/test/base/testing_browser_process.h" #include "chrome/test/base/testing_profile.h" #include "chrome/test/base/testing_profile_manager.h" -#include "components/drive/dummy_file_system.h" +#include "components/drive/chromeos/dummy_file_system.h" #include "components/drive/service/dummy_drive_service.h" #include "content/public/test/test_browser_thread_bundle.h" #include "content/public/test/test_utils.h"
diff --git a/chrome/browser/chromeos/drive/file_system_util.cc b/chrome/browser/chromeos/drive/file_system_util.cc index 55b68cd2..6a1fb51 100644 --- a/chrome/browser/chromeos/drive/file_system_util.cc +++ b/chrome/browser/chromeos/drive/file_system_util.cc
@@ -33,10 +33,10 @@ #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_paths_internal.h" #include "chromeos/chromeos_constants.h" +#include "components/drive/chromeos/file_system_interface.h" #include "components/drive/drive.pb.h" #include "components/drive/drive_pref_names.h" #include "components/drive/file_system_core_util.h" -#include "components/drive/file_system_interface.h" #include "components/drive/job_list.h" #include "components/prefs/pref_service.h" #include "components/user_manager/user_manager.h"
diff --git a/chrome/browser/chromeos/drive/file_task_executor.cc b/chrome/browser/chromeos/drive/file_task_executor.cc index e07cd4b..b0cad9e 100644 --- a/chrome/browser/chromeos/drive/file_task_executor.cc +++ b/chrome/browser/chromeos/drive/file_task_executor.cc
@@ -18,8 +18,8 @@ #include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" #include "chrome/common/extensions/api/file_manager_private.h" +#include "components/drive/chromeos/file_system_interface.h" #include "components/drive/drive.pb.h" -#include "components/drive/file_system_interface.h" #include "components/drive/service/drive_service_interface.h" #include "content/public/browser/browser_thread.h" #include "storage/browser/fileapi/file_system_url.h"
diff --git a/chrome/browser/chromeos/drive/file_task_executor_unittest.cc b/chrome/browser/chromeos/drive/file_task_executor_unittest.cc index d4f8f7b..5d7c585 100644 --- a/chrome/browser/chromeos/drive/file_task_executor_unittest.cc +++ b/chrome/browser/chromeos/drive/file_task_executor_unittest.cc
@@ -8,7 +8,7 @@ #include <string> #include "base/run_loop.h" -#include "components/drive/fake_file_system.h" +#include "components/drive/chromeos/fake_file_system.h" #include "components/drive/service/fake_drive_service.h" #include "content/public/test/test_browser_thread_bundle.h" #include "google_apis/drive/drive_api_parser.h"
diff --git a/chrome/browser/chromeos/drive/fileapi/file_system_backend_delegate.cc b/chrome/browser/chromeos/drive/fileapi/file_system_backend_delegate.cc index d4c4483c..e42ce7f 100644 --- a/chrome/browser/chromeos/drive/fileapi/file_system_backend_delegate.cc +++ b/chrome/browser/chromeos/drive/fileapi/file_system_backend_delegate.cc
@@ -13,8 +13,8 @@ #include "chrome/browser/chromeos/drive/fileapi/fileapi_worker.h" #include "chrome/browser/chromeos/drive/fileapi/webkit_file_stream_reader_impl.h" #include "chrome/browser/chromeos/drive/fileapi/webkit_file_stream_writer_impl.h" +#include "components/drive/chromeos/file_system_interface.h" #include "components/drive/drive_api_util.h" -#include "components/drive/file_system_interface.h" #include "content/public/browser/browser_thread.h" #include "storage/browser/fileapi/async_file_util.h" #include "storage/browser/fileapi/file_stream_reader.h"
diff --git a/chrome/browser/chromeos/drive/fileapi/fileapi_worker.cc b/chrome/browser/chromeos/drive/fileapi/fileapi_worker.cc index b62964f..5b437ee 100644 --- a/chrome/browser/chromeos/drive/fileapi/fileapi_worker.cc +++ b/chrome/browser/chromeos/drive/fileapi/fileapi_worker.cc
@@ -13,9 +13,9 @@ #include "base/thread_task_runner_handle.h" #include "base/threading/sequenced_worker_pool.h" #include "chrome/browser/chromeos/drive/file_system_util.h" +#include "components/drive/chromeos/file_system_interface.h" #include "components/drive/drive.pb.h" #include "components/drive/file_errors.h" -#include "components/drive/file_system_interface.h" #include "components/drive/resource_entry_conversion.h" #include "content/public/browser/browser_thread.h" #include "storage/browser/fileapi/file_system_url.h"
diff --git a/chrome/browser/chromeos/drive/fileapi/fileapi_worker_unittest.cc b/chrome/browser/chromeos/drive/fileapi/fileapi_worker_unittest.cc index 74052d2..c184256 100644 --- a/chrome/browser/chromeos/drive/fileapi/fileapi_worker_unittest.cc +++ b/chrome/browser/chromeos/drive/fileapi/fileapi_worker_unittest.cc
@@ -11,7 +11,7 @@ #include "base/bind.h" #include "base/bind_helpers.h" #include "base/files/file_util.h" -#include "components/drive/dummy_file_system.h" +#include "components/drive/chromeos/dummy_file_system.h" #include "content/public/test/test_browser_thread_bundle.h" #include "content/public/test/test_utils.h" #include "google_apis/drive/test_util.h"
diff --git a/chrome/browser/chromeos/drive/fileapi/webkit_file_stream_reader_impl_unittest.cc b/chrome/browser/chromeos/drive/fileapi/webkit_file_stream_reader_impl_unittest.cc index 4210c9d..6edc61ce 100644 --- a/chrome/browser/chromeos/drive/fileapi/webkit_file_stream_reader_impl_unittest.cc +++ b/chrome/browser/chromeos/drive/fileapi/webkit_file_stream_reader_impl_unittest.cc
@@ -15,10 +15,10 @@ #include "base/run_loop.h" #include "base/threading/thread.h" #include "base/time/time.h" -#include "components/drive/drive_test_util.h" -#include "components/drive/fake_file_system.h" +#include "components/drive/chromeos/drive_test_util.h" +#include "components/drive/chromeos/fake_file_system.h" +#include "components/drive/chromeos/file_system_interface.h" #include "components/drive/file_system_core_util.h" -#include "components/drive/file_system_interface.h" #include "components/drive/service/fake_drive_service.h" #include "components/drive/service/test_util.h" #include "content/public/test/test_browser_thread_bundle.h"
diff --git a/chrome/browser/chromeos/drive/write_on_cache_file.cc b/chrome/browser/chromeos/drive/write_on_cache_file.cc index 9b4b3b1..c6b0b2c 100644 --- a/chrome/browser/chromeos/drive/write_on_cache_file.cc +++ b/chrome/browser/chromeos/drive/write_on_cache_file.cc
@@ -7,8 +7,8 @@ #include "base/bind.h" #include "base/callback.h" #include "base/threading/sequenced_worker_pool.h" +#include "components/drive/chromeos/file_system_interface.h" #include "components/drive/file_system_core_util.h" -#include "components/drive/file_system_interface.h" #include "content/public/browser/browser_thread.h" using content::BrowserThread;
diff --git a/chrome/browser/chromeos/drive/write_on_cache_file_unittest.cc b/chrome/browser/chromeos/drive/write_on_cache_file_unittest.cc index 1bca4fc3..64ae849 100644 --- a/chrome/browser/chromeos/drive/write_on_cache_file_unittest.cc +++ b/chrome/browser/chromeos/drive/write_on_cache_file_unittest.cc
@@ -5,7 +5,7 @@ #include "chrome/browser/chromeos/drive/write_on_cache_file.h" #include "base/bind.h" -#include "components/drive/dummy_file_system.h" +#include "components/drive/chromeos/dummy_file_system.h" #include "content/public/test/test_browser_thread_bundle.h" #include "content/public/test/test_utils.h" #include "google_apis/drive/test_util.h"
diff --git a/chrome/browser/chromeos/extensions/file_manager/event_router.cc b/chrome/browser/chromeos/extensions/file_manager/event_router.cc index a59bc72..78bfead 100644 --- a/chrome/browser/chromeos/extensions/file_manager/event_router.cc +++ b/chrome/browser/chromeos/extensions/file_manager/event_router.cc
@@ -38,9 +38,9 @@ #include "chromeos/login/login_state.h" #include "chromeos/network/network_handler.h" #include "chromeos/network/network_state_handler.h" +#include "components/drive/chromeos/file_system_interface.h" #include "components/drive/drive_pref_names.h" #include "components/drive/file_change.h" -#include "components/drive/file_system_interface.h" #include "components/drive/service/drive_service_interface.h" #include "components/prefs/pref_change_registrar.h" #include "components/prefs/pref_service.h"
diff --git a/chrome/browser/chromeos/extensions/file_manager/event_router.h b/chrome/browser/chromeos/extensions/file_manager/event_router.h index ce0c827..9f310ace 100644 --- a/chrome/browser/chromeos/extensions/file_manager/event_router.h +++ b/chrome/browser/chromeos/extensions/file_manager/event_router.h
@@ -26,9 +26,9 @@ #include "chromeos/disks/disk_mount_manager.h" #include "chromeos/network/network_state_handler_observer.h" #include "chromeos/settings/timezone_settings.h" -#include "components/drive/file_system_observer.h" +#include "components/drive/chromeos/file_system_observer.h" +#include "components/drive/chromeos/sync_client.h" #include "components/drive/service/drive_service_interface.h" -#include "components/drive/sync_client.h" #include "components/keyed_service/core/keyed_service.h" #include "storage/browser/fileapi/file_system_operation.h"
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 7977cd5..9bde9a3d1 100644 --- a/chrome/browser/chromeos/extensions/file_manager/private_api_drive.h +++ b/chrome/browser/chromeos/extensions/file_manager/private_api_drive.h
@@ -16,8 +16,8 @@ #include "base/files/file.h" #include "chrome/browser/chromeos/extensions/file_manager/private_api_base.h" #include "chrome/browser/chromeos/file_manager/fileapi_util.h" +#include "components/drive/chromeos/file_system_interface.h" #include "components/drive/file_errors.h" -#include "components/drive/file_system_interface.h" namespace drive { class FileCacheEntry;
diff --git a/chrome/browser/chromeos/extensions/file_manager/private_api_file_system.cc b/chrome/browser/chromeos/extensions/file_manager/private_api_file_system.cc index 64f8d246..1cc3dfcc 100644 --- a/chrome/browser/chromeos/extensions/file_manager/private_api_file_system.cc +++ b/chrome/browser/chromeos/extensions/file_manager/private_api_file_system.cc
@@ -34,9 +34,9 @@ #include "chrome/common/extensions/api/file_manager_private.h" #include "chrome/common/extensions/api/file_manager_private_internal.h" #include "chromeos/disks/disk_mount_manager.h" +#include "components/drive/chromeos/file_system_interface.h" #include "components/drive/drive.pb.h" #include "components/drive/event_logger.h" -#include "components/drive/file_system_interface.h" #include "components/storage_monitor/storage_info.h" #include "components/storage_monitor/storage_monitor.h" #include "content/public/browser/child_process_security_policy.h"
diff --git a/chrome/browser/chromeos/extensions/file_manager/private_api_mount.cc b/chrome/browser/chromeos/extensions/file_manager/private_api_mount.cc index c21b6bb..708b3e7 100644 --- a/chrome/browser/chromeos/extensions/file_manager/private_api_mount.cc +++ b/chrome/browser/chromeos/extensions/file_manager/private_api_mount.cc
@@ -16,8 +16,8 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/common/extensions/api/file_manager_private.h" #include "chromeos/disks/disk_mount_manager.h" +#include "components/drive/chromeos/file_system_interface.h" #include "components/drive/event_logger.h" -#include "components/drive/file_system_interface.h" #include "content/public/browser/browser_thread.h" #include "google_apis/drive/task_util.h" #include "ui/shell_dialogs/selected_file_info.h"
diff --git a/chrome/browser/chromeos/extensions/file_manager/private_api_util.cc b/chrome/browser/chromeos/extensions/file_manager/private_api_util.cc index b7d73034..669358d 100644 --- a/chrome/browser/chromeos/extensions/file_manager/private_api_util.cc +++ b/chrome/browser/chromeos/extensions/file_manager/private_api_util.cc
@@ -22,9 +22,9 @@ #include "chrome/browser/chromeos/fileapi/file_system_backend.h" #include "chrome/browser/profiles/profile.h" #include "chrome/common/extensions/api/file_manager_private.h" +#include "components/drive/chromeos/file_system_interface.h" #include "components/drive/drive.pb.h" #include "components/drive/file_errors.h" -#include "components/drive/file_system_interface.h" #include "content/public/browser/child_process_security_policy.h" #include "storage/browser/fileapi/file_system_context.h" #include "storage/browser/fileapi/file_system_url.h"
diff --git a/chrome/browser/chromeos/extensions/info_private_apitest.cc b/chrome/browser/chromeos/extensions/info_private_apitest.cc index 7866a51..6fdb457 100644 --- a/chrome/browser/chromeos/extensions/info_private_apitest.cc +++ b/chrome/browser/chromeos/extensions/info_private_apitest.cc
@@ -8,8 +8,7 @@ #include "chromeos/settings/cros_settings_names.h" #include "components/prefs/pref_service.h" -// Disabled due to flakiness, see crbug.com/600886 for details. -IN_PROC_BROWSER_TEST_F(ExtensionApiTest, DISABLED_ChromeOSInfoPrivateTest) { +IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ChromeOSInfoPrivateTest) { // Set the initial timezone different from what JS function // timezoneSetTest() will attempt to set. base::StringValue initial_timezone("America/Los_Angeles");
diff --git a/chrome/browser/chromeos/file_manager/file_manager_browsertest_base.cc b/chrome/browser/chromeos/file_manager/file_manager_browsertest_base.cc index a3ecae5..a56bd38 100644 --- a/chrome/browser/chromeos/file_manager/file_manager_browsertest_base.cc +++ b/chrome/browser/chromeos/file_manager/file_manager_browsertest_base.cc
@@ -24,7 +24,7 @@ #include "chrome/browser/notifications/notification_ui_manager.h" #include "chrome/common/chrome_switches.h" #include "chromeos/chromeos_switches.h" -#include "components/drive/file_system_interface.h" +#include "components/drive/chromeos/file_system_interface.h" #include "components/drive/service/fake_drive_service.h" #include "content/public/browser/notification_service.h" #include "content/public/test/test_utils.h"
diff --git a/chrome/browser/chromeos/file_manager/fileapi_util_unittest.cc b/chrome/browser/chromeos/file_manager/fileapi_util_unittest.cc index b35d5f3..f0db18ef 100644 --- a/chrome/browser/chromeos/file_manager/fileapi_util_unittest.cc +++ b/chrome/browser/chromeos/file_manager/fileapi_util_unittest.cc
@@ -8,8 +8,8 @@ #include "chrome/test/base/testing_browser_process.h" #include "chrome/test/base/testing_profile.h" #include "chrome/test/base/testing_profile_manager.h" -#include "components/drive/drive_test_util.h" -#include "components/drive/fake_file_system.h" +#include "components/drive/chromeos/drive_test_util.h" +#include "components/drive/chromeos/fake_file_system.h" #include "components/drive/service/fake_drive_service.h" #include "components/drive/service/test_util.h" #include "content/public/browser/storage_partition.h"
diff --git a/chrome/browser/chromeos/file_manager/filesystem_api_util.cc b/chrome/browser/chromeos/file_manager/filesystem_api_util.cc index ff80ebb4..aa6f9be 100644 --- a/chrome/browser/chromeos/file_manager/filesystem_api_util.cc +++ b/chrome/browser/chromeos/file_manager/filesystem_api_util.cc
@@ -16,9 +16,9 @@ #include "chrome/browser/chromeos/file_system_provider/provided_file_system_interface.h" #include "chrome/browser/extensions/extension_util.h" #include "chrome/browser/profiles/profile.h" +#include "components/drive/chromeos/file_system_interface.h" #include "components/drive/file_errors.h" #include "components/drive/file_system_core_util.h" -#include "components/drive/file_system_interface.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/storage_partition.h" #include "google_apis/drive/task_util.h"
diff --git a/chrome/browser/chromeos/file_manager/volume_manager.cc b/chrome/browser/chromeos/file_manager/volume_manager.cc index d7f79f4..237de53 100644 --- a/chrome/browser/chromeos/file_manager/volume_manager.cc +++ b/chrome/browser/chromeos/file_manager/volume_manager.cc
@@ -29,8 +29,8 @@ #include "chrome/common/pref_names.h" #include "chromeos/chromeos_switches.h" #include "chromeos/disks/disk_mount_manager.h" +#include "components/drive/chromeos/file_system_interface.h" #include "components/drive/file_system_core_util.h" -#include "components/drive/file_system_interface.h" #include "components/prefs/pref_service.h" #include "components/storage_monitor/storage_monitor.h" #include "content/public/browser/browser_context.h"
diff --git a/chrome/browser/chromeos/fileapi/external_file_url_request_job_unittest.cc b/chrome/browser/chromeos/fileapi/external_file_url_request_job_unittest.cc index 120e4c1..e790c1e 100644 --- a/chrome/browser/chromeos/fileapi/external_file_url_request_job_unittest.cc +++ b/chrome/browser/chromeos/fileapi/external_file_url_request_job_unittest.cc
@@ -22,8 +22,8 @@ #include "chrome/test/base/testing_browser_process.h" #include "chrome/test/base/testing_profile.h" #include "chrome/test/base/testing_profile_manager.h" -#include "components/drive/drive_test_util.h" -#include "components/drive/fake_file_system.h" +#include "components/drive/chromeos/drive_test_util.h" +#include "components/drive/chromeos/fake_file_system.h" #include "components/drive/service/fake_drive_service.h" #include "components/drive/service/test_util.h" #include "components/pref_registry/pref_registry_syncable.h"
diff --git a/chrome/browser/chromeos/input_method/mode_indicator_controller.cc b/chrome/browser/chromeos/input_method/mode_indicator_controller.cc index 2540032..e48347c2 100644 --- a/chrome/browser/chromeos/input_method/mode_indicator_controller.cc +++ b/chrome/browser/chromeos/input_method/mode_indicator_controller.cc
@@ -111,7 +111,7 @@ ash::kShellWindowId_SettingBubbleContainer); ui::ime::ModeIndicatorView* mi_view = new ui::ime::ModeIndicatorView( parent, cursor_bounds_, short_name); - views::BubbleDelegateView::CreateBubble(mi_view); + views::BubbleDialogDelegateView::CreateBubble(mi_view); views::Widget* mi_widget = mi_view->GetWidget(); if (GetModeIndicatorObserverForTesting())
diff --git a/chrome/browser/chromeos/input_method/mode_indicator_controller.h b/chrome/browser/chromeos/input_method/mode_indicator_controller.h index e1caf97..1201c32 100644 --- a/chrome/browser/chromeos/input_method/mode_indicator_controller.h +++ b/chrome/browser/chromeos/input_method/mode_indicator_controller.h
@@ -64,8 +64,8 @@ // True on a text field is focused. bool is_focused_; - // Observer of the widgets created by BubbleDelegateView. This is used to - // close the previous widget when a new widget is created. + // Observer of the widgets created by BubbleDialogDelegateView. This is used + // to close the previous widget when a new widget is created. std::unique_ptr<ModeIndicatorObserverInterface> mi_observer_; DISALLOW_COPY_AND_ASSIGN(ModeIndicatorController);
diff --git a/chrome/browser/chromeos/login/enrollment/enterprise_enrollment_helper_impl.cc b/chrome/browser/chromeos/login/enrollment/enterprise_enrollment_helper_impl.cc index 8c18f34..87f19a8e 100644 --- a/chrome/browser/chromeos/login/enrollment/enterprise_enrollment_helper_impl.cc +++ b/chrome/browser/chromeos/login/enrollment/enterprise_enrollment_helper_impl.cc
@@ -92,7 +92,7 @@ bool fetch_additional_token) { DCHECK(!started_); started_ = true; - oauth_fetcher_.reset(new policy::PolicyOAuth2TokenFetcher()); + oauth_fetcher_.reset(policy::PolicyOAuth2TokenFetcher::CreateInstance()); oauth_fetcher_->StartWithAuthCode( auth_code, g_browser_process->system_request_context(), base::Bind(&EnterpriseEnrollmentHelperImpl::OnTokenFetched, @@ -114,11 +114,11 @@ (new TokenRevoker())->Start(additional_token_); if (oauth_fetcher_) { - if (!oauth_fetcher_->oauth2_access_token().empty()) - (new TokenRevoker())->Start(oauth_fetcher_->oauth2_access_token()); + if (!oauth_fetcher_->OAuth2AccessToken().empty()) + (new TokenRevoker())->Start(oauth_fetcher_->OAuth2AccessToken()); - if (!oauth_fetcher_->oauth2_refresh_token().empty()) - (new TokenRevoker())->Start(oauth_fetcher_->oauth2_refresh_token()); + if (!oauth_fetcher_->OAuth2RefreshToken().empty()) + (new TokenRevoker())->Start(oauth_fetcher_->OAuth2RefreshToken()); oauth_fetcher_.reset(); } else if (oauth_token_.length()) { @@ -210,8 +210,8 @@ } additional_token_ = token; - std::string refresh_token = oauth_fetcher_->oauth2_refresh_token(); - oauth_fetcher_.reset(new policy::PolicyOAuth2TokenFetcher()); + std::string refresh_token = oauth_fetcher_->OAuth2RefreshToken(); + oauth_fetcher_.reset(policy::PolicyOAuth2TokenFetcher::CreateInstance()); oauth_fetcher_->StartWithRefreshToken( refresh_token, g_browser_process->system_request_context(), base::Bind(&EnterpriseEnrollmentHelperImpl::OnTokenFetched,
diff --git a/chrome/browser/chromeos/login/existing_user_controller.cc b/chrome/browser/chromeos/login/existing_user_controller.cc index 0ffe89c..421555f 100644 --- a/chrome/browser/chromeos/login/existing_user_controller.cc +++ b/chrome/browser/chromeos/login/existing_user_controller.cc
@@ -228,25 +228,29 @@ cros_settings_->GetBoolean(kAccountsPrefShowUserNamesOnSignIn, &show_users_on_signin); - for (user_manager::UserList::const_iterator it = users.begin(); - it != users.end(); - ++it) { + for (const auto& user : users) { + // Skip kiosk apps for login screen user list. Kiosk apps as pods (aka new + // kiosk UI) is currently disabled and it gets the apps directly from + // KioskAppManager. + if (user->GetType() == user_manager::USER_TYPE_KIOSK_APP) + continue; + // TODO(xiyuan): Clean user profile whose email is not in whitelist. - bool meets_supervised_requirements = - (*it)->GetType() != user_manager::USER_TYPE_SUPERVISED || + const bool meets_supervised_requirements = + user->GetType() != user_manager::USER_TYPE_SUPERVISED || user_manager::UserManager::Get()->AreSupervisedUsersAllowed(); - bool meets_whitelist_requirements = - CrosSettings::IsWhitelisted((*it)->email(), nullptr) || - !(*it)->HasGaiaAccount(); + const bool meets_whitelist_requirements = + CrosSettings::IsWhitelisted(user->email(), nullptr) || + !user->HasGaiaAccount(); // Public session accounts are always shown on login screen. - bool meets_show_users_requirements = + const bool meets_show_users_requirements = show_users_on_signin || - (*it)->GetType() == user_manager::USER_TYPE_PUBLIC_ACCOUNT; + user->GetType() == user_manager::USER_TYPE_PUBLIC_ACCOUNT; if (meets_supervised_requirements && meets_whitelist_requirements && meets_show_users_requirements) { - filtered_users.push_back(*it); + filtered_users.push_back(user); } }
diff --git a/chrome/browser/chromeos/login/kiosk_browsertest.cc b/chrome/browser/chromeos/login/kiosk_browsertest.cc index 58dcec28..7c262c4 100644 --- a/chrome/browser/chromeos/login/kiosk_browsertest.cc +++ b/chrome/browser/chromeos/login/kiosk_browsertest.cc
@@ -18,6 +18,7 @@ #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" #include "base/synchronization/lock.h" +#include "base/sys_info.h" #include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/chromeos/app_mode/fake_cws.h" #include "chrome/browser/chromeos/app_mode/kiosk_app_launch_error.h" @@ -255,6 +256,12 @@ return app->GetType(); } +void SetPlatformVersion(const std::string& platform_version) { + const std::string lsb_release = base::StringPrintf( + "CHROMEOS_RELEASE_VERSION=%s", platform_version.c_str()); + base::SysInfo::SetChromeOSVersionInfoForTest(lsb_release, base::Time::Now()); +} + // Helper functions for CanConfigureNetwork mock. class ScopedCanConfigureNetwork { public: @@ -1545,6 +1552,13 @@ LaunchKioskWithSecondaryApps(primary_app, secondary_apps); } + bool PrimaryAppUpdateIsPending() const { + Profile* app_profile = ProfileManager::GetPrimaryUserProfile(); + return !!extensions::ExtensionSystem::Get(app_profile) + ->extension_service() + ->GetPendingExtensionUpdate(test_app_id()); + } + private: class KioskAppExternalUpdateWaiter : public KioskAppManagerObserver { public: @@ -1915,6 +1929,84 @@ ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); } +// Tests the primary app install with required platform version. The test +// has three runs: +// 1. Install an app. +// 2. App update is delayed because the required platform version is not +// compliant. +// 3. Platform version changed and the new app is installed because it is +// compliant now. +IN_PROC_BROWSER_TEST_F(KioskUpdateTest, + PRE_PRE_IncompliantPlatformDelayInstall) { + PreCacheAndLaunchApp(kTestOfflineEnabledKioskApp, "1.0.0", + std::string(kTestOfflineEnabledKioskApp) + "_v1.crx"); +} + +IN_PROC_BROWSER_TEST_F(KioskUpdateTest, PRE_IncompliantPlatformDelayInstall) { + SetPlatformVersion("1233.0.0"); + + set_test_app_id(kTestOfflineEnabledKioskApp); + set_test_app_version("2.0.0"); + set_test_crx_file(test_app_id() + "_v2_required_platform_version_added.crx"); + + // Fake auto launch. + ReloadAutolaunchKioskApps(); + KioskAppManager::Get()->SetAppWasAutoLaunchedWithZeroDelay( + kTestOfflineEnabledKioskApp); + + StartUIForAppLaunch(); + SimulateNetworkOnline(); + LaunchApp(test_app_id(), false); + WaitForAppLaunchSuccess(); + + EXPECT_EQ("1.0.0", GetInstalledAppVersion().GetString()); + EXPECT_TRUE(PrimaryAppUpdateIsPending()); +} + +IN_PROC_BROWSER_TEST_F(KioskUpdateTest, IncompliantPlatformDelayInstall) { + SetPlatformVersion("1234.0.0"); + + set_test_app_id(kTestOfflineEnabledKioskApp); + set_test_app_version("2.0.0"); + set_test_crx_file(test_app_id() + "_v2_required_platform_version_added.crx"); + + // Fake auto launch. + ReloadAutolaunchKioskApps(); + KioskAppManager::Get()->SetAppWasAutoLaunchedWithZeroDelay( + kTestOfflineEnabledKioskApp); + + StartUIForAppLaunch(); + SimulateNetworkOnline(); + LaunchApp(test_app_id(), false); + WaitForAppLaunchSuccess(); + + EXPECT_EQ("2.0.0", GetInstalledAppVersion().GetString()); + EXPECT_FALSE(PrimaryAppUpdateIsPending()); +} + +// Tests that app is installed for the first time even on an incompliant +// platform. +IN_PROC_BROWSER_TEST_F(KioskUpdateTest, IncompliantPlatformFirstInstall) { + SetPlatformVersion("1233.0.0"); + + set_test_app_id(kTestOfflineEnabledKioskApp); + set_test_app_version("2.0.0"); + set_test_crx_file(test_app_id() + "_v2_required_platform_version_added.crx"); + + // Fake auto launch. + ReloadAutolaunchKioskApps(); + KioskAppManager::Get()->SetAppWasAutoLaunchedWithZeroDelay( + kTestOfflineEnabledKioskApp); + + StartUIForAppLaunch(); + SimulateNetworkOnline(); + LaunchApp(test_app_id(), false); + WaitForAppLaunchSuccess(); + + EXPECT_EQ("2.0.0", GetInstalledAppVersion().GetString()); + EXPECT_FALSE(PrimaryAppUpdateIsPending()); +} + /* ***** Test Kiosk multi-app feature ***** */ // Launch a primary kiosk app which has two secondary apps.
diff --git a/chrome/browser/chromeos/login/saml/saml_browsertest.cc b/chrome/browser/chromeos/login/saml/saml_browsertest.cc index 11360d2..ebe85f26 100644 --- a/chrome/browser/chromeos/login/saml/saml_browsertest.cc +++ b/chrome/browser/chromeos/login/saml/saml_browsertest.cc
@@ -846,6 +846,11 @@ GetLoginUI()->GetWebContents(), "var enrollmentScreen = document.getElementById('oauth-enrollment');" "function SendReplyIfEnrollmentDone() {" + " if (enrollmentScreen.classList.contains(" + " 'oauth-enroll-state-attribute-prompt')) {" + " $('oauth-enroll-attribute-prompt-card').fire('submit');" + " return false;" + " }" " if (!enrollmentScreen.classList.contains(" " 'oauth-enroll-state-success')) {" " return false;"
diff --git a/chrome/browser/chromeos/login/users/chrome_user_manager_impl.cc b/chrome/browser/chromeos/login/users/chrome_user_manager_impl.cc index 7ba70e8..7d67f78 100644 --- a/chrome/browser/chromeos/login/users/chrome_user_manager_impl.cc +++ b/chrome/browser/chromeos/login/users/chrome_user_manager_impl.cc
@@ -40,7 +40,6 @@ #include "chrome/browser/chromeos/login/users/supervised_user_manager_impl.h" #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" -#include "chrome/browser/chromeos/policy/device_local_account.h" #include "chrome/browser/chromeos/profiles/multiprofiles_session_aborted_dialog.h" #include "chrome/browser/chromeos/profiles/profile_helper.h" #include "chrome/browser/chromeos/session_length_limiter.h" @@ -90,16 +89,16 @@ // order. const char kRegularUsers[] = "LoggedInUsers"; -// A vector pref of the public accounts defined on this device. -const char kPublicAccounts[] = "PublicAccounts"; +// A vector pref of the device local accounts defined on this device. +const char kDeviceLocalAccounts[] = "PublicAccounts"; // Key for list of users that should be reported. const char kReportingUsers[] = "reporting_users"; -// A string pref that gets set when a public account is removed but a user is -// currently logged into that account, requiring the account's data to be -// removed after logout. -const char kPublicAccountPendingDataRemoval[] = +// A string pref that gets set when a device local account is removed but a +// user is currently logged into that account, requiring the account's data to +// be removed after logout. +const char kDeviceLocalAccountPendingDataRemoval[] = "PublicAccountPendingDataRemoval"; bool FakeOwnership() { @@ -134,8 +133,9 @@ void ChromeUserManagerImpl::RegisterPrefs(PrefRegistrySimple* registry) { ChromeUserManager::RegisterPrefs(registry); - registry->RegisterListPref(kPublicAccounts); - registry->RegisterStringPref(kPublicAccountPendingDataRemoval, std::string()); + registry->RegisterListPref(kDeviceLocalAccounts); + registry->RegisterStringPref(kDeviceLocalAccountPendingDataRemoval, + std::string()); registry->RegisterListPref(kReportingUsers); SupervisedUserManager::RegisterPrefs(registry); @@ -530,11 +530,12 @@ bool ChromeUserManagerImpl::IsUserNonCryptohomeDataEphemeral( const AccountId& account_id) const { - // Data belonging to the obsolete public accounts whose data has not been - // removed yet is not ephemeral. - bool is_obsolete_public_account = IsPublicAccountMarkedForRemoval(account_id); + // Data belonging to the obsolete device local accounts whose data has not + // been removed yet is not ephemeral. + const bool is_obsolete_device_local_account = + IsDeviceLocalAccountMarkedForRemoval(account_id); - return !is_obsolete_public_account && + return !is_obsolete_device_local_account && ChromeUserManager::IsUserNonCryptohomeDataEphemeral(account_id); } @@ -569,16 +570,24 @@ return connector->IsEnterpriseManaged(); } -void ChromeUserManagerImpl::LoadPublicAccounts( - std::set<AccountId>* public_sessions_set) { - const base::ListValue* prefs_public_sessions = - GetLocalState()->GetList(kPublicAccounts); - std::vector<AccountId> public_sessions; - ParseUserList(*prefs_public_sessions, std::set<AccountId>(), &public_sessions, - public_sessions_set); - for (const AccountId& account_id : public_sessions) { - users_.push_back(user_manager::User::CreatePublicAccountUser(account_id)); - UpdatePublicAccountDisplayName(account_id.GetUserEmail()); +void ChromeUserManagerImpl::LoadDeviceLocalAccounts( + std::set<AccountId>* device_local_accounts_set) { + const base::ListValue* prefs_device_local_accounts = + GetLocalState()->GetList(kDeviceLocalAccounts); + std::vector<AccountId> device_local_accounts; + ParseUserList(*prefs_device_local_accounts, std::set<AccountId>(), + &device_local_accounts, device_local_accounts_set); + for (const AccountId& account_id : device_local_accounts) { + policy::DeviceLocalAccount::Type type; + if (!policy::IsDeviceLocalAccountUser(account_id.GetUserEmail(), &type)) { + NOTREACHED(); + continue; + } + + users_.push_back( + CreateUserFromDeviceLocalAccount(account_id, type).release()); + if (type == policy::DeviceLocalAccount::TYPE_PUBLIC_SESSION) + UpdatePublicAccountDisplayName(account_id.GetUserEmail()); } } @@ -613,18 +622,10 @@ return DemoAppLauncher::IsDemoAppSession(account_id); } -bool ChromeUserManagerImpl::IsKioskApp(const AccountId& account_id) const { - policy::DeviceLocalAccount::Type device_local_account_type; - return policy::IsDeviceLocalAccountUser(account_id.GetUserEmail(), - &device_local_account_type) && - device_local_account_type == - policy::DeviceLocalAccount::TYPE_KIOSK_APP; -} - -bool ChromeUserManagerImpl::IsPublicAccountMarkedForRemoval( +bool ChromeUserManagerImpl::IsDeviceLocalAccountMarkedForRemoval( const AccountId& account_id) const { return account_id == AccountId::FromUserEmail(GetLocalState()->GetString( - kPublicAccountPendingDataRemoval)); + kDeviceLocalAccountPendingDataRemoval)); } void ChromeUserManagerImpl::RetrieveTrustedDevicePolicies() { @@ -654,7 +655,7 @@ EnsureUsersLoaded(); - bool changed = UpdateAndCleanUpPublicAccounts( + bool changed = UpdateAndCleanUpDeviceLocalAccounts( policy::GetDeviceLocalAccounts(cros_settings_)); // If ephemeral users are enabled and we are on the login screen, take this @@ -789,22 +790,17 @@ WallpaperManager::Get()->EnsureLoggedInUserWallpaperLoaded(); } -void ChromeUserManagerImpl::KioskAppLoggedIn( - const AccountId& kiosk_app_account_id) { +void ChromeUserManagerImpl::KioskAppLoggedIn(user_manager::User* user) { DCHECK_CURRENTLY_ON(BrowserThread::UI); - policy::DeviceLocalAccount::Type device_local_account_type; - DCHECK(policy::IsDeviceLocalAccountUser(kiosk_app_account_id.GetUserEmail(), - &device_local_account_type)); - DCHECK_EQ(policy::DeviceLocalAccount::TYPE_KIOSK_APP, - device_local_account_type); - active_user_ = user_manager::User::CreateKioskAppUser(kiosk_app_account_id); + active_user_ = user; active_user_->SetStubImage( base::WrapUnique(new user_manager::UserImage( *ResourceBundle::GetSharedInstance().GetImageSkiaNamed( IDR_PROFILE_PICTURE_LOADING))), user_manager::User::USER_IMAGE_INVALID, false); + const AccountId& kiosk_app_account_id = user->GetAccountId(); WallpaperManager::Get()->SetUserWallpaperNow(kiosk_app_account_id); // TODO(bartfab): Add KioskAppUsers to the users_ list and keep metadata like @@ -822,9 +818,9 @@ break; } } - std::string kiosk_app_name; + std::string kiosk_app_id; if (account) { - kiosk_app_name = account->kiosk_app_id; + kiosk_app_id = account->kiosk_app_id; } else { LOG(ERROR) << "Logged into nonexistent kiosk-app account: " << kiosk_app_account_id.GetUserEmail(); @@ -833,7 +829,7 @@ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); command_line->AppendSwitch(::switches::kForceAppMode); - command_line->AppendSwitchASCII(::switches::kAppId, kiosk_app_name); + command_line->AppendSwitchASCII(::switches::kAppId, kiosk_app_id); // Disable window animation since kiosk app runs in a single full screen // window and window animation causes start-up janks. @@ -901,83 +897,70 @@ EasyUnlockService::ResetLocalStateForUser(account_id); } -void -ChromeUserManagerImpl::CleanUpPublicAccountNonCryptohomeDataPendingRemoval() { +void ChromeUserManagerImpl:: + CleanUpDeviceLocalAccountNonCryptohomeDataPendingRemoval() { PrefService* local_state = GetLocalState(); - const std::string public_account_pending_data_removal = - local_state->GetString(kPublicAccountPendingDataRemoval); - if (public_account_pending_data_removal.empty() || + const std::string device_local_account_pending_data_removal = + local_state->GetString(kDeviceLocalAccountPendingDataRemoval); + if (device_local_account_pending_data_removal.empty() || (IsUserLoggedIn() && - public_account_pending_data_removal == GetActiveUser()->email())) { + device_local_account_pending_data_removal == GetActiveUser()->email())) { return; } RemoveNonCryptohomeData( - AccountId::FromUserEmail(public_account_pending_data_removal)); - local_state->ClearPref(kPublicAccountPendingDataRemoval); + AccountId::FromUserEmail(device_local_account_pending_data_removal)); + local_state->ClearPref(kDeviceLocalAccountPendingDataRemoval); } -void ChromeUserManagerImpl::CleanUpPublicAccountNonCryptohomeData( - const std::vector<std::string>& old_public_accounts) { +void ChromeUserManagerImpl::CleanUpDeviceLocalAccountNonCryptohomeData( + const std::vector<std::string>& old_device_local_accounts) { std::set<std::string> users; for (user_manager::UserList::const_iterator it = users_.begin(); it != users_.end(); ++it) users.insert((*it)->email()); - // If the user is logged into a public account that has been removed from the - // user list, mark the account's data as pending removal after logout. - if (IsLoggedInAsPublicAccount()) { - const std::string active_user_id = GetActiveUser()->email(); + // If the user is logged into a device local account that has been removed + // from the user list, mark the account's data as pending removal after + // logout. + const user_manager::User* const active_user = GetActiveUser(); + if (active_user && active_user->IsDeviceLocalAccount()) { + const std::string active_user_id = active_user->email(); if (users.find(active_user_id) == users.end()) { - GetLocalState()->SetString(kPublicAccountPendingDataRemoval, + GetLocalState()->SetString(kDeviceLocalAccountPendingDataRemoval, active_user_id); users.insert(active_user_id); } } - // Remove the data belonging to any other public accounts that are no longer - // found on the user list. + // Remove the data belonging to any other device local accounts that are no + // longer found on the user list. for (std::vector<std::string>::const_iterator it = - old_public_accounts.begin(); - it != old_public_accounts.end(); - ++it) { + old_device_local_accounts.begin(); + it != old_device_local_accounts.end(); ++it) { if (users.find(*it) == users.end()) RemoveNonCryptohomeData(AccountId::FromUserEmail(*it)); } } -bool ChromeUserManagerImpl::UpdateAndCleanUpPublicAccounts( +bool ChromeUserManagerImpl::UpdateAndCleanUpDeviceLocalAccounts( const std::vector<policy::DeviceLocalAccount>& device_local_accounts) { - // Try to remove any public account data marked as pending removal. - CleanUpPublicAccountNonCryptohomeDataPendingRemoval(); + // Try to remove any device local account data marked as pending removal. + CleanUpDeviceLocalAccountNonCryptohomeDataPendingRemoval(); - // Get the current list of public accounts. - std::vector<std::string> old_public_accounts; - for (user_manager::UserList::const_iterator it = users_.begin(); - it != users_.end(); - ++it) { - if ((*it)->GetType() == user_manager::USER_TYPE_PUBLIC_ACCOUNT) - old_public_accounts.push_back((*it)->email()); + // Get the current list of device local accounts. + std::vector<std::string> old_accounts; + for (const auto& user : users_) { + if (user->IsDeviceLocalAccount()) + old_accounts.push_back(user->email()); } - // Get the new list of public accounts from policy. - std::vector<std::string> new_public_accounts; - for (std::vector<policy::DeviceLocalAccount>::const_iterator it = - device_local_accounts.begin(); - it != device_local_accounts.end(); - ++it) { - // TODO(mnissler, nkostylev, bartfab): Process Kiosk Apps within the - // standard login framework: http://crbug.com/234694 - if (it->type == policy::DeviceLocalAccount::TYPE_PUBLIC_SESSION) - new_public_accounts.push_back(it->user_id); - } - - // If the list of public accounts has not changed, return. - if (new_public_accounts.size() == old_public_accounts.size()) { + // If the list of device local accounts has not changed, return. + if (device_local_accounts.size() == old_accounts.size()) { bool changed = false; - for (size_t i = 0; i < new_public_accounts.size(); ++i) { - if (new_public_accounts[i] != old_public_accounts[i]) { + for (size_t i = 0; i < device_local_accounts.size(); ++i) { + if (device_local_accounts[i].user_id != old_accounts[i]) { changed = true; break; } @@ -986,20 +969,17 @@ return false; } - // Persist the new list of public accounts in a pref. - ListPrefUpdate prefs_public_accounts_update(GetLocalState(), kPublicAccounts); - prefs_public_accounts_update->Clear(); - for (std::vector<std::string>::const_iterator it = - new_public_accounts.begin(); - it != new_public_accounts.end(); - ++it) { - prefs_public_accounts_update->AppendString(*it); - } + // Persist the new list of device local accounts in a pref. + ListPrefUpdate prefs_device_local_accounts_update(GetLocalState(), + kDeviceLocalAccounts); + prefs_device_local_accounts_update->Clear(); + for (const auto& account : device_local_accounts) + prefs_device_local_accounts_update->AppendString(account.user_id); - // Remove the old public accounts from the user list. + // Remove the old device local accounts from the user list. for (user_manager::UserList::iterator it = users_.begin(); it != users_.end();) { - if ((*it)->GetType() == user_manager::USER_TYPE_PUBLIC_ACCOUNT) { + if ((*it)->IsDeviceLocalAccount()) { if (*it != GetLoggedInUser()) DeleteUser(*it); it = users_.erase(it); @@ -1008,30 +988,36 @@ } } - // Add the new public accounts to the front of the user list. - for (std::vector<std::string>::const_reverse_iterator it = - new_public_accounts.rbegin(); - it != new_public_accounts.rend(); - ++it) { - if (IsLoggedInAsPublicAccount() && *it == GetActiveUser()->email()) - users_.insert(users_.begin(), GetLoggedInUser()); - else - users_.insert(users_.begin(), user_manager::User::CreatePublicAccountUser( - AccountId::FromUserEmail(*it))); - UpdatePublicAccountDisplayName(*it); + // Add the new device local accounts to the front of the user list. + user_manager::User* const active_user = GetActiveUser(); + const bool is_device_local_account_session = + active_user && active_user->IsDeviceLocalAccount(); + for (auto it = device_local_accounts.rbegin(); + it != device_local_accounts.rend(); ++it) { + if (is_device_local_account_session && + AccountId::FromUserEmail(it->user_id) == active_user->GetAccountId()) { + users_.insert(users_.begin(), active_user); + } else { + users_.insert(users_.begin(), + CreateUserFromDeviceLocalAccount( + AccountId::FromUserEmail(it->user_id), it->type) + .release()); + } + if (it->type == policy::DeviceLocalAccount::TYPE_PUBLIC_SESSION) { + UpdatePublicAccountDisplayName(it->user_id); + } } for (user_manager::UserList::iterator ui = users_.begin(), - ue = users_.begin() + new_public_accounts.size(); - ui != ue; - ++ui) { + ue = users_.begin() + device_local_accounts.size(); + ui != ue; ++ui) { GetUserImageManager((*ui)->GetAccountId())->LoadUserImage(); } - // Remove data belonging to public accounts that are no longer found on the - // user list. - CleanUpPublicAccountNonCryptohomeData(old_public_accounts); + // Remove data belonging to device local accounts that are no longer found on + // the user list. + CleanUpDeviceLocalAccountNonCryptohomeData(old_accounts); return true; } @@ -1298,4 +1284,24 @@ image_index < chromeos::default_user_image::kDefaultImagesCount; } +std::unique_ptr<user_manager::User> +ChromeUserManagerImpl::CreateUserFromDeviceLocalAccount( + const AccountId& account_id, + const policy::DeviceLocalAccount::Type type) const { + std::unique_ptr<user_manager::User> user; + switch (type) { + case policy::DeviceLocalAccount::TYPE_PUBLIC_SESSION: + user.reset(user_manager::User::CreatePublicAccountUser(account_id)); + break; + case policy::DeviceLocalAccount::TYPE_KIOSK_APP: + user.reset(user_manager::User::CreateKioskAppUser(account_id)); + break; + default: + NOTREACHED(); + break; + } + + return user; +} + } // namespace chromeos
diff --git a/chrome/browser/chromeos/login/users/chrome_user_manager_impl.h b/chrome/browser/chromeos/login/users/chrome_user_manager_impl.h index 936059c..82d9cbc 100644 --- a/chrome/browser/chromeos/login/users/chrome_user_manager_impl.h +++ b/chrome/browser/chromeos/login/users/chrome_user_manager_impl.h
@@ -24,6 +24,7 @@ #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" #include "chrome/browser/chromeos/login/users/multi_profile_user_controller_delegate.h" #include "chrome/browser/chromeos/policy/cloud_external_data_policy_observer.h" +#include "chrome/browser/chromeos/policy/device_local_account.h" #include "chrome/browser/chromeos/policy/device_local_account_policy_service.h" #include "chrome/browser/chromeos/settings/cros_settings.h" #include "chrome/browser/chromeos/settings/device_settings_service.h" @@ -40,10 +41,6 @@ class ImageSkia; } -namespace policy { -struct DeviceLocalAccount; -} - namespace user_manager { class RemoveUserDelegate; } @@ -154,7 +151,7 @@ const AccountId& account_id, user_manager::User::OAuthTokenStatus status) const override; bool IsEnterpriseManaged() const override; - void LoadPublicAccounts(std::set<AccountId>* users_set) override; + void LoadDeviceLocalAccounts(std::set<AccountId>* users_set) override; void NotifyOnLogin() override; void NotifyUserAddedToSession(const user_manager::User* added_user, bool user_switch_pending) override; @@ -165,12 +162,11 @@ void RemoveUserInternal(const AccountId& account_id, user_manager::RemoveUserDelegate* delegate) override; bool IsDemoApp(const AccountId& account_id) const override; - bool IsKioskApp(const AccountId& account_id) const override; - bool IsPublicAccountMarkedForRemoval( + bool IsDeviceLocalAccountMarkedForRemoval( const AccountId& account_id) const override; void DemoAccountLoggedIn() override; void GuestUserLoggedIn() override; - void KioskAppLoggedIn(const AccountId& kiosk_app_account_id) override; + void KioskAppLoggedIn(user_manager::User* user) override; void PublicAccountUserLoggedIn(user_manager::User* user) override; void RegularUserLoggedIn(const AccountId& account_id) override; void RegularUserLoggedInAsEphemeral(const AccountId& account_id) override; @@ -196,23 +192,23 @@ // Updates current user ownership on UI thread. void UpdateOwnership(); - // If data for a public account is marked as pending removal and the user is - // no longer logged into that account, removes the data. - void CleanUpPublicAccountNonCryptohomeDataPendingRemoval(); + // If data for a device local account is marked as pending removal and the + // user is no longer logged into that account, removes the data. + void CleanUpDeviceLocalAccountNonCryptohomeDataPendingRemoval(); - // Removes data belonging to public accounts that are no longer found on the - // user list. If the user is currently logged into one of these accounts, the - // data for that account is not removed immediately but marked as pending + // Removes data belonging to device local accounts that are no longer found on + // the user list. If the user is currently logged into one of these accounts, + // the data for that account is not removed immediately but marked as pending // removal after logout. - void CleanUpPublicAccountNonCryptohomeData( - const std::vector<std::string>& old_public_accounts); + void CleanUpDeviceLocalAccountNonCryptohomeData( + const std::vector<std::string>& old_device_local_accounts); - // Replaces the list of public accounts with those found in + // Replaces the list of device local accounts with those found in // |device_local_accounts|. Ensures that data belonging to accounts no longer // on the list is removed. Returns |true| if the list has changed. - // Public accounts are defined by policy. This method is called whenever an - // updated list of public accounts is received from policy. - bool UpdateAndCleanUpPublicAccounts( + // Device local accounts are defined by policy. This method is called whenever + // an updated list of device local accounts is received from policy. + bool UpdateAndCleanUpDeviceLocalAccounts( const std::vector<policy::DeviceLocalAccount>& device_local_accounts); // Updates the display name for public account |username| from policy settings @@ -244,6 +240,11 @@ // Removes user from the list of the users who should be reported. void RemoveReportingUser(const AccountId& account_id); + // Creates a user for the given device local account. + std::unique_ptr<user_manager::User> CreateUserFromDeviceLocalAccount( + const AccountId& account_id, + const policy::DeviceLocalAccount::Type type) const; + // Interface to the signed settings store. CrosSettings* cros_settings_;
diff --git a/chrome/browser/chromeos/login/users/fake_chrome_user_manager.cc b/chrome/browser/chromeos/login/users/fake_chrome_user_manager.cc index 2ce8c7a..1ffe41b8 100644 --- a/chrome/browser/chromeos/login/users/fake_chrome_user_manager.cc +++ b/chrome/browser/chromeos/login/users/fake_chrome_user_manager.cc
@@ -58,6 +58,15 @@ return user; } +user_manager::User* FakeChromeUserManager::AddKioskAppUser( + const AccountId& account_id) { + user_manager::User* user = user_manager::User::CreateKioskAppUser(account_id); + user->set_username_hash(ProfileHelper::GetUserIdHashByUserIdForTesting( + account_id.GetUserEmail())); + users_.push_back(user); + return user; +} + const user_manager::User* FakeChromeUserManager::AddPublicAccountUser( const AccountId& account_id) { user_manager::User* user = @@ -72,15 +81,6 @@ return user; } -void FakeChromeUserManager::AddKioskAppUser( - const AccountId& kiosk_app_account_id) { - user_manager::User* user = - user_manager::User::CreateKioskAppUser(kiosk_app_account_id); - user->set_username_hash(ProfileHelper::GetUserIdHashByUserIdForTesting( - kiosk_app_account_id.GetUserEmail())); - users_.push_back(user); -} - void FakeChromeUserManager::LoginUser(const AccountId& account_id) { UserLoggedIn(account_id, ProfileHelper::GetUserIdHashByUserIdForTesting( account_id.GetUserEmail()),
diff --git a/chrome/browser/chromeos/login/users/fake_chrome_user_manager.h b/chrome/browser/chromeos/login/users/fake_chrome_user_manager.h index 2895939..b43346d 100644 --- a/chrome/browser/chromeos/login/users/fake_chrome_user_manager.h +++ b/chrome/browser/chromeos/login/users/fake_chrome_user_manager.h
@@ -30,7 +30,7 @@ ~FakeChromeUserManager() override; // Create and add a kiosk app user. - void AddKioskAppUser(const AccountId& kiosk_app_account_id); + user_manager::User* AddKioskAppUser(const AccountId& account_id); // Create and add a public account user. const user_manager::User* AddPublicAccountUser(const AccountId& account_id);
diff --git a/chrome/browser/chromeos/login/users/mock_user_manager.h b/chrome/browser/chromeos/login/users/mock_user_manager.h index 8f86804..9e2f504c 100644 --- a/chrome/browser/chromeos/login/users/mock_user_manager.h +++ b/chrome/browser/chromeos/login/users/mock_user_manager.h
@@ -97,15 +97,16 @@ void(const AccountId&, user_manager::User::OAuthTokenStatus status)); MOCK_CONST_METHOD0(IsEnterpriseManaged, bool(void)); - MOCK_METHOD1(LoadPublicAccounts, void(std::set<AccountId>*)); + MOCK_METHOD1(LoadDeviceLocalAccounts, void(std::set<AccountId>*)); MOCK_METHOD0(PerformPreUserListLoadingActions, void(void)); MOCK_METHOD0(PerformPostUserListLoadingActions, void(void)); MOCK_METHOD1(PerformPostUserLoggedInActions, void(bool)); MOCK_CONST_METHOD1(IsDemoApp, bool(const AccountId&)); MOCK_CONST_METHOD1(IsKioskApp, bool(const AccountId&)); - MOCK_CONST_METHOD1(IsPublicAccountMarkedForRemoval, bool(const AccountId&)); + MOCK_CONST_METHOD1(IsDeviceLocalAccountMarkedForRemoval, + bool(const AccountId&)); MOCK_METHOD0(DemoAccountLoggedIn, void(void)); - MOCK_METHOD1(KioskAppLoggedIn, void(const AccountId&)); + MOCK_METHOD1(KioskAppLoggedIn, void(user_manager::User*)); MOCK_METHOD1(PublicAccountUserLoggedIn, void(user_manager::User*)); MOCK_METHOD1(SupervisedUserLoggedIn, void(const AccountId&)); MOCK_METHOD1(OnUserRemoved, void(const AccountId&));
diff --git a/chrome/browser/chromeos/policy/OWNERS b/chrome/browser/chromeos/policy/OWNERS index 20268c3..96cbb40 100644 --- a/chrome/browser/chromeos/policy/OWNERS +++ b/chrome/browser/chromeos/policy/OWNERS
@@ -2,3 +2,4 @@ atwilson@chromium.org cschuet@chromium.org tnagel@chromium.org +pastarmovj@chromium.org
diff --git a/chrome/browser/chromeos/policy/policy_oauth2_token_fetcher.cc b/chrome/browser/chromeos/policy/policy_oauth2_token_fetcher.cc index 6c81f18..a6562915 100644 --- a/chrome/browser/chromeos/policy/policy_oauth2_token_fetcher.cc +++ b/chrome/browser/chromeos/policy/policy_oauth2_token_fetcher.cc
@@ -4,10 +4,12 @@ #include "chrome/browser/chromeos/policy/policy_oauth2_token_fetcher.h" +#include <memory> #include <vector> #include "base/bind.h" #include "base/logging.h" +#include "base/memory/weak_ptr.h" #include "base/strings/string_util.h" #include "content/public/browser/browser_thread.h" #include "google_apis/gaia/gaia_auth_fetcher.h" @@ -23,21 +25,109 @@ namespace { +// If true, fake policy tokens will be sent instead of making network requests. +bool use_fake_tokens_for_testing_ = false; + // Max retry count for token fetching requests. const int kMaxRequestAttemptCount = 5; // OAuth token request retry delay in milliseconds. const int kRequestRestartDelay = 3000; -} // namespace +class PolicyOAuth2TokenFetcherImpl : public PolicyOAuth2TokenFetcher, + public GaiaAuthConsumer, + public OAuth2AccessTokenConsumer { + public: + PolicyOAuth2TokenFetcherImpl(); + ~PolicyOAuth2TokenFetcherImpl() override; -PolicyOAuth2TokenFetcher::PolicyOAuth2TokenFetcher() { -} + private: + // PolicyOAuth2TokenFetcher overrides. + void StartWithSigninContext( + net::URLRequestContextGetter* auth_context_getter, + net::URLRequestContextGetter* system_context_getter, + const TokenCallback& callback) override; + void StartWithAuthCode(const std::string& auth_code, + net::URLRequestContextGetter* system_context_getter, + const TokenCallback& callback) override; + void StartWithRefreshToken( + const std::string& oauth2_refresh_token, + net::URLRequestContextGetter* system_context_getter, + const TokenCallback& callback) override; -PolicyOAuth2TokenFetcher::~PolicyOAuth2TokenFetcher() { -} + // Returns true if we have previously attempted to fetch tokens with this + // class and failed. + bool Failed() const override { return failed_; } -void PolicyOAuth2TokenFetcher::StartWithSigninContext( + const std::string& OAuth2RefreshToken() const override { + return oauth2_refresh_token_; + } + const std::string& OAuth2AccessToken() const override { + return oauth2_access_token_; + } + + // GaiaAuthConsumer overrides. + void OnClientOAuthSuccess( + const GaiaAuthConsumer::ClientOAuthResult& oauth_tokens) override; + void OnClientOAuthFailure(const GoogleServiceAuthError& error) override; + + // OAuth2AccessTokenConsumer overrides. + void OnGetTokenSuccess(const std::string& access_token, + const base::Time& expiration_time) override; + void OnGetTokenFailure(const GoogleServiceAuthError& error) override; + + // Starts fetching OAuth2 refresh token. + void StartFetchingRefreshToken(); + + // Starts fetching OAuth2 access token for the device management service. + void StartFetchingAccessToken(); + + // Decides how to proceed on GAIA |error|. If the error looks temporary, + // retries |task| until max retry count is reached. + // If retry count runs out, or error condition is unrecoverable, it calls + // Delegate::OnOAuth2TokenFetchFailed(). + void RetryOnError(const GoogleServiceAuthError& error, + const base::Closure& task); + + // Passes |token| and |error| to the |callback_|. + void ForwardPolicyToken(const std::string& token, + const GoogleServiceAuthError& error); + + // Auth code which is used to retreive a refresh token. + std::string auth_code_; + + scoped_refptr<net::URLRequestContextGetter> auth_context_getter_; + scoped_refptr<net::URLRequestContextGetter> system_context_getter_; + std::unique_ptr<GaiaAuthFetcher> refresh_token_fetcher_; + std::unique_ptr<OAuth2AccessTokenFetcher> access_token_fetcher_; + + // OAuth2 refresh token. Could come either from the outside or through + // refresh token fetching flow within this class. + std::string oauth2_refresh_token_; + + // OAuth2 access token. + std::string oauth2_access_token_; + + // The retry counter. Increment this only when failure happened. + int retry_count_ = 0; + + // True if we have already failed to fetch the policy. + bool failed_ = false; + + // The callback to invoke when done. + TokenCallback callback_; + + base::WeakPtrFactory<PolicyOAuth2TokenFetcherImpl> weak_ptr_factory_; + + DISALLOW_COPY_AND_ASSIGN(PolicyOAuth2TokenFetcherImpl); +}; + +PolicyOAuth2TokenFetcherImpl::PolicyOAuth2TokenFetcherImpl() + : weak_ptr_factory_(this) {} + +PolicyOAuth2TokenFetcherImpl::~PolicyOAuth2TokenFetcherImpl() {} + +void PolicyOAuth2TokenFetcherImpl::StartWithSigninContext( net::URLRequestContextGetter* auth_context_getter, net::URLRequestContextGetter* system_context_getter, const TokenCallback& callback) { @@ -49,7 +139,7 @@ StartFetchingRefreshToken(); } -void PolicyOAuth2TokenFetcher::StartWithAuthCode( +void PolicyOAuth2TokenFetcherImpl::StartWithAuthCode( const std::string& auth_code, net::URLRequestContextGetter* system_context_getter, const TokenCallback& callback) { @@ -61,7 +151,7 @@ StartFetchingRefreshToken(); } -void PolicyOAuth2TokenFetcher::StartWithRefreshToken( +void PolicyOAuth2TokenFetcherImpl::StartWithRefreshToken( const std::string& oauth2_refresh_token, net::URLRequestContextGetter* system_context_getter, const TokenCallback& callback) { @@ -73,7 +163,7 @@ StartFetchingAccessToken(); } -void PolicyOAuth2TokenFetcher::StartFetchingRefreshToken() { +void PolicyOAuth2TokenFetcherImpl::StartFetchingRefreshToken() { if (auth_code_.empty()) { refresh_token_fetcher_.reset(new GaiaAuthFetcher( this, GaiaConstants::kChromeSource, auth_context_getter_.get())); @@ -86,7 +176,7 @@ } } -void PolicyOAuth2TokenFetcher::StartFetchingAccessToken() { +void PolicyOAuth2TokenFetcherImpl::StartFetchingAccessToken() { std::vector<std::string> scopes; scopes.push_back(GaiaConstants::kDeviceManagementServiceOAuth); scopes.push_back(GaiaConstants::kOAuthWrapBridgeUserInfoScope); @@ -100,7 +190,7 @@ scopes); } -void PolicyOAuth2TokenFetcher::OnClientOAuthSuccess( +void PolicyOAuth2TokenFetcherImpl::OnClientOAuthSuccess( const GaiaAuthConsumer::ClientOAuthResult& oauth2_tokens) { VLOG(1) << "OAuth2 tokens for policy fetching succeeded."; oauth2_refresh_token_ = oauth2_tokens.refresh_token; @@ -108,16 +198,17 @@ StartFetchingAccessToken(); } -void PolicyOAuth2TokenFetcher::OnClientOAuthFailure( +void PolicyOAuth2TokenFetcherImpl::OnClientOAuthFailure( const GoogleServiceAuthError& error) { VLOG(1) << "OAuth2 tokens fetch for policy fetch failed! (error = " << error.state() << ")"; - RetryOnError(error, - base::Bind(&PolicyOAuth2TokenFetcher::StartFetchingRefreshToken, - AsWeakPtr())); + RetryOnError( + error, + base::Bind(&PolicyOAuth2TokenFetcherImpl::StartFetchingRefreshToken, + weak_ptr_factory_.GetWeakPtr())); } -void PolicyOAuth2TokenFetcher::OnGetTokenSuccess( +void PolicyOAuth2TokenFetcherImpl::OnGetTokenSuccess( const std::string& access_token, const base::Time& expiration_time) { VLOG(1) << "OAuth2 access token (device management) fetching succeeded."; @@ -126,16 +217,17 @@ GoogleServiceAuthError(GoogleServiceAuthError::NONE)); } -void PolicyOAuth2TokenFetcher::OnGetTokenFailure( +void PolicyOAuth2TokenFetcherImpl::OnGetTokenFailure( const GoogleServiceAuthError& error) { LOG(ERROR) << "OAuth2 access token (device management) fetching failed!"; - RetryOnError(error, - base::Bind(&PolicyOAuth2TokenFetcher::StartFetchingAccessToken, - AsWeakPtr())); + RetryOnError( + error, base::Bind(&PolicyOAuth2TokenFetcherImpl::StartFetchingAccessToken, + weak_ptr_factory_.GetWeakPtr())); } -void PolicyOAuth2TokenFetcher::RetryOnError(const GoogleServiceAuthError& error, - const base::Closure& task) { +void PolicyOAuth2TokenFetcherImpl::RetryOnError( + const GoogleServiceAuthError& error, + const base::Closure& task) { DCHECK_CURRENTLY_ON(BrowserThread::UI); if (error.IsTransientError() && retry_count_ < kMaxRequestAttemptCount) { retry_count_++; @@ -153,11 +245,78 @@ ForwardPolicyToken(std::string(), error); } -void PolicyOAuth2TokenFetcher::ForwardPolicyToken( +void PolicyOAuth2TokenFetcherImpl::ForwardPolicyToken( const std::string& token, const GoogleServiceAuthError& error) { if (!callback_.is_null()) callback_.Run(token, error); } +// Fake token fetcher that immediately returns tokens without making network +// requests. +class PolicyOAuth2TokenFetcherFake : public PolicyOAuth2TokenFetcher { + public: + PolicyOAuth2TokenFetcherFake() {} + ~PolicyOAuth2TokenFetcherFake() override {} + + private: + // PolicyOAuth2TokenFetcher overrides. + void StartWithSigninContext( + net::URLRequestContextGetter* auth_context_getter, + net::URLRequestContextGetter* system_context_getter, + const TokenCallback& callback) override { + ForwardPolicyToken(callback); + } + + void StartWithAuthCode(const std::string& auth_code, + net::URLRequestContextGetter* system_context_getter, + const TokenCallback& callback) override { + ForwardPolicyToken(callback); + } + + void StartWithRefreshToken( + const std::string& oauth2_refresh_token, + net::URLRequestContextGetter* system_context_getter, + const TokenCallback& callback) override { + ForwardPolicyToken(callback); + } + + bool Failed() const override { return false; } + const std::string& OAuth2RefreshToken() const override { + return refresh_token_; + } + const std::string& OAuth2AccessToken() const override { + return access_token_; + } + + private: + void ForwardPolicyToken(const TokenCallback& callback) { + if (!callback.is_null()) + callback.Run(access_token_, GoogleServiceAuthError::AuthErrorNone()); + } + + const std::string refresh_token_ = "fake_refresh_token"; + const std::string access_token_ = "fake_access_token"; + + DISALLOW_COPY_AND_ASSIGN(PolicyOAuth2TokenFetcherFake); +}; + +} // namespace + +// static +void PolicyOAuth2TokenFetcher::UseFakeTokensForTesting() { + use_fake_tokens_for_testing_ = true; +} + +// static +PolicyOAuth2TokenFetcher* PolicyOAuth2TokenFetcher::CreateInstance() { + if (use_fake_tokens_for_testing_) + return new PolicyOAuth2TokenFetcherFake(); + return new PolicyOAuth2TokenFetcherImpl(); +} + +PolicyOAuth2TokenFetcher::PolicyOAuth2TokenFetcher() {} + +PolicyOAuth2TokenFetcher::~PolicyOAuth2TokenFetcher() {} + } // namespace policy
diff --git a/chrome/browser/chromeos/policy/policy_oauth2_token_fetcher.h b/chrome/browser/chromeos/policy/policy_oauth2_token_fetcher.h index 18ef8c1..f112280 100644 --- a/chrome/browser/chromeos/policy/policy_oauth2_token_fetcher.h +++ b/chrome/browser/chromeos/policy/policy_oauth2_token_fetcher.h
@@ -9,12 +9,8 @@ #include <string> #include "base/callback.h" -#include "base/compiler_specific.h" #include "base/macros.h" -#include "base/memory/ref_counted.h" -#include "base/memory/weak_ptr.h" #include "google_apis/gaia/gaia_auth_consumer.h" -#include "google_apis/gaia/oauth2_access_token_consumer.h" class GaiaAuthFetcher; class OAuth2AccessTokenFetcher; @@ -30,96 +26,43 @@ // send a (possibly empty) token to the callback, which will then let the policy // subsystem proceed and resume Profile creation. Sending the token even when no // Profile is pending is also OK. -class PolicyOAuth2TokenFetcher - : public base::SupportsWeakPtr<PolicyOAuth2TokenFetcher>, - public GaiaAuthConsumer, - public OAuth2AccessTokenConsumer { +class PolicyOAuth2TokenFetcher { public: - typedef base::Callback<void(const std::string&, - const GoogleServiceAuthError&)> TokenCallback; + // Allocates a PolicyOAuth2TokenFetcher instance. + static PolicyOAuth2TokenFetcher* CreateInstance(); + + // Makes CreateInstance() return a fake token fetcher that does not make + // network calls so tests can avoid a dependency on GAIA. + static void UseFakeTokensForTesting(); + + using TokenCallback = + base::Callback<void(const std::string&, const GoogleServiceAuthError&)>; PolicyOAuth2TokenFetcher(); - ~PolicyOAuth2TokenFetcher() override; + virtual ~PolicyOAuth2TokenFetcher(); // Fetches the device management service's oauth2 token. This may be fetched // via signin context, auth code, or oauth2 refresh token. - void StartWithSigninContext( + virtual void StartWithSigninContext( net::URLRequestContextGetter* auth_context_getter, net::URLRequestContextGetter* system_context_getter, - const TokenCallback& callback); - void StartWithAuthCode(const std::string& auth_code, - net::URLRequestContextGetter* system_context_getter, - const TokenCallback& callback); - void StartWithRefreshToken( + const TokenCallback& callback) = 0; + virtual void StartWithAuthCode( + const std::string& auth_code, + net::URLRequestContextGetter* system_context_getter, + const TokenCallback& callback) = 0; + virtual void StartWithRefreshToken( const std::string& oauth2_refresh_token, net::URLRequestContextGetter* system_context_getter, - const TokenCallback& callback); + const TokenCallback& callback) = 0; // Returns true if we have previously attempted to fetch tokens with this // class and failed. - bool failed() const { - return failed_; - } - - const std::string& oauth2_refresh_token() const { - return oauth2_refresh_token_; - } - const std::string& oauth2_access_token() const { - return oauth2_access_token_; - } + virtual bool Failed() const = 0; + virtual const std::string& OAuth2RefreshToken() const = 0; + virtual const std::string& OAuth2AccessToken() const = 0; private: - // GaiaAuthConsumer overrides. - void OnClientOAuthSuccess( - const GaiaAuthConsumer::ClientOAuthResult& oauth_tokens) override; - void OnClientOAuthFailure(const GoogleServiceAuthError& error) override; - - // OAuth2AccessTokenConsumer overrides. - void OnGetTokenSuccess(const std::string& access_token, - const base::Time& expiration_time) override; - void OnGetTokenFailure(const GoogleServiceAuthError& error) override; - - // Starts fetching OAuth2 refresh token. - void StartFetchingRefreshToken(); - - // Starts fetching OAuth2 access token for the device management service. - void StartFetchingAccessToken(); - - // Decides how to proceed on GAIA |error|. If the error looks temporary, - // retries |task| until max retry count is reached. - // If retry count runs out, or error condition is unrecoverable, it calls - // Delegate::OnOAuth2TokenFetchFailed(). - void RetryOnError(const GoogleServiceAuthError& error, - const base::Closure& task); - - // Passes |token| and |error| to the |callback_|. - void ForwardPolicyToken(const std::string& token, - const GoogleServiceAuthError& error); - - // Auth code which is used to retreive a refresh token. - std::string auth_code_; - - scoped_refptr<net::URLRequestContextGetter> auth_context_getter_; - scoped_refptr<net::URLRequestContextGetter> system_context_getter_; - std::unique_ptr<GaiaAuthFetcher> refresh_token_fetcher_; - std::unique_ptr<OAuth2AccessTokenFetcher> access_token_fetcher_; - - // OAuth2 refresh token. Could come either from the outside or through - // refresh token fetching flow within this class. - std::string oauth2_refresh_token_; - - // OAuth2 access token. - std::string oauth2_access_token_; - - // The retry counter. Increment this only when failure happened. - int retry_count_ = 0; - - // True if we have already failed to fetch the policy. - bool failed_ = false; - - // The callback to invoke when done. - TokenCallback callback_; - DISALLOW_COPY_AND_ASSIGN(PolicyOAuth2TokenFetcher); };
diff --git a/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.cc b/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.cc index 47ec950..0fb6d86 100644 --- a/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.cc +++ b/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.cc
@@ -334,7 +334,7 @@ ->user_context() .GetRefreshToken(); if (!refresh_token.empty()) { - token_fetcher_.reset(new PolicyOAuth2TokenFetcher()); + token_fetcher_.reset(PolicyOAuth2TokenFetcher::CreateInstance()); token_fetcher_->StartWithRefreshToken( refresh_token, g_browser_process->system_request_context(), base::Bind(&UserCloudPolicyManagerChromeOS::OnOAuth2PolicyTokenFetched, @@ -351,7 +351,7 @@ return; } - token_fetcher_.reset(new PolicyOAuth2TokenFetcher()); + token_fetcher_.reset(PolicyOAuth2TokenFetcher::CreateInstance()); token_fetcher_->StartWithSigninContext( signin_context.get(), g_browser_process->system_request_context(), base::Bind(&UserCloudPolicyManagerChromeOS::OnOAuth2PolicyTokenFetched,
diff --git a/chrome/browser/chromeos/policy/wildcard_login_checker.cc b/chrome/browser/chromeos/policy/wildcard_login_checker.cc index 1e53a69..435e114 100644 --- a/chrome/browser/chromeos/policy/wildcard_login_checker.cc +++ b/chrome/browser/chromeos/policy/wildcard_login_checker.cc
@@ -43,7 +43,7 @@ start_timestamp_ = base::Time::Now(); callback_ = callback; - token_fetcher_.reset(new PolicyOAuth2TokenFetcher()); + token_fetcher_.reset(PolicyOAuth2TokenFetcher::CreateInstance()); token_fetcher_->StartWithSigninContext( signin_context.get(), g_browser_process->system_request_context(), base::Bind(&WildcardLoginChecker::OnPolicyTokenFetched, @@ -59,7 +59,7 @@ start_timestamp_ = base::Time::Now(); callback_ = callback; - token_fetcher_.reset(new PolicyOAuth2TokenFetcher()); + token_fetcher_.reset(PolicyOAuth2TokenFetcher::CreateInstance()); token_fetcher_->StartWithRefreshToken( refresh_token, g_browser_process->system_request_context(), base::Bind(&WildcardLoginChecker::OnPolicyTokenFetched,
diff --git a/chrome/browser/chromeos/settings/OWNERS b/chrome/browser/chromeos/settings/OWNERS index 1d8758f..bb2a49f 100644 --- a/chrome/browser/chromeos/settings/OWNERS +++ b/chrome/browser/chromeos/settings/OWNERS
@@ -1,2 +1,3 @@ mnissler@chromium.org bartfab@chromium.org +pastarmovj@chromium.org
diff --git a/chrome/browser/devtools/devtools_sanity_browsertest.cc b/chrome/browser/devtools/devtools_sanity_browsertest.cc index 5144111..ac3e2921 100644 --- a/chrome/browser/devtools/devtools_sanity_browsertest.cc +++ b/chrome/browser/devtools/devtools_sanity_browsertest.cc
@@ -8,6 +8,7 @@ #include "base/cancelable_callback.h" #include "base/command_line.h" #include "base/compiler_specific.h" +#include "base/files/file_path.h" #include "base/location.h" #include "base/macros.h" #include "base/memory/ref_counted.h" @@ -64,9 +65,14 @@ #include "extensions/common/value_builder.h" #include "net/dns/mock_host_resolver.h" #include "net/test/spawned_test_server/spawned_test_server.h" +#include "net/test/url_request/url_request_mock_http_job.h" +#include "net/url_request/url_request_context.h" +#include "net/url_request/url_request_filter.h" +#include "net/url_request/url_request_http_job.h" #include "third_party/WebKit/public/web/WebInputEvent.h" #include "ui/compositor/compositor_switches.h" #include "ui/gl/gl_switches.h" +#include "url/gurl.h" using app_modal::AppModalDialog; using app_modal::JavaScriptAppModalDialog; @@ -94,6 +100,10 @@ const char kWindowOpenTestPage[] = "files/devtools/window_open.html"; const char kLatencyInfoTestPage[] = "files/devtools/latency_info.html"; const char kChunkedTestPage[] = "chunked"; +const char kPushTestPage[] = "files/devtools/push_test_page.html"; +// The resource is not really pushed, but mock url request job pretends it is. +const char kPushTestResource[] = "devtools/image.png"; +const char kPushUseNullEndTime[] = "pushUseNullEndTime"; const char kSlowTestPage[] = "chunked?waitBeforeHeaders=100&waitBetweenChunks=100&chunksNumber=2"; const char kSharedWorkerTestPage[] = @@ -165,6 +175,83 @@ SwitchToPanel(window, (prefix + panel_name).c_str()); } +class PushTimesMockURLRequestJob : public net::URLRequestMockHTTPJob { + public: + PushTimesMockURLRequestJob(net::URLRequest* request, + net::NetworkDelegate* network_delegate, + base::FilePath file_path) + : net::URLRequestMockHTTPJob( + request, + network_delegate, + file_path, + BrowserThread::GetBlockingPool()->GetTaskRunnerWithShutdownBehavior( + base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)) {} + + void Start() override { + load_timing_info_.socket_reused = true; + load_timing_info_.request_start_time = base::Time::Now(); + load_timing_info_.request_start = base::TimeTicks::Now(); + load_timing_info_.send_start = base::TimeTicks::Now(); + load_timing_info_.send_end = base::TimeTicks::Now(); + load_timing_info_.receive_headers_end = base::TimeTicks::Now(); + + net::URLRequestMockHTTPJob::Start(); + } + + void GetLoadTimingInfo(net::LoadTimingInfo* load_timing_info) const override { + load_timing_info_.push_start = load_timing_info_.request_start - + base::TimeDelta::FromMilliseconds(100); + if (load_timing_info_.push_end.is_null() && + request()->url().query() != kPushUseNullEndTime) { + load_timing_info_.push_end = base::TimeTicks::Now(); + } + *load_timing_info = load_timing_info_; + } + + private: + mutable net::LoadTimingInfo load_timing_info_; + DISALLOW_COPY_AND_ASSIGN(PushTimesMockURLRequestJob); +}; + +class TestInterceptor : public net::URLRequestInterceptor { + public: + // Creates TestInterceptor and registers it with the URLRequestFilter, + // which takes ownership of it. + static void Register(const GURL& url, const base::FilePath& file_path) { + EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO)); + net::URLRequestFilter::GetInstance()->AddHostnameInterceptor( + url.scheme(), url.host(), + make_scoped_ptr(new TestInterceptor(url, file_path))); + } + + // Unregisters previously created TestInterceptor, which should delete it. + static void Unregister(const GURL& url) { + EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO)); + net::URLRequestFilter::GetInstance()->RemoveHostnameHandler(url.scheme(), + url.host()); + } + + // net::URLRequestJobFactory::ProtocolHandler implementation: + net::URLRequestJob* MaybeInterceptRequest( + net::URLRequest* request, + net::NetworkDelegate* network_delegate) const override { + EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO)); + if (request->url().path() != url_.path()) + return nullptr; + return new PushTimesMockURLRequestJob(request, network_delegate, + file_path_); + } + + private: + TestInterceptor(const GURL& url, const base::FilePath& file_path) + : url_(url), file_path_(file_path) {} + + const GURL url_; + const base::FilePath file_path_; + + DISALLOW_COPY_AND_ASSIGN(TestInterceptor); +}; + } // namespace class DevToolsSanityTest : public InProcessBrowserTest { @@ -942,6 +1029,24 @@ RunTest("testNetworkRawHeadersText", kChunkedTestPage); } +IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestNetworkPushTime) { + OpenDevToolsWindow(kPushTestPage, false); + GURL push_url = spawned_test_server()->GetURL(kPushTestResource); + base::FilePath file_path = + spawned_test_server()->document_root().AppendASCII(kPushTestResource); + + BrowserThread::PostTask( + BrowserThread::IO, FROM_HERE, + base::Bind(&TestInterceptor::Register, push_url, file_path)); + + DispatchOnTestSuite(window_, "testPushTimes", push_url.spec().c_str()); + + BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, + base::Bind(&TestInterceptor::Unregister, push_url)); + + CloseDevToolsWindow(); +} + // Tests that console messages are not duplicated on navigation back. #if defined(OS_WIN) // Flaking on windows swarm try runs: crbug.com/409285.
diff --git a/chrome/browser/dom_distiller/lazy_dom_distiller_service.h b/chrome/browser/dom_distiller/lazy_dom_distiller_service.h index 9264f033..0a4bf96 100644 --- a/chrome/browser/dom_distiller/lazy_dom_distiller_service.h +++ b/chrome/browser/dom_distiller/lazy_dom_distiller_service.h
@@ -5,8 +5,9 @@ #ifndef CHROME_BROWSER_DOM_DISTILLER_LAZY_DOM_DISTILLER_SERVICE_H_ #define CHROME_BROWSER_DOM_DISTILLER_LAZY_DOM_DISTILLER_SERVICE_H_ +#include <memory> + #include "base/macros.h" -#include "base/memory/scoped_ptr.h" #include "components/dom_distiller/core/dom_distiller_service.h" #include "components/dom_distiller/core/task_tracker.h" #include "content/public/browser/notification_observer.h"
diff --git a/chrome/browser/domain_reliability/OWNERS b/chrome/browser/domain_reliability/OWNERS index 695ce9d..a54916d6 100644 --- a/chrome/browser/domain_reliability/OWNERS +++ b/chrome/browser/domain_reliability/OWNERS
@@ -1,5 +1,5 @@ davidben@chromium.org mmenke@chromium.org szym@chromium.org -ttuttle@chromium.org +juliatuttle@chromium.org rdsmith@chromium.org
diff --git a/chrome/browser/download/notification/download_item_notification.cc b/chrome/browser/download/notification/download_item_notification.cc index 7907f1b..c135ccd 100644 --- a/chrome/browser/download/notification/download_item_notification.cc +++ b/chrome/browser/download/notification/download_item_notification.cc
@@ -844,8 +844,8 @@ return GetWarningStatusString(); // The hostname. (E.g.:"example.com" or "127.0.0.1") - base::string16 host_name = - url_formatter::FormatUrlForSecurityDisplayOmitScheme(item_->GetURL()); + base::string16 host_name = url_formatter::FormatUrlForSecurityDisplay( + item_->GetURL(), url_formatter::SchemeDisplay::OMIT_HTTP_AND_HTTPS); DownloadItemModel model(item_); base::string16 sub_status_text;
diff --git a/chrome/browser/engagement/site_engagement_service.cc b/chrome/browser/engagement/site_engagement_service.cc index 8eeb49c..df709189e 100644 --- a/chrome/browser/engagement/site_engagement_service.cc +++ b/chrome/browser/engagement/site_engagement_service.cc
@@ -36,6 +36,8 @@ namespace { +const int FOUR_WEEKS_IN_DAYS = 28; + // Global bool to ensure we only update the parameters from variations once. bool g_updated_from_variations = false; @@ -269,12 +271,18 @@ last_engagement_time_ = now; } -void SiteEngagementScore::Reset(double points) { +void SiteEngagementScore::Reset(double points, const base::Time* updated_time) { raw_score_ = points; points_added_today_ = 0; // This must be set in order to prevent the score from decaying when read. - last_engagement_time_ = clock_->Now(); + if (updated_time) { + last_engagement_time_ = *updated_time; + if (!last_shortcut_launch_time_.is_null()) + last_shortcut_launch_time_ = *updated_time; + } else { + last_engagement_time_ = clock_->Now(); + } } bool SiteEngagementScore::MaxPointsPerDayAdded() const { @@ -447,29 +455,7 @@ } void SiteEngagementService::ResetScoreForURL(const GURL& url, double score) { - DCHECK(url.is_valid()); - DCHECK_GE(score, 0); - DCHECK_LE(score, SiteEngagementScore::kMaxPoints); - - HostContentSettingsMap* settings_map = - HostContentSettingsMapFactory::GetForProfile(profile_); - std::unique_ptr<base::DictionaryValue> score_dict = - GetScoreDictForOrigin(settings_map, url); - SiteEngagementScore engagement_score(clock_.get(), *score_dict); - - engagement_score.Reset(score); - if (score == 0) { - settings_map->SetWebsiteSettingDefaultScope( - url, GURL(), CONTENT_SETTINGS_TYPE_SITE_ENGAGEMENT, std::string(), - nullptr); - return; - } - - if (engagement_score.UpdateScoreDict(score_dict.get())) { - settings_map->SetWebsiteSettingDefaultScope( - url, GURL(), CONTENT_SETTINGS_TYPE_SITE_ENGAGEMENT, std::string(), - score_dict.release()); - } + ResetScoreAndAccessTimesForURL(url, score, nullptr); } void SiteEngagementService::OnURLsDeleted( @@ -484,10 +470,11 @@ history::HistoryService* hs = HistoryServiceFactory::GetForProfile( profile_, ServiceAccessType::EXPLICIT_ACCESS); - hs->GetCountsForOrigins( + hs->GetCountsAndLastVisitForOrigins( std::set<GURL>(origins.begin(), origins.end()), - base::Bind(&SiteEngagementService::GetCountsForOriginsComplete, - weak_factory_.GetWeakPtr(), origins, expired)); + base::Bind( + &SiteEngagementService::GetCountsAndLastVisitForOriginsComplete, + weak_factory_.GetWeakPtr(), hs, origins, expired)); } void SiteEngagementService::SetLastShortcutLaunchTime(const GURL& url) { @@ -745,13 +732,23 @@ return total_origins; } -void SiteEngagementService::GetCountsForOriginsComplete( +void SiteEngagementService::GetCountsAndLastVisitForOriginsComplete( + history::HistoryService* history_service, const std::multiset<GURL>& deleted_origins, bool expired, - const history::OriginCountMap& remaining_origins) { + const history::OriginCountAndLastVisitMap& remaining_origins) { + + // The most in-the-past option in the Clear Browsing Dialog aside from "all + // time" is 4 weeks ago. Set the last updated date to 4 weeks ago for origins + // where we can't find a valid last visit date. + base::Time now = clock_->Now(); + base::Time four_weeks_ago = + now - base::TimeDelta::FromDays(FOUR_WEEKS_IN_DAYS); + for (const auto& origin_to_count : remaining_origins) { GURL origin = origin_to_count.first; - int remaining = origin_to_count.second; + int remaining = origin_to_count.second.first; + base::Time last_visit = origin_to_count.second.second; int deleted = deleted_origins.count(origin); // Do not update engagement scores if the deletion was an expiry, but the @@ -763,6 +760,57 @@ // entire history. double proportion_remaining = static_cast<double>(remaining) / (remaining + deleted); - ResetScoreForURL(origin, proportion_remaining * GetScore(origin)); + if (last_visit.is_null() || last_visit > now) + last_visit = four_weeks_ago; + + // At this point, we are going to proportionally decay the origin's + // engagement, and reset its last visit date to the last visit to a URL + // under the origin in history. If this new last visit date is long enough + // in the past, the next time the origin's engagement is accessed the + // automatic decay will kick in - i.e. a double decay will have occurred. + // To prevent this, compute the decay that would have taken place since the + // new last visit and add it to the engagement at this point. When the + // engagement is next accessed, it will decay back to the proportionally + // reduced value rather than being decayed once here, and then once again + // when it is next accessed. + int undecay = 0; + int days_since_engagement = (now - last_visit).InDays(); + if (days_since_engagement > 0) { + int periods = days_since_engagement / + SiteEngagementScore::GetDecayPeriodInDays(); + undecay = periods * SiteEngagementScore::GetDecayPoints(); + } + + double score = + std::min(SiteEngagementScore::kMaxPoints, + (proportion_remaining * GetScore(origin)) + undecay); + ResetScoreAndAccessTimesForURL(origin, score, &last_visit); + } +} + +void SiteEngagementService::ResetScoreAndAccessTimesForURL( + const GURL& url, double score, const base::Time* updated_time) { + DCHECK(url.is_valid()); + DCHECK_GE(score, 0); + DCHECK_LE(score, SiteEngagementScore::kMaxPoints); + + HostContentSettingsMap* settings_map = + HostContentSettingsMapFactory::GetForProfile(profile_); + std::unique_ptr<base::DictionaryValue> score_dict = + GetScoreDictForOrigin(settings_map, url); + SiteEngagementScore engagement_score(clock_.get(), *score_dict); + + engagement_score.Reset(score, updated_time); + if (score == 0) { + settings_map->SetWebsiteSettingDefaultScope( + url, GURL(), CONTENT_SETTINGS_TYPE_SITE_ENGAGEMENT, std::string(), + nullptr); + return; + } + + if (engagement_score.UpdateScoreDict(score_dict.get())) { + settings_map->SetWebsiteSettingDefaultScope( + url, GURL(), CONTENT_SETTINGS_TYPE_SITE_ENGAGEMENT, std::string(), + score_dict.release()); } }
diff --git a/chrome/browser/engagement/site_engagement_service.h b/chrome/browser/engagement/site_engagement_service.h index 554fb2df..1a2342b 100644 --- a/chrome/browser/engagement/site_engagement_service.h +++ b/chrome/browser/engagement/site_engagement_service.h
@@ -22,6 +22,10 @@ class Clock; } +namespace history { +class HistoryService; +} + class GURL; class Profile; @@ -101,8 +105,16 @@ double Score() const; void AddPoints(double points); - // Resets the score to |points| and reset the daily point limit. - void Reset(double points); + // Resets the score to |points| and resets the daily point limit. If + // |updated_time| is non-null, sets the last engagement time and last + // shortcut launch time (if it is non-null) to |updated_time|. Otherwise, last + // engagement time is set to the current time and last shortcut launch time is + // left unchanged. + // TODO(calamity): Ideally, all SiteEngagementScore methods should take a + // base::Time argument like this one does rather than each Score hold a + // pointer to a base::Clock. Then SiteEngagementScore doesn't need to worry + // about clock vending. See crbug.com/604305 + void Reset(double points, const base::Time* updated_time); // Returns true if the maximum number of points today has been added. bool MaxPointsPerDayAdded() const; @@ -298,10 +310,18 @@ int OriginsWithMaxDailyEngagement() const; int OriginsWithMaxEngagement(const std::map<GURL, double>& score_map) const; - void GetCountsForOriginsComplete( + void GetCountsAndLastVisitForOriginsComplete( + history::HistoryService* history_service, const std::multiset<GURL>& deleted_url_origins, bool expired, - const history::OriginCountMap& remaining_origin_counts); + const history::OriginCountAndLastVisitMap& remaining_origin_counts); + + // Resets the engagement score for |url| to |score|, and sets the last + // engagement time and last shortcut launch time (if it is non-null) to + // |updated_time|. Clears daily limits. + void ResetScoreAndAccessTimesForURL(const GURL& url, + double score, + const base::Time* updated_time); Profile* profile_;
diff --git a/chrome/browser/engagement/site_engagement_service_unittest.cc b/chrome/browser/engagement/site_engagement_service_unittest.cc index 08da629..45728ff4 100644 --- a/chrome/browser/engagement/site_engagement_service_unittest.cc +++ b/chrome/browser/engagement/site_engagement_service_unittest.cc
@@ -433,20 +433,43 @@ current_day += base::TimeDelta::FromDays(7); test_clock_.SetNow(current_day); - score_.Reset(20.0); + score_.Reset(20.0, nullptr); EXPECT_DOUBLE_EQ(20.0, score_.Score()); EXPECT_DOUBLE_EQ(0, score_.points_added_today_); EXPECT_EQ(current_day, score_.last_engagement_time_); + EXPECT_TRUE(score_.last_shortcut_launch_time_.is_null()); // Adding points after the reset should work as normal. score_.AddPoints(5); EXPECT_EQ(25.0, score_.Score()); - // The decay should happen one decay period from + // The decay should happen one decay period from the current time. test_clock_.SetNow(current_day + base::TimeDelta::FromDays( SiteEngagementScore::GetDecayPeriodInDays() + 1)); EXPECT_EQ(25.0 - SiteEngagementScore::GetDecayPoints(), score_.Score()); + + // Ensure that manually setting a time works as expected. + score_.AddPoints(5); + test_clock_.SetNow(GetReferenceTime()); + base::Time now = test_clock_.Now(); + score_.Reset(10.0, &now); + + EXPECT_DOUBLE_EQ(10.0, score_.Score()); + EXPECT_DOUBLE_EQ(0, score_.points_added_today_); + EXPECT_EQ(now, score_.last_engagement_time_); + EXPECT_TRUE(score_.last_shortcut_launch_time_.is_null()); + + score_.set_last_shortcut_launch_time(test_clock_.Now()); + test_clock_.SetNow(GetReferenceTime() + base::TimeDelta::FromDays(3)); + now = test_clock_.Now(); + score_.Reset(15.0, &now); + + // 5 bonus from the last shortcut launch. + EXPECT_DOUBLE_EQ(20.0, score_.Score()); + EXPECT_DOUBLE_EQ(0, score_.points_added_today_); + EXPECT_EQ(now, score_.last_engagement_time_); + EXPECT_EQ(now, score_.last_shortcut_launch_time_); } class SiteEngagementServiceTest : public ChromeRenderViewHostTestHarness { @@ -1104,28 +1127,35 @@ } TEST_F(SiteEngagementServiceTest, CleanupOriginsOnHistoryDeletion) { - SiteEngagementService* engagement = - SiteEngagementServiceFactory::GetForProfile(profile()); - ASSERT_TRUE(engagement); + base::SimpleTestClock* clock = new base::SimpleTestClock(); + std::unique_ptr<SiteEngagementService> engagement( + new SiteEngagementService(profile(), base::WrapUnique(clock))); + ASSERT_TRUE(engagement.get()); GURL origin1("http://www.google.com/"); GURL origin1a("http://www.google.com/search?q=asdf"); + GURL origin1b("http://www.google.com/maps/search?q=asdf"); GURL origin2("https://drive.google.com/"); GURL origin2a("https://drive.google.com/somedoc"); GURL origin3("http://notdeleted.com/"); + GURL origin4("http://decayed.com/"); + GURL origin4a("http://decayed.com/index.html"); base::Time today = GetReferenceTime(); base::Time yesterday = GetReferenceTime() - base::TimeDelta::FromDays(1); base::Time yesterday_afternoon = GetReferenceTime() - base::TimeDelta::FromDays(1) + base::TimeDelta::FromHours(4); + base::Time yesterday_week = GetReferenceTime() - base::TimeDelta::FromDays(8); + clock->SetNow(today); history::HistoryService* history = HistoryServiceFactory::GetForProfile( profile(), ServiceAccessType::IMPLICIT_ACCESS); history->AddPage(origin1, yesterday_afternoon, history::SOURCE_BROWSED); - history->AddPage(origin1a, today, history::SOURCE_BROWSED); - engagement->AddPoints(origin1, 5.0); + history->AddPage(origin1a, yesterday_week, history::SOURCE_BROWSED); + history->AddPage(origin1b, today, history::SOURCE_BROWSED); + engagement->AddPoints(origin1, 3.0); history->AddPage(origin2, yesterday_afternoon, history::SOURCE_BROWSED); history->AddPage(origin2a, yesterday_afternoon, history::SOURCE_BROWSED); @@ -1134,26 +1164,34 @@ history->AddPage(origin3, today, history::SOURCE_BROWSED); engagement->AddPoints(origin3, 5.0); - EXPECT_EQ(5.0, engagement->GetScore(origin1)); + history->AddPage(origin4, yesterday_week, history::SOURCE_BROWSED); + history->AddPage(origin4a, yesterday_afternoon, history::SOURCE_BROWSED); + engagement->AddPoints(origin4, 5.0); + + EXPECT_EQ(3.0, engagement->GetScore(origin1)); EXPECT_EQ(5.0, engagement->GetScore(origin2)); EXPECT_EQ(5.0, engagement->GetScore(origin3)); + EXPECT_EQ(5.0, engagement->GetScore(origin4)); { SiteEngagementChangeWaiter waiter(profile()); base::CancelableTaskTracker task_tracker; - // Expire origin1, origin2 and origin2a. + // Expire origin1, origin2, origin2a, and origin4's most recent visit. history->ExpireHistoryBetween(std::set<GURL>(), yesterday, today, base::Bind(&base::DoNothing), &task_tracker); waiter.Wait(); - // origin2 is cleaned up because all its urls are deleted. origin1a is still - // in history, but 50% of urls have been deleted, thus halving origin1's - // score. origin3 is untouched. - EXPECT_EQ(2.5, engagement->GetScore(origin1)); + // origin2 is cleaned up because all its urls are deleted. origin1a and + // origin1b are still in history, but 33% of urls have been deleted, thus + // cutting origin1's score by 1/3. origin3 is untouched. origin4 has 1 URL + // deleted and 1 remaining, but its most recent visit is more than 1 week in + // the past. Ensure that its scored is halved, and not decayed further. + EXPECT_EQ(2, engagement->GetScore(origin1)); EXPECT_EQ(0, engagement->GetScore(origin2)); EXPECT_EQ(5.0, engagement->GetScore(origin3)); - EXPECT_EQ(7.5, engagement->GetTotalEngagementPoints()); + EXPECT_EQ(2.5, engagement->GetScore(origin4)); + EXPECT_EQ(9.5, engagement->GetTotalEngagementPoints()); } { @@ -1163,6 +1201,30 @@ std::vector<history::ExpireHistoryArgs> expire_list; history::ExpireHistoryArgs args; args.urls.insert(origin1a); + args.SetTimeRangeForOneDay(yesterday_week); + expire_list.push_back(args); + + base::CancelableTaskTracker task_tracker; + history->ExpireHistory(expire_list, base::Bind(&base::DoNothing), + &task_tracker); + waiter.Wait(); + + // origin1's score should be halved again. origin3 and origin4 remain + // untouched. + EXPECT_EQ(1, engagement->GetScore(origin1)); + EXPECT_EQ(0, engagement->GetScore(origin2)); + EXPECT_EQ(5.0, engagement->GetScore(origin3)); + EXPECT_EQ(2.5, engagement->GetScore(origin4)); + EXPECT_EQ(8.5, engagement->GetTotalEngagementPoints()); + } + + { + SiteEngagementChangeWaiter waiter(profile()); + + // Expire origin1b. + std::vector<history::ExpireHistoryArgs> expire_list; + history::ExpireHistoryArgs args; + args.urls.insert(origin1b); args.SetTimeRangeForOneDay(today); expire_list.push_back(args); @@ -1171,11 +1233,12 @@ &task_tracker); waiter.Wait(); - // Only origin3 remains. + // origin1 should be removed. origin3 and origin4 remain untouched. EXPECT_EQ(0, engagement->GetScore(origin1)); EXPECT_EQ(0, engagement->GetScore(origin2)); EXPECT_EQ(5.0, engagement->GetScore(origin3)); - EXPECT_EQ(5.0, engagement->GetTotalEngagementPoints()); + EXPECT_EQ(2.5, engagement->GetScore(origin4)); + EXPECT_EQ(7.5, engagement->GetTotalEngagementPoints()); } }
diff --git a/chrome/browser/extensions/api/declarative_content/declarative_content_apitest.cc b/chrome/browser/extensions/api/declarative_content/declarative_content_apitest.cc index 05ce28ca..a2850b0e 100644 --- a/chrome/browser/extensions/api/declarative_content/declarative_content_apitest.cc +++ b/chrome/browser/extensions/api/declarative_content/declarative_content_apitest.cc
@@ -750,12 +750,20 @@ private: void SetUpCommandLine(base::CommandLine* command_line) override { DeclarativeContentApiTest::SetUpCommandLine(command_line); + // If disabling the redesign, we need to disable Media Router since having + // Media Router enabled will result in auto-enabling the redesign and + // breaking the test. + if (!enable_redesign_) { + override_media_router_.reset(new FeatureSwitch::ScopedOverride( + FeatureSwitch::media_router(), false)); + } override_toolbar_redesign_.reset(new FeatureSwitch::ScopedOverride( FeatureSwitch::extension_action_redesign(), enable_redesign_)); } bool enable_redesign_; std::unique_ptr<FeatureSwitch::ScopedOverride> override_toolbar_redesign_; + std::unique_ptr<FeatureSwitch::ScopedOverride> override_media_router_; DISALLOW_COPY_AND_ASSIGN(ShowPageActionWithoutPageActionTest); };
diff --git a/chrome/browser/extensions/api/file_system/file_system_api_unittest.cc b/chrome/browser/extensions/api/file_system/file_system_api_unittest.cc index 2a7f36a..f3ce3def 100644 --- a/chrome/browser/extensions/api/file_system/file_system_api_unittest.cc +++ b/chrome/browser/extensions/api/file_system/file_system_api_unittest.cc
@@ -26,6 +26,7 @@ #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h" #include "chrome/test/base/testing_browser_process.h" #include "components/prefs/testing_pref_service.h" +#include "components/user_manager/user.h" #include "content/public/test/test_browser_thread_bundle.h" #include "extensions/common/extension.h" #include "extensions/common/extension_builder.h" @@ -399,8 +400,10 @@ .SetBoolean("kiosk_only", true) .Build()) .Build()); - user_manager_->KioskAppLoggedIn( - AccountId::FromUserEmail(manual_launch_kiosk_app->id())); + user_manager::User* const manual_kiosk_app_user = + user_manager_->AddKioskAppUser( + AccountId::FromUserEmail(manual_launch_kiosk_app->id())); + user_manager_->KioskAppLoggedIn(manual_kiosk_app_user); { TestingConsentProviderDelegate delegate; delegate.SetDialogButton(ui::DIALOG_BUTTON_OK);
diff --git a/chrome/browser/extensions/api/file_system/file_system_apitest_chromeos.cc b/chrome/browser/extensions/api/file_system/file_system_apitest_chromeos.cc index aea16aa3..02a9e76 100644 --- a/chrome/browser/extensions/api/file_system/file_system_apitest_chromeos.cc +++ b/chrome/browser/extensions/api/file_system/file_system_apitest_chromeos.cc
@@ -21,7 +21,7 @@ #include "chrome/browser/extensions/component_loader.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/extensions/api/file_system.h" -#include "components/drive/file_system_interface.h" +#include "components/drive/chromeos/file_system_interface.h" #include "components/drive/service/fake_drive_service.h" #include "content/public/test/test_utils.h" #include "extensions/browser/event_router.h"
diff --git a/chrome/browser/extensions/api/runtime/chrome_runtime_api_delegate.cc b/chrome/browser/extensions/api/runtime/chrome_runtime_api_delegate.cc index 1368740..0bb2a193 100644 --- a/chrome/browser/extensions/api/runtime/chrome_runtime_api_delegate.cc +++ b/chrome/browser/extensions/api/runtime/chrome_runtime_api_delegate.cc
@@ -4,8 +4,10 @@ #include "chrome/browser/extensions/api/runtime/chrome_runtime_api_delegate.h" +#include <memory> #include <string> #include <utility> +#include <vector> #include "base/location.h" #include "base/metrics/histogram.h" @@ -23,11 +25,14 @@ #include "chrome/browser/ui/browser_window.h" #include "components/update_client/update_query_params.h" #include "content/public/browser/notification_service.h" +#include "extensions/browser/extension_registry.h" #include "extensions/browser/extension_system.h" #include "extensions/browser/notification_types.h" #include "extensions/browser/warning_service.h" #include "extensions/browser/warning_set.h" #include "extensions/common/api/runtime.h" +#include "extensions/common/constants.h" +#include "net/base/backoff_entry.h" #if defined(OS_CHROMEOS) #include "chromeos/dbus/dbus_thread_manager.h" @@ -55,19 +60,69 @@ // disabled. const int kFastReloadCount = 5; +// The policy we use for exponential backoff of update check requests. +const net::BackoffEntry::Policy kBackoffPolicy = { + // num_errors_to_ignore + 0, + + // initial_delay_ms (note that we set 'always_use_initial_delay' to false + // below) + 1000 * extensions::kDefaultUpdateFrequencySeconds, + + // multiply_factor + 1, + + // jitter_factor + 0.1, + + // maximum_backoff_ms (-1 means no maximum) + -1, + + // entry_lifetime_ms (-1 means never discard) + -1, + + // always_use_initial_delay + false, +}; + +base::TickClock* g_test_clock = nullptr; + } // namespace +struct ChromeRuntimeAPIDelegate::UpdateCheckInfo { + public: + UpdateCheckInfo() { + if (g_test_clock) + backoff.reset(new net::BackoffEntry(&kBackoffPolicy, g_test_clock)); + else + backoff.reset(new net::BackoffEntry(&kBackoffPolicy)); + } + + std::unique_ptr<net::BackoffEntry> backoff; + std::vector<UpdateCheckCallback> callbacks; +}; + ChromeRuntimeAPIDelegate::ChromeRuntimeAPIDelegate( content::BrowserContext* context) - : browser_context_(context), registered_for_updates_(false) { + : browser_context_(context), + registered_for_updates_(false), + extension_registry_observer_(this) { registrar_.Add(this, extensions::NOTIFICATION_EXTENSION_UPDATE_FOUND, content::NotificationService::AllSources()); + extension_registry_observer_.Add( + extensions::ExtensionRegistry::Get(browser_context_)); } ChromeRuntimeAPIDelegate::~ChromeRuntimeAPIDelegate() { } +// static +void ChromeRuntimeAPIDelegate::set_tick_clock_for_tests( + base::TickClock* clock) { + g_test_clock = clock; +} + void ChromeRuntimeAPIDelegate::AddUpdateObserver( extensions::UpdateObserver* observer) { registered_for_updates_ = true; @@ -152,17 +207,20 @@ if (!updater) { return false; } - if (!updater->CheckExtensionSoon( - extension_id, - base::Bind(&ChromeRuntimeAPIDelegate::UpdateCheckComplete, - base::Unretained(this), - extension_id))) { + + UpdateCheckInfo& info = update_check_info_[extension_id]; + + // If not enough time has elapsed, or we have 10 or more outstanding calls, + // return a status of throttled. + if (info.backoff->ShouldRejectRequest() || info.callbacks.size() >= 10) { base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::Bind(callback, UpdateCheckResult(true, kUpdateThrottled, ""))); } else { - UpdateCallbackList& callbacks = pending_update_checks_[extension_id]; - callbacks.push_back(callback); + info.callbacks.push_back(callback); + updater->CheckExtensionSoon( + extension_id, base::Bind(&ChromeRuntimeAPIDelegate::UpdateCheckComplete, + base::Unretained(this), extension_id)); } return true; } @@ -259,11 +317,31 @@ } } +void ChromeRuntimeAPIDelegate::OnExtensionInstalled( + content::BrowserContext* browser_context, + const Extension* extension, + bool is_update) { + if (!is_update) + return; + auto info = update_check_info_.find(extension->id()); + if (info != update_check_info_.end()) { + info->second.backoff->Reset(); + } +} + void ChromeRuntimeAPIDelegate::UpdateCheckComplete( const std::string& extension_id) { ExtensionSystem* system = ExtensionSystem::Get(browser_context_); ExtensionService* service = system->extension_service(); const Extension* update = service->GetPendingExtensionUpdate(extension_id); + UpdateCheckInfo& info = update_check_info_[extension_id]; + + // We always inform the BackoffEntry of a "failure" here, because we only + // want to consider an update check request a success from a throttling + // standpoint once the extension goes on to actually update to a new + // version. See OnExtensionInstalled for where we reset the BackoffEntry. + info.backoff->InformOfRequest(false); + if (update) { CallUpdateCallbacks( extension_id, @@ -277,12 +355,12 @@ void ChromeRuntimeAPIDelegate::CallUpdateCallbacks( const std::string& extension_id, const UpdateCheckResult& result) { - UpdateCallbackList callbacks = pending_update_checks_[extension_id]; - pending_update_checks_.erase(extension_id); - for (UpdateCallbackList::const_iterator iter = callbacks.begin(); - iter != callbacks.end(); - ++iter) { - const UpdateCheckCallback& callback = *iter; + auto it = update_check_info_.find(extension_id); + if (it == update_check_info_.end()) + return; + std::vector<UpdateCheckCallback> callbacks; + it->second.callbacks.swap(callbacks); + for (const auto& callback : callbacks) { callback.Run(result); } }
diff --git a/chrome/browser/extensions/api/runtime/chrome_runtime_api_delegate.h b/chrome/browser/extensions/api/runtime/chrome_runtime_api_delegate.h index 934bcd8..6ff1a05 100644 --- a/chrome/browser/extensions/api/runtime/chrome_runtime_api_delegate.h +++ b/chrome/browser/extensions/api/runtime/chrome_runtime_api_delegate.h
@@ -6,15 +6,19 @@ #define CHROME_BROWSER_EXTENSIONS_API_RUNTIME_CHROME_RUNTIME_API_DELEGATE_H_ #include <map> -#include <vector> +#include <string> +#include <utility> #include "base/macros.h" +#include "base/scoped_observer.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" #include "extensions/browser/api/runtime/runtime_api.h" #include "extensions/browser/api/runtime/runtime_api_delegate.h" +#include "extensions/browser/extension_registry_observer.h" namespace base { +class TickClock; class TimeTicks; } @@ -25,16 +29,21 @@ } namespace extensions { +class ExtensionRegistry; class RuntimeAPI; class UpdateObserver; } class ChromeRuntimeAPIDelegate : public extensions::RuntimeAPIDelegate, - public content::NotificationObserver { + public content::NotificationObserver, + public extensions::ExtensionRegistryObserver { public: explicit ChromeRuntimeAPIDelegate(content::BrowserContext* context); ~ChromeRuntimeAPIDelegate() override; + // Sets a custom TickClock to use in tests. + static void set_tick_clock_for_tests(base::TickClock* clock); + private: friend class extensions::RuntimeAPI; @@ -56,6 +65,11 @@ const content::NotificationSource& source, const content::NotificationDetails& details) override; + // ExtensionRegistryObserver implementation. + void OnExtensionInstalled(content::BrowserContext* browser_context, + const extensions::Extension* extension, + bool is_update) override; + void UpdateCheckComplete(const std::string& extension_id); void CallUpdateCallbacks(const std::string& extension_id, const UpdateCheckResult& result); @@ -73,12 +87,14 @@ // it was reloaded with not enough time in between reloads. std::map<std::string, std::pair<base::TimeTicks, int> > last_reload_time_; - // Pending update checks. - typedef std::vector<UpdateCheckCallback> UpdateCallbackList; - typedef std::map<std::string, UpdateCallbackList> UpdateCallbackMap; - UpdateCallbackMap pending_update_checks_; + // Information about update checks, keyed by extension id. + struct UpdateCheckInfo; + std::map<std::string, UpdateCheckInfo> update_check_info_; - private: + ScopedObserver<extensions::ExtensionRegistry, + extensions::ExtensionRegistryObserver> + extension_registry_observer_; + DISALLOW_COPY_AND_ASSIGN(ChromeRuntimeAPIDelegate); };
diff --git a/chrome/browser/extensions/api/runtime/chrome_runtime_api_delegate_unittest.cc b/chrome/browser/extensions/api/runtime/chrome_runtime_api_delegate_unittest.cc new file mode 100644 index 0000000..0313064a --- /dev/null +++ b/chrome/browser/extensions/api/runtime/chrome_runtime_api_delegate_unittest.cc
@@ -0,0 +1,317 @@ +// 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 <deque> +#include <memory> +#include <set> +#include <utility> + +#include "base/callback.h" +#include "base/files/file_path.h" +#include "base/memory/ptr_util.h" +#include "base/memory/ref_counted.h" +#include "base/test/simple_test_tick_clock.h" +#include "chrome/browser/extensions/api/runtime/chrome_runtime_api_delegate.h" +#include "chrome/browser/extensions/extension_service.h" +#include "chrome/browser/extensions/extension_service_test_with_install.h" +#include "chrome/browser/extensions/test_extension_system.h" +#include "chrome/browser/extensions/update_install_gate.h" +#include "chrome/browser/extensions/updater/extension_updater.h" +#include "extensions/browser/event_router.h" +#include "extensions/browser/event_router_factory.h" +#include "extensions/browser/extension_prefs.h" +#include "extensions/browser/extension_registry.h" +#include "extensions/browser/updater/extension_downloader.h" +#include "extensions/browser/updater/extension_downloader_test_delegate.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace extensions { + +namespace { + +// A fake EventRouter that lets us pretend an extension has a listener +// registered for named events. +class TestEventRouter : public EventRouter { + public: + explicit TestEventRouter(content::BrowserContext* context) + : EventRouter(context, ExtensionPrefs::Get(context)) {} + ~TestEventRouter() override {} + + // An entry in our fake event registry. + using Entry = std::pair<std::string, std::string>; + + bool ExtensionHasEventListener(const std::string& extension_id, + const std::string& event_name) override { + return fake_registry_.find(Entry(extension_id, event_name)) != + fake_registry_.end(); + } + + // Pretend that |extension_id| is listening for |event_name|. + void AddFakeListener(const std::string& extension_id, + const std::string& event_name) { + fake_registry_.insert(Entry(extension_id, event_name)); + } + + private: + std::set<Entry> fake_registry_; + + DISALLOW_COPY_AND_ASSIGN(TestEventRouter); +}; + +std::unique_ptr<KeyedService> TestEventRouterFactoryFunction( + content::BrowserContext* context) { + return base::WrapUnique(new TestEventRouter(context)); +} + +// This class lets us intercept extension update checks and respond as if +// either no update was found, or one was (and it was downloaded). +class DownloaderTestDelegate : public ExtensionDownloaderTestDelegate { + public: + DownloaderTestDelegate() {} + + // On the next update check for extension |id|, we'll respond that no update + // is available. + void AddNoUpdateResponse(const std::string& id) { + no_updates_.insert(id); + if (updates_.find(id) != updates_.end()) + updates_.erase(id); + } + + // On the next update check for extension |id|, pretend that an update to + // version |version| has been downloaded to |path|. + void AddUpdateResponse(const std::string& id, + const base::FilePath& path, + const std::string& version) { + if (no_updates_.find(id) != no_updates_.end()) + no_updates_.erase(id); + DownloadFinishedArgs args; + args.path = path; + args.version = version; + updates_[id] = std::move(args); + } + + void StartUpdateCheck( + ExtensionDownloader* downloader, + ExtensionDownloaderDelegate* delegate, + std::unique_ptr<ManifestFetchData> fetch_data) override { + // Instead of immediately firing callbacks to the delegate in matching + // cases below, we instead post a task since the delegate typically isn't + // expecting a synchronous reply (the real code has to go do at least one + // network request before getting a response, so this is is a reasonable + // expectation by delegates). + for (const std::string& id : fetch_data->extension_ids()) { + auto no_update = no_updates_.find(id); + if (no_update != no_updates_.end()) { + no_updates_.erase(no_update); + base::MessageLoop::current()->task_runner()->PostTask( + FROM_HERE, + base::Bind(&ExtensionDownloaderDelegate::OnExtensionDownloadFailed, + base::Unretained(delegate), id, + ExtensionDownloaderDelegate::NO_UPDATE_AVAILABLE, + ExtensionDownloaderDelegate::PingResult(), + fetch_data->request_ids())); + continue; + } + auto update = updates_.find(id); + if (update != updates_.end()) { + CRXFileInfo info(id, update->second.path, "" /* no hash */); + std::string version = update->second.version; + updates_.erase(update); + base::MessageLoop::current()->task_runner()->PostTask( + FROM_HERE, + base::Bind( + &ExtensionDownloaderDelegate::OnExtensionDownloadFinished, + base::Unretained(delegate), info, + false /* file_ownership_passed */, GURL(), version, + ExtensionDownloaderDelegate::PingResult(), + fetch_data->request_ids(), + ExtensionDownloaderDelegate::InstallCallback())); + continue; + } + ADD_FAILURE() << "Unexpected extension id " << id; + } + } + + private: + // Simple holder for the data passed in AddUpdateResponse calls. + struct DownloadFinishedArgs { + base::FilePath path; + std::string version; + }; + + // These keep track of what response we should give for update checks, keyed + // by extension id. A given extension id should only appear in one or the + // other. + std::set<std::string> no_updates_; + std::map<std::string, DownloadFinishedArgs> updates_; + + DISALLOW_COPY_AND_ASSIGN(DownloaderTestDelegate); +}; + +// Helper to let test code wait for and return an update check result. +class UpdateCheckResultCatcher { + public: + UpdateCheckResultCatcher() {} + + void OnResult(const RuntimeAPIDelegate::UpdateCheckResult& result) { + EXPECT_EQ(nullptr, result_.get()); + result_.reset(new RuntimeAPIDelegate::UpdateCheckResult( + result.success, result.response, result.version)); + if (run_loop_) + run_loop_->Quit(); + } + + std::unique_ptr<RuntimeAPIDelegate::UpdateCheckResult> WaitForResult() { + if (!result_) { + run_loop_.reset(new base::RunLoop); + run_loop_->Run(); + } + return std::move(result_); + } + + private: + std::unique_ptr<RuntimeAPIDelegate::UpdateCheckResult> result_; + std::unique_ptr<base::RunLoop> run_loop_; + + DISALLOW_COPY_AND_ASSIGN(UpdateCheckResultCatcher); +}; + +class ChromeRuntimeAPIDelegateTest : public ExtensionServiceTestWithInstall { + public: + ChromeRuntimeAPIDelegateTest() {} + + void SetUp() override { + ExtensionServiceTestWithInstall::SetUp(); + ExtensionDownloader::set_test_delegate(&downloader_test_delegate_); + ChromeRuntimeAPIDelegate::set_tick_clock_for_tests(&clock_); + + InitializeExtensionServiceWithUpdater(); + runtime_delegate_.reset(new ChromeRuntimeAPIDelegate(browser_context())); + service()->updater()->SetExtensionCacheForTesting(nullptr); + EventRouterFactory::GetInstance()->SetTestingFactory( + browser_context(), &TestEventRouterFactoryFunction); + + // Setup the ExtensionService so that extension updates won't complete + // installation until the extension is idle. + update_install_gate_.reset(new UpdateInstallGate(service())); + service()->RegisterInstallGate(ExtensionPrefs::DELAY_REASON_WAIT_FOR_IDLE, + update_install_gate_.get()); + static_cast<TestExtensionSystem*>(ExtensionSystem::Get(browser_context())) + ->SetReady(); + } + + void TearDown() override { + ExtensionDownloader::set_test_delegate(nullptr); + ChromeRuntimeAPIDelegate::set_tick_clock_for_tests(nullptr); + ExtensionServiceTestWithInstall::TearDown(); + } + + // Uses runtime_delegate_ to run an update check for |id|, expecting + // |expected_response| and (if an update was available) |expected_version|. + // The |expected_response| should be one of 'throttled', 'no_update', or + // 'update_available'. + void DoUpdateCheck(const std::string& id, + const std::string& expected_response, + const std::string& expected_version) { + UpdateCheckResultCatcher catcher; + EXPECT_TRUE(runtime_delegate_->CheckForUpdates( + id, base::Bind(&UpdateCheckResultCatcher::OnResult, + base::Unretained(&catcher)))); + std::unique_ptr<RuntimeAPIDelegate::UpdateCheckResult> result = + catcher.WaitForResult(); + ASSERT_NE(nullptr, result.get()); + EXPECT_TRUE(result->success); + EXPECT_EQ(expected_response, result->response); + EXPECT_EQ(expected_version, result->version); + } + + protected: + // A clock we pass to the code used for throttling, so that we can manually + // increment time to test various throttling scenarios. + base::SimpleTestTickClock clock_; + + // Used for intercepting update check requests and possibly returning fake + // download results. + DownloaderTestDelegate downloader_test_delegate_; + + // The object whose behavior we're testing. + std::unique_ptr<RuntimeAPIDelegate> runtime_delegate_; + + // For preventing extensions from being updated immediately. + std::unique_ptr<UpdateInstallGate> update_install_gate_; + + private: + DISALLOW_COPY_AND_ASSIGN(ChromeRuntimeAPIDelegateTest); +}; + +TEST_F(ChromeRuntimeAPIDelegateTest, RequestUpdateCheck) { + base::FilePath v1_path = data_dir().AppendASCII("autoupdate/v1.crx"); + base::FilePath v2_path = data_dir().AppendASCII("autoupdate/v2.crx"); + + // Start by installing version 1. + scoped_refptr<const Extension> v1(InstallCRX(v1_path, INSTALL_NEW)); + std::string id = v1->id(); + + // Make it look like our test extension listens for the + // runtime.onUpdateAvailable event, so that it won't be updated immediately + // when the ExtensionUpdater hands the new version to the ExtensionService. + TestEventRouter* event_router = + static_cast<TestEventRouter*>(EventRouter::Get(browser_context())); + event_router->AddFakeListener(id, "runtime.onUpdateAvailable"); + + // Run an update check that should get a "no_update" response. + downloader_test_delegate_.AddNoUpdateResponse(id); + DoUpdateCheck(id, "no_update", ""); + + // Check again after a short delay - we should be throttled because + // not enough time has passed. + clock_.Advance(base::TimeDelta::FromMinutes(15)); + downloader_test_delegate_.AddNoUpdateResponse(id); + DoUpdateCheck(id, "throttled", ""); + + // Now simulate checking a few times at a 6 hour interval - none of these + // should be throttled. + for (int i = 0; i < 5; i++) { + clock_.Advance(base::TimeDelta::FromHours(6)); + downloader_test_delegate_.AddNoUpdateResponse(id); + DoUpdateCheck(id, "no_update", ""); + } + + // Run an update check that should get an "update_available" response. This + // actually causes the new version to be downloaded/unpacked, but the install + // will not complete until we reload the extension. + clock_.Advance(base::TimeDelta::FromDays(1)); + downloader_test_delegate_.AddUpdateResponse(id, v2_path, "2.0"); + DoUpdateCheck(id, "update_available", "2.0"); + + // Call again after short delay - it should be throttled instead of getting + // another "update_available" response. + clock_.Advance(base::TimeDelta::FromMinutes(30)); + downloader_test_delegate_.AddUpdateResponse(id, v2_path, "2.0"); + DoUpdateCheck(id, "throttled", ""); + + // Reload the extension, causing the delayed update to v2 to happen, then do + // another update check - we should get a no_update instead of throttled. + service()->ReloadExtension(id); + const Extension* current = + ExtensionRegistry::Get(browser_context())->GetInstalledExtension(id); + ASSERT_NE(nullptr, current); + EXPECT_EQ("2.0", current->VersionString()); + clock_.Advance(base::TimeDelta::FromSeconds(10)); + downloader_test_delegate_.AddNoUpdateResponse(id); + DoUpdateCheck(id, "no_update", ""); + + // Check again after short delay; we should be throttled. + clock_.Advance(base::TimeDelta::FromMinutes(5)); + DoUpdateCheck(id, "throttled", ""); + + // Call again after a longer delay, we should should be unthrottled. + clock_.Advance(base::TimeDelta::FromHours(8)); + downloader_test_delegate_.AddNoUpdateResponse(id); + DoUpdateCheck(id, "no_update", ""); +} + +} // namespace + +} // namespace extensions
diff --git a/chrome/browser/extensions/api/tab_capture/tab_capture_apitest.cc b/chrome/browser/extensions/api/tab_capture/tab_capture_apitest.cc index 7cb912b8..6c61789 100644 --- a/chrome/browser/extensions/api/tab_capture/tab_capture_apitest.cc +++ b/chrome/browser/extensions/api/tab_capture/tab_capture_apitest.cc
@@ -6,6 +6,7 @@ #include "base/location.h" #include "base/single_thread_task_runner.h" #include "base/strings/stringprintf.h" +#include "base/test/test_timeouts.h" #include "base/thread_task_runner_handle.h" #include "base/time/time.h" #include "build/build_config.h" @@ -403,8 +404,7 @@ #if defined(OS_WIN) && !defined(NDEBUG) #define MAYBE_TabIndicator DISABLED_TabIndicator #else -// Also flaky everywhere else: https://crbug.com/530657 -#define MAYBE_TabIndicator DISABLED_TabIndicator +#define MAYBE_TabIndicator TabIndicator #endif // Tests that the tab indicator (in the tab strip) is shown during tab capture. IN_PROC_BROWSER_TEST_F(TabCaptureApiTest, MAYBE_TabIndicator) { @@ -412,19 +412,20 @@ chrome::GetTabAlertStateForContents( browser()->tab_strip_model()->GetActiveWebContents())); - // Run an extension test that just turns on tab capture, which should cause - // the indicator to turn on. - AddExtensionToCommandLineWhitelist(); - ASSERT_TRUE(RunExtensionSubtest("tab_capture", "start_tab_capture.html")) - << message_; - // A TabStripModelObserver that quits the MessageLoop whenever the UI's model // is sent an event that changes the indicator status. class IndicatorChangeObserver : public TabStripModelObserver { public: explicit IndicatorChangeObserver(Browser* browser) - : last_alert_state_(chrome::GetTabAlertStateForContents( - browser->tab_strip_model()->GetActiveWebContents())) {} + : browser_(browser), + last_alert_state_(chrome::GetTabAlertStateForContents( + browser->tab_strip_model()->GetActiveWebContents())) { + browser_->tab_strip_model()->AddObserver(this); + } + + ~IndicatorChangeObserver() override { + browser_->tab_strip_model()->RemoveObserver(this); + } TabAlertState last_alert_state() const { return last_alert_state_; } @@ -433,32 +434,37 @@ TabChangeType change_type) override { const TabAlertState alert_state = chrome::GetTabAlertStateForContents(contents); - const bool has_changed = alert_state != last_alert_state_; - last_alert_state_ = alert_state; - if (has_changed) { + if (alert_state != last_alert_state_) { + last_alert_state_ = alert_state; base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::MessageLoop::QuitWhenIdleClosure()); } } private: + Browser* const browser_; TabAlertState last_alert_state_; }; - // Run the browser until the indicator turns on. IndicatorChangeObserver observer(browser()); - browser()->tab_strip_model()->AddObserver(&observer); + ASSERT_EQ(TabAlertState::NONE, observer.last_alert_state()); + + // Run an extension test that just turns on tab capture, which should cause + // the indicator to turn on. + AddExtensionToCommandLineWhitelist(); + ASSERT_TRUE(RunExtensionSubtest("tab_capture", "start_tab_capture.html")) + << message_; + + // Run the browser until the indicator turns on. const base::TimeTicks start_time = base::TimeTicks::Now(); while (observer.last_alert_state() != TabAlertState::TAB_CAPTURING) { if (base::TimeTicks::Now() - start_time > - base::TimeDelta::FromSeconds(10)) { + TestTimeouts::action_max_timeout()) { EXPECT_EQ(TabAlertState::TAB_CAPTURING, observer.last_alert_state()); - browser()->tab_strip_model()->RemoveObserver(&observer); return; } content::RunMessageLoop(); } - browser()->tab_strip_model()->RemoveObserver(&observer); } } // namespace
diff --git a/chrome/browser/extensions/display_info_provider_chromeos.cc b/chrome/browser/extensions/display_info_provider_chromeos.cc index c28b5c4..f35c6cc 100644 --- a/chrome/browser/extensions/display_info_provider_chromeos.cc +++ b/chrome/browser/extensions/display_info_provider_chromeos.cc
@@ -8,8 +8,10 @@ #include "ash/display/display_configuration_controller.h" #include "ash/display/display_manager.h" +#include "ash/display/resolution_notification_controller.h" #include "ash/shell.h" #include "base/strings/string_number_conversions.h" +#include "chrome/browser/chromeos/display/display_preferences.h" #include "extensions/common/api/system_display.h" #include "ui/display/manager/display_layout.h" #include "ui/gfx/display.h" @@ -186,8 +188,9 @@ ash::DisplayManager* display_manager, int64_t primary_display_id, std::string* error) { - bool is_primary = display.id() == primary_display_id || - (info.is_primary && *info.is_primary); + int64_t id = display.id(); + bool is_primary = + id == primary_display_id || (info.is_primary && *info.is_primary); // If mirroring source id is set, a display with the given id should exist, // and if should not be the same as the target display's id. @@ -200,7 +203,7 @@ return false; } - if (*info.mirroring_source_id == base::Int64ToString(display.id())) { + if (*info.mirroring_source_id == base::Int64ToString(id)) { *error = "Not allowed to mirror self."; return false; } @@ -256,8 +259,7 @@ return false; } - const gfx::Insets overscan = - display_manager->GetOverscanInsets(display.id()); + const gfx::Insets overscan = display_manager->GetOverscanInsets(id); int screen_width = display.bounds().width() + overscan.width(); int screen_height = display.bounds().height() + overscan.height(); @@ -271,6 +273,41 @@ return false; } } + + // Set the display mode. + if (info.display_mode) { + ash::DisplayMode current_mode = + display_manager->GetActiveModeForDisplayId(id); + ash::DisplayMode new_mode; + // Copy properties not set in the UI from the current mode. + new_mode.refresh_rate = current_mode.refresh_rate; + new_mode.interlaced = current_mode.interlaced; + // Set properties from the UI properties. + new_mode.size.SetSize(info.display_mode->width_in_native_pixels, + info.display_mode->height_in_native_pixels); + new_mode.ui_scale = info.display_mode->ui_scale; + new_mode.device_scale_factor = info.display_mode->device_scale_factor; + new_mode.native = info.display_mode->is_native; + + if (new_mode.IsEquivalent(current_mode)) { + *error = "Display mode mataches crrent mode."; + return false; + } + + if (!display_manager->SetDisplayMode(id, new_mode)) { + *error = "Unable to set the display mode."; + return false; + } + + if (!gfx::Display::IsInternalDisplayId(id)) { + // For external displays, show a notification confirming the resolution + // change. + ash::Shell::GetInstance() + ->resolution_notification_controller() + ->PrepareNotification(id, current_mode, new_mode, + base::Bind(&chromeos::StoreDisplayPrefs)); + } + } return true; } @@ -285,6 +322,27 @@ return manager->GetDisplayForId(display_id); } +extensions::api::system_display::DisplayMode GetDisplayMode( + ash::DisplayManager* display_manager, + const ash::DisplayInfo& display_info, + const ash::DisplayMode& display_mode) { + extensions::api::system_display::DisplayMode result; + + bool is_internal = gfx::Display::HasInternalDisplay() && + gfx::Display::InternalDisplayId() == display_info.id(); + gfx::Size size_dip = display_mode.GetSizeInDIP(is_internal); + result.width = size_dip.width(); + result.height = size_dip.height(); + result.width_in_native_pixels = display_mode.size.width(); + result.height_in_native_pixels = display_mode.size.height(); + result.ui_scale = display_mode.ui_scale; + result.device_scale_factor = display_mode.device_scale_factor; + result.is_native = display_mode.native; + result.is_selected = display_mode.IsEquivalent( + display_manager->GetActiveModeForDisplayId(display_info.id())); + return result; +} + } // namespace DisplayInfoProviderChromeOS::DisplayInfoProviderChromeOS() { @@ -388,6 +446,11 @@ unit->overscan.top = overscan_insets.top(); unit->overscan.right = overscan_insets.right(); unit->overscan.bottom = overscan_insets.bottom(); + + for (const ash::DisplayMode& display_mode : display_info.display_modes()) { + unit->modes.push_back( + GetDisplayMode(display_manager, display_info, display_mode)); + } } void DisplayInfoProviderChromeOS::EnableUnifiedDesktop(bool enable) { @@ -395,7 +458,7 @@ enable); } -DisplayInfo DisplayInfoProviderChromeOS::GetAllDisplaysInfo() { +DisplayUnitInfoList DisplayInfoProviderChromeOS::GetAllDisplaysInfo() { ash::DisplayManager* display_manager = ash::Shell::GetInstance()->display_manager(); if (!display_manager->IsInUnifiedMode()) @@ -407,7 +470,7 @@ // Use first display as primary. int64_t primary_id = displays[0].id(); - DisplayInfo all_displays; + DisplayUnitInfoList all_displays; for (const gfx::Display& display : displays) { api::system_display::DisplayUnitInfo unit = CreateDisplayUnitInfo(display, primary_id);
diff --git a/chrome/browser/extensions/display_info_provider_chromeos.h b/chrome/browser/extensions/display_info_provider_chromeos.h index b8f8967c..51f83c5 100644 --- a/chrome/browser/extensions/display_info_provider_chromeos.h +++ b/chrome/browser/extensions/display_info_provider_chromeos.h
@@ -23,7 +23,7 @@ const gfx::Display& display, api::system_display::DisplayUnitInfo* unit) override; void EnableUnifiedDesktop(bool enable) override; - DisplayInfo GetAllDisplaysInfo() override; + DisplayUnitInfoList GetAllDisplaysInfo() override; private: DISALLOW_COPY_AND_ASSIGN(DisplayInfoProviderChromeOS);
diff --git a/chrome/browser/extensions/display_info_provider_chromeos_unittest.cc b/chrome/browser/extensions/display_info_provider_chromeos_unittest.cc index 44dd3d5..67b4baa 100644 --- a/chrome/browser/extensions/display_info_provider_chromeos_unittest.cc +++ b/chrome/browser/extensions/display_info_provider_chromeos_unittest.cc
@@ -79,7 +79,7 @@ TEST_F(DisplayInfoProviderChromeosTest, GetBasic) { UpdateDisplay("500x600,400x520"); - DisplayInfo result = DisplayInfoProvider::Get()->GetAllDisplaysInfo(); + DisplayUnitInfoList result = DisplayInfoProvider::Get()->GetAllDisplaysInfo(); ASSERT_EQ(2u, result.size()); @@ -120,7 +120,7 @@ // Check initial state. EXPECT_FALSE(GetDisplayManager()->IsInUnifiedMode()); - DisplayInfo result = DisplayInfoProvider::Get()->GetAllDisplaysInfo(); + DisplayUnitInfoList result = DisplayInfoProvider::Get()->GetAllDisplaysInfo(); ASSERT_EQ(2u, result.size()); @@ -230,7 +230,7 @@ TEST_F(DisplayInfoProviderChromeosTest, GetRotation) { UpdateDisplay("500x600/r"); - DisplayInfo result = DisplayInfoProvider::Get()->GetAllDisplaysInfo(); + DisplayUnitInfoList result = DisplayInfoProvider::Get()->GetAllDisplaysInfo(); ASSERT_EQ(1u, result.size()); @@ -278,7 +278,7 @@ TEST_F(DisplayInfoProviderChromeosTest, GetDPI) { UpdateDisplay("500x600,400x520*2"); - DisplayInfo result; + DisplayUnitInfoList result; result = DisplayInfoProvider::Get()->GetAllDisplaysInfo(); ASSERT_EQ(2u, result.size()); @@ -311,7 +311,7 @@ TEST_F(DisplayInfoProviderChromeosTest, GetVisibleArea) { UpdateDisplay("640x720*2/o, 400x520/o"); - DisplayInfo result; + DisplayUnitInfoList result; result = DisplayInfoProvider::Get()->GetAllDisplaysInfo(); ASSERT_EQ(2u, result.size()); @@ -356,7 +356,7 @@ TEST_F(DisplayInfoProviderChromeosTest, GetMirroring) { UpdateDisplay("600x600, 400x520/o"); - DisplayInfo result; + DisplayUnitInfoList result; result = DisplayInfoProvider::Get()->GetAllDisplaysInfo(); ASSERT_EQ(2u, result.size()); @@ -404,7 +404,7 @@ GetDisplayManager()->SetLayoutForCurrentDisplays( ash::test::CreateDisplayLayout(display::DisplayPlacement::LEFT, -40)); - DisplayInfo result = DisplayInfoProvider::Get()->GetAllDisplaysInfo(); + DisplayUnitInfoList result = DisplayInfoProvider::Get()->GetAllDisplaysInfo(); ASSERT_EQ(2u, result.size()); EXPECT_EQ("0,0 600x600", SystemInfoDisplayBoundsToString(result[0].bounds)); @@ -1070,5 +1070,57 @@ EXPECT_EQ("Overscan changes not allowed for the internal monitor.", error); } +TEST_F(DisplayInfoProviderChromeosTest, DisplayMode) { + UpdateDisplay("1200x600,600x1000"); + + DisplayUnitInfoList result = DisplayInfoProvider::Get()->GetAllDisplaysInfo(); + ASSERT_GE(result.size(), 1u); + const api::system_display::DisplayUnitInfo& primary_info = result[0]; + // Ensure that we have two modes for the primary display so that we can + // test chaning modes. + ASSERT_GE(primary_info.modes.size(), 2u); + + // Get the currently active mode and one other mode to switch to. + int64_t id; + base::StringToInt64(primary_info.id, &id); + ash::DisplayMode active_mode = + GetDisplayManager()->GetActiveModeForDisplayId(id); + const api::system_display::DisplayMode* cur_mode = nullptr; + const api::system_display::DisplayMode* other_mode = nullptr; + for (const auto& mode : primary_info.modes) { + if (mode.is_selected) + cur_mode = &mode; + else if (!other_mode) + other_mode = &mode; + if (cur_mode && other_mode) + break; + } + ASSERT_TRUE(cur_mode); + ASSERT_TRUE(other_mode); + ASSERT_NE(other_mode, cur_mode); + + // Verify that other_mode differs from the active mode. + ash::DisplayMode other_mode_ash; + other_mode_ash.size.SetSize(other_mode->width_in_native_pixels, + other_mode->height_in_native_pixels); + other_mode_ash.ui_scale = other_mode->ui_scale; + other_mode_ash.device_scale_factor = other_mode->device_scale_factor; + EXPECT_FALSE(active_mode.IsEquivalent(other_mode_ash)); + + // Switch modes. + api::system_display::DisplayProperties info; + info.display_mode = + api::system_display::DisplayMode::FromValue(*other_mode->ToValue()); + + bool success = false; + std::string error; + CallSetDisplayUnitInfo(base::Int64ToString(id), info, &success, &error); + ASSERT_TRUE(success); + + // Verify that other_mode now matches the active mode. + active_mode = GetDisplayManager()->GetActiveModeForDisplayId(id); + EXPECT_TRUE(active_mode.IsEquivalent(other_mode_ash)); +} + } // namespace } // namespace extensions
diff --git a/chrome/browser/extensions/display_info_provider_win.cc b/chrome/browser/extensions/display_info_provider_win.cc index 001e170..16e69204 100644 --- a/chrome/browser/extensions/display_info_provider_win.cc +++ b/chrome/browser/extensions/display_info_provider_win.cc
@@ -12,8 +12,8 @@ #include "base/strings/utf_string_conversions.h" #include "base/win/win_util.h" #include "extensions/common/api/system_display.h" +#include "ui/display/win/dpi.h" #include "ui/gfx/geometry/size.h" -#include "ui/gfx/win/dpi.h" namespace extensions { @@ -23,7 +23,8 @@ BOOL CALLBACK EnumMonitorCallback(HMONITOR monitor, HDC hdc, LPRECT rect, LPARAM data) { - DisplayInfo* all_displays = reinterpret_cast<DisplayInfo*>(data); + DisplayUnitInfoList* all_displays = + reinterpret_cast<DisplayUnitInfoList*>(data); DCHECK(all_displays); DisplayUnitInfo unit; @@ -38,7 +39,7 @@ if (!EnumDisplayDevices(monitor_info.szDevice, 0, &device, 0)) return FALSE; - gfx::Size dpi(gfx::GetDPI()); + gfx::Size dpi(display::win::GetDPI()); unit.id = base::Int64ToString(base::Hash(base::WideToUTF8(monitor_info.szDevice))); unit.name = base::WideToUTF8(device.DeviceString); @@ -68,7 +69,7 @@ void DisplayInfoProviderWin::UpdateDisplayUnitInfoForPlatform( const gfx::Display& display, extensions::api::system_display::DisplayUnitInfo* unit) { - DisplayInfo all_displays; + DisplayUnitInfoList all_displays; EnumDisplayMonitors( NULL, NULL, EnumMonitorCallback, reinterpret_cast<LPARAM>(&all_displays)); for (size_t i = 0; i < all_displays.size(); ++i) {
diff --git a/chrome/browser/extensions/extension_disabled_ui_browsertest.cc b/chrome/browser/extensions/extension_disabled_ui_browsertest.cc index 912a772f..720d2f8 100644 --- a/chrome/browser/extensions/extension_disabled_ui_browsertest.cc +++ b/chrome/browser/extensions/extension_disabled_ui_browsertest.cc
@@ -20,7 +20,9 @@ #include "chrome/browser/ui/global_error/global_error.h" #include "chrome/browser/ui/global_error/global_error_service.h" #include "chrome/browser/ui/global_error/global_error_service_factory.h" +#include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/common/chrome_switches.h" +#include "chrome/test/base/ui_test_utils.h" #include "content/public/browser/browser_thread.h" #include "content/public/test/test_utils.h" #include "extensions/browser/extension_dialog_auto_confirm.h" @@ -179,6 +181,30 @@ EXPECT_FALSE(GetExtensionDisabledGlobalError()); } +IN_PROC_BROWSER_TEST_F(ExtensionDisabledGlobalErrorTest, + UninstallWhilePromptBeingShown) { + const Extension* extension = InstallAndUpdateIncreasingPermissionsExtension(); + ASSERT_TRUE(extension); + ASSERT_TRUE(GetExtensionDisabledGlobalError()); + + // Navigate a tab to the disabled extension, it will show a permission + // increase dialog. + GURL url = extension->GetResourceURL(""); + int starting_tab_count = browser()->tab_strip_model()->count(); + ui_test_utils::NavigateToURLWithDisposition( + browser(), url, NEW_FOREGROUND_TAB, + ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); + int tab_count = browser()->tab_strip_model()->count(); + EXPECT_EQ(starting_tab_count + 1, tab_count); + + // Uninstall the extension while the dialog is being shown. + // Although the dialog is modal, a user can still uninstall the extension by + // other means, e.g. if the user had two browser windows open they can use the + // second browser window that does not contain the modal dialog, navigate to + // chrome://extensions and uninstall the extension. + UninstallExtension(extension->id()); +} + // Tests that no error appears if the user disabled the extension. IN_PROC_BROWSER_TEST_F(ExtensionDisabledGlobalErrorTest, UserDisabled) { const Extension* extension = InstallIncreasingPermissionExtensionV1();
diff --git a/chrome/browser/extensions/extension_garbage_collector.cc b/chrome/browser/extensions/extension_garbage_collector.cc index e24e5ad0..efc39846 100644 --- a/chrome/browser/extensions/extension_garbage_collector.cc +++ b/chrome/browser/extensions/extension_garbage_collector.cc
@@ -234,13 +234,22 @@ } } - ExtensionService* service = - ExtensionSystem::Get(context_)->extension_service(); - service->OnGarbageCollectIsolatedStorageStart(); + DCHECK(!installs_delayed_for_gc_); + installs_delayed_for_gc_ = true; content::BrowserContext::GarbageCollectStoragePartitions( context_, std::move(active_paths), - base::Bind(&ExtensionService::OnGarbageCollectIsolatedStorageFinished, - service->AsWeakPtr())); + base::Bind( + &ExtensionGarbageCollector::OnGarbageCollectIsolatedStorageFinished, + weak_factory_.GetWeakPtr())); +} + +void ExtensionGarbageCollector::OnGarbageCollectIsolatedStorageFinished() { + DCHECK(installs_delayed_for_gc_); + installs_delayed_for_gc_ = false; + + ExtensionSystem::Get(context_) + ->extension_service() + ->MaybeFinishDelayedInstallations(); } void ExtensionGarbageCollector::OnBeginCrxInstall( @@ -263,4 +272,10 @@ } } +InstallGate::Action ExtensionGarbageCollector::ShouldDelay( + const Extension* extension, + bool install_immediately) { + return installs_delayed_for_gc_ ? DELAY : INSTALL; +} + } // namespace extensions
diff --git a/chrome/browser/extensions/extension_garbage_collector.h b/chrome/browser/extensions/extension_garbage_collector.h index 9a76806..01433745 100644 --- a/chrome/browser/extensions/extension_garbage_collector.h +++ b/chrome/browser/extensions/extension_garbage_collector.h
@@ -11,6 +11,7 @@ #include "base/files/file_path.h" #include "base/macros.h" #include "base/memory/weak_ptr.h" +#include "chrome/browser/extensions/install_gate.h" #include "chrome/browser/extensions/install_observer.h" #include "components/keyed_service/core/keyed_service.h" @@ -25,7 +26,9 @@ // The class is owned by ExtensionService, but is mostly independent. Tasks to // garbage collect extensions and isolated storage are posted once the // ExtensionSystem signals ready. -class ExtensionGarbageCollector : public KeyedService, public InstallObserver { +class ExtensionGarbageCollector : public KeyedService, + public InstallObserver, + public InstallGate { public: explicit ExtensionGarbageCollector(content::BrowserContext* context); ~ExtensionGarbageCollector() override; @@ -35,14 +38,18 @@ // Manually trigger GarbageCollectExtensions() for testing. void GarbageCollectExtensionsForTest(); - // Overriddes for KeyedService: + // KeyedService: void Shutdown() override; - // Overriddes for InstallObserver + // InstallObserver: void OnBeginCrxInstall(const std::string& extension_id) override; void OnFinishCrxInstall(const std::string& extension_id, bool success) override; + // InstallGate: + Action ShouldDelay(const Extension* extension, + bool install_immediately) override; + protected: // Cleans up the extension install directory. It can end up with garbage in it // if extensions can't initially be removed when they are uninstalled (eg if a @@ -58,6 +65,10 @@ // cache lifetimes. void GarbageCollectIsolatedStorageIfNeeded(); + // Restart any extension installs which were delayed for isolated storage + // garbage collection. + void OnGarbageCollectIsolatedStorageFinished(); + static void GarbageCollectExtensionsOnFileThread( const base::FilePath& install_directory, const std::multimap<std::string, base::FilePath>& extension_paths); @@ -69,6 +80,12 @@ // garbage collection from running while a CRX is being installed. int crx_installs_in_progress_; + // Set to true to delay all new extension installations. Acts as a lock to + // allow background processing of garbage collection of on-disk state without + // needing to worry about race conditions caused by extension installation and + // reinstallation. + bool installs_delayed_for_gc_ = false; + // Generate weak pointers for safely posting to the file thread for garbage // collection. base::WeakPtrFactory<ExtensionGarbageCollector> weak_factory_;
diff --git a/chrome/browser/extensions/extension_gcm_app_handler_unittest.cc b/chrome/browser/extensions/extension_gcm_app_handler_unittest.cc index 30024f8..077e2a8 100644 --- a/chrome/browser/extensions/extension_gcm_app_handler_unittest.cc +++ b/chrome/browser/extensions/extension_gcm_app_handler_unittest.cc
@@ -266,7 +266,6 @@ extension_service_ = extension_system->Get(profile())->extension_service(); extension_service_->set_extensions_enabled(true); extension_service_->set_show_extensions_prompts(false); - extension_service_->set_install_updates_when_idle_for_test(false); // Create GCMProfileService that talks with fake GCMClient. gcm::GCMProfileServiceFactory::GetInstance()->SetTestingFactoryAndUse(
diff --git a/chrome/browser/extensions/extension_message_bubble_controller.cc b/chrome/browser/extensions/extension_message_bubble_controller.cc index dfe1fed..b95ebd755 100644 --- a/chrome/browser/extensions/extension_message_bubble_controller.cc +++ b/chrome/browser/extensions/extension_message_bubble_controller.cc
@@ -12,7 +12,7 @@ #include "base/strings/utf_string_conversions.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser.h" -#include "chrome/browser/ui/browser_finder.h" +#include "chrome/browser/ui/browser_list.h" #include "chrome/browser/ui/toolbar/toolbar_actions_model.h" #include "chrome/common/url_constants.h" #include "content/public/browser/user_metrics.h" @@ -103,7 +103,9 @@ user_action_(ACTION_BOUNDARY), delegate_(delegate), initialized_(false), - did_highlight_(false) { + did_highlight_(false), + browser_list_observer_(this) { + browser_list_observer_.Add(BrowserList::GetInstance()); } ExtensionMessageBubbleController::~ExtensionMessageBubbleController() { @@ -236,6 +238,13 @@ g_should_ignore_learn_more_for_testing = should_ignore; } +void ExtensionMessageBubbleController::OnBrowserRemoved(Browser* browser) { + if (browser == browser_ && did_highlight_) { + ToolbarActionsModel::Get(profile())->StopHighlighting(); + did_highlight_ = false; + } +} + void ExtensionMessageBubbleController::AcknowledgeExtensions() { ExtensionIdList* list = GetOrCreateExtensionList(); for (ExtensionIdList::const_iterator it = list->begin();
diff --git a/chrome/browser/extensions/extension_message_bubble_controller.h b/chrome/browser/extensions/extension_message_bubble_controller.h index 11b5836..f125d481 100644 --- a/chrome/browser/extensions/extension_message_bubble_controller.h +++ b/chrome/browser/extensions/extension_message_bubble_controller.h
@@ -8,11 +8,15 @@ #include <stddef.h> #include <string> + #include "base/macros.h" +#include "base/scoped_observer.h" +#include "chrome/browser/ui/browser_list_observer.h" #include "extensions/browser/browser_context_keyed_api_factory.h" #include "extensions/common/extension.h" class Browser; +class BrowserList; class ExtensionService; class Profile; @@ -21,7 +25,7 @@ class ExtensionPrefs; class ExtensionRegistry; -class ExtensionMessageBubbleController { +class ExtensionMessageBubbleController : public chrome::BrowserListObserver { public: // UMA histogram constants. enum BubbleAction { @@ -121,7 +125,7 @@ }; ExtensionMessageBubbleController(Delegate* delegate, Browser* browser); - virtual ~ExtensionMessageBubbleController(); + ~ExtensionMessageBubbleController() override; Delegate* delegate() const { return delegate_.get(); } Profile* profile(); @@ -162,6 +166,9 @@ bool should_ignore_learn_more); private: + // BrowserListObserver: + void OnBrowserRemoved(Browser* browser) override; + // Iterate over the known extensions and acknowledge each one. void AcknowledgeExtensions(); @@ -191,6 +198,8 @@ // Whether or not the bubble is highlighting extensions. bool did_highlight_; + ScopedObserver<BrowserList, BrowserListObserver> browser_list_observer_; + DISALLOW_COPY_AND_ASSIGN(ExtensionMessageBubbleController); };
diff --git a/chrome/browser/extensions/extension_message_bubble_controller_unittest.cc b/chrome/browser/extensions/extension_message_bubble_controller_unittest.cc index 1181748..f57d7756 100644 --- a/chrome/browser/extensions/extension_message_bubble_controller_unittest.cc +++ b/chrome/browser/extensions/extension_message_bubble_controller_unittest.cc
@@ -10,12 +10,14 @@ #include "base/command_line.h" #include "base/macros.h" #include "base/memory/ptr_util.h" +#include "base/run_loop.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" #include "base/values.h" #include "build/build_config.h" #include "chrome/browser/extensions/dev_mode_bubble_delegate.h" +#include "chrome/browser/extensions/extension_action_test_util.h" #include "chrome/browser/extensions/extension_function_test_utils.h" #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/extensions/extension_web_ui_override_registrar.h" @@ -24,6 +26,8 @@ #include "chrome/browser/extensions/settings_api_bubble_delegate.h" #include "chrome/browser/extensions/suspicious_extension_bubble_delegate.h" #include "chrome/browser/extensions/test_extension_system.h" +#include "chrome/browser/ui/toolbar/toolbar_actions_model.h" +#include "chrome/browser/ui/toolbar/toolbar_actions_model_factory.h" #include "chrome/test/base/browser_with_test_window_test.h" #include "chrome/test/base/testing_profile.h" #include "components/proxy_config/proxy_config_pref_names.h" @@ -53,6 +57,14 @@ new extensions::ExtensionWebUIOverrideRegistrar(context)); } +// Creates a new ToolbarActionsModel for the given |context|. +std::unique_ptr<KeyedService> BuildToolbarModel( + content::BrowserContext* context) { + return base::WrapUnique( + new ToolbarActionsModel(Profile::FromBrowserContext(context), + extensions::ExtensionPrefs::Get(context))); +} + } // namespace namespace extensions { @@ -982,4 +994,29 @@ NULL); } +// Tests that a bubble outliving the associated browser object doesn't crash. +// crbug.com/604003 +TEST_F(ExtensionMessageBubbleTest, TestBubbleOutlivesBrowser) { + FeatureSwitch::ScopedOverride force_dev_mode_highlighting( + FeatureSwitch::force_dev_mode_highlighting(), true); + Init(); + ToolbarActionsModelFactory::GetInstance()->SetTestingFactory( + profile(), &BuildToolbarModel); + ToolbarActionsModel* model = ToolbarActionsModel::Get(profile()); + base::RunLoop().RunUntilIdle(); + + ASSERT_TRUE(LoadExtensionWithAction("1", kId1, Manifest::UNPACKED)); + + std::unique_ptr<TestExtensionMessageBubbleController> controller( + new TestExtensionMessageBubbleController( + new DevModeBubbleDelegate(browser()->profile()), browser())); + EXPECT_TRUE(controller->ShouldShow()); + EXPECT_EQ(1u, model->toolbar_items().size()); + controller->HighlightExtensionsIfNecessary(); + EXPECT_TRUE(ToolbarActionsModel::Get(profile())->is_highlighting()); + set_browser(nullptr); + EXPECT_FALSE(ToolbarActionsModel::Get(profile())->is_highlighting()); + controller.reset(); +} + } // namespace extensions
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc index f924d0ae..a16b493 100644 --- a/chrome/browser/extensions/extension_service.cc +++ b/chrome/browser/extensions/extension_service.cc
@@ -70,7 +70,6 @@ #include "extensions/browser/app_sorting.h" #include "extensions/browser/event_router.h" #include "extensions/browser/extension_host.h" -#include "extensions/browser/extension_prefs.h" #include "extensions/browser/extension_registry.h" #include "extensions/browser/extension_system.h" #include "extensions/browser/extensions_browser_client.h" @@ -519,7 +518,8 @@ << " because it is not installed or pending"; // Delete extension_path since we're not creating a CrxInstaller // that would do it for us. - if (!GetFileTaskRunner()->PostTask( + if (file_ownership_passed && + !GetFileTaskRunner()->PostTask( FROM_HERE, base::Bind(&extensions::file_util::DeleteFile, file.path, false))) NOTREACHED(); @@ -692,12 +692,12 @@ } void ExtensionService::ReloadExtension(const std::string& extension_id) { - ReloadExtensionImpl(extension_id, true); // be_noisy + ReloadExtensionImpl(extension_id, true); // be_noisy } void ExtensionService::ReloadExtensionWithQuietFailure( const std::string& extension_id) { - ReloadExtensionImpl(extension_id, false); // be_noisy + ReloadExtensionImpl(extension_id, false); // be_noisy } bool ExtensionService::UninstallExtension( @@ -1770,55 +1770,38 @@ else extension_prefs_->SetExtensionDisabled(id, disable_reasons); - if (ShouldDelayExtensionUpdate( - id, - !!(install_flags & extensions::kInstallFlagInstallImmediately))) { - extension_prefs_->SetDelayedInstallInfo( - extension, - initial_state, - install_flags, - extensions::ExtensionPrefs::DELAY_REASON_WAIT_FOR_IDLE, - page_ordinal, - install_parameter); + extensions::ExtensionPrefs::DelayReason delay_reason; + extensions::InstallGate::Action action = ShouldDelayExtensionInstall( + extension, !!(install_flags & extensions::kInstallFlagInstallImmediately), + &delay_reason); + switch (action) { + case extensions::InstallGate::INSTALL: + AddNewOrUpdatedExtension(extension, initial_state, install_flags, + page_ordinal, install_parameter); + return; + case extensions::InstallGate::DELAY: + extension_prefs_->SetDelayedInstallInfo(extension, initial_state, + install_flags, delay_reason, + page_ordinal, install_parameter); - // Transfer ownership of |extension|. - delayed_installs_.Insert(extension); - - // Notify observers that app update is available. - FOR_EACH_OBSERVER(extensions::UpdateObserver, update_observers_, - OnAppUpdateAvailable(extension)); - return; - } - - extensions::SharedModuleService::ImportStatus status = - shared_module_service_->SatisfyImports(extension); - if (installs_delayed_for_gc_) { - extension_prefs_->SetDelayedInstallInfo( - extension, - initial_state, - install_flags, - extensions::ExtensionPrefs::DELAY_REASON_GC, - page_ordinal, - install_parameter); - delayed_installs_.Insert(extension); - } else if (status != SharedModuleService::IMPORT_STATUS_OK) { - if (status == SharedModuleService::IMPORT_STATUS_UNSATISFIED) { - extension_prefs_->SetDelayedInstallInfo( - extension, - initial_state, - install_flags, - extensions::ExtensionPrefs::DELAY_REASON_WAIT_FOR_IMPORTS, - page_ordinal, - install_parameter); + // Transfer ownership of |extension|. delayed_installs_.Insert(extension); - } - } else { - AddNewOrUpdatedExtension(extension, - initial_state, - install_flags, - page_ordinal, - install_parameter); + + if (delay_reason == + extensions::ExtensionPrefs::DELAY_REASON_WAIT_FOR_IDLE) { + // Notify observers that app update is available. + FOR_EACH_OBSERVER(extensions::UpdateObserver, update_observers_, + OnAppUpdateAvailable(extension)); + } + return; + case extensions::InstallGate::ABORT: + // Do nothing to abort the install. One such case is the shared module + // service gets IMPORT_STATUS_UNRECOVERABLE status for the pending + // install. + return; } + + NOTREACHED() << "Unknown action for delayed install: " << action; } void ExtensionService::OnExtensionManagementSettingsChanged() { @@ -1869,33 +1852,26 @@ void ExtensionService::MaybeFinishDelayedInstallation( const std::string& extension_id) { // Check if the extension already got installed. - if (!delayed_installs_.Contains(extension_id)) - return; - extensions::ExtensionPrefs::DelayReason reason = - extension_prefs_->GetDelayedInstallReason(extension_id); - - // Check if the extension is idle. DELAY_REASON_NONE is used for older - // preferences files that will not have set this field but it was previously - // only used for idle updates. - if ((reason == extensions::ExtensionPrefs::DELAY_REASON_WAIT_FOR_IDLE || - reason == extensions::ExtensionPrefs::DELAY_REASON_NONE) && - is_ready() && !extensions::util::IsExtensionIdle(extension_id, profile_)) - return; - const Extension* extension = delayed_installs_.GetByID(extension_id); - if (reason == extensions::ExtensionPrefs::DELAY_REASON_WAIT_FOR_IMPORTS) { - extensions::SharedModuleService::ImportStatus status = - shared_module_service_->SatisfyImports(extension); - if (status != SharedModuleService::IMPORT_STATUS_OK) { - if (status == SharedModuleService::IMPORT_STATUS_UNRECOVERABLE) { - delayed_installs_.Remove(extension_id); - // Make sure no version of the extension is actually installed, (i.e., - // that this delayed install was not an update). - CHECK(!extension_prefs_->GetInstalledExtensionInfo(extension_id).get()); - extension_prefs_->DeleteExtensionPrefs(extension_id); - } + if (!extension) + return; + + extensions::ExtensionPrefs::DelayReason reason; + const extensions::InstallGate::Action action = ShouldDelayExtensionInstall( + extension, false /* install_immediately*/, &reason); + switch (action) { + case extensions::InstallGate::INSTALL: + break; + case extensions::InstallGate::DELAY: + // Bail out and continue to delay the install. return; - } + case extensions::InstallGate::ABORT: + delayed_installs_.Remove(extension_id); + // Make sure no version of the extension is actually installed, (i.e., + // that this delayed install was not an update). + CHECK(!extension_prefs_->GetInstalledExtensionInfo(extension_id).get()); + extension_prefs_->DeleteExtensionPrefs(extension_id); + return; } FinishDelayedInstallation(extension_id); @@ -2246,41 +2222,21 @@ !system_->management_policy()->MustRemainEnabled(extension, nullptr); } -bool ExtensionService::ShouldDelayExtensionUpdate( - const std::string& extension_id, - bool install_immediately) const { - const char kOnUpdateAvailableEvent[] = "runtime.onUpdateAvailable"; - - // If delayed updates are globally disabled, or just for this extension, - // don't delay. - if (!install_updates_when_idle_ || install_immediately) - return false; - - const Extension* old = GetInstalledExtension(extension_id); - // If there is no old extension, this is not an update, so don't delay. - if (!old) - return false; - - if (extensions::BackgroundInfo::HasPersistentBackgroundPage(old)) { - // Delay installation if the extension listens for the onUpdateAvailable - // event. - return extensions::EventRouter::Get(profile_) - ->ExtensionHasEventListener(extension_id, kOnUpdateAvailableEvent); - } else { - // Delay installation if the extension is not idle. - return !extensions::util::IsExtensionIdle(extension_id, profile_); +extensions::InstallGate::Action ExtensionService::ShouldDelayExtensionInstall( + const extensions::Extension* extension, + bool install_immediately, + extensions::ExtensionPrefs::DelayReason* reason) const { + for (const auto& entry : install_delayer_registry_) { + extensions::InstallGate* const delayer = entry.second; + extensions::InstallGate::Action action = + delayer->ShouldDelay(extension, install_immediately); + if (action != extensions::InstallGate::INSTALL) { + *reason = entry.first; + return action; + } } -} -void ExtensionService::OnGarbageCollectIsolatedStorageStart() { - DCHECK(!installs_delayed_for_gc_); - installs_delayed_for_gc_ = true; -} - -void ExtensionService::OnGarbageCollectIsolatedStorageFinished() { - DCHECK(installs_delayed_for_gc_); - installs_delayed_for_gc_ = false; - MaybeFinishDelayedInstallations(); + return extensions::InstallGate::INSTALL; } void ExtensionService::MaybeFinishDelayedInstallations() { @@ -2438,6 +2394,25 @@ update_observers_.RemoveObserver(observer); } +void ExtensionService::RegisterInstallGate( + extensions::ExtensionPrefs::DelayReason reason, + extensions::InstallGate* install_delayer) { + DCHECK(install_delayer_registry_.end() == + install_delayer_registry_.find(reason)); + install_delayer_registry_[reason] = install_delayer; +} + +void ExtensionService::UnregisterInstallGate( + extensions::InstallGate* install_delayer) { + for (auto it = install_delayer_registry_.begin(); + it != install_delayer_registry_.end(); ++it) { + if (it->second == install_delayer) { + install_delayer_registry_.erase(it); + return; + } + } +} + // Used only by test code. void ExtensionService::UnloadAllExtensionsInternal() { profile_->GetExtensionSpecialStoragePolicy()->RevokeRightsForAllExtensions();
diff --git a/chrome/browser/extensions/extension_service.h b/chrome/browser/extensions/extension_service.h index 5989005..eb16786 100644 --- a/chrome/browser/extensions/extension_service.h +++ b/chrome/browser/extensions/extension_service.h
@@ -19,10 +19,12 @@ #include "base/strings/string16.h" #include "chrome/browser/extensions/blacklist.h" #include "chrome/browser/extensions/extension_management.h" +#include "chrome/browser/extensions/install_gate.h" #include "chrome/browser/extensions/pending_extension_manager.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" #include "extensions/browser/crx_file_info.h" +#include "extensions/browser/extension_prefs.h" #include "extensions/browser/external_provider_interface.h" #include "extensions/browser/install_flag.h" #include "extensions/browser/process_manager.h" @@ -346,14 +348,6 @@ void SetFileTaskRunnerForTesting( const scoped_refptr<base::SequencedTaskRunner>& task_runner); - // Postpone installations so that we don't have to worry about race - // conditions. - void OnGarbageCollectIsolatedStorageStart(); - - // Restart any extension installs which were delayed for isolated storage - // garbage collection. - void OnGarbageCollectIsolatedStorageFinished(); - // Record a histogram using the PermissionMessage enum values for each // permission in |e|. // NOTE: If this is ever called with high frequency, the implementation may @@ -374,6 +368,11 @@ void AddUpdateObserver(extensions::UpdateObserver* observer); void RemoveUpdateObserver(extensions::UpdateObserver* observer); + // Register/unregister an InstallGate with the service. + void RegisterInstallGate(extensions::ExtensionPrefs::DelayReason reason, + extensions::InstallGate* install_delayer); + void UnregisterInstallGate(extensions::InstallGate* install_delayer); + ////////////////////////////////////////////////////////////////////////////// // Simple Accessors @@ -450,13 +449,6 @@ browser_terminating_ = value; } - // By default ExtensionService will wait with installing an updated extension - // until the extension is idle. Tests might not like this behavior, so you can - // disable it with this method. - void set_install_updates_when_idle_for_test(bool value) { - install_updates_when_idle_ = value; - } - // Set a callback to be called when all external providers are ready and their // extensions have been installed. void set_external_updates_finished_callback_for_test( @@ -558,10 +550,17 @@ // Helper method to determine if an extension can be blocked. bool CanBlockExtension(const extensions::Extension* extension) const; - // Helper to determine if updating an extensions should proceed immediately, - // or if we should delay the update until further notice. - bool ShouldDelayExtensionUpdate(const std::string& extension_id, - bool install_immediately) const; + // Helper to determine if installing an extensions should proceed immediately, + // or if we should delay the install until further notice, or if the install + // should be aborted. A pending install is delayed or aborted when any of the + // delayers say so and only proceeds when all delayers return INSTALL. + // |extension| is the extension to be installed. |install_immediately| is the + // install flag set with the install. |reason| is the reason associated with + // the install delayer that wants to defer or abort the install. + extensions::InstallGate::Action ShouldDelayExtensionInstall( + const extensions::Extension* extension, + bool install_immediately, + extensions::ExtensionPrefs::DelayReason* reason) const; // Manages the blacklisted extensions, intended as callback from // Blacklist::GetBlacklistedIDs. @@ -634,10 +633,6 @@ // Whether to notify users when they attempt to install an extension. bool show_extensions_prompts_ = true; - // Whether to delay installing of extension updates until the extension is - // idle. - bool install_updates_when_idle_ = true; - // Signaled when all extensions are loaded. extensions::OneShotEvent* const ready_; @@ -683,12 +678,6 @@ // decide to abort. bool browser_terminating_ = false; - // Set to true to delay all new extension installations. Acts as a lock to - // allow background processing of garbage collection of on-disk state without - // needing to worry about race conditions caused by extension installation and - // reinstallation. - bool installs_delayed_for_gc_ = false; - // Set to true if this is the first time this ExtensionService has run. // Used for specially handling external extensions that are installed the // first time. @@ -727,6 +716,10 @@ // Migrates app data when upgrading a legacy packaged app to a platform app std::unique_ptr<extensions::AppDataMigrator> app_data_migrator_; + using InstallGateRegistry = std::map<extensions::ExtensionPrefs::DelayReason, + extensions::InstallGate*>; + InstallGateRegistry install_delayer_registry_; + FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, DestroyingProfileClearsExtensions); FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, SetUnsetBlacklistInPrefs);
diff --git a/chrome/browser/extensions/extension_service_test_base.cc b/chrome/browser/extensions/extension_service_test_base.cc index d9c0401e..2fe09ad 100644 --- a/chrome/browser/extensions/extension_service_test_base.cc +++ b/chrome/browser/extensions/extension_service_test_base.cc
@@ -18,6 +18,7 @@ #include "chrome/browser/extensions/extension_error_reporter.h" #include "chrome/browser/extensions/extension_garbage_collector_factory.h" #include "chrome/browser/extensions/extension_service.h" +#include "chrome/browser/extensions/shared_module_service.h" #include "chrome/browser/extensions/test_extension_system.h" #include "chrome/browser/extensions/updater/extension_updater.h" #include "chrome/browser/prefs/browser_prefs.h" @@ -318,7 +319,6 @@ base::ThreadTaskRunnerHandle::Get().get()); service_->set_extensions_enabled(true); service_->set_show_extensions_prompts(false); - service_->set_install_updates_when_idle_for_test(false); service_->component_loader()->set_ignore_whitelist_for_testing(true); // When we start up, we want to make sure there is no external provider, @@ -328,6 +328,9 @@ // will register one specifically. service_->ClearProvidersForTesting(); + service_->RegisterInstallGate(ExtensionPrefs::DELAY_REASON_WAIT_FOR_IMPORTS, + service_->shared_module_service()); + #if defined(OS_CHROMEOS) InstallLimiter::Get(profile_.get())->DisableForTest(); #endif
diff --git a/chrome/browser/extensions/extension_system_impl.cc b/chrome/browser/extensions/extension_system_impl.cc index 1a04022f..365ef91 100644 --- a/chrome/browser/extensions/extension_system_impl.cc +++ b/chrome/browser/extensions/extension_system_impl.cc
@@ -20,6 +20,7 @@ #include "chrome/browser/extensions/chrome_content_verifier_delegate.h" #include "chrome/browser/extensions/component_loader.h" #include "chrome/browser/extensions/extension_error_reporter.h" +#include "chrome/browser/extensions/extension_garbage_collector.h" #include "chrome/browser/extensions/extension_management.h" #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/extensions/extension_sync_service.h" @@ -31,6 +32,7 @@ #include "chrome/browser/extensions/shared_user_script_master.h" #include "chrome/browser/extensions/state_store_notification_observer.h" #include "chrome/browser/extensions/unpacked_installer.h" +#include "chrome/browser/extensions/update_install_gate.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" @@ -62,6 +64,7 @@ #if defined(OS_CHROMEOS) #include "chrome/browser/app_mode/app_mode_utils.h" +#include "chrome/browser/chromeos/app_mode/kiosk_app_update_install_gate.h" #include "chrome/browser/chromeos/extensions/device_local_account_management_policy_provider.h" #include "chrome/browser/chromeos/policy/device_local_account.h" #include "chromeos/chromeos_switches.h" @@ -142,6 +145,27 @@ management_policy_->RegisterProvider(InstallVerifier::Get(profile_)); } +void ExtensionSystemImpl::Shared::InitInstallGates() { + update_install_gate_.reset(new UpdateInstallGate(extension_service_.get())); + extension_service_->RegisterInstallGate( + ExtensionPrefs::DELAY_REASON_WAIT_FOR_IDLE, update_install_gate_.get()); + extension_service_->RegisterInstallGate( + ExtensionPrefs::DELAY_REASON_GC, + ExtensionGarbageCollector::Get(profile_)); + extension_service_->RegisterInstallGate( + ExtensionPrefs::DELAY_REASON_WAIT_FOR_IMPORTS, + extension_service_->shared_module_service()); +#if defined(OS_CHROMEOS) + if (chrome::IsRunningInForcedAppMode()) { + kiosk_app_update_install_gate_.reset( + new chromeos::KioskAppUpdateInstallGate(profile_)); + extension_service_->RegisterInstallGate( + ExtensionPrefs::DELAY_REASON_WAIT_FOR_OS_UPDATE, + kiosk_app_update_install_gate_.get()); + } +#endif +} + void ExtensionSystemImpl::Shared::Init(bool extensions_enabled) { TRACE_EVENT0("browser,startup", "ExtensionSystemImpl::Shared::Init"); const base::CommandLine* command_line = @@ -227,6 +251,8 @@ app_sorting_.reset(new ChromeAppSorting(profile_)); + InitInstallGates(); + extension_service_->Init(); // Make sure ExtensionSyncService is created.
diff --git a/chrome/browser/extensions/extension_system_impl.h b/chrome/browser/extensions/extension_system_impl.h index b6bb19bc..5cd96a3 100644 --- a/chrome/browser/extensions/extension_system_impl.h +++ b/chrome/browser/extensions/extension_system_impl.h
@@ -21,6 +21,7 @@ class NavigationObserver; class StateStoreNotificationObserver; class UninstallPingSender; +class InstallGate; class ValueStoreFactory; class ValueStoreFactoryImpl; @@ -80,6 +81,7 @@ virtual void InitPrefs(); // This must not be called until all the providers have been created. void RegisterManagementPolicyProviders(); + void InitInstallGates(); void Init(bool extensions_enabled); // KeyedService implementation. @@ -122,6 +124,7 @@ scoped_refptr<InfoMap> extension_info_map_; std::unique_ptr<QuotaService> quota_service_; std::unique_ptr<AppSorting> app_sorting_; + std::unique_ptr<InstallGate> update_install_gate_; // For verifying the contents of extensions read from disk. scoped_refptr<ContentVerifier> content_verifier_; @@ -131,6 +134,7 @@ #if defined(OS_CHROMEOS) std::unique_ptr<chromeos::DeviceLocalAccountManagementPolicyProvider> device_local_account_management_policy_provider_; + std::unique_ptr<InstallGate> kiosk_app_update_install_gate_; #endif OneShotEvent ready_;
diff --git a/chrome/browser/extensions/install_gate.h b/chrome/browser/extensions/install_gate.h new file mode 100644 index 0000000..0980cd8 --- /dev/null +++ b/chrome/browser/extensions/install_gate.h
@@ -0,0 +1,34 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_EXTENSIONS_INSTALL_GATE_H_ +#define CHROME_BROWSER_EXTENSIONS_INSTALL_GATE_H_ + +namespace extensions { + +class Extension; + +// An interface that ExtensionService inquires for whether extension installs +// should be delayed and whether to finish/abort delayed installs. +class InstallGate { + public: + // Actions for a pending install. + enum Action { + INSTALL, // Proceed to finish the install. + DELAY, // Delay the install. + ABORT // Abort the install. + }; + + virtual ~InstallGate() = default; + + // Invoked by ExtensionService to check what to do with a pending install of + // the given extension. |extension| is an unpacked new extension to be + // installed. |install_immediately| is the flag associated with the install. + virtual Action ShouldDelay(const Extension* extension, + bool install_immediately) = 0; +}; + +} // namespace extensions + +#endif // CHROME_BROWSER_EXTENSIONS_INSTALL_GATE_H_
diff --git a/chrome/browser/extensions/navigation_observer.cc b/chrome/browser/extensions/navigation_observer.cc index 84856799..7e9f831d 100644 --- a/chrome/browser/extensions/navigation_observer.cc +++ b/chrome/browser/extensions/navigation_observer.cc
@@ -21,8 +21,11 @@ namespace extensions { NavigationObserver::NavigationObserver(Profile* profile) - : profile_(profile), weak_factory_(this) { + : profile_(profile), + extension_registry_observer_(this), + weak_factory_(this) { RegisterForNotifications(); + extension_registry_observer_.Add(ExtensionRegistry::Get(profile)); } NavigationObserver::~NavigationObserver() {} @@ -94,15 +97,19 @@ void NavigationObserver::OnInstallPromptDone( ExtensionInstallPrompt::Result result) { + // The extension was already uninstalled. + if (in_progress_prompt_extension_id_.empty()) + return; + ExtensionService* extension_service = extensions::ExtensionSystem::Get(profile_)->extension_service(); const Extension* extension = extension_service->GetExtensionById( in_progress_prompt_extension_id_, true); + CHECK(extension); if (result == ExtensionInstallPrompt::Result::ACCEPTED) { NavigationController* nav_controller = in_progress_prompt_navigation_controller_; - CHECK(extension); CHECK(nav_controller); // Grant permissions, re-enable the extension, and then reload the tab. @@ -110,7 +117,7 @@ nav_controller->Reload(true); } else { std::string histogram_name = - result == ExtensionInstallPrompt::Result::USER_CANCELED + result == ExtensionInstallPrompt::Result::USER_CANCELED ? "ReEnableCancel" : "ReEnableAbort"; ExtensionService::RecordPermissionMessagesHistogram(extension, @@ -122,4 +129,18 @@ extension_install_prompt_.reset(); } +void NavigationObserver::OnExtensionUninstalled( + content::BrowserContext* browser_context, + const Extension* extension, + UninstallReason reason) { + if (in_progress_prompt_extension_id_.empty() || + in_progress_prompt_extension_id_ != extension->id()) { + return; + } + + in_progress_prompt_extension_id_ = std::string(); + in_progress_prompt_navigation_controller_ = nullptr; + extension_install_prompt_.reset(); +} + } // namespace extensions
diff --git a/chrome/browser/extensions/navigation_observer.h b/chrome/browser/extensions/navigation_observer.h index 32b7b7b..44b2a2f 100644 --- a/chrome/browser/extensions/navigation_observer.h +++ b/chrome/browser/extensions/navigation_observer.h
@@ -11,9 +11,11 @@ #include "base/macros.h" #include "base/memory/weak_ptr.h" +#include "base/scoped_observer.h" #include "chrome/browser/extensions/extension_install_prompt.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" +#include "extensions/browser/extension_registry_observer.h" class Profile; @@ -27,7 +29,8 @@ // navigates into an extension that has been disabled due to a permission // increase, it prompts the user to accept the new permissions and re-enables // the extension. -class NavigationObserver : public content::NotificationObserver { +class NavigationObserver : public content::NotificationObserver, + public ExtensionRegistryObserver { public: explicit NavigationObserver(Profile* profile); ~NavigationObserver() override; @@ -49,6 +52,11 @@ void OnInstallPromptDone(ExtensionInstallPrompt::Result result); + // extensions::ExtensionRegistryObserver: + void OnExtensionUninstalled(content::BrowserContext* browser_context, + const Extension* extension, + UninstallReason reason) override; + content::NotificationRegistrar registrar_; Profile* profile_; @@ -63,6 +71,9 @@ // The extension ids we've already prompted the user about. std::set<std::string> prompted_extensions_; + ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> + extension_registry_observer_; + base::WeakPtrFactory<NavigationObserver> weak_factory_; DISALLOW_COPY_AND_ASSIGN(NavigationObserver);
diff --git a/chrome/browser/extensions/shared_module_service.cc b/chrome/browser/extensions/shared_module_service.cc index d3a8cdf6..64284ba 100644 --- a/chrome/browser/extensions/shared_module_service.cc +++ b/chrome/browser/extensions/shared_module_service.cc
@@ -134,6 +134,22 @@ return dependents; } +InstallGate::Action SharedModuleService::ShouldDelay(const Extension* extension, + bool install_immediately) { + ImportStatus status = SatisfyImports(extension); + switch (status) { + case IMPORT_STATUS_OK: + return INSTALL; + case IMPORT_STATUS_UNSATISFIED: + return DELAY; + case IMPORT_STATUS_UNRECOVERABLE: + return ABORT; + } + + NOTREACHED(); + return INSTALL; +} + void SharedModuleService::PruneSharedModules() { ExtensionRegistry* registry = ExtensionRegistry::Get(browser_context_); ExtensionService* service =
diff --git a/chrome/browser/extensions/shared_module_service.h b/chrome/browser/extensions/shared_module_service.h index 13605ae..b10094ed 100644 --- a/chrome/browser/extensions/shared_module_service.h +++ b/chrome/browser/extensions/shared_module_service.h
@@ -9,6 +9,7 @@ #include "base/macros.h" #include "base/scoped_observer.h" +#include "chrome/browser/extensions/install_gate.h" #include "extensions/browser/extension_registry_observer.h" #include "extensions/common/manifest_handlers/shared_module_info.h" @@ -21,7 +22,8 @@ class ExtensionSet; class ExtensionRegistry; -class SharedModuleService : public ExtensionRegistryObserver { +class SharedModuleService : public ExtensionRegistryObserver, + public InstallGate { public: enum ImportStatus { // No imports needed. @@ -56,6 +58,10 @@ std::unique_ptr<ExtensionSet> GetDependentExtensions( const Extension* extension); + // InstallGate: + Action ShouldDelay(const Extension* extension, + bool install_immediately) override; + private: // Uninstall shared modules which are not used by other extensions. void PruneSharedModules();
diff --git a/chrome/browser/extensions/update_install_gate.cc b/chrome/browser/extensions/update_install_gate.cc new file mode 100644 index 0000000..14173a88 --- /dev/null +++ b/chrome/browser/extensions/update_install_gate.cc
@@ -0,0 +1,53 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/extensions/update_install_gate.h" + +#include "chrome/browser/extensions/extension_service.h" +#include "chrome/browser/extensions/extension_util.h" +#include "chrome/browser/profiles/profile.h" +#include "extensions/browser/event_router.h" +#include "extensions/common/extension.h" +#include "extensions/common/manifest_handlers/background_info.h" + +namespace extensions { + +UpdateInstallGate::UpdateInstallGate(ExtensionService* service) + : service_(service) {} + +InstallGate::Action UpdateInstallGate::ShouldDelay(const Extension* extension, + bool install_immediately) { + // Allow installation when |install_immediately| is set or ExtensionService + // is not ready. UpdateInstallGate blocks update when the old version of + // the extension is not idle (i.e. in use). When ExtensionService is not + // ready, the old version is definitely idle, so the installation is allowed + // to proceeded. This essentially allows the delayed installation to happen + // during the initialization of ExtensionService. + if (install_immediately || !service_->is_ready()) + return INSTALL; + + const Extension* old = service_->GetInstalledExtension(extension->id()); + // If there is no old extension, this is not an update, so don't delay. + if (!old) + return INSTALL; + + if (extensions::BackgroundInfo::HasPersistentBackgroundPage(old)) { + const char kOnUpdateAvailableEvent[] = "runtime.onUpdateAvailable"; + // Delay installation if the extension listens for the onUpdateAvailable + // event. + return extensions::EventRouter::Get(service_->profile()) + ->ExtensionHasEventListener(extension->id(), + kOnUpdateAvailableEvent) + ? DELAY + : INSTALL; + } else { + // Delay installation if the extension is not idle. + return !extensions::util::IsExtensionIdle(extension->id(), + service_->profile()) + ? DELAY + : INSTALL; + } +} + +} // namespace extensions
diff --git a/chrome/browser/extensions/update_install_gate.h b/chrome/browser/extensions/update_install_gate.h new file mode 100644 index 0000000..af72776 --- /dev/null +++ b/chrome/browser/extensions/update_install_gate.h
@@ -0,0 +1,33 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_EXTENSIONS_UPDATE_INSTALL_GATE_H_ +#define CHROME_BROWSER_EXTENSIONS_UPDATE_INSTALL_GATE_H_ + +#include "base/macros.h" +#include "chrome/browser/extensions/install_gate.h" + +class ExtensionService; + +namespace extensions { + +// Delays an extension update if the old version is not idle. +class UpdateInstallGate : public InstallGate { + public: + explicit UpdateInstallGate(ExtensionService* service); + + // InstallGate: + Action ShouldDelay(const Extension* extension, + bool install_immediately) override; + + private: + // Not owned. + ExtensionService* const service_; + + DISALLOW_COPY_AND_ASSIGN(UpdateInstallGate); +}; + +} // namespace extensions + +#endif // CHROME_BROWSER_EXTENSIONS_UPDATE_INSTALL_GATE_H_
diff --git a/chrome/browser/extensions/update_install_gate_unittest.cc b/chrome/browser/extensions/update_install_gate_unittest.cc new file mode 100644 index 0000000..a42ee16 --- /dev/null +++ b/chrome/browser/extensions/update_install_gate_unittest.cc
@@ -0,0 +1,279 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/extensions/update_install_gate.h" + +#include <memory> + +#include "base/command_line.h" +#include "base/memory/ptr_util.h" +#include "base/run_loop.h" +#include "chrome/browser/extensions/extension_service.h" +#include "chrome/browser/extensions/test_extension_system.h" +#include "chrome/test/base/testing_browser_process.h" +#include "chrome/test/base/testing_profile.h" +#include "chrome/test/base/testing_profile_manager.h" +#include "content/public/test/test_browser_thread_bundle.h" +#include "content/public/test/test_renderer_host.h" +#include "extensions/browser/event_router.h" +#include "extensions/browser/event_router_factory.h" +#include "extensions/browser/extension_host.h" +#include "extensions/browser/extension_prefs.h" +#include "extensions/browser/extension_registry.h" +#include "extensions/common/extension_builder.h" +#include "extensions/common/manifest_handlers/background_info.h" +#include "extensions/common/value_builder.h" +#include "testing/gtest/include/gtest/gtest.h" + +#if defined(OS_CHROMEOS) +#include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h" +#include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h" +#include "chrome/browser/chromeos/settings/cros_settings.h" +#include "chrome/browser/chromeos/settings/device_settings_service.h" +#endif + +namespace extensions { + +namespace { + +const char kAppId[] = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; +const char kPersistentExtensionId[] = "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"; +const char kNonPersistentExtensionId[] = "cccccccccccccccccccccccccccccccc"; + +std::unique_ptr<KeyedService> BuildEventRouter( + content::BrowserContext* profile) { + return base::WrapUnique(new extensions::EventRouter(profile, nullptr)); +} + +scoped_refptr<Extension> CreateApp(const std::string& extension_id, + const std::string& version) { + scoped_refptr<Extension> app = + ExtensionBuilder() + .SetManifest( + DictionaryBuilder() + .Set("name", "Test app") + .Set("version", version) + .Set("manifest_version", 2) + .Set("app", + DictionaryBuilder() + .Set("background", + DictionaryBuilder() + .Set("scripts", ListBuilder() + .Append("background.js") + .Build()) + .Build()) + .Build()) + .Build()) + .SetID(extension_id) + .Build(); + return app; +} + +scoped_refptr<Extension> CreateExtension(const std::string& extension_id, + const std::string& version, + bool persistent) { + scoped_refptr<Extension> extension = + ExtensionBuilder() + .SetManifest( + DictionaryBuilder() + .Set("name", "Test extension") + .Set("version", version) + .Set("manifest_version", 2) + .Set("background", DictionaryBuilder() + .Set("page", "background.html") + .SetBoolean("persistent", persistent) + .Build()) + .Build()) + .SetID(extension_id) + .Build(); + return extension; +} + +ExtensionHost* CreateHost(Profile* profile, const Extension* app) { + ProcessManager::Get(profile)->CreateBackgroundHost( + app, BackgroundInfo::GetBackgroundURL(app)); + base::RunLoop().RunUntilIdle(); + + return ProcessManager::Get(profile)->GetBackgroundHostForExtension(app->id()); +} + +} // namespace + +class UpdateInstallGateTest : public testing::Test { + public: + UpdateInstallGateTest() { + profile_manager_.reset( + new TestingProfileManager(TestingBrowserProcess::GetGlobal())); + } + + // testing::Test + void SetUp() override { + // Must be called from ::testing::Test::SetUp. + ASSERT_TRUE(profile_manager_->SetUp()); + + const char kUserProfile[] = "profile1@example.com"; +#if defined(OS_CHROMEOS) + const AccountId account_id(AccountId::FromUserEmail(kUserProfile)); + // Needed to allow ChromeProcessManagerDelegate to allow background pages. + fake_user_manager_ = new chromeos::FakeChromeUserManager(); + // Takes ownership of fake_user_manager_. + scoped_user_manager_enabler_.reset( + new chromeos::ScopedUserManagerEnabler(fake_user_manager_)); + fake_user_manager_->AddUser(account_id); + fake_user_manager_->LoginUser(account_id); +#endif + profile_ = profile_manager_->CreateTestingProfile(kUserProfile); + profile_manager_->SetLoggedIn(true); + + TestExtensionSystem* test_extension_system = + static_cast<TestExtensionSystem*>(ExtensionSystem::Get(profile_)); + service_ = test_extension_system->CreateExtensionService( + base::CommandLine::ForCurrentProcess(), + base::FilePath() /* install_directory */, + false /* autoupdate_enabled */); + registry_ = ExtensionRegistry::Get(profile_); + + event_router_ = static_cast<EventRouter*>( + EventRouterFactory::GetInstance()->SetTestingFactoryAndUse( + profile_, &BuildEventRouter)); + + delayer_.reset(new UpdateInstallGate(service_)); + + new_app_ = CreateApp(kAppId, "2.0"); + new_persistent_ = CreateExtension(kPersistentExtensionId, "2.0", true); + new_none_persistent_ = + CreateExtension(kNonPersistentExtensionId, "2.0", false); + } + + void TearDown() override { profile_manager_->DeleteAllTestingProfiles(); } + + void AddExistingExtensions() { + scoped_refptr<Extension> app = CreateApp(kAppId, "1.0"); + registry_->AddEnabled(app); + + scoped_refptr<Extension> persistent = + CreateExtension(kPersistentExtensionId, "1.0", true); + registry_->AddEnabled(persistent); + + scoped_refptr<Extension> none_persistent = + CreateExtension(kNonPersistentExtensionId, "1.0", false); + registry_->AddEnabled(none_persistent); + } + + void MakeExtensionInUse(const std::string& extension_id) { + const Extension* const extension = + registry_->GetInstalledExtension(extension_id); + ASSERT_TRUE(!!extension); + ASSERT_TRUE(!!CreateHost(profile_, extension)); + } + + void MakeExtensionListenForOnUpdateAvailable( + const std::string& extension_id) { + const char kOnUpdateAvailableEvent[] = "runtime.onUpdateAvailable"; + event_router_->AddEventListener(kOnUpdateAvailableEvent, NULL, + extension_id); + } + + void Check(const Extension* extension, + bool is_in_use, + bool has_listener, + bool install_immediately, + InstallGate::Action expected_action) { + if (is_in_use) + MakeExtensionInUse(extension->id()); + if (has_listener) + MakeExtensionListenForOnUpdateAvailable(extension->id()); + + EXPECT_EQ(expected_action, + delayer()->ShouldDelay(extension, install_immediately)); + } + + UpdateInstallGate* delayer() { return delayer_.get(); } + ExtensionService* service() { return service_; } + + const Extension* new_app() const { return new_app_.get(); } + const Extension* new_persistent() const { return new_persistent_.get(); } + const Extension* new_none_persistent() const { + return new_none_persistent_.get(); + } + + private: + // Needed by extension system. + content::TestBrowserThreadBundle thread_bundle_; + + // Needed to ensure we don't end up creating actual RenderViewHosts + // and RenderProcessHosts. + content::RenderViewHostTestEnabler render_view_host_test_enabler_; + + TestingProfile* profile_ = nullptr; + std::unique_ptr<TestingProfileManager> profile_manager_; + + ExtensionService* service_ = nullptr; + ExtensionRegistry* registry_ = nullptr; + EventRouter* event_router_ = nullptr; + +#if defined(OS_CHROMEOS) + // Needed for creating ExtensionService. + chromeos::FakeChromeUserManager* fake_user_manager_ = nullptr; + std::unique_ptr<chromeos::ScopedUserManagerEnabler> + scoped_user_manager_enabler_; +#endif + + std::unique_ptr<UpdateInstallGate> delayer_; + + scoped_refptr<Extension> new_app_; + scoped_refptr<Extension> new_persistent_; + scoped_refptr<Extension> new_none_persistent_; + + DISALLOW_COPY_AND_ASSIGN(UpdateInstallGateTest); +}; + +TEST_F(UpdateInstallGateTest, InstallOnServiceNotReady) { + ASSERT_FALSE(service()->is_ready()); + Check(new_app(), false, false, false, InstallGate::INSTALL); + Check(new_persistent(), false, false, false, InstallGate::INSTALL); + Check(new_none_persistent(), false, false, false, InstallGate::INSTALL); +} + +TEST_F(UpdateInstallGateTest, InstallOnFirstInstall) { + service()->Init(); + Check(new_app(), false, false, false, InstallGate::INSTALL); + Check(new_persistent(), false, false, false, InstallGate::INSTALL); + Check(new_none_persistent(), false, false, false, InstallGate::INSTALL); +} + +TEST_F(UpdateInstallGateTest, InstallOnInstallImmediately) { + service()->Init(); + AddExistingExtensions(); + + const bool kInstallImmediately = true; + for (bool in_use : {false, true}) { + for (bool has_listener : {false, true}) { + Check(new_app(), in_use, has_listener, kInstallImmediately, + InstallGate::INSTALL); + Check(new_persistent(), in_use, has_listener, kInstallImmediately, + InstallGate::INSTALL); + Check(new_none_persistent(), in_use, has_listener, kInstallImmediately, + InstallGate::INSTALL); + } + } +} + +TEST_F(UpdateInstallGateTest, DelayInstallWhenInUse) { + service()->Init(); + AddExistingExtensions(); + + const bool kInUse = true; + const bool kDontInstallImmediately = false; + for (bool has_listener : {false, true}) { + Check(new_app(), kInUse, has_listener, kDontInstallImmediately, + InstallGate::DELAY); + Check(new_persistent(), kInUse, has_listener, kDontInstallImmediately, + has_listener ? InstallGate::DELAY : InstallGate::INSTALL); + Check(new_none_persistent(), kInUse, has_listener, kDontInstallImmediately, + InstallGate::DELAY); + } +} + +} // namespace extensions
diff --git a/chrome/browser/extensions/updater/extension_updater.cc b/chrome/browser/extensions/updater/extension_updater.cc index bd93ba3..484029f7 100644 --- a/chrome/browser/extensions/updater/extension_updater.cc +++ b/chrome/browser/extensions/updater/extension_updater.cc
@@ -60,10 +60,6 @@ #endif const int kMaxUpdateFrequencySeconds = 60 * 60 * 24 * 7; // 7 days -// Require at least 5 seconds between consecutive non-succesful extension update -// checks. -const int kMinUpdateThrottleTime = 5; - // When we've computed a days value, we want to make sure we don't send a // negative value (due to the system clock being set backwards, etc.), since -1 // is a special sentinel value that means "never pinged", and other negative @@ -129,17 +125,6 @@ ExtensionUpdater::InProgressCheck::~InProgressCheck() {} -struct ExtensionUpdater::ThrottleInfo { - ThrottleInfo() - : in_progress(true), - throttle_delay(kMinUpdateThrottleTime), - check_start(Time::Now()) {} - - bool in_progress; - int throttle_delay; - Time check_start; -}; - ExtensionUpdater::ExtensionUpdater( ExtensionServiceInterface* service, ExtensionPrefs* extension_prefs, @@ -157,7 +142,6 @@ prefs_(prefs), profile_(profile), next_request_id_(0), - extension_registry_observer_(this), crx_install_is_running_(false), extension_cache_(cache), weak_ptr_factory_(this) { @@ -168,8 +152,6 @@ frequency_seconds_ = std::max(frequency_seconds_, kMinUpdateFrequencySeconds); #endif frequency_seconds_ = std::min(frequency_seconds_, kMaxUpdateFrequencySeconds); - - extension_registry_observer_.Add(ExtensionRegistry::Get(profile)); } ExtensionUpdater::~ExtensionUpdater() { @@ -422,56 +404,12 @@ NotifyIfFinished(request_id); } -bool ExtensionUpdater::CheckExtensionSoon(const std::string& extension_id, +void ExtensionUpdater::CheckExtensionSoon(const std::string& extension_id, const FinishedCallback& callback) { - bool have_throttle_info = ContainsKey(throttle_info_, extension_id); - ThrottleInfo& info = throttle_info_[extension_id]; - if (have_throttle_info) { - // We already had a ThrottleInfo object for this extension, check if the - // update check request should be allowed. - - // If another check is in progress, don't start a new check. - if (info.in_progress) - return false; - - Time now = Time::Now(); - Time last = info.check_start; - // If somehow time moved back, we don't want to infinitely keep throttling. - if (now < last) { - last = now; - info.check_start = now; - } - Time earliest = last + TimeDelta::FromSeconds(info.throttle_delay); - // If check is too soon, throttle. - if (now < earliest) - return false; - - // TODO(mek): Somehow increase time between allowing checks when checks - // are repeatedly throttled and don't result in updates being installed. - - // It's okay to start a check, update values. - info.check_start = now; - info.in_progress = true; - } - CheckParams params; params.ids.push_back(extension_id); - params.callback = base::Bind(&ExtensionUpdater::ExtensionCheckFinished, - weak_ptr_factory_.GetWeakPtr(), - extension_id, callback); + params.callback = callback; CheckNow(params); - return true; -} - -void ExtensionUpdater::ExtensionCheckFinished( - const std::string& extension_id, - const FinishedCallback& callback) { - std::map<std::string, ThrottleInfo>::iterator it = - throttle_info_.find(extension_id); - if (it != throttle_info_.end()) { - it->second.in_progress = false; - } - callback.Run(); } void ExtensionUpdater::OnExtensionDownloadFailed( @@ -659,14 +597,6 @@ MaybeInstallCRXFile(); } -void ExtensionUpdater::OnExtensionWillBeInstalled( - content::BrowserContext* browser_context, - const Extension* extension, - bool is_update, - const std::string& old_name) { - throttle_info_.erase(extension->id()); -} - void ExtensionUpdater::NotifyStarted() { content::NotificationService::current()->Notify( extensions::NOTIFICATION_EXTENSION_UPDATING_STARTED,
diff --git a/chrome/browser/extensions/updater/extension_updater.h b/chrome/browser/extensions/updater/extension_updater.h index d2568296..92851e8 100644 --- a/chrome/browser/extensions/updater/extension_updater.h +++ b/chrome/browser/extensions/updater/extension_updater.h
@@ -56,7 +56,6 @@ // .... // updater->Stop(); class ExtensionUpdater : public ExtensionDownloaderDelegate, - public ExtensionRegistryObserver, public content::NotificationObserver { public: typedef base::Closure FinishedCallback; @@ -104,10 +103,8 @@ // already a pending task that has not yet run. void CheckSoon(); - // Starts an update check for the specified extension soon. If a check - // is already running, or finished too recently without an update being - // installed, this method returns false and the check won't be scheduled. - bool CheckExtensionSoon(const std::string& extension_id, + // Starts an update check for the specified extension soon. + void CheckExtensionSoon(const std::string& extension_id, const FinishedCallback& callback); // Starts an update check right now, instead of waiting for the next @@ -158,8 +155,6 @@ std::list<std::string> in_progress_ids_; }; - struct ThrottleInfo; - // Ensure that we have a valid ExtensionDownloader instance referenced by // |downloader|. void EnsureDownloaderCreated(); @@ -214,12 +209,6 @@ const content::NotificationSource& source, const content::NotificationDetails& details) override; - // Implementation of ExtensionRegistryObserver. - void OnExtensionWillBeInstalled(content::BrowserContext* browser_context, - const Extension* extension, - bool is_update, - const std::string& old_name) override; - // Send a notification that update checks are starting. void NotifyStarted(); @@ -256,9 +245,6 @@ // Observes CRX installs we initiate. content::NotificationRegistrar registrar_; - ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> - extension_registry_observer_; - // True when a CrxInstaller is doing an install. Used in MaybeUpdateCrxFile() // to keep more than one install from running at once. bool crx_install_is_running_; @@ -269,10 +255,6 @@ ExtensionCache* extension_cache_; - // Keeps track of when an extension tried to update itself, so we can throttle - // checks to prevent too many requests from being made. - std::map<std::string, ThrottleInfo> throttle_info_; - base::WeakPtrFactory<ExtensionUpdater> weak_ptr_factory_; DISALLOW_COPY_AND_ASSIGN(ExtensionUpdater);
diff --git a/chrome/browser/geolocation/geolocation_infobar_delegate_android.cc b/chrome/browser/geolocation/geolocation_infobar_delegate_android.cc index a4b18a6..b81d233 100644 --- a/chrome/browser/geolocation/geolocation_infobar_delegate_android.cc +++ b/chrome/browser/geolocation/geolocation_infobar_delegate_android.cc
@@ -8,9 +8,7 @@ #include "chrome/browser/infobars/infobar_service.h" #include "chrome/grit/generated_resources.h" #include "components/infobars/core/infobar.h" -#include "components/url_formatter/elide_url.h" #include "grit/generated_resources.h" -#include "ui/base/l10n/l10n_util.h" // static infobars::InfoBar* GeolocationInfoBarDelegateAndroid::Create( @@ -42,8 +40,6 @@ return IDR_ANDROID_INFOBAR_GEOLOCATION; } -base::string16 GeolocationInfoBarDelegateAndroid::GetMessageText() const { - return l10n_util::GetStringFUTF16(IDS_GEOLOCATION_INFOBAR_QUESTION, - url_formatter::FormatUrlForSecurityDisplay( - requesting_frame_)); +int GeolocationInfoBarDelegateAndroid::GetMessageResourceId() const { + return IDS_GEOLOCATION_INFOBAR_QUESTION; }
diff --git a/chrome/browser/geolocation/geolocation_infobar_delegate_android.h b/chrome/browser/geolocation/geolocation_infobar_delegate_android.h index 029f701..94c3515b 100644 --- a/chrome/browser/geolocation/geolocation_infobar_delegate_android.h +++ b/chrome/browser/geolocation/geolocation_infobar_delegate_android.h
@@ -29,7 +29,7 @@ // PermissionInfoBarDelegate: infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override; int GetIconId() const override; - base::string16 GetMessageText() const override; + int GetMessageResourceId() const override; GURL requesting_frame_;
diff --git a/chrome/browser/icon_loader_win.cc b/chrome/browser/icon_loader_win.cc index 9378295..759088d3 100644 --- a/chrome/browser/icon_loader_win.cc +++ b/chrome/browser/icon_loader_win.cc
@@ -11,10 +11,10 @@ #include "base/message_loop/message_loop.h" #include "base/threading/thread.h" #include "third_party/skia/include/core/SkBitmap.h" +#include "ui/display/win/dpi.h" #include "ui/gfx/geometry/size.h" #include "ui/gfx/icon_util.h" #include "ui/gfx/image/image_skia.h" -#include "ui/gfx/win/dpi.h" // static IconGroupID IconLoader::ReadGroupIDFromFilepath( @@ -61,7 +61,8 @@ std::unique_ptr<SkBitmap> bitmap( IconUtil::CreateSkBitmapFromHICON(file_info.hIcon)); if (bitmap.get()) { - gfx::ImageSkia image_skia(gfx::ImageSkiaRep(*bitmap, gfx::GetDPIScale())); + gfx::ImageSkia image_skia(gfx::ImageSkiaRep(*bitmap, + display::win::GetDPIScale())); image_skia.MakeThreadSafe(); image_.reset(new gfx::Image(image_skia)); DestroyIcon(file_info.hIcon);
diff --git a/chrome/browser/io_thread_unittest.cc b/chrome/browser/io_thread_unittest.cc index 13753dc..c1bfd0f 100644 --- a/chrome/browser/io_thread_unittest.cc +++ b/chrome/browser/io_thread_unittest.cc
@@ -93,7 +93,7 @@ EXPECT_FALSE(params_.enable_tcp_fast_open_for_ssl); EXPECT_FALSE(params_.parse_alternative_services); EXPECT_FALSE(params_.enable_alternative_service_with_different_host); - EXPECT_TRUE(params_.enable_npn); + EXPECT_FALSE(params_.enable_npn); EXPECT_TRUE(params_.enable_priority_dependencies); EXPECT_FALSE(params_.enable_quic); EXPECT_FALSE(params_.enable_quic_for_proxies);
diff --git a/chrome/browser/locale_tests_browsertest.cc b/chrome/browser/locale_tests_browsertest.cc index 26b82d11..75d814a 100644 --- a/chrome/browser/locale_tests_browsertest.cc +++ b/chrome/browser/locale_tests_browsertest.cc
@@ -4,10 +4,11 @@ #include <stddef.h> +#include <memory> + #include "base/command_line.h" #include "base/environment.h" #include "base/macros.h" -#include "base/memory/scoped_ptr.h" #include "build/build_config.h" #include "chrome/test/base/in_process_browser_test.h" #include "ui/base/ui_base_switches.h"
diff --git a/chrome/browser/media/DEPS b/chrome/browser/media/DEPS index c230b82..30abf7d6 100644 --- a/chrome/browser/media/DEPS +++ b/chrome/browser/media/DEPS
@@ -2,6 +2,7 @@ "+media/audio", "+media/base", "+media/cast", + "+media/media_features.h", "+third_party/libyuv", "+third_party/webrtc", ]
diff --git a/chrome/browser/media/encrypted_media_supported_types_browsertest.cc b/chrome/browser/media/encrypted_media_supported_types_browsertest.cc index 29dd138d..d59b992c 100644 --- a/chrome/browser/media/encrypted_media_supported_types_browsertest.cc +++ b/chrome/browser/media/encrypted_media_supported_types_browsertest.cc
@@ -23,6 +23,7 @@ #include "content/public/common/content_switches.h" #include "content/public/test/browser_test_utils.h" #include "media/base/test_data_util.h" +#include "media/media_features.h" #include "net/test/embedded_test_server/embedded_test_server.h" #include "url/gurl.h" @@ -114,6 +115,10 @@ video_mp4_codecs_.push_back("avc1.4D000C"); // Main profile. video_mp4_codecs_.push_back("avc3.64001F"); // High profile. +#if BUILDFLAG(ENABLE_MP4_VP9_DEMUXING) + video_mp4_codecs_.push_back("vp09.01.01.08.02.01.01.00"); +#endif + video_mp4_hi10p_codecs_.push_back("avc1.6E001E"); // Hi10P profile // Extended codecs are used, so make sure generic ones fail. These will be
diff --git a/chrome/browser/media/media_stream_devices_controller.cc b/chrome/browser/media/media_stream_devices_controller.cc index 515cc99..47e68a1 100644 --- a/chrome/browser/media/media_stream_devices_controller.cc +++ b/chrome/browser/media/media_stream_devices_controller.cc
@@ -30,6 +30,7 @@ #include "components/content_settings/core/common/content_settings_pattern.h" #include "components/pref_registry/pref_registry_syncable.h" #include "components/prefs/scoped_user_pref_update.h" +#include "components/url_formatter/elide_url.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/permission_type.h" #include "content/public/browser/render_frame_host.h" @@ -232,10 +233,6 @@ return old_video_setting_ == CONTENT_SETTING_ASK; } -const std::string& MediaStreamDevicesController::GetSecurityOriginSpec() const { - return request_.security_origin.spec(); -} - void MediaStreamDevicesController::ForcePermissionDeniedTemporarily() { base::AutoReset<bool> persist_permissions( &persist_permission_changes_, false); @@ -260,7 +257,9 @@ else if (!IsAskingForVideo()) message_id = IDS_MEDIA_CAPTURE_AUDIO_ONLY; return l10n_util::GetStringFUTF16( - message_id, base::UTF8ToUTF16(GetSecurityOriginSpec())); + message_id, + url_formatter::FormatUrlForSecurityDisplay( + GetOrigin(), url_formatter::SchemeDisplay::OMIT_CRYPTOGRAPHIC)); } base::string16 MediaStreamDevicesController::GetMessageTextFragment() const {
diff --git a/chrome/browser/media/media_stream_devices_controller.h b/chrome/browser/media/media_stream_devices_controller.h index d3bc932c..90c19b5 100644 --- a/chrome/browser/media/media_stream_devices_controller.h +++ b/chrome/browser/media/media_stream_devices_controller.h
@@ -39,7 +39,6 @@ bool IsAllowedForVideo() const; bool IsAskingForAudio() const; bool IsAskingForVideo() const; - const std::string& GetSecurityOriginSpec() const; // Forces the permissions to be denied (without being persisted) regardless // of what the previous state was. If the user had previously allowed the
diff --git a/chrome/browser/media/media_stream_infobar_delegate_android.cc b/chrome/browser/media/media_stream_infobar_delegate_android.cc index fe04c526..3e77c74 100644 --- a/chrome/browser/media/media_stream_infobar_delegate_android.cc +++ b/chrome/browser/media/media_stream_infobar_delegate_android.cc
@@ -108,13 +108,7 @@ } base::string16 MediaStreamInfoBarDelegateAndroid::GetMessageText() const { - int message_id = IDS_MEDIA_CAPTURE_AUDIO_AND_VIDEO; - if (!controller_->IsAskingForAudio()) - message_id = IDS_MEDIA_CAPTURE_VIDEO_ONLY; - else if (!controller_->IsAskingForVideo()) - message_id = IDS_MEDIA_CAPTURE_AUDIO_ONLY; - return l10n_util::GetStringFUTF16( - message_id, base::UTF8ToUTF16(controller_->GetSecurityOriginSpec())); + return controller_->GetMessageText(); } base::string16 MediaStreamInfoBarDelegateAndroid::GetButtonLabel( @@ -125,8 +119,7 @@ } bool MediaStreamInfoBarDelegateAndroid::Accept() { - GURL origin(controller_->GetSecurityOriginSpec()); - if (content::IsOriginSecure(origin)) { + if (content::IsOriginSecure(controller_->GetOrigin())) { UMA_HISTOGRAM_ENUMERATION("Media.DevicePermissionActions", kAllowHttps, kPermissionActionsMax); } else {
diff --git a/chrome/browser/media/midi_permission_infobar_delegate_android.cc b/chrome/browser/media/midi_permission_infobar_delegate_android.cc index 9e65adc..d32a40d 100644 --- a/chrome/browser/media/midi_permission_infobar_delegate_android.cc +++ b/chrome/browser/media/midi_permission_infobar_delegate_android.cc
@@ -7,9 +7,7 @@ #include "chrome/browser/infobars/infobar_service.h" #include "chrome/grit/generated_resources.h" #include "components/infobars/core/infobar.h" -#include "components/url_formatter/elide_url.h" #include "grit/theme_resources.h" -#include "ui/base/l10n/l10n_util.h" // static infobars::InfoBar* MidiPermissionInfoBarDelegateAndroid::Create( @@ -42,9 +40,6 @@ return IDR_INFOBAR_MIDI; } -base::string16 MidiPermissionInfoBarDelegateAndroid::GetMessageText() const { - return l10n_util::GetStringFUTF16( - IDS_MIDI_SYSEX_INFOBAR_QUESTION, - url_formatter::FormatUrlForSecurityDisplay( - requesting_frame_.GetOrigin())); +int MidiPermissionInfoBarDelegateAndroid::GetMessageResourceId() const { + return IDS_MIDI_SYSEX_INFOBAR_QUESTION; }
diff --git a/chrome/browser/media/midi_permission_infobar_delegate_android.h b/chrome/browser/media/midi_permission_infobar_delegate_android.h index fb7b1afc..b6a8c1a9 100644 --- a/chrome/browser/media/midi_permission_infobar_delegate_android.h +++ b/chrome/browser/media/midi_permission_infobar_delegate_android.h
@@ -33,7 +33,7 @@ // ConfirmInfoBarDelegate: infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override; int GetIconId() const override; - base::string16 GetMessageText() const override; + int GetMessageResourceId() const override; GURL requesting_frame_;
diff --git a/chrome/browser/media/protected_media_identifier_infobar_delegate_android.cc b/chrome/browser/media/protected_media_identifier_infobar_delegate_android.cc index 1054685d..9e48cbc2 100644 --- a/chrome/browser/media/protected_media_identifier_infobar_delegate_android.cc +++ b/chrome/browser/media/protected_media_identifier_infobar_delegate_android.cc
@@ -9,7 +9,6 @@ #include "chrome/common/url_constants.h" #include "chrome/grit/generated_resources.h" #include "components/infobars/core/infobar.h" -#include "components/url_formatter/elide_url.h" #include "grit/components_strings.h" #include "ui/base/l10n/l10n_util.h" @@ -47,11 +46,9 @@ return IDR_ANDROID_INFOBAR_PROTECTED_MEDIA_IDENTIFIER; } -base::string16 ProtectedMediaIdentifierInfoBarDelegateAndroid::GetMessageText() +int ProtectedMediaIdentifierInfoBarDelegateAndroid::GetMessageResourceId() const { - return l10n_util::GetStringFUTF16( - IDS_PROTECTED_MEDIA_IDENTIFIER_INFOBAR_QUESTION, - url_formatter::FormatUrlForSecurityDisplay(requesting_frame_)); + return IDS_PROTECTED_MEDIA_IDENTIFIER_INFOBAR_QUESTION; } base::string16 ProtectedMediaIdentifierInfoBarDelegateAndroid::GetLinkText()
diff --git a/chrome/browser/media/protected_media_identifier_infobar_delegate_android.h b/chrome/browser/media/protected_media_identifier_infobar_delegate_android.h index 2c6edfa..74db50e 100644 --- a/chrome/browser/media/protected_media_identifier_infobar_delegate_android.h +++ b/chrome/browser/media/protected_media_identifier_infobar_delegate_android.h
@@ -32,7 +32,7 @@ // ConfirmInfoBarDelegate: infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override; int GetIconId() const override; - base::string16 GetMessageText() const override; + int GetMessageResourceId() const override; base::string16 GetLinkText() const override; GURL GetLinkURL() const override;
diff --git a/chrome/browser/memory/tab_manager.cc b/chrome/browser/memory/tab_manager.cc index a229986..9d7ff7b 100644 --- a/chrome/browser/memory/tab_manager.cc +++ b/chrome/browser/memory/tab_manager.cc
@@ -35,6 +35,7 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_list.h" +#include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/tab_contents/tab_contents_iterator.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/browser/ui/tabs/tab_utils.h" @@ -141,7 +142,7 @@ under_memory_pressure_(false), weak_ptr_factory_(this) { #if defined(OS_CHROMEOS) - delegate_.reset(new TabManagerDelegate); + delegate_.reset(new TabManagerDelegate(weak_ptr_factory_.GetWeakPtr())); #endif browser_tab_strip_tracker_.Init( BrowserTabStripTracker::InitWith::ALL_BROWERS); @@ -278,8 +279,7 @@ // handling process. if (base::CommandLine::ForCurrentProcess()->HasSwitch( chromeos::switches::kEnableArcMemoryManagement)) { - delegate_->LowMemoryKill(weak_ptr_factory_.GetWeakPtr(), - GetUnsortedTabStats()); + delegate_->LowMemoryKill(GetUnsortedTabStats()); return; } #endif @@ -462,17 +462,17 @@ void TabManager::AddTabStats(TabStatsList* stats_list) { BrowserList* browser_list = BrowserList::GetInstance(); - // The first window will be the active one. - bool browser_active = true; for (BrowserList::const_reverse_iterator browser_iterator = browser_list->begin_last_active(); browser_iterator != browser_list->end_last_active(); ++browser_iterator) { Browser* browser = *browser_iterator; - AddTabStats(browser->tab_strip_model(), browser->is_app(), browser_active, + // |is_active_window| tells us whether this browser window is active. It is + // possible that none of the browser windows is active because it's some + // other application window in the foreground. + bool is_active_window = browser->window()->IsActive(); + AddTabStats(browser->tab_strip_model(), browser->is_app(), is_active_window, stats_list); - // The active browser window is processed in the first iteration. - browser_active = false; } }
diff --git a/chrome/browser/memory/tab_manager.h b/chrome/browser/memory/tab_manager.h index 1614cc7..d1f3741 100644 --- a/chrome/browser/memory/tab_manager.h +++ b/chrome/browser/memory/tab_manager.h
@@ -117,6 +117,10 @@ // |test_tick_clock_| for more details. void set_test_tick_clock(base::TickClock* test_tick_clock); + // Returns the list of the stats for all renderers. Must be called on the UI + // thread. + TabStatsList GetUnsortedTabStats(); + private: FRIEND_TEST_ALL_PREFIXES(TabManagerTest, ChildProcessNotifications); FRIEND_TEST_ALL_PREFIXES(TabManagerTest, Comparator); @@ -236,10 +240,6 @@ // Implementation of DiscardTab. bool DiscardTabImpl(); - // Returns the list of the stats for all renderers. Must be called on the UI - // thread. - TabStatsList GetUnsortedTabStats(); - // Timer to periodically update the stats of the renderers. base::RepeatingTimer update_timer_;
diff --git a/chrome/browser/memory/tab_manager_delegate_chromeos.cc b/chrome/browser/memory/tab_manager_delegate_chromeos.cc index e2a07e07..c227fdb 100644 --- a/chrome/browser/memory/tab_manager_delegate_chromeos.cc +++ b/chrome/browser/memory/tab_manager_delegate_chromeos.cc
@@ -9,9 +9,11 @@ #include <string> #include <vector> +#include "ash/shell.h" #include "base/bind.h" #include "base/command_line.h" #include "base/memory/memory_pressure_monitor_chromeos.h" +#include "base/process/process_handle.h" // kNullProcessHandle. #include "base/strings/string16.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" @@ -20,17 +22,22 @@ #include "chrome/browser/chromeos/arc/arc_process.h" #include "chrome/browser/chromeos/arc/arc_process_service.h" #include "chrome/browser/memory/tab_stats.h" +#include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_list.h" +#include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/common/chrome_constants.h" #include "chromeos/chromeos_switches.h" #include "components/arc/arc_bridge_service.h" #include "components/arc/common/process.mojom.h" +#include "components/exo/shell_surface.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/notification_service.h" #include "content/public/browser/notification_types.h" #include "content/public/browser/render_process_host.h" #include "content/public/browser/render_widget_host.h" #include "content/public/browser/zygote_host_linux.h" +#include "ui/aura/window.h" +#include "ui/wm/public/activation_client.h" using base::ProcessHandle; using base::TimeDelta; @@ -39,14 +46,36 @@ namespace memory { namespace { +const char kExoShellSurfaceWindowName[] = "ExoShellSurface"; +const char kArcProcessNamePrefix[] = "org.chromium.arc."; + // When switching to a new tab the tab's renderer's OOM score needs to be // updated to reflect its front-most status and protect it from discard. // However, doing this immediately might slow down tab switch time, so wait // a little while before doing the adjustment. -const int kFocusedTabScoreAdjustIntervalMs = 500; +const int kFocusedProcessScoreAdjustIntervalMs = 500; -// TODO(cylee): Check whether the app is in foreground or not. -int AppStateToPriority(const arc::mojom::ProcessState& process_state) { +aura::client::ActivationClient* GetActivationClient() { + if (!ash::Shell::HasInstance()) + return nullptr; + return aura::client::GetActivationClient(ash::Shell::GetPrimaryRootWindow()); +} + +// Checks if a window renders ARC apps. +bool IsArcWindow(aura::Window* window) { + if (!window || window->name() != kExoShellSurfaceWindowName) + return false; + std::string application_id = exo::ShellSurface::GetApplicationId(window); + return application_id.find(kArcProcessNamePrefix) == 0; +} + +bool IsArcWindowInForeground() { + auto activation_client = GetActivationClient(); + return activation_client && IsArcWindow(activation_client->GetActiveWindow()); +} + +int AppStateToPriority( + const arc::mojom::ProcessState& process_state) { // Logic copied from Android: // frameworks/base/core/java/android/app/ActivityManager.java // Note that ProcessState enumerates from most important (lower value) to @@ -67,16 +96,21 @@ } else if (process_state >= arc::mojom::ProcessState::FOREGROUND_SERVICE) { return ProcessPriority::ANDROID_FOREGROUND_SERVICE; } else if (process_state >= arc::mojom::ProcessState::TOP) { - return ProcessPriority::ANDROID_TOP; + return IsArcWindowInForeground() ? + ProcessPriority::ANDROID_TOP : + ProcessPriority::ANDROID_TOP_INACTIVE; } else if (process_state >= arc::mojom::ProcessState::PERSISTENT) { return ProcessPriority::ANDROID_PERSISTENT; } return ProcessPriority::ANDROID_NON_EXISTS; } -// TODO(cylee): Check whether the tab is in foreground or not. int TabStatsToPriority(const TabStats& tab) { + if (tab.is_selected) + return ProcessPriority::CHROME_SELECTED; + int priority = 0; + if (tab.is_app) { priority = ProcessPriority::CHROME_APP; } else if (tab.is_internal_page) { @@ -84,9 +118,6 @@ } else { priority = ProcessPriority::CHROME_NORMAL; } - - if (tab.is_selected) - priority |= ProcessPriority::CHROME_SELECTED; if (tab.is_pinned) priority |= ProcessPriority::CHROME_PINNED; if (tab.is_media) @@ -104,8 +135,84 @@ } // namespace -TabManagerDelegate::TabManagerDelegate() - : focused_tab_process_info_(std::make_pair(0, 0)), +// Holds the info of a newly focused tab or app window. The focused process is +// set to highest priority (lowest OOM score), but not immediately. To avoid +// redundant settings the OOM score adjusting only happens after a timeout. If +// the process loses focus before the timeout, the adjustment is canceled. +// +// This information might be set on UI thread and looked up on FILE thread. So a +// lock is needed to avoid racing. +class TabManagerDelegate::FocusedProcess { + public: + static const int kInvalidArcAppNspid = 0; + struct Data { + union { + // If a chrome tqab. + base::ProcessHandle pid; + // If an ARC app. + int nspid; + }; + bool is_arc_app; + }; + + void SetTabPid(base::ProcessHandle pid) { + Data* data = new Data(); + data->is_arc_app = false; + data->pid = pid; + + base::AutoLock lock(lock_); + data_.reset(data); + } + + void SetArcAppNspid(int nspid) { + Data* data = new Data(); + data->is_arc_app = true; + data->nspid = nspid; + + base::AutoLock lock(lock_); + data_.reset(data); + } + + // Getter. Returns kNullProcessHandle if the process is not a tab. + base::ProcessHandle GetTabPid() { + base::AutoLock lock(lock_); + if (data_ && !data_->is_arc_app) + return data_->pid; + return base::kNullProcessHandle; + } + + // Getter. Returns kInvalidArcAppNspid if the process is not an arc app. + int GetArcAppNspid() { + base::AutoLock lock(lock_); + if (data_ && data_->is_arc_app) + return data_->nspid; + return kInvalidArcAppNspid; + } + + // An atomic operation which checks whether the containing instance is an ARC + // app. If so it resets the data and returns true. Useful when canceling an + // ongoing OOM score setting for a focused ARC app because the focus has been + // shifted away shortly. + bool ResetIfIsArcApp() { + base::AutoLock lock(lock_); + if (data_ && data_->is_arc_app) { + data_.reset(); + return true; + } + return false; + } + + private: + scoped_ptr<Data> data_; + // Protects rw access to data_; + base::Lock lock_; +}; + + +TabManagerDelegate::TabManagerDelegate( + const base::WeakPtr<TabManager>& tab_manager) + : tab_manager_(tab_manager), + focused_process_(new FocusedProcess()), arc_process_instance_(nullptr), arc_process_instance_version_(0), weak_ptr_factory_(this) { @@ -118,14 +225,38 @@ auto arc_bridge_service = arc::ArcBridgeService::Get(); if (arc_bridge_service) arc_bridge_service->AddObserver(this); + auto activation_client = GetActivationClient(); + if (activation_client) + activation_client->AddObserver(this); + BrowserList::GetInstance()->AddObserver(this); } TabManagerDelegate::~TabManagerDelegate() { + BrowserList::GetInstance()->RemoveObserver(this); + auto activation_client = GetActivationClient(); + if (activation_client) + activation_client->RemoveObserver(this); auto arc_bridge_service = arc::ArcBridgeService::Get(); if (arc_bridge_service) arc_bridge_service->RemoveObserver(this); } +void TabManagerDelegate::OnBrowserSetLastActive(Browser* browser) { + // Set OOM score to the selected tab when a browser window is activated. + // content::NOTIFICATION_RENDER_WIDGET_VISIBILITY_CHANGED didn't catch the + // case (like when switching focus between 2 browser windows) so we need to + // handle it here. + TabStripModel* tab_strip_model = browser->tab_strip_model(); + int selected_index = tab_strip_model->active_index(); + content::WebContents* contents = + tab_strip_model->GetWebContentsAt(selected_index); + if (!contents) + return; + + base::ProcessHandle pid = contents->GetRenderProcessHost()->GetHandle(); + AdjustFocusedTabScore(pid); +} + void TabManagerDelegate::OnProcessInstanceReady() { auto arc_bridge_service = arc::ArcBridgeService::Get(); DCHECK(arc_bridge_service); @@ -152,23 +283,57 @@ arc_process_instance_version_ = 0; } +void TabManagerDelegate::OnWindowActivated( + aura::client::ActivationChangeObserver::ActivationReason reason, + aura::Window* gained_active, + aura::Window* lost_active) { + if (IsArcWindow(gained_active)) { + // Currently there is no way to know which app is displayed in the ARC + // window, so schedule an early adjustment for all processes to reflect + // the change. + // Put a dummy FocusedProcess with nspid = kInvalidArcAppNspid for now to + // indicate the focused process is an arc app. + // TODO(cylee): Fix it when we have nspid info in ARC windows. + focused_process_->SetArcAppNspid(FocusedProcess::kInvalidArcAppNspid); + // If the timer is already running (possibly for a tab), it'll be reset + // here. + focus_process_score_adjust_timer_.Start( + FROM_HERE, + TimeDelta::FromMilliseconds(kFocusedProcessScoreAdjustIntervalMs), + this, &TabManagerDelegate::ScheduleEarlyOomPrioritiesAdjustment); + } + if (IsArcWindow(lost_active)) { + // Do not bother adjusting OOM score if the ARC window is deactivated + // shortly. + if (focused_process_->ResetIfIsArcApp() && + focus_process_score_adjust_timer_.IsRunning()) + focus_process_score_adjust_timer_.Stop(); + } +} + +void TabManagerDelegate::ScheduleEarlyOomPrioritiesAdjustment() { + DCHECK_CURRENTLY_ON(BrowserThread::UI); + if (tab_manager_) { + AdjustOomPriorities(tab_manager_->GetUnsortedTabStats()); + } +} + // If able to get the list of ARC procsses, prioritize tabs and apps as a whole. // Otherwise try to kill tabs only. void TabManagerDelegate::LowMemoryKill( - const base::WeakPtr<TabManager>& tab_manager, const TabStatsList& tab_list) { arc::ArcProcessService* arc_process_service = arc::ArcProcessService::Get(); if (arc_process_service && arc_process_service->RequestProcessList( base::Bind(&TabManagerDelegate::LowMemoryKillImpl, - weak_ptr_factory_.GetWeakPtr(), tab_manager, tab_list))) { + weak_ptr_factory_.GetWeakPtr(), tab_list))) { // LowMemoryKillImpl will be called asynchronously so nothing left to do. return; } // If the list of ARC processes is not available, call LowMemoryKillImpl // synchronously with an empty list of apps. std::vector<arc::ArcProcess> dummy_apps; - LowMemoryKillImpl(tab_manager, tab_list, dummy_apps); + LowMemoryKillImpl(tab_list, dummy_apps); } int TabManagerDelegate::GetCachedOomScore(ProcessHandle process_handle) { @@ -183,10 +348,13 @@ void TabManagerDelegate::AdjustFocusedTabScoreOnFileThread() { DCHECK_CURRENTLY_ON(BrowserThread::FILE); - base::ProcessHandle pid = 0; + base::ProcessHandle pid = focused_process_->GetTabPid(); + // The focused process doesn't render a tab. Could happen when the focus + // just switched to an ARC app. We can not avoid the race. + if (pid == base::kNullProcessHandle) + return; { base::AutoLock oom_score_autolock(oom_score_lock_); - pid = focused_tab_process_info_.second; oom_score_map_[pid] = chrome::kLowestRendererOomScore; } content::ZygoteHost::GetInstance()->AdjustRendererOOMScore( @@ -197,7 +365,36 @@ BrowserThread::PostTask( BrowserThread::FILE, FROM_HERE, base::Bind(&TabManagerDelegate::AdjustFocusedTabScoreOnFileThread, - weak_ptr_factory_.GetWeakPtr())); + base::Unretained(this))); +} + +void TabManagerDelegate::AdjustFocusedTabScore(base::ProcessHandle pid) { + // Clear running timer if one was set for a previous focused tab/app. + if (focus_process_score_adjust_timer_.IsRunning()) + focus_process_score_adjust_timer_.Stop(); + focused_process_->SetTabPid(pid); + + bool not_lowest_score = false; + { + base::AutoLock oom_score_autolock(oom_score_lock_); + // If the currently focused tab already has a lower score, do not + // set it. This can happen in case the newly focused tab is script + // connected to the previous tab. + ProcessScoreMap::iterator it = oom_score_map_.find(pid); + not_lowest_score = (it == oom_score_map_.end() || + it->second != chrome::kLowestRendererOomScore); + } + if (not_lowest_score) { + // By starting a timer we guarantee that the tab is focused for + // certain amount of time. Secondly, it also does not add overhead + // to the tab switching time. + // If there's an existing running timer (could be for ARC app), it + // would be replaced by a new task. + focus_process_score_adjust_timer_.Start( + FROM_HERE, + TimeDelta::FromMilliseconds(kFocusedProcessScoreAdjustIntervalMs), + this, &TabManagerDelegate::OnFocusTabScoreAdjustmentTimeout); + } } void TabManagerDelegate::Observe(int type, @@ -232,35 +429,19 @@ if (visible) { content::RenderProcessHost* render_host = content::Source<content::RenderWidgetHost>(source) - .ptr() - ->GetProcess(); - ProcessScoreMap::iterator it; - bool not_lowest_score = false; - { - base::AutoLock oom_score_autolock(oom_score_lock_); - focused_tab_process_info_ = - std::make_pair(render_host->GetID(), render_host->GetHandle()); - - // If the currently focused tab already has a lower score, do not - // set it. This can happen in case the newly focused tab is script - // connected to the previous tab. - it = oom_score_map_.find(focused_tab_process_info_.second); - not_lowest_score = it == oom_score_map_.end() || - it->second != chrome::kLowestRendererOomScore; - } - if (not_lowest_score) { - // By starting a timer we guarantee that the tab is focused for - // certain amount of time. Secondly, it also does not add overhead - // to the tab switching time. - if (focus_tab_score_adjust_timer_.IsRunning()) - focus_tab_score_adjust_timer_.Reset(); - else - focus_tab_score_adjust_timer_.Start( - FROM_HERE, - TimeDelta::FromMilliseconds(kFocusedTabScoreAdjustIntervalMs), - this, &TabManagerDelegate::OnFocusTabScoreAdjustmentTimeout); - } + .ptr() + ->GetProcess(); + AdjustFocusedTabScore(render_host->GetHandle()); } + // Do not handle the "else" case when it changes to invisible because + // 1. The behavior is a bit awkward in that when switching from tab A to + // tab B, the event "invisible of B" comes after "visible of A". It can + // cause problems when the 2 tabs have the same content (e.g., New Tab + // Page). To be more clear, if we try to cancel the timer when losing + // focus it may cancel the timer for the same renderer process. + // 2. When another window is launched on top of an existing browser + // window, the selected tab in the existing browser didn't receive this + // event, so an attempt to cancel timer in this case doesn't work. break; } default: @@ -279,15 +460,14 @@ // 2) last time a tab was selected // 3) is the tab currently selected void TabManagerDelegate::AdjustOomPriorities(const TabStatsList& tab_list) { - if (!IsArcMemoryManagementEnabled()) - return; - - arc::ArcProcessService* arc_process_service = arc::ArcProcessService::Get(); - if (arc_process_service && - arc_process_service->RequestProcessList( - base::Bind(&TabManagerDelegate::AdjustOomPrioritiesImpl, - weak_ptr_factory_.GetWeakPtr(), tab_list))) { - return; + if (IsArcMemoryManagementEnabled()) { + arc::ArcProcessService* arc_process_service = arc::ArcProcessService::Get(); + if (arc_process_service && + arc_process_service->RequestProcessList( + base::Bind(&TabManagerDelegate::AdjustOomPrioritiesImpl, + weak_ptr_factory_.GetWeakPtr(), tab_list))) { + return; + } } // Pass in a dummy list if unable to get ARC processes or // --enable-arc-memory-management is off. @@ -308,8 +488,11 @@ } for (const auto& app : arc_processes) { - candidates.push_back( - KillCandidate(&app, AppStateToPriority(app.process_state))); + KillCandidate candidate(&app, AppStateToPriority(app.process_state)); + // Skip persistent processes since we should never kill them. + if (candidate.priority >= ProcessPriority::ANDROID_PERSISTENT) + continue; + candidates.push_back(candidate); } // Sort candidates according to priority. @@ -320,17 +503,14 @@ } void TabManagerDelegate::LowMemoryKillImpl( - const base::WeakPtr<TabManager>& tab_manager, const TabStatsList& tab_list, const std::vector<arc::ArcProcess>& arc_processes) { std::vector<TabManagerDelegate::KillCandidate> candidates = GetSortedKillCandidates(tab_list, arc_processes); for (const auto& entry : candidates) { - // Never kill persistent process. - if (entry.priority >= ProcessPriority::ANDROID_PERSISTENT) { - break; - } + // Ensure we never kill persistent apps. + DCHECK(entry.priority != ProcessPriority::ANDROID_PERSISTENT); if (entry.is_arc_app) { if (arc_process_instance_) { arc_process_instance_->KillProcess(entry.app->nspid, "LowMemoryKill"); @@ -338,10 +518,10 @@ } } else { int64_t tab_id = entry.tab->tab_contents_id; - // Check |tab_manager| is alive before taking tabs into consideration. - if (tab_manager && - tab_manager->CanDiscardTab(tab_id) && - tab_manager->DiscardTabById(tab_id)) { + // Check |tab_manager_| is alive before taking tabs into consideration. + if (tab_manager_ && + tab_manager_->CanDiscardTab(tab_id) && + tab_manager_->DiscardTabById(tab_id)) { break; } } @@ -365,7 +545,7 @@ // Higher values are more likely to be killed by the OOM killer. // Break the processes into 2 parts. This is to help lower the chance of - // altering oom score for many processes on any small change. + // altering OOM score for many processes on any small change. int range_middle = (chrome::kLowestRendererOomScore + chrome::kHighestRendererOomScore) / 2; @@ -411,7 +591,7 @@ BrowserThread::PostTask( BrowserThread::FILE, FROM_HERE, base::Bind(&TabManagerDelegate::SetOomScoreAdjForTabsOnFileThread, - weak_ptr_factory_.GetWeakPtr(), entries)); + base::Unretained(this), entries)); } void TabManagerDelegate::SetOomScoreAdjForTabsOnFileThread( @@ -458,7 +638,7 @@ // 1. tab_list contains entries for already-discarded tabs. If the PID // (renderer_handle) is zero, we don't need to adjust the oom_score. // 2. Only add unseen process handle so if there's multiple tab maps to - // the same process, the process is set to an oom score based on its "most + // the same process, the process is set to an OOM score based on its "most // important" tab. if (process_handle != 0 && new_map->find(process_handle) == new_map->end()) {
diff --git a/chrome/browser/memory/tab_manager_delegate_chromeos.h b/chrome/browser/memory/tab_manager_delegate_chromeos.h index 0c74455..7a01250 100644 --- a/chrome/browser/memory/tab_manager_delegate_chromeos.h +++ b/chrome/browser/memory/tab_manager_delegate_chromeos.h
@@ -11,15 +11,18 @@ #include "base/containers/hash_tables.h" #include "base/gtest_prod_util.h" #include "base/macros.h" +#include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/process/process.h" #include "base/timer/timer.h" #include "chrome/browser/chromeos/arc/arc_process.h" #include "chrome/browser/memory/tab_manager.h" #include "chrome/browser/memory/tab_stats.h" +#include "chrome/browser/ui/browser_list_observer.h" #include "components/arc/arc_bridge_service.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" +#include "ui/wm/public/activation_change_observer.h" namespace memory { @@ -29,6 +32,8 @@ // TODO(cylee): Refactor this CL so the prioritize logic is unified in // TabManager. enum ProcessPriority { + // Processes on Android side which generally don't have an app window, and + // possibly be auto relaunched if killed. ANDROID_BACKGROUND = 1, ANDROID_SERVICE = 1 << 1, ANDROID_CANT_SAVE_STATE = 1 << 2, @@ -37,16 +42,26 @@ ANDROID_TOP_SLEEPING = 1 << 5, ANDROID_FOREGROUND_SERVICE = 1 << 6, ANDROID_FOREGROUND = 1 << 7, - // A chrome window can be of one of the 3 exclusive types below: + // A chrome window can be one of the 3 exclusive types below: // internal page, normal page, or chrome app. CHROME_INTERNAL = 1 << 8, CHROME_NORMAL = 1 << 9, CHROME_APP = 1 << 10, - // A chrome window could have the following 4 additional attributes + // An android app which is on top of screen from Android's point of view, + // but the app window is inactive from Chrome OS's point of view. + // Give it a higher priority then normal chrome tab since it could not be + // reloaded if killed. + ANDROID_TOP_INACTIVE = CHROME_APP, + // A chrome tab could have following 3 additional attributes // (not exclusive). CHROME_PINNED = 1 << 11, CHROME_MEDIA = 1 << 12, CHROME_CANT_SAVE_STATE = 1 << 13, + // The highest level of priority. Either a selected tab or an Android app in + // an active window. In theory there should be at most one process with this + // priority at a time, but at the time of writing Chrome couldn't get Android + // window stack info yet so there may be multiple Android apps be token as on + // top of screen for now. CHROME_SELECTED = 1 << 14, ANDROID_TOP = CHROME_SELECTED, @@ -60,19 +75,28 @@ // Note that AdjustOomPriorities will be called on the UI thread by // TabManager, but the actual work will take place on the file thread // (see implementation of AdjustOomPriorities). -class TabManagerDelegate : public content::NotificationObserver, - public arc::ArcBridgeService::Observer { +class TabManagerDelegate : public arc::ArcBridgeService::Observer, + public aura::client::ActivationChangeObserver, + public content::NotificationObserver, + public chrome::BrowserListObserver { public: - TabManagerDelegate(); + explicit TabManagerDelegate(const base::WeakPtr<TabManager>& tab_manager); ~TabManagerDelegate() override; + void OnBrowserSetLastActive(Browser* browser) override; + // ArcBridgeService::Observer overrides. void OnProcessInstanceReady() override; void OnProcessInstanceClosed() override; + // aura::ActivationChangeObserver overrides. + void OnWindowActivated( + aura::client::ActivationChangeObserver::ActivationReason reason, + aura::Window* gained_active, + aura::Window* lost_active) override; + // Kills a process on memory pressure. - void LowMemoryKill(const base::WeakPtr<TabManager>& tab_manager, - const TabStatsList& tab_stats); + void LowMemoryKill(const TabStatsList& tab_stats); // Returns oom_score_adj of a process if the score is cached by |this|. // If couldn't find the score in the cache, returns -1001 since the valid @@ -90,7 +114,7 @@ const std::vector<std::pair<base::ProcessHandle, int>>& entries); private: - FRIEND_TEST_ALL_PREFIXES(TabManagerDelegateTest, LowMemoryKill); + FRIEND_TEST_ALL_PREFIXES(TabManagerDelegateTest, KillCandidatesSorted); FRIEND_TEST_ALL_PREFIXES(TabManagerDelegateTest, SetOomScoreAdj); // On ARC enabled machines, either a tab or an app could be a possible @@ -114,6 +138,8 @@ } }; + class FocusedProcess; + // content::NotificationObserver: void Observe(int type, const content::NotificationSource& source, @@ -122,7 +148,7 @@ // Pair to hold child process host id and ProcessHandle. typedef std::pair<int, base::ProcessHandle> ProcessInfo; - // Cache oom scores in memory. + // Cache OOM scores in memory. typedef base::hash_map<base::ProcessHandle, int> ProcessScoreMap; // Get the list of candidates to kill, sorted by reversed importance. @@ -134,8 +160,7 @@ void OnFocusTabScoreAdjustmentTimeout(); // Kills a process after getting all info of tabs and apps. - void LowMemoryKillImpl(const base::WeakPtr<TabManager>& tab_manager, - const TabStatsList& tab_list, + void LowMemoryKillImpl(const TabStatsList& tab_list, const std::vector<arc::ArcProcess>& arc_processes); // Public interface to adjust OOM scores. @@ -145,6 +170,9 @@ // Sets the score of the focused tab to the least value. void AdjustFocusedTabScoreOnFileThread(); + // Sets a newly focused tab the highest priority process if it wasn't. + void AdjustFocusedTabScore(base::ProcessHandle pid); + // Called by AdjustOomPriorities. Runs on the main thread. void AdjustOomPrioritiesImpl( const TabStatsList& tab_list, @@ -157,7 +185,7 @@ void SetOomScoreAdjForTabsOnFileThread( const std::vector<std::pair<base::ProcessHandle, int>>& entries); - // Sets oom score for processes in the range [|rbegin|, |rend|) to integers + // Sets OOM score for processes in the range [|rbegin|, |rend|) to integers // distributed evenly in [|range_begin|, |range_end|). // The new score is set in |new_map|. void DistributeOomScoreInRange( @@ -167,17 +195,27 @@ int range_end, ProcessScoreMap* new_map); + // Initiates an oom priority adjustment. + void ScheduleEarlyOomPrioritiesAdjustment(); + + // Holds a reference to the owning TabManager. + const base::WeakPtr<TabManager> tab_manager_; + // Registrar to receive renderer notifications. content::NotificationRegistrar registrar_; - // Timer to guarantee that the tab is focused for a certain amount of time. - base::OneShotTimer focus_tab_score_adjust_timer_; - // This lock is for |oom_score_map_| and |focused_tab_process_info_|. + + // Timer to guarantee that the tab or app is focused for a certain amount of + // time. + base::OneShotTimer focus_process_score_adjust_timer_; + // Holds the info of the newly focused tab or app. Its OOM score would be + // adjusted when |focus_process_score_adjust_timer_| is expired. + scoped_ptr<FocusedProcess> focused_process_; + + // This lock is for |oom_score_map_|. base::Lock oom_score_lock_; // Map maintaining the process handle - oom_score mapping. Behind // |oom_score_lock_|. ProcessScoreMap oom_score_map_; - // Holds the focused tab's child process host id. Behind |oom_score_lock_|. - ProcessInfo focused_tab_process_info_; // Holds a weak pointer to arc::mojom::ProcessInstance. arc::mojom::ProcessInstance* arc_process_instance_;
diff --git a/chrome/browser/memory/tab_manager_delegate_chromeos_unittest.cc b/chrome/browser/memory/tab_manager_delegate_chromeos_unittest.cc index 68b6a98..92682b4c 100644 --- a/chrome/browser/memory/tab_manager_delegate_chromeos_unittest.cc +++ b/chrome/browser/memory/tab_manager_delegate_chromeos_unittest.cc
@@ -5,22 +5,65 @@ #include "chrome/browser/memory/tab_manager_delegate_chromeos.h" #include <algorithm> +#include <string> #include <vector> +#include "ash/shell.h" +#include "ash/test/ash_test_base.h" #include "base/logging.h" #include "chrome/browser/chromeos/arc/arc_process.h" #include "chrome/browser/memory/tab_stats.h" #include "chrome/common/url_constants.h" #include "components/arc/common/process.mojom.h" #include "components/arc/test/fake_arc_bridge_service.h" +#include "components/exo/shell_surface.h" #include "testing/gtest/include/gtest/gtest.h" +#include "ui/aura/window.h" +#include "ui/wm/public/activation_client.h" #include "url/gurl.h" namespace memory { -typedef testing::Test TabManagerDelegateTest; +namespace { -TEST_F(TabManagerDelegateTest, LowMemoryKill) { +const char kExoShellSurfaceWindowName[] = "ExoShellSurface"; +const char kArcProcessNamePrefix[] = "org.chromium.arc."; + +} // namespace + +class TabManagerDelegateTest : public ash::test::AshTestBase { + public: + TabManagerDelegateTest() : application_id_(kArcProcessNamePrefix) {} + ~TabManagerDelegateTest() override {} + + void SetUp() override { + AshTestBase::SetUp(); + + arc_window_ = CreateTestWindowInShellWithId(0); + arc_window_->SetName(kExoShellSurfaceWindowName); + exo::ShellSurface::SetApplicationId(arc_window_, + &application_id_); + } + + protected: + void ActivateArcWindow() { + GetActivationClient()->ActivateWindow(arc_window_); + } + void DeactivateArcWindow() { + GetActivationClient()->DeactivateWindow(arc_window_); + } + + private: + aura::client::ActivationClient* GetActivationClient() { + return aura::client::GetActivationClient( + ash::Shell::GetPrimaryRootWindow()); + } + + aura::Window* arc_window_; + std::string application_id_; +}; + +TEST_F(TabManagerDelegateTest, KillCandidatesSorted) { std::vector<arc::ArcProcess> arc_processes = { {1, 10, "top", arc::mojom::ProcessState::TOP}, {2, 20, "foreground", arc::mojom::ProcessState::FOREGROUND_SERVICE}, @@ -46,24 +89,65 @@ tab1, tab2, tab3, tab4, tab5 }; - std::vector<TabManagerDelegate::KillCandidate> candidates = - TabManagerDelegate::GetSortedKillCandidates( + std::vector<TabManagerDelegate::KillCandidate> candidates; + + // Case 1: ARC window in the foreground. + ActivateArcWindow(); + candidates = TabManagerDelegate::GetSortedKillCandidates( tab_list, arc_processes); EXPECT_EQ(8U, candidates.size()); EXPECT_EQ("service", candidates[0].app->process_name); EXPECT_EQ("foreground", candidates[1].app->process_name); + // internal page. EXPECT_EQ(200, candidates[2].tab->tab_contents_id); + // chrome app. EXPECT_EQ(500, candidates[3].tab->tab_contents_id); + // pinned. EXPECT_EQ(100, candidates[4].tab->tab_contents_id); + // media. EXPECT_EQ(400, candidates[5].tab->tab_contents_id); + // pinned and media. EXPECT_EQ(300, candidates[6].tab->tab_contents_id); + // ARC window is the active window, so top app has highest priority. EXPECT_EQ("top", candidates[7].app->process_name); + + // Case 2: ARC window in the background. + DeactivateArcWindow(); + candidates = TabManagerDelegate::GetSortedKillCandidates( + tab_list, arc_processes); + EXPECT_EQ(8U, candidates.size()); + + EXPECT_EQ("service", candidates[0].app->process_name); + EXPECT_EQ("foreground", candidates[1].app->process_name); + // internal page. + EXPECT_EQ(200, candidates[2].tab->tab_contents_id); + + // Chrome app and android app are tied, so both orders are correct. + if (candidates[3].is_arc_app) { + EXPECT_EQ("top", candidates[3].app->process_name); + // chrome app. + EXPECT_EQ(500, candidates[4].tab->tab_contents_id); + } else { + // chrome app. + EXPECT_EQ(500, candidates[3].tab->tab_contents_id); + EXPECT_EQ("top", candidates[4].app->process_name); + } + + // pinned. + EXPECT_EQ(100, candidates[5].tab->tab_contents_id); + // media. + EXPECT_EQ(400, candidates[6].tab->tab_contents_id); + // pinned and media. + EXPECT_EQ(300, candidates[7].tab->tab_contents_id); } class MockTabManagerDelegate : public TabManagerDelegate { + public: + MockTabManagerDelegate(): TabManagerDelegate(nullptr) { + } protected: - // Nullify the operation for nuit test. + // Nullify the operation for unit test. void SetOomScoreAdjForTabs( const std::vector<std::pair<base::ProcessHandle, int>>& entries) override {} @@ -73,6 +157,7 @@ arc::FakeArcBridgeService fake_arc_bridge_service; MockTabManagerDelegate tab_manager_delegate; + ActivateArcWindow(); std::vector<arc::ArcProcess> arc_processes = { {1, 10, "top", arc::mojom::ProcessState::TOP}, {2, 20, "foreground", arc::mojom::ProcessState::FOREGROUND_SERVICE},
diff --git a/chrome/browser/metrics/chrome_metrics_service_client.cc b/chrome/browser/metrics/chrome_metrics_service_client.cc index 9d05aded..ed4fe07e 100644 --- a/chrome/browser/metrics/chrome_metrics_service_client.cc +++ b/chrome/browser/metrics/chrome_metrics_service_client.cc
@@ -236,7 +236,10 @@ } void ChromeMetricsServiceClient::OnRecordingDisabled() { - crash_keys::ClearMetricsClientId(); + // If we're shutting down, don't drop the metrics_client_id, so that late + // crashes won't lose it. + if (!g_browser_process->IsShuttingDown()) + crash_keys::ClearMetricsClientId(); } bool ChromeMetricsServiceClient::IsOffTheRecordSessionActive() {
diff --git a/chrome/browser/nacl_host/test/nacl_gdb_browsertest.cc b/chrome/browser/nacl_host/test/nacl_gdb_browsertest.cc index d498d950..4555f8c6 100644 --- a/chrome/browser/nacl_host/test/nacl_gdb_browsertest.cc +++ b/chrome/browser/nacl_host/test/nacl_gdb_browsertest.cc
@@ -2,10 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <memory> + #include "base/command_line.h" #include "base/environment.h" #include "base/files/file_util.h" -#include "base/memory/scoped_ptr.h" #include "base/path_service.h" #include "base/win/windows_version.h" #include "build/build_config.h"
diff --git a/chrome/browser/net/net_error_tab_helper.cc b/chrome/browser/net/net_error_tab_helper.cc index cf27cabb..3a54c68 100644 --- a/chrome/browser/net/net_error_tab_helper.cc +++ b/chrome/browser/net/net_error_tab_helper.cc
@@ -263,7 +263,7 @@ if (testing_state_ != TESTING_DEFAULT) return testing_state_ == TESTING_FORCE_ENABLED; - // TODO(ttuttle): Disable on mobile? + // TODO(juliatuttle): Disable on mobile? return *resolve_errors_with_web_service_; }
diff --git a/chrome/browser/notifications/notification_permission_infobar_delegate.cc b/chrome/browser/notifications/notification_permission_infobar_delegate.cc index 39a1f39..b23ce55b 100644 --- a/chrome/browser/notifications/notification_permission_infobar_delegate.cc +++ b/chrome/browser/notifications/notification_permission_infobar_delegate.cc
@@ -8,9 +8,6 @@ #include "chrome/browser/infobars/infobar_service.h" #include "chrome/grit/generated_resources.h" #include "components/infobars/core/infobar.h" -#include "components/url_formatter/elide_url.h" -#include "net/base/escape.h" -#include "ui/base/l10n/l10n_util.h" // static infobars::InfoBar* NotificationPermissionInfobarDelegate::Create( @@ -44,9 +41,6 @@ return IDR_ANDROID_INFOBAR_NOTIFICATIONS; } -base::string16 NotificationPermissionInfobarDelegate::GetMessageText() const { - return l10n_util::GetStringFUTF16( - IDS_NOTIFICATION_PERMISSIONS, - url_formatter::FormatUrlForSecurityDisplay( - requesting_frame_.GetOrigin())); +int NotificationPermissionInfobarDelegate::GetMessageResourceId() const { + return IDS_NOTIFICATION_PERMISSIONS; }
diff --git a/chrome/browser/notifications/notification_permission_infobar_delegate.h b/chrome/browser/notifications/notification_permission_infobar_delegate.h index bd4f247..7bd72ce 100644 --- a/chrome/browser/notifications/notification_permission_infobar_delegate.h +++ b/chrome/browser/notifications/notification_permission_infobar_delegate.h
@@ -28,7 +28,7 @@ // PermissionInfoBarDelegate: infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override; int GetIconId() const override; - base::string16 GetMessageText() const override; + int GetMessageResourceId() const override; GURL requesting_frame_;
diff --git a/chrome/browser/notifications/platform_notification_service_browsertest.cc b/chrome/browser/notifications/platform_notification_service_browsertest.cc index 2258bba..48e167e 100644 --- a/chrome/browser/notifications/platform_notification_service_browsertest.cc +++ b/chrome/browser/notifications/platform_notification_service_browsertest.cc
@@ -112,7 +112,6 @@ void PlatformNotificationServiceBrowserTest::SetUpCommandLine( base::CommandLine* command_line) { command_line->AppendSwitch(switches::kEnableExperimentalWebPlatformFeatures); - command_line->AppendSwitch(switches::kEnableNotificationActionIcons); InProcessBrowserTest::SetUpCommandLine(command_line); }
diff --git a/chrome/browser/notifications/platform_notification_service_impl.cc b/chrome/browser/notifications/platform_notification_service_impl.cc index 7a5b8bb..f8f52edb 100644 --- a/chrome/browser/notifications/platform_notification_service_impl.cc +++ b/chrome/browser/notifications/platform_notification_service_impl.cc
@@ -164,13 +164,13 @@ const GURL& origin, int action_index) { DCHECK_CURRENTLY_ON(BrowserThread::UI); - blink::WebNotificationPermission permission = + blink::mojom::PermissionStatus permission_status = CheckPermissionOnUIThread(browser_context, origin, kInvalidRenderProcessId); // TODO(peter): Change this to a CHECK() when Issue 555572 is resolved. // Also change this method to be const again. - if (permission != blink::WebNotificationPermissionAllowed) { + if (permission_status != blink::mojom::PermissionStatus::GRANTED) { content::RecordAction(base::UserMetricsAction( "Notifications.Persistent.ClickedWithoutPermission")); return; @@ -214,7 +214,7 @@ base::Bind(&OnCloseEventDispatchComplete)); } -blink::WebNotificationPermission +blink::mojom::PermissionStatus PlatformNotificationServiceImpl::CheckPermissionOnUIThread( BrowserContext* browser_context, const GURL& origin, @@ -248,7 +248,7 @@ NotifierId notifier_id(NotifierId::APPLICATION, extension->id()); if (notifier_state_tracker->IsNotifierEnabled(notifier_id)) - return blink::WebNotificationPermissionAllowed; + return blink::mojom::PermissionStatus::GRANTED; } } #endif @@ -257,14 +257,14 @@ DesktopNotificationProfileUtil::GetContentSetting(profile, origin); if (setting == CONTENT_SETTING_ALLOW) - return blink::WebNotificationPermissionAllowed; + return blink::mojom::PermissionStatus::GRANTED; if (setting == CONTENT_SETTING_BLOCK) - return blink::WebNotificationPermissionDenied; + return blink::mojom::PermissionStatus::DENIED; - return blink::WebNotificationPermissionDefault; + return blink::mojom::PermissionStatus::ASK; } -blink::WebNotificationPermission +blink::mojom::PermissionStatus PlatformNotificationServiceImpl::CheckPermissionOnIOThread( content::ResourceContext* resource_context, const GURL& origin, @@ -289,7 +289,7 @@ extensions::APIPermission::kNotifications) && process_map.Contains(extension->id(), render_process_id)) { if (!extension_info_map->AreNotificationsDisabled(extension->id())) - return blink::WebNotificationPermissionAllowed; + return blink::mojom::PermissionStatus::GRANTED; } } #endif @@ -304,11 +304,11 @@ content_settings::ResourceIdentifier()); if (setting == CONTENT_SETTING_ALLOW) - return blink::WebNotificationPermissionAllowed; + return blink::mojom::PermissionStatus::GRANTED; if (setting == CONTENT_SETTING_BLOCK) - return blink::WebNotificationPermissionDenied; + return blink::mojom::PermissionStatus::DENIED; - return blink::WebNotificationPermissionDefault; + return blink::mojom::PermissionStatus::ASK; } void PlatformNotificationServiceImpl::DisplayNotification(
diff --git a/chrome/browser/notifications/platform_notification_service_impl.h b/chrome/browser/notifications/platform_notification_service_impl.h index b26aa2ab3..e375a8d 100644 --- a/chrome/browser/notifications/platform_notification_service_impl.h +++ b/chrome/browser/notifications/platform_notification_service_impl.h
@@ -21,6 +21,7 @@ #include "chrome/browser/profiles/profile.h" #include "content/public/browser/platform_notification_service.h" #include "content/public/common/persistent_notification_status.h" +#include "third_party/WebKit/public/platform/modules/permissions/permission_status.mojom.h" class NotificationDelegate; class NotificationUIManager; @@ -86,11 +87,11 @@ void OpenNotificationSettings(content::BrowserContext* browser_context); // content::PlatformNotificationService implementation. - blink::WebNotificationPermission CheckPermissionOnUIThread( + blink::mojom::PermissionStatus CheckPermissionOnUIThread( content::BrowserContext* browser_context, const GURL& origin, int render_process_id) override; - blink::WebNotificationPermission CheckPermissionOnIOThread( + blink::mojom::PermissionStatus CheckPermissionOnIOThread( content::ResourceContext* resource_context, const GURL& origin, int render_process_id) override;
diff --git a/chrome/browser/notifications/platform_notification_service_unittest.cc b/chrome/browser/notifications/platform_notification_service_unittest.cc index d9bf4090b3..94236ac 100644 --- a/chrome/browser/notifications/platform_notification_service_unittest.cc +++ b/chrome/browser/notifications/platform_notification_service_unittest.cc
@@ -24,6 +24,7 @@ #include "content/public/test/test_browser_thread_bundle.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" +#include "third_party/WebKit/public/platform/modules/permissions/permission_status.mojom.h" #if defined(ENABLE_EXTENSIONS) #include "base/command_line.h" @@ -365,7 +366,7 @@ // Verify that the service indicates that permission has been granted. We only // check the UI thread-method for now, as that's the one guarding the behavior // in the browser process. - EXPECT_EQ(blink::WebNotificationPermissionAllowed, + EXPECT_EQ(blink::mojom::PermissionStatus::GRANTED, service()->CheckPermissionOnUIThread(profile(), extension->url(), kFakeRenderProcessId));
diff --git a/chrome/browser/page_load_metrics/observers/from_gws_page_load_metrics_observer.cc b/chrome/browser/page_load_metrics/observers/from_gws_page_load_metrics_observer.cc index 34a8aec9..b6c1a7fc 100644 --- a/chrome/browser/page_load_metrics/observers/from_gws_page_load_metrics_observer.cc +++ b/chrome/browser/page_load_metrics/observers/from_gws_page_load_metrics_observer.cc
@@ -3,7 +3,6 @@ // found in the LICENSE file. #include "chrome/browser/page_load_metrics/observers/from_gws_page_load_metrics_observer.h" - #include <string> #include "base/metrics/histogram.h" @@ -12,117 +11,260 @@ #include "components/page_load_metrics/common/page_load_timing.h" #include "net/base/registry_controlled_domains/registry_controlled_domain.h" -namespace { +namespace internal { -bool IsFromGoogle(const GURL& url) { +const char kHistogramFromGWSFirstPaint[] = + "PageLoad.Clients.FromGWS2.Timing2.NavigationToFirstPaint"; +const char kHistogramFromGWSFirstTextPaint[] = + "PageLoad.Clients.FromGWS2.Timing2.NavigationToFirstTextPaint"; +const char kHistogramFromGWSFirstImagePaint[] = + "PageLoad.Clients.FromGWS2.Timing2.NavigationToFirstImagePaint"; +const char kHistogramFromGWSFirstContentfulPaint[] = + "PageLoad.Clients.FromGWS2.Timing2.NavigationToFirstContentfulPaint"; +const char kHistogramFromGWSParseStartToFirstContentfulPaint[] = + "PageLoad.Clients.FromGWS2.Timing2.ParseStartToFirstContentfulPaint"; +const char kHistogramFromGWSDomContentLoaded[] = + "PageLoad.Clients.FromGWS2.Timing2.NavigationToDOMContentLoadedEventFired"; +const char kHistogramFromGWSParseDuration[] = + "PageLoad.Clients.FromGWS2.Timing2.ParseDuration"; +const char kHistogramFromGWSLoad[] = + "PageLoad.Clients.FromGWS2.Timing2.NavigationToLoadEventFired"; + +} // namespace internal + +// See +// https://docs.google.com/document/d/1jNPZ6Aeh0KV6umw1yZrrkfXRfxWNruwu7FELLx_cpOg/edit +// for additional details. + +// static +bool FromGWSPageLoadMetricsLogger::IsGoogleSearchHostname( + base::StringPiece host) { const char kGoogleSearchHostnamePrefix[] = "www."; - std::string domain = net::registry_controlled_domains::GetDomainAndRegistry( - url, net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES); - if (!base::StartsWith(domain, "google.", base::CompareCase::SENSITIVE) || - !base::StartsWith(url.host_piece(), kGoogleSearchHostnamePrefix, - base::CompareCase::SENSITIVE) || - url.host_piece().length() != - domain.length() + strlen(kGoogleSearchHostnamePrefix)) { + + // Hostname must start with 'www.' Hostnames are not case sensitive. + if (!base::StartsWith(host, kGoogleSearchHostnamePrefix, + base::CompareCase::INSENSITIVE_ASCII)) { return false; } - return true; -} + std::string domain = net::registry_controlled_domains::GetDomainAndRegistry( + host, + // Do not include private registries, such as appspot.com. We don't want + // to match URLs like www.google.appspot.com. + net::registry_controlled_domains::EXCLUDE_PRIVATE_REGISTRIES); -// Returns true if the provided URL is a referrer string that came from -// a Google Web Search results page. This is a little non-deterministic -// because desktop and mobile websearch differ and sometimes just provide -// http://www.google.com/ as the referrer. See -// http://googlewebmastercentral.blogspot.in/2012/03/upcoming-changes-in-googles-http.html -// In the case of /url we can be sure that it came from websearch but we will -// be generous and allow for cases where a non-Google URL was provided a bare -// Google URL as a referrer. The domain validation matches the code used by the -// prerenderer for similar purposes. -// TODO(csharrison): Remove the fuzzy logic when the referrer is reliable. -bool IsFromGoogleSearchResult(const GURL& url, const GURL& referrer) { - if (!IsFromGoogle(referrer)) + // Domain and registry must start with 'google.' e.g. 'google.com' or + // 'google.co.uk'. + if (!base::StartsWith(domain, "google.", + base::CompareCase::INSENSITIVE_ASCII)) { return false; - if (base::StartsWith(referrer.path(), "/url", base::CompareCase::SENSITIVE)) - return true; - bool is_possible_search_referrer = - referrer.path().empty() || referrer.path() == "/" || - base::StartsWith(referrer.path(), "/search", - base::CompareCase::SENSITIVE) || - base::StartsWith(referrer.path(), "/webhp", base::CompareCase::SENSITIVE); - return is_possible_search_referrer && !IsFromGoogle(url); + } + + // Finally, the length of the URL before the domain and registry must be equal + // in length to the search hostname prefix. + const size_t url_hostname_prefix_length = host.length() - domain.length(); + return url_hostname_prefix_length == strlen(kGoogleSearchHostnamePrefix); } -} // namespace +// static +bool FromGWSPageLoadMetricsLogger::IsGoogleSearchResultUrl(const GURL& url) { + // NOTE: we do not require 'q=' in the query, as AJAXy search may instead + // store the query in the URL fragment. + if (!IsGoogleSearchHostname(url.host_piece())) { + return false; + } -FromGWSPageLoadMetricsObserver::FromGWSPageLoadMetricsObserver() - : navigation_from_gws_(false) {} + if (!QueryContainsComponentPrefix(url.query_piece(), "q=") && + !QueryContainsComponentPrefix(url.ref_piece(), "q=")) { + return false; + } + + const base::StringPiece path = url.path_piece(); + return path == "/search" || path == "/webhp" || path == "/custom" || + path == "/"; +} + +// static +bool FromGWSPageLoadMetricsLogger::IsGoogleRedirectorUrl(const GURL& url) { + return IsGoogleSearchHostname(url.host_piece()) && + url.path_piece() == "/url" && url.has_query(); +} + +// static +bool FromGWSPageLoadMetricsLogger::IsGoogleSearchRedirectorUrl( + const GURL& url) { + return IsGoogleRedirectorUrl(url) && + // Google search result redirects are differentiated from other + // redirects by 'source=web'. + QueryContainsComponent(url.query_piece(), "source=web"); +} + +// static +bool FromGWSPageLoadMetricsLogger::QueryContainsComponent( + const base::StringPiece query, + const base::StringPiece component) { + return QueryContainsComponentHelper(query, component, false); +} + +// static +bool FromGWSPageLoadMetricsLogger::QueryContainsComponentPrefix( + const base::StringPiece query, + const base::StringPiece component) { + return QueryContainsComponentHelper(query, component, true); +} + +// static +bool FromGWSPageLoadMetricsLogger::QueryContainsComponentHelper( + const base::StringPiece query, + const base::StringPiece component, + bool component_is_prefix) { + if (query.empty() || component.empty() || + component.length() > query.length()) { + return false; + } + + // Verify that the provided query string does not include the query or + // fragment start character, as the logic below depends on this character not + // being included. + DCHECK(query[0] != '?' && query[0] != '#'); + + // We shouldn't try to find matches beyond the point where there aren't enough + // characters left in query to fully match the component. + const size_t last_search_start = query.length() - component.length(); + + // We need to search for matches in a loop, rather than stopping at the first + // match, because we may initially match a substring that isn't a full query + // string component. Consider, for instance, the query string 'ab=cd&b=c'. If + // we search for component 'b=c', the first substring match will be characters + // 1-3 (zero-based) in the query string. However, this isn't a full component + // (the full component is ab=cd) so the match will fail. Thus, we must + // continue our search to find the second substring match, which in the + // example is at characters 6-8 (the end of the query string) and is a + // successful component match. + for (size_t start_offset = 0; start_offset <= last_search_start; + start_offset += component.length()) { + start_offset = query.find(component, start_offset); + if (start_offset == std::string::npos) { + // We searched to end of string and did not find a match. + return false; + } + // Verify that the character prior to the component is valid (either we're + // at the beginning of the query string, or are preceded by an ampersand). + if (start_offset != 0 && query[start_offset - 1] != '&') { + continue; + } + if (!component_is_prefix) { + // Verify that the character after the component substring is valid + // (either we're at the end of the query string, or are followed by an + // ampersand). + const size_t after_offset = start_offset + component.length(); + if (after_offset < query.length() && query[after_offset] != '&') { + continue; + } + } + return true; + } + return false; +} + +FromGWSPageLoadMetricsObserver::FromGWSPageLoadMetricsObserver() {} + +void FromGWSPageLoadMetricsObserver::OnStart( + content::NavigationHandle* navigation_handle, + const GURL& currently_committed_url) { + logger_.set_previously_committed_url(currently_committed_url); +} void FromGWSPageLoadMetricsObserver::OnCommit( content::NavigationHandle* navigation_handle) { - SetCommittedURLAndReferrer(navigation_handle->GetURL(), - navigation_handle->GetReferrer()); + logger_.set_navigation_initiated_via_link( + navigation_handle->HasUserGesture() && + ui::PageTransitionCoreTypeIs(navigation_handle->GetPageTransition(), + ui::PAGE_TRANSITION_LINK)); } void FromGWSPageLoadMetricsObserver::OnComplete( const page_load_metrics::PageLoadTiming& timing, const page_load_metrics::PageLoadExtraInfo& extra_info) { - using page_load_metrics::WasStartedInForegroundEventInForeground; + logger_.OnComplete(timing, extra_info); +} - if (!navigation_from_gws_) - return; - - if (WasStartedInForegroundEventInForeground( - timing.dom_content_loaded_event_start, extra_info)) { - PAGE_LOAD_HISTOGRAM( - "PageLoad.Clients.FromGWS.Timing2." - "NavigationToDOMContentLoadedEventFired", - timing.dom_content_loaded_event_start); - PAGE_LOAD_HISTOGRAM( - "PageLoad.Clients.FromGWS.Timing2." - "DOMLoadingToDOMContentLoadedEventFired", - timing.dom_content_loaded_event_start - timing.dom_loading); - } - if (WasStartedInForegroundEventInForeground(timing.load_event_start, - extra_info)) { - PAGE_LOAD_HISTOGRAM( - "PageLoad.Clients.FromGWS.Timing2.NavigationToLoadEventFired", - timing.load_event_start); - } - if (WasStartedInForegroundEventInForeground(timing.first_layout, - extra_info)) { - PAGE_LOAD_HISTOGRAM( - "PageLoad.Clients.FromGWS.Timing2.NavigationToFirstLayout", - timing.first_layout); - } - if (WasStartedInForegroundEventInForeground(timing.first_text_paint, - extra_info)) { - PAGE_LOAD_HISTOGRAM( - "PageLoad.Clients.FromGWS.Timing2.NavigationToFirstTextPaint", - timing.first_text_paint); - } - if (WasStartedInForegroundEventInForeground(timing.first_image_paint, - extra_info)) { - PAGE_LOAD_HISTOGRAM( - "PageLoad.Clients.FromGWS.Timing2.NavigationToFirstImagePaint", - timing.first_image_paint); - } - if (WasStartedInForegroundEventInForeground(timing.first_paint, extra_info)) { - PAGE_LOAD_HISTOGRAM( - "PageLoad.Clients.FromGWS.Timing2.NavigationToFirstPaint", - timing.first_paint); - } - if (WasStartedInForegroundEventInForeground(timing.first_contentful_paint, - extra_info)) { - PAGE_LOAD_HISTOGRAM( - "PageLoad.Clients.FromGWS.Timing2.NavigationToFirstContentfulPaint", - timing.first_contentful_paint); - PAGE_LOAD_HISTOGRAM( - "PageLoad.Clients.FromGWS.Timing2.DOMLoadingToFirstContentfulPaint", - timing.first_contentful_paint - timing.dom_loading); +void FromGWSPageLoadMetricsLogger::OnComplete( + const page_load_metrics::PageLoadTiming& timing, + const page_load_metrics::PageLoadExtraInfo& extra_info) { + if (ShouldLogMetrics(extra_info.committed_url)) { + LogMetrics(timing, extra_info); } } -void FromGWSPageLoadMetricsObserver::SetCommittedURLAndReferrer( - const GURL& url, - const content::Referrer& referrer) { - navigation_from_gws_ = IsFromGoogleSearchResult(url, referrer.url); +bool FromGWSPageLoadMetricsLogger::ShouldLogMetrics( + const GURL& committed_url) const { + // If we didn't navigate from another page, then this couldn't be a navigation + // from search, so don't log stats. + if (previously_committed_url_.is_empty()) + return false; + + // If this navigation didn't commit, or this page is a known google redirector + // URL or Google search results URL, then we should not log stats. + if (committed_url.is_empty() || IsGoogleRedirectorUrl(committed_url) || + IsGoogleSearchResultUrl(committed_url)) + return false; + + // We're only interested in tracking user gesture initiated navigations + // (e.g. clicks) initiated via links. + if (!navigation_initiated_via_link_) + return false; + + // We're only interested in navigations from the SRP or through the JS + // redirector. + if (!IsGoogleSearchResultUrl(previously_committed_url_) && + !IsGoogleSearchRedirectorUrl(previously_committed_url_)) + return false; + + return true; +} + +void FromGWSPageLoadMetricsLogger::LogMetrics( + const page_load_metrics::PageLoadTiming& timing, + const page_load_metrics::PageLoadExtraInfo& extra_info) { + if (WasStartedInForegroundEventInForeground( + timing.dom_content_loaded_event_start, extra_info)) { + PAGE_LOAD_HISTOGRAM(internal::kHistogramFromGWSDomContentLoaded, + timing.dom_content_loaded_event_start); + } + if (WasStartedInForegroundEventInForeground(timing.parse_stop, extra_info)) { + PAGE_LOAD_HISTOGRAM(internal::kHistogramFromGWSParseDuration, + timing.parse_stop - timing.parse_start); + } + if (WasStartedInForegroundEventInForeground(timing.load_event_start, + extra_info)) { + PAGE_LOAD_HISTOGRAM(internal::kHistogramFromGWSLoad, + timing.load_event_start); + } + if (WasStartedInForegroundEventInForeground(timing.first_text_paint, + extra_info)) { + PAGE_LOAD_HISTOGRAM(internal::kHistogramFromGWSFirstTextPaint, + timing.first_text_paint); + } + if (WasStartedInForegroundEventInForeground(timing.first_image_paint, + extra_info)) { + PAGE_LOAD_HISTOGRAM(internal::kHistogramFromGWSFirstImagePaint, + timing.first_image_paint); + } + if (WasStartedInForegroundEventInForeground(timing.first_paint, extra_info)) { + PAGE_LOAD_HISTOGRAM(internal::kHistogramFromGWSFirstPaint, + timing.first_paint); + } + if (WasStartedInForegroundEventInForeground(timing.first_contentful_paint, + extra_info)) { + PAGE_LOAD_HISTOGRAM(internal::kHistogramFromGWSFirstContentfulPaint, + timing.first_contentful_paint); + + // If we have a foreground paint, we should have a foreground parse start, + // since paints can't happen until after parsing starts. + DCHECK(WasStartedInForegroundEventInForeground(timing.parse_start, + extra_info)); + PAGE_LOAD_HISTOGRAM( + internal::kHistogramFromGWSParseStartToFirstContentfulPaint, + timing.first_contentful_paint - timing.parse_start); + } }
diff --git a/chrome/browser/page_load_metrics/observers/from_gws_page_load_metrics_observer.h b/chrome/browser/page_load_metrics/observers/from_gws_page_load_metrics_observer.h index 0465ede2..429bd90 100644 --- a/chrome/browser/page_load_metrics/observers/from_gws_page_load_metrics_observer.h +++ b/chrome/browser/page_load_metrics/observers/from_gws_page_load_metrics_observer.h
@@ -7,24 +7,90 @@ #include "base/macros.h" #include "components/page_load_metrics/browser/page_load_metrics_observer.h" +#include "url/gurl.h" + +namespace internal { +// Exposed for tests. +extern const char kHistogramFromGWSFirstTextPaint[]; +} // namespace internal + +// FromGWSPageLoadMetricsLogger is a peer class to +// FromGWSPageLoadMetricsObserver. FromGWSPageLoadMetricsLogger is responsible +// for tracking state needed to decide if metrics should be logged, and to log +// metrics in cases where metrics should be logged. FromGWSPageLoadMetricsLogger +// exists to decouple the logging policy implementation from other Chromium +// classes such as NavigationHandle and related infrastructure, in order to make +// the code more unit testable. +class FromGWSPageLoadMetricsLogger { + public: + FromGWSPageLoadMetricsLogger() {} + + void set_previously_committed_url(const GURL& url) { + previously_committed_url_ = url; + } + + void set_navigation_initiated_via_link(bool navigation_initiated_via_link) { + navigation_initiated_via_link_ = navigation_initiated_via_link; + } + + // Invoked when metrics for the given page are complete. + void OnComplete(const page_load_metrics::PageLoadTiming& timing, + const page_load_metrics::PageLoadExtraInfo& extra_info); + + // The methods below are public only for testing. + static bool IsGoogleSearchHostname(base::StringPiece host); + static bool IsGoogleSearchResultUrl(const GURL& url); + static bool IsGoogleRedirectorUrl(const GURL& url); + static bool IsGoogleSearchRedirectorUrl(const GURL& url); + + // Whether the given query string contains the given component. The query + // parameter should contain the query string of a URL (the portion following + // the question mark, excluding the question mark). The component must fully + // match a component in the query string. For example, 'foo=bar' would match + // the query string 'a=b&foo=bar&c=d' but would not match 'a=b&zzzfoo=bar&c=d' + // since, though foo=bar appears in the query string, the key specified in the + // component 'foo' does not match the full key in the query string + // 'zzzfoo'. For QueryContainsComponent, the component should of the form + // 'key=value'. For QueryContainsComponentPrefix, the component should be of + // the form 'key=' (where the value is not specified). + static bool QueryContainsComponent(const base::StringPiece query, + const base::StringPiece component); + static bool QueryContainsComponentPrefix(const base::StringPiece query, + const base::StringPiece component); + + // Whether metrics should be logged based on state provided via setters and + // the given committed_url. + bool ShouldLogMetrics(const GURL& committed_url) const; + + private: + GURL previously_committed_url_; + bool navigation_initiated_via_link_ = false; + + // Common helper for QueryContainsComponent and QueryContainsComponentPrefix. + static bool QueryContainsComponentHelper(const base::StringPiece query, + const base::StringPiece component, + bool component_is_prefix); + + void LogMetrics(const page_load_metrics::PageLoadTiming& timing, + const page_load_metrics::PageLoadExtraInfo& extra_info); + + DISALLOW_COPY_AND_ASSIGN(FromGWSPageLoadMetricsLogger); +}; class FromGWSPageLoadMetricsObserver : public page_load_metrics::PageLoadMetricsObserver { public: FromGWSPageLoadMetricsObserver(); // page_load_metrics::PageLoadMetricsObserver implementation: + void OnStart(content::NavigationHandle* navigation_handle, + const GURL& currently_committed_url) override; void OnCommit(content::NavigationHandle* navigation_handle) override; void OnComplete( const page_load_metrics::PageLoadTiming& timing, const page_load_metrics::PageLoadExtraInfo& extra_info) override; - protected: - // Called in tests. - void SetCommittedURLAndReferrer(const GURL& url, - const content::Referrer& referrer); - private: - bool navigation_from_gws_; + FromGWSPageLoadMetricsLogger logger_; DISALLOW_COPY_AND_ASSIGN(FromGWSPageLoadMetricsObserver); };
diff --git a/chrome/browser/page_load_metrics/observers/from_gws_page_load_metrics_observer_unittest.cc b/chrome/browser/page_load_metrics/observers/from_gws_page_load_metrics_observer_unittest.cc index 9fc0d336..263b8a8 100644 --- a/chrome/browser/page_load_metrics/observers/from_gws_page_load_metrics_observer_unittest.cc +++ b/chrome/browser/page_load_metrics/observers/from_gws_page_load_metrics_observer_unittest.cc
@@ -9,187 +9,558 @@ #include "chrome/browser/page_load_metrics/observers/page_load_metrics_observer_test_harness.h" namespace { - -const char kHistogramNameFromGWSFirstTextPaint[] = - "PageLoad.Clients.FromGWS.Timing2.NavigationToFirstTextPaint"; - +const char kExampleUrl[] = "http://www.example.com/"; } // namespace -class TestFromGWSPageLoadMetricsObserver - : public FromGWSPageLoadMetricsObserver { - public: - explicit TestFromGWSPageLoadMetricsObserver(const content::Referrer& referrer) - : FromGWSPageLoadMetricsObserver(), referrer_(referrer) {} - void OnCommit(content::NavigationHandle* navigation_handle) override { - const GURL& url = navigation_handle->GetURL(); - SetCommittedURLAndReferrer( - url, content::Referrer::SanitizeForRequest(url, referrer_)); - } - - private: - const content::Referrer referrer_; - - DISALLOW_COPY_AND_ASSIGN(TestFromGWSPageLoadMetricsObserver); -}; - class FromGWSPageLoadMetricsObserverTest : public page_load_metrics::PageLoadMetricsObserverTestHarness { public: void RegisterObservers(page_load_metrics::PageLoadTracker* tracker) override { tracker->AddObserver( - base::WrapUnique(new TestFromGWSPageLoadMetricsObserver(referrer_))); + base::WrapUnique(new FromGWSPageLoadMetricsObserver())); } - - // Inject this referrer to FromGWS observers. - void set_referrer(const content::Referrer& referrer) { referrer_ = referrer; } - - protected: - content::Referrer referrer_; }; +class FromGWSPageLoadMetricsLoggerTest : public testing::Test {}; + TEST_F(FromGWSPageLoadMetricsObserverTest, NoMetrics) { - histogram_tester().ExpectTotalCount(kHistogramNameFromGWSFirstTextPaint, 0); + histogram_tester().ExpectTotalCount(internal::kHistogramFromGWSFirstTextPaint, + 0); } -TEST_F(FromGWSPageLoadMetricsObserverTest, NoReferral) { +TEST_F(FromGWSPageLoadMetricsObserverTest, NoPreviousCommittedUrl) { page_load_metrics::PageLoadTiming timing; timing.navigation_start = base::Time::FromDoubleT(1); timing.first_text_paint = base::TimeDelta::FromMilliseconds(1); PopulateRequiredTimingFields(&timing); - NavigateAndCommit(GURL("http://www.example.com")); + NavigateAndCommit(GURL(kExampleUrl)); SimulateTimingUpdate(timing); // Navigate again to force logging. - NavigateAndCommit(GURL("http://www.google.com")); - histogram_tester().ExpectTotalCount(kHistogramNameFromGWSFirstTextPaint, 0); + NavigateAndCommit(GURL("http://www.final.com")); + histogram_tester().ExpectTotalCount(internal::kHistogramFromGWSFirstTextPaint, + 0); } -TEST_F(FromGWSPageLoadMetricsObserverTest, ReferralsFromGWSHTTPToHTTPS) { +TEST_F(FromGWSPageLoadMetricsObserverTest, NonSearchPreviousCommittedUrl) { page_load_metrics::PageLoadTiming timing; timing.navigation_start = base::Time::FromDoubleT(1); timing.first_text_paint = base::TimeDelta::FromMilliseconds(1); PopulateRequiredTimingFields(&timing); - // HTTPS google.com referral to HTTP example.com. - set_referrer(content::Referrer(GURL("https://www.google.com"), - blink::WebReferrerPolicyOrigin)); - NavigateAndCommit(GURL("http://www.example.com")); + NavigateAndCommit(GURL("http://www.other.com")); + NavigateAndCommit(GURL(kExampleUrl)); SimulateTimingUpdate(timing); // Navigate again to force logging. - NavigateAndCommit(GURL("https://www.example2.com")); - histogram_tester().ExpectTotalCount(kHistogramNameFromGWSFirstTextPaint, 1); - histogram_tester().ExpectBucketCount(kHistogramNameFromGWSFirstTextPaint, - timing.first_text_paint.InMilliseconds(), - 1); + NavigateAndCommit(GURL("http://www.final.com")); + histogram_tester().ExpectTotalCount(internal::kHistogramFromGWSFirstTextPaint, + 0); } -TEST_F(FromGWSPageLoadMetricsObserverTest, ReferralFromGWS) { +TEST_F(FromGWSPageLoadMetricsObserverTest, + GoogleNonSearchPreviousCommittedUrl1) { page_load_metrics::PageLoadTiming timing; timing.navigation_start = base::Time::FromDoubleT(1); timing.first_text_paint = base::TimeDelta::FromMilliseconds(1); PopulateRequiredTimingFields(&timing); - - set_referrer(content::Referrer(GURL("https://www.google.com/url"), - blink::WebReferrerPolicyDefault)); - NavigateAndCommit(GURL("https://www.example.com")); + NavigateAndCommit(GURL("https://www.google.com/")); + NavigateAndCommit(GURL(kExampleUrl)); SimulateTimingUpdate(timing); // Navigate again to force logging. - NavigateAndCommit(GURL("https://www.example2.com")); - histogram_tester().ExpectTotalCount(kHistogramNameFromGWSFirstTextPaint, 1); - histogram_tester().ExpectBucketCount(kHistogramNameFromGWSFirstTextPaint, - timing.first_text_paint.InMilliseconds(), - 1); + NavigateAndCommit(GURL("http://www.final.com")); + histogram_tester().ExpectTotalCount(internal::kHistogramFromGWSFirstTextPaint, + 0); } -TEST_F(FromGWSPageLoadMetricsObserverTest, ReferralFromGWSBackgroundLater) { +TEST_F(FromGWSPageLoadMetricsObserverTest, + GoogleNonSearchPreviousCommittedUrl2) { + page_load_metrics::PageLoadTiming timing; + timing.navigation_start = base::Time::FromDoubleT(1); + timing.first_text_paint = base::TimeDelta::FromMilliseconds(1); + PopulateRequiredTimingFields(&timing); + // Navigation from /search, but missing a query string, so can't have been a + // search results page. + NavigateAndCommit(GURL("https://www.google.com/search?a=b&c=d")); + NavigateAndCommit(GURL(kExampleUrl)); + + SimulateTimingUpdate(timing); + + // Navigate again to force logging. + NavigateAndCommit(GURL("http://www.final.com")); + histogram_tester().ExpectTotalCount(internal::kHistogramFromGWSFirstTextPaint, + 0); +} + +TEST_F(FromGWSPageLoadMetricsObserverTest, SearchPreviousCommittedUrl1) { + page_load_metrics::PageLoadTiming timing; + timing.navigation_start = base::Time::FromDoubleT(1); + timing.first_text_paint = base::TimeDelta::FromMilliseconds(1); + PopulateRequiredTimingFields(&timing); + NavigateAndCommit(GURL("https://www.google.com/webhp?q=test")); + NavigateAndCommit(GURL(kExampleUrl)); + + SimulateTimingUpdate(timing); + + // Navigate again to force logging. + NavigateAndCommit(GURL("http://www.final.com")); + histogram_tester().ExpectTotalCount(internal::kHistogramFromGWSFirstTextPaint, + 1); + histogram_tester().ExpectBucketCount( + internal::kHistogramFromGWSFirstTextPaint, + timing.first_text_paint.InMilliseconds(), 1); +} + +TEST_F(FromGWSPageLoadMetricsObserverTest, SearchPreviousCommittedUrl2) { + page_load_metrics::PageLoadTiming timing; + timing.navigation_start = base::Time::FromDoubleT(1); + timing.first_text_paint = base::TimeDelta::FromMilliseconds(1); + PopulateRequiredTimingFields(&timing); + NavigateAndCommit(GURL("https://www.google.com/#q=test")); + NavigateAndCommit(GURL(kExampleUrl)); + + SimulateTimingUpdate(timing); + + // Navigate again to force logging. + NavigateAndCommit(GURL("http://www.final.com")); + histogram_tester().ExpectTotalCount(internal::kHistogramFromGWSFirstTextPaint, + 1); + histogram_tester().ExpectBucketCount( + internal::kHistogramFromGWSFirstTextPaint, + timing.first_text_paint.InMilliseconds(), 1); +} + +TEST_F(FromGWSPageLoadMetricsObserverTest, SearchPreviousCommittedUrl3) { + page_load_metrics::PageLoadTiming timing; + timing.navigation_start = base::Time::FromDoubleT(1); + timing.first_text_paint = base::TimeDelta::FromMilliseconds(1); + PopulateRequiredTimingFields(&timing); + NavigateAndCommit(GURL("https://www.google.com/webhp#q=test")); + NavigateAndCommit(GURL(kExampleUrl)); + + SimulateTimingUpdate(timing); + + // Navigate again to force logging. + NavigateAndCommit(GURL("http://www.final.com")); + histogram_tester().ExpectTotalCount(internal::kHistogramFromGWSFirstTextPaint, + 1); + histogram_tester().ExpectBucketCount( + internal::kHistogramFromGWSFirstTextPaint, + timing.first_text_paint.InMilliseconds(), 1); +} + +TEST_F(FromGWSPageLoadMetricsObserverTest, SearchPreviousCommittedUrl4) { + page_load_metrics::PageLoadTiming timing; + timing.navigation_start = base::Time::FromDoubleT(1); + timing.first_text_paint = base::TimeDelta::FromMilliseconds(1); + PopulateRequiredTimingFields(&timing); + NavigateAndCommit(GURL("https://www.google.co.uk/search#q=test")); + NavigateAndCommit(GURL(kExampleUrl)); + + SimulateTimingUpdate(timing); + + // Navigate again to force logging. + NavigateAndCommit(GURL("http://www.final.com")); + histogram_tester().ExpectTotalCount(internal::kHistogramFromGWSFirstTextPaint, + 1); + histogram_tester().ExpectBucketCount( + internal::kHistogramFromGWSFirstTextPaint, + timing.first_text_paint.InMilliseconds(), 1); +} + +TEST_F(FromGWSPageLoadMetricsObserverTest, SearchToNonSearchToOtherPage) { + page_load_metrics::PageLoadTiming timing; + timing.navigation_start = base::Time::FromDoubleT(1); + timing.first_text_paint = base::TimeDelta::FromMilliseconds(1); + page_load_metrics::PageLoadTiming timing2; + timing2.navigation_start = base::Time::FromDoubleT(2); + timing2.first_text_paint = base::TimeDelta::FromMilliseconds(100); + PopulateRequiredTimingFields(&timing); + PopulateRequiredTimingFields(&timing2); + NavigateAndCommit(GURL("https://www.google.co.uk/search#q=test")); + NavigateAndCommit(GURL(kExampleUrl)); + SimulateTimingUpdate(timing); + NavigateAndCommit(GURL("http://www.example.com/other")); + SimulateTimingUpdate(timing2); + + // Navigate again to force logging. We expect to log timing for the page + // navigated from search, but not for the page navigated from that page. + NavigateAndCommit(GURL("http://www.final.com")); + histogram_tester().ExpectTotalCount(internal::kHistogramFromGWSFirstTextPaint, + 1); + histogram_tester().ExpectBucketCount( + internal::kHistogramFromGWSFirstTextPaint, + timing.first_text_paint.InMilliseconds(), 1); +} + +TEST_F(FromGWSPageLoadMetricsObserverTest, SearchToNonSearchToSearch) { + page_load_metrics::PageLoadTiming timing; + timing.navigation_start = base::Time::FromDoubleT(1); + timing.first_text_paint = base::TimeDelta::FromMilliseconds(1); + page_load_metrics::PageLoadTiming timing2; + timing2.navigation_start = base::Time::FromDoubleT(2); + timing2.first_text_paint = base::TimeDelta::FromMilliseconds(100); + PopulateRequiredTimingFields(&timing); + PopulateRequiredTimingFields(&timing2); + NavigateAndCommit(GURL("https://www.google.co.uk/search#q=test")); + NavigateAndCommit(GURL(kExampleUrl)); + SimulateTimingUpdate(timing); + NavigateAndCommit(GURL("https://www.google.co.uk/search#q=test")); + SimulateTimingUpdate(timing2); + + // Navigate again to force logging. We expect to log timing for the page + // navigated from search, but not for the search page we navigated to. + NavigateAndCommit(GURL("http://www.final.com")); + histogram_tester().ExpectTotalCount(internal::kHistogramFromGWSFirstTextPaint, + 1); + histogram_tester().ExpectBucketCount( + internal::kHistogramFromGWSFirstTextPaint, + timing.first_text_paint.InMilliseconds(), 1); +} + +TEST_F(FromGWSPageLoadMetricsObserverTest, + SearchToNonSearchToSearchToNonSearch) { + page_load_metrics::PageLoadTiming timing; + timing.navigation_start = base::Time::FromDoubleT(1); + timing.first_text_paint = base::TimeDelta::FromMilliseconds(1); + page_load_metrics::PageLoadTiming timing2; + timing2.navigation_start = base::Time::FromDoubleT(2); + timing2.first_text_paint = base::TimeDelta::FromMilliseconds(100); + page_load_metrics::PageLoadTiming timing3; + timing3.navigation_start = base::Time::FromDoubleT(3); + timing3.first_text_paint = base::TimeDelta::FromMilliseconds(1000); + PopulateRequiredTimingFields(&timing); + PopulateRequiredTimingFields(&timing2); + PopulateRequiredTimingFields(&timing3); + NavigateAndCommit(GURL("https://www.google.co.uk/search#q=test")); + NavigateAndCommit(GURL(kExampleUrl)); + SimulateTimingUpdate(timing); + NavigateAndCommit(GURL("https://www.google.co.uk/search#q=test")); + SimulateTimingUpdate(timing2); + NavigateAndCommit(GURL(kExampleUrl)); + SimulateTimingUpdate(timing3); + + // Navigate again to force logging. We expect to log timing for both pages + // navigated from search, but not for the search pages we navigated to. + NavigateAndCommit(GURL("http://www.final.com")); + histogram_tester().ExpectTotalCount(internal::kHistogramFromGWSFirstTextPaint, + 2); + histogram_tester().ExpectBucketCount( + internal::kHistogramFromGWSFirstTextPaint, + timing.first_text_paint.InMilliseconds(), 1); + histogram_tester().ExpectBucketCount( + internal::kHistogramFromGWSFirstTextPaint, + timing3.first_text_paint.InMilliseconds(), 1); +} + +TEST_F(FromGWSPageLoadMetricsObserverTest, + SearchToNonSearchToSearchToNonSearchBackgrounded) { + page_load_metrics::PageLoadTiming timing; + timing.navigation_start = base::Time::FromDoubleT(1); + timing.first_text_paint = base::TimeDelta::FromMilliseconds(1); + page_load_metrics::PageLoadTiming timing2; + timing2.navigation_start = base::Time::FromDoubleT(2); + timing2.first_text_paint = base::TimeDelta::FromMilliseconds(100); + page_load_metrics::PageLoadTiming timing3; + timing3.navigation_start = base::Time::FromDoubleT(3); + timing3.first_text_paint = base::TimeDelta::FromMilliseconds(1000); + PopulateRequiredTimingFields(&timing); + PopulateRequiredTimingFields(&timing2); + PopulateRequiredTimingFields(&timing3); + NavigateAndCommit(GURL("https://www.google.co.uk/search#q=test")); + NavigateAndCommit(GURL(kExampleUrl)); + SimulateTimingUpdate(timing); + NavigateAndCommit(GURL("https://www.google.co.uk/search#q=test")); + web_contents()->WasHidden(); + SimulateTimingUpdate(timing2); + NavigateAndCommit(GURL(kExampleUrl)); + SimulateTimingUpdate(timing3); + + // Navigate again to force logging. We expect to log timing for the first page + // navigated from search, but not the second since it was backgrounded. + NavigateAndCommit(GURL("http://www.final.com")); + histogram_tester().ExpectTotalCount(internal::kHistogramFromGWSFirstTextPaint, + 1); + histogram_tester().ExpectBucketCount( + internal::kHistogramFromGWSFirstTextPaint, + timing.first_text_paint.InMilliseconds(), 1); +} + +TEST_F(FromGWSPageLoadMetricsObserverTest, + SearchRedirectorPreviousCommittedUrl) { + page_load_metrics::PageLoadTiming timing; + timing.navigation_start = base::Time::FromDoubleT(1); + timing.first_text_paint = base::TimeDelta::FromMilliseconds(1); + PopulateRequiredTimingFields(&timing); + NavigateAndCommit(GURL("https://www.google.com/search#q=test")); + NavigateAndCommit(GURL("https://www.google.com/url?source=web")); + NavigateAndCommit(GURL(kExampleUrl)); + + SimulateTimingUpdate(timing); + + // Navigate again to force logging. + NavigateAndCommit(GURL("http://www.final.com")); + histogram_tester().ExpectTotalCount(internal::kHistogramFromGWSFirstTextPaint, + 1); + histogram_tester().ExpectBucketCount( + internal::kHistogramFromGWSFirstTextPaint, + timing.first_text_paint.InMilliseconds(), 1); +} + +TEST_F(FromGWSPageLoadMetricsObserverTest, + NonSearchRedirectorPreviousCommittedUrl) { + page_load_metrics::PageLoadTiming timing; + timing.navigation_start = base::Time::FromDoubleT(1); + timing.first_text_paint = base::TimeDelta::FromMilliseconds(1); + PopulateRequiredTimingFields(&timing); + NavigateAndCommit(GURL("https://www.google.com/webhp?q=test")); + NavigateAndCommit(GURL("https://www.google.com/url?a=b&c=d")); + NavigateAndCommit(GURL(kExampleUrl)); + + SimulateTimingUpdate(timing); + + // Navigate again to force logging. + NavigateAndCommit(GURL("http://www.final.com")); + histogram_tester().ExpectTotalCount(internal::kHistogramFromGWSFirstTextPaint, + 0); +} + +TEST_F(FromGWSPageLoadMetricsObserverTest, + SearchPreviousCommittedUrlBackgroundLater) { page_load_metrics::PageLoadTiming timing; timing.navigation_start = base::Time::FromDoubleT(1); timing.first_text_paint = base::TimeDelta::FromMicroseconds(1); PopulateRequiredTimingFields(&timing); - set_referrer(content::Referrer(GURL("https://www.google.com/url"), - blink::WebReferrerPolicyDefault)); - NavigateAndCommit(GURL("https://www.example.com")); + NavigateAndCommit(GURL("https://www.google.com/search#q=test")); + NavigateAndCommit(GURL(kExampleUrl)); SimulateTimingUpdate(timing); web_contents()->WasHidden(); // Navigate again to force logging. - NavigateAndCommit(GURL("https://www.example2.com")); - histogram_tester().ExpectTotalCount(kHistogramNameFromGWSFirstTextPaint, 1); - histogram_tester().ExpectBucketCount(kHistogramNameFromGWSFirstTextPaint, - timing.first_text_paint.InMilliseconds(), - 1); -} - -TEST_F(FromGWSPageLoadMetricsObserverTest, ReferralsFromCaseInsensitive) { - page_load_metrics::PageLoadTiming timing; - timing.navigation_start = base::Time::FromDoubleT(1); - timing.first_text_paint = base::TimeDelta::FromMilliseconds(1); - PopulateRequiredTimingFields(&timing); - // HTTPS google.com referral to HTTP example.com. - set_referrer(content::Referrer(GURL("https://wWw.GoOGlE.cOm/webhp"), - blink::WebReferrerPolicyOrigin)); - NavigateAndCommit(GURL("https://www.example.com")); - SimulateTimingUpdate(timing); - - // Navigate again to force logging. - NavigateAndCommit(GURL("https://www.example2.com")); - histogram_tester().ExpectTotalCount(kHistogramNameFromGWSFirstTextPaint, 1); - histogram_tester().ExpectBucketCount(kHistogramNameFromGWSFirstTextPaint, - timing.first_text_paint.InMilliseconds(), - 1); -} - -TEST_F(FromGWSPageLoadMetricsObserverTest, ReferralsFromGWSOrigin) { - page_load_metrics::PageLoadTiming timing; - timing.navigation_start = base::Time::FromDoubleT(1); - timing.first_text_paint = base::TimeDelta::FromMilliseconds(1); - PopulateRequiredTimingFields(&timing); - // HTTPS google.com referral to HTTP example.com. - set_referrer(content::Referrer(GURL("https://www.google.com"), - blink::WebReferrerPolicyOrigin)); - NavigateAndCommit(GURL("https://www.example.com")); - - SimulateTimingUpdate(timing); - - page_load_metrics::PageLoadTiming timing2; - timing2.navigation_start = base::Time::FromDoubleT(10); - timing2.first_text_paint = base::TimeDelta::FromMilliseconds(100); - PopulateRequiredTimingFields(&timing2); - // HTTPS google.com referral to HTTP example.com. - set_referrer(content::Referrer(GURL("https://www.google.co.in"), - blink::WebReferrerPolicyOrigin)); - NavigateAndCommit(GURL("https://www.example2.com")); - - SimulateTimingUpdate(timing2); - // Navigate again to force logging. - NavigateAndCommit(GURL("https://www.example3.com")); - histogram_tester().ExpectTotalCount(kHistogramNameFromGWSFirstTextPaint, 2); - histogram_tester().ExpectBucketCount(kHistogramNameFromGWSFirstTextPaint, - timing.first_text_paint.InMilliseconds(), - 1); + NavigateAndCommit(GURL("https://www.final.com")); + histogram_tester().ExpectTotalCount(internal::kHistogramFromGWSFirstTextPaint, + 1); histogram_tester().ExpectBucketCount( - kHistogramNameFromGWSFirstTextPaint, - timing2.first_text_paint.InMilliseconds(), 1); + internal::kHistogramFromGWSFirstTextPaint, + timing.first_text_paint.InMilliseconds(), 1); } -TEST_F(FromGWSPageLoadMetricsObserverTest, ReferralNotFromGWS) { - page_load_metrics::PageLoadTiming timing; - timing.navigation_start = base::Time::FromDoubleT(1); - timing.first_text_paint = base::TimeDelta::FromMilliseconds(1); - PopulateRequiredTimingFields(&timing); - set_referrer(content::Referrer(GURL("https://www.anothersite.com"), - blink::WebReferrerPolicyDefault)); - NavigateAndCommit(GURL("https://www.example.com")); +TEST_F(FromGWSPageLoadMetricsLoggerTest, IsGoogleSearchHostname) { + struct { + bool expected_result; + const char* url; + } test_cases[] = { + {true, "www.google.com"}, + {true, "www.google.co.uk"}, + {true, "www.google.co.in"}, + {false, "other.google.com"}, + {false, "other.www.google.com"}, + {false, "www.other.google.com"}, + {false, "www.www.google.com"}, + {false, "www.google.appspot.com"}, + {false, "www.google.example.com"}, + // Search results are not served from the bare google.com domain. + {false, "google.com"}, + }; + for (const auto& test : test_cases) { + EXPECT_EQ(test.expected_result, + FromGWSPageLoadMetricsLogger::IsGoogleSearchHostname(test.url)) + << "for URL: " << test.url; + } +} - SimulateTimingUpdate(timing); +TEST_F(FromGWSPageLoadMetricsLoggerTest, IsGoogleSearchResultUrl) { + struct { + bool expected_result; + const char* url; + } test_cases[] = { + {true, "https://www.google.com/#q=test"}, + {true, "https://www.google.com/search#q=test"}, + {true, "https://www.google.com/search?q=test"}, + {true, "https://www.google.com/webhp#q=test"}, + {true, "https://www.google.com/webhp?q=test"}, + {true, "https://www.google.com/webhp?a=b&q=test"}, + {true, "https://www.google.com/webhp?a=b&q=test&c=d"}, + {true, "https://www.google.com/webhp#a=b&q=test&c=d"}, + {true, "https://www.google.com/webhp?#a=b&q=test&c=d"}, + {false, "https://www.google.com/"}, + {false, "https://www.google.com/about/"}, + {false, "https://other.google.com/"}, + {false, "https://other.google.com/webhp?q=test"}, + {false, kExampleUrl}, + {false, "https://www.example.com/webhp?q=test"}, + {false, "https://google.com/#q=test"}, + }; + for (const auto& test : test_cases) { + EXPECT_EQ( + test.expected_result, + FromGWSPageLoadMetricsLogger::IsGoogleSearchResultUrl(GURL(test.url))) + << "for URL: " << test.url; + } +} - // Navigate again to force logging. - NavigateAndCommit(GURL("https://www.google.com")); - histogram_tester().ExpectTotalCount(kHistogramNameFromGWSFirstTextPaint, 0); +TEST_F(FromGWSPageLoadMetricsLoggerTest, IsGoogleRedirectorUrl) { + struct { + bool expected_result; + const char* url; + } test_cases[] = { + {true, "https://www.google.com/url?"}, + {true, "https://www.google.com/url?a=b"}, + {true, "https://www.google.com/url?source=web"}, + {true, "https://www.google.com/url?a=b&source=web&c=d"}, + {true, "https://www.google.co.uk/url?source=web"}, + {false, "https://www.google.com/?"}, + {false, "https://www.google.com/?url"}, + {false, "https://www.example.com/url?source=web"}, + {false, "https://google.com/url?"}, + {false, "https://google.com/url?"}, + }; + for (const auto& test : test_cases) { + EXPECT_EQ( + test.expected_result, + FromGWSPageLoadMetricsLogger::IsGoogleRedirectorUrl(GURL(test.url))) + << "for URL: " << test.url; + } +} + +TEST_F(FromGWSPageLoadMetricsLoggerTest, IsGoogleSearchRedirectorUrl) { + struct { + bool expected_result; + const char* url; + } test_cases[] = { + {true, "https://www.google.com/url?source=web"}, + {true, "https://www.google.com/url?source=web#foo"}, + {false, "https://www.google.com/?source=web"}, + {false, "https://www.google.com/source=web"}, + {false, "https://www.example.com/url?source=web"}, + }; + for (const auto& test : test_cases) { + EXPECT_EQ(test.expected_result, + FromGWSPageLoadMetricsLogger::IsGoogleSearchRedirectorUrl( + GURL(test.url))) + << "for URL: " << test.url; + } +} + +TEST_F(FromGWSPageLoadMetricsLoggerTest, QueryContainsComponent) { + struct { + bool expected_result; + const char* query; + const char* component; + } test_cases[] = { + {true, "a=b", "a=b"}, + {true, "a=b&c=d", "a=b"}, + {true, "a=b&c=d", "c=d"}, + {true, "a=b&c=d&e=f", "c=d"}, + {true, "za=b&a=b", "a=b"}, + {true, "a=bz&a=b", "a=b"}, + {true, "a=ba=b&a=b", "a=b"}, + {true, "a=a=a&a=a", "a=a"}, + {true, "source=web", "source=web"}, + {true, "a=b&source=web", "source=web"}, + {true, "a=b&source=web&c=d", "source=web"}, + {false, "a=a=a", "a=a"}, + {false, "", ""}, + {false, "a=b", ""}, + {false, "", "a=b"}, + {false, "za=b", "a=b"}, + {false, "za=bz", "a=b"}, + {false, "a=bz", "a=b"}, + {false, "za=b&c=d", "a=b"}, + {false, "a=b&c=dz", "c=d"}, + {false, "a=b&zc=d&e=f", "c=d"}, + {false, "a=b&c=dz&e=f", "c=d"}, + {false, "a=b&zc=dz&e=f", "c=d"}, + {false, "a=b&foosource=web&c=d", "source=web"}, + {false, "a=b&source=webbar&c=d", "source=web"}, + {false, "a=b&foosource=webbar&c=d", "source=web"}, + }; + for (const auto& test : test_cases) { + EXPECT_EQ(test.expected_result, + FromGWSPageLoadMetricsLogger::QueryContainsComponent( + test.query, test.component)) + << "For query: " << test.query << " with component: " << test.component; + } +} + +TEST_F(FromGWSPageLoadMetricsLoggerTest, QueryContainsComponentPrefix) { + struct { + bool expected_result; + const char* query; + const char* component; + } test_cases[] = { + {true, "a=b", "a="}, + {true, "a=b&c=d", "a="}, + {true, "a=b&c=d", "c="}, + {true, "a=b&c=d&e=f", "c="}, + {true, "za=b&a=b", "a="}, + {true, "ba=a=b&a=b", "a="}, + {true, "q=test", "q="}, + {true, "a=b&q=test", "q="}, + {true, "q=test&c=d", "q="}, + {true, "a=b&q=test&c=d", "q="}, + {false, "", ""}, + {false, "za=b", "a="}, + {false, "za=b&c=d", "a="}, + {false, "a=b&zc=d", "c="}, + {false, "a=b&zc=d&e=f", "c="}, + {false, "a=b&zq=test&c=d", "q="}, + {false, "ba=a=b", "a="}, + }; + for (const auto& test : test_cases) { + EXPECT_EQ(test.expected_result, + FromGWSPageLoadMetricsLogger::QueryContainsComponentPrefix( + test.query, test.component)) + << "For query: " << test.query << " with component: " << test.component; + } +} + +TEST_F(FromGWSPageLoadMetricsLoggerTest, Basic) { + FromGWSPageLoadMetricsLogger logger; + ASSERT_FALSE(logger.ShouldLogMetrics(GURL(kExampleUrl))); +} + +TEST_F(FromGWSPageLoadMetricsLoggerTest, NoPreviousPage) { + FromGWSPageLoadMetricsLogger logger; + logger.set_previously_committed_url(GURL()); + logger.set_navigation_initiated_via_link(true); + ASSERT_FALSE(logger.ShouldLogMetrics(GURL(kExampleUrl))); +} + +TEST_F(FromGWSPageLoadMetricsLoggerTest, NavigationNotInitiatedViaLink) { + FromGWSPageLoadMetricsLogger logger; + logger.set_previously_committed_url( + GURL("https://www.google.com/search?q=test")); + logger.set_navigation_initiated_via_link(false); + ASSERT_FALSE(logger.ShouldLogMetrics(GURL(kExampleUrl))); +} + +TEST_F(FromGWSPageLoadMetricsLoggerTest, NavigationFromSearchToSearch) { + FromGWSPageLoadMetricsLogger logger; + logger.set_previously_committed_url( + GURL("https://www.google.com/search?q=test")); + logger.set_navigation_initiated_via_link(true); + ASSERT_FALSE( + logger.ShouldLogMetrics(GURL("https://www.google.com/search?q=test"))); +} + +TEST_F(FromGWSPageLoadMetricsLoggerTest, NavigationFromSearch) { + FromGWSPageLoadMetricsLogger logger; + logger.set_previously_committed_url( + GURL("https://www.google.com/search?q=test")); + logger.set_navigation_initiated_via_link(true); + ASSERT_TRUE(logger.ShouldLogMetrics(GURL(kExampleUrl))); +} + +TEST_F(FromGWSPageLoadMetricsLoggerTest, NavigationFromSearchRedirector) { + FromGWSPageLoadMetricsLogger logger; + logger.set_previously_committed_url( + GURL("https://www.google.com/url?source=web")); + logger.set_navigation_initiated_via_link(true); + ASSERT_TRUE(logger.ShouldLogMetrics(GURL(kExampleUrl))); }
diff --git a/chrome/browser/permissions/permission_bubble_request_impl.cc b/chrome/browser/permissions/permission_bubble_request_impl.cc index 69feadb8..99f5318 100644 --- a/chrome/browser/permissions/permission_bubble_request_impl.cc +++ b/chrome/browser/permissions/permission_bubble_request_impl.cc
@@ -106,7 +106,9 @@ return base::string16(); } return l10n_util::GetStringFUTF16( - message_id, url_formatter::FormatUrlForSecurityDisplay(request_origin_)); + message_id, + url_formatter::FormatUrlForSecurityDisplay( + request_origin_, url_formatter::SchemeDisplay::OMIT_CRYPTOGRAPHIC)); } base::string16 PermissionBubbleRequestImpl::GetMessageTextFragment() const {
diff --git a/chrome/browser/permissions/permission_infobar_delegate.cc b/chrome/browser/permissions/permission_infobar_delegate.cc index 07e36bd..14a9f5d 100644 --- a/chrome/browser/permissions/permission_infobar_delegate.cc +++ b/chrome/browser/permissions/permission_infobar_delegate.cc
@@ -7,6 +7,7 @@ #include "chrome/browser/permissions/permission_uma_util.h" #include "chrome/grit/generated_resources.h" #include "components/infobars/core/infobar.h" +#include "components/url_formatter/elide_url.h" #include "ui/base/l10n/l10n_util.h" PermissionInfobarDelegate::~PermissionInfobarDelegate() { @@ -25,8 +26,16 @@ content_settings_type_(content_settings_type), callback_(callback) {} -infobars::InfoBarDelegate::Type -PermissionInfobarDelegate::GetInfoBarType() const { +base::string16 PermissionInfobarDelegate::GetMessageText() const { + return l10n_util::GetStringFUTF16( + GetMessageResourceId(), + url_formatter::FormatUrlForSecurityDisplay( + requesting_origin_, + url_formatter::SchemeDisplay::OMIT_CRYPTOGRAPHIC)); +} + +infobars::InfoBarDelegate::Type PermissionInfobarDelegate::GetInfoBarType() + const { return PAGE_ACTION_TYPE; }
diff --git a/chrome/browser/permissions/permission_infobar_delegate.h b/chrome/browser/permissions/permission_infobar_delegate.h index d39d3c7e..1daeccd 100644 --- a/chrome/browser/permissions/permission_infobar_delegate.h +++ b/chrome/browser/permissions/permission_infobar_delegate.h
@@ -31,12 +31,15 @@ const PermissionSetCallback& callback); ~PermissionInfobarDelegate() override; + virtual int GetMessageResourceId() const = 0; + private: // ConfirmInfoBarDelegate: Type GetInfoBarType() const override; void InfoBarDismissed() override; PermissionInfobarDelegate* AsPermissionInfobarDelegate() override; base::string16 GetButtonLabel(InfoBarButton button) const override; + base::string16 GetMessageText() const override; bool Accept() override; bool Cancel() override;
diff --git a/chrome/browser/policy/OWNERS b/chrome/browser/policy/OWNERS index 20268c3..96cbb40 100644 --- a/chrome/browser/policy/OWNERS +++ b/chrome/browser/policy/OWNERS
@@ -2,3 +2,4 @@ atwilson@chromium.org cschuet@chromium.org tnagel@chromium.org +pastarmovj@chromium.org
diff --git a/chrome/browser/policy/configuration_policy_handler_list_factory.cc b/chrome/browser/policy/configuration_policy_handler_list_factory.cc index 4483ffe..d38ecbb 100644 --- a/chrome/browser/policy/configuration_policy_handler_list_factory.cc +++ b/chrome/browser/policy/configuration_policy_handler_list_factory.cc
@@ -561,6 +561,10 @@ prefs::kSystemTimezoneAutomaticDetectionPolicy, base::Value::TYPE_INTEGER }, #endif + + { key::kTaskManagerEndProcessEnabled, + prefs::kTaskManagerEndProcessEnabled, + base::Value::TYPE_BOOLEAN }, }; class ForceSafeSearchPolicyHandler : public TypeCheckingPolicyHandler {
diff --git a/chrome/browser/policy/policy_browsertest.cc b/chrome/browser/policy/policy_browsertest.cc index e658b11c..43ec5cc7 100644 --- a/chrome/browser/policy/policy_browsertest.cc +++ b/chrome/browser/policy/policy_browsertest.cc
@@ -70,6 +70,7 @@ #include "chrome/browser/search/search.h" #include "chrome/browser/search_engines/template_url_service_factory.h" #include "chrome/browser/ssl/ssl_blocking_page.h" +#include "chrome/browser/task_manager/task_manager.h" #include "chrome/browser/translate/chrome_translate_client.h" #include "chrome/browser/translate/cld_data_harness.h" #include "chrome/browser/translate/cld_data_harness_factory.h" @@ -3857,6 +3858,33 @@ ->ShowingInterstitialPage()); } +// Test that TaskManager::IsEndProcessEnabled is controlled by +// TaskManagerEndProcessEnabled policy +IN_PROC_BROWSER_TEST_F(PolicyTest, TaskManagerEndProcessEnabled) { + // By default it's allowed to end tasks. + EXPECT_TRUE(TaskManager::IsEndProcessEnabled()); + + // Disabling ending tasks in task manager by policy + PolicyMap policies1; + policies1.Set(key::kTaskManagerEndProcessEnabled, POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_MACHINE, POLICY_SOURCE_CLOUD, + new base::FundamentalValue(false), nullptr); + UpdateProviderPolicy(policies1); + + // Policy should not allow ending tasks anymore. + EXPECT_FALSE(TaskManager::IsEndProcessEnabled()); + + // Enabling ending tasks in task manager by policy + PolicyMap policies2; + policies2.Set(key::kTaskManagerEndProcessEnabled, POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_MACHINE, POLICY_SOURCE_CLOUD, + new base::FundamentalValue(true), nullptr); + UpdateProviderPolicy(policies2); + + // Policy should allow ending tasks again. + EXPECT_TRUE(TaskManager::IsEndProcessEnabled()); +} + #if !defined(OS_CHROMEOS) // Similar to PolicyTest but sets the proper policy before the browser is // started.
diff --git a/chrome/browser/policy/test/policy_testserver.py b/chrome/browser/policy/test/policy_testserver.py index c7f933d..316d855 100644 --- a/chrome/browser/policy/test/policy_testserver.py +++ b/chrome/browser/policy/test/policy_testserver.py
@@ -308,6 +308,12 @@ elif request_type == 'status_upload': response = self.ProcessStatusUploadRequest( rmsg.device_status_report_request, rmsg.session_status_report_request) + elif request_type == 'device_attribute_update_permission': + response = self.ProcessDeviceAttributeUpdatePermissionRequest() + elif request_type == 'device_attribute_update': + response = self.ProcessDeviceAttributeUpdateRequest() + elif request_type == 'remote_commands': + response = self.ProcessRemoteCommandsRequest() else: return (400, 'Invalid request parameter') @@ -586,6 +592,38 @@ return (200, response) + def ProcessDeviceAttributeUpdatePermissionRequest(self): + """Handles a device attribute update permission request. + + Returns: + A tuple of HTTP status code and response data to send to the client. + """ + response = dm.DeviceManagementResponse() + response.device_attribute_update_permission_response.result = ( + dm.DeviceAttributeUpdatePermissionResponse.ATTRIBUTE_UPDATE_ALLOWED) + + return (200, response) + + def ProcessDeviceAttributeUpdateRequest(self): + """Handles a device attribute update request. + + Returns: + A tuple of HTTP status code and response data to send to the client. + """ + response = dm.DeviceManagementResponse() + response.device_attribute_update_response.result = ( + dm.DeviceAttributeUpdateResponse.ATTRIBUTE_UPDATE_SUCCESS) + + return (200, response) + + def ProcessRemoteCommandsRequest(self): + """Handles a remote command request. + + Returns: + A tuple of HTTP status code and response data to send to the client. + """ + return (200, '') + def SetProtobufMessageField(self, group_message, field, field_value): """Sets a field in a protobuf message.
diff --git a/chrome/browser/process_singleton_browsertest.cc b/chrome/browser/process_singleton_browsertest.cc index ff7a4cb..02a30ce 100644 --- a/chrome/browser/process_singleton_browsertest.cc +++ b/chrome/browser/process_singleton_browsertest.cc
@@ -12,6 +12,8 @@ #include <stddef.h> +#include <memory> + #include "base/bind.h" #include "base/command_line.h" #include "base/files/file_path.h" @@ -19,7 +21,6 @@ #include "base/location.h" #include "base/macros.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "base/path_service.h" #include "base/process/launch.h" #include "base/process/process.h"
diff --git a/chrome/browser/push_messaging/push_messaging_notification_manager.cc b/chrome/browser/push_messaging/push_messaging_notification_manager.cc index c8be8829..8ac8458 100644 --- a/chrome/browser/push_messaging/push_messaging_notification_manager.cc +++ b/chrome/browser/push_messaging/push_messaging_notification_manager.cc
@@ -67,8 +67,8 @@ const GURL& origin, int64_t service_worker_registration_id) { PlatformNotificationData notification_data; - notification_data.title = - url_formatter::FormatUrlForSecurityDisplayOmitScheme(origin); + notification_data.title = url_formatter::FormatUrlForSecurityDisplay( + origin, url_formatter::SchemeDisplay::OMIT_HTTP_AND_HTTPS); notification_data.direction = PlatformNotificationData::DIRECTION_LEFT_TO_RIGHT; notification_data.body =
diff --git a/chrome/browser/resources/chromeos/chromevox/strings/chromevox_strings_sw.xtb b/chrome/browser/resources/chromeos/chromevox/strings/chromevox_strings_sw.xtb index b7a468d..0695196 100644 --- a/chrome/browser/resources/chromeos/chromevox/strings/chromevox_strings_sw.xtb +++ b/chrome/browser/resources/chromeos/chromevox/strings/chromevox_strings_sw.xtb
@@ -114,7 +114,7 @@ <translation id="2429669115401274487">PM</translation> <translation id="2435413342408885429"><ph name="KEY" /> sasa ni kirekebishaji kipya cha ChromeVox.</translation> <translation id="2450814015951372393">Kisanduku cha kuteua</translation> -<translation id="2462626033734746142">Kikundi cha kitufe cha redio</translation> +<translation id="2462626033734746142">Vitufe kadhaa vya mviringo</translation> <translation id="2471138580042810658">Kichwa 6</translation> <translation id="248982282205370495">{COUNT,plural, =1{nyota}other{nyota #}}</translation> <translation id="2549392850788122959"><ph name="KEY" /> imewekwa upya.</translation> @@ -164,7 +164,7 @@ <translation id="2999559350546931576">Punguza kiwango cha sauti</translation> <translation id="2999945368667127852">Hakuna wijeti ya maudhui inayofuata.</translation> <translation id="3012414509011670858">Hakuna sehemu iliyotangulia.</translation> -<translation id="3030432017085518523">Kitufe cha redio cha kipengee cha menyu</translation> +<translation id="3030432017085518523">Kitufe cha mviringo cha menyu</translation> <translation id="3037392361165431467">{COUNT,plural, =1{apostrofi}other{apostrofi #}}</translation> <translation id="3046838483509668188">Chaguo za ChromeVox</translation> <translation id="3047143736589213134">Ramani msingi ya majaribio</translation> @@ -387,7 +387,7 @@ <translation id="4986606102545753256"><ph name="NAME" />, dirisha</translation> <translation id="4993152509206108683">Kadiria asilimia <ph name="PERCENT" /></translation> <translation id="4996716799442435517">Yanayoonekana</translation> -<translation id="4997282455736854877">Kitufe <ph name="NAME" />, kimeteuliwa</translation> +<translation id="4997282455736854877">Kitufe cha mviringo cha <ph name="NAME" /> kimechaguliwa</translation> <translation id="4997475792277222884">Hakuna kipengee kinachofuata ambacho si kiungo.</translation> <translation id="5000760171916499057">Hakuna fomu.</translation> <translation id="5005670136041063723">Hakuna vipengee vinavyofanana tena.</translation> @@ -442,7 +442,7 @@ <translation id="5502713021410870035">Septemba</translation> <translation id="5507663321906818013">Mfumo wa kutatua hitilafu</translation> <translation id="5518443085409638729">Weka kishale kati ya herufi unapohariri maandishi (kama vile Mac OS X).</translation> -<translation id="552195134157544755">Kitufe cha redio</translation> +<translation id="552195134157544755">Kitufe cha mviringo</translation> <translation id="5534303576632885660">kichwa</translation> <translation id="5546092960038624944">Hakuna kichwa cha ngazi ya 5 iliyotangulia.</translation> <translation id="556042886152191864">Kitufe</translation> @@ -452,7 +452,7 @@ <translation id="5585044216466955529">Badilisha maandishi, ingizo la barua pepe</translation> <translation id="5597170376237141345">Kisanduku cha kuteua kinachofuata</translation> <translation id="5597933780944041114">Hakuna kichwa kinachofuata.</translation> -<translation id="5598905979683743333"><ph name="NAME" />, kitufe cha redio kimeondolewa uteuzi</translation> +<translation id="5598905979683743333">Kitufe cha mviringo cha <ph name="NAME" /> hakijachaguliwa</translation> <translation id="5601172225407283979">Tekeleza kitendo chaguo-msingi</translation> <translation id="5608798115546226984">Inayojijaza kiotomatiki kulingana na maandishi</translation> <translation id="561939826962581046">wakati</translation> @@ -590,7 +590,7 @@ <translation id="72393384879519786">Kichwa</translation> <translation id="7241683698754534149">Fungua maelezo marefu katika kichupo kipya</translation> <translation id="7248671827512403053">Programu</translation> -<translation id="725969808843520477">Kitufe cha redio kinachofuata</translation> +<translation id="725969808843520477">Kitufe cha mviringo kinachofuata</translation> <translation id="7269119382257320590">Hakuna vituo vya maandishi</translation> <translation id="7273174640290488576">Mtupu</translation> <translation id="7285387653379749618">Majedwali</translation> @@ -635,7 +635,7 @@ <translation id="7674768236845044097">alama</translation> <translation id="7684431668231950609">Hariri maandishi, ingizo la URL</translation> <translation id="7685589220304187312">tlbar</translation> -<translation id="7693840228159394336">Kitufe cha redio kilichotangulia</translation> +<translation id="7693840228159394336">Kitufe cha mviringo kilichotangulia</translation> <translation id="7701196182766842984">autolst</translation> <translation id="7770823902658038748"><ph name="VALUE" />, <ph name="NAME" />, kikasha maandishi cha nenosiri</translation> <translation id="7805247615045262757">kudurusu chaguo-msingi</translation>
diff --git a/chrome/browser/resources/chromeos/login/login_shared.js b/chrome/browser/resources/chromeos/login/login_shared.js index 626338c..84af18c5 100644 --- a/chrome/browser/resources/chromeos/login/login_shared.js +++ b/chrome/browser/resources/chromeos/login/login_shared.js
@@ -91,7 +91,6 @@ * Update body class to switch between OOBE UI and Login UI. */ Oobe.showOobeUI = function(showOobe) { - console.log('Oobe.showOobeUI(' + showOobe + ')'); if (showOobe) { document.body.classList.add('oobe-display'); @@ -286,11 +285,41 @@ * Login for telemetry. * @param {string} username Login username. * @param {string} password Login password. + * @param {boolean} enterpriseEnroll Login as an enterprise enrollment? */ - Oobe.loginForTesting = function(username, password, gaia_id) { + Oobe.loginForTesting = function(username, password, gaia_id, + enterpriseEnroll = false) { + // Helper method that runs |fn| after |screenName| is visible. + function waitForOobeScreen(screenName, fn) { + if (Oobe.getInstance().currentScreen && + Oobe.getInstance().currentScreen.id === screenName) { + fn(); + } else { + $('oobe').addEventListener('screenchanged', function handler(e) { + if (e.detail == screenName) { + $('oobe').removeEventListener('screenchanged', handler); + fn(); + } + }); + } + } + Oobe.disableSigninUI(); chrome.send('skipToLoginForTesting', [username]); - chrome.send('completeLogin', [gaia_id, username, password, false]); + + if (!enterpriseEnroll) { + chrome.send('completeLogin', [gaia_id, username, password, false]); + } else { + waitForOobeScreen('gaia-signin', function() { + chrome.send('toggleEnrollmentScreen'); + chrome.send('toggleFakeEnrollment'); + }); + + waitForOobeScreen('oauth-enrollment', function() { + chrome.send('oauthEnrollCompleteLogin', [username, 'authcode']); + chrome.send('completeLogin', [gaia_id, username, password, false]); + }); + } }; /**
diff --git a/chrome/browser/resources/md_feedback/OWNERS b/chrome/browser/resources/md_feedback/OWNERS new file mode 100644 index 0000000..02b5b46 --- /dev/null +++ b/chrome/browser/resources/md_feedback/OWNERS
@@ -0,0 +1 @@ +apacible@chromium.org
diff --git a/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.js b/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.js index d700f4c2..cb74d9e 100644 --- a/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.js +++ b/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.js
@@ -130,19 +130,8 @@ }, /** - * Whether the search input is currently focused. This is used to prevent - * window focus/blur events from interfering with input-focus-dependent - * operations. - * @private {boolean} - */ - isSearchFocused_: { - type: Boolean, - value: false, - }, - - /** - * Records the value of |isSearchFocused_| when a window blur event is - * received. This used to handle search focus edge cases. See + * Records whether the search input is focused when a window blur event is + * received. This is used to handle search focus edge cases. See * |setSearchFocusHandlers_| for details. * @private {boolean} */ @@ -152,18 +141,6 @@ }, /** - * Temporarily set when the window focus event handler needs to reset - * |isSearchFocused_| to the correct value but needs to know whether the - * search input focus handler will run. See |setSearchFocusHandlers_| for - * details. - * @private {boolean} - */ - isSearchFocusedShouldBeSet_: { - type: Boolean, - value: false, - }, - - /** * Whether the user is currently searching for a sink. * @private {boolean} */ @@ -1478,66 +1455,36 @@ // clicks the search button, a focus event will not fire and so its event // handler from ready() will not run. this.isUserSearching_ = true; - this.$$('#sink-search-input').focus(); + this.$['sink-search-input'].focus(); }, /** - * Sets various focus and blur event handlers to handle |isSearchFocused_| and - * showing search results when the input is focused. + * Sets various focus and blur event handlers to handle showing search results + * when the search input is focused. * @private */ setSearchFocusHandlers_: function() { var search = this.$['sink-search-input']; + var that = this; // The window can see a blur event for two important cases: the window is // actually losing focus or keyboard focus is wrapping from the end of the - // document to the beginning. To handle both cases, we save the state of - // |isSearchFocused_| during the window blur event. + // document to the beginning. To handle both cases, we save whether the + // search input was focused during the window blur event. // - // The corresponding window focus event can do nothing if |isSearchFocused_| - // was false during the blur event. If the search input is gaining focus now - // it will work correctly. There are two cases when the input had focus - // during the window blur event: the input still has focus and the input - // lost focus. These cases are handled by the logic around - // |isSearchFocusedShouldBeSet_| and |isSearchFocused_|. - // - // Because the window focus event will always happen first, it doesn't know - // whether the input focus handler will later run or not. If it is not going - // to run, then |isSearchFocused_| should be set to |false|, otherwise it - // should be |true|. So the window focus handler just sets - // |isSearchFocused_| to |false| and makes a note in - // |isSearchFocusedShouldBeSet_| that |isSearchFocused_| should actually be - // set to true if the search focus handler runs. The |setTimeout| in the - // window focus handler clears this note as soon as all focus event handlers - // have run. + // When the search input receives focus it could be as part of window focus + // and if the search input was also focused on window blur, it shouldn't + // change the value of |isUserSearching_|. Otherwise, focusing the search + // input should activate the FILTER view by setting |isUserSearching_|. window.addEventListener('blur', function() { - this.isSearchFocusedOnWindowBlur_ = this.isSearchFocused_; - }.bind(this)); - window.addEventListener('focus', function() { - if (this.isSearchFocusedOnWindowBlur_) { - this.isSearchFocusedOnWindowBlur_ = false; - this.isSearchFocusedShouldBeSet_ = true; - this.isSearchFocused_ = false; - setTimeout(function() { - this.isSearchFocusedShouldBeSet_ = false; - }.bind(this)); - } - }.bind(this)); - search.addEventListener('blur', function() { - // This lets normal blur cases work as expected, but doesn't get in the - // way of the window blur handler capturing the "current" state. This is - // the case because this will be run after all the blur handlers are done. - setTimeout(function() { this.isSearchFocused_ = false; }.bind(this)); - }.bind(this)); + that.isSearchFocusedOnWindowBlur_ = + that.shadowRoot.activeElement == search; + }); search.addEventListener('focus', function() { - if (this.isSearchFocusedShouldBeSet_) { - this.isSearchFocused_ = true; + if (!that.isSearchFocusedOnWindowBlur_) { + that.isUserSearching_ = true; } - if (!this.isSearchFocused_) { - this.isSearchFocused_ = true; - this.isUserSearching_ = true; - } - }.bind(this)); + }); }, /**
diff --git a/chrome/browser/resources/settings/bluetooth_page/bluetooth_add_device_dialog.html b/chrome/browser/resources/settings/bluetooth_page/bluetooth_add_device_dialog.html index f528aba..edb3b17 100644 --- a/chrome/browser/resources/settings/bluetooth_page/bluetooth_add_device_dialog.html +++ b/chrome/browser/resources/settings/bluetooth_page/bluetooth_add_device_dialog.html
@@ -4,11 +4,12 @@ <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-spinner/paper-spinner.html"> <link rel="import" href="chrome://md-settings/settings_shared_css.html"> +<link rel="import" href="chrome://md-settings/bluetooth_page/bluetooth_dialog_shared_css.html"> <dom-module id="settings-bluetooth-add-device-dialog"> - <link rel="import" type="css" href="bluetooth_dialog.css"> <template> <style include="settings-shared"></style> + <style include="bluetooth-dialog-shared"></style> <div id="dialogOuterDiv" class="layout vertical flex"> <div id="dialogHeaderDiv" class="settings-box layout horizontal"> <span id="dialogTitle" class="flex"
diff --git a/chrome/browser/resources/settings/bluetooth_page/bluetooth_dialog.css b/chrome/browser/resources/settings/bluetooth_page/bluetooth_dialog.css deleted file mode 100644 index 827fd37..0000000 --- a/chrome/browser/resources/settings/bluetooth_page/bluetooth_dialog.css +++ /dev/null
@@ -1,91 +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. */ - -#dialogOuterDiv { - margin-bottom: 16px; -} - -#dialogHeaderDiv { - height: 40px; - margin: 0 5px 10px; -} - -#dialogFooterDiv { - height: 40px; - margin: 0 20px; -} - -#dialogMessage { - margin-bottom: 10px; -} - -#dialogTitle { - font-size: 125%; - margin: 0 10px; -} - -#dialogDeviceList { - -webkit-margin-start: 4px; - height: 210px; - margin-bottom: 20px; - overflow-y: auto; -} - -#pairing { - margin-bottom: 10px; -} - -#pairing paper-input { - text-align: center; -} - -#pinDiv { - margin-top: 10px; -} - -iron-selector { - width: 100%; -} - -paper-spinner { - height: 20px; - margin: 0 10px; - width: 20px; -} - -/* .display indicates a displayed pin code or passkey. */ -span.display { - border: 1px solid #ccc; - border-radius: 4px; - box-shadow: 0 0 0 1px #222; - color: #222; - font-size: 16px; - height: 38px; - line-height: 38px; - margin: 0 5px; - padding: 0 15px; - text-align: center; - text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); -} - -span.display.next { - background: rgb(77, 144, 254); - border: 2px solid rgb(77, 144, 254); - box-shadow: none; - color: #fff; -} - -span.display.untyped { - border: 1px solid #d4d4d4; - box-shadow: 0 0 0 1px #888; - color: #666; -} - -/* .confirm indicates a confirmation passkey. */ -span.confirm { - color: #999; - font-size: 20px; - font-weight: 600; /* semibold */ - margin: 0 20px; -}
diff --git a/chrome/browser/resources/settings/bluetooth_page/bluetooth_dialog_shared_css.html b/chrome/browser/resources/settings/bluetooth_page/bluetooth_dialog_shared_css.html new file mode 100644 index 0000000..7275d22c --- /dev/null +++ b/chrome/browser/resources/settings/bluetooth_page/bluetooth_dialog_shared_css.html
@@ -0,0 +1,93 @@ +<dom-module id="bluetooth-dialog-shared"> + <template> + <style> + #dialogOuterDiv { + margin-bottom: 16px; + } + + #dialogHeaderDiv { + height: 40px; + margin: 0 5px 10px; + } + + #dialogFooterDiv { + height: 40px; + margin: 0 20px; + } + + #dialogMessage { + margin-bottom: 10px; + } + + #dialogTitle { + font-size: 125%; + margin: 0 10px; + } + + #dialogDeviceList { + -webkit-margin-start: 4px; + height: 210px; + margin-bottom: 20px; + overflow-y: auto; + } + + #pairing { + margin-bottom: 10px; + } + + #pairing paper-input { + text-align: center; + } + + #pinDiv { + margin-top: 10px; + } + + iron-selector { + width: 100%; + } + + paper-spinner { + height: 20px; + margin: 0 10px; + width: 20px; + } + + /* .display indicates a displayed pin code or passkey. */ + span.display { + border: 1px solid #ccc; + border-radius: 4px; + box-shadow: 0 0 0 1px #222; + color: #222; + font-size: 16px; + height: 38px; + line-height: 38px; + margin: 0 5px; + padding: 0 15px; + text-align: center; + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); + } + + span.display.next { + background: rgb(77, 144, 254); + border: 2px solid rgb(77, 144, 254); + box-shadow: none; + color: #fff; + } + + span.display.untyped { + border: 1px solid #d4d4d4; + box-shadow: 0 0 0 1px #888; + color: #666; + } + + /* .confirm indicates a confirmation passkey. */ + span.confirm { + color: #999; + font-size: 20px; + font-weight: 600; /* semibold */ + margin: 0 20px; + } + </style> + </template> +</dom-module>
diff --git a/chrome/browser/resources/settings/bluetooth_page/bluetooth_pair_device_dialog.html b/chrome/browser/resources/settings/bluetooth_page/bluetooth_pair_device_dialog.html index 755d418..9a8d5949 100644 --- a/chrome/browser/resources/settings/bluetooth_page/bluetooth_pair_device_dialog.html +++ b/chrome/browser/resources/settings/bluetooth_page/bluetooth_pair_device_dialog.html
@@ -4,11 +4,12 @@ <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-input/paper-input.html"> <link rel="import" href="chrome://md-settings/settings_shared_css.html"> +<link rel="import" href="chrome://md-settings/bluetooth_page/bluetooth_dialog_shared_css.html"> <dom-module id="settings-bluetooth-pair-device-dialog"> - <link rel="import" type="css" href="bluetooth_dialog.css"> <template> <style include="settings-shared"></style> + <style include="bluetooth-dialog-shared"></style> <div id="dialogOuterDiv" class="layout vertical flex"> <div id="dialogHeaderDiv" class="settings-box layout horizontal center"> <span id="dialogTitle" class="flex"
diff --git a/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_browser_proxy.html b/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_browser_proxy.html new file mode 100644 index 0000000..0c96ce9 --- /dev/null +++ b/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_browser_proxy.html
@@ -0,0 +1,2 @@ +<link rel="import" href="chrome://resources/html/cr.html"> +<script src="chrome://md-settings/clear_browsing_data_dialog/clear_browsing_data_browser_proxy.js"></script>
diff --git a/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_browser_proxy.js b/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_browser_proxy.js new file mode 100644 index 0000000..9c52c79 --- /dev/null +++ b/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_browser_proxy.js
@@ -0,0 +1,38 @@ +// 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. + +/** + * @fileoverview A helper object used from the "Clear browsing data" dialog + * to interact with the browser. + */ + +cr.define('settings', function() { + /** @interface */ + function ClearBrowsingDataBrowserProxy() {} + + ClearBrowsingDataBrowserProxy.prototype = { + /** + * @return {!Promise} A promise resolved when data clearing has completed. + */ + clearBrowsingData: function() {}, + }; + + /** + * @constructor + * @implements {settings.ClearBrowsingDataBrowserProxy} + */ + function ClearBrowsingDataBrowserProxyImpl() {} + cr.addSingletonGetter(ClearBrowsingDataBrowserProxyImpl); + + ClearBrowsingDataBrowserProxyImpl.prototype = { + /** @override */ + clearBrowsingData: function() { + return cr.sendWithPromise('clearBrowsingData'); + }, + }; + + return { + ClearBrowsingDataBrowserProxyImpl: ClearBrowsingDataBrowserProxyImpl, + }; +});
diff --git a/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_dialog.html b/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_dialog.html index 360c5ed..b9a9bda 100644 --- a/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_dialog.html +++ b/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_dialog.html
@@ -1,6 +1,8 @@ <link rel="import" href="chrome://resources/html/polymer.html"> +<link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html"> <link rel="import" href="chrome://md-settings/i18n_setup.html"> +<link rel="import" href="chrome://md-settings/clear_browsing_data_dialog/clear_browsing_data_browser_proxy.html"> <link rel="import" href="chrome://md-settings/controls/settings_checkbox.html"> <link rel="import" href="chrome://md-settings/controls/settings_dropdown_menu.html"> <link rel="import" href="chrome://md-settings/settings_dialog.html"> @@ -9,7 +11,7 @@ <dom-module id="settings-clear-browsing-data-dialog"> <template> <style include="settings-shared"></style> - <settings-dialog id="dialog" on-iron-overlay-closed="onDialogClosed_"> + <settings-dialog id="dialog"> <div class="title" i18n-content="clearBrowsingData"></div> <div class="body"> <div class="row"> @@ -55,8 +57,8 @@ <div class="button-container"> <paper-button class="cancel-button" i18n-content="cancel" dialog-dismiss></paper-button> - <paper-button class="action-button" id="clearDataButton" - i18n-content="clearBrowsingData" dialog-confirm> + <paper-button class="action-button" id="clearBrowsingData" + i18n-content="clearBrowsingData" on-tap="onClearBrowsingDataTap_"> </paper-button> </div> <div class="footer">
diff --git a/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_dialog.js b/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_dialog.js index 0d9f4de..b6b045d 100644 --- a/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_dialog.js +++ b/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_dialog.js
@@ -3,21 +3,14 @@ // found in the LICENSE file. /** - * @fileoverview - * 'settings-clear-browsing-data-page' provides options to delete browsing - * data that has been cached by chromium. - * - * Example: - * - * <iron-animated-pages> - * <settings-clear-browsing-data-page prefs="{{prefs}}"> - * </settings-clear-browsing-data-page> - * ... other pages ... - * </iron-animated-pages> + * @fileoverview 'settings-clear-browsing-data-dialog' allows the user to delete + * browsing data that has been cached by Chromium. */ Polymer({ is: 'settings-clear-browsing-data-dialog', + behaviors: [WebUIListenerBehavior], + properties: { /** * Preferences state. @@ -28,14 +21,6 @@ }, /** - * The current active route. - */ - currentRoute: { - type: Object, - notify: true, - }, - - /** * List of options for the dropdown menu. * @private {!DropdownMenuOptionList>} */ @@ -52,37 +37,24 @@ }, }, + /** @private {!settings.ClearBrowsingDataBrowserProxy} */ + browserProxy_: null, + + /** @override */ ready: function() { this.$.clearFrom.menuOptions = this.clearFromOptions_; - }, - - attached: function() { - var self = this; - cr.define('SettingsClearBrowserData', function() { - return { - doneClearing: function() { - return self.doneClearing_.apply(self, arguments); - }, - setAllowDeletingHistory: function() { - return self.setAllowDeletingHistory_.apply(self, arguments); - }, - }; - }); - }, - - /** @private */ - doneClearing_: function() { - // TODO(dschuyler): inform the user on whether clearing data was successful. + this.addWebUIListener( + 'browsing-history-pref-changed', + this.setAllowDeletingHistory_.bind(this)); + this.browserProxy_ = + settings.ClearBrowsingDataBrowserProxyImpl.getInstance(); }, /** - * @private * @param {boolean} allowed Whether the user is allowed to delete histories. + * @private */ setAllowDeletingHistory_: function(allowed) { - // This is called from c++, protect against poor timing. - if (!this.$) - return; this.$.browsingCheckbox.disabled = !allowed; this.$.downloadCheckbox.disabled = !allowed; if (!allowed) { @@ -95,12 +67,12 @@ this.$.dialog.open(); }, - /** - * @param {!Event} event Tells us whether to perform an action or cancel. - * @private - */ - onDialogClosed_: function(event) { - if (event.detail.confirmed) - chrome.send('performClearBrowserData'); + /** @private */ + onClearBrowsingDataTap_: function() { + // TODO(dpapad): Show spinner, disable buttons here. + this.browserProxy_.clearBrowsingData().then(function() { + // TODO(dpapad): Hide spinner, re-enable buttons here. + this.$.dialog.close(); + }.bind(this)); }, });
diff --git a/chrome/browser/resources/settings/device_page/compiled_resources2.gyp b/chrome/browser/resources/settings/device_page/compiled_resources2.gyp index 67a7d9c..6966fb4 100644 --- a/chrome/browser/resources/settings/device_page/compiled_resources2.gyp +++ b/chrome/browser/resources/settings/device_page/compiled_resources2.gyp
@@ -26,6 +26,8 @@ { 'target_name': 'display', 'dependencies': [ + '<(DEPTH)/third_party/polymer/v1_0/components-chromium/paper-button/compiled_resources2.gyp:paper-button-extracted', + '<(DEPTH)/third_party/polymer/v1_0/components-chromium/paper-slider/compiled_resources2.gyp:paper-slider-extracted', '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:cr', '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:i18n_behavior', '<(EXTERNS_GYP):system_display',
diff --git a/chrome/browser/resources/settings/device_page/display.html b/chrome/browser/resources/settings/device_page/display.html index 92a4d45..026006e 100644 --- a/chrome/browser/resources/settings/device_page/display.html +++ b/chrome/browser/resources/settings/device_page/display.html
@@ -5,6 +5,7 @@ <link rel="import" href="chrome://resources/polymer/v1_0/paper-checkbox/paper-checkbox.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-dropdown-menu/paper-dropdown-menu.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-listbox/paper-listbox.html"> +<link rel="import" href="chrome://resources/polymer/v1_0/paper-slider/paper-slider.html"> <link rel="import" href="chrome://md-settings/settings_shared_css.html"> <dom-module id="settings-display"> @@ -18,19 +19,29 @@ } .settings-box.embedded { + align-self: stretch; margin-left: 20px; padding: 0; } /* TODO(stevenjb): Placeholder */ .display-area { + align-self: stretch; border: lightgrey solid 1px; - height: 300px; + flex: 1 1; + height: 200px; margin: 10px; - width: 600px; + } + + .textarea { + margin: 10px 0; + } + + .info-text { + color: var(--paper-grey-500); } </style> - <div class="settings-box first layout vertical"> + <div class="settings-box first layout vertical self-stretch"> <div class="display-section">$i18n{displayArrangement}</div> <div class="display-area"> <!-- TODO(stevenjb): Support layout --> @@ -44,7 +55,7 @@ </div> <div class="settings-box layout vertical"> <div class="display-section">[[selectedDisplay.name]]</div> - <div class="settings-box embedded first self-stretch"> + <div class="settings-box embedded first"> <paper-checkbox class="flex" checked="[[isMirrored_(displays)]]" hidden$="[[!showMirror_(displays)]]" on-tap="onMirroredTap_"> $i18n{displayMirror} @@ -55,13 +66,23 @@ $i18n{displayMakePrimary} </paper-button> </div> - <div class="settings-box embedded self-stretch"> - <div class="start">$i18n{displayResolution}</div> - <!-- TODO(stevenjb): Implement --> - <paper-slider disabled></paper-slider> + <div class="settings-box embedded horizontal justified"> + <div class="start textarea layout vertical"> + <div>$i18n{displayResolutionTitle}</div> + <div class="info-text layout self-start"> + [[getResolutionText_(selectedDisplay, immediateSelectedModeIndex_)]] + </div> + </div> + <paper-slider snaps max-markers="100" step="1" + disabled="[[!enableSetResolution_(selectedDisplay)]]" + min="0" max="[[maxModeIndex_]]" + value="[[selectedModeIndex_]]" + immediate-value="{{immediateSelectedModeIndex_}}" + on-change="onChangeMode_"> + </paper-slider> </div> - <div class="settings-box embedded self-stretch"> - <div class="start">$i18n{displayOrientation}</div> + <div class="settings-box embedded"> + <div class="start textarea">$i18n{displayOrientation}</div> <paper-dropdown-menu> <paper-listbox class="dropdown-content" selected="[[selectedDisplay.rotation]]"
diff --git a/chrome/browser/resources/settings/device_page/display.js b/chrome/browser/resources/settings/device_page/display.js index 5d1e71d..0bbf2f3 100644 --- a/chrome/browser/resources/settings/device_page/display.js +++ b/chrome/browser/resources/settings/device_page/display.js
@@ -38,7 +38,16 @@ * Selected display * @type {!chrome.system.display.DisplayUnitInfo|undefined} */ - selectedDisplay: Object, + selectedDisplay: {type: Object, observer: 'selectedDisplayChanged_'}, + + /** Maximum mode index value for slider. */ + maxModeIndex_: {type: Number, value: 0}, + + /** Selected mode index value for slider. */ + selectedModeIndex_: {type: Number}, + + /** Immediate selected mode index value for slider. */ + immediateSelectedModeIndex_: {type: Number, value: 0} }, /** @@ -72,6 +81,31 @@ /** * @param {!chrome.system.display.DisplayUnitInfo} selectedDisplay + * @return {number} + * @private + */ + getSelectedModeIndex_: function(selectedDisplay) { + for (var i = 0; i < selectedDisplay.modes.length; ++i) { + if (selectedDisplay.modes[i].isSelected) + return i; + } + return 0; + }, + + /** @private */ + selectedDisplayChanged_: function() { + // Set maxModeIndex first so that the slider updates correctly. + if (this.selectedDisplay.modes.length == 0) { + this.maxModeIndex_ = 0; + this.selectedModeIndex_ = 0; + return; + } + this.maxModeIndex_ = this.selectedDisplay.modes.length - 1; + this.selectedModeIndex_ = this.getSelectedModeIndex_(this.selectedDisplay); + }, + + /** + * @param {!chrome.system.display.DisplayUnitInfo} selectedDisplay * @param {string} primaryDisplayId * @return {boolean} * @private @@ -109,11 +143,47 @@ }, /** - * @param {!{model: !{index: number}}} e + * @param {!chrome.system.display.DisplayUnitInfo} selectedDisplay + * @return {boolean} + * @private + */ + enableSetResolution_: function(selectedDisplay) { + return selectedDisplay.modes.length > 1; + }, + + /** + * @param {!chrome.system.display.DisplayUnitInfo} selectedDisplay + * @param {number} immediateSelectedModeIndex + * @return {string} + * @private + */ + getResolutionText_: function(selectedDisplay, immediateSelectedModeIndex) { + if (this.selectedDisplay.modes.length == 0) { + var widthStr = selectedDisplay.bounds.width.toString(); + var heightStr = selectedDisplay.bounds.height.toString(); + return this.i18n('displayResolutionText', widthStr, heightStr); + } + if (isNaN(immediateSelectedModeIndex)) + immediateSelectedModeIndex = this.getSelectedModeIndex_(selectedDisplay); + var mode = selectedDisplay.modes[immediateSelectedModeIndex]; + var best = selectedDisplay.isInternal ? mode.uiScale == 1.0 : mode.isNative; + var widthStr = mode.width.toString(); + var heightStr = mode.height.toString(); + if (best) + return this.i18n('displayResolutionTextBest', widthStr, heightStr); + else if (mode.isNative) + return this.i18n('displayResolutionTextNative', widthStr, heightStr); + return this.i18n('displayResolutionText', widthStr, heightStr); + }, + + /** + * @param {!{model: !{index: number}, target: !PaperButtonElement}} e * @private */ onSelectDisplayTap_: function(e) { this.selectedDisplay = this.displays[e.model.index]; + // Force active in case selected display was clicked. + e.target.active = true; }, /** @private */ @@ -131,6 +201,25 @@ }, /** + * @param {!{target: !PaperSliderElement}} e + * @private + */ + onChangeMode_: function(e) { + var curIndex = this.selectedModeIndex_; + var newIndex = parseInt(e.target.value, 10); + if (newIndex == curIndex) + return; + assert(newIndex >= 0); + assert(newIndex < this.selectedDisplay.modes.length); + /** @type {!chrome.system.display.DisplayProperties} */ var properties = { + displayMode: this.selectedDisplay.modes[newIndex] + }; + settings.display.systemDisplayApi.setDisplayProperties( + this.selectedDisplay.id, properties, + this.setPropertiesCallback_.bind(this)); + }, + + /** * @param {!{detail: !{selected: string}}} e * @private */
diff --git a/chrome/browser/resources/settings/settings_resources.grd b/chrome/browser/resources/settings/settings_resources.grd index 668820c3..7027939 100644 --- a/chrome/browser/resources/settings/settings_resources.grd +++ b/chrome/browser/resources/settings/settings_resources.grd
@@ -244,6 +244,12 @@ file="certificate_manager_page/certificates_error_dialog.html" type="chrome_html" /> </if> + <structure name="IDR_SETTINGS_CLEAR_BROWSING_DATA_BROWSER_PROXY_HTML" + file="clear_browsing_data_dialog/clear_browsing_data_browser_proxy.html" + type="chrome_html" /> + <structure name="IDR_SETTINGS_CLEAR_BROWSING_DATA_BROWSER_PROXY_JS" + file="clear_browsing_data_dialog/clear_browsing_data_browser_proxy.js" + type="chrome_html" /> <structure name="IDR_SETTINGS_CLEAR_BROWSING_DATA_DIALOG_HTML" file="clear_browsing_data_dialog/clear_browsing_data_dialog.html" type="chrome_html" /> @@ -707,8 +713,8 @@ <structure name="IDR_SETTINGS_BLUETOOTH_DEVICE_LIST_ITEM_JS" file="bluetooth_page/bluetooth_device_list_item.js" type="chrome_html" /> - <structure name="IDR_SETTINGS_BLUETOOTH_DIALOG_CSS" - file="bluetooth_page/bluetooth_dialog.css" + <structure name="IDR_SETTINGS_BLUETOOTH_DIALOG_SHARED_CSS_HTML" + file="bluetooth_page/bluetooth_dialog_shared_css.html" type="chrome_html" /> <structure name="IDR_SETTINGS_BLUETOOTH_PAGE_HTML" file="bluetooth_page/bluetooth_page.html"
diff --git a/chrome/browser/resources/settings/site_settings/constants.js b/chrome/browser/resources/settings/site_settings/constants.js index 0725fa64..33d469f7 100644 --- a/chrome/browser/resources/settings/site_settings/constants.js +++ b/chrome/browser/resources/settings/site_settings/constants.js
@@ -4,11 +4,11 @@ cr.define('settings', function() { /** - * The possible contentSettingsTypes (the ones we currently support - * configuring in the UI). This is a subset of the constants found under - * content_setttings_types.h and the values should be kept in sync. - * TODO(finnur): When all categories have been implemented we can just - * generate these constants from content_setttings_types.h. + * All possible contentSettingsTypes that we currently support configuring in + * the UI. Both top-level categories and content settings that represent + * individual permissions under Site Details should appear here. This is a + * subset of the constants found under content_setttings_types.h and the + * values should be kept in sync. * @enum {number} */ var ContentSettingsTypes = {
diff --git a/chrome/browser/resources/settings/site_settings/site_list.js b/chrome/browser/resources/settings/site_settings/site_list.js index bfa1a5c..57611da 100644 --- a/chrome/browser/resources/settings/site_settings/site_list.js +++ b/chrome/browser/resources/settings/site_settings/site_list.js
@@ -359,8 +359,7 @@ this.showAllowAction_ = this.categorySubtype == settings.PermissionValues.BLOCK; this.showBlockAction_ = - this.categorySubtype == settings.PermissionValues.ALLOW && - this.category != settings.ContentSettingsTypes.FULLSCREEN; + this.categorySubtype == settings.PermissionValues.ALLOW; }, /**
diff --git a/chrome/browser/resources/settings/site_settings/site_settings_behavior.js b/chrome/browser/resources/settings/site_settings/site_settings_behavior.js index 1474530..d1ab7fb2 100644 --- a/chrome/browser/resources/settings/site_settings/site_settings_behavior.js +++ b/chrome/browser/resources/settings/site_settings/site_settings_behavior.js
@@ -71,8 +71,6 @@ return 'camera'; case settings.ContentSettingsTypes.COOKIES: return 'cookies'; - case settings.ContentSettingsTypes.FULLSCREEN: - return 'fullscreen'; case settings.ContentSettingsTypes.GEOLOCATION: return 'location'; case settings.ContentSettingsTypes.IMAGES: @@ -91,7 +89,9 @@ }, /** - * A utility function to compute the icon to use for the category. + * A utility function to compute the icon to use for the category, both for + * the overall category as well as the individual permission in the details + * for a site. * @param {number} category The category to show the icon for. * @return {string} The id of the icon for the given category. * @protected @@ -123,7 +123,9 @@ }, /** - * A utility function to compute the title of the category. + * A utility function to compute the title of the category, both for + * the overall category as well as the individual permission in the details + * for a site. * @param {number} category The category to show the title for. * @return {string} The title for the given category. * @protected @@ -155,62 +157,6 @@ }, /** - * A utility function to compute the name of the pref for the category. - * @param {number} category The category to find the pref name for. - * @return {string} The pref name for the given category. - * @protected - */ - computeCategoryPrefName: function(category) { - return 'profile.default_content_setting_values.' + - this.computeCategorySuffix(category); - }, - - /** - * A utility function to compute the name of the pref for the exceptions - * for a given category. - * @param {number} category The category to find the pref name for. - * @return {string} The pref name for the given category exceptions. - * @protected - */ - computeCategoryExceptionsPrefName: function(category) { - return 'profile.content_settings.exceptions.' + - this.computeCategorySuffix(category); - }, - - /** - * A utility function to convert the category enum into its text - * representation, for use with prefs. - * @param {number} category The category to find the pref name for. - * @return {string} The pref name (suffix) for the given category. - * @protected - */ - computeCategorySuffix: function(category) { - switch (category) { - case settings.ContentSettingsTypes.CAMERA: - return 'media_stream_camera'; - case settings.ContentSettingsTypes.COOKIES: - return 'cookies'; - case settings.ContentSettingsTypes.FULLSCREEN: - return 'fullscreen'; - case settings.ContentSettingsTypes.GEOLOCATION: - return 'geolocation'; - case settings.ContentSettingsTypes.IMAGES: - return 'images'; - case settings.ContentSettingsTypes.JAVASCRIPT: - return 'javascript'; - case settings.ContentSettingsTypes.MIC: - return 'media_stream_mic'; - case settings.ContentSettingsTypes.NOTIFICATIONS: - return 'notifications'; - case settings.ContentSettingsTypes.POPUPS: - return 'popups'; - default: - assertNotReached(); - return ''; - } - }, - - /** * A utility function to compute the description for the category. * @param {number} category The category to show the description for. * @param {boolean} categoryEnabled The state of the global toggle. @@ -256,14 +202,6 @@ loadTimeData.getString( 'siteSettingsAskBeforeAccessingRecommended') : loadTimeData.getString('siteSettingsAskBeforeAccessing'); - case settings.ContentSettingsTypes.FULLSCREEN: - // "Allowed" vs. "Ask first (recommended)". - if (categoryEnabled) { - return loadTimeData.getString('siteSettingsAllowed'); - } - return showRecommendation ? - loadTimeData.getString('siteSettingsAskFirstRecommended') : - loadTimeData.getString('siteSettingsAskFirst'); case settings.ContentSettingsTypes.COOKIES: // "Allow sites to save and read cookie data" vs "Blocked". if (!categoryEnabled) {
diff --git a/chrome/browser/resources/settings/site_settings/site_settings_category.js b/chrome/browser/resources/settings/site_settings/site_settings_category.js index 88614f5..fe3a19cae 100644 --- a/chrome/browser/resources/settings/site_settings/site_settings_category.js +++ b/chrome/browser/resources/settings/site_settings/site_settings_category.js
@@ -96,14 +96,6 @@ settings.PermissionValues.ASK : settings.PermissionValues.BLOCK); break; - case settings.ContentSettingsTypes.FULLSCREEN: - // "Allowed" vs. "Ask first". - this.browserProxy.setDefaultValueForContentType( - this.category, - this.categoryEnabled ? - settings.PermissionValues.ALLOW : - settings.PermissionValues.ASK); - break; default: assertNotReached('Invalid category: ' + this.category); }
diff --git a/chrome/browser/resources/settings/site_settings_page/site_settings_page.html b/chrome/browser/resources/settings/site_settings_page/site_settings_page.html index afb909f..de82974f 100644 --- a/chrome/browser/resources/settings/site_settings_page/site_settings_page.html +++ b/chrome/browser/resources/settings/site_settings_page/site_settings_page.html
@@ -78,16 +78,6 @@ <div id="popups" class="option-value"></div> </paper-icon-item> - <paper-icon-item category$="[[ContentSettingsTypes.FULLSCREEN]]" - on-tap="onTapCategory"> - <iron-icon icon="[[computeIconForContentCategory( - ContentSettingsTypes.FULLSCREEN)]]" item-icon=""></iron-icon> - <div class="flex"> - [[computeTitleForContentCategory(ContentSettingsTypes.FULLSCREEN)]] - </div> - <div id="fullscreen" class="option-value"></div> - </paper-icon-item> - <paper-icon-item category$="[[ContentSettingsTypes.NOTIFICATIONS]]" on-tap="onTapCategory"> <iron-icon icon="[[computeIconForContentCategory(
diff --git a/chrome/browser/resources/settings/site_settings_page/site_settings_page.js b/chrome/browser/resources/settings/site_settings_page/site_settings_page.js index d4207d58..a16c45dc 100644 --- a/chrome/browser/resources/settings/site_settings_page/site_settings_page.js +++ b/chrome/browser/resources/settings/site_settings_page/site_settings_page.js
@@ -43,8 +43,6 @@ this.setDefaultValue_(this.ContentSettingsTypes.JAVASCRIPT, '#javascript'); this.setDefaultValue_(this.ContentSettingsTypes.POPUPS, '#popups'); - this.setDefaultValue_(this.ContentSettingsTypes.FULLSCREEN, - '#fullscreen'); this.setDefaultValue_(this.ContentSettingsTypes.NOTIFICATIONS, '#notifications'); this.setDefaultValue_(this.ContentSettingsTypes.IMAGES, '#images');
diff --git a/chrome/browser/safe_browsing/download_protection_service.cc b/chrome/browser/safe_browsing/download_protection_service.cc index ea264ac..081d32ae 100644 --- a/chrome/browser/safe_browsing/download_protection_service.cc +++ b/chrome/browser/safe_browsing/download_protection_service.cc
@@ -17,6 +17,7 @@ #include "base/metrics/field_trial.h" #include "base/metrics/histogram.h" #include "base/metrics/sparse_histogram.h" +#include "base/rand_util.h" #include "base/sequenced_task_runner_helpers.h" #include "base/stl_util.h" #include "base/strings/string_number_conversions.h" @@ -70,6 +71,8 @@ namespace { static const int64_t kDownloadRequestTimeoutMs = 7000; +// We sample 1% of whitelisted downloads to still send out download pings. +static const double kWhitelistDownloadSampleRate = 0.01; } // namespace namespace safe_browsing { @@ -294,6 +297,10 @@ finished_(false), type_(ClientDownloadRequest::WIN_EXECUTABLE), start_time_(base::TimeTicks::Now()), + skipped_url_whitelist_(false), + skipped_certificate_whitelist_(false), + is_extended_reporting_(false), + is_incognito_(false), weakptr_factory_(this) { DCHECK_CURRENTLY_ON(BrowserThread::UI); item_->AddObserver(this); @@ -303,6 +310,14 @@ DVLOG(2) << "Starting SafeBrowsing download check for: " << item_->DebugString(true); DCHECK_CURRENTLY_ON(BrowserThread::UI); + if (item_->GetBrowserContext()) { + Profile* profile = + Profile::FromBrowserContext(item_->GetBrowserContext()); + is_extended_reporting_ = profile && + profile->GetPrefs()->GetBoolean( + prefs::kSafeBrowsingExtendedReportingEnabled); + is_incognito_ = item_->GetBrowserContext()->IsOffTheRecord(); + } // TODO(noelutz): implement some cache to make sure we don't issue the same // request over and over again if a user downloads the same binary multiple // times. @@ -733,6 +748,13 @@ WHITELIST_TYPE_MAX); } + virtual bool ShouldSampleWhitelistedDownload() { + // We currently sample 1% whitelisted downloads from users who opted + // in extended reporting and are not in incognito mode. + return service_ && is_extended_reporting_ && !is_incognito_ && + base::RandDouble() < service_->whitelist_sample_rate(); + } + void CheckWhitelists() { DCHECK_CURRENTLY_ON(BrowserThread::IO); @@ -746,23 +768,33 @@ if (url.is_valid() && database_manager_->MatchDownloadWhitelistUrl(url)) { DVLOG(2) << url << " is on the download whitelist."; RecordCountOfWhitelistedDownload(URL_WHITELIST); - // TODO(grt): Continue processing without uploading so that - // ClientDownloadRequest callbacks can be run even for this type of safe - // download. - PostFinishTask(SAFE, REASON_WHITELISTED_URL); - return; + if (ShouldSampleWhitelistedDownload()) { + skipped_url_whitelist_ = true; + } else { + // TODO(grt): Continue processing without uploading so that + // ClientDownloadRequest callbacks can be run even for this type of safe + // download. + PostFinishTask(SAFE, REASON_WHITELISTED_URL); + return; + } } + bool should_sample_for_certificate = ShouldSampleWhitelistedDownload(); if (signature_info_.trusted()) { for (int i = 0; i < signature_info_.certificate_chain_size(); ++i) { if (CertificateChainIsWhitelisted( signature_info_.certificate_chain(i))) { RecordCountOfWhitelistedDownload(SIGNATURE_WHITELIST); - // TODO(grt): Continue processing without uploading so that - // ClientDownloadRequest callbacks can be run even for this type of - // safe download. - PostFinishTask(SAFE, REASON_TRUSTED_EXECUTABLE); - return; + if (should_sample_for_certificate) { + skipped_certificate_whitelist_ = true; + break; + } else { + // TODO(grt): Continue processing without uploading so that + // ClientDownloadRequest callbacks can be run even for this type of + // safe download. + PostFinishTask(SAFE, REASON_TRUSTED_EXECUTABLE); + return; + } } } } @@ -843,17 +875,9 @@ // before sending it. if (!service_) return; - bool is_extended_reporting = false; - if (item_->GetBrowserContext()) { - Profile* profile = - Profile::FromBrowserContext(item_->GetBrowserContext()); - is_extended_reporting = profile && - profile->GetPrefs()->GetBoolean( - prefs::kSafeBrowsingExtendedReportingEnabled); - } ClientDownloadRequest request; - if (is_extended_reporting) { + if (is_extended_reporting_) { request.mutable_population()->set_user_population( ChromeUserPopulation::EXTENDED_REPORTING); } else { @@ -863,6 +887,8 @@ request.set_url(SanitizeUrl(item_->GetUrlChain().back())); request.mutable_digests()->set_sha256(item_->GetHash()); request.set_length(item_->GetReceivedBytes()); + request.set_skipped_url_whitelist(true); + request.set_skipped_certificate_whitelist(true); for (size_t i = 0; i < item_->GetUrlChain().size(); ++i) { ClientDownloadRequest::Resource* resource = request.add_resources(); resource->set_url(SanitizeUrl(item_->GetUrlChain()[i])); @@ -1081,6 +1107,10 @@ base::TimeTicks start_time_; // Used for stats. base::TimeTicks timeout_start_time_; base::TimeTicks request_start_time_; + bool skipped_url_whitelist_; + bool skipped_certificate_whitelist_; + bool is_extended_reporting_; + bool is_incognito_; base::WeakPtrFactory<CheckClientDownloadRequest> weakptr_factory_; DISALLOW_COPY_AND_ASSIGN(CheckClientDownloadRequest); @@ -1095,7 +1125,8 @@ download_request_timeout_ms_(kDownloadRequestTimeoutMs), feedback_service_( new DownloadFeedbackService(request_context_getter_.get(), - BrowserThread::GetBlockingPool())) { + BrowserThread::GetBlockingPool())), + whitelist_sample_rate_(kWhitelistDownloadSampleRate) { if (sb_service) { ui_manager_ = sb_service->ui_manager(); database_manager_ = sb_service->database_manager();
diff --git a/chrome/browser/safe_browsing/download_protection_service.h b/chrome/browser/safe_browsing/download_protection_service.h index 7cddf1f..d15659a 100644 --- a/chrome/browser/safe_browsing/download_protection_service.h +++ b/chrome/browser/safe_browsing/download_protection_service.h
@@ -137,6 +137,10 @@ ClientDownloadRequestSubscription RegisterClientDownloadRequestCallback( const ClientDownloadRequestCallback& callback); + double whitelist_sample_rate() const { + return whitelist_sample_rate_; + } + protected: // Enum to keep track why a particular download verdict was chosen. // This is used to keep some stats around. @@ -173,7 +177,9 @@ friend class DownloadProtectionServiceTest; FRIEND_TEST_ALL_PREFIXES(DownloadProtectionServiceTest, - CheckClientDownloadWhitelistedUrl); + CheckClientDownloadWhitelistedUrlWithoutSampling); + FRIEND_TEST_ALL_PREFIXES(DownloadProtectionServiceTest, + CheckClientDownloadWhitelistedUrlWithSampling); FRIEND_TEST_ALL_PREFIXES(DownloadProtectionServiceTest, CheckClientDownloadValidateRequest); FRIEND_TEST_ALL_PREFIXES(DownloadProtectionServiceTest, @@ -246,6 +252,9 @@ // Normally empty. std::set<std::string> manual_blacklist_hashes_; + // Rate of whitelisted downloads we sample to send out download ping. + double whitelist_sample_rate_; + DISALLOW_COPY_AND_ASSIGN(DownloadProtectionService); }; } // namespace safe_browsing
diff --git a/chrome/browser/safe_browsing/download_protection_service_unittest.cc b/chrome/browser/safe_browsing/download_protection_service_unittest.cc index 9262f807..e5bc6825 100644 --- a/chrome/browser/safe_browsing/download_protection_service_unittest.cc +++ b/chrome/browser/safe_browsing/download_protection_service_unittest.cc
@@ -49,6 +49,7 @@ #include "net/http/http_status_code.h" #include "net/url_request/test_url_fetcher_factory.h" #include "net/url_request/url_fetcher_delegate.h" +#include "net/url_request/url_fetcher_impl.h" #include "net/url_request/url_request_status.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" @@ -280,6 +281,10 @@ sb_service_ = NULL; } + void SetWhitelistedDownloadSampleRate(double target_rate) { + download_service_->whitelist_sample_rate_ = target_rate; + } + bool RequestContainsResource(const ClientDownloadRequest& request, ClientDownloadRequest::ResourceType type, const std::string& url, @@ -362,6 +367,49 @@ void ClearClientDownloadRequest() { last_client_download_request_.reset(); } + void PrepareResponse(net::FakeURLFetcherFactory* factory, + ClientDownloadResponse::Verdict verdict, + net::HttpStatusCode response_code, + net::URLRequestStatus::Status status) { + ClientDownloadResponse response; + response.set_verdict(verdict); + factory->SetFakeResponse( + DownloadProtectionService::GetDownloadRequestUrl(), + response.SerializeAsString(), + response_code, status); + } + + void PrepareBasicDownloadItem( + content::MockDownloadItem* item, + const std::vector<std::string> url_chain_items, + const std::string& referrer_url, + const base::FilePath::StringType& tmp_path_literal, + const base::FilePath::StringType& final_path_literal) { + url_chain_.clear(); + for (std::string item: url_chain_items) + url_chain_.push_back(GURL(item)); + referrer_ = GURL(referrer_url); + tmp_path_ = base::FilePath( + base::FilePath::StringPieceType(tmp_path_literal)); + final_path_ = base::FilePath( + base::FilePath::StringPieceType(final_path_literal)); + hash_ = "hash"; + + EXPECT_CALL(*item, GetFullPath()).WillRepeatedly(ReturnRef(tmp_path_)); + EXPECT_CALL(*item, GetTargetFilePath()) + .WillRepeatedly(ReturnRef(final_path_)); + EXPECT_CALL(*item, GetUrlChain()).WillRepeatedly(ReturnRef(url_chain_)); + EXPECT_CALL(*item, GetReferrerUrl()).WillRepeatedly(ReturnRef(referrer_)); + EXPECT_CALL(*item, GetTabUrl()) + .WillRepeatedly(ReturnRef(GURL::EmptyGURL())); + EXPECT_CALL(*item, GetTabReferrerUrl()) + .WillRepeatedly(ReturnRef(GURL::EmptyGURL())); + EXPECT_CALL(*item, GetHash()).WillRepeatedly(ReturnRef(hash_)); + EXPECT_CALL(*item, GetReceivedBytes()).WillRepeatedly(Return(100)); + EXPECT_CALL(*item, HasUserGesture()).WillRepeatedly(Return(true)); + EXPECT_CALL(*item, GetRemoteAddress()).WillRepeatedly(Return("")); + } + private: // Helper functions for FlushThreadMessageLoops. void RunAllPendingAndQuitUI() { @@ -428,6 +476,13 @@ testing::AssertionFailure() << "Expected " << expected << ", got " << result_; } + + void SetExtendedReportingPreference(bool is_extended_reporting) { + profile_->GetPrefs()->SetBoolean( + prefs::kSafeBrowsingExtendedReportingEnabled, + is_extended_reporting); + } + // Check scenarios where we should/shouldn't send a report for // a corrupted zip. void CheckClientDownloadReportCorruptZip(bool is_extended_reporting, @@ -448,45 +503,33 @@ std::unique_ptr<ClientDownloadRequest> last_client_download_request_; base::ScopedTempDir profile_dir_; std::unique_ptr<TestingProfile> profile_; + // The following 5 fields are used by PrepareBasicDownloadItem() function to + // store attributes of the last download item. + std::vector<GURL> url_chain_; + GURL referrer_; + base::FilePath tmp_path_; + base::FilePath final_path_; + std::string hash_; }; void DownloadProtectionServiceTest::CheckClientDownloadReportCorruptZip( bool is_extended_reporting, bool is_incognito) { - ClientDownloadResponse response; - response.set_verdict(ClientDownloadResponse::SAFE); net::FakeURLFetcherFactory factory(NULL); - // Empty response means SAFE. - factory.SetFakeResponse( - DownloadProtectionService::GetDownloadRequestUrl(), - response.SerializeAsString(), - net::HTTP_OK, net::URLRequestStatus::SUCCESS); + PrepareResponse( + &factory, ClientDownloadResponse::SAFE, net::HTTP_OK, + net::URLRequestStatus::SUCCESS); - base::ScopedTempDir download_dir; - ASSERT_TRUE(download_dir.CreateUniqueTempDir()); - - base::FilePath a_tmp(download_dir.path().Append(FILE_PATH_LITERAL("a.tmp"))); - base::FilePath a_zip(FILE_PATH_LITERAL("a.zip")); - std::vector<GURL> url_chain; - url_chain.push_back(GURL("http://www.evil.com/a.zip")); - GURL referrer("http://www.google.com/"); - std::string hash = "hash"; profile_->GetPrefs()->SetBoolean(prefs::kSafeBrowsingExtendedReportingEnabled, is_extended_reporting); - content::MockDownloadItem item; - EXPECT_CALL(item, GetFullPath()).WillRepeatedly(ReturnRef(a_tmp)); - EXPECT_CALL(item, GetTargetFilePath()).WillRepeatedly(ReturnRef(a_zip)); - EXPECT_CALL(item, GetUrlChain()).WillRepeatedly(ReturnRef(url_chain)); - EXPECT_CALL(item, GetReferrerUrl()).WillRepeatedly(ReturnRef(referrer)); - EXPECT_CALL(item, GetTabUrl()).WillRepeatedly(ReturnRef(GURL::EmptyGURL())); - EXPECT_CALL(item, GetTabReferrerUrl()) - .WillRepeatedly(ReturnRef(GURL::EmptyGURL())); - EXPECT_CALL(item, GetHash()).WillRepeatedly(ReturnRef(hash)); - EXPECT_CALL(item, GetReceivedBytes()).WillRepeatedly(Return(100)); - EXPECT_CALL(item, HasUserGesture()).WillRepeatedly(Return(true)); - EXPECT_CALL(item, GetRemoteAddress()).WillRepeatedly(Return("")); + PrepareBasicDownloadItem( + &item, + {"http://www.evil.com/a.zip"}, // url_chain + "http://www.google.com/", // referrer + FILE_PATH_LITERAL("a.tmp"), // tmp_path + FILE_PATH_LITERAL("a.zip")); // final_path if (is_incognito) { EXPECT_CALL(item, GetBrowserContext()) @@ -498,7 +541,7 @@ std::string file_contents = "corrupt zip file"; ASSERT_EQ(static_cast<int>(file_contents.size()), base::WriteFile( - a_tmp, file_contents.data(), file_contents.size())); + tmp_path_, file_contents.data(), file_contents.size())); download_service_->CheckClientDownload( &item, @@ -526,21 +569,13 @@ TEST_F(DownloadProtectionServiceTest, CheckClientDownloadInvalidUrl) { - base::FilePath a_tmp(FILE_PATH_LITERAL("a.tmp")); - base::FilePath a_exe(FILE_PATH_LITERAL("a.exe")); - std::vector<GURL> url_chain; - GURL referrer("http://www.google.com/"); - std::string hash = "hash"; - content::MockDownloadItem item; - EXPECT_CALL(item, GetFullPath()).WillRepeatedly(ReturnRef(a_tmp)); - EXPECT_CALL(item, GetTargetFilePath()).WillRepeatedly(ReturnRef(a_exe)); - EXPECT_CALL(item, GetUrlChain()).WillRepeatedly(ReturnRef(url_chain)); - EXPECT_CALL(item, GetReferrerUrl()).WillRepeatedly(ReturnRef(referrer)); - EXPECT_CALL(item, GetHash()).WillRepeatedly(ReturnRef(hash)); - EXPECT_CALL(item, GetTabUrl()).WillRepeatedly(ReturnRef(GURL::EmptyGURL())); - EXPECT_CALL(item, GetTabReferrerUrl()) - .WillRepeatedly(ReturnRef(GURL::EmptyGURL())); + PrepareBasicDownloadItem( + &item, + std::vector<std::string>(), // empty url_chain + "http://www.google.com/", // referrer + FILE_PATH_LITERAL("a.tmp"), // tmp_path + FILE_PATH_LITERAL("a.exe")); // final_path download_service_->CheckClientDownload( &item, base::Bind(&DownloadProtectionServiceTest::CheckDoneCallback, @@ -550,15 +585,12 @@ EXPECT_FALSE(HasClientDownloadRequest()); Mock::VerifyAndClearExpectations(&item); - url_chain.push_back(GURL("file://www.google.com/")); - EXPECT_CALL(item, GetFullPath()).WillRepeatedly(ReturnRef(a_tmp)); - EXPECT_CALL(item, GetTargetFilePath()).WillRepeatedly(ReturnRef(a_exe)); - EXPECT_CALL(item, GetUrlChain()).WillRepeatedly(ReturnRef(url_chain)); - EXPECT_CALL(item, GetReferrerUrl()).WillRepeatedly(ReturnRef(referrer)); - EXPECT_CALL(item, GetHash()).WillRepeatedly(ReturnRef(hash)); - EXPECT_CALL(item, GetTabUrl()).WillRepeatedly(ReturnRef(GURL::EmptyGURL())); - EXPECT_CALL(item, GetTabReferrerUrl()) - .WillRepeatedly(ReturnRef(GURL::EmptyGURL())); + PrepareBasicDownloadItem( + &item, + {"file://www.google.com/"}, // url_chain + "http://www.google.com/", // referrer + FILE_PATH_LITERAL("a.tmp"), // tmp_path + FILE_PATH_LITERAL("a.exe")); // final_path download_service_->CheckClientDownload( &item, base::Bind(&DownloadProtectionServiceTest::CheckDoneCallback, @@ -569,22 +601,13 @@ } TEST_F(DownloadProtectionServiceTest, CheckClientDownloadNotABinary) { - base::FilePath a_tmp(FILE_PATH_LITERAL("a.tmp")); - base::FilePath a_txt(FILE_PATH_LITERAL("a.txt")); - std::vector<GURL> url_chain; - GURL referrer("http://www.google.com/"); - std::string hash = "hash"; - content::MockDownloadItem item; - url_chain.push_back(GURL("http://www.example.com/foo")); - EXPECT_CALL(item, GetFullPath()).WillRepeatedly(ReturnRef(a_tmp)); - EXPECT_CALL(item, GetTargetFilePath()).WillRepeatedly(ReturnRef(a_txt)); - EXPECT_CALL(item, GetUrlChain()).WillRepeatedly(ReturnRef(url_chain)); - EXPECT_CALL(item, GetReferrerUrl()).WillRepeatedly(ReturnRef(referrer)); - EXPECT_CALL(item, GetHash()).WillRepeatedly(ReturnRef(hash)); - EXPECT_CALL(item, GetTabUrl()).WillRepeatedly(ReturnRef(GURL::EmptyGURL())); - EXPECT_CALL(item, GetTabReferrerUrl()) - .WillRepeatedly(ReturnRef(GURL::EmptyGURL())); + PrepareBasicDownloadItem( + &item, + std::vector<std::string>(), // empty url_chain + "http://www.google.com/", // referrer + FILE_PATH_LITERAL("a.tmp"), // tmp_path + FILE_PATH_LITERAL("a.txt")); // final_path download_service_->CheckClientDownload( &item, base::Bind(&DownloadProtectionServiceTest::CheckDoneCallback, @@ -594,39 +617,27 @@ EXPECT_FALSE(HasClientDownloadRequest()); } -TEST_F(DownloadProtectionServiceTest, CheckClientDownloadWhitelistedUrl) { +TEST_F(DownloadProtectionServiceTest, + CheckClientDownloadWhitelistedUrlWithoutSampling) { // Response to any requests will be DANGEROUS. - ClientDownloadResponse response; - response.set_verdict(ClientDownloadResponse::DANGEROUS); net::FakeURLFetcherFactory factory(NULL); - factory.SetFakeResponse( - DownloadProtectionService::GetDownloadRequestUrl(), - response.SerializeAsString(), - net::HTTP_OK, net::URLRequestStatus::SUCCESS); - - std::string hash = "hash"; - base::FilePath a_tmp(FILE_PATH_LITERAL("a.tmp")); - base::FilePath a_exe(FILE_PATH_LITERAL("a.exe")); - std::vector<GURL> url_chain; - GURL referrer; + PrepareResponse( + &factory, ClientDownloadResponse::DANGEROUS, net::HTTP_OK, + net::URLRequestStatus::SUCCESS); content::MockDownloadItem item; - EXPECT_CALL(item, GetFullPath()).WillRepeatedly(ReturnRef(a_tmp)); - EXPECT_CALL(item, GetTargetFilePath()).WillRepeatedly(ReturnRef(a_exe)); - EXPECT_CALL(item, GetUrlChain()).WillRepeatedly(ReturnRef(url_chain)); - EXPECT_CALL(item, GetReferrerUrl()).WillRepeatedly(ReturnRef(referrer)); - EXPECT_CALL(item, GetTabUrl()).WillRepeatedly(ReturnRef(GURL::EmptyGURL())); - EXPECT_CALL(item, GetTabReferrerUrl()) - .WillRepeatedly(ReturnRef(GURL::EmptyGURL())); - EXPECT_CALL(item, GetHash()).WillRepeatedly(ReturnRef(hash)); - EXPECT_CALL(item, GetReceivedBytes()).WillRepeatedly(Return(100)); - EXPECT_CALL(item, HasUserGesture()).WillRepeatedly(Return(true)); - EXPECT_CALL(item, GetRemoteAddress()).WillRepeatedly(Return("")); - EXPECT_CALL(*binary_feature_extractor_.get(), CheckSignature(a_tmp, _)) + PrepareBasicDownloadItem( + &item, + std::vector<std::string>(), // empty url_chain + "", // referrer + FILE_PATH_LITERAL("a.tmp"), // tmp_path + FILE_PATH_LITERAL("a.exe")); // final_path + + EXPECT_CALL(*binary_feature_extractor_.get(), CheckSignature(tmp_path_, _)) .Times(4); EXPECT_CALL(*binary_feature_extractor_.get(), ExtractImageFeatures( - a_tmp, BinaryFeatureExtractor::kDefaultOptions, _, _)) + tmp_path_, BinaryFeatureExtractor::kDefaultOptions, _, _)) .Times(4); // We should not get whilelist checks for other URLs than specified below. @@ -640,7 +651,9 @@ .WillRepeatedly(Return(true)); // With no referrer and just the bad url, should be marked DANGEROUS. - url_chain.push_back(GURL("http://www.evil.com/bla.exe")); + url_chain_.push_back(GURL("http://www.evil.com/bla.exe")); + // Set sample rate to 0 to prevent sampling. + SetWhitelistedDownloadSampleRate(0); download_service_->CheckClientDownload( &item, base::Bind(&DownloadProtectionServiceTest::CheckDoneCallback, @@ -652,7 +665,7 @@ ClearClientDownloadRequest(); // Check that the referrer is not matched against the whitelist. - referrer = GURL("http://www.google.com/"); + referrer_ = GURL("http://www.google.com/"); download_service_->CheckClientDownload( &item, base::Bind(&DownloadProtectionServiceTest::CheckDoneCallback, @@ -664,7 +677,7 @@ ClearClientDownloadRequest(); // Redirect from a site shouldn't be checked either. - url_chain.insert(url_chain.begin(), GURL("http://www.google.com/redirect")); + url_chain_.insert(url_chain_.begin(), GURL("http://www.google.com/redirect")); download_service_->CheckClientDownload( &item, base::Bind(&DownloadProtectionServiceTest::CheckDoneCallback, @@ -676,7 +689,7 @@ ClearClientDownloadRequest(); // Only if the final url is whitelisted should it be SAFE. - url_chain.push_back(GURL("http://www.google.com/a.exe")); + url_chain_.push_back(GURL("http://www.google.com/a.exe")); download_service_->CheckClientDownload( &item, base::Bind(&DownloadProtectionServiceTest::CheckDoneCallback, @@ -688,40 +701,113 @@ EXPECT_FALSE(HasClientDownloadRequest()); } -TEST_F(DownloadProtectionServiceTest, CheckClientDownloadFetchFailed) { +TEST_F(DownloadProtectionServiceTest, + CheckClientDownloadWhitelistedUrlWithSampling) { + // Server responses "SAFE" to every requests coming from whitelisted + // download. net::FakeURLFetcherFactory factory(NULL); - // HTTP request will fail. - factory.SetFakeResponse( - DownloadProtectionService::GetDownloadRequestUrl(), std::string(), - net::HTTP_INTERNAL_SERVER_ERROR, net::URLRequestStatus::FAILED); - - base::FilePath a_tmp(FILE_PATH_LITERAL("a.tmp")); - base::FilePath a_exe(FILE_PATH_LITERAL("a.exe")); - std::vector<GURL> url_chain; - url_chain.push_back(GURL("http://www.evil.com/a.exe")); - GURL referrer("http://www.google.com/"); - std::string hash = "hash"; + PrepareResponse( + &factory, ClientDownloadResponse::SAFE, net::HTTP_OK, + net::URLRequestStatus::SUCCESS); content::MockDownloadItem item; - EXPECT_CALL(item, GetFullPath()).WillRepeatedly(ReturnRef(a_tmp)); - EXPECT_CALL(item, GetTargetFilePath()).WillRepeatedly(ReturnRef(a_exe)); - EXPECT_CALL(item, GetUrlChain()).WillRepeatedly(ReturnRef(url_chain)); - EXPECT_CALL(item, GetReferrerUrl()).WillRepeatedly(ReturnRef(referrer)); - EXPECT_CALL(item, GetTabUrl()).WillRepeatedly(ReturnRef(GURL::EmptyGURL())); - EXPECT_CALL(item, GetTabReferrerUrl()) - .WillRepeatedly(ReturnRef(GURL::EmptyGURL())); - EXPECT_CALL(item, GetHash()).WillRepeatedly(ReturnRef(hash)); - EXPECT_CALL(item, GetReceivedBytes()).WillRepeatedly(Return(100)); - EXPECT_CALL(item, HasUserGesture()).WillRepeatedly(Return(true)); - EXPECT_CALL(item, GetRemoteAddress()).WillRepeatedly(Return("")); + PrepareBasicDownloadItem( + &item, + std::vector<std::string>(), // empty url_chain + "http://www.google.com/", // referrer + FILE_PATH_LITERAL("a.tmp"), // tmp_path + FILE_PATH_LITERAL("a.exe")); // final_path + EXPECT_CALL(*binary_feature_extractor_.get(), CheckSignature(tmp_path_, _)) + .Times(4); + EXPECT_CALL(*binary_feature_extractor_.get(), + ExtractImageFeatures( + tmp_path_, BinaryFeatureExtractor::kDefaultOptions, _, _)) + .Times(4); + // Assume http://www.whitelist.com/a.exe is on the whitelist. + EXPECT_CALL(*sb_service_->mock_database_manager(), + MatchDownloadWhitelistUrl(_)).Times(0); + EXPECT_CALL(*sb_service_->mock_database_manager(), + MatchDownloadWhitelistUrl(GURL("http://www.whitelist.com/a.exe"))) + .WillRepeatedly(Return(true)); + url_chain_.push_back(GURL("http://www.whitelist.com/a.exe")); + // Set sample rate to 1.00, so download_service_ will always send download + // pings for whitelisted downloads. + SetWhitelistedDownloadSampleRate(1.00); + // Case (1): is_extended_reporting && is_incognito. + // ClientDownloadRequest should NOT be sent. + SetExtendedReportingPreference(true); + EXPECT_CALL(item, GetBrowserContext()) + .WillRepeatedly(Return(profile_->GetOffTheRecordProfile())); + download_service_->CheckClientDownload( + &item, + base::Bind(&DownloadProtectionServiceTest::CheckDoneCallback, + base::Unretained(this))); + MessageLoop::current()->Run(); + EXPECT_TRUE(IsResult(DownloadProtectionService::SAFE)); + EXPECT_FALSE(HasClientDownloadRequest()); + + // Case (2): is_extended_reporting && !is_incognito. + // ClientDownloadRequest should be sent. + EXPECT_CALL(item, GetBrowserContext()) + .WillRepeatedly(Return(profile_.get())); + download_service_->CheckClientDownload( + &item, + base::Bind(&DownloadProtectionServiceTest::CheckDoneCallback, + base::Unretained(this))); + MessageLoop::current()->Run(); + EXPECT_TRUE(IsResult(DownloadProtectionService::SAFE)); + EXPECT_TRUE(HasClientDownloadRequest()); + EXPECT_TRUE(GetClientDownloadRequest()->skipped_url_whitelist()); + ClearClientDownloadRequest(); + + // Case (3): !is_extended_reporting && is_incognito. + // ClientDownloadRequest should NOT be sent. + SetExtendedReportingPreference(false); + EXPECT_CALL(item, GetBrowserContext()) + .WillRepeatedly(Return(profile_->GetOffTheRecordProfile())); + download_service_->CheckClientDownload( + &item, + base::Bind(&DownloadProtectionServiceTest::CheckDoneCallback, + base::Unretained(this))); + MessageLoop::current()->Run(); + EXPECT_TRUE(IsResult(DownloadProtectionService::SAFE)); + EXPECT_FALSE(HasClientDownloadRequest()); + + // Case (4): !is_extended_reporting && !is_incognito. + // ClientDownloadRequest should NOT be sent. + EXPECT_CALL(item, GetBrowserContext()) + .WillRepeatedly(Return(profile_.get())); + download_service_->CheckClientDownload( + &item, + base::Bind(&DownloadProtectionServiceTest::CheckDoneCallback, + base::Unretained(this))); + MessageLoop::current()->Run(); + EXPECT_TRUE(IsResult(DownloadProtectionService::SAFE)); + EXPECT_FALSE(HasClientDownloadRequest()); +} + +TEST_F(DownloadProtectionServiceTest, CheckClientDownloadFetchFailed) { + // HTTP request will fail. + net::FakeURLFetcherFactory factory(NULL); + PrepareResponse( + &factory, ClientDownloadResponse::SAFE, net::HTTP_INTERNAL_SERVER_ERROR, + net::URLRequestStatus::FAILED); + + content::MockDownloadItem item; + PrepareBasicDownloadItem( + &item, + {"http://www.evil.com/a.exe"}, // url_chain + "http://www.google.com/", // referrer + FILE_PATH_LITERAL("a.tmp"), // tmp_path + FILE_PATH_LITERAL("a.exe")); // final_path EXPECT_CALL(*sb_service_->mock_database_manager(), MatchDownloadWhitelistUrl(_)) .WillRepeatedly(Return(false)); - EXPECT_CALL(*binary_feature_extractor_.get(), CheckSignature(a_tmp, _)); + EXPECT_CALL(*binary_feature_extractor_.get(), CheckSignature(tmp_path_, _)); EXPECT_CALL( *binary_feature_extractor_.get(), - ExtractImageFeatures(a_tmp, BinaryFeatureExtractor::kDefaultOptions, + ExtractImageFeatures(tmp_path_, BinaryFeatureExtractor::kDefaultOptions, _, _)); download_service_->CheckClientDownload( @@ -733,43 +819,27 @@ } TEST_F(DownloadProtectionServiceTest, CheckClientDownloadSuccess) { - ClientDownloadResponse response; - response.set_verdict(ClientDownloadResponse::SAFE); net::FakeURLFetcherFactory factory(NULL); - // Empty response means SAFE. - factory.SetFakeResponse( - DownloadProtectionService::GetDownloadRequestUrl(), - response.SerializeAsString(), - net::HTTP_OK, net::URLRequestStatus::SUCCESS); - - base::FilePath a_tmp(FILE_PATH_LITERAL("a.tmp")); - base::FilePath a_exe(FILE_PATH_LITERAL("a.exe")); - std::vector<GURL> url_chain; - url_chain.push_back(GURL("http://www.evil.com/a.exe")); - GURL referrer("http://www.google.com/"); - std::string hash = "hash"; + PrepareResponse( + &factory, ClientDownloadResponse::SAFE, net::HTTP_OK, + net::URLRequestStatus::SUCCESS); content::MockDownloadItem item; - EXPECT_CALL(item, GetFullPath()).WillRepeatedly(ReturnRef(a_tmp)); - EXPECT_CALL(item, GetTargetFilePath()).WillRepeatedly(ReturnRef(a_exe)); - EXPECT_CALL(item, GetUrlChain()).WillRepeatedly(ReturnRef(url_chain)); - EXPECT_CALL(item, GetReferrerUrl()).WillRepeatedly(ReturnRef(referrer)); - EXPECT_CALL(item, GetTabUrl()).WillRepeatedly(ReturnRef(GURL::EmptyGURL())); - EXPECT_CALL(item, GetTabReferrerUrl()) - .WillRepeatedly(ReturnRef(GURL::EmptyGURL())); - EXPECT_CALL(item, GetHash()).WillRepeatedly(ReturnRef(hash)); - EXPECT_CALL(item, GetReceivedBytes()).WillRepeatedly(Return(100)); - EXPECT_CALL(item, HasUserGesture()).WillRepeatedly(Return(true)); - EXPECT_CALL(item, GetRemoteAddress()).WillRepeatedly(Return("")); + PrepareBasicDownloadItem( + &item, + {"http://www.evil.com/a.exe"}, // url_chain + "http://www.google.com/", // referrer + FILE_PATH_LITERAL("a.tmp"), // tmp_path + FILE_PATH_LITERAL("a.exe")); // final_path EXPECT_CALL(*sb_service_->mock_database_manager(), MatchDownloadWhitelistUrl(_)) .WillRepeatedly(Return(false)); - EXPECT_CALL(*binary_feature_extractor_.get(), CheckSignature(a_tmp, _)) + EXPECT_CALL(*binary_feature_extractor_.get(), CheckSignature(tmp_path_, _)) .Times(6); EXPECT_CALL(*binary_feature_extractor_.get(), ExtractImageFeatures( - a_tmp, BinaryFeatureExtractor::kDefaultOptions, _, _)) + tmp_path_, BinaryFeatureExtractor::kDefaultOptions, _, _)) .Times(6); download_service_->CheckClientDownload( @@ -783,10 +853,10 @@ ClearClientDownloadRequest(); // Invalid response should result in UNKNOWN. - response.Clear(); + ClientDownloadResponse invalid_response; factory.SetFakeResponse( DownloadProtectionService::GetDownloadRequestUrl(), - response.SerializePartialAsString(), + invalid_response.SerializePartialAsString(), net::HTTP_OK, net::URLRequestStatus::SUCCESS); download_service_->CheckClientDownload( @@ -803,11 +873,9 @@ item, &feedback_ping, &feedback_response)); // If the response is dangerous the result should also be marked as dangerous. - response.set_verdict(ClientDownloadResponse::DANGEROUS); - factory.SetFakeResponse( - DownloadProtectionService::GetDownloadRequestUrl(), - response.SerializeAsString(), - net::HTTP_OK, net::URLRequestStatus::SUCCESS); + PrepareResponse( + &factory, ClientDownloadResponse::DANGEROUS, net::HTTP_OK, + net::URLRequestStatus::SUCCESS); download_service_->CheckClientDownload( &item, @@ -822,11 +890,9 @@ ClearClientDownloadRequest(); // If the response is uncommon the result should also be marked as uncommon. - response.set_verdict(ClientDownloadResponse::UNCOMMON); - factory.SetFakeResponse( - DownloadProtectionService::GetDownloadRequestUrl(), - response.SerializeAsString(), - net::HTTP_OK, net::URLRequestStatus::SUCCESS); + PrepareResponse( + &factory, ClientDownloadResponse::UNCOMMON, net::HTTP_OK, + net::URLRequestStatus::SUCCESS); download_service_->CheckClientDownload( &item, @@ -838,18 +904,18 @@ item, &feedback_ping, &feedback_response)); ClientDownloadRequest decoded_request; EXPECT_TRUE(decoded_request.ParseFromString(feedback_ping)); - EXPECT_EQ(url_chain.back().spec(), decoded_request.url()); - EXPECT_EQ(response.SerializeAsString(), feedback_response); + EXPECT_EQ(url_chain_.back().spec(), decoded_request.url()); + ClientDownloadResponse expected_response; + expected_response.set_verdict(ClientDownloadResponse::UNCOMMON); + EXPECT_EQ(expected_response.SerializeAsString(), feedback_response); EXPECT_TRUE(HasClientDownloadRequest()); ClearClientDownloadRequest(); // If the response is dangerous_host the result should also be marked as // dangerous_host. - response.set_verdict(ClientDownloadResponse::DANGEROUS_HOST); - factory.SetFakeResponse( - DownloadProtectionService::GetDownloadRequestUrl(), - response.SerializeAsString(), - net::HTTP_OK, net::URLRequestStatus::SUCCESS); + PrepareResponse( + &factory, ClientDownloadResponse::DANGEROUS_HOST, net::HTTP_OK, + net::URLRequestStatus::SUCCESS); download_service_->CheckClientDownload( &item, @@ -859,17 +925,16 @@ EXPECT_TRUE(IsResult(DownloadProtectionService::DANGEROUS_HOST)); EXPECT_TRUE(DownloadFeedbackService::GetPingsForDownloadForTesting( item, &feedback_ping, &feedback_response)); - EXPECT_EQ(response.SerializeAsString(), feedback_response); + expected_response.set_verdict(ClientDownloadResponse::DANGEROUS_HOST); + EXPECT_EQ(expected_response.SerializeAsString(), feedback_response); EXPECT_TRUE(HasClientDownloadRequest()); ClearClientDownloadRequest(); // If the response is POTENTIALLY_UNWANTED the result should also be marked as // POTENTIALLY_UNWANTED. - response.set_verdict(ClientDownloadResponse::POTENTIALLY_UNWANTED); - factory.SetFakeResponse( - DownloadProtectionService::GetDownloadRequestUrl(), - response.SerializeAsString(), - net::HTTP_OK, net::URLRequestStatus::SUCCESS); + PrepareResponse( + &factory, ClientDownloadResponse::POTENTIALLY_UNWANTED, net::HTTP_OK, + net::URLRequestStatus::SUCCESS); download_service_->CheckClientDownload( &item, @@ -883,42 +948,26 @@ } TEST_F(DownloadProtectionServiceTest, CheckClientDownloadHTTPS) { - ClientDownloadResponse response; - response.set_verdict(ClientDownloadResponse::DANGEROUS); net::FakeURLFetcherFactory factory(NULL); - factory.SetFakeResponse( - DownloadProtectionService::GetDownloadRequestUrl(), - response.SerializeAsString(), - net::HTTP_OK, net::URLRequestStatus::SUCCESS); - - base::FilePath a_tmp(FILE_PATH_LITERAL("a.tmp")); - base::FilePath a_exe(FILE_PATH_LITERAL("a.exe")); - std::vector<GURL> url_chain; - url_chain.push_back(GURL("http://www.evil.com/a.exe")); - GURL referrer("http://www.google.com/"); - std::string hash = "hash"; + PrepareResponse( + &factory, ClientDownloadResponse::DANGEROUS, net::HTTP_OK, + net::URLRequestStatus::SUCCESS); content::MockDownloadItem item; - EXPECT_CALL(item, GetFullPath()).WillRepeatedly(ReturnRef(a_tmp)); - EXPECT_CALL(item, GetTargetFilePath()).WillRepeatedly(ReturnRef(a_exe)); - EXPECT_CALL(item, GetUrlChain()).WillRepeatedly(ReturnRef(url_chain)); - EXPECT_CALL(item, GetReferrerUrl()).WillRepeatedly(ReturnRef(referrer)); - EXPECT_CALL(item, GetTabUrl()).WillRepeatedly(ReturnRef(GURL::EmptyGURL())); - EXPECT_CALL(item, GetTabReferrerUrl()) - .WillRepeatedly(ReturnRef(GURL::EmptyGURL())); - EXPECT_CALL(item, GetHash()).WillRepeatedly(ReturnRef(hash)); - EXPECT_CALL(item, GetReceivedBytes()).WillRepeatedly(Return(100)); - EXPECT_CALL(item, HasUserGesture()).WillRepeatedly(Return(true)); - EXPECT_CALL(item, GetRemoteAddress()).WillRepeatedly(Return("")); + PrepareBasicDownloadItem(&item, + {"http://www.evil.com/a.exe"}, // url_chain + "http://www.google.com/", // referrer + FILE_PATH_LITERAL("a.tmp"), // tmp_path + FILE_PATH_LITERAL("a.exe")); // final_path EXPECT_CALL(*sb_service_->mock_database_manager(), MatchDownloadWhitelistUrl(_)) .WillRepeatedly(Return(false)); - EXPECT_CALL(*binary_feature_extractor_.get(), CheckSignature(a_tmp, _)) + EXPECT_CALL(*binary_feature_extractor_.get(), CheckSignature(tmp_path_, _)) .Times(1); EXPECT_CALL(*binary_feature_extractor_.get(), ExtractImageFeatures( - a_tmp, BinaryFeatureExtractor::kDefaultOptions, _, _)) + tmp_path_, BinaryFeatureExtractor::kDefaultOptions, _, _)) .Times(1); download_service_->CheckClientDownload( @@ -933,41 +982,26 @@ } TEST_F(DownloadProtectionServiceTest, CheckClientDownloadBlob) { - ClientDownloadResponse response; - response.set_verdict(ClientDownloadResponse::DANGEROUS); net::FakeURLFetcherFactory factory(NULL); - factory.SetFakeResponse(DownloadProtectionService::GetDownloadRequestUrl(), - response.SerializeAsString(), net::HTTP_OK, - net::URLRequestStatus::SUCCESS); - - base::FilePath a_tmp(FILE_PATH_LITERAL("a.tmp")); - base::FilePath a_exe(FILE_PATH_LITERAL("a.exe")); - std::vector<GURL> url_chain; - url_chain.push_back( - GURL("blob:http://www.evil.com/50b85f60-71e4-11e4-82f8-0800200c9a66")); - GURL referrer("http://www.google.com/"); - std::string hash = "hash"; + PrepareResponse( + &factory, ClientDownloadResponse::DANGEROUS, net::HTTP_OK, + net::URLRequestStatus::SUCCESS); content::MockDownloadItem item; - EXPECT_CALL(item, GetFullPath()).WillRepeatedly(ReturnRef(a_tmp)); - EXPECT_CALL(item, GetTargetFilePath()).WillRepeatedly(ReturnRef(a_exe)); - EXPECT_CALL(item, GetUrlChain()).WillRepeatedly(ReturnRef(url_chain)); - EXPECT_CALL(item, GetReferrerUrl()).WillRepeatedly(ReturnRef(referrer)); - EXPECT_CALL(item, GetTabUrl()).WillRepeatedly(ReturnRef(GURL::EmptyGURL())); - EXPECT_CALL(item, GetTabReferrerUrl()) - .WillRepeatedly(ReturnRef(GURL::EmptyGURL())); - EXPECT_CALL(item, GetHash()).WillRepeatedly(ReturnRef(hash)); - EXPECT_CALL(item, GetReceivedBytes()).WillRepeatedly(Return(100)); - EXPECT_CALL(item, HasUserGesture()).WillRepeatedly(Return(true)); - EXPECT_CALL(item, GetRemoteAddress()).WillRepeatedly(Return("")); + PrepareBasicDownloadItem( + &item, + {"blob:http://www.evil.com/50b85f60-71e4-11e4-82f8-0800200c9a66"}, + "http://www.google.com/", // referrer + FILE_PATH_LITERAL("a.tmp"), // tmp_path + FILE_PATH_LITERAL("a.exe")); // final_path EXPECT_CALL(*sb_service_->mock_database_manager(), MatchDownloadWhitelistUrl(_)).WillRepeatedly(Return(false)); - EXPECT_CALL(*binary_feature_extractor_.get(), CheckSignature(a_tmp, _)) + EXPECT_CALL(*binary_feature_extractor_.get(), CheckSignature(tmp_path_, _)) .Times(1); EXPECT_CALL(*binary_feature_extractor_.get(), ExtractImageFeatures( - a_tmp, BinaryFeatureExtractor::kDefaultOptions, _, _)) + tmp_path_, BinaryFeatureExtractor::kDefaultOptions, _, _)) .Times(1); download_service_->CheckClientDownload( @@ -982,45 +1016,27 @@ } TEST_F(DownloadProtectionServiceTest, CheckClientDownloadData) { - ClientDownloadResponse response; - response.set_verdict(ClientDownloadResponse::DANGEROUS); net::FakeURLFetcherFactory factory(NULL); - factory.SetFakeResponse(DownloadProtectionService::GetDownloadRequestUrl(), - response.SerializeAsString(), net::HTTP_OK, - net::URLRequestStatus::SUCCESS); - - base::FilePath a_tmp(FILE_PATH_LITERAL("a.tmp")); - base::FilePath a_exe(FILE_PATH_LITERAL("a.exe")); - std::vector<GURL> url_chain; - url_chain.push_back( - GURL("data:text/html:base64,")); - url_chain.push_back( - GURL("data:text/html:base64,blahblahblah")); - url_chain.push_back( - GURL("data:application/octet-stream:base64,blahblah")); - GURL referrer("data:text/html:base64,foobar"); - std::string hash = "hash"; + PrepareResponse( + &factory, ClientDownloadResponse::DANGEROUS, net::HTTP_OK, + net::URLRequestStatus::SUCCESS); content::MockDownloadItem item; - EXPECT_CALL(item, GetFullPath()).WillRepeatedly(ReturnRef(a_tmp)); - EXPECT_CALL(item, GetTargetFilePath()).WillRepeatedly(ReturnRef(a_exe)); - EXPECT_CALL(item, GetUrlChain()).WillRepeatedly(ReturnRef(url_chain)); - EXPECT_CALL(item, GetReferrerUrl()).WillRepeatedly(ReturnRef(referrer)); - EXPECT_CALL(item, GetTabUrl()).WillRepeatedly(ReturnRef(GURL::EmptyGURL())); - EXPECT_CALL(item, GetTabReferrerUrl()) - .WillRepeatedly(ReturnRef(GURL::EmptyGURL())); - EXPECT_CALL(item, GetHash()).WillRepeatedly(ReturnRef(hash)); - EXPECT_CALL(item, GetReceivedBytes()).WillRepeatedly(Return(100)); - EXPECT_CALL(item, HasUserGesture()).WillRepeatedly(Return(true)); - EXPECT_CALL(item, GetRemoteAddress()).WillRepeatedly(Return("")); + PrepareBasicDownloadItem( + &item, + {"data:text/html:base64,", "data:text/html:base64,blahblahblah", + "data:application/octet-stream:base64,blahblah"}, // url_chain + "data:text/html:base64,foobar", // referrer + FILE_PATH_LITERAL("a.tmp"), // tmp_path + FILE_PATH_LITERAL("a.exe")); // final_path EXPECT_CALL(*sb_service_->mock_database_manager(), MatchDownloadWhitelistUrl(_)).WillRepeatedly(Return(false)); - EXPECT_CALL(*binary_feature_extractor_.get(), CheckSignature(a_tmp, _)) + EXPECT_CALL(*binary_feature_extractor_.get(), CheckSignature(tmp_path_, _)) .Times(1); EXPECT_CALL(*binary_feature_extractor_.get(), ExtractImageFeatures( - a_tmp, BinaryFeatureExtractor::kDefaultOptions, _, _)) + tmp_path_, BinaryFeatureExtractor::kDefaultOptions, _, _)) .Times(1); download_service_->CheckClientDownload( @@ -1042,7 +1058,7 @@ const char kExpectedReferrer[] = "data:text/html:base64," "06E2C655B9F7130B508FFF86FD19B57E6BF1A1CFEFD6EFE1C3EB09FE24EF456A"; - EXPECT_EQ(hash, request.digests().sha256()); + EXPECT_EQ(hash_, request.digests().sha256()); EXPECT_EQ(kExpectedUrl, request.url()); EXPECT_EQ(3, request.resources_size()); EXPECT_TRUE(RequestContainsResource(request, @@ -1058,37 +1074,18 @@ } TEST_F(DownloadProtectionServiceTest, CheckClientDownloadZip) { - ClientDownloadResponse response; - response.set_verdict(ClientDownloadResponse::SAFE); net::FakeURLFetcherFactory factory(NULL); - // Empty response means SAFE. - factory.SetFakeResponse( - DownloadProtectionService::GetDownloadRequestUrl(), - response.SerializeAsString(), - net::HTTP_OK, net::URLRequestStatus::SUCCESS); - - base::ScopedTempDir download_dir; - ASSERT_TRUE(download_dir.CreateUniqueTempDir()); - - base::FilePath a_tmp(download_dir.path().Append(FILE_PATH_LITERAL("a.tmp"))); - base::FilePath a_zip(FILE_PATH_LITERAL("a.zip")); - std::vector<GURL> url_chain; - url_chain.push_back(GURL("http://www.evil.com/a.zip")); - GURL referrer("http://www.google.com/"); - std::string hash = "hash"; + PrepareResponse( + &factory, ClientDownloadResponse::SAFE, net::HTTP_OK, + net::URLRequestStatus::SUCCESS); content::MockDownloadItem item; - EXPECT_CALL(item, GetFullPath()).WillRepeatedly(ReturnRef(a_tmp)); - EXPECT_CALL(item, GetTargetFilePath()).WillRepeatedly(ReturnRef(a_zip)); - EXPECT_CALL(item, GetUrlChain()).WillRepeatedly(ReturnRef(url_chain)); - EXPECT_CALL(item, GetReferrerUrl()).WillRepeatedly(ReturnRef(referrer)); - EXPECT_CALL(item, GetTabUrl()).WillRepeatedly(ReturnRef(GURL::EmptyGURL())); - EXPECT_CALL(item, GetTabReferrerUrl()) - .WillRepeatedly(ReturnRef(GURL::EmptyGURL())); - EXPECT_CALL(item, GetHash()).WillRepeatedly(ReturnRef(hash)); - EXPECT_CALL(item, GetReceivedBytes()).WillRepeatedly(Return(100)); - EXPECT_CALL(item, HasUserGesture()).WillRepeatedly(Return(true)); - EXPECT_CALL(item, GetRemoteAddress()).WillRepeatedly(Return("")); + PrepareBasicDownloadItem( + &item, + {"http://www.evil.com/a.zip"}, // url_chain + "http://www.google.com/", // referrer + FILE_PATH_LITERAL("a.tmp"), // tmp_path + FILE_PATH_LITERAL("a.zip")); // final_path // Write out a zip archive to the temporary file. In this case, it // only contains a text file. @@ -1098,7 +1095,7 @@ ASSERT_EQ(static_cast<int>(file_contents.size()), base::WriteFile( zip_source_dir.path().Append(FILE_PATH_LITERAL("file.txt")), file_contents.data(), file_contents.size())); - ASSERT_TRUE(zip::Zip(zip_source_dir.path(), a_tmp, false)); + ASSERT_TRUE(zip::Zip(zip_source_dir.path(), tmp_path_, false)); download_service_->CheckClientDownload( &item, @@ -1114,7 +1111,7 @@ ASSERT_EQ(static_cast<int>(file_contents.size()), base::WriteFile( zip_source_dir.path().Append(FILE_PATH_LITERAL("file.exe")), file_contents.data(), file_contents.size())); - ASSERT_TRUE(zip::Zip(zip_source_dir.path(), a_tmp, false)); + ASSERT_TRUE(zip::Zip(zip_source_dir.path(), tmp_path_, false)); EXPECT_CALL(*sb_service_->mock_database_manager(), MatchDownloadWhitelistUrl(_)) @@ -1145,11 +1142,9 @@ // If the response is dangerous the result should also be marked as // dangerous. - response.set_verdict(ClientDownloadResponse::DANGEROUS); - factory.SetFakeResponse( - DownloadProtectionService::GetDownloadRequestUrl(), - response.SerializeAsString(), - net::HTTP_OK, net::URLRequestStatus::SUCCESS); + PrepareResponse( + &factory, ClientDownloadResponse::DANGEROUS, net::HTTP_OK, + net::URLRequestStatus::SUCCESS); download_service_->CheckClientDownload( &item, @@ -1168,7 +1163,7 @@ base::WriteFile( zip_source_dir.path().Append(FILE_PATH_LITERAL("file.rar")), file_contents.data(), file_contents.size())); - ASSERT_TRUE(zip::Zip(zip_source_dir.path(), a_tmp, false)); + ASSERT_TRUE(zip::Zip(zip_source_dir.path(), tmp_path_, false)); download_service_->CheckClientDownload( &item, base::Bind(&DownloadProtectionServiceTest::CheckDoneCallback, @@ -1186,7 +1181,7 @@ // Repeat the test with just the archive inside the zip file. ASSERT_TRUE( base::DeleteFile(zip_source_dir.path().AppendASCII("file.exe"), false)); - ASSERT_TRUE(zip::Zip(zip_source_dir.path(), a_tmp, false)); + ASSERT_TRUE(zip::Zip(zip_source_dir.path(), tmp_path_, false)); download_service_->CheckClientDownload( &item, base::Bind(&DownloadProtectionServiceTest::CheckDoneCallback, @@ -1221,49 +1216,33 @@ } TEST_F(DownloadProtectionServiceTest, CheckClientCrxDownloadSuccess) { - ClientDownloadResponse response; // Even if the server verdict is dangerous we should return SAFE because // DownloadProtectionService::IsSupportedDownload() will return false // for crx downloads. - response.set_verdict(ClientDownloadResponse::DANGEROUS); net::FakeURLFetcherFactory factory(NULL); - // Empty response means SAFE. - factory.SetFakeResponse( - DownloadProtectionService::GetDownloadRequestUrl(), - response.SerializeAsString(), - net::HTTP_OK, net::URLRequestStatus::SUCCESS); - - base::FilePath a_tmp(FILE_PATH_LITERAL("a.tmp")); - base::FilePath a_crx(FILE_PATH_LITERAL("a.crx")); - std::vector<GURL> url_chain; - url_chain.push_back(GURL("http://www.evil.com/a.crx")); - GURL referrer("http://www.google.com/"); - std::string hash = "hash"; + PrepareResponse( + &factory, ClientDownloadResponse::DANGEROUS, net::HTTP_OK, + net::URLRequestStatus::SUCCESS); content::MockDownloadItem item; - EXPECT_CALL(item, GetFullPath()).WillRepeatedly(ReturnRef(a_tmp)); - EXPECT_CALL(item, GetTargetFilePath()).WillRepeatedly(ReturnRef(a_crx)); - EXPECT_CALL(item, GetUrlChain()).WillRepeatedly(ReturnRef(url_chain)); - EXPECT_CALL(item, GetReferrerUrl()).WillRepeatedly(ReturnRef(referrer)); - EXPECT_CALL(item, GetTabUrl()).WillRepeatedly(ReturnRef(GURL::EmptyGURL())); - EXPECT_CALL(item, GetTabReferrerUrl()) - .WillRepeatedly(ReturnRef(GURL::EmptyGURL())); - EXPECT_CALL(item, GetHash()).WillRepeatedly(ReturnRef(hash)); - EXPECT_CALL(item, GetReceivedBytes()).WillRepeatedly(Return(100)); - EXPECT_CALL(item, HasUserGesture()).WillRepeatedly(Return(true)); - EXPECT_CALL(item, GetRemoteAddress()).WillRepeatedly(Return("")); + PrepareBasicDownloadItem( + &item, + {"http://www.evil.com/a.crx"}, // url_chain + "http://www.google.com/", // referrer + FILE_PATH_LITERAL("a.tmp"), // tmp_path + FILE_PATH_LITERAL("a.crx")); // final_path EXPECT_CALL(*sb_service_->mock_database_manager(), MatchDownloadWhitelistUrl(_)) .WillRepeatedly(Return(false)); - EXPECT_CALL(*binary_feature_extractor_.get(), CheckSignature(a_tmp, _)) + EXPECT_CALL(*binary_feature_extractor_.get(), CheckSignature(tmp_path_, _)) .Times(1); EXPECT_CALL(*binary_feature_extractor_.get(), ExtractImageFeatures( - a_tmp, BinaryFeatureExtractor::kDefaultOptions, _, _)) + tmp_path_, BinaryFeatureExtractor::kDefaultOptions, _, _)) .Times(1); - EXPECT_FALSE(download_service_->IsSupportedDownload(item, a_crx)); + EXPECT_FALSE(download_service_->IsSupportedDownload(item, final_path_)); download_service_->CheckClientDownload( &item, base::Bind(&DownloadProtectionServiceTest::CheckDoneCallback, @@ -1275,36 +1254,26 @@ TEST_F(DownloadProtectionServiceTest, CheckClientDownloadValidateRequest) { net::TestURLFetcherFactory factory; - base::FilePath tmp_path(FILE_PATH_LITERAL("bla.tmp")); - base::FilePath final_path(FILE_PATH_LITERAL("bla.exe")); - std::vector<GURL> url_chain; - url_chain.push_back(GURL("http://www.google.com/")); - url_chain.push_back(GURL("http://www.google.com/bla.exe")); - GURL referrer("http://www.google.com/"); - std::string hash = "hash"; - std::string remote_address = "10.11.12.13"; - content::MockDownloadItem item; - EXPECT_CALL(item, GetFullPath()).WillRepeatedly(ReturnRef(tmp_path)); - EXPECT_CALL(item, GetTargetFilePath()).WillRepeatedly(ReturnRef(final_path)); - EXPECT_CALL(item, GetUrlChain()).WillRepeatedly(ReturnRef(url_chain)); - EXPECT_CALL(item, GetReferrerUrl()).WillRepeatedly(ReturnRef(referrer)); - EXPECT_CALL(item, GetTabUrl()).WillRepeatedly(ReturnRef(GURL::EmptyGURL())); - EXPECT_CALL(item, GetTabReferrerUrl()) - .WillRepeatedly(ReturnRef(GURL::EmptyGURL())); - EXPECT_CALL(item, GetHash()).WillRepeatedly(ReturnRef(hash)); - EXPECT_CALL(item, GetReceivedBytes()).WillRepeatedly(Return(100)); - EXPECT_CALL(item, HasUserGesture()).WillRepeatedly(Return(true)); + PrepareBasicDownloadItem( + &item, + {"http://www.google.com/", + "http://www.google.com/bla.exe"}, // url_chain + "http://www.google.com/", // referrer + FILE_PATH_LITERAL("bla.tmp"), // tmp_path + FILE_PATH_LITERAL("bla.exe")); // final_path + + std::string remote_address = "10.11.12.13"; EXPECT_CALL(item, GetRemoteAddress()).WillRepeatedly(Return(remote_address)); EXPECT_CALL(*sb_service_->mock_database_manager(), MatchDownloadWhitelistUrl(_)) .WillRepeatedly(Return(false)); - EXPECT_CALL(*binary_feature_extractor_.get(), CheckSignature(tmp_path, _)) + EXPECT_CALL(*binary_feature_extractor_.get(), CheckSignature(tmp_path_, _)) .WillOnce(SetCertificateContents("dummy cert data")); EXPECT_CALL( *binary_feature_extractor_.get(), - ExtractImageFeatures(tmp_path, BinaryFeatureExtractor::kDefaultOptions, + ExtractImageFeatures(tmp_path_, BinaryFeatureExtractor::kDefaultOptions, _, _)) .WillOnce(SetDosHeaderContents("dummy dos header")); download_service_->CheckClientDownload( @@ -1321,7 +1290,7 @@ ClientDownloadRequest request; EXPECT_TRUE(request.ParseFromString(fetcher->upload_data())); EXPECT_EQ("http://www.google.com/bla.exe", request.url()); - EXPECT_EQ(hash, request.digests().sha256()); + EXPECT_EQ(hash_, request.digests().sha256()); EXPECT_EQ(item.GetReceivedBytes(), request.length()); EXPECT_EQ(item.HasUserGesture(), request.user_initiated()); EXPECT_TRUE(RequestContainsServerIp(request, remote_address)); @@ -1332,7 +1301,7 @@ EXPECT_TRUE(RequestContainsResource(request, ClientDownloadRequest::DOWNLOAD_URL, "http://www.google.com/bla.exe", - referrer.spec())); + referrer_.spec())); EXPECT_TRUE(request.has_signature()); ASSERT_EQ(1, request.signature().certificate_chain_size()); const ClientDownloadRequest_CertificateChain& chain = @@ -1359,34 +1328,23 @@ CheckClientDownloadValidateRequestNoSignature) { net::TestURLFetcherFactory factory; - base::FilePath tmp_path(FILE_PATH_LITERAL("bla.tmp")); - base::FilePath final_path(FILE_PATH_LITERAL("bla.exe")); - std::vector<GURL> url_chain; - url_chain.push_back(GURL("http://www.google.com/")); - url_chain.push_back(GURL("ftp://www.google.com/bla.exe")); - GURL referrer("http://www.google.com/"); - std::string hash = "hash"; - std::string remote_address = "10.11.12.13"; - content::MockDownloadItem item; - EXPECT_CALL(item, GetFullPath()).WillRepeatedly(ReturnRef(tmp_path)); - EXPECT_CALL(item, GetTargetFilePath()).WillRepeatedly(ReturnRef(final_path)); - EXPECT_CALL(item, GetUrlChain()).WillRepeatedly(ReturnRef(url_chain)); - EXPECT_CALL(item, GetReferrerUrl()).WillRepeatedly(ReturnRef(referrer)); - EXPECT_CALL(item, GetTabUrl()).WillRepeatedly(ReturnRef(GURL::EmptyGURL())); - EXPECT_CALL(item, GetTabReferrerUrl()) - .WillRepeatedly(ReturnRef(GURL::EmptyGURL())); - EXPECT_CALL(item, GetHash()).WillRepeatedly(ReturnRef(hash)); - EXPECT_CALL(item, GetReceivedBytes()).WillRepeatedly(Return(100)); - EXPECT_CALL(item, HasUserGesture()).WillRepeatedly(Return(true)); + PrepareBasicDownloadItem( + &item, + {"http://www.google.com/", + "ftp://www.google.com/bla.exe"}, // url_chain + "http://www.google.com/", // referrer + FILE_PATH_LITERAL("bla.tmp"), // tmp_path + FILE_PATH_LITERAL("bla.exe")); // final_path + std::string remote_address = "10.11.12.13"; EXPECT_CALL(item, GetRemoteAddress()).WillRepeatedly(Return(remote_address)); EXPECT_CALL(*sb_service_->mock_database_manager(), MatchDownloadWhitelistUrl(_)) .WillRepeatedly(Return(false)); - EXPECT_CALL(*binary_feature_extractor_.get(), CheckSignature(tmp_path, _)); + EXPECT_CALL(*binary_feature_extractor_.get(), CheckSignature(tmp_path_, _)); EXPECT_CALL(*binary_feature_extractor_.get(), - ExtractImageFeatures(tmp_path, + ExtractImageFeatures(tmp_path_, BinaryFeatureExtractor::kDefaultOptions, _, _)); download_service_->CheckClientDownload( @@ -1403,7 +1361,7 @@ ClientDownloadRequest request; EXPECT_TRUE(request.ParseFromString(fetcher->upload_data())); EXPECT_EQ("ftp://www.google.com/bla.exe", request.url()); - EXPECT_EQ(hash, request.digests().sha256()); + EXPECT_EQ(hash_, request.digests().sha256()); EXPECT_EQ(item.GetReceivedBytes(), request.length()); EXPECT_EQ(item.HasUserGesture(), request.user_initiated()); EXPECT_EQ(2, request.resources_size()); @@ -1413,7 +1371,7 @@ EXPECT_TRUE(RequestContainsResource(request, ClientDownloadRequest::DOWNLOAD_URL, "ftp://www.google.com/bla.exe", - referrer.spec())); + referrer_.spec())); EXPECT_TRUE(request.has_signature()); EXPECT_EQ(0, request.signature().certificate_chain_size()); @@ -1430,38 +1388,31 @@ CheckClientDownloadValidateRequestTabHistory) { net::TestURLFetcherFactory factory; - base::FilePath tmp_path(FILE_PATH_LITERAL("bla.tmp")); - base::FilePath final_path(FILE_PATH_LITERAL("bla.exe")); - std::vector<GURL> url_chain; - url_chain.push_back(GURL("http://www.google.com/")); - url_chain.push_back(GURL("http://www.google.com/bla.exe")); - GURL referrer("http://www.google.com/"); + content::MockDownloadItem item; + PrepareBasicDownloadItem( + &item, + {"http://www.google.com/", + "http://www.google.com/bla.exe"}, // url_chain + "http://www.google.com/", // referrer + FILE_PATH_LITERAL("bla.tmp"), // tmp_path + FILE_PATH_LITERAL("bla.exe")); // final_path + GURL tab_url("http://tab.com/final"); GURL tab_referrer("http://tab.com/referrer"); - std::string hash = "hash"; std::string remote_address = "10.11.12.13"; - - content::MockDownloadItem item; - EXPECT_CALL(item, GetFullPath()).WillRepeatedly(ReturnRef(tmp_path)); - EXPECT_CALL(item, GetTargetFilePath()).WillRepeatedly(ReturnRef(final_path)); - EXPECT_CALL(item, GetUrlChain()).WillRepeatedly(ReturnRef(url_chain)); - EXPECT_CALL(item, GetReferrerUrl()).WillRepeatedly(ReturnRef(referrer)); EXPECT_CALL(item, GetTabUrl()).WillRepeatedly(ReturnRef(tab_url)); EXPECT_CALL(item, GetTabReferrerUrl()) .WillRepeatedly(ReturnRef(tab_referrer)); - EXPECT_CALL(item, GetHash()).WillRepeatedly(ReturnRef(hash)); - EXPECT_CALL(item, GetReceivedBytes()).WillRepeatedly(Return(100)); - EXPECT_CALL(item, HasUserGesture()).WillRepeatedly(Return(true)); EXPECT_CALL(item, GetRemoteAddress()).WillRepeatedly(Return(remote_address)); EXPECT_CALL(item, GetBrowserContext()).WillRepeatedly(Return(profile_.get())); EXPECT_CALL(*sb_service_->mock_database_manager(), MatchDownloadWhitelistUrl(_)) .WillRepeatedly(Return(false)); - EXPECT_CALL(*binary_feature_extractor_.get(), CheckSignature(tmp_path, _)) + EXPECT_CALL(*binary_feature_extractor_.get(), CheckSignature(tmp_path_, _)) .WillRepeatedly(SetCertificateContents("dummy cert data")); EXPECT_CALL( *binary_feature_extractor_.get(), - ExtractImageFeatures(tmp_path, BinaryFeatureExtractor::kDefaultOptions, + ExtractImageFeatures(tmp_path_, BinaryFeatureExtractor::kDefaultOptions, _, _)) .WillRepeatedly(SetDosHeaderContents("dummy dos header")); @@ -1481,7 +1432,7 @@ ClientDownloadRequest request; EXPECT_TRUE(request.ParseFromString(fetcher->upload_data())); EXPECT_EQ("http://www.google.com/bla.exe", request.url()); - EXPECT_EQ(hash, request.digests().sha256()); + EXPECT_EQ(hash_, request.digests().sha256()); EXPECT_EQ(item.GetReceivedBytes(), request.length()); EXPECT_EQ(item.HasUserGesture(), request.user_initiated()); EXPECT_TRUE(RequestContainsServerIp(request, remote_address)); @@ -1494,7 +1445,7 @@ EXPECT_TRUE(RequestContainsResource(request, ClientDownloadRequest::DOWNLOAD_URL, "http://www.google.com/bla.exe", - referrer.spec())); + referrer_.spec())); EXPECT_TRUE(RequestContainsResource(request, ClientDownloadRequest::TAB_URL, tab_url.spec(), @@ -1552,7 +1503,7 @@ ClientDownloadRequest request; EXPECT_TRUE(request.ParseFromString(fetcher->upload_data())); EXPECT_EQ("http://www.google.com/bla.exe", request.url()); - EXPECT_EQ(hash, request.digests().sha256()); + EXPECT_EQ(hash_, request.digests().sha256()); EXPECT_EQ(item.GetReceivedBytes(), request.length()); EXPECT_EQ(item.HasUserGesture(), request.user_initiated()); EXPECT_TRUE(RequestContainsServerIp(request, remote_address)); @@ -1565,7 +1516,7 @@ EXPECT_TRUE(RequestContainsResource(request, ClientDownloadRequest::DOWNLOAD_URL, "http://www.google.com/bla.exe", - referrer.spec())); + referrer_.spec())); EXPECT_TRUE(RequestContainsResource(request, ClientDownloadRequest::TAB_REDIRECT, "http://tab.com/ref1", @@ -1596,6 +1547,8 @@ } TEST_F(DownloadProtectionServiceTest, TestCheckDownloadUrl) { + net::TestURLFetcherFactory factory; + std::vector<GURL> url_chain; url_chain.push_back(GURL("http://www.google.com/")); url_chain.push_back(GURL("http://www.google.com/bla.exe")); @@ -1663,32 +1616,20 @@ TEST_F(DownloadProtectionServiceTest, TestDownloadRequestTimeout) { net::TestURLFetcherFactory factory; - std::vector<GURL> url_chain; - url_chain.push_back(GURL("http://www.evil.com/bla.exe")); - GURL referrer("http://www.google.com/"); - base::FilePath tmp_path(FILE_PATH_LITERAL("a.tmp")); - base::FilePath final_path(FILE_PATH_LITERAL("a.exe")); - std::string hash = "hash"; - content::MockDownloadItem item; - EXPECT_CALL(item, GetFullPath()).WillRepeatedly(ReturnRef(tmp_path)); - EXPECT_CALL(item, GetTargetFilePath()).WillRepeatedly(ReturnRef(final_path)); - EXPECT_CALL(item, GetUrlChain()).WillRepeatedly(ReturnRef(url_chain)); - EXPECT_CALL(item, GetReferrerUrl()).WillRepeatedly(ReturnRef(referrer)); - EXPECT_CALL(item, GetTabUrl()).WillRepeatedly(ReturnRef(GURL::EmptyGURL())); - EXPECT_CALL(item, GetTabReferrerUrl()) - .WillRepeatedly(ReturnRef(GURL::EmptyGURL())); - EXPECT_CALL(item, GetHash()).WillRepeatedly(ReturnRef(hash)); - EXPECT_CALL(item, GetReceivedBytes()).WillRepeatedly(Return(100)); - EXPECT_CALL(item, HasUserGesture()).WillRepeatedly(Return(true)); - EXPECT_CALL(item, GetRemoteAddress()).WillRepeatedly(Return("")); + PrepareBasicDownloadItem( + &item, + {"http://www.evil.com/bla.exe"}, // url_chain + "http://www.google.com/", // referrer + FILE_PATH_LITERAL("a.tmp"), // tmp_path + FILE_PATH_LITERAL("a.exe")); // final_path EXPECT_CALL(*sb_service_->mock_database_manager(), MatchDownloadWhitelistUrl(_)) .WillRepeatedly(Return(false)); - EXPECT_CALL(*binary_feature_extractor_.get(), CheckSignature(tmp_path, _)); + EXPECT_CALL(*binary_feature_extractor_.get(), CheckSignature(tmp_path_, _)); EXPECT_CALL(*binary_feature_extractor_.get(), - ExtractImageFeatures(tmp_path, + ExtractImageFeatures(tmp_path_, BinaryFeatureExtractor::kDefaultOptions, _, _)); @@ -1707,38 +1648,23 @@ } TEST_F(DownloadProtectionServiceTest, TestDownloadItemDestroyed) { - net::TestURLFetcherFactory factory; - - std::vector<GURL> url_chain; - url_chain.push_back(GURL("http://www.evil.com/bla.exe")); - GURL referrer("http://www.google.com/"); - GURL tab_url("http://www.google.com/tab"); - base::FilePath tmp_path(FILE_PATH_LITERAL("a.tmp")); - base::FilePath final_path(FILE_PATH_LITERAL("a.exe")); - std::string hash = "hash"; - { content::MockDownloadItem item; - EXPECT_CALL(item, GetFullPath()).WillRepeatedly(ReturnRef(tmp_path)); - EXPECT_CALL(item, GetTargetFilePath()) - .WillRepeatedly(ReturnRef(final_path)); - EXPECT_CALL(item, GetUrlChain()).WillRepeatedly(ReturnRef(url_chain)); - EXPECT_CALL(item, GetReferrerUrl()).WillRepeatedly(ReturnRef(referrer)); + PrepareBasicDownloadItem( + &item, + {"http://www.evil.com/bla.exe"}, // url_chain + "http://www.google.com/", // referrer + FILE_PATH_LITERAL("a.tmp"), // tmp_path + FILE_PATH_LITERAL("a.exe")); // final_path + GURL tab_url("http://www.google.com/tab"); EXPECT_CALL(item, GetTabUrl()).WillRepeatedly(ReturnRef(tab_url)); - EXPECT_CALL(item, GetTabReferrerUrl()) - .WillRepeatedly(ReturnRef(GURL::EmptyGURL())); - EXPECT_CALL(item, GetHash()).WillRepeatedly(ReturnRef(hash)); - EXPECT_CALL(item, GetReceivedBytes()).WillRepeatedly(Return(100)); - EXPECT_CALL(item, HasUserGesture()).WillRepeatedly(Return(true)); - EXPECT_CALL(item, GetRemoteAddress()).WillRepeatedly(Return("")); - EXPECT_CALL(*sb_service_->mock_database_manager(), MatchDownloadWhitelistUrl(_)) .WillRepeatedly(Return(false)); - EXPECT_CALL(*binary_feature_extractor_.get(), CheckSignature(tmp_path, _)); + EXPECT_CALL(*binary_feature_extractor_.get(), CheckSignature(tmp_path_, _)); EXPECT_CALL(*binary_feature_extractor_.get(), ExtractImageFeatures( - tmp_path, BinaryFeatureExtractor::kDefaultOptions, _, _)); + tmp_path_, BinaryFeatureExtractor::kDefaultOptions, _, _)); download_service_->CheckClientDownload( &item, @@ -1755,29 +1681,15 @@ TEST_F(DownloadProtectionServiceTest, TestDownloadItemDestroyedDuringWhitelistCheck) { net::TestURLFetcherFactory factory; - - std::vector<GURL> url_chain; - url_chain.push_back(GURL("http://www.evil.com/bla.exe")); - GURL referrer("http://www.google.com/"); + scoped_ptr<content::MockDownloadItem> item(new content::MockDownloadItem); + PrepareBasicDownloadItem( + item.get(), + {"http://www.evil.com/bla.exe"}, // url_chain + "http://www.google.com/", // referrer + FILE_PATH_LITERAL("a.tmp"), // tmp_path + FILE_PATH_LITERAL("a.exe")); // final_path GURL tab_url("http://www.google.com/tab"); - base::FilePath tmp_path(FILE_PATH_LITERAL("a.tmp")); - base::FilePath final_path(FILE_PATH_LITERAL("a.exe")); - std::string hash = "hash"; - - std::unique_ptr<content::MockDownloadItem> item( - new content::MockDownloadItem); - EXPECT_CALL(*item, GetFullPath()).WillRepeatedly(ReturnRef(tmp_path)); - EXPECT_CALL(*item, GetTargetFilePath()) - .WillRepeatedly(ReturnRef(final_path)); - EXPECT_CALL(*item, GetUrlChain()).WillRepeatedly(ReturnRef(url_chain)); - EXPECT_CALL(*item, GetReferrerUrl()).WillRepeatedly(ReturnRef(referrer)); EXPECT_CALL(*item, GetTabUrl()).WillRepeatedly(ReturnRef(tab_url)); - EXPECT_CALL(*item, GetTabReferrerUrl()) - .WillRepeatedly(ReturnRef(GURL::EmptyGURL())); - EXPECT_CALL(*item, GetHash()).WillRepeatedly(ReturnRef(hash)); - EXPECT_CALL(*item, GetReceivedBytes()).WillRepeatedly(Return(100)); - EXPECT_CALL(*item, HasUserGesture()).WillRepeatedly(Return(true)); - EXPECT_CALL(*item, GetRemoteAddress()).WillRepeatedly(Return("")); EXPECT_CALL(*sb_service_->mock_database_manager(), MatchDownloadWhitelistUrl(_)) @@ -1785,9 +1697,9 @@ item.reset(); return false; })); - EXPECT_CALL(*binary_feature_extractor_.get(), CheckSignature(tmp_path, _)); + EXPECT_CALL(*binary_feature_extractor_.get(), CheckSignature(tmp_path_, _)); EXPECT_CALL(*binary_feature_extractor_.get(), - ExtractImageFeatures(tmp_path, + ExtractImageFeatures(tmp_path_, BinaryFeatureExtractor::kDefaultOptions, _, _)); @@ -1946,32 +1858,21 @@ }; TEST_F(DownloadProtectionServiceFlagTest, CheckClientDownloadOverridenByFlag) { - base::FilePath a_tmp(FILE_PATH_LITERAL("a.tmp")); - base::FilePath a_exe(FILE_PATH_LITERAL("a.exe")); - std::vector<GURL> url_chain; - url_chain.push_back(GURL("http://www.evil.com/a.exe")); - GURL referrer("http://www.google.com/"); - content::MockDownloadItem item; - EXPECT_CALL(item, GetFullPath()).WillRepeatedly(ReturnRef(a_tmp)); - EXPECT_CALL(item, GetTargetFilePath()).WillRepeatedly(ReturnRef(a_exe)); - EXPECT_CALL(item, GetUrlChain()).WillRepeatedly(ReturnRef(url_chain)); - EXPECT_CALL(item, GetReferrerUrl()).WillRepeatedly(ReturnRef(referrer)); - EXPECT_CALL(item, GetTabUrl()).WillRepeatedly(ReturnRef(GURL::EmptyGURL())); - EXPECT_CALL(item, GetTabReferrerUrl()) - .WillRepeatedly(ReturnRef(GURL::EmptyGURL())); + PrepareBasicDownloadItem( + &item, + {"http://www.evil.com/a.exe"}, // url_chain + "http://www.google.com/", // referrer + FILE_PATH_LITERAL("a.tmp"), // tmp_path + FILE_PATH_LITERAL("a.exe")); // final_path EXPECT_CALL(item, GetHash()).WillRepeatedly(ReturnRef(blacklisted_hash_)); - EXPECT_CALL(item, GetReceivedBytes()).WillRepeatedly(Return(100)); - EXPECT_CALL(item, HasUserGesture()).WillRepeatedly(Return(true)); - EXPECT_CALL(item, GetRemoteAddress()).WillRepeatedly(Return("")); - EXPECT_CALL(*sb_service_->mock_database_manager(), MatchDownloadWhitelistUrl(_)) .WillRepeatedly(Return(false)); - EXPECT_CALL(*binary_feature_extractor_.get(), CheckSignature(a_tmp, _)); + EXPECT_CALL(*binary_feature_extractor_.get(), CheckSignature(tmp_path_, _)); EXPECT_CALL(*binary_feature_extractor_.get(), ExtractImageFeatures( - a_tmp, BinaryFeatureExtractor::kDefaultOptions, _, _)); + tmp_path_, BinaryFeatureExtractor::kDefaultOptions, _, _)); download_service_->CheckClientDownload( &item, @@ -1988,27 +1889,15 @@ // blacklisted by hash. TEST_F(DownloadProtectionServiceFlagTest, CheckClientDownloadZipOverridenByFlag) { - const base::FilePath zip_path = - testdata_path_.AppendASCII("zipfile_one_unsigned_binary.zip"); - - base::FilePath final_path(FILE_PATH_LITERAL("a.zip")); - std::vector<GURL> url_chain; - url_chain.push_back(GURL("http://www.evil.com/a.zip")); - GURL referrer("http://www.google.com/"); - std::string zip_hash("hash"); // not blacklisted - content::MockDownloadItem item; - EXPECT_CALL(item, GetFullPath()).WillRepeatedly(ReturnRef(zip_path)); - EXPECT_CALL(item, GetTargetFilePath()).WillRepeatedly(ReturnRef(final_path)); - EXPECT_CALL(item, GetUrlChain()).WillRepeatedly(ReturnRef(url_chain)); - EXPECT_CALL(item, GetReferrerUrl()).WillRepeatedly(ReturnRef(referrer)); - EXPECT_CALL(item, GetTabUrl()).WillRepeatedly(ReturnRef(GURL::EmptyGURL())); - EXPECT_CALL(item, GetTabReferrerUrl()) - .WillRepeatedly(ReturnRef(GURL::EmptyGURL())); - EXPECT_CALL(item, GetHash()).WillRepeatedly(ReturnRef(zip_hash)); - EXPECT_CALL(item, GetReceivedBytes()).WillRepeatedly(Return(100)); - EXPECT_CALL(item, HasUserGesture()).WillRepeatedly(Return(true)); - EXPECT_CALL(item, GetRemoteAddress()).WillRepeatedly(Return("")); + + PrepareBasicDownloadItem( + &item, + {"http://www.evil.com/a.exe"}, // url_chain + "http://www.google.com/", // referrer + testdata_path_.AppendASCII( + "zipfile_one_unsigned_binary.zip").value(), // tmp_path + FILE_PATH_LITERAL("a.zip")); // final_path EXPECT_CALL(*sb_service_->mock_database_manager(), MatchDownloadWhitelistUrl(_))
diff --git a/chrome/browser/search/hotword_service.cc b/chrome/browser/search/hotword_service.cc index 2e23bfb..ee4d8b1 100644 --- a/chrome/browser/search/hotword_service.cc +++ b/chrome/browser/search/hotword_service.cc
@@ -295,7 +295,7 @@ chromeos::AudioDeviceList devices; chromeos::CrasAudioHandler::Get()->GetAudioDevices(&devices); for (size_t i = 0; i < devices.size(); ++i) { - if (devices[i].type == chromeos::AUDIO_TYPE_AOKR) { + if (devices[i].type == chromeos::AUDIO_TYPE_HOTWORD) { DCHECK(devices[i].is_input); return true; }
diff --git a/chrome/browser/search/instant_service.cc b/chrome/browser/search/instant_service.cc index 1089c78..ef1594d 100644 --- a/chrome/browser/search/instant_service.cc +++ b/chrome/browser/search/instant_service.cc
@@ -21,7 +21,6 @@ #include "chrome/browser/search/most_visited_iframe_source.h" #include "chrome/browser/search/search.h" #include "chrome/browser/search/suggestions/suggestions_service_factory.h" -#include "chrome/browser/search/suggestions/suggestions_source.h" #include "chrome/browser/search/thumbnail_source.h" #include "chrome/browser/search_engines/template_url_service_factory.h" #include "chrome/browser/search_engines/ui_thread_search_terms_data.h" @@ -174,8 +173,6 @@ content::URLDataSource::Add( profile_, new LargeIconSource(fallback_icon_service, large_icon_service)); content::URLDataSource::Add(profile_, new MostVisitedIframeSource()); - content::URLDataSource::Add( - profile_, new suggestions::SuggestionsSource(profile_)); if (IsLocalNTPSuggestionServiceEnabled()) { suggestions_service_ =
diff --git a/chrome/browser/search/suggestions/suggestions_source.h b/chrome/browser/search/suggestions/suggestions_source.h deleted file mode 100644 index fce814e..0000000 --- a/chrome/browser/search/suggestions/suggestions_source.h +++ /dev/null
@@ -1,75 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_SEARCH_SUGGESTIONS_SUGGESTIONS_SOURCE_H_ -#define CHROME_BROWSER_SEARCH_SUGGESTIONS_SUGGESTIONS_SOURCE_H_ - -#include <map> -#include <string> - -#include "base/callback.h" -#include "base/macros.h" -#include "base/memory/weak_ptr.h" -#include "components/suggestions/proto/suggestions.pb.h" -#include "content/public/browser/url_data_source.h" -#include "url/gurl.h" - -class Profile; -class SkBitmap; - -namespace suggestions { - -// SuggestionsSource renders a webpage to list SuggestionsService data. -class SuggestionsSource : public content::URLDataSource { - public: - explicit SuggestionsSource(Profile* profile); - - // content::URLDataSource implementation. - std::string GetSource() const override; - void StartDataRequest( - const std::string& path, - int render_process_id, - int render_frame_id, - const content::URLDataSource::GotDataCallback& callback) override; - std::string GetMimeType(const std::string& path) const override; - base::MessageLoop* MessageLoopForRequestPath( - const std::string& path) const override; - - private: - ~SuggestionsSource() override; - - // Container for the state of a request. - struct RequestContext { - RequestContext( - bool is_refresh_in, - const suggestions::SuggestionsProfile& suggestions_profile_in, - const content::URLDataSource::GotDataCallback& callback_in); - ~RequestContext(); - - const bool is_refresh; - const suggestions::SuggestionsProfile suggestions_profile; - const content::URLDataSource::GotDataCallback callback; - std::map<GURL, std::string> base64_encoded_pngs; - }; - - // Callback for responses from each Thumbnail request. - void OnThumbnailAvailable(RequestContext* context, base::Closure barrier, - const GURL& url, const SkBitmap* bitmap); - - // Callback for when all requests are complete. Renders the output webpage and - // passes the result to the original caller. - void OnThumbnailsFetched(RequestContext* context); - - // Only used when servicing requests on the UI thread. - Profile* const profile_; - - // For callbacks may be run after destruction. - base::WeakPtrFactory<SuggestionsSource> weak_ptr_factory_; - - DISALLOW_COPY_AND_ASSIGN(SuggestionsSource); -}; - -} // namespace suggestions - -#endif // CHROME_BROWSER_SEARCH_SUGGESTIONS_SUGGESTIONS_SOURCE_H_
diff --git a/chrome/browser/search/suggestions/suggestions_source.cc b/chrome/browser/search/suggestions/suggestions_ui.cc similarity index 76% rename from chrome/browser/search/suggestions/suggestions_source.cc rename to chrome/browser/search/suggestions/suggestions_ui.cc index 7c237d1..de84dc4 100644 --- a/chrome/browser/search/suggestions/suggestions_source.cc +++ b/chrome/browser/search/suggestions/suggestions_ui.cc
@@ -1,18 +1,18 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. +// Copyright 2016 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/search/suggestions/suggestions_source.h" +#include "chrome/browser/search/suggestions/suggestions_ui.h" -#include <stddef.h> -#include <stdint.h> - -#include <vector> +#include <map> +#include <string> #include "base/barrier_closure.h" #include "base/base64.h" #include "base/bind.h" +#include "base/callback.h" #include "base/memory/ref_counted_memory.h" +#include "base/memory/weak_ptr.h" #include "base/strings/string16.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_piece.h" @@ -22,7 +22,9 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/search/suggestions/suggestions_service_factory.h" #include "chrome/common/url_constants.h" +#include "components/suggestions/proto/suggestions.pb.h" #include "components/suggestions/suggestions_service.h" +#include "content/public/browser/url_data_source.h" #include "net/base/escape.h" #include "ui/base/l10n/time_format.h" #include "ui/gfx/codec/png_codec.h" @@ -108,7 +110,55 @@ return base::JoinString(out, base::StringPiece()); } -} // namespace +// SuggestionsSource renders a webpage to list SuggestionsService data. +class SuggestionsSource : public content::URLDataSource { + public: + explicit SuggestionsSource(Profile* profile); + + // content::URLDataSource implementation. + std::string GetSource() const override; + void StartDataRequest( + const std::string& path, + int render_process_id, + int render_frame_id, + const content::URLDataSource::GotDataCallback& callback) override; + std::string GetMimeType(const std::string& path) const override; + base::MessageLoop* MessageLoopForRequestPath( + const std::string& path) const override; + + private: + ~SuggestionsSource() override; + + // Container for the state of a request. + struct RequestContext { + RequestContext( + bool is_refresh_in, + const suggestions::SuggestionsProfile& suggestions_profile_in, + const content::URLDataSource::GotDataCallback& callback_in); + ~RequestContext(); + + const bool is_refresh; + const suggestions::SuggestionsProfile suggestions_profile; + const content::URLDataSource::GotDataCallback callback; + std::map<GURL, std::string> base64_encoded_pngs; + }; + + // Callback for responses from each Thumbnail request. + void OnThumbnailAvailable(RequestContext* context, base::Closure barrier, + const GURL& url, const SkBitmap* bitmap); + + // Callback for when all requests are complete. Renders the output webpage and + // passes the result to the original caller. + void OnThumbnailsFetched(RequestContext* context); + + // Only used when servicing requests on the UI thread. + Profile* const profile_; + + // For callbacks may be run after destruction. + base::WeakPtrFactory<SuggestionsSource> weak_ptr_factory_; + + DISALLOW_COPY_AND_ASSIGN(SuggestionsSource); +}; SuggestionsSource::SuggestionsSource(Profile* profile) : profile_(profile), weak_ptr_factory_(this) {} @@ -215,4 +265,14 @@ barrier.Run(); } +} // namespace + +SuggestionsUI::SuggestionsUI(content::WebUI* web_ui) + : content::WebUIController(web_ui) { + Profile* profile = Profile::FromWebUI(web_ui); + content::URLDataSource::Add(profile, new SuggestionsSource(profile)); +} + +SuggestionsUI::~SuggestionsUI() {} + } // namespace suggestions
diff --git a/chrome/browser/search/suggestions/suggestions_ui.h b/chrome/browser/search/suggestions/suggestions_ui.h new file mode 100644 index 0000000..feb7c51 --- /dev/null +++ b/chrome/browser/search/suggestions/suggestions_ui.h
@@ -0,0 +1,30 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_SEARCH_SUGGESTIONS_SUGGESTIONS_UI_H_ +#define CHROME_BROWSER_SEARCH_SUGGESTIONS_SUGGESTIONS_UI_H_ + +#include "base/macros.h" +#include "content/public/browser/web_ui_controller.h" + +namespace content { +class WebUI; +} + +namespace suggestions { + +// The WebUIController for chrome://suggestions. Renders a webpage to list +// SuggestionsService data. +class SuggestionsUI : public content::WebUIController { + public: + explicit SuggestionsUI(content::WebUI* web_ui); + ~SuggestionsUI() override; + + private: + DISALLOW_COPY_AND_ASSIGN(SuggestionsUI); +}; + +} // namespace suggestions + +#endif // CHROME_BROWSER_SEARCH_SUGGESTIONS_SUGGESTIONS_UI_H_
diff --git a/chrome/browser/ssl/bad_clock_blocking_page.h b/chrome/browser/ssl/bad_clock_blocking_page.h index ee5edfb0..48366d97 100644 --- a/chrome/browser/ssl/bad_clock_blocking_page.h +++ b/chrome/browser/ssl/bad_clock_blocking_page.h
@@ -5,11 +5,11 @@ #ifndef CHROME_BROWSER_SSL_BAD_CLOCK_BLOCKING_PAGE_H_ #define CHROME_BROWSER_SSL_BAD_CLOCK_BLOCKING_PAGE_H_ +#include <memory> #include <string> #include "base/callback.h" #include "base/macros.h" -#include "base/memory/scoped_ptr.h" #include "base/time/time.h" #include "chrome/browser/interstitials/security_interstitial_page.h" #include "chrome/browser/ssl/ssl_cert_reporter.h"
diff --git a/chrome/browser/ssl/certificate_reporting_test_utils.h b/chrome/browser/ssl/certificate_reporting_test_utils.h index 1136c5d..e62e0132 100644 --- a/chrome/browser/ssl/certificate_reporting_test_utils.h +++ b/chrome/browser/ssl/certificate_reporting_test_utils.h
@@ -5,9 +5,9 @@ #ifndef CHROME_BROWSER_SSL_CERTIFICATE_REPORTING_TEST_UTILS_H_ #define CHROME_BROWSER_SSL_CERTIFICATE_REPORTING_TEST_UTILS_H_ +#include <memory> #include <string> -#include "base/memory/scoped_ptr.h" #include "chrome/test/base/in_process_browser_test.h" class Browser;
diff --git a/chrome/browser/task_manager/task_manager.cc b/chrome/browser/task_manager/task_manager.cc index aac1308..95fdb0a 100644 --- a/chrome/browser/task_manager/task_manager.cc +++ b/chrome/browser/task_manager/task_manager.cc
@@ -1507,6 +1507,16 @@ void TaskManager::RegisterPrefs(PrefRegistrySimple* registry) { registry->RegisterDictionaryPref(prefs::kTaskManagerWindowPlacement); registry->RegisterDictionaryPref(prefs::kTaskManagerColumnVisibility); + registry->RegisterBooleanPref(prefs::kTaskManagerEndProcessEnabled, true); +} + +// static +bool TaskManager::IsEndProcessEnabled() { + if (g_browser_process->local_state()) { + return g_browser_process->local_state()->GetBoolean( + prefs::kTaskManagerEndProcessEnabled); + } + return true; } bool TaskManager::IsBrowserProcess(int index) const {
diff --git a/chrome/browser/task_manager/task_manager.h b/chrome/browser/task_manager/task_manager.h index a8178cb1..464637e9 100644 --- a/chrome/browser/task_manager/task_manager.h +++ b/chrome/browser/task_manager/task_manager.h
@@ -54,6 +54,9 @@ public: static void RegisterPrefs(PrefRegistrySimple* registry); + // Returns true if the user is allowed to end processes. + static bool IsEndProcessEnabled(); + // Returns true if the process at the specified index is the browser process. bool IsBrowserProcess(int index) const;
diff --git a/chrome/browser/ui/android/autofill/card_unmask_prompt_view_android.cc b/chrome/browser/ui/android/autofill/card_unmask_prompt_view_android.cc index a0dd9c7a2..9229486 100644 --- a/chrome/browser/ui/android/autofill/card_unmask_prompt_view_android.cc +++ b/chrome/browser/ui/android/autofill/card_unmask_prompt_view_android.cc
@@ -41,9 +41,13 @@ ScopedJavaLocalRef<jstring> instructions = base::android::ConvertUTF16ToJavaString( env, controller_->GetInstructionsMessage()); + + ScopedJavaLocalRef<jstring> confirm = base::android::ConvertUTF16ToJavaString( + env, controller_->GetOkButtonLabel()); + java_object_.Reset(Java_CardUnmaskBridge_create( env, reinterpret_cast<intptr_t>(this), dialog_title.obj(), - instructions.obj(), + instructions.obj(), confirm.obj(), ResourceMapper::MapFromChromiumId(controller_->GetCvcImageRid()), controller_->ShouldRequestExpirationDate(), controller_->CanStoreLocally(),
diff --git a/chrome/browser/ui/ash/chrome_screenshot_grabber.cc b/chrome/browser/ui/ash/chrome_screenshot_grabber.cc index 91a3ebe..5e9e72cd 100644 --- a/chrome/browser/ui/ash/chrome_screenshot_grabber.cc +++ b/chrome/browser/ui/ash/chrome_screenshot_grabber.cc
@@ -41,7 +41,7 @@ #include "chrome/browser/notifications/notifier_state_tracker.h" #include "chrome/browser/notifications/notifier_state_tracker_factory.h" #include "chromeos/login/login_state.h" -#include "components/drive/file_system_interface.h" +#include "components/drive/chromeos/file_system_interface.h" #endif namespace {
diff --git a/chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.cc b/chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.cc deleted file mode 100644 index 5dc10be..0000000 --- a/chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.cc +++ /dev/null
@@ -1,258 +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 "chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.h" - -#include "ash/shelf/shelf_util.h" -#include "ash/wm/window_util.h" -#include "base/bind.h" -#include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" -#include "chrome/browser/ui/ash/launcher/arc_app_window_launcher_item_controller.h" -#include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" -#include "components/arc/arc_bridge_service.h" -#include "components/exo/shell_surface.h" -#include "ui/aura/env.h" -#include "ui/base/base_window.h" -#include "ui/views/widget/widget.h" - -class ArcAppWindowLauncherController::AppWindow : public ui::BaseWindow { - public: - AppWindow(int task_id, views::Widget* widget) - : task_id_(task_id), widget_(widget) {} - ~AppWindow() {} - - void SetController(ArcAppWindowLauncherItemController* controller) { - DCHECK(!controller_ && controller); - controller_ = controller; - } - - int task_id() const { return task_id_; } - - ArcAppWindowLauncherItemController* controller() { return controller_; } - - // ui::BaseWindow: - bool IsActive() const override { return widget_->IsActive(); } - - bool IsMaximized() const override { return widget_->IsMaximized(); } - - bool IsMinimized() const override { return widget_->IsMinimized(); } - - bool IsFullscreen() const override { return widget_->IsFullscreen(); } - - gfx::NativeWindow GetNativeWindow() const override { - return widget_->GetNativeWindow(); - } - - gfx::Rect GetRestoredBounds() const override { - return widget_->GetRestoredBounds(); - } - - ui::WindowShowState GetRestoredState() const override { - // Stub implementation. See also ChromeNativeAppWindowViews. - if (IsMaximized()) - return ui::SHOW_STATE_MAXIMIZED; - if (IsFullscreen()) - return ui::SHOW_STATE_FULLSCREEN; - return ui::SHOW_STATE_NORMAL; - } - - gfx::Rect GetBounds() const override { - return widget_->GetWindowBoundsInScreen(); - } - - void Show() override { - if (widget_->IsVisible()) { - widget_->Activate(); - return; - } - widget_->Show(); - } - - void ShowInactive() override { - if (widget_->IsVisible()) - return; - - widget_->ShowInactive(); - } - - void Hide() override { widget_->Hide(); } - - void Close() override { widget_->Close(); } - - void Activate() override { widget_->Activate(); } - - void Deactivate() override { widget_->Deactivate(); } - - void Maximize() override { widget_->Maximize(); } - - void Minimize() override { widget_->Minimize(); } - - void Restore() override { widget_->Restore(); } - - void SetBounds(const gfx::Rect& bounds) override { - widget_->SetBounds(bounds); - } - - void FlashFrame(bool flash) override { widget_->FlashFrame(flash); } - - bool IsAlwaysOnTop() const override { return widget_->IsAlwaysOnTop(); } - - void SetAlwaysOnTop(bool always_on_top) override { - widget_->SetAlwaysOnTop(always_on_top); - } - - private: - int task_id_; - // Unowned pointers - views::Widget* widget_; - ArcAppWindowLauncherItemController* controller_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(AppWindow); -}; - -ArcAppWindowLauncherController::ArcAppWindowLauncherController( - ChromeLauncherController* owner) - : AppWindowLauncherController(owner), - observed_windows_(this), - weak_ptr_factory_(this) { - aura::Env* env = aura::Env::GetInstanceDontCreate(); - if (env) - env->AddObserver(this); -} - -ArcAppWindowLauncherController::~ArcAppWindowLauncherController() { - aura::Env* env = aura::Env::GetInstanceDontCreate(); - if (env) - env->RemoveObserver(this); -} - -void ArcAppWindowLauncherController::OnWindowInitialized(aura::Window* window) { - DCHECK(!observed_windows_.IsObserving(window)); - - // Root Arc window has type WINDOW_TYPE_NORMAL. - if (window->type() != ui::wm::WINDOW_TYPE_NORMAL) - return; - - observed_windows_.Add(window); -} - -void ArcAppWindowLauncherController::OnWindowPropertyChanged( - aura::Window* window, - const void* key, - intptr_t old) { - if (window_to_app_window_.find(window) != window_to_app_window_.end()) - return; - - const std::string app_id = exo::ShellSurface::GetApplicationId(window); - if (app_id.empty()) - return; - - int task_id = 0; - if (sscanf(app_id.c_str(), "org.chromium.arc.%d", &task_id) != 1 || !task_id) - return; - - views::Widget* widget = views::Widget::GetWidgetForNativeWindow(window); - DCHECK(widget); - window_to_app_window_[window].reset(new AppWindow(task_id, widget)); - - arc::ArcBridgeService* bridge_service = arc::ArcBridgeService::Get(); - if (!bridge_service) { - NOTREACHED(); - return; - } - - arc::mojom::AppInstance* app_instance = bridge_service->app_instance(); - if (!app_instance) { - VLOG(2) << "Request to resolve task when bridge service is not ready."; - return; - } - - // Resolve information about task. - app_instance->GetTaskInfo( - task_id, base::Bind(&ArcAppWindowLauncherController::OnGetTaskInfo, - weak_ptr_factory_.GetWeakPtr(), task_id)); -} - -void ArcAppWindowLauncherController::OnWindowDestroying(aura::Window* window) { - DCHECK(observed_windows_.IsObserving(window)); - observed_windows_.Remove(window); - - WindowToAppWindow::iterator it = window_to_app_window_.find(window); - if (it == window_to_app_window_.end()) - return; - - ArcAppWindowLauncherItemController* controller = it->second->controller(); - if (controller) { - const std::string app_id = controller->app_id(); - controller->RemoveWindowForNativeWindow(window); - if (!controller->window_count()) { - ash::ShelfID shelf_id = ash::GetShelfIDForWindow(window); - DCHECK(shelf_id); - owner()->CloseLauncherItem(shelf_id); - AppControllerMap::iterator it2 = app_controller_map_.find(app_id); - DCHECK(it2 != app_controller_map_.end()); - app_controller_map_.erase(it2); - } - } - window_to_app_window_.erase(it); -} - -ArcAppWindowLauncherController::AppWindow* -ArcAppWindowLauncherController::GetAppWindowForTask(int task_id) { - for (auto& it : window_to_app_window_) { - if (it.second->task_id() == task_id) - return it.second.get(); - } - return nullptr; -} - -void ArcAppWindowLauncherController::OnGetTaskInfo(int task_id, - mojo::String package_name, - mojo::String activity_name) { - if (package_name.get().empty() || activity_name.get().empty()) - return; - - AppWindow* app_window = GetAppWindowForTask(task_id); - if (!app_window) - return; - - DCHECK(app_window && !app_window->controller()); - ash::ShelfItemStatus status = - ash::wm::IsActiveWindow(app_window->GetNativeWindow()) - ? ash::STATUS_ACTIVE - : ash::STATUS_RUNNING; - - const std::string app_id = - ArcAppListPrefs::GetAppId(package_name, activity_name); - - ArcAppWindowLauncherItemController* controller; - AppControllerMap::iterator it = app_controller_map_.find(app_id); - ash::ShelfID shelf_id = 0; - if (it != app_controller_map_.end()) { - controller = it->second; - DCHECK(controller->app_id() == app_id); - shelf_id = controller->shelf_id(); - controller->AddWindow(app_window); - } else { - controller = new ArcAppWindowLauncherItemController(app_id, owner()); - controller->AddWindow(app_window); - shelf_id = owner()->GetShelfIDForAppID(app_id); - if (shelf_id == 0) - shelf_id = owner()->CreateAppLauncherItem(controller, app_id, status); - else - owner()->SetItemController(shelf_id, controller); - app_controller_map_[app_id] = controller; - } - app_window->SetController(controller); - owner()->SetItemStatus(shelf_id, status); - ash::SetShelfIDForWindow(shelf_id, app_window->GetNativeWindow()); -} - -AppWindowLauncherItemController* -ArcAppWindowLauncherController::ControllerForWindow(aura::Window* window) { - WindowToAppWindow::iterator it = window_to_app_window_.find(window); - if (it == window_to_app_window_.end()) - return nullptr; - return it->second->controller(); -}
diff --git a/chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.h b/chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.h deleted file mode 100644 index 493bcfd..0000000 --- a/chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.h +++ /dev/null
@@ -1,66 +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 CHROME_BROWSER_UI_ASH_LAUNCHER_ARC_APP_WINDOW_LAUNCHER_CONTROLLER_H_ -#define CHROME_BROWSER_UI_ASH_LAUNCHER_ARC_APP_WINDOW_LAUNCHER_CONTROLLER_H_ - -#include <map> -#include <memory> - -#include "base/macros.h" -#include "base/scoped_observer.h" -#include "chrome/browser/ui/ash/launcher/app_window_launcher_controller.h" -#include "mojo/public/cpp/bindings/binding.h" -#include "ui/aura/env_observer.h" -#include "ui/aura/window_observer.h" - -namespace aura { -class Window; -} - -class ArcAppWindowLauncherItemController; -class ChromeLauncherController; - -class ArcAppWindowLauncherController : public AppWindowLauncherController, - public aura::EnvObserver, - public aura::WindowObserver { - public: - explicit ArcAppWindowLauncherController(ChromeLauncherController* owner); - ~ArcAppWindowLauncherController() override; - - // aura::EnvObserver: - void OnWindowInitialized(aura::Window* window) override; - - // aura::WindowObserver: - void OnWindowDestroying(aura::Window* window) override; - void OnWindowPropertyChanged(aura::Window* window, - const void* key, - intptr_t old) override; - - private: - class AppWindow; - - using WindowToAppWindow = std::map<aura::Window*, std::unique_ptr<AppWindow>>; - using AppControllerMap = - std::map<std::string, ArcAppWindowLauncherItemController*>; - - AppWindow* GetAppWindowForTask(int task_id); - - void OnGetTaskInfo(int task_id, - mojo::String package_name, - mojo::String activity_name); - - // AppWindowLauncherController: - AppWindowLauncherItemController* ControllerForWindow( - aura::Window* window) override; - - WindowToAppWindow window_to_app_window_; - AppControllerMap app_controller_map_; - ScopedObserver<aura::Window, aura::WindowObserver> observed_windows_; - base::WeakPtrFactory<ArcAppWindowLauncherController> weak_ptr_factory_; - - DISALLOW_COPY_AND_ASSIGN(ArcAppWindowLauncherController); -}; - -#endif // CHROME_BROWSER_UI_ASH_LAUNCHER_ARC_APP_WINDOW_LAUNCHER_CONTROLLER_H_
diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc index b81ad446..e976a59 100644 --- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc +++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc
@@ -100,7 +100,6 @@ #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" #include "chrome/browser/ui/app_list/arc/arc_app_utils.h" #include "chrome/browser/ui/ash/chrome_shell_delegate.h" -#include "chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.h" #include "chrome/browser/ui/ash/launcher/launcher_arc_app_updater.h" #include "chrome/browser/ui/ash/launcher/multi_profile_app_window_launcher_controller.h" #include "chrome/browser/ui/ash/launcher/multi_profile_browser_status_monitor.h" @@ -353,10 +352,6 @@ new ExtensionAppWindowLauncherController(this)); } app_window_controllers_.push_back(std::move(extension_app_window_controller)); - - std::unique_ptr<AppWindowLauncherController> arc_app_window_controller; - arc_app_window_controller.reset(new ArcAppWindowLauncherController(this)); - app_window_controllers_.push_back(std::move(arc_app_window_controller)); #else // Create our v1/v2 application / browser monitors which will inform the // launcher of status changes.
diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc index 16bc7e7..a27a51ae 100644 --- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc +++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc
@@ -1469,66 +1469,6 @@ EXPECT_EQ("AppList, Chrome, App1, App2", GetPinnedAppStatus()); } -TEST_F(ChromeLauncherControllerTest, ArcAppShelf) { - InitLauncherController(); - - const arc::mojom::AppInfo& app_info = arc_test_.fake_apps()[0]; - const std::string arc_app_id = ArcAppTest::GetAppId(app_info); - - InstallArcApps(); - - EXPECT_FALSE(launcher_controller_->IsAppPinned(arc_app_id)); - EXPECT_EQ(0, launcher_controller_->GetShelfIDForAppID(arc_app_id)); - - arc_test_.app_instance()->SetTaskInfo(100, app_info.package_name, - app_info.activity); - - std::string win_app_id = "org.chromium.arc.100"; - views::Widget* arc_app_window = CreateAppWindow(&win_app_id); - - // Item is not created until bridge returns task information. - EXPECT_EQ(0, launcher_controller_->GetShelfIDForAppID(arc_app_id)); - EXPECT_EQ(2, model_->item_count()); - - arc_test_.app_instance()->WaitForIncomingMethodCall(); - content::BrowserThread::GetBlockingPool()->FlushForTesting(); - base::RunLoop().RunUntilIdle(); - - EXPECT_NE(0, launcher_controller_->GetShelfIDForAppID(arc_app_id)); - ASSERT_EQ(3, model_->item_count()); - // Activation notification does not properly works in unit_tests. - EXPECT_TRUE(model_->items().back().status == ash::STATUS_RUNNING || - model_->items().back().status == ash::STATUS_ACTIVE); - - // Destroying window removes shelf item. - arc_app_window->CloseNow(); - EXPECT_EQ(0, launcher_controller_->GetShelfIDForAppID(arc_app_id)); - EXPECT_EQ(2, model_->item_count()); - - // Test with pinned app. - launcher_controller_->PinAppWithID(arc_app_id); - EXPECT_NE(0, launcher_controller_->GetShelfIDForAppID(arc_app_id)); - ASSERT_EQ(3, model_->item_count()); - EXPECT_EQ(ash::STATUS_CLOSED, model_->items().back().status); - - // Run Arc task and status should change. - arc_app_window = CreateAppWindow(&win_app_id); - arc_test_.app_instance()->WaitForIncomingMethodCall(); - content::BrowserThread::GetBlockingPool()->FlushForTesting(); - base::RunLoop().RunUntilIdle(); - - EXPECT_NE(0, launcher_controller_->GetShelfIDForAppID(arc_app_id)); - ASSERT_EQ(3, model_->item_count()); - EXPECT_TRUE(model_->items().back().status == ash::STATUS_RUNNING || - model_->items().back().status == ash::STATUS_ACTIVE); - - // Close Arc task and status should change back to ash::STATUS_CLOSED. - arc_app_window->CloseNow(); - EXPECT_NE(0, launcher_controller_->GetShelfIDForAppID(arc_app_id)); - ASSERT_EQ(3, model_->item_count()); - EXPECT_EQ(ash::STATUS_CLOSED, model_->items().back().status); -} - // Check that with multi profile V1 apps are properly added / removed from the // shelf. TEST_F(MultiProfileMultiBrowserShelfLayoutChromeLauncherControllerTest,
diff --git a/chrome/browser/ui/ash/solid_color_user_wallpaper_delegate.cc b/chrome/browser/ui/ash/solid_color_user_wallpaper_delegate.cc index c09ef57..43ff95a 100644 --- a/chrome/browser/ui/ash/solid_color_user_wallpaper_delegate.cc +++ b/chrome/browser/ui/ash/solid_color_user_wallpaper_delegate.cc
@@ -7,6 +7,7 @@ #include "ash/desktop_background/desktop_background_controller.h" #include "ash/desktop_background/user_wallpaper_delegate.h" #include "ash/shell.h" +#include "ash/wm/common/window_animation_types.h" #include "ash/wm/window_animations.h" #include "base/macros.h" #include "ui/gfx/image/image_skia.h" @@ -25,9 +26,9 @@ ~UserWallpaperDelegate() override {} int GetAnimationType() override { - return ShouldShowInitialAnimation() ? - ash::WINDOW_VISIBILITY_ANIMATION_TYPE_BRIGHTNESS_GRAYSCALE : - static_cast<int>(wm::WINDOW_VISIBILITY_ANIMATION_TYPE_FADE); + return ShouldShowInitialAnimation() + ? ash::wm::WINDOW_VISIBILITY_ANIMATION_TYPE_BRIGHTNESS_GRAYSCALE + : static_cast<int>(wm::WINDOW_VISIBILITY_ANIMATION_TYPE_FADE); } bool ShouldShowInitialAnimation() override { return true; }
diff --git a/chrome/browser/ui/ash/system_tray_tray_cast_browsertest_chromeos.cc b/chrome/browser/ui/ash/system_tray_tray_cast_browsertest_chromeos.cc index 81d75ac5..90fb713 100644 --- a/chrome/browser/ui/ash/system_tray_tray_cast_browsertest_chromeos.cc +++ b/chrome/browser/ui/ash/system_tray_tray_cast_browsertest_chromeos.cc
@@ -16,6 +16,7 @@ #include "content/public/browser/render_view_host.h" #include "content/public/test/test_utils.h" #include "extensions/browser/process_manager.h" +#include "extensions/common/feature_switch.h" namespace { @@ -132,11 +133,21 @@ SystemTrayTrayCastChromeOSTest() : ExtensionBrowserTest() {} ~SystemTrayTrayCastChromeOSTest() override {} + void SetUpCommandLine(base::CommandLine* command_line) override { + // SystemTrayTrayCastChromeOSTest tests the behavior of the system tray + // without Media Router, so we explicitly disable it. + ExtensionBrowserTest::SetUpCommandLine(command_line); + override_media_router_.reset(new extensions::FeatureSwitch::ScopedOverride( + extensions::FeatureSwitch::media_router(), false)); + } + const extensions::Extension* LoadCastTestExtension() { return LoadExtension(test_data_dir_.AppendASCII("tray_cast")); } private: + std::unique_ptr<extensions::FeatureSwitch::ScopedOverride> + override_media_router_; DISALLOW_COPY_AND_ASSIGN(SystemTrayTrayCastChromeOSTest); };
diff --git a/chrome/browser/ui/ash/window_positioner_unittest.cc b/chrome/browser/ui/ash/window_positioner_unittest.cc index 6045108..1c00b0c 100644 --- a/chrome/browser/ui/ash/window_positioner_unittest.cc +++ b/chrome/browser/ui/ash/window_positioner_unittest.cc
@@ -8,6 +8,7 @@ #include "ash/test/ash_test_base.h" #include "ash/test/test_shell_delegate.h" +#include "ash/wm/aura/wm_globals_aura.h" #include "ash/wm/window_resizer.h" #include "base/compiler_specific.h" #include "base/logging.h" @@ -80,7 +81,7 @@ // as he needs it. window()->Hide(); popup()->Hide(); - window_positioner_.reset(new WindowPositioner()); + window_positioner_.reset(new WindowPositioner(wm::WmGlobalsAura::Get())); } void WindowPositionerTest::TearDown() {
diff --git a/chrome/browser/ui/autofill/card_unmask_prompt_view_browsertest.cc b/chrome/browser/ui/autofill/card_unmask_prompt_view_browsertest.cc index ab024450..7744de0 100644 --- a/chrome/browser/ui/autofill/card_unmask_prompt_view_browsertest.cc +++ b/chrome/browser/ui/autofill/card_unmask_prompt_view_browsertest.cc
@@ -114,6 +114,7 @@ IN_PROC_BROWSER_TEST_F(CardUnmaskPromptViewBrowserTest, DisplayUI) { controller()->ShowPrompt(CreateCardUnmaskPromptView(controller(), contents()), test::GetMaskedServerCard(), + AutofillClient::UNMASK_FOR_AUTOFILL, delegate()->GetWeakPtr()); } @@ -125,6 +126,7 @@ EarlyCloseAfterSuccess) { controller()->ShowPrompt(CreateCardUnmaskPromptView(controller(), contents()), test::GetMaskedServerCard(), + AutofillClient::UNMASK_FOR_AUTOFILL, delegate()->GetWeakPtr()); controller()->OnUnmaskResponse(base::ASCIIToUTF16("123"), base::ASCIIToUTF16("10"), @@ -149,6 +151,7 @@ CloseTabWhileDialogShowing) { controller()->ShowPrompt(CreateCardUnmaskPromptView(controller(), contents()), test::GetMaskedServerCard(), + AutofillClient::UNMASK_FOR_AUTOFILL, delegate()->GetWeakPtr()); // Simulate AutofillManager (the delegate in production code) being destroyed // before CardUnmaskPromptViewBridge::OnConstrainedWindowClosed() is called.
diff --git a/chrome/browser/ui/autofill/chrome_autofill_client.cc b/chrome/browser/ui/autofill/chrome_autofill_client.cc index aed5945..1b3b6a4 100644 --- a/chrome/browser/ui/autofill/chrome_autofill_client.cc +++ b/chrome/browser/ui/autofill/chrome_autofill_client.cc
@@ -161,10 +161,11 @@ void ChromeAutofillClient::ShowUnmaskPrompt( const CreditCard& card, + UnmaskCardReason reason, base::WeakPtr<CardUnmaskDelegate> delegate) { unmask_controller_.ShowPrompt( CreateCardUnmaskPromptView(&unmask_controller_, web_contents()), - card, delegate); + card, reason, delegate); } void ChromeAutofillClient::OnUnmaskVerificationResult(
diff --git a/chrome/browser/ui/autofill/chrome_autofill_client.h b/chrome/browser/ui/autofill/chrome_autofill_client.h index 1437d9c..09d025f 100644 --- a/chrome/browser/ui/autofill/chrome_autofill_client.h +++ b/chrome/browser/ui/autofill/chrome_autofill_client.h
@@ -54,6 +54,7 @@ void HideRequestAutocompleteDialog() override; void ShowAutofillSettings() override; void ShowUnmaskPrompt(const CreditCard& card, + UnmaskCardReason reason, base::WeakPtr<CardUnmaskDelegate> delegate) override; void OnUnmaskVerificationResult(PaymentsRpcResult result) override; void ConfirmSaveCreditCardLocally(const CreditCard& card,
diff --git a/chrome/browser/ui/cocoa/autofill/card_unmask_prompt_view_bridge.mm b/chrome/browser/ui/cocoa/autofill/card_unmask_prompt_view_bridge.mm index b4f949e..dfee20cc 100644 --- a/chrome/browser/ui/cocoa/autofill/card_unmask_prompt_view_bridge.mm +++ b/chrome/browser/ui/cocoa/autofill/card_unmask_prompt_view_bridge.mm
@@ -728,8 +728,8 @@ // Add verify button. verifyButton_.reset( [[ConstrainedWindowButton alloc] initWithFrame:NSZeroRect]); - [verifyButton_ setTitle:l10n_util::GetNSStringWithFixup( - IDS_AUTOFILL_CARD_UNMASK_CONFIRM_BUTTON)]; + [verifyButton_ setTitle:l10n_util::FixUpWindowsStyleLabel( + controller->GetOkButtonLabel())]; [verifyButton_ setKeyEquivalent:kKeyEquivalentReturn]; [verifyButton_ setTarget:self]; [verifyButton_ setAction:@selector(onVerify:)];
diff --git a/chrome/browser/ui/cocoa/task_manager_mac.mm b/chrome/browser/ui/cocoa/task_manager_mac.mm index 853389b..fd8cb4d 100644 --- a/chrome/browser/ui/cocoa/task_manager_mac.mm +++ b/chrome/browser/ui/cocoa/task_manager_mac.mm
@@ -412,7 +412,8 @@ [tableView_ selectRowIndexes:indexSet byExtendingSelection:YES]; } - bool enabled = [selection count] > 0 && !selectionContainsBrowserProcess; + bool enabled = [selection count] > 0 && !selectionContainsBrowserProcess && + TaskManager::IsEndProcessEnabled(); [endProcessButton_ setEnabled:enabled]; }
diff --git a/chrome/browser/ui/cocoa/website_settings/permission_bubble_controller.mm b/chrome/browser/ui/cocoa/website_settings/permission_bubble_controller.mm index 9d9d634..0bcc1bd 100644 --- a/chrome/browser/ui/cocoa/website_settings/permission_bubble_controller.mm +++ b/chrome/browser/ui/cocoa/website_settings/permission_bubble_controller.mm
@@ -29,6 +29,7 @@ #include "chrome/browser/ui/website_settings/permission_bubble_view.h" #include "chrome/browser/ui/website_settings/permission_menu_model.h" #include "chrome/grit/generated_resources.h" +#include "components/url_formatter/elide_url.h" #include "content/public/browser/native_web_keyboard_event.h" #include "content/public/browser/user_metrics.h" #include "grit/components_strings.h" @@ -39,6 +40,7 @@ #include "ui/base/cocoa/window_size_constants.h" #include "ui/base/l10n/l10n_util_mac.h" #include "ui/base/models/simple_menu_model.h" +#include "url/gurl.h" using base::UserMetricsAction; @@ -186,7 +188,7 @@ // Returns an autoreleased NSView displaying the title for the bubble // requesting settings for |host|. -- (NSView*)titleWithHostname:(const std::string&)host; +- (NSView*)titleWithOrigin:(const GURL&)origin; // Returns an autoreleased NSView displaying a menu for |request|. The // menu will be initialized as 'allow' if |allow| is YES. @@ -341,7 +343,7 @@ } base::scoped_nsobject<NSView> titleView( - [[self titleWithHostname:requests[0]->GetOrigin().host()] retain]); + [[self titleWithOrigin:requests[0]->GetOrigin()] retain]); [contentView addSubview:titleView]; [titleView setFrameOrigin:NSMakePoint(kHorizontalPadding, kVerticalPadding + yOffset)]; @@ -518,16 +520,18 @@ return permissionView.autorelease(); } -- (NSView*)titleWithHostname:(const std::string&)host { +- (NSView*)titleWithOrigin:(const GURL&)origin { base::scoped_nsobject<NSTextField> titleView( [[NSTextField alloc] initWithFrame:NSZeroRect]); [titleView setDrawsBackground:NO]; [titleView setBezeled:NO]; [titleView setEditable:NO]; [titleView setSelectable:NO]; - [titleView setStringValue: - l10n_util::GetNSStringF(IDS_PERMISSIONS_BUBBLE_PROMPT, - base::UTF8ToUTF16(host))]; + [titleView setStringValue:l10n_util::GetNSStringF( + IDS_PERMISSIONS_BUBBLE_PROMPT, + url_formatter::FormatUrlForSecurityDisplay( + origin, url_formatter::SchemeDisplay:: + OMIT_CRYPTOGRAPHIC))]; [titleView setFont:[NSFont systemFontOfSize:[NSFont smallSystemFontSize]]]; [titleView sizeToFit]; NSRect titleFrame = [titleView frame];
diff --git a/chrome/browser/ui/location_bar/location_bar_browsertest.cc b/chrome/browser/ui/location_bar/location_bar_browsertest.cc index 211c886..5441b6e 100644 --- a/chrome/browser/ui/location_bar/location_bar_browsertest.cc +++ b/chrome/browser/ui/location_bar/location_bar_browsertest.cc
@@ -57,7 +57,9 @@ private: std::unique_ptr<extensions::FeatureSwitch::ScopedOverride> enable_override_; - std::unique_ptr<extensions::FeatureSwitch::ScopedOverride> enable_redesign_; + std::unique_ptr<extensions::FeatureSwitch::ScopedOverride> disable_redesign_; + std::unique_ptr<extensions::FeatureSwitch::ScopedOverride> + disable_media_router_; DISALLOW_COPY_AND_ASSIGN(LocationBarBrowserTest); }; @@ -67,9 +69,13 @@ // enable the switch. enable_override_.reset(new extensions::FeatureSwitch::ScopedOverride( extensions::FeatureSwitch::enable_override_bookmarks_ui(), true)); + // We need to disable Media Router since having Media Router enabled will + // result in auto-enabling the redesign and breaking the test. + disable_media_router_.reset(new extensions::FeatureSwitch::ScopedOverride( + extensions::FeatureSwitch::media_router(), false)); // For testing page actions in the location bar, we also have to be sure to // *not* have the redesign turned on. - enable_redesign_.reset(new extensions::FeatureSwitch::ScopedOverride( + disable_redesign_.reset(new extensions::FeatureSwitch::ScopedOverride( extensions::FeatureSwitch::extension_action_redesign(), false)); ExtensionBrowserTest::SetUpCommandLine(command_line); } @@ -176,7 +182,7 @@ private: void SetUpCommandLine(base::CommandLine* command_line) override; - std::unique_ptr<extensions::FeatureSwitch::ScopedOverride> enable_redesign_; + std::unique_ptr<extensions::FeatureSwitch::ScopedOverride> disable_redesign_; DISALLOW_COPY_AND_ASSIGN(LocationBarBrowserTestWithRedesign); }; @@ -184,7 +190,7 @@ void LocationBarBrowserTestWithRedesign::SetUpCommandLine( base::CommandLine* command_line) { LocationBarBrowserTest::SetUpCommandLine(command_line); - enable_redesign_.reset(new extensions::FeatureSwitch::ScopedOverride( + disable_redesign_.reset(new extensions::FeatureSwitch::ScopedOverride( extensions::FeatureSwitch::extension_action_redesign(), true)); }
diff --git a/chrome/browser/ui/tab_helpers.cc b/chrome/browser/ui/tab_helpers.cc index 24a889a9..2c8de2f 100644 --- a/chrome/browser/ui/tab_helpers.cc +++ b/chrome/browser/ui/tab_helpers.cc
@@ -54,10 +54,12 @@ #if BUILDFLAG(ANDROID_JAVA_UI) #include "chrome/browser/android/data_usage/data_use_tab_helper.h" #include "chrome/browser/android/offline_pages/offline_page_tab_helper.h" +#include "chrome/browser/android/offline_pages/recent_tab_helper.h" #include "chrome/browser/android/voice_search_tab_helper.h" #include "chrome/browser/android/webapps/single_tab_mode_tab_helper.h" #include "chrome/browser/ui/android/context_menu_helper.h" #include "chrome/browser/ui/android/view_android_helper.h" +#include "components/offline_pages/offline_page_feature.h" #else #include "chrome/browser/banners/app_banner_manager_desktop.h" #include "chrome/browser/plugins/plugin_observer.h" @@ -180,7 +182,11 @@ #if BUILDFLAG(ANDROID_JAVA_UI) ContextMenuHelper::CreateForWebContents(web_contents); DataUseTabHelper::CreateForWebContents(web_contents); + offline_pages::OfflinePageTabHelper::CreateForWebContents(web_contents); + if (offline_pages::IsOffliningRecentPagesEnabled()) + offline_pages::RecentTabHelper::CreateForWebContents(web_contents); + SingleTabModeTabHelper::CreateForWebContents(web_contents); ViewAndroidHelper::CreateForWebContents(web_contents); VoiceSearchTabHelper::CreateForWebContents(web_contents);
diff --git a/chrome/browser/ui/toolbar/browser_actions_bar_browsertest.cc b/chrome/browser/ui/toolbar/browser_actions_bar_browsertest.cc index e80cec13..e4d6fc77 100644 --- a/chrome/browser/ui/toolbar/browser_actions_bar_browsertest.cc +++ b/chrome/browser/ui/toolbar/browser_actions_bar_browsertest.cc
@@ -67,6 +67,10 @@ base::CommandLine* command_line) { ExtensionBrowserTest::SetUpCommandLine(command_line); ToolbarActionsBar::disable_animations_for_testing_ = true; + // We need to disable Media Router since having Media Router enabled will + // result in auto-enabling the redesign and breaking the test. + override_media_router_.reset(new extensions::FeatureSwitch::ScopedOverride( + extensions::FeatureSwitch::media_router(), false)); // These tests are deliberately testing behavior without the redesign. // Forcefully disable it. override_redesign_.reset(new extensions::FeatureSwitch::ScopedOverride(
diff --git a/chrome/browser/ui/toolbar/browser_actions_bar_browsertest.h b/chrome/browser/ui/toolbar/browser_actions_bar_browsertest.h index 795be82..cbce1318 100644 --- a/chrome/browser/ui/toolbar/browser_actions_bar_browsertest.h +++ b/chrome/browser/ui/toolbar/browser_actions_bar_browsertest.h
@@ -52,6 +52,8 @@ protected: // Enable or disable the feature redesign switch. std::unique_ptr<extensions::FeatureSwitch::ScopedOverride> override_redesign_; + std::unique_ptr<extensions::FeatureSwitch::ScopedOverride> + override_media_router_; private: std::unique_ptr<BrowserActionTestUtil> browser_actions_bar_;
diff --git a/chrome/browser/ui/toolbar/toolbar_actions_bar.cc b/chrome/browser/ui/toolbar/toolbar_actions_bar.cc index bd3d27d3a..79fa085 100644 --- a/chrome/browser/ui/toolbar/toolbar_actions_bar.cc +++ b/chrome/browser/ui/toolbar/toolbar_actions_bar.cc
@@ -131,7 +131,7 @@ model_observer_(this), suppress_layout_(false), suppress_animation_(true), - checked_extension_bubble_(false), + should_check_extension_bubble_(!main_bar), is_drag_in_progress_(false), popped_out_action_(nullptr), is_popped_out_sticky_(false), @@ -398,8 +398,8 @@ // haven't already shown the bubble. // Extension bubbles can also highlight a subset of actions, so don't show the // bubble if the toolbar is already highlighting a different set. - if (!checked_extension_bubble_ && !is_highlighting()) { - checked_extension_bubble_ = true; + if (should_check_extension_bubble_ && !is_highlighting()) { + should_check_extension_bubble_ = false; // CreateActions() can be called as part of the browser window set up, which // we need to let finish before showing the actions. std::unique_ptr<extensions::ExtensionMessageBubbleController> controller = @@ -597,6 +597,7 @@ void ToolbarActionsBar::ShowToolbarActionBubble( std::unique_ptr<ToolbarActionsBarBubbleDelegate> bubble) { + DCHECK(!in_overflow_mode()); if (delegate_->IsAnimating()) { // If the toolbar is animating, we can't effectively anchor the bubble, // so wait until animation stops.
diff --git a/chrome/browser/ui/toolbar/toolbar_actions_bar.h b/chrome/browser/ui/toolbar/toolbar_actions_bar.h index 6a347dc4..21304085 100644 --- a/chrome/browser/ui/toolbar/toolbar_actions_bar.h +++ b/chrome/browser/ui/toolbar/toolbar_actions_bar.h
@@ -325,9 +325,10 @@ // See also TabOrderHelper in the .cc file. static bool pop_out_actions_to_run_; - // True if we have checked to see if there is an extension bubble that should - // be displayed, and, if there is, shown that bubble. - bool checked_extension_bubble_; + // True if we should check to see if there is an extension bubble that should + // be displayed, and, if there is, started the process for showing that + // bubble. This is only ever true for the main bar. + bool should_check_extension_bubble_; // Whether or not the user is in the middle of a drag-and-drop operation. bool is_drag_in_progress_;
diff --git a/chrome/browser/ui/views/apps/app_window_desktop_window_tree_host_win.cc b/chrome/browser/ui/views/apps/app_window_desktop_window_tree_host_win.cc index e8ec90d6..13064016 100644 --- a/chrome/browser/ui/views/apps/app_window_desktop_window_tree_host_win.cc +++ b/chrome/browser/ui/views/apps/app_window_desktop_window_tree_host_win.cc
@@ -10,7 +10,7 @@ #include "chrome/browser/ui/views/apps/chrome_native_app_window_views_win.h" #include "chrome/browser/ui/views/apps/glass_app_window_frame_view_win.h" #include "ui/base/theme_provider.h" -#include "ui/gfx/win/dpi.h" +#include "ui/display/win/dpi.h" #include "ui/views/controls/menu/native_menu_win.h" AppWindowDesktopWindowTreeHostWin::AppWindowDesktopWindowTreeHostWin( @@ -69,7 +69,7 @@ gfx::Insets insets = app_window_->glass_frame_view()->GetGlassInsets(); // The DWM API's expect values in pixels. We need to convert from DIP to // pixels here. - insets = insets.Scale(gfx::GetDPIScale()); + insets = insets.Scale(display::win::GetDPIScale()); margins.cxLeftWidth = insets.left(); margins.cxRightWidth = insets.right(); margins.cyBottomHeight = insets.bottom();
diff --git a/chrome/browser/ui/views/apps/glass_app_window_frame_view_win.cc b/chrome/browser/ui/views/apps/glass_app_window_frame_view_win.cc index bde1830..b3e3cb5 100644 --- a/chrome/browser/ui/views/apps/glass_app_window_frame_view_win.cc +++ b/chrome/browser/ui/views/apps/glass_app_window_frame_view_win.cc
@@ -7,7 +7,7 @@ #include "base/win/windows_version.h" #include "extensions/browser/app_window/native_app_window.h" #include "ui/base/hit_test.h" -#include "ui/gfx/win/dpi.h" +#include "ui/display/win/dpi.h" #include "ui/views/widget/widget.h" #include "ui/views/widget/widget_delegate.h" @@ -30,11 +30,11 @@ } gfx::Insets GlassAppWindowFrameViewWin::GetGlassInsets() const { - int caption_height = gfx::win::GetSystemMetricsInDIP(SM_CYSIZEFRAME) + - gfx::win::GetSystemMetricsInDIP(SM_CYCAPTION); + int caption_height = display::win::GetSystemMetricsInDIP(SM_CYSIZEFRAME) + + display::win::GetSystemMetricsInDIP(SM_CYCAPTION); int frame_size = base::win::GetVersion() < base::win::VERSION_WIN10 - ? gfx::win::GetSystemMetricsInDIP(SM_CXSIZEFRAME) + ? display::win::GetSystemMetricsInDIP(SM_CXSIZEFRAME) : 0; return gfx::Insets(caption_height, frame_size, frame_size, frame_size); @@ -55,7 +55,7 @@ } else { // On Windows 10 we use a 1 pixel non client border which is too thin as a // resize target. This inset extends the resize region. - int resize_border = gfx::win::GetSystemMetricsInDIP(SM_CXSIZEFRAME); + int resize_border = display::win::GetSystemMetricsInDIP(SM_CXSIZEFRAME); insets.Set(0, resize_border, resize_border, resize_border); } return insets; @@ -103,7 +103,7 @@ : false; // Don't allow overlapping resize handles when the window is maximized or // fullscreen, as it can't be resized in those states. - int resize_border = gfx::win::GetSystemMetricsInDIP(SM_CXSIZEFRAME); + int resize_border = display::win::GetSystemMetricsInDIP(SM_CXSIZEFRAME); int frame_component = GetHTComponentForFrame(point, resize_border,
diff --git a/chrome/browser/ui/views/autofill/OWNERS b/chrome/browser/ui/views/autofill/OWNERS index 262db99..658a9f5 100644 --- a/chrome/browser/ui/views/autofill/OWNERS +++ b/chrome/browser/ui/views/autofill/OWNERS
@@ -1,2 +1 @@ -dbeam@chromium.org estade@chromium.org
diff --git a/chrome/browser/ui/views/autofill/card_unmask_prompt_views.cc b/chrome/browser/ui/views/autofill/card_unmask_prompt_views.cc index 3e78123..87f0e49 100644 --- a/chrome/browser/ui/views/autofill/card_unmask_prompt_views.cc +++ b/chrome/browser/ui/views/autofill/card_unmask_prompt_views.cc
@@ -291,7 +291,7 @@ base::string16 CardUnmaskPromptViews::GetDialogButtonLabel( ui::DialogButton button) const { if (button == ui::DIALOG_BUTTON_OK) - return l10n_util::GetStringUTF16(IDS_AUTOFILL_CARD_UNMASK_CONFIRM_BUTTON); + return controller_->GetOkButtonLabel(); return DialogDelegateView::GetDialogButtonLabel(button); }
diff --git a/chrome/browser/ui/views/autofill/info_bubble.cc b/chrome/browser/ui/views/autofill/info_bubble.cc index 53e370df..ecc7bc1 100644 --- a/chrome/browser/ui/views/autofill/info_bubble.cc +++ b/chrome/browser/ui/views/autofill/info_bubble.cc
@@ -86,7 +86,7 @@ if (show_above_anchor_) set_arrow(views::BubbleBorder::vertical_mirror(arrow())); - widget_ = views::BubbleDelegateView::CreateBubble(this); + widget_ = views::BubbleDialogDelegateView::CreateBubble(this); if (align_to_anchor_edge_) { // The frame adjusts its arrow before the bubble's alignment can be changed. @@ -142,9 +142,13 @@ void InfoBubble::OnWidgetBoundsChanged(views::Widget* widget, const gfx::Rect& new_bounds) { - views::BubbleDelegateView::OnWidgetBoundsChanged(widget, new_bounds); + views::BubbleDialogDelegateView::OnWidgetBoundsChanged(widget, new_bounds); if (anchor_widget() == widget) frame_->set_available_bounds(widget->GetWindowBoundsInScreen()); } +int InfoBubble::GetDialogButtons() const { + return ui::DIALOG_BUTTON_NONE; +} + } // namespace autofill
diff --git a/chrome/browser/ui/views/autofill/info_bubble.h b/chrome/browser/ui/views/autofill/info_bubble.h index 47fd2f9..d91be82b 100644 --- a/chrome/browser/ui/views/autofill/info_bubble.h +++ b/chrome/browser/ui/views/autofill/info_bubble.h
@@ -9,14 +9,14 @@ #include "base/macros.h" #include "base/strings/string16.h" #include "ui/gfx/geometry/insets.h" -#include "ui/views/bubble/bubble_delegate.h" +#include "ui/views/bubble/bubble_dialog_delegate.h" namespace autofill { class InfoBubbleFrame; // Class to create and manage an information bubble for errors or tooltips. -class InfoBubble : public views::BubbleDelegateView { +class InfoBubble : public views::BubbleDialogDelegateView { public: InfoBubble(views::View* anchor, const base::string16& message); ~InfoBubble() override; @@ -30,13 +30,14 @@ // Updates the position of the bubble. void UpdatePosition(); - // views::BubbleDelegateView: + // views::BubbleDialogDelegateView: views::NonClientFrameView* CreateNonClientFrameView( views::Widget* widget) override; gfx::Size GetPreferredSize() const override; void OnWidgetDestroyed(views::Widget* widget) override; void OnWidgetBoundsChanged(views::Widget* widget, const gfx::Rect& new_bounds) override; + int GetDialogButtons() const override; views::View* anchor() { return anchor_; } const views::View* anchor() const { return anchor_; }
diff --git a/chrome/browser/ui/views/autofill/tooltip_icon.cc b/chrome/browser/ui/views/autofill/tooltip_icon.cc index d5a6640..6c1b12d 100644 --- a/chrome/browser/ui/views/autofill/tooltip_icon.cc +++ b/chrome/browser/ui/views/autofill/tooltip_icon.cc
@@ -39,7 +39,7 @@ protected: // InfoBubble: gfx::Rect GetAnchorRect() const override { - gfx::Rect bounds = views::BubbleDelegateView::GetAnchorRect(); + gfx::Rect bounds = views::BubbleDialogDelegateView::GetAnchorRect(); bounds.Inset(GetPreferredInsets(anchor())); return bounds; }
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h b/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h index 722ac92..7a11557 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h +++ b/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h
@@ -62,7 +62,7 @@ bool AcceleratorPressed(const ui::Accelerator& accelerator) override; protected: - // views::BubbleDelegateView method. + // views::BubbleDialogDelegateView method. void Init() override; base::string16 GetWindowTitle() const override; @@ -71,7 +71,7 @@ FRIEND_TEST_ALL_PREFIXES(BookmarkBubbleViewTest, SyncPromoSignedIn); FRIEND_TEST_ALL_PREFIXES(BookmarkBubbleViewTest, SyncPromoNotSignedIn); - // views::BubbleDelegateView: + // views::BubbleDialogDelegateView: const char* GetClassName() const override; View* GetInitiallyFocusedView() override; View* CreateFootnoteView() override;
diff --git a/chrome/browser/ui/views/conflicting_module_view_win.cc b/chrome/browser/ui/views/conflicting_module_view_win.cc index 181963ff..bf7e720 100644 --- a/chrome/browser/ui/views/conflicting_module_view_win.cc +++ b/chrome/browser/ui/views/conflicting_module_view_win.cc
@@ -20,10 +20,9 @@ #include "ui/accessibility/ax_view_state.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" -#include "ui/views/controls/button/label_button.h" #include "ui/views/controls/image_view.h" #include "ui/views/controls/label.h" -#include "ui/views/layout/grid_layout.h" +#include "ui/views/layout/box_layout.h" #include "ui/views/layout/layout_constants.h" #include "ui/views/widget/widget.h" @@ -31,13 +30,6 @@ namespace { -// Layout constants. -const int kInsetBottomRight = 13; -const int kInsetLeft = 14; -const int kInsetTop = 9; -const int kHeadlineMessagePadding = 4; -const int kMessageBubblePadding = 11; - // How often to show this bubble. const int kShowConflictingModuleBubbleMax = 3; @@ -46,18 +38,13 @@ //////////////////////////////////////////////////////////////////////////////// // ConflictingModuleView -ConflictingModuleView::ConflictingModuleView( - views::View* anchor_view, - Browser* browser, - const GURL& help_center_url) - : BubbleDelegateView(anchor_view, views::BubbleBorder::TOP_RIGHT), +ConflictingModuleView::ConflictingModuleView(views::View* anchor_view, + Browser* browser, + const GURL& help_center_url) + : BubbleDialogDelegateView(anchor_view, views::BubbleBorder::TOP_RIGHT), browser_(browser), - explanation_(NULL), - learn_more_button_(NULL), - not_now_button_(NULL), help_center_url_(help_center_url) { set_close_on_deactivate(false); - set_close_on_esc(true); // Compensate for built-in vertical padding in the anchor view's image. set_anchor_view_insets(gfx::Insets( @@ -99,7 +86,7 @@ ConflictingModuleView* bubble_delegate = new ConflictingModuleView(anchor_view, browser, url); - views::BubbleDelegateView::CreateBubble(bubble_delegate); + views::BubbleDialogDelegateView::CreateBubble(bubble_delegate); bubble_delegate->ShowBubble(); done_checking = true; @@ -121,68 +108,46 @@ bubble_shown.SetValue(bubble_shown.GetValue() + 1); } -void ConflictingModuleView::DismissBubble() { - GetWidget()->Close(); - +void ConflictingModuleView::OnWidgetClosing(views::Widget* widget) { + views::BubbleDialogDelegateView::OnWidgetClosing(widget); content::RecordAction( UserMetricsAction("ConflictingModuleNotificationDismissed")); } +bool ConflictingModuleView::Accept() { + browser_->OpenURL(content::OpenURLParams( + help_center_url_, content::Referrer(), NEW_FOREGROUND_TAB, + ui::PAGE_TRANSITION_LINK, false)); + EnumerateModulesModel::GetInstance()->AcknowledgeConflictNotification(); + return true; +} + +base::string16 ConflictingModuleView::GetDialogButtonLabel( + ui::DialogButton button) const { + return l10n_util::GetStringUTF16(button == ui::DIALOG_BUTTON_OK + ? IDS_CONFLICTS_LEARN_MORE + : IDS_CONFLICTS_NOT_NOW); +} + void ConflictingModuleView::Init() { ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); - views::GridLayout* layout = views::GridLayout::CreatePanel(this); - layout->SetInsets(kInsetTop, kInsetLeft, - kInsetBottomRight, kInsetBottomRight); - SetLayoutManager(layout); + SetLayoutManager( + new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, + views::kRelatedControlHorizontalSpacing)); views::ImageView* icon = new views::ImageView(); - icon->SetImage(rb.GetNativeImageNamed(IDR_INPUT_ALERT_MENU).ToImageSkia()); - gfx::Size icon_size = icon->GetPreferredSize(); + icon->SetImage(rb.GetImageSkiaNamed(IDR_INPUT_ALERT_MENU)); + AddChildView(icon); - const int text_column_set_id = 0; - views::ColumnSet* upper_columns = layout->AddColumnSet(text_column_set_id); - upper_columns->AddColumn( - views::GridLayout::LEADING, views::GridLayout::LEADING, - 0, views::GridLayout::FIXED, icon_size.width(), icon_size.height()); - upper_columns->AddPaddingColumn(0, views::kRelatedControlHorizontalSpacing); - upper_columns->AddColumn( - views::GridLayout::LEADING, views::GridLayout::LEADING, - 0, views::GridLayout::USE_PREF, 0, 0); - - layout->StartRowWithPadding( - 0, text_column_set_id, 0, kHeadlineMessagePadding); - layout->AddView(icon); - explanation_ = new views::Label(); - explanation_->SetMultiLine(true); - explanation_->SetHorizontalAlignment(gfx::ALIGN_LEFT); - explanation_->SetText(l10n_util::GetStringUTF16( - IDS_OPTIONS_CONFLICTING_MODULE)); - explanation_->SizeToFit(views::Widget::GetLocalizedContentsWidth( + views::Label* explanation = new views::Label(); + explanation->SetMultiLine(true); + explanation->SetHorizontalAlignment(gfx::ALIGN_LEFT); + explanation->SetText( + l10n_util::GetStringUTF16(IDS_OPTIONS_CONFLICTING_MODULE)); + explanation->SizeToFit(views::Widget::GetLocalizedContentsWidth( IDS_CONFLICTING_MODULE_BUBBLE_WIDTH_CHARS)); - layout->AddView(explanation_); - - const int action_row_column_set_id = 1; - views::ColumnSet* bottom_columns = - layout->AddColumnSet(action_row_column_set_id); - bottom_columns->AddPaddingColumn(1, 0); - bottom_columns->AddColumn(views::GridLayout::TRAILING, - views::GridLayout::CENTER, 0, views::GridLayout::USE_PREF, 0, 0); - bottom_columns->AddPaddingColumn(0, views::kRelatedButtonHSpacing); - bottom_columns->AddColumn(views::GridLayout::TRAILING, - views::GridLayout::CENTER, 0, views::GridLayout::USE_PREF, 0, 0); - layout->AddPaddingRow(0, 7); - - layout->StartRowWithPadding(0, action_row_column_set_id, - 0, kMessageBubblePadding); - learn_more_button_ = new views::LabelButton(this, - l10n_util::GetStringUTF16(IDS_CONFLICTS_LEARN_MORE)); - learn_more_button_->SetStyle(views::Button::STYLE_BUTTON); - layout->AddView(learn_more_button_); - not_now_button_ = new views::LabelButton(this, - l10n_util::GetStringUTF16(IDS_CONFLICTS_NOT_NOW)); - not_now_button_->SetStyle(views::Button::STYLE_BUTTON); - layout->AddView(not_now_button_); + AddChildView(explanation); content::RecordAction( UserMetricsAction("ConflictingModuleNotificationShown")); @@ -192,33 +157,9 @@ EnumerateModulesModel::ACTION_BOUNDARY); } -void ConflictingModuleView::ButtonPressed(views::Button* sender, - const ui::Event& event) { - if (sender == learn_more_button_) { - browser_->OpenURL( - content::OpenURLParams(help_center_url_, - content::Referrer(), - NEW_FOREGROUND_TAB, - ui::PAGE_TRANSITION_LINK, - false)); - - EnumerateModulesModel* model = EnumerateModulesModel::GetInstance(); - model->AcknowledgeConflictNotification(); - DismissBubble(); - } else if (sender == not_now_button_) { - DismissBubble(); - } -} - void ConflictingModuleView::GetAccessibleState( ui::AXViewState* state) { - state->role = ui::AX_ROLE_ALERT; -} - -void ConflictingModuleView::ViewHierarchyChanged( - const ViewHierarchyChangedDetails& details) { - if (details.is_add && details.child == this) - NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); + state->role = ui::AX_ROLE_ALERT_DIALOG; } void ConflictingModuleView::Observe(
diff --git a/chrome/browser/ui/views/conflicting_module_view_win.h b/chrome/browser/ui/views/conflicting_module_view_win.h index 63794e5..14dd4a7 100644 --- a/chrome/browser/ui/views/conflicting_module_view_win.h +++ b/chrome/browser/ui/views/conflicting_module_view_win.h
@@ -8,21 +8,14 @@ #include "base/macros.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" -#include "ui/views/bubble/bubble_delegate.h" -#include "ui/views/controls/button/button.h" +#include "ui/views/bubble/bubble_dialog_delegate.h" #include "url/gurl.h" class Browser; -namespace views { -class Label; -class LabelButton; -} - // This is the class that implements the UI for the bubble showing that there // is a 3rd party module loaded that conflicts with Chrome. -class ConflictingModuleView : public views::BubbleDelegateView, - public views::ButtonListener, +class ConflictingModuleView : public views::BubbleDialogDelegateView, public content::NotificationObserver { public: ConflictingModuleView(views::View* anchor_view, @@ -38,20 +31,14 @@ // Shows the bubble and updates the counter for how often it has been shown. void ShowBubble(); - // Dismiss and make sure the bubble is not shown again. This bubble is a - // single-appearance bubble. - void DismissBubble(); - - // views::BubbleDelegateView implementation: + // views::BubbleDialogDelegateView implementation: + void OnWidgetClosing(views::Widget* widget) override; + bool Accept() override; + base::string16 GetDialogButtonLabel(ui::DialogButton button) const override; void Init() override; - // views::ButtonListener implementation. - void ButtonPressed(views::Button* sender, const ui::Event& event) override; - // views::View implementation. void GetAccessibleState(ui::AXViewState* state) override; - void ViewHierarchyChanged( - const ViewHierarchyChangedDetails& details) override; // content::NotificationObserver implementation. void Observe( @@ -63,11 +50,6 @@ content::NotificationRegistrar registrar_; - // The headline, labels and buttons on the bubble. - views::Label* explanation_; - views::LabelButton* learn_more_button_; - views::LabelButton* not_now_button_; - // The link to the help center for this conflict. GURL help_center_url_;
diff --git a/chrome/browser/ui/views/elevation_icon_setter.cc b/chrome/browser/ui/views/elevation_icon_setter.cc index 7ad062fa..9e651426 100644 --- a/chrome/browser/ui/views/elevation_icon_setter.cc +++ b/chrome/browser/ui/views/elevation_icon_setter.cc
@@ -15,8 +15,8 @@ #include <shellapi.h> #include "base/win/win_util.h" #include "base/win/windows_version.h" +#include "ui/display/win/dpi.h" #include "ui/gfx/icon_util.h" -#include "ui/gfx/win/dpi.h" #endif @@ -81,7 +81,7 @@ #if defined(OS_WIN) // Windows gives us back a correctly-scaled image for the current DPI, so // mark this image as having been scaled for the current DPI already. - device_scale_factor = gfx::GetDPIScale(); + device_scale_factor = display::win::GetDPIScale(); #endif button_->SetImage( views::Button::STATE_NORMAL,
diff --git a/chrome/browser/ui/views/frame/glass_browser_frame_view.cc b/chrome/browser/ui/views/frame/glass_browser_frame_view.cc index 04fbcb0..b955342 100644 --- a/chrome/browser/ui/views/frame/glass_browser_frame_view.cc +++ b/chrome/browser/ui/views/frame/glass_browser_frame_view.cc
@@ -26,11 +26,11 @@ #include "ui/base/material_design/material_design_controller.h" #include "ui/base/resource/resource_bundle_win.h" #include "ui/base/theme_provider.h" +#include "ui/display/win/dpi.h" #include "ui/gfx/canvas.h" #include "ui/gfx/icon_util.h" #include "ui/gfx/image/image.h" #include "ui/gfx/scoped_canvas.h" -#include "ui/gfx/win/dpi.h" #include "ui/resources/grit/ui_resources.h" #include "ui/views/controls/label.h" #include "ui/views/layout/layout_constants.h" @@ -228,10 +228,11 @@ // See if we're in the sysmenu region. We still have to check the tabstrip // first so that clicks in a tab don't get treated as sysmenu clicks. int nonclient_border_thickness = NonClientBorderThickness(false); - if (gfx::Rect(nonclient_border_thickness, - gfx::win::GetSystemMetricsInDIP(SM_CYSIZEFRAME), - gfx::win::GetSystemMetricsInDIP(SM_CXSMICON), - gfx::win::GetSystemMetricsInDIP(SM_CYSMICON)).Contains(point)) + gfx::Rect sys_menu_region(nonclient_border_thickness, + display::win::GetSystemMetricsInDIP(SM_CYSIZEFRAME), + display::win::GetSystemMetricsInDIP(SM_CXSMICON), + display::win::GetSystemMetricsInDIP(SM_CYSMICON)); + if (sys_menu_region.Contains(point)) return (frame_component == HTCLIENT) ? HTCLIENT : HTSYSMENU; if (frame_component != HTNOWHERE) @@ -300,7 +301,7 @@ int GlassBrowserFrameView::FrameBorderThickness() const { return (frame()->IsMaximized() || frame()->IsFullscreen()) ? - 0 : gfx::win::GetSystemMetricsInDIP(SM_CXSIZEFRAME); + 0 : display::win::GetSystemMetricsInDIP(SM_CXSIZEFRAME); } int GlassBrowserFrameView::FrameTopBorderHeight(bool restored) const { @@ -308,7 +309,7 @@ // frame has a 0 frame border around most edges and a CYSIZEFRAME-thick border // at the top (see AeroGlassFrame::OnGetMinMaxInfo()). return (frame()->IsFullscreen() && !restored) ? - 0 : gfx::win::GetSystemMetricsInDIP(SM_CYSIZEFRAME); + 0 : display::win::GetSystemMetricsInDIP(SM_CYSIZEFRAME); } int GlassBrowserFrameView::NonClientBorderThickness(bool restored) const { @@ -520,7 +521,7 @@ int button_y = frame()->IsMaximized() ? (FrameTopBorderHeight(false) - 1) : 1; profile_switcher_.view()->SetBounds( button_x, button_y, label_size.width(), - gfx::win::GetSystemMetricsInDIP(SM_CYMENUSIZE) + 1); + display::win::GetSystemMetricsInDIP(SM_CYMENUSIZE) + 1); } void GlassBrowserFrameView::LayoutIncognitoIcon() {
diff --git a/chrome/browser/ui/views/frame/minimize_button_metrics_win.cc b/chrome/browser/ui/views/frame/minimize_button_metrics_win.cc index 7d161f3..986f5e2 100644 --- a/chrome/browser/ui/views/frame/minimize_button_metrics_win.cc +++ b/chrome/browser/ui/views/frame/minimize_button_metrics_win.cc
@@ -7,7 +7,7 @@ #include "base/logging.h" #include "base/i18n/rtl.h" #include "ui/base/win/shell.h" -#include "ui/gfx/win/dpi.h" +#include "ui/display/win/dpi.h" namespace { @@ -32,7 +32,7 @@ // returning it. POINT minimize_button_corner = { titlebar_info.rgrect[2].left, 0 }; MapWindowPoints(HWND_DESKTOP, hwnd, &minimize_button_corner, 1); - return minimize_button_corner.x / gfx::GetDPIScale(); + return minimize_button_corner.x / display::win::GetDPIScale(); } } // namespace
diff --git a/chrome/browser/ui/views/location_bar/page_action_image_view_interactive_uitest.cc b/chrome/browser/ui/views/location_bar/page_action_image_view_interactive_uitest.cc index d53cd68..692f52b 100644 --- a/chrome/browser/ui/views/location_bar/page_action_image_view_interactive_uitest.cc +++ b/chrome/browser/ui/views/location_bar/page_action_image_view_interactive_uitest.cc
@@ -30,6 +30,10 @@ void SetUpCommandLine(base::CommandLine* command_line) override { ExtensionBrowserTest::SetUpCommandLine(command_line); + // We need to disable Media Router since having Media Router enabled will + // result in auto-enabling the redesign and breaking the test. + disable_media_router_.reset(new extensions::FeatureSwitch::ScopedOverride( + extensions::FeatureSwitch::media_router(), false)); // Testing page action-specific UI means we need to disable the redesign. disable_redesign_.reset(new extensions::FeatureSwitch::ScopedOverride( extensions::FeatureSwitch::extension_action_redesign(), false)); @@ -37,6 +41,8 @@ private: std::unique_ptr<extensions::FeatureSwitch::ScopedOverride> disable_redesign_; + std::unique_ptr<extensions::FeatureSwitch::ScopedOverride> + disable_media_router_; DISALLOW_COPY_AND_ASSIGN(PageActionImageViewInteractiveUITest); };
diff --git a/chrome/browser/ui/views/new_task_manager_view.cc b/chrome/browser/ui/views/new_task_manager_view.cc index 9cef45a..254071e 100644 --- a/chrome/browser/ui/views/new_task_manager_view.cc +++ b/chrome/browser/ui/views/new_task_manager_view.cc
@@ -11,6 +11,7 @@ #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/profiles/profile_window.h" #include "chrome/browser/task_management/task_manager_observer.h" +#include "chrome/browser/task_manager/task_manager.h" #include "chrome/browser/ui/browser_navigator_params.h" #include "chrome/browser/ui/task_manager/task_manager_columns.h" #include "chrome/browser/ui/user_manager.h" @@ -255,7 +256,8 @@ } kill_button_->SetEnabled(!selection_contains_browser_process && - !selections.empty()); + !selections.empty() && + TaskManager::IsEndProcessEnabled()); } void NewTaskManagerView::OnDoubleClick() {
diff --git a/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc b/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc index 2f349f9d..ce7f56d 100644 --- a/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc +++ b/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc
@@ -1092,6 +1092,64 @@ namespace { +void CloseTabsWhileDetachedStep2(const BrowserList* browser_list) { + ASSERT_EQ(2u, browser_list->size()); + Browser* old_browser = browser_list->get(0); + EXPECT_EQ("0 3", IDString(old_browser->tab_strip_model())); + Browser* new_browser = browser_list->get(1); + EXPECT_EQ("1 2", IDString(new_browser->tab_strip_model())); + chrome::CloseTab(new_browser); +} + +} // namespace + +#if defined(OS_CHROMEOS) +// TODO(sky,sad): Disabled as it fails due to resize locks with a real +// compositor. crbug.com/331924 +#define MAYBE_DeleteTabsWhileDetached DISABLED_DeleteTabsWhileDetached +#else +#define MAYBE_DeleteTabsWhileDetached DeleteTabsWhileDetached +#endif +// Selects 2 tabs out of 4, drags them out and closes the new browser window +// while dragging tabs. +IN_PROC_BROWSER_TEST_P(DetachToBrowserTabDragControllerTest, + MAYBE_DeleteTabsWhileDetached) { + // Add 3 tabs for a total of 4 tabs. + AddTabAndResetBrowser(browser()); + AddTabAndResetBrowser(browser()); + AddTabAndResetBrowser(browser()); + TabStrip* tab_strip = GetTabStripForBrowser(browser()); + EXPECT_EQ("0 1 2 3", IDString(browser()->tab_strip_model())); + + // Click the first tab and select two middle tabs. + gfx::Point tab_1_center(GetCenterInScreenCoordinates(tab_strip->tab_at(1))); + gfx::Point tab_2_center(GetCenterInScreenCoordinates(tab_strip->tab_at(2))); + ASSERT_TRUE(PressInput(tab_1_center)); + ASSERT_TRUE(ReleaseInput()); + browser()->tab_strip_model()->AddTabAtToSelection(1); + browser()->tab_strip_model()->AddTabAtToSelection(2); + // Press mouse button in the second tab and drag it enough to detach. + ASSERT_TRUE(PressInput(tab_2_center)); + ASSERT_TRUE(DragInputToNotifyWhenDone( + tab_2_center.x(), tab_2_center.y() + GetDetachY(tab_strip), + base::Bind(&CloseTabsWhileDetachedStep2, browser_list))); + QuitWhenNotDragging(); + + // Should not be dragging. + ASSERT_EQ(1u, browser_list->size()); + ASSERT_FALSE(tab_strip->IsDragSessionActive()); + ASSERT_FALSE(TabDragController::IsActive()); + + // Only tab "1" gets closed; tab "2" which was also selected gets restored. + // TODO(varkha): fix this expectation once closing a tab while dragging + // stops the drag and causes all selected tabs to get closed. + EXPECT_EQ("0 3 2", IDString(browser()->tab_strip_model())); + + EXPECT_FALSE(GetIsDragged(browser())); +} + +namespace { + void DeleteSourceDetachedStep2(WebContents* tab, const BrowserList* browser_list) { ASSERT_EQ(2u, browser_list->size());
diff --git a/chrome/browser/ui/views/task_manager_view.cc b/chrome/browser/ui/views/task_manager_view.cc index 7487bc4..cac4532 100644 --- a/chrome/browser/ui/views/task_manager_view.cc +++ b/chrome/browser/ui/views/task_manager_view.cc
@@ -537,7 +537,8 @@ } } kill_button_->SetEnabled(!selection_contains_browser_process && - !selection.empty()); + !selection.empty() && + TaskManager::IsEndProcessEnabled()); } void TaskManagerView::OnDoubleClick() {
diff --git a/chrome/browser/ui/views/translate/translate_bubble_view.h b/chrome/browser/ui/views/translate/translate_bubble_view.h index 3758847..d69f4ba 100644 --- a/chrome/browser/ui/views/translate/translate_bubble_view.h +++ b/chrome/browser/ui/views/translate/translate_bubble_view.h
@@ -73,7 +73,7 @@ TranslateBubbleModel* model() { return model_.get(); } - // views::BubbleDelegateView methods. + // views::BubbleDialogDelegateView methods. void Init() override; void ButtonPressed(views::Button* sender, const ui::Event& event) override;
diff --git a/chrome/browser/ui/views/website_settings/permissions_bubble_view.cc b/chrome/browser/ui/views/website_settings/permissions_bubble_view.cc index f7a62951..000a4de 100644 --- a/chrome/browser/ui/views/website_settings/permissions_bubble_view.cc +++ b/chrome/browser/ui/views/website_settings/permissions_bubble_view.cc
@@ -206,7 +206,8 @@ kItemMajorSpacing)); display_origin_ = url_formatter::FormatUrlForSecurityDisplay( - requests[0]->GetOrigin()); + requests[0]->GetOrigin(), + url_formatter::SchemeDisplay::OMIT_CRYPTOGRAPHIC); ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); for (size_t index = 0; index < requests.size(); index++) {
diff --git a/chrome/browser/ui/website_settings/website_settings.cc b/chrome/browser/ui/website_settings/website_settings.cc index 09ec5ba..27563c8 100644 --- a/chrome/browser/ui/website_settings/website_settings.cc +++ b/chrome/browser/ui/website_settings/website_settings.cc
@@ -187,7 +187,8 @@ } base::string16 GetSimpleSiteName(const GURL& url) { - return url_formatter::FormatUrlForSecurityDisplayOmitScheme(url); + return url_formatter::FormatUrlForSecurityDisplay( + url, url_formatter::SchemeDisplay::OMIT_HTTP_AND_HTTPS); } ChooserContextBase* GetUsbChooserContext(Profile* profile) {
diff --git a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc index ea154ef..c6f8ea2f 100644 --- a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc +++ b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
@@ -17,6 +17,7 @@ #include "chrome/browser/engagement/site_engagement_service.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_manager.h" +#include "chrome/browser/search/suggestions/suggestions_ui.h" #include "chrome/browser/ui/webui/about_ui.h" #include "chrome/browser/ui/webui/bookmarks_ui.h" #include "chrome/browser/ui/webui/components_ui.h" @@ -346,6 +347,8 @@ return &NewWebUI<ProfilerUI>; if (url.host() == chrome::kChromeUISignInInternalsHost) return &NewWebUI<SignInInternalsUI>; + if (url.host() == chrome::kChromeUISuggestionsHost) + return &NewWebUI<suggestions::SuggestionsUI>; if (url.host() == chrome::kChromeUISupervisedUserInternalsHost) return &NewWebUI<SupervisedUserInternalsUI>; if (url.host() == chrome::kChromeUISupervisedUserPassphrasePageHost)
diff --git a/chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.cc b/chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.cc index 894abae..31b680fa 100644 --- a/chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.cc +++ b/chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.cc
@@ -19,6 +19,7 @@ #include "chrome/browser/chromeos/login/screens/network_error.h" #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" #include "chrome/browser/chromeos/policy/enrollment_status_chromeos.h" +#include "chrome/browser/chromeos/policy/policy_oauth2_token_fetcher.h" #include "chrome/browser/ui/webui/chromeos/login/oobe_screen.h" #include "chrome/grit/generated_resources.h" #include "chromeos/network/network_state.h" @@ -120,6 +121,8 @@ // EnrollmentScreenHandler, WebUIMessageHandler implementation -- void EnrollmentScreenHandler::RegisterMessages() { + AddCallback("toggleFakeEnrollment", + &EnrollmentScreenHandler::HandleToggleFakeEnrollment); AddCallback("oauthEnrollClose", &EnrollmentScreenHandler::HandleClose); AddCallback("oauthEnrollCompleteLogin", @@ -456,6 +459,9 @@ } // EnrollmentScreenHandler, private ----------------------------- +void EnrollmentScreenHandler::HandleToggleFakeEnrollment() { + policy::PolicyOAuth2TokenFetcher::UseFakeTokensForTesting(); +} void EnrollmentScreenHandler::HandleClose(const std::string& reason) { DCHECK(controller_);
diff --git a/chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.h b/chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.h index 88a1a37..05b95145 100644 --- a/chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.h +++ b/chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.h
@@ -62,6 +62,7 @@ private: // Handlers for WebUI messages. + void HandleToggleFakeEnrollment(); void HandleClose(const std::string& reason); void HandleCompleteLogin(const std::string& user, const std::string& auth_code);
diff --git a/chrome/browser/ui/webui/options/autofill_options_handler.cc b/chrome/browser/ui/webui/options/autofill_options_handler.cc index 3cbb4029..397c110 100644 --- a/chrome/browser/ui/webui/options/autofill_options_handler.cc +++ b/chrome/browser/ui/webui/options/autofill_options_handler.cc
@@ -28,6 +28,7 @@ #include "chrome/grit/generated_resources.h" #include "components/autofill/content/browser/wallet/wallet_service_url.h" #include "components/autofill/core/browser/autofill_country.h" +#include "components/autofill/core/browser/autofill_data_util.h" #include "components/autofill/core/browser/autofill_profile.h" #include "components/autofill/core/browser/credit_card.h" #include "components/autofill/core/browser/personal_data_manager.h" @@ -97,23 +98,17 @@ std::string not_used; std::vector<AddressUiComponent> components = i18n::addressinput::BuildComponents( - country_code, - localization, - ui_language_code, - components_language_code == NULL ? - ¬_used : components_language_code); + country_code, localization, ui_language_code, + components_language_code ? components_language_code : ¬_used); if (components.empty()) { static const char kDefaultCountryCode[] = "US"; components = i18n::addressinput::BuildComponents( - kDefaultCountryCode, - localization, - ui_language_code, - components_language_code == NULL ? - ¬_used : components_language_code); + kDefaultCountryCode, localization, ui_language_code, + components_language_code ? components_language_code : ¬_used); } DCHECK(!components.empty()); - base::ListValue* line = NULL; + base::ListValue* line = nullptr; static const char kField[] = "field"; static const char kLength[] = "length"; for (size_t i = 0; i < components.size(); ++i) { @@ -209,7 +204,8 @@ namespace options { -AutofillOptionsHandler::AutofillOptionsHandler() : personal_data_(NULL) {} +AutofillOptionsHandler::AutofillOptionsHandler() + : personal_data_(nullptr), prior_profile_(nullptr) {} AutofillOptionsHandler::~AutofillOptionsHandler() { if (personal_data_) @@ -395,8 +391,8 @@ return; } - AutofillProfile* profile = personal_data_->GetProfileByGUID(guid); - if (!profile) { + prior_profile_ = personal_data_->GetProfileByGUID(guid); + if (!prior_profile_) { // There is a race where a user can click once on the close button and // quickly click again on the list item before the item is removed (since // the list is not updated until the model tells the list an item has been @@ -406,7 +402,7 @@ } base::DictionaryValue address; - AutofillProfileToDictionary(*profile, &address); + AutofillProfileToDictionary(*prior_profile_, &address); web_ui()->CallJavascriptFunction("AutofillOptions.editAddress", address); } @@ -481,12 +477,32 @@ AutofillProfile profile(guid, kSettingsOrigin); - base::string16 value; - if (args->GetString(arg_counter++, &value)) { - profile.SetInfo(AutofillType(autofill::NAME_FULL), value, - g_browser_process->GetApplicationLocale()); + base::string16 full_name; + if (args->GetString(arg_counter++, &full_name)) { + // Although First/Middle/Last are not displayed on the form, we transfer + // this information when they match the full name given. This is because it + // may not be possible later to correctly tokenize the concatenated full + // name; e.g., when the last name contains a space, the first word would be + // treated as a middle name. + if (prior_profile_ && autofill::data_util::ProfileMatchesFullName( + full_name, *prior_profile_)) { + profile.SetRawInfo(autofill::NAME_FULL, full_name); + + profile.SetRawInfo(autofill::NAME_FIRST, + prior_profile_->GetRawInfo(autofill::NAME_FIRST)); + profile.SetRawInfo(autofill::NAME_MIDDLE, + prior_profile_->GetRawInfo(autofill::NAME_MIDDLE)); + profile.SetRawInfo(autofill::NAME_LAST, + prior_profile_->GetRawInfo(autofill::NAME_LAST)); + } else { + // In contrast to SetRawInfo, SetInfo will naively attempt to populate the + // First/Middle/Last fields by tokenization. + profile.SetInfo(AutofillType(autofill::NAME_FULL), full_name, + g_browser_process->GetApplicationLocale()); + } } + base::string16 value; if (args->GetString(arg_counter++, &value)) profile.SetRawInfo(autofill::COMPANY_NAME, value); @@ -609,9 +625,7 @@ std::unique_ptr<base::ListValue> components(new base::ListValue); GetAddressComponents( base::UTF16ToUTF8(profile.GetRawInfo(autofill::ADDRESS_HOME_COUNTRY)), - profile.language_code(), - components.get(), - NULL); + profile.language_code(), components.get(), nullptr); address->Set(kComponents, components.release()); }
diff --git a/chrome/browser/ui/webui/options/autofill_options_handler.h b/chrome/browser/ui/webui/options/autofill_options_handler.h index ef00b3e..861ca9d 100644 --- a/chrome/browser/ui/webui/options/autofill_options_handler.h +++ b/chrome/browser/ui/webui/options/autofill_options_handler.h
@@ -106,6 +106,10 @@ // Unowned pointer, may not be NULL. autofill::PersonalDataManager* personal_data_; + // The profile which was last used to populate the Address Editor. Unowned; + // not populated until LoadAdressEditor is called. + autofill::AutofillProfile* prior_profile_; + DISALLOW_COPY_AND_ASSIGN(AutofillOptionsHandler); };
diff --git a/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc b/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc index 0ae9744..6d01cdf 100644 --- a/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc +++ b/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc
@@ -366,7 +366,11 @@ {"displayArrangement", IDS_SETTINGS_DISPLAY_ARRANGEMENT}, {"displayMirror", IDS_SETTINGS_DISPLAY_MIRROR}, {"displayMakePrimary", IDS_SETTINGS_DISPLAY_MAKE_PRIMARY}, - {"displayResolution", IDS_SETTINGS_DISPLAY_RESOLUTION}, + {"displayResolutionTitle", IDS_SETTINGS_DISPLAY_RESOLUTION_TITLE}, + {"displayResolutionText", IDS_SETTINGS_DISPLAY_RESOLUTION_TEXT}, + {"displayResolutionTextBest", IDS_SETTINGS_DISPLAY_RESOLUTION_TEXT_BEST}, + {"displayResolutionTextNative", + IDS_SETTINGS_DISPLAY_RESOLUTION_TEXT_NATIVE}, {"displayOrientation", IDS_SETTINGS_DISPLAY_ORIENTATION}, {"displayOrientationStandard", IDS_SETTINGS_DISPLAY_ORIENTATION_STANDARD}, };
diff --git a/chrome/browser/ui/webui/settings/settings_clear_browsing_data_handler.cc b/chrome/browser/ui/webui/settings/settings_clear_browsing_data_handler.cc index 66570f1..0cde828 100644 --- a/chrome/browser/ui/webui/settings/settings_clear_browsing_data_handler.cc +++ b/chrome/browser/ui/webui/settings/settings_clear_browsing_data_handler.cc
@@ -36,15 +36,18 @@ void ClearBrowsingDataHandler::RegisterMessages() { web_ui()->RegisterMessageCallback( - "performClearBrowserData", - base::Bind(&ClearBrowsingDataHandler::HandleClearBrowserData, + "clearBrowsingData", + base::Bind(&ClearBrowsingDataHandler::HandleClearBrowsingData, base::Unretained(this))); } -void ClearBrowsingDataHandler::HandleClearBrowserData( +void ClearBrowsingDataHandler::HandleClearBrowsingData( const base::ListValue* args) { // We should never be called when the previous clearing has not yet finished. CHECK(!remover_); + CHECK_EQ(1U, args->GetSize()); + CHECK(webui_callback_id_.empty()); + CHECK(args->GetString(0, &webui_callback_id_)); Profile* profile = Profile::FromWebUI(web_ui()); PrefService* prefs = profile->GetPrefs(); @@ -135,12 +138,16 @@ void ClearBrowsingDataHandler::OnBrowsingDataRemoverDone() { remover_->RemoveObserver(this); remover_ = nullptr; - web_ui()->CallJavascriptFunction("SettingsClearBrowserData.doneClearing"); + ResolveJavascriptCallback( + base::StringValue(webui_callback_id_), + *base::Value::CreateNullValue()); + webui_callback_id_.clear(); } void ClearBrowsingDataHandler::OnBrowsingHistoryPrefChanged() { web_ui()->CallJavascriptFunction( - "SettingsClearBrowserData.setAllowDeletingHistory", + "cr.webUIListenerCallback", + base::StringValue("browsing-history-pref-changed"), base::FundamentalValue(*allow_deleting_browser_history_)); }
diff --git a/chrome/browser/ui/webui/settings/settings_clear_browsing_data_handler.h b/chrome/browser/ui/webui/settings/settings_clear_browsing_data_handler.h index 39248a3..9059094 100644 --- a/chrome/browser/ui/webui/settings/settings_clear_browsing_data_handler.h +++ b/chrome/browser/ui/webui/settings/settings_clear_browsing_data_handler.h
@@ -33,8 +33,8 @@ void RegisterMessages() override; private: - // Javascript callback to start clearing data. - void HandleClearBrowserData(const base::ListValue* value); + // Clears browsing data, called by Javascript. + void HandleClearBrowsingData(const base::ListValue* value); // BrowsingDataRemover::Observer implementation. // Re-enables clear button once all requested data has been removed. @@ -46,6 +46,10 @@ // If non-null it means removal is in progress. BrowsingDataRemover* remover_; + // The WebUI callback ID of the last performClearBrowserData request. There + // can only be one such request in-flight. + std::string webui_callback_id_; + // Keeps track of whether clearing LSO data is supported. BooleanPrefMember clear_plugin_lso_data_enabled_;
diff --git a/chrome/browser/ui/window_sizer/window_sizer_ash.cc b/chrome/browser/ui/window_sizer/window_sizer_ash.cc index c9e8f7b..80501fc 100644 --- a/chrome/browser/ui/window_sizer/window_sizer_ash.cc +++ b/chrome/browser/ui/window_sizer/window_sizer_ash.cc
@@ -109,10 +109,6 @@ browser_->window() ? browser_->window()->GetNativeWindow() : NULL; ash::WindowPositioner::GetBoundsAndShowStateForNewWindow( - screen_, - browser_window, - is_saved_bounds, - passed_show_state, - bounds_in_screen, - show_state); + ash::wm::WmWindowAura::Get(browser_window), is_saved_bounds, + passed_show_state, bounds_in_screen, show_state); }
diff --git a/chrome/browser/ui/window_sizer/window_sizer_ash_unittest.cc b/chrome/browser/ui/window_sizer/window_sizer_ash_unittest.cc index 6d5a2dd..6ba5b8df 100644 --- a/chrome/browser/ui/window_sizer/window_sizer_ash_unittest.cc +++ b/chrome/browser/ui/window_sizer/window_sizer_ash_unittest.cc
@@ -518,53 +518,53 @@ gfx::Rect window_bounds; ui::WindowShowState out_show_state1 = ui::SHOW_STATE_DEFAULT; GetWindowBoundsAndShowState( - p1366x768, // The screen resolution. - p1366x768, // The monitor work area. - gfx::Rect(), // The second monitor. - gfx::Rect(), // The (persisted) bounds. - p1366x768, // The overall work area. - ui::SHOW_STATE_NORMAL, // The persisted show state. - ui::SHOW_STATE_DEFAULT, // The last show state. - DEFAULT, // No persisted values. - browser.get(), // Use this browser. - gfx::Rect(), // Don't request valid bounds. - &window_bounds, - &out_show_state1); + p1366x768, // The screen resolution. + p1366x768, // The monitor work area. + gfx::Rect(), // The second monitor. + gfx::Rect(), // The (persisted) bounds. + p1366x768, // The overall work area. + ui::SHOW_STATE_NORMAL, // The persisted show state. + ui::SHOW_STATE_DEFAULT, // The last show state. + DEFAULT, // No persisted values. + browser.get(), // Use this browser. + gfx::Rect(), // Don't request valid bounds. + 0u, // Display index. + &window_bounds, &out_show_state1); EXPECT_EQ(ui::SHOW_STATE_MAXIMIZED, out_show_state1); // If there is a stored coordinate however, that should be taken instead. ui::WindowShowState out_show_state2 = ui::SHOW_STATE_DEFAULT; GetWindowBoundsAndShowState( - p1366x768, // The screen resolution. - p1366x768, // The monitor work area. - gfx::Rect(), // The second monitor. - gfx::Rect(50, 100, 300, 150), // The (persisted) bounds. - p1366x768, // The overall work area. - ui::SHOW_STATE_NORMAL, // The persisted show state. - ui::SHOW_STATE_DEFAULT, // The last show state. - PERSISTED, // Set the persisted values. - browser.get(), // Use this browser. - gfx::Rect(), // Don't request valid bounds. - &window_bounds, - &out_show_state2); + p1366x768, // The screen resolution. + p1366x768, // The monitor work area. + gfx::Rect(), // The second monitor. + gfx::Rect(50, 100, 300, 150), // The (persisted) bounds. + p1366x768, // The overall work area. + ui::SHOW_STATE_NORMAL, // The persisted show state. + ui::SHOW_STATE_DEFAULT, // The last show state. + PERSISTED, // Set the persisted values. + browser.get(), // Use this browser. + gfx::Rect(), // Don't request valid bounds. + 0u, // Display index. + &window_bounds, &out_show_state2); EXPECT_EQ(ui::SHOW_STATE_NORMAL, out_show_state2); EXPECT_EQ("50,100 300x150", window_bounds.ToString()); // A larger monitor should not trigger auto-maximize. ui::WindowShowState out_show_state3 = ui::SHOW_STATE_DEFAULT; GetWindowBoundsAndShowState( - p1600x1200, // The screen resolution. - p1600x1200, // The monitor work area. - gfx::Rect(), // The second monitor. - gfx::Rect(), // The (persisted) bounds. - p1600x1200, // The overall work area. - ui::SHOW_STATE_NORMAL, // The persisted show state. - ui::SHOW_STATE_DEFAULT, // The last show state. - DEFAULT, // No persisted values. - browser.get(), // Use this browser. - gfx::Rect(), // Don't request valid bounds. - &window_bounds, - &out_show_state3); + p1600x1200, // The screen resolution. + p1600x1200, // The monitor work area. + gfx::Rect(), // The second monitor. + gfx::Rect(), // The (persisted) bounds. + p1600x1200, // The overall work area. + ui::SHOW_STATE_NORMAL, // The persisted show state. + ui::SHOW_STATE_DEFAULT, // The last show state. + DEFAULT, // No persisted values. + browser.get(), // Use this browser. + gfx::Rect(), // Don't request valid bounds. + 0u, // Display index. + &window_bounds, &out_show_state3); #if defined(OS_WIN) EXPECT_EQ(ui::SHOW_STATE_MAXIMIZED, out_show_state3); #else @@ -644,9 +644,11 @@ EXPECT_NE(ash::Shell::GetPrimaryRootWindow(), ash::Shell::GetTargetRootWindow()); gfx::Rect window_bounds; - GetWindowBounds(p1600x1200, p1600x1200, secondary_bounds, gfx::Rect(), - secondary_bounds, PERSISTED, new_browser.get(), gfx::Rect(), - &window_bounds); + ui::WindowShowState out_show_state = ui::SHOW_STATE_DEFAULT; + GetWindowBoundsAndShowState( + p1600x1200, p1600x1200, secondary_bounds, gfx::Rect(), secondary_bounds, + ui::SHOW_STATE_DEFAULT, ui::SHOW_STATE_DEFAULT, PERSISTED, + new_browser.get(), gfx::Rect(), 1u, &window_bounds, &out_show_state); // TODO(oshima): Use exact bounds when the window_sizer_ash is // moved to ash and changed to include the result from // RearrangeVisibleWindowOnShow.
diff --git a/chrome/browser/ui/window_sizer/window_sizer_common_unittest.cc b/chrome/browser/ui/window_sizer/window_sizer_common_unittest.cc index e4b783e..55fc103 100644 --- a/chrome/browser/ui/window_sizer/window_sizer_common_unittest.cc +++ b/chrome/browser/ui/window_sizer/window_sizer_common_unittest.cc
@@ -26,8 +26,16 @@ class TestScreen : public gfx::Screen { public: - TestScreen() {} - ~TestScreen() override {} + TestScreen() : previous_screen_(gfx::Screen::GetScreen()) { + gfx::Screen::SetScreenInstance(this); + } + ~TestScreen() override { gfx::Screen::SetScreenInstance(previous_screen_); } + + // Sets the index of the display returned from GetDisplayNearestWindow(). + // Only used on aura. + void set_index_of_display_nearest_window(int index) { + index_of_display_nearest_window_ = index; + } // Overridden from gfx::Screen: gfx::Point GetCursorScreenPoint() override { @@ -53,7 +61,7 @@ gfx::Display GetDisplayNearestWindow(gfx::NativeView view) const override { #if defined(USE_AURA) - return GetDisplayMatching(view->GetBoundsInScreen()); + return displays_[index_of_display_nearest_window_]; #else NOTREACHED(); return gfx::Display(); @@ -95,6 +103,8 @@ } private: + gfx::Screen* previous_screen_; + size_t index_of_display_nearest_window_ = 0u; std::vector<gfx::Display> displays_; DISALLOW_COPY_AND_ASSIGN(TestScreen); @@ -118,12 +128,11 @@ } // namespace -TestStateProvider::TestStateProvider(): - has_persistent_data_(false), - persistent_show_state_(ui::SHOW_STATE_DEFAULT), - has_last_active_data_(false), - last_active_show_state_(ui::SHOW_STATE_DEFAULT) { -} +TestStateProvider::TestStateProvider() + : has_persistent_data_(false), + persistent_show_state_(ui::SHOW_STATE_DEFAULT), + has_last_active_data_(false), + last_active_show_state_(ui::SHOW_STATE_DEFAULT) {} void TestStateProvider::SetPersistentState(const gfx::Rect& bounds, const gfx::Rect& work_area, @@ -168,24 +177,25 @@ int kWindowTilePixels = WindowSizer::kWindowTilePixels; // The window sizer commonly used test functions. -void GetWindowBoundsAndShowState( - const gfx::Rect& monitor1_bounds, - const gfx::Rect& monitor1_work_area, - const gfx::Rect& monitor2_bounds, - const gfx::Rect& bounds, - const gfx::Rect& work_area, - ui::WindowShowState show_state_persisted, - ui::WindowShowState show_state_last, - Source source, - const Browser* browser, - const gfx::Rect& passed_in, - gfx::Rect* out_bounds, - ui::WindowShowState* out_show_state) { +void GetWindowBoundsAndShowState(const gfx::Rect& monitor1_bounds, + const gfx::Rect& monitor1_work_area, + const gfx::Rect& monitor2_bounds, + const gfx::Rect& bounds, + const gfx::Rect& work_area, + ui::WindowShowState show_state_persisted, + ui::WindowShowState show_state_last, + Source source, + const Browser* browser, + const gfx::Rect& passed_in, + size_t display_index, + gfx::Rect* out_bounds, + ui::WindowShowState* out_show_state) { DCHECK(out_show_state); TestScreen test_screen; test_screen.AddDisplay(monitor1_bounds, monitor1_work_area); if (!monitor2_bounds.IsEmpty()) test_screen.AddDisplay(monitor2_bounds, monitor2_bounds); + test_screen.set_index_of_display_nearest_window(display_index); std::unique_ptr<TestStateProvider> sp(new TestStateProvider); if (source == PERSISTED || source == BOTH) sp->SetPersistentState(bounds, work_area, show_state_persisted, true); @@ -199,7 +209,6 @@ out_bounds, out_show_state); } - void GetWindowBounds(const gfx::Rect& monitor1_bounds, const gfx::Rect& monitor1_work_area, const gfx::Rect& monitor2_bounds, @@ -213,7 +222,7 @@ GetWindowBoundsAndShowState( monitor1_bounds, monitor1_work_area, monitor2_bounds, bounds, work_area, ui::SHOW_STATE_DEFAULT, ui::SHOW_STATE_DEFAULT, source, browser, - passed_in, out_bounds, &out_show_state); + passed_in, 0u, out_bounds, &out_show_state); } ui::WindowShowState GetWindowShowState(
diff --git a/chrome/browser/ui/window_sizer/window_sizer_common_unittest.h b/chrome/browser/ui/window_sizer/window_sizer_common_unittest.h index 7c73ac00..5e10dd2b 100644 --- a/chrome/browser/ui/window_sizer/window_sizer_common_unittest.h +++ b/chrome/browser/ui/window_sizer/window_sizer_common_unittest.h
@@ -94,6 +94,8 @@ // last active window, the persisted value which was stored earlier, both or // none. For all these states the |bounds| and |work_area| get used, for the // show states either |show_state_persisted| or |show_state_last| will be used. +// |display_index| is the index of the display to return from +// GetDisplayNearestWindow(), and is only used on aura. void GetWindowBoundsAndShowState(const gfx::Rect& monitor1_bounds, const gfx::Rect& monitor1_work_area, const gfx::Rect& monitor2_bounds, @@ -104,6 +106,7 @@ Source source, const Browser* browser, const gfx::Rect& passed_in, + size_t display_index, gfx::Rect* out_bounds, ui::WindowShowState* out_show_state);
diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index 563312d..fb2d36c 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi
@@ -565,8 +565,8 @@ 'browser/search/suggestions/image_fetcher_impl.h', 'browser/search/suggestions/suggestions_service_factory.cc', 'browser/search/suggestions/suggestions_service_factory.h', - 'browser/search/suggestions/suggestions_source.cc', - 'browser/search/suggestions/suggestions_source.h', + 'browser/search/suggestions/suggestions_ui.cc', + 'browser/search/suggestions/suggestions_ui.h', 'browser/search/thumbnail_source.cc', 'browser/search/thumbnail_source.h', 'browser/shell_integration.cc', @@ -1540,6 +1540,8 @@ 'browser/android/offline_pages/offline_page_tab_helper.h', 'browser/android/offline_pages/offline_page_utils.cc', 'browser/android/offline_pages/offline_page_utils.h', + 'browser/android/offline_pages/recent_tab_helper.cc', + 'browser/android/offline_pages/recent_tab_helper.h', ], 'chrome_browser_browser_process_sources': [ 'browser/browser_process.cc',
diff --git a/chrome/chrome_browser_chromeos.gypi b/chrome/chrome_browser_chromeos.gypi index d2533c2..1447da1 100644 --- a/chrome/chrome_browser_chromeos.gypi +++ b/chrome/chrome_browser_chromeos.gypi
@@ -37,6 +37,8 @@ 'browser/chromeos/app_mode/kiosk_app_manager.cc', 'browser/chromeos/app_mode/kiosk_app_manager.h', 'browser/chromeos/app_mode/kiosk_app_manager_observer.h', + 'browser/chromeos/app_mode/kiosk_app_update_install_gate.cc', + 'browser/chromeos/app_mode/kiosk_app_update_install_gate.h', 'browser/chromeos/app_mode/kiosk_app_update_service.cc', 'browser/chromeos/app_mode/kiosk_app_update_service.h', 'browser/chromeos/app_mode/kiosk_diagnosis_runner.cc',
diff --git a/chrome/chrome_browser_extensions.gypi b/chrome/chrome_browser_extensions.gypi index d1f21466..84d5ebc3 100644 --- a/chrome/chrome_browser_extensions.gypi +++ b/chrome/chrome_browser_extensions.gypi
@@ -758,6 +758,7 @@ 'browser/extensions/global_shortcut_listener_win.h', 'browser/extensions/global_shortcut_listener_x11.cc', 'browser/extensions/global_shortcut_listener_x11.h', + 'browser/extensions/install_gate.h', 'browser/extensions/install_observer.cc', 'browser/extensions/install_observer.h', 'browser/extensions/install_signer.cc', @@ -836,6 +837,8 @@ 'browser/extensions/token_cache/token_cache_service_factory.h', 'browser/extensions/unpacked_installer.cc', 'browser/extensions/unpacked_installer.h', + 'browser/extensions/update_install_gate.cc', + 'browser/extensions/update_install_gate.h', 'browser/extensions/updater/chrome_extension_downloader_factory.cc', 'browser/extensions/updater/chrome_extension_downloader_factory.h', 'browser/extensions/updater/chrome_update_client_config.cc',
diff --git a/chrome/chrome_browser_ui.gypi b/chrome/chrome_browser_ui.gypi index d53b887..69f8e8e 100644 --- a/chrome/chrome_browser_ui.gypi +++ b/chrome/chrome_browser_ui.gypi
@@ -745,8 +745,6 @@ 'browser/ui/app_list/arc/arc_app_utils.h', 'browser/ui/app_list/search/arc_app_result.cc', 'browser/ui/app_list/search/arc_app_result.h', - 'browser/ui/ash/launcher/arc_app_window_launcher_controller.cc', - 'browser/ui/ash/launcher/arc_app_window_launcher_controller.h', 'browser/ui/ash/launcher/arc_app_window_launcher_item_controller.cc', 'browser/ui/ash/launcher/arc_app_window_launcher_item_controller.h', 'browser/ui/ash/launcher/arc_launcher_context_menu.cc',
diff --git a/chrome/chrome_gpu.gypi b/chrome/chrome_gpu.gypi index a661c72..3241e11 100644 --- a/chrome/chrome_gpu.gypi +++ b/chrome/chrome_gpu.gypi
@@ -16,6 +16,10 @@ 'gpu/chrome_content_gpu_client.cc', 'gpu/chrome_content_gpu_client.h', ], + 'dependencies': [ + '../content/content.gyp:content_common', + '../content/content.gyp:content_gpu', + ], 'conditions': [ ['chromeos==1', { 'dependencies': [
diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi index 5992552..f28ee1cd 100644 --- a/chrome/chrome_tests.gypi +++ b/chrome/chrome_tests.gypi
@@ -711,6 +711,7 @@ 'browser/chromeos/accessibility/speech_monitor.cc', 'browser/chromeos/accessibility/speech_monitor.h', 'browser/chromeos/accessibility/touch_exploration_controller_browsertest.cc', + 'browser/chromeos/app_mode/kiosk_crash_restore_browsertest.cc', 'browser/chromeos/app_mode/kiosk_app_manager_browsertest.cc', 'browser/chromeos/app_mode/kiosk_app_update_service_browsertest.cc', 'browser/chromeos/attestation/attestation_policy_browsertest.cc',
diff --git a/chrome/chrome_tests_unit.gypi b/chrome/chrome_tests_unit.gypi index 3e72ea55..82332eb 100644 --- a/chrome/chrome_tests_unit.gypi +++ b/chrome/chrome_tests_unit.gypi
@@ -208,8 +208,8 @@ 'browser/profiles/profile_info_cache_unittest.h', 'browser/profiles/profile_manager_unittest.cc', 'browser/profiles/profile_shortcut_manager_unittest_win.cc', - 'browser/push_messaging/push_messaging_app_identifier_unittest.cc', 'browser/push_messaging/background_budget_service_unittest.cc', + 'browser/push_messaging/push_messaging_app_identifier_unittest.cc', 'browser/push_messaging/push_messaging_notification_manager_unittest.cc', 'browser/push_messaging/push_messaging_permission_context_unittest.cc', 'browser/push_messaging/push_messaging_service_unittest.cc', @@ -454,6 +454,7 @@ 'browser/extensions/api/permissions/permissions_api_helpers_unittest.cc', 'browser/extensions/api/preference/preference_api_prefs_unittest.cc', 'browser/extensions/api/proxy/proxy_api_helpers_unittest.cc', + 'browser/extensions/api/runtime/chrome_runtime_api_delegate_unittest.cc', 'browser/extensions/api/signed_in_devices/id_mapping_helper_unittest.cc', 'browser/extensions/api/signed_in_devices/signed_in_devices_api_unittest.cc', 'browser/extensions/api/signed_in_devices/signed_in_devices_manager_unittest.cc', @@ -539,6 +540,7 @@ 'browser/extensions/shared_module_service_unittest.cc', 'browser/extensions/standard_management_policy_provider_unittest.cc', 'browser/extensions/token_cache/token_cache_service_unittest.cc', + 'browser/extensions/update_install_gate_unittest.cc', 'browser/extensions/updater/extension_cache_fake.cc', 'browser/extensions/updater/extension_cache_fake.h', 'browser/extensions/updater/extension_updater_unittest.cc', @@ -1410,8 +1412,8 @@ 'browser/content_settings/content_settings_supervised_provider_unittest.cc', 'browser/supervised_user/child_accounts/family_info_fetcher_unittest.cc', 'browser/supervised_user/child_accounts/permission_request_creator_apiary_unittest.cc', - 'browser/supervised_user/experimental/supervised_user_async_url_checker_unittest.cc', 'browser/supervised_user/experimental/safe_search_url_reporter_unittest.cc', + 'browser/supervised_user/experimental/supervised_user_async_url_checker_unittest.cc', 'browser/supervised_user/supervised_user_bookmarks_handler_unittest.cc', 'browser/supervised_user/supervised_user_pref_store_unittest.cc', 'browser/supervised_user/supervised_user_service_unittest.cc', @@ -1568,12 +1570,12 @@ 'browser/ui/webui/options/password_manager_handler_unittest.cc', 'browser/ui/webui/options/pepper_flash_content_settings_utils_unittest.cc', 'browser/ui/webui/options/sync_setup_handler_unittest.cc', - 'browser/ui/webui/settings_utils_unittest.cc', - 'browser/ui/webui/settings/settings_manage_profile_handler_unittest.cc', 'browser/ui/webui/settings/people_handler_unittest.cc', 'browser/ui/webui/settings/profile_info_handler_unittest.cc', 'browser/ui/webui/settings/reset_settings_handler_unittest.cc', + 'browser/ui/webui/settings/settings_manage_profile_handler_unittest.cc', 'browser/ui/webui/settings/site_settings_handler_unittest.cc', + 'browser/ui/webui/settings_utils_unittest.cc', 'browser/ui/webui/signin/login_ui_service_unittest.cc', 'browser/ui/webui/sync_internals_message_handler_unittest.cc', 'browser/ui/webui/web_dialog_web_contents_delegate_unittest.cc', @@ -1648,6 +1650,7 @@ 'browser/android/offline_pages/offline_page_mhtml_archiver_unittest.cc', 'browser/android/offline_pages/offline_page_tab_helper_unittest.cc', 'browser/android/offline_pages/offline_page_utils_unittest.cc', + 'browser/android/offline_pages/recent_tab_helper_unittest.cc', 'browser/android/offline_pages/test_offline_page_model_builder.cc', 'browser/android/offline_pages/test_offline_page_model_builder.h', ],
diff --git a/chrome/common/chrome_features.cc b/chrome/common/chrome_features.cc index 6a62d37..067ebfb 100644 --- a/chrome/common/chrome_features.cc +++ b/chrome/common/chrome_features.cc
@@ -72,7 +72,7 @@ #if defined(OS_CHROMEOS) // Enables or disables the opt-in IME menu in the language settings page. const base::Feature kOptInImeMenu{"OptInImeMenu", - base::FEATURE_ENABLED_BY_DEFAULT}; + base::FEATURE_DISABLED_BY_DEFAULT}; #endif // defined(OS_CHROMEOS) } // namespace features
diff --git a/chrome/common/extensions/docs/templates/articles/manifest/file_handlers.html b/chrome/common/extensions/docs/templates/articles/manifest/file_handlers.html index 0d97af7..cce801f 100644 --- a/chrome/common/extensions/docs/templates/articles/manifest/file_handlers.html +++ b/chrome/common/extensions/docs/templates/articles/manifest/file_handlers.html
@@ -5,13 +5,13 @@ to specify what types of files the app can handle. An app can have multiple <code>file_handlers</code>, with each one having an identifier, a list of MIME types and/or a list of file extensions that can be handled. -The app can handle a file if it either has a matching file extension or -has a matching MIME type. -You can use a wildcard <code>"*"</code> in <code>types</code> or -<code>extensions</code> to indicate that the app can handle any file type or -<code>"<em>type</em>/*"</code> in <code>types</code> to indicate that the app -can handle any file with a MIME type of <code><em>type</em></code>. -Here's an example of specifying file handlers: +The app can handle a file if it either has a matching file extension or has a +matching MIME type. The app can also handle directories if +<code>include_directories</code> is set. You can use a wildcard <code>"*"</code> +in <code>types</code> or <code>extensions</code> to indicate that the app can +handle any file type or <code>"<em>type</em>/*"</code> in <code>types</code> +to indicate that the app can handle any file with a MIME type of +<code><em>type</em></code>. Here's an example of specifying file handlers: </p> <pre data-filename="manifest.json"> @@ -32,16 +32,17 @@ }, "any": { "extensions": [ - "*" + "*", + "include_directories": true ], } } </pre> <p> -To handle files, apps also need to declare the $(ref:fileSystem) -permission. Apps can then be passed files in the $(ref:app.runtime.onLaunched) -event - either from the system -file manager (currently supported on Chrome OS only) or by providing -a path on the <a href="../first_app#open">command line</a>. +To handle files or directories, apps also need to declare the $(ref:fileSystem) +permission. Apps can then be passed files or directories in the +$(ref:app.runtime.onLaunched) event - either from the system file manager +(currently supported on Chrome OS only) or by providing a path on the +<a href="../first_app#open">command line</a>. </p>
diff --git a/chrome/common/pref_names.cc b/chrome/common/pref_names.cc index 26d5dbc..73bb224 100644 --- a/chrome/common/pref_names.cc +++ b/chrome/common/pref_names.cc
@@ -1369,6 +1369,9 @@ // restored on startup. const char kTaskManagerColumnVisibility[] = "task_manager.column_visibility"; +// A boolean indicating if ending processes are enabled or disabled by policy. +const char kTaskManagerEndProcessEnabled[] = "task_manager.end_process_enabled"; + // A collection of position, size, and other data relating to app windows to // restore on startup. const char kAppWindowPlacement[] = "browser.app_window_placement";
diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h index bdc0ba5..e28d0f9572 100644 --- a/chrome/common/pref_names.h +++ b/chrome/common/pref_names.h
@@ -474,6 +474,7 @@ extern const char kBrowserWindowPlacementPopup[]; extern const char kTaskManagerWindowPlacement[]; extern const char kTaskManagerColumnVisibility[]; +extern const char kTaskManagerEndProcessEnabled[]; extern const char kAppWindowPlacement[]; extern const char kDownloadDefaultDirectory[];
diff --git a/chrome/common/safe_browsing/csd.proto b/chrome/common/safe_browsing/csd.proto index 1b3f3b6..415ff115 100644 --- a/chrome/common/safe_browsing/csd.proto +++ b/chrome/common/safe_browsing/csd.proto
@@ -358,6 +358,12 @@ // True if the .zip or DMG, etc, was 100% successfully unpacked. optional bool archive_valid = 26; + + // True if this ClientDownloadRequest is from a whitelisted domain. + optional bool skipped_url_whitelist = 28; + + // True if this ClientDownloadRequest contains a whitelisted certificate. + optional bool skipped_certificate_whitelist = 31; } message ClientDownloadResponse {
diff --git a/chrome/gpu/BUILD.gn b/chrome/gpu/BUILD.gn index d8c9405d..8ce64935 100644 --- a/chrome/gpu/BUILD.gn +++ b/chrome/gpu/BUILD.gn
@@ -4,6 +4,7 @@ static_library("gpu") { deps = [ + "//content/public/common", "//content/public/gpu", ]
diff --git a/chrome/installer/linux/common/apt.include b/chrome/installer/linux/common/apt.include index aabca09..cdc0c0e 100644 --- a/chrome/installer/linux/common/apt.include +++ b/chrome/installer/linux/common/apt.include
@@ -14,11 +14,28 @@ fi } -# Install the repository signing key (see also: -# https://www.google.com/linuxrepositories/) +# Install the repository/package signing keys, if they aren't already. +# (see also: https://www.google.com/linuxrepositories/) install_key() { APT_KEY="`which apt-key 2> /dev/null`" - if [ -x "$APT_KEY" ]; then + if [ ! -x "$APT_KEY" ]; then + return + fi + + NEED_KEYS=0 + "$APT_KEY" export 7fac5991 2>&1 | \ + grep -q -- "-----BEGIN PGP PUBLIC KEY BLOCK-----" + if [ $? -ne 0 ]; then + NEED_KEYS=1 + fi + + "$APT_KEY" export d38b4796 2>&1 | \ + grep -q -- "-----BEGIN PGP PUBLIC KEY BLOCK-----" + if [ $? -ne 0 ]; then + NEED_KEYS=1 + fi + + if [ $NEED_KEYS -eq 1 ]; then "$APT_KEY" add - >/dev/null 2>&1 <<KEYDATA -----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG v1.4.2.2 (GNU/Linux) @@ -51,6 +68,73 @@ /FJG =Quqp -----END PGP PUBLIC KEY BLOCK----- +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1 + +mQINBFcMjNMBEAC6Wr5QuLIFgz1V1EFPlg8ty2TsjQEl4VWftUAqWlMevJFWvYEx +BOsOZ6kNFfBfjAxgJNWTkxZrHzDl74R7KW/nUx6X57bpFjUyRaB8F3/NpWKSeIGS +pJT+0m2SgUNhLAn1WY/iNJGNaMl7lgUnaP+/ZsSNT9hyTBiH3Ev5VvAtMGhVI/u8 +P0EtTjXp4o2U+VqFTBGmZ6PJVhCFjZUeRByloHw8dGOshfXKgriebpioHvU8iQ2U +GV3WNIirB2Rq1wkKxXJ/9Iw+4l5m4GmXMs7n3XaYQoBj28H86YA1cYWSm5LR5iU2 +TneI1fJ3vwF2vpSXVBUUDk67PZhg6ZwGRT7GFWskC0z8PsWd5jwK20mA8EVKq0vN +BFmMK6i4fJU+ux17Rgvnc9tDSCzFZ1/4f43EZ41uTmmNXIDsaPCqwjvSS5ICadt2 +xeqTWDlzONUpOs5yBjF1cfJSdVxsfshvln2JXUwgIdKl4DLbZybuNFXnPffNLb2v +PtRJHO48O2UbeXS8n27PcuMoLRd7+r7TsqG2vBH4t/cB/1vsvWMbqnQlaJ5VsjeW +Tp8Gv9FJiKuU8PKiWsF4EGR/kAFyCB8QbJeQ6HrOT0CXLOaYHRu2TvJ4taY9doXn +98TgU03XTLcYoSp49cdkkis4K+9hd2dUqARVCG7UVd9PY60VVCKi47BVKQARAQAB +tFRHb29nbGUgSW5jLiAoTGludXggUGFja2FnZXMgU2lnbmluZyBBdXRob3JpdHkp +IDxsaW51eC1wYWNrYWdlcy1rZXltYXN0ZXJAZ29vZ2xlLmNvbT6JAjgEEwECACIF +AlcMjNMCGwMGCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheAAAoJEHch9jvTi0eW5CAP +/RELE/OAoA4o1cMBxJsljWgCgDig2Ge91bFCN0vExLcP0iByra7qPWJowXDJ5sCj +UBnCkrxGo5D15U7cW5FC0+qWU73q0AuG3OjKDQ49ecdRkYHwcvwWQvT5Lz3DwOGW +4armfEuzWXcUDeShR7AgfcTq+Pfoo3dHqdB8TmtNySu/AdJFmVH/xTiWYWrOSibh +yLuaSW/0cTkHW0GDk06MlDkcdkTzhO5GMDO7PUxBgCysTXFR0T9TVWDo9VwvuMww +2pE5foleA0X6PD/6GQpy3aX2xry8rhFvYplEa5zwXhqsscdKXlp1ZPZ4PMvvwe49 +5mY9n/1Rx1TmMvIcLHKP61sURMOve97Gipk/iD6oaeeT8I0khexHCQy7JMROoPMr +z5onVOt2rAGZScIZsm5FYGSt9eDKBWI6qpJ/5QoVhkRWjOXOchZlJHo+kLdg6jq2 +vOnIlFnXo0p6Rqf/IEq5PMh70vVZpk4tNYNy4zRx03ZTA9qXRLW+ftxSQIYMY5eC +Z31lqSH4EjqgtUG+zn2A6juKayb1nkt2O3F1wWOm6oTzNsAP5LdReJRlw151Jp4U +4ftGtw7ygq+nvokXL7YLuu8sbFqfFXcTPrAZa5M9gnC7GCnIQyF/WvqUnrcaC1jp +qBc+pkSJhROhN12QY8Po8AT8/UaUh/dPIiW5A4o8pOPEiEYEEBECAAYFAlcNtn8A +CgkQoECDD3+sWZGy3wCfWTMZWsipX+yG/VB4Q1FunIfEVHYAnimEXCjZ3IVyy5F1 +yU36PihDCjWqiEYEEBECAAYFAlcNtvEACgkQMUcsOzG36APnRwCeJ/bfGf8FBa4q +5TMw8p1GS1jWT5EAn2sc02481HHdTmZiW/CGWXmgE+OPuQINBFcMjcgBEACrL9gH +hdr6gQX4ZMA5slp628xOrHCsdLO54WNdPRKeFHXJqSSJi3fs8FxBWI4FnejeKUGb +F+MrOlFpKqELxaMje7bwZyap3izztZHszP3YmOoTBJvREGKdCkL82cLsChYD/Prg +E8crvkhSnq9evcsKAnziMxg/wDCChUL3Evqo29BeoB81f+E9wkrUTMCT/kVxt3pG +RalKX0UhrtKrpm8yRfjufJfwjkdwgvinkRGZ2GrWHj4LzMbi9/udYaJZ66Yw0hEU +4USxUB9vNtmSFrb4EB91T2rhc68dgQ4jYBI7K4Ebb8XaWAxb+IAq31l1UkiEA32F +4qUMoL6rChB4y6nHxOnTvs+XEb5TBwXVogjLRKTQs5U/HV9l7j+HAchk5y3im2N2 +UKmMxHqotvPZZUZPdaCRxUedQf9gR0yLZV+U9BcDuwjzL/zjrthNZYlEGJ6HZ/TL +STp4dDH+uXuLqMVWy5iquKtnbrnNTQtv5twD+Ajpgy60YLOJ9YaiJ4GjifOpzSk8 +3e1rJ3p/pX6B5NWQinVLZJzxyeOoh3iMjdmCDSnEXLrCmYv5g6jyV/Wbd4GYFuMK +8TT7+PQdWLcbZ/Lxc5w0s+c7+f5OfmKXO5KPHnnUsrF5DBaKRPjScpwePQitxeIg +lUgEMDkNruBhu1PzCxd3BtXgu++K3WdoH3VcgwARAQABiQREBBgBAgAPBQJXDI3I +AhsCBQkFo5qAAikJEHch9jvTi0eWwV0gBBkBAgAGBQJXDI3IAAoJEBOXvFNkDbVR +QSYP/0Ewr3T7e0soTz8g4QJLLVqZDZdX8Iez04idNHuvAu0AwdZ2wl0C+tMkD7l4 +R2aI6BKe/9wPndk/NJe+ZYcD/uzyiKIJQD48PrifNnwvHu9A80rE4BppQnplENeh +ibbWaGNJQONGFJx7QTYlFjS5LNlG1AX6mQjxvb423zOWSOmEamYXYBmYyMG6vkr/ +XTPzsldky8XFuPrJUZslL/Wlx31XQ1IrtkHHOYqWwr0hTc50/2O8H0ewl/dBZLq3 +EminZZ+tsTugof0j4SbxYhplw99nGwbN1uXy4L8/dWOUXnY5OgaTKZPF15zRMxXN +9FeylBVYpp5kzre/rRI6mQ2lafYHdbjvd7ryHF5JvYToSDXd0mzF2nLzm6jwsO84 +7ZNd5GdTD6/vcef1IJta1nSwA/hhLtgtlz6/tNncp3lEdCjAMx29jYPDX+Lqs9JA +xcJHufr82o6wM9TF24Q8ra8NbvB63odVidCfiHoOsIFDUrazH8XuaQzyZkI0bbzL +mgMAvMO6u1zPfe/TK6LdJg7AeAKScOJS38D5mmwaD1bABr67ebA/X5HdaomSDKVd +UYaewfTGBIsrWmCmKpdb+WfX4odFpNzXW/qskiBp5WSesKvN1QUkLJZDZD1kz2++ +Xul5B97s5LxLTLRwvgLoNaUFr3lnejzNLgdBpf6FnkA59syRUuIP/jiAZ2uJzXVK +PeRJqMGL+Ue2HiVEe8ima3SQIceqW8jKS7c7Nic6dMWxgnDpk5tJmVjrgfc0a9c1 +FY4GomUBbZFj+j73+WRk3EaVKIsty+xz48+rlJjdYFVCJo0Jp67jjjXOt6EOHTni +OA/ANtzRIzDMnWrwJZ7AxCGJ4YjLShkcRM9S30X0iuAkxNILX++SNOd8aqc2bFof +yTCkcbk6CIc1W00vffv1QGTNjstNpVSl9+bRmlJDqJWnDGk5Nl4Ncqd8X51V0tYE +g6WEK4OM83wx5Ew/TdTRq5jJkbCu2GYNaNNNgXW7bXSvT5VINbuP6dmbi1/8s0jK +JQOEBI3RxxoB+01Dgx9YdNfjsCM3hvQvykaWMALeZIpzbXxV118Y9QQUIRe2L+4X +ZACEAhWjj2K1wP7ODGTQrrM4q4sIw1l3l7yO9aXXN7likAAddT4WEpGV0CiorReO +J1y/sKJRJSI/npN1UK7wMazZ+yzhxN0qzG8sqREKJQnNuuGQQ/qIGb/oe4dPO0Fi +hAUGkWoa0bgtGVijN5fQSbMbV50kZYqaa9GnNQRnchmZb+pK2xLcK85hD1np37/A +m5o2ggoONj3qI3JaRHsZaOs1qPQcyd46OyIFUpHJIfk4nezDCoQYd93bWUGqDwxI +/n/CsdO0365yqDO/ADscehlVqdAupVv2 +=dmoF +-----END PGP PUBLIC KEY BLOCK----- KEYDATA fi }
diff --git a/chrome/installer/linux/common/repo.cron b/chrome/installer/linux/common/repo.cron index fbb3e74..2750e49 100755 --- a/chrome/installer/linux/common/repo.cron +++ b/chrome/installer/linux/common/repo.cron
@@ -25,8 +25,9 @@ . "$DEFAULTS_FILE" fi +install_key + if [ "$repo_add_once" = "true" ]; then - install_key create_sources_lists RES=$? # Sources creation succeeded, so stop trying.
diff --git a/chrome/installer/linux/common/rpm.include b/chrome/installer/linux/common/rpm.include index 7c8ef53..8122767 100644 --- a/chrome/installer/linux/common/rpm.include +++ b/chrome/installer/linux/common/rpm.include
@@ -3,14 +3,9 @@ # Install the repository signing key (see also: # https://www.google.com/linuxrepositories/) install_rpm_key() { - # Check to see if key already exists. - rpm -q gpg-pubkey-7fac5991-4615767f > /dev/null 2>&1 - if [ "$?" -eq "0" ]; then - # Key already exists - return 0 - fi - # This is to work around a bug in RPM 4.7.0. (see http://crbug.com/22312) - rpm -q gpg-pubkey-7fac5991-45f06f46 > /dev/null 2>&1 + # Check to see if all keys already exists. + rpm -q gpg-pubkey-7fac5991-4615767f \ + gpg-pubkey-d38b4796-570c8cd3 > /dev/null 2>&1 if [ "$?" -eq "0" ]; then # Key already exists return 0 @@ -51,6 +46,73 @@ /FJG =Quqp -----END PGP PUBLIC KEY BLOCK----- +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1 + +mQINBFcMjNMBEAC6Wr5QuLIFgz1V1EFPlg8ty2TsjQEl4VWftUAqWlMevJFWvYEx +BOsOZ6kNFfBfjAxgJNWTkxZrHzDl74R7KW/nUx6X57bpFjUyRaB8F3/NpWKSeIGS +pJT+0m2SgUNhLAn1WY/iNJGNaMl7lgUnaP+/ZsSNT9hyTBiH3Ev5VvAtMGhVI/u8 +P0EtTjXp4o2U+VqFTBGmZ6PJVhCFjZUeRByloHw8dGOshfXKgriebpioHvU8iQ2U +GV3WNIirB2Rq1wkKxXJ/9Iw+4l5m4GmXMs7n3XaYQoBj28H86YA1cYWSm5LR5iU2 +TneI1fJ3vwF2vpSXVBUUDk67PZhg6ZwGRT7GFWskC0z8PsWd5jwK20mA8EVKq0vN +BFmMK6i4fJU+ux17Rgvnc9tDSCzFZ1/4f43EZ41uTmmNXIDsaPCqwjvSS5ICadt2 +xeqTWDlzONUpOs5yBjF1cfJSdVxsfshvln2JXUwgIdKl4DLbZybuNFXnPffNLb2v +PtRJHO48O2UbeXS8n27PcuMoLRd7+r7TsqG2vBH4t/cB/1vsvWMbqnQlaJ5VsjeW +Tp8Gv9FJiKuU8PKiWsF4EGR/kAFyCB8QbJeQ6HrOT0CXLOaYHRu2TvJ4taY9doXn +98TgU03XTLcYoSp49cdkkis4K+9hd2dUqARVCG7UVd9PY60VVCKi47BVKQARAQAB +tFRHb29nbGUgSW5jLiAoTGludXggUGFja2FnZXMgU2lnbmluZyBBdXRob3JpdHkp +IDxsaW51eC1wYWNrYWdlcy1rZXltYXN0ZXJAZ29vZ2xlLmNvbT6JAjgEEwECACIF +AlcMjNMCGwMGCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheAAAoJEHch9jvTi0eW5CAP +/RELE/OAoA4o1cMBxJsljWgCgDig2Ge91bFCN0vExLcP0iByra7qPWJowXDJ5sCj +UBnCkrxGo5D15U7cW5FC0+qWU73q0AuG3OjKDQ49ecdRkYHwcvwWQvT5Lz3DwOGW +4armfEuzWXcUDeShR7AgfcTq+Pfoo3dHqdB8TmtNySu/AdJFmVH/xTiWYWrOSibh +yLuaSW/0cTkHW0GDk06MlDkcdkTzhO5GMDO7PUxBgCysTXFR0T9TVWDo9VwvuMww +2pE5foleA0X6PD/6GQpy3aX2xry8rhFvYplEa5zwXhqsscdKXlp1ZPZ4PMvvwe49 +5mY9n/1Rx1TmMvIcLHKP61sURMOve97Gipk/iD6oaeeT8I0khexHCQy7JMROoPMr +z5onVOt2rAGZScIZsm5FYGSt9eDKBWI6qpJ/5QoVhkRWjOXOchZlJHo+kLdg6jq2 +vOnIlFnXo0p6Rqf/IEq5PMh70vVZpk4tNYNy4zRx03ZTA9qXRLW+ftxSQIYMY5eC +Z31lqSH4EjqgtUG+zn2A6juKayb1nkt2O3F1wWOm6oTzNsAP5LdReJRlw151Jp4U +4ftGtw7ygq+nvokXL7YLuu8sbFqfFXcTPrAZa5M9gnC7GCnIQyF/WvqUnrcaC1jp +qBc+pkSJhROhN12QY8Po8AT8/UaUh/dPIiW5A4o8pOPEiEYEEBECAAYFAlcNtn8A +CgkQoECDD3+sWZGy3wCfWTMZWsipX+yG/VB4Q1FunIfEVHYAnimEXCjZ3IVyy5F1 +yU36PihDCjWqiEYEEBECAAYFAlcNtvEACgkQMUcsOzG36APnRwCeJ/bfGf8FBa4q +5TMw8p1GS1jWT5EAn2sc02481HHdTmZiW/CGWXmgE+OPuQINBFcMjcgBEACrL9gH +hdr6gQX4ZMA5slp628xOrHCsdLO54WNdPRKeFHXJqSSJi3fs8FxBWI4FnejeKUGb +F+MrOlFpKqELxaMje7bwZyap3izztZHszP3YmOoTBJvREGKdCkL82cLsChYD/Prg +E8crvkhSnq9evcsKAnziMxg/wDCChUL3Evqo29BeoB81f+E9wkrUTMCT/kVxt3pG +RalKX0UhrtKrpm8yRfjufJfwjkdwgvinkRGZ2GrWHj4LzMbi9/udYaJZ66Yw0hEU +4USxUB9vNtmSFrb4EB91T2rhc68dgQ4jYBI7K4Ebb8XaWAxb+IAq31l1UkiEA32F +4qUMoL6rChB4y6nHxOnTvs+XEb5TBwXVogjLRKTQs5U/HV9l7j+HAchk5y3im2N2 +UKmMxHqotvPZZUZPdaCRxUedQf9gR0yLZV+U9BcDuwjzL/zjrthNZYlEGJ6HZ/TL +STp4dDH+uXuLqMVWy5iquKtnbrnNTQtv5twD+Ajpgy60YLOJ9YaiJ4GjifOpzSk8 +3e1rJ3p/pX6B5NWQinVLZJzxyeOoh3iMjdmCDSnEXLrCmYv5g6jyV/Wbd4GYFuMK +8TT7+PQdWLcbZ/Lxc5w0s+c7+f5OfmKXO5KPHnnUsrF5DBaKRPjScpwePQitxeIg +lUgEMDkNruBhu1PzCxd3BtXgu++K3WdoH3VcgwARAQABiQREBBgBAgAPBQJXDI3I +AhsCBQkFo5qAAikJEHch9jvTi0eWwV0gBBkBAgAGBQJXDI3IAAoJEBOXvFNkDbVR +QSYP/0Ewr3T7e0soTz8g4QJLLVqZDZdX8Iez04idNHuvAu0AwdZ2wl0C+tMkD7l4 +R2aI6BKe/9wPndk/NJe+ZYcD/uzyiKIJQD48PrifNnwvHu9A80rE4BppQnplENeh +ibbWaGNJQONGFJx7QTYlFjS5LNlG1AX6mQjxvb423zOWSOmEamYXYBmYyMG6vkr/ +XTPzsldky8XFuPrJUZslL/Wlx31XQ1IrtkHHOYqWwr0hTc50/2O8H0ewl/dBZLq3 +EminZZ+tsTugof0j4SbxYhplw99nGwbN1uXy4L8/dWOUXnY5OgaTKZPF15zRMxXN +9FeylBVYpp5kzre/rRI6mQ2lafYHdbjvd7ryHF5JvYToSDXd0mzF2nLzm6jwsO84 +7ZNd5GdTD6/vcef1IJta1nSwA/hhLtgtlz6/tNncp3lEdCjAMx29jYPDX+Lqs9JA +xcJHufr82o6wM9TF24Q8ra8NbvB63odVidCfiHoOsIFDUrazH8XuaQzyZkI0bbzL +mgMAvMO6u1zPfe/TK6LdJg7AeAKScOJS38D5mmwaD1bABr67ebA/X5HdaomSDKVd +UYaewfTGBIsrWmCmKpdb+WfX4odFpNzXW/qskiBp5WSesKvN1QUkLJZDZD1kz2++ +Xul5B97s5LxLTLRwvgLoNaUFr3lnejzNLgdBpf6FnkA59syRUuIP/jiAZ2uJzXVK +PeRJqMGL+Ue2HiVEe8ima3SQIceqW8jKS7c7Nic6dMWxgnDpk5tJmVjrgfc0a9c1 +FY4GomUBbZFj+j73+WRk3EaVKIsty+xz48+rlJjdYFVCJo0Jp67jjjXOt6EOHTni +OA/ANtzRIzDMnWrwJZ7AxCGJ4YjLShkcRM9S30X0iuAkxNILX++SNOd8aqc2bFof +yTCkcbk6CIc1W00vffv1QGTNjstNpVSl9+bRmlJDqJWnDGk5Nl4Ncqd8X51V0tYE +g6WEK4OM83wx5Ew/TdTRq5jJkbCu2GYNaNNNgXW7bXSvT5VINbuP6dmbi1/8s0jK +JQOEBI3RxxoB+01Dgx9YdNfjsCM3hvQvykaWMALeZIpzbXxV118Y9QQUIRe2L+4X +ZACEAhWjj2K1wP7ODGTQrrM4q4sIw1l3l7yO9aXXN7likAAddT4WEpGV0CiorReO +J1y/sKJRJSI/npN1UK7wMazZ+yzhxN0qzG8sqREKJQnNuuGQQ/qIGb/oe4dPO0Fi +hAUGkWoa0bgtGVijN5fQSbMbV50kZYqaa9GnNQRnchmZb+pK2xLcK85hD1np37/A +m5o2ggoONj3qI3JaRHsZaOs1qPQcyd46OyIFUpHJIfk4nezDCoQYd93bWUGqDwxI +/n/CsdO0365yqDO/ADscehlVqdAupVv2 +=dmoF +-----END PGP PUBLIC KEY BLOCK----- KEYDATA rpm --import "$TMPKEY" rc=$?
diff --git a/chrome/installer/linux/common/rpmrepo.cron b/chrome/installer/linux/common/rpmrepo.cron index 1e6a3a6..8048c08 100755 --- a/chrome/installer/linux/common/rpmrepo.cron +++ b/chrome/installer/linux/common/rpmrepo.cron
@@ -22,6 +22,8 @@ . "$DEFAULTS_FILE" fi +install_rpm_key + if [ "$repo_add_once" = "true" ]; then determine_rpm_package_manager @@ -40,14 +42,6 @@ # See configure_urpmi() for details. configure_urpmi ;; - "yast") - # It looks as though yast/zypper has a lock on the RPM DB during - # postinstall, so we cannot add the signing key with install_rpm_key(). - # Instead, we attempt to do this here. If the user attempt to update before - # the cron job imports the key, Yast will grab the key from our server and - # prompt the user to accept the key. - install_rpm_key - ;; esac if [ $? -eq 0 ]; then
diff --git a/chrome/renderer/extensions/chrome_extensions_dispatcher_delegate.cc b/chrome/renderer/extensions/chrome_extensions_dispatcher_delegate.cc index c563949..ade3988 100644 --- a/chrome/renderer/extensions/chrome_extensions_dispatcher_delegate.cc +++ b/chrome/renderer/extensions/chrome_extensions_dispatcher_delegate.cc
@@ -133,11 +133,11 @@ // there's no reason to have its native handlers residing and being compiled // in //extensions. module_system->RegisterNativeHandler( - "i18n", - scoped_ptr<NativeHandler>(new extensions::I18NCustomBindings(context))); + "i18n", std::unique_ptr<NativeHandler>( + new extensions::I18NCustomBindings(context))); module_system->RegisterNativeHandler( "lazy_background_page", - scoped_ptr<NativeHandler>( + std::unique_ptr<NativeHandler>( new extensions::LazyBackgroundPageNativeHandler(context))); }
diff --git a/chrome/renderer/media/DEPS b/chrome/renderer/media/DEPS index 5475cf4..2483926 100644 --- a/chrome/renderer/media/DEPS +++ b/chrome/renderer/media/DEPS
@@ -3,4 +3,5 @@ "+media/video", # For basic video functions. "+media/base", # For basic media functions. "+media/cast", # For cast streaming library. + "+media/media_features.h", # For flag definitions. ]
diff --git a/chrome/renderer/media/chrome_key_systems.cc b/chrome/renderer/media/chrome_key_systems.cc index 70bc5079..e05fe0dc 100644 --- a/chrome/renderer/media/chrome_key_systems.cc +++ b/chrome/renderer/media/chrome_key_systems.cc
@@ -18,6 +18,7 @@ #include "components/cdm/renderer/widevine_key_systems.h" #include "content/public/renderer/render_thread.h" #include "media/base/eme_constants.h" +#include "media/media_features.h" #if defined(OS_ANDROID) #include "components/cdm/renderer/android_key_systems.h" @@ -190,6 +191,10 @@ #if defined(USE_PROPRIETARY_CODECS) if (codecs[i] == kCdmSupportedCodecAvc1) supported_codecs |= media::EME_CODEC_MP4_AVC1; +#if BUILDFLAG(ENABLE_MP4_VP9_DEMUXING) + if (codecs[i] == kCdmSupportedCodecVp9) + supported_codecs |= media::EME_CODEC_MP4_VP9; +#endif #endif // defined(USE_PROPRIETARY_CODECS) }
diff --git a/chrome/renderer/net/OWNERS b/chrome/renderer/net/OWNERS index 0c27a2f..fd1666b4 100644 --- a/chrome/renderer/net/OWNERS +++ b/chrome/renderer/net/OWNERS
@@ -1,3 +1,3 @@ jar@chromium.org mmenke@chromium.org -ttuttle@chromium.org +juliatuttle@chromium.org
diff --git a/chrome/service/cloud_print/cdd_conversion_win.cc b/chrome/service/cloud_print/cdd_conversion_win.cc index 2aad275..3b055e6 100644 --- a/chrome/service/cloud_print/cdd_conversion_win.cc +++ b/chrome/service/cloud_print/cdd_conversion_win.cc
@@ -18,10 +18,10 @@ return description.InitFromString(print_ticket_data); } -scoped_ptr<DEVMODE, base::FreeDeleter> CjtToDevMode( +std::unique_ptr<DEVMODE, base::FreeDeleter> CjtToDevMode( const base::string16& printer_name, const std::string& print_ticket) { - scoped_ptr<DEVMODE, base::FreeDeleter> dev_mode; + std::unique_ptr<DEVMODE, base::FreeDeleter> dev_mode; cloud_devices::CloudDeviceDescription description; if (!description.InitFromString(print_ticket))
diff --git a/chrome/service/cloud_print/cdd_conversion_win.h b/chrome/service/cloud_print/cdd_conversion_win.h index 2d6cf8e9..c3b71a4 100644 --- a/chrome/service/cloud_print/cdd_conversion_win.h +++ b/chrome/service/cloud_print/cdd_conversion_win.h
@@ -7,17 +7,17 @@ #include <windows.h> +#include <memory> #include <string> #include "base/memory/free_deleter.h" -#include "base/memory/scoped_ptr.h" #include "base/strings/string16.h" namespace cloud_print { bool IsValidCjt(const std::string& print_ticket); -scoped_ptr<DEVMODE, base::FreeDeleter> CjtToDevMode( +std::unique_ptr<DEVMODE, base::FreeDeleter> CjtToDevMode( const base::string16& printer_name, const std::string& print_ticket);
diff --git a/chrome/service/cloud_print/cloud_print_auth.h b/chrome/service/cloud_print/cloud_print_auth.h index 3b2e864..06692cb 100644 --- a/chrome/service/cloud_print/cloud_print_auth.h +++ b/chrome/service/cloud_print/cloud_print_auth.h
@@ -5,6 +5,7 @@ #ifndef CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_AUTH_H_ #define CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_AUTH_H_ +#include <memory> #include <string> #include "base/macros.h" @@ -80,7 +81,7 @@ Client* client_; gaia::OAuthClientInfo oauth_client_info_; - scoped_ptr<gaia::GaiaOAuthClient> oauth_client_; + std::unique_ptr<gaia::GaiaOAuthClient> oauth_client_; // The CloudPrintURLFetcher instance for the current request. scoped_refptr<CloudPrintURLFetcher> request_;
diff --git a/chrome/service/cloud_print/cloud_print_proxy.h b/chrome/service/cloud_print/cloud_print_proxy.h index bd575ba..257e21d 100644 --- a/chrome/service/cloud_print/cloud_print_proxy.h +++ b/chrome/service/cloud_print/cloud_print_proxy.h
@@ -6,11 +6,11 @@ #define CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_PROXY_H_ #include <list> +#include <memory> #include <string> #include <vector> #include "base/macros.h" -#include "base/memory/scoped_ptr.h" #include "base/threading/non_thread_safe.h" #include "chrome/service/cloud_print/cloud_print_proxy_backend.h" #include "chrome/service/cloud_print/cloud_print_wipeout.h" @@ -83,7 +83,7 @@ // Our asynchronous backend to communicate with sync components living on // other threads. - scoped_ptr<CloudPrintProxyBackend> backend_; + std::unique_ptr<CloudPrintProxyBackend> backend_; // This class does not own this. It is guaranteed to remain valid for the // lifetime of this class. ServiceProcessPrefs* service_prefs_; @@ -97,7 +97,7 @@ // successful authentication with the Cloud Print service. bool enabled_; // This is a cleanup class for unregistering printers on proxy disable. - scoped_ptr<CloudPrintWipeout> wipeout_; + std::unique_ptr<CloudPrintWipeout> wipeout_; DISALLOW_COPY_AND_ASSIGN(CloudPrintProxy); };
diff --git a/chrome/service/cloud_print/cloud_print_proxy_backend.cc b/chrome/service/cloud_print/cloud_print_proxy_backend.cc index 1aaa0f0..bc09b07 100644 --- a/chrome/service/cloud_print/cloud_print_proxy_backend.cc +++ b/chrome/service/cloud_print/cloud_print_proxy_backend.cc
@@ -138,7 +138,7 @@ // OAuth client info. gaia::OAuthClientInfo oauth_client_info_; // Notification (xmpp) handler. - scoped_ptr<notifier::PushClient> push_client_; + std::unique_ptr<notifier::PushClient> push_client_; // Indicates whether XMPP notifications are currently enabled. bool notifications_enabled_; // The time when notifications were enabled. Valid only when @@ -155,7 +155,7 @@ // Connector settings. ConnectorSettings settings_; std::string robot_email_; - scoped_ptr<CloudPrintTokenStore> token_store_; + std::unique_ptr<CloudPrintTokenStore> token_store_; DISALLOW_COPY_AND_ASSIGN(Core); };
diff --git a/chrome/service/cloud_print/cloud_print_url_fetcher.cc b/chrome/service/cloud_print/cloud_print_url_fetcher.cc index ef93735..9ccf523 100644 --- a/chrome/service/cloud_print/cloud_print_url_fetcher.cc +++ b/chrome/service/cloud_print/cloud_print_url_fetcher.cc
@@ -202,7 +202,7 @@ // response, we will retry (to handle the case where we got redirected // to a non-cloudprint-server URL eg. for authentication). bool succeeded = false; - scoped_ptr<base::DictionaryValue> response_dict = + std::unique_ptr<base::DictionaryValue> response_dict = ParseResponseJSON(data, &succeeded); if (response_dict) {
diff --git a/chrome/service/cloud_print/cloud_print_url_fetcher.h b/chrome/service/cloud_print/cloud_print_url_fetcher.h index 8ef6156c..00f8cdd 100644 --- a/chrome/service/cloud_print/cloud_print_url_fetcher.h +++ b/chrome/service/cloud_print/cloud_print_url_fetcher.h
@@ -5,10 +5,10 @@ #ifndef CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_URL_FETCHER_H_ #define CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_URL_FETCHER_H_ +#include <memory> #include <string> #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "base/time/time.h" #include "net/url_request/url_fetcher.h" #include "net/url_request/url_fetcher_delegate.h" @@ -156,7 +156,7 @@ void SetupRequestHeaders(); static CloudPrintURLFetcherFactory* factory(); - scoped_ptr<net::URLFetcher> request_; + std::unique_ptr<net::URLFetcher> request_; Delegate* delegate_; int num_retries_; std::string additional_headers_;
diff --git a/chrome/service/cloud_print/cloud_print_url_fetcher_unittest.cc b/chrome/service/cloud_print/cloud_print_url_fetcher_unittest.cc index 192bf0a..263212475 100644 --- a/chrome/service/cloud_print/cloud_print_url_fetcher_unittest.cc +++ b/chrome/service/cloud_print/cloud_print_url_fetcher_unittest.cc
@@ -57,7 +57,7 @@ private: // Not owned here. net::URLRequestThrottlerManager* throttler_manager_; - scoped_ptr<net::TestURLRequestContext> context_; + std::unique_ptr<net::TestURLRequestContext> context_; }; class TestCloudPrintURLFetcher : public CloudPrintURLFetcher {
diff --git a/chrome/service/cloud_print/connector_settings.h b/chrome/service/cloud_print/connector_settings.h index 2b20b3c..f8a14d2 100644 --- a/chrome/service/cloud_print/connector_settings.h +++ b/chrome/service/cloud_print/connector_settings.h
@@ -5,12 +5,12 @@ #ifndef CHROME_SERVICE_CLOUD_PRINT_CONNECTOR_SETTINGS_H_ #define CHROME_SERVICE_CLOUD_PRINT_CONNECTOR_SETTINGS_H_ +#include <memory> #include <set> #include <string> #include "base/gtest_prod_util.h" #include "base/macros.h" -#include "base/memory/scoped_ptr.h" #include "url/gurl.h" class ServiceProcessPrefs; @@ -91,7 +91,7 @@ Printers printers_; // Print system settings. - scoped_ptr<base::DictionaryValue> print_system_settings_; + std::unique_ptr<base::DictionaryValue> print_system_settings_; DISALLOW_COPY_AND_ASSIGN(ConnectorSettings); };
diff --git a/chrome/service/cloud_print/connector_settings_unittest.cc b/chrome/service/cloud_print/connector_settings_unittest.cc index 1fd20643..ccf2a21 100644 --- a/chrome/service/cloud_print/connector_settings_unittest.cc +++ b/chrome/service/cloud_print/connector_settings_unittest.cc
@@ -84,7 +84,7 @@ "{'foo',,}", }; for (size_t i = 0; i < arraysize(kEmptyJSons); ++i) { - scoped_ptr<ServiceProcessPrefs> prefs(CreateTestFile(kEmptyJSons[i])); + std::unique_ptr<ServiceProcessPrefs> prefs(CreateTestFile(kEmptyJSons[i])); ConnectorSettings settings; settings.InitFrom(prefs.get()); @@ -99,7 +99,8 @@ } TEST_F(ConnectorSettingsTest, InitFromFile) { - scoped_ptr<ServiceProcessPrefs> prefs(CreateTestFile(kServiceStateContent)); + std::unique_ptr<ServiceProcessPrefs> prefs( + CreateTestFile(kServiceStateContent)); ConnectorSettings settings; settings.InitFrom(prefs.get()); EXPECT_EQ("https://www.google.com/cloudprint", settings.server_url().spec()); @@ -115,7 +116,8 @@ } TEST_F(ConnectorSettingsTest, CopyFrom) { - scoped_ptr<ServiceProcessPrefs> prefs(CreateTestFile(kServiceStateContent)); + std::unique_ptr<ServiceProcessPrefs> prefs( + CreateTestFile(kServiceStateContent)); ConnectorSettings settings1; settings1.InitFrom(prefs.get()); @@ -136,7 +138,7 @@ } TEST_F(ConnectorSettingsTest, SettersTest) { - scoped_ptr<ServiceProcessPrefs> prefs(CreateTestFile("{}")); + std::unique_ptr<ServiceProcessPrefs> prefs(CreateTestFile("{}")); ConnectorSettings settings; settings.InitFrom(prefs.get()); EXPECT_FALSE(settings.xmpp_ping_enabled());
diff --git a/chrome/service/cloud_print/print_system_cups.cc b/chrome/service/cloud_print/print_system_cups.cc index 5751fdc..c16f56a 100644 --- a/chrome/service/cloud_print/print_system_cups.cc +++ b/chrome/service/cloud_print/print_system_cups.cc
@@ -13,6 +13,7 @@ #include <algorithm> #include <list> #include <map> +#include <memory> #include "base/bind.h" #include "base/files/file_path.h" @@ -21,7 +22,6 @@ #include "base/logging.h" #include "base/macros.h" #include "base/md5.h" -#include "base/memory/scoped_ptr.h" #include "base/rand_util.h" #include "base/single_thread_task_runner.h" #include "base/strings/string_number_conversions.h" @@ -535,7 +535,7 @@ const std::string& print_ticket_data, const std::string& print_ticket_mime_type) { DCHECK(initialized_); - scoped_ptr<base::Value> ticket_value( + std::unique_ptr<base::Value> ticket_value( base::JSONReader::Read(print_ticket_data)); return ticket_value != NULL && ticket_value->IsType(base::Value::TYPE_DICTIONARY); @@ -546,7 +546,8 @@ const std::string& print_ticket, std::map<std::string, std::string>* options) { DCHECK(options); - scoped_ptr<base::Value> ticket_value(base::JSONReader::Read(print_ticket)); + std::unique_ptr<base::Value> ticket_value( + base::JSONReader::Read(print_ticket)); if (ticket_value == NULL || !ticket_value->IsType(base::Value::TYPE_DICTIONARY)) { return false;
diff --git a/chrome/service/cloud_print/print_system_win.cc b/chrome/service/cloud_print/print_system_win.cc index c9f5597..fad5830 100644 --- a/chrome/service/cloud_print/print_system_win.cc +++ b/chrome/service/cloud_print/print_system_win.cc
@@ -4,12 +4,13 @@ #include "chrome/service/cloud_print/print_system.h" +#include <memory> + #include "base/command_line.h" #include "base/files/file_util.h" #include "base/json/json_writer.h" #include "base/macros.h" #include "base/memory/free_deleter.h" -#include "base/memory/scoped_ptr.h" #include "base/strings/utf_string_conversions.h" #include "base/thread_task_runner_handle.h" #include "base/win/object_watcher.h" @@ -262,7 +263,7 @@ base::string16 printer_wide = base::UTF8ToWide(printer_name); // We only support PDF and XPS documents for now. if (print_data_mime_type == kContentTypePDF) { - scoped_ptr<DEVMODE, base::FreeDeleter> dev_mode; + std::unique_ptr<DEVMODE, base::FreeDeleter> dev_mode; if (print_ticket_mime_type == kContentTypeJSON) { dev_mode = CjtToDevMode(printer_wide, print_ticket); } else { @@ -426,7 +427,7 @@ int render_dpi, const scoped_refptr<base::SingleThreadTaskRunner>& client_task_runner) { DCHECK(g_service_process->io_task_runner()->BelongsToCurrentThread()); - scoped_ptr<ServiceUtilityProcessHost> utility_host( + std::unique_ptr<ServiceUtilityProcessHost> utility_host( new ServiceUtilityProcessHost(this, client_task_runner.get())); // TODO(gene): For now we disabling autorotation for CloudPrinting. // Landscape/Portrait setting is passed in the print ticket and @@ -540,7 +541,7 @@ printing::PrinterCapsAndDefaults printer_info; if (succeeded) { printer_info.caps_mime_type = kContentTypeJSON; - scoped_ptr<base::DictionaryValue> description( + std::unique_ptr<base::DictionaryValue> description( PrinterSemanticCapsAndDefaultsToCdd(semantic_info)); if (description) { base::JSONWriter::WriteWithOptions( @@ -573,7 +574,7 @@ void GetPrinterCapsAndDefaultsImpl( const scoped_refptr<base::SingleThreadTaskRunner>& client_task_runner) { DCHECK(g_service_process->io_task_runner()->BelongsToCurrentThread()); - scoped_ptr<ServiceUtilityProcessHost> utility_host( + std::unique_ptr<ServiceUtilityProcessHost> utility_host( new ServiceUtilityProcessHost(this, client_task_runner.get())); if (utility_host->StartGetPrinterCapsAndDefaults(printer_name_)) { // The object will self-destruct when the child process dies. @@ -587,7 +588,7 @@ void GetPrinterSemanticCapsAndDefaultsImpl( const scoped_refptr<base::SingleThreadTaskRunner>& client_task_runner) { DCHECK(g_service_process->io_task_runner()->BelongsToCurrentThread()); - scoped_ptr<ServiceUtilityProcessHost> utility_host( + std::unique_ptr<ServiceUtilityProcessHost> utility_host( new ServiceUtilityProcessHost(this, client_task_runner.get())); if (utility_host->StartGetPrinterSemanticCapsAndDefaults(printer_name_)) { // The object will self-destruct when the child process dies. @@ -750,7 +751,7 @@ if (ERROR_INVALID_PARAMETER != last_error) { // ERROR_INVALID_PARAMETER normally means that the job id is not valid. DCHECK(last_error == ERROR_INSUFFICIENT_BUFFER); - scoped_ptr<BYTE[]> job_info_buffer(new BYTE[bytes_needed]); + std::unique_ptr<BYTE[]> job_info_buffer(new BYTE[bytes_needed]); if (GetJob(printer_handle.Get(), job_id, 1, job_info_buffer.get(), bytes_needed, &bytes_needed)) { JOB_INFO_1 *job_info =
diff --git a/chrome/service/cloud_print/printer_job_handler_unittest.cc b/chrome/service/cloud_print/printer_job_handler_unittest.cc index 443b133..0e43929 100644 --- a/chrome/service/cloud_print/printer_job_handler_unittest.cc +++ b/chrome/service/cloud_print/printer_job_handler_unittest.cc
@@ -2,11 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "chrome/service/cloud_print/printer_job_handler.h" + +#include <memory> + #include "base/files/file_path.h" #include "base/location.h" #include "base/md5.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "base/message_loop/message_loop.h" #include "base/single_thread_task_runner.h" #include "base/strings/stringprintf.h" @@ -15,7 +18,6 @@ #include "chrome/service/cloud_print/cloud_print_service_helpers.h" #include "chrome/service/cloud_print/cloud_print_token_store.h" #include "chrome/service/cloud_print/print_system.h" -#include "chrome/service/cloud_print/printer_job_handler.h" #include "net/http/http_response_headers.h" #include "net/http/http_status_code.h" #include "net/url_request/test_url_fetcher_factory.h" @@ -282,13 +284,13 @@ class TestURLFetcherCallback { public: - scoped_ptr<net::FakeURLFetcher> CreateURLFetcher( + std::unique_ptr<net::FakeURLFetcher> CreateURLFetcher( const GURL& url, net::URLFetcherDelegate* d, const std::string& response_data, net::HttpStatusCode response_code, net::URLRequestStatus::Status status) { - scoped_ptr<net::FakeURLFetcher> fetcher( + std::unique_ptr<net::FakeURLFetcher> fetcher( new net::FakeURLFetcher(url, d, response_data, response_code, status)); OnRequestCreate(url, fetcher.get()); return fetcher;
diff --git a/chrome/service/cloud_print/printer_job_queue_handler.h b/chrome/service/cloud_print/printer_job_queue_handler.h index dfb0d74..5c5b8db1 100644 --- a/chrome/service/cloud_print/printer_job_queue_handler.h +++ b/chrome/service/cloud_print/printer_job_queue_handler.h
@@ -6,6 +6,7 @@ #define CHROME_SERVICE_CLOUD_PRINT_PRINTER_JOB_QUEUE_HANDLER_H_ #include <map> +#include <memory> #include <string> #include <utility> #include <vector> @@ -13,7 +14,6 @@ #include "base/files/file_path.h" #include "base/macros.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/time/time.h" #include "chrome/common/cloud_print/cloud_print_constants.h" @@ -76,7 +76,7 @@ void JobDone(const std::string& job_id); private: - scoped_ptr<TimeProvider> time_provider_; + std::unique_ptr<TimeProvider> time_provider_; struct FailedJobMetadata { int retries_;
diff --git a/chrome/service/cloud_print/printer_job_queue_handler_unittest.cc b/chrome/service/cloud_print/printer_job_queue_handler_unittest.cc index e9353fb..082ded0 100644 --- a/chrome/service/cloud_print/printer_job_queue_handler_unittest.cc +++ b/chrome/service/cloud_print/printer_job_queue_handler_unittest.cc
@@ -53,7 +53,7 @@ class PrinterJobQueueHandlerTest : public ::testing::Test { protected: - scoped_ptr<base::Value> data_; + std::unique_ptr<base::Value> data_; const base::DictionaryValue* GetAsDictionary() const { const base::DictionaryValue* json_data_ = nullptr;
diff --git a/chrome/service/net/service_url_request_context_getter.h b/chrome/service/net/service_url_request_context_getter.h index caf439c8..c091ed3b 100644 --- a/chrome/service/net/service_url_request_context_getter.h +++ b/chrome/service/net/service_url_request_context_getter.h
@@ -5,9 +5,9 @@ #ifndef CHROME_SERVICE_NET_SERVICE_URL_REQUEST_CONTEXT_GETTER_H_ #define CHROME_SERVICE_NET_SERVICE_URL_REQUEST_CONTEXT_GETTER_H_ +#include <memory> #include <string> -#include "base/memory/scoped_ptr.h" #include "net/cookies/cookie_monster.h" #include "net/disk_cache/disk_cache.h" #include "net/dns/host_resolver.h" @@ -48,8 +48,8 @@ std::string user_agent_; scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_; - scoped_ptr<net::ProxyConfigService> proxy_config_service_; - scoped_ptr<net::URLRequestContext> url_request_context_; + std::unique_ptr<net::ProxyConfigService> proxy_config_service_; + std::unique_ptr<net::URLRequestContext> url_request_context_; }; #endif // CHROME_SERVICE_NET_SERVICE_URL_REQUEST_CONTEXT_GETTER_H_
diff --git a/chrome/service/service_ipc_server.cc b/chrome/service/service_ipc_server.cc index de82ad0..057105b 100644 --- a/chrome/service/service_ipc_server.cc +++ b/chrome/service/service_ipc_server.cc
@@ -86,7 +86,8 @@ return channel_->Send(msg); } -void ServiceIPCServer::AddMessageHandler(scoped_ptr<MessageHandler> handler) { +void ServiceIPCServer::AddMessageHandler( + std::unique_ptr<MessageHandler> handler) { message_handlers_.push_back(handler.release()); }
diff --git a/chrome/service/service_ipc_server.h b/chrome/service/service_ipc_server.h index 6d1c74d..34ed708 100644 --- a/chrome/service/service_ipc_server.h +++ b/chrome/service/service_ipc_server.h
@@ -7,10 +7,10 @@ #include <stdint.h> +#include <memory> #include <vector> #include "base/macros.h" -#include "base/memory/scoped_ptr.h" #include "base/memory/scoped_vector.h" #include "ipc/ipc_channel_handle.h" #include "ipc/ipc_listener.h" @@ -65,7 +65,7 @@ // is received that is not handled by the ServiceIPCServer itself, the // handlers will be called to handle the message in first-add first-call order // until it is handled or there are no more handlers. - void AddMessageHandler(scoped_ptr<MessageHandler> handler); + void AddMessageHandler(std::unique_ptr<MessageHandler> handler); bool is_ipc_client_connected() const { return ipc_client_connected_; } @@ -89,7 +89,7 @@ Client* client_; scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; IPC::ChannelHandle channel_handle_; - scoped_ptr<IPC::SyncChannel> channel_; + std::unique_ptr<IPC::SyncChannel> channel_; base::WaitableEvent* shutdown_event_; ScopedVector<MessageHandler> message_handlers_; @@ -97,7 +97,8 @@ bool ipc_client_connected_; // Calculates histograms deltas. - scoped_ptr<base::HistogramDeltaSerialization> histogram_delta_serializer_; + std::unique_ptr<base::HistogramDeltaSerialization> + histogram_delta_serializer_; DISALLOW_COPY_AND_ASSIGN(ServiceIPCServer); };
diff --git a/chrome/service/service_ipc_server_unittest.cc b/chrome/service/service_ipc_server_unittest.cc index c66e2abc..13a04c6 100644 --- a/chrome/service/service_ipc_server_unittest.cc +++ b/chrome/service/service_ipc_server_unittest.cc
@@ -6,6 +6,7 @@ #include "base/bind.h" #include "base/bind_helpers.h" +#include "base/memory/ptr_util.h" #include "base/message_loop/message_loop.h" #include "base/run_loop.h" #include "base/single_thread_task_runner.h" @@ -107,9 +108,9 @@ base::MessageLoopForUI main_message_loop_; base::Thread io_thread_; base::WaitableEvent shutdown_event_; - scoped_ptr<ServiceIPCServer> server_; + std::unique_ptr<ServiceIPCServer> server_; FakeChannelListener client_process_channel_listener_; - scoped_ptr<IPC::SyncChannel> client_process_channel_; + std::unique_ptr<IPC::SyncChannel> client_process_channel_; }; ServiceIPCServerTest::ServiceIPCServerTest() @@ -237,7 +238,7 @@ // itself. FakeMessageHandler* handler = new FakeMessageHandler(true /* should_handle */); - server_->AddMessageHandler(make_scoped_ptr(handler)); + server_->AddMessageHandler(base::WrapUnique(handler)); SendToServiceProcess(new ServiceMsg_DisableCloudPrintProxy()); ASSERT_EQ(1, handler->handle_message_calls_); } @@ -250,13 +251,13 @@ // being added until it is handled. FakeMessageHandler* handler1 = new FakeMessageHandler(false /* should_handle */); - server_->AddMessageHandler(make_scoped_ptr(handler1)); + server_->AddMessageHandler(base::WrapUnique(handler1)); FakeMessageHandler* handler2 = new FakeMessageHandler(true /* should_handle */); - server_->AddMessageHandler(make_scoped_ptr(handler2)); + server_->AddMessageHandler(base::WrapUnique(handler2)); FakeMessageHandler* handler3 = new FakeMessageHandler(true /* should_handle */); - server_->AddMessageHandler(make_scoped_ptr(handler3)); + server_->AddMessageHandler(base::WrapUnique(handler3)); SendToServiceProcess(new ServiceMsg_DisableCloudPrintProxy()); ASSERT_EQ(1, handler1->handle_message_calls_); ASSERT_EQ(1, handler2->handle_message_calls_);
diff --git a/chrome/service/service_main.cc b/chrome/service/service_main.cc index 03b0bcb..846bcc9 100644 --- a/chrome/service/service_main.cc +++ b/chrome/service/service_main.cc
@@ -30,7 +30,7 @@ base::StatisticsRecorder::Initialize(); // If there is already a service process running, quit now. - scoped_ptr<ServiceProcessState> state(new ServiceProcessState); + std::unique_ptr<ServiceProcessState> state(new ServiceProcessState); if (!state->Initialize()) return 0;
diff --git a/chrome/service/service_process.cc b/chrome/service/service_process.cc index 8cba1bca..9896ef6 100644 --- a/chrome/service/service_process.cc +++ b/chrome/service/service_process.cc
@@ -13,6 +13,7 @@ #include "base/i18n/rtl.h" #include "base/location.h" #include "base/macros.h" +#include "base/memory/ptr_util.h" #include "base/memory/singleton.h" #include "base/path_service.h" #include "base/single_thread_task_runner.h" @@ -84,7 +85,7 @@ // chrome executable's lifetime. void PrepareRestartOnCrashEnviroment( const base::CommandLine& parsed_command_line) { - scoped_ptr<base::Environment> env(base::Environment::Create()); + std::unique_ptr<base::Environment> env(base::Environment::Create()); // Clear this var so child processes don't show the dialog by default. env->UnSetVar(env_vars::kShowRestart); @@ -200,7 +201,7 @@ io_task_runner(), service_process_state_->GetServiceProcessChannel(), &shutdown_event_)); - ipc_server_->AddMessageHandler(make_scoped_ptr( + ipc_server_->AddMessageHandler(base::WrapUnique( new cloud_print::CloudPrintMessageHandler(ipc_server_.get(), this))); ipc_server_->Init();
diff --git a/chrome/service/service_process.h b/chrome/service/service_process.h index dc9cb98..fde5ce1 100644 --- a/chrome/service/service_process.h +++ b/chrome/service/service_process.h
@@ -5,11 +5,11 @@ #ifndef CHROME_SERVICE_SERVICE_PROCESS_H_ #define CHROME_SERVICE_SERVICE_PROCESS_H_ +#include <memory> #include <string> #include "base/macros.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "base/threading/thread.h" #include "chrome/service/cloud_print/cloud_print_proxy.h" #include "chrome/service/service_ipc_server.h" @@ -107,14 +107,14 @@ // Terminate forces the service process to quit. void Terminate(); - scoped_ptr<net::NetworkChangeNotifier> network_change_notifier_; - scoped_ptr<base::Thread> io_thread_; - scoped_ptr<base::Thread> file_thread_; + std::unique_ptr<net::NetworkChangeNotifier> network_change_notifier_; + std::unique_ptr<base::Thread> io_thread_; + std::unique_ptr<base::Thread> file_thread_; scoped_refptr<base::SequencedWorkerPool> blocking_pool_; - scoped_ptr<cloud_print::CloudPrintProxy> cloud_print_proxy_; - scoped_ptr<ServiceProcessPrefs> service_prefs_; - scoped_ptr<ServiceIPCServer> ipc_server_; - scoped_ptr<ServiceProcessState> service_process_state_; + std::unique_ptr<cloud_print::CloudPrintProxy> cloud_print_proxy_; + std::unique_ptr<ServiceProcessPrefs> service_prefs_; + std::unique_ptr<ServiceIPCServer> ipc_server_; + std::unique_ptr<ServiceProcessState> service_process_state_; // An event that will be signalled when we shutdown. base::WaitableEvent shutdown_event_;
diff --git a/chrome/service/service_process_prefs.cc b/chrome/service/service_process_prefs.cc index 7cbfda7..33846a6 100644 --- a/chrome/service/service_process_prefs.cc +++ b/chrome/service/service_process_prefs.cc
@@ -6,17 +6,16 @@ #include <utility> +#include "base/memory/ptr_util.h" #include "base/thread_task_runner_handle.h" #include "base/values.h" #include "components/prefs/pref_filter.h" -ServiceProcessPrefs::ServiceProcessPrefs( - const base::FilePath& pref_filename, - base::SequencedTaskRunner* task_runner) +ServiceProcessPrefs::ServiceProcessPrefs(const base::FilePath& pref_filename, + base::SequencedTaskRunner* task_runner) : prefs_(new JsonPrefStore(pref_filename, task_runner, - scoped_ptr<PrefFilter>())) { -} + std::unique_ptr<PrefFilter>())) {} ServiceProcessPrefs::~ServiceProcessPrefs() {} @@ -41,7 +40,7 @@ void ServiceProcessPrefs::SetString(const std::string& key, const std::string& value) { - prefs_->SetValue(key, make_scoped_ptr(new base::StringValue(value)), + prefs_->SetValue(key, base::WrapUnique(new base::StringValue(value)), WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); } @@ -56,7 +55,7 @@ } void ServiceProcessPrefs::SetBoolean(const std::string& key, bool value) { - prefs_->SetValue(key, make_scoped_ptr(new base::FundamentalValue(value)), + prefs_->SetValue(key, base::WrapUnique(new base::FundamentalValue(value)), WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); } @@ -71,7 +70,7 @@ } void ServiceProcessPrefs::SetInt(const std::string& key, int value) { - prefs_->SetValue(key, make_scoped_ptr(new base::FundamentalValue(value)), + prefs_->SetValue(key, base::WrapUnique(new base::FundamentalValue(value)), WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); } @@ -96,7 +95,7 @@ } void ServiceProcessPrefs::SetValue(const std::string& key, - scoped_ptr<base::Value> value) { + std::unique_ptr<base::Value> value) { prefs_->SetValue(key, std::move(value), WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); }
diff --git a/chrome/service/service_process_prefs.h b/chrome/service/service_process_prefs.h index cae0542..21ef0a9 100644 --- a/chrome/service/service_process_prefs.h +++ b/chrome/service/service_process_prefs.h
@@ -5,6 +5,7 @@ #ifndef CHROME_SERVICE_SERVICE_PROCESS_PREFS_H_ #define CHROME_SERVICE_SERVICE_PROCESS_PREFS_H_ +#include <memory> #include <string> #include "base/macros.h" @@ -57,7 +58,7 @@ const base::ListValue* GetList(const std::string& key) const; // Set a |value| for |key|. - void SetValue(const std::string& key, scoped_ptr<base::Value> value); + void SetValue(const std::string& key, std::unique_ptr<base::Value> value); // Removes the pref specified by |key|. void RemovePref(const std::string& key);
diff --git a/chrome/service/service_process_prefs_unittest.cc b/chrome/service/service_process_prefs_unittest.cc index ed5ad04..494b8bf3 100644 --- a/chrome/service/service_process_prefs_unittest.cc +++ b/chrome/service/service_process_prefs_unittest.cc
@@ -27,7 +27,7 @@ base::ScopedTempDir temp_dir_; // A message loop that we can use as the file thread message loop. base::MessageLoop message_loop_; - scoped_ptr<ServiceProcessPrefs> prefs_; + std::unique_ptr<ServiceProcessPrefs> prefs_; }; // Test ability to retrieve prefs
diff --git a/chrome/service/service_utility_process_host.h b/chrome/service/service_utility_process_host.h index 024a85f..d5c3fe63 100644 --- a/chrome/service/service_utility_process_host.h +++ b/chrome/service/service_utility_process_host.h
@@ -5,11 +5,10 @@ #ifndef CHROME_SERVICE_SERVICE_UTILITY_PROCESS_HOST_H_ #define CHROME_SERVICE_SERVICE_UTILITY_PROCESS_HOST_H_ -#include "build/build_config.h" +#include <memory> #include "base/macros.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "content/public/common/child_process_host_delegate.h" #include "ipc/ipc_platform_file.h" @@ -142,7 +141,7 @@ void OnGetPrinterSemanticCapsAndDefaultsFailed( const std::string& printer_name); - scoped_ptr<content::ChildProcessHost> child_process_host_; + std::unique_ptr<content::ChildProcessHost> child_process_host_; base::Process process_; // A pointer to our client interface, who will be informed of progress. scoped_refptr<Client> client_; @@ -153,7 +152,7 @@ base::Time start_time_; class PdfToEmfState; - scoped_ptr<PdfToEmfState> pdf_to_emf_state_; + std::unique_ptr<PdfToEmfState> pdf_to_emf_state_; base::WeakPtrFactory<ServiceUtilityProcessHost> weak_ptr_factory_;
diff --git a/chrome/test/data/chromeos/app_mode/offline_enabled_kiosk_app/v2_required_platform_version_added.crx b/chrome/test/data/chromeos/app_mode/webstore/downloads/ajoggoflpgplnnjkjamcmbepjdjdnpdp_v2_required_platform_version_added.crx similarity index 100% rename from chrome/test/data/chromeos/app_mode/offline_enabled_kiosk_app/v2_required_platform_version_added.crx rename to chrome/test/data/chromeos/app_mode/webstore/downloads/ajoggoflpgplnnjkjamcmbepjdjdnpdp_v2_required_platform_version_added.crx Binary files differ
diff --git a/chrome/test/data/chromeos/app_mode/webstore/downloads/ajoggoflpgplnnjkjamcmbepjdjdnpdp_v2_required_platform_version_added.crx.mock-http-headers b/chrome/test/data/chromeos/app_mode/webstore/downloads/ajoggoflpgplnnjkjamcmbepjdjdnpdp_v2_required_platform_version_added.crx.mock-http-headers new file mode 100644 index 0000000..707bb1f --- /dev/null +++ b/chrome/test/data/chromeos/app_mode/webstore/downloads/ajoggoflpgplnnjkjamcmbepjdjdnpdp_v2_required_platform_version_added.crx.mock-http-headers
@@ -0,0 +1,2 @@ +HTTP/1.1 200 OK +Content-Type: application/x-chrome-extension
diff --git a/chrome/test/data/devtools/image.png b/chrome/test/data/devtools/image.png new file mode 100644 index 0000000..85f38b2 --- /dev/null +++ b/chrome/test/data/devtools/image.png Binary files differ
diff --git a/chrome/test/data/devtools/push_test_page.html b/chrome/test/data/devtools/push_test_page.html new file mode 100644 index 0000000..059c719 --- /dev/null +++ b/chrome/test/data/devtools/push_test_page.html
@@ -0,0 +1,12 @@ +<html> +<script> +function addImage(url) +{ + var image = document.createElement("img"); + image.src = url; + document.body.appendChild(image); +} +</script> +<body> +</body> +</html>
diff --git a/chrome/test/data/policy/policy_test_cases.json b/chrome/test/data/policy/policy_test_cases.json index 1ce28fe..060854e 100644 --- a/chrome/test/data/policy/policy_test_cases.json +++ b/chrome/test/data/policy/policy_test_cases.json
@@ -2707,6 +2707,17 @@ ] }, + "TaskManagerEndProcessEnabled": { + "os": ["win", "linux", "mac", "chromeos"], + "test_policy": { "TaskManagerEndProcessEnabled": false }, + "pref_mappings": [ + { + "pref": "task_manager.end_process_enabled", + "local_state": true + } + ] + }, + "----- Chrome Frame policies -------------------------------------------": {}, "ChromeFrameRendererSettings": {
diff --git a/chrome/test/data/webui/settings/cr_settings_browsertest.js b/chrome/test/data/webui/settings/cr_settings_browsertest.js index 1c82000..5ed9efa 100644 --- a/chrome/test/data/webui/settings/cr_settings_browsertest.js +++ b/chrome/test/data/webui/settings/cr_settings_browsertest.js
@@ -303,8 +303,8 @@ certificate_manager_page.registerTests(); mocha.run(); }); +GEN('#endif'); -GEN('#elif defined(OS_WIN) || defined(OS_MACOSX)'); /** * Test fixture for chrome/browser/resources/settings/privacy_page/. * @constructor @@ -326,9 +326,9 @@ }; TEST_F('CrSettingsPrivacyPageTest', 'PrivacyPage', function() { + settings_privacy_page.registerTests(); mocha.run(); }); -GEN('#endif'); /** * Test fixture for chrome/browser/resources/settings/site_settings/.
diff --git a/chrome/test/data/webui/settings/privacy_page_test.js b/chrome/test/data/webui/settings/privacy_page_test.js index 0d949a4..120096c 100644 --- a/chrome/test/data/webui/settings/privacy_page_test.js +++ b/chrome/test/data/webui/settings/privacy_page_test.js
@@ -21,26 +21,89 @@ }, }; - suite('PrivacyPage', function() { - /** @type {settings.TestPrivacyPageBrowserProxy} */ - var testBrowserProxy; + /** + * @constructor + * @extends {TestBrowserProxy} + * @implements {settings.ClearBrowsingDataBrowserProxy} + */ + function TestClearBrowsingDataBrowserProxy() { + settings.TestBrowserProxy.call(this, ['clearBrowsingData']); + } - /** @type {SettingsPrivacyPageElement} */ - var page; + TestClearBrowsingDataBrowserProxy.prototype = { + __proto__: settings.TestBrowserProxy.prototype, - setup(function() { - testBrowserProxy = new TestPrivacyPageBrowserProxy(); - settings.PrivacyPageBrowserProxyImpl.instance_ = testBrowserProxy; - PolymerTest.clearBody(); - page = document.createElement('settings-privacy-page'); - document.body.appendChild(page); + /** @override */ + clearBrowsingData: function() { + this.methodCalled('clearBrowsingData'); + return Promise.resolve(); + }, + }; + + function registerNativeCertificateManagerTests() { + suite('NativeCertificateManager', function() { + /** @type {settings.TestPrivacyPageBrowserProxy} */ + var testBrowserProxy; + + /** @type {SettingsPrivacyPageElement} */ + var page; + + setup(function() { + testBrowserProxy = new TestPrivacyPageBrowserProxy(); + settings.PrivacyPageBrowserProxyImpl.instance_ = testBrowserProxy; + PolymerTest.clearBody(); + page = document.createElement('settings-privacy-page'); + document.body.appendChild(page); + }); + + teardown(function() { page.remove(); }); + + test('NativeCertificateManager', function() { + MockInteractions.tap(page.$.manageCertificates); + return testBrowserProxy.whenCalled('showManageSSLCertificates'); + }); }); + } - teardown(function() { page.remove(); }); + function registerClearBrowsingDataTests() { + suite('ClearBrowsingData', function() { + /** @type {settings.TestClearBrowsingDataBrowserProxy} */ + var testBrowserProxy; - test('NativeCertificateManager', function() { - MockInteractions.tap(page.$.manageCertificates); - return testBrowserProxy.whenCalled('showManageSSLCertificates'); + /** @type {SettingsClearBrowsingDataDialogElement} */ + var element; + + setup(function() { + testBrowserProxy = new TestClearBrowsingDataBrowserProxy(); + settings.ClearBrowsingDataBrowserProxyImpl.instance_ = testBrowserProxy; + PolymerTest.clearBody(); + element = document.createElement('settings-clear-browsing-data-dialog'); + document.body.appendChild(element); + }); + + teardown(function() { element.remove(); }); + + test('ClearBrowsingDataTap', function() { + element.open(); + assertTrue(element.$.dialog.opened); + var clearBrowsingDataButton = element.$.clearBrowsingData; + assertTrue(!!clearBrowsingDataButton); + + MockInteractions.tap(clearBrowsingDataButton); + return testBrowserProxy.whenCalled('clearBrowsingData').then( + function() { + assertFalse(element.$.dialog.opened); + }); + }); }); - }); + } + + return { + registerTests: function() { + if (cr.isMac || cr.isWin) + registerNativeCertificateManagerTests(); + + registerClearBrowsingDataTests(); + }, + }; });
diff --git a/chrome/test/data/webui/settings/site_settings_category_tests.js b/chrome/test/data/webui/settings/site_settings_category_tests.js index 9568cfe..ed1da65 100644 --- a/chrome/test/data/webui/settings/site_settings_category_tests.js +++ b/chrome/test/data/webui/settings/site_settings_category_tests.js
@@ -105,25 +105,27 @@ for (var key in settings.ContentSettingsTypes) { var category = settings.ContentSettingsTypes[key]; - // All categories have a textId, an icon, a title, and pref names. - assertNotEquals('', testElement.computeCategoryTextId(category)); + // All top-level categories must have category text ids and + // descriptions. Categories that only appear under Site Details don't + // need that. + if (category != settings.ContentSettingsTypes.FULLSCREEN) { + assertNotEquals('', testElement.computeCategoryTextId(category)); + + assertNotEquals( + '', testElement.computeCategoryDesc(category, true, true)); + assertNotEquals( + '', testElement.computeCategoryDesc(category, true, false)); + assertNotEquals( + '', testElement.computeCategoryDesc(category, false, true)); + assertNotEquals( + '', testElement.computeCategoryDesc(category, false, false)); + } + + // All categories have an icon and a title. assertNotEquals( '', testElement.computeIconForContentCategory(category)); assertNotEquals( '', testElement.computeTitleForContentCategory(category)); - assertNotEquals( - '', testElement.computeCategoryPrefName(category)); - assertNotEquals( - '', testElement.computeCategoryExceptionsPrefName(category)); - - assertNotEquals( - '', testElement.computeCategoryDesc(category, true, true)); - assertNotEquals( - '', testElement.computeCategoryDesc(category, true, false)); - assertNotEquals( - '', testElement.computeCategoryDesc(category, false, true)); - assertNotEquals( - '', testElement.computeCategoryDesc(category, false, false)); } }); });
diff --git a/chrome/test/media_router/BUILD.gn b/chrome/test/media_router/BUILD.gn index f1678e42..5215498 100644 --- a/chrome/test/media_router/BUILD.gn +++ b/chrome/test/media_router/BUILD.gn
@@ -14,11 +14,23 @@ "resources/route_creation_timed_out.json", ] +media_router_test_extension_resources = [ + "telemetry/extension/manifest.json", + "telemetry/extension/script.js", +] + +# GYP version: chrome/test/media_router/media_router_tests.gypi: +# media_router_test_extension_files +copy("test_extension_resource_files") { + sources = media_router_test_extension_resources + outputs = [ + "$root_out_dir/media_router/test_extension/{{source_file_part}}", + ] +} + # GYP version: chrome/test/media_router/media_router_tests.gypi: # media_router_integration_test_files copy("browser_tests_resource_files") { - # This list corresponds to media_router_integration_test_resources in - # media_router_integration_test_files target in GYP. sources = media_router_integration_test_resources outputs = [ "$root_out_dir/media_router/browser_test_resources/{{source_file_part}}",
diff --git a/chrome/test/media_router/e2e_tests.gyp b/chrome/test/media_router/e2e_tests.gyp index f386fe77..67134b8 100644 --- a/chrome/test/media_router/e2e_tests.gyp +++ b/chrome/test/media_router/e2e_tests.gyp
@@ -24,6 +24,7 @@ 'type': 'none', 'dependencies': [ '../../chrome.gyp:chrome_run', + 'media_router_tests.gypi:media_router_test_extension_files', ], 'includes': [ '../../../build/isolate.gypi', @@ -35,4 +36,4 @@ ], }], ], -} \ No newline at end of file +}
diff --git a/chrome/test/media_router/media_router_perf_tests.isolate b/chrome/test/media_router/media_router_perf_tests.isolate index ddd2c23..5ec9676 100644 --- a/chrome/test/media_router/media_router_perf_tests.isolate +++ b/chrome/test/media_router/media_router_perf_tests.isolate
@@ -17,6 +17,7 @@ 'files': [ 'internal/', '<(PRODUCT_DIR)/mr_extension/release/', + '<(PRODUCT_DIR)/media_router/test_extension/', '../../../third_party/catapult/', '../../../tools/perf/', '../../../tools/variations/fieldtrial_util.py',
diff --git a/chrome/test/media_router/media_router_tests.gypi b/chrome/test/media_router/media_router_tests.gypi index fbc7c90a..d8f4fc3 100644 --- a/chrome/test/media_router/media_router_tests.gypi +++ b/chrome/test/media_router/media_router_tests.gypi
@@ -14,6 +14,10 @@ 'resources/no_provider.json', 'resources/route_creation_timed_out.json', ], + 'media_router_test_extension_resources': [ + 'telemetry/extension/manifest.json', + 'telemetry/extension/script.js', + ], }, # end of variables 'targets': [ { @@ -34,5 +38,23 @@ }, ], }, # end of target 'media_router_integration_test_files' + { + 'target_name': 'media_router_test_extension_files', + 'type': 'none', + 'variables': { + 'output_dir': '<(PRODUCT_DIR)/media_router/test_extension', + 'resource_files': [ + '<@(media_router_test_extension_resources)', + ] + }, + 'copies': [ + { + 'destination': '<(output_dir)', + 'files': [ + '<@(resource_files)', + ], + }, + ], + }, # end of target 'media_router_test_extension_files' ], # end of targets }
diff --git a/chrome/test/media_router/telemetry/benchmarks/media_router_benchmark.py b/chrome/test/media_router/telemetry/benchmarks/media_router_benchmark.py index 78356ce..e8d1b692 100644 --- a/chrome/test/media_router/telemetry/benchmarks/media_router_benchmark.py +++ b/chrome/test/media_router/telemetry/benchmarks/media_router_benchmark.py
@@ -9,7 +9,7 @@ from telemetry.timeline import tracing_category_filter from telemetry.web_perf import timeline_based_measurement -from benchmarks.pagesets import media_router_pages +from benchmarks.pagesets import media_router_perf_pages from benchmarks import media_router_measurements from benchmarks import media_router_timeline_metric @@ -17,26 +17,28 @@ class _BaseCastBenchmark(perf_benchmark.PerfBenchmark): options = {'page_repeat': 6} - page_set = media_router_pages.MediaRouterPageSet + page_set = media_router_perf_pages.MediaRouterDialogPageSet def SetExtraBrowserOptions(self, options): options.clear_sytem_cache_for_browser_and_profile_on_start = True + # This flag is required to enable the communication between the page and + # the test extension. + options.disable_background_networking = False + # TODO: find a better way to find extension location. options.AppendExtraBrowserArgs([ - '--load-extension=' + os.path.join(path_util.GetChromiumSrcDir(), 'out', - 'Release', 'mr_extension', 'release'), + '--load-extension=' + ','.join([ + os.path.join(path_util.GetChromiumSrcDir(), 'out', + 'Release', 'mr_extension', 'release'), + os.path.join(path_util.GetChromiumSrcDir(), 'out', + 'Release', 'media_router', 'test_extension')]), '--whitelisted-extension-id=enhhojjnijigcajfphajepfemndkmdlo', '--media-router=1', '--enable-stats-collection-bindings' ]) - @classmethod - def ValueCanBeAddedPredicate(cls, value, is_first_result): - """Only drops the first result.""" - return not is_first_result - -class TraceEventCaseBenckmark(_BaseCastBenchmark): +class TraceEventCastBenckmark(_BaseCastBenchmark): def CreateTimelineBasedMeasurementOptions(self): media_router_category = 'media_router' @@ -52,14 +54,35 @@ def Name(cls): return 'media_router.dialog.latency.tracing' + @classmethod + def ValueCanBeAddedPredicate(cls, value, is_first_result): + """Only drops the first result.""" + return not is_first_result -class HistogramCaseBenckmark(_BaseCastBenchmark): + +class HistogramCastBenckmark(_BaseCastBenchmark): def CreatePageTest(self, options): - return media_router_measurements.MediaRouterPageTest() + return media_router_measurements.MediaRouterDialogTest() @classmethod def Name(cls): return 'media_router.dialog.latency.histogram' + @classmethod + def ValueCanBeAddedPredicate(cls, value, is_first_result): + """Only drops the first result.""" + return not is_first_result + +class CPUMemoryCastBenckmark(_BaseCastBenchmark): + options = {'page_repeat': 1} + + page_set = media_router_perf_pages.MediaRouterCPUMemoryPageSet + + def CreatePageTest(self, options): + return media_router_measurements.MediaRouterCPUMemoryTest() + + @classmethod + def Name(cls): + return 'media_router.cpu_memory'
diff --git a/chrome/test/media_router/telemetry/benchmarks/media_router_cpu_memory_metric.py b/chrome/test/media_router/telemetry/benchmarks/media_router_cpu_memory_metric.py new file mode 100644 index 0000000..b7ca295c --- /dev/null +++ b/chrome/test/media_router/telemetry/benchmarks/media_router_cpu_memory_metric.py
@@ -0,0 +1,51 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import logging +import json + +from telemetry.core import exceptions +from telemetry.value import scalar + +from metrics import Metric + + +METRICS = {'privateMemory': {'units': 'MB', 'display_name': 'private_memory'}, + 'cpu': {'units': '%', 'display_name': 'cpu_utilization'}} + + +class MediaRouterCPUMemoryMetric(Metric): + "A metric for media router CPU/Memory usage." + + def Start(self, page, tab): + raise NotImplementedError() + + def Stop(self, page, tab): + raise NotImplementedError() + + def AddResults(self, tab, results): + results_json = None + try: + results_json = tab.EvaluateJavaScript( + 'JSON.stringify(window.perfResults)') + except exceptions.EvaluateException: + pass + # This log gives the detailed information about CPU/memory usage. + logging.info('results_json' + ': ' + str(results_json)) + + if not results_json: + return + perf_results = json.loads(results_json) + for (metric, metric_results) in perf_results.iteritems(): + for (process, process_results) in metric_results.iteritems(): + if not process_results: + continue + avg_result = round(sum(process_results)/len(process_results), 4) + if metric == 'privateMemory': + avg_result = round(avg_result/(1024 * 1024), 2) + results.AddValue(scalar.ScalarValue( + results.current_page, + '%s.%s' % (METRICS.get(metric).get('display_name'), process), + METRICS.get(metric).get('units'), + avg_result))
diff --git a/chrome/test/media_router/telemetry/benchmarks/media_router_metric.py b/chrome/test/media_router/telemetry/benchmarks/media_router_dialog_metric.py similarity index 95% rename from chrome/test/media_router/telemetry/benchmarks/media_router_metric.py rename to chrome/test/media_router/telemetry/benchmarks/media_router_dialog_metric.py index 0439b58d..85f66b8 100644 --- a/chrome/test/media_router/telemetry/benchmarks/media_router_metric.py +++ b/chrome/test/media_router/telemetry/benchmarks/media_router_dialog_metric.py
@@ -25,11 +25,11 @@ }] -class MediaRouterMetric(Metric): +class MediaRouterDialogMetric(Metric): "A metric for media router dialog latency from histograms." def __init__(self): - super(MediaRouterMetric, self).__init__() + super(MediaRouterDialogMetric, self).__init__() self._histogram_start = dict() self._histogram_delta = dict() self._started = False
diff --git a/chrome/test/media_router/telemetry/benchmarks/media_router_measurements.py b/chrome/test/media_router/telemetry/benchmarks/media_router_measurements.py index 320ae9e..b760a29 100644 --- a/chrome/test/media_router/telemetry/benchmarks/media_router_measurements.py +++ b/chrome/test/media_router/telemetry/benchmarks/media_router_measurements.py
@@ -2,20 +2,32 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -from benchmarks import media_router_metric +from benchmarks import media_router_dialog_metric +from benchmarks import media_router_cpu_memory_metric from telemetry.page import page_test -class MediaRouterPageTest(page_test.PageTest): +class MediaRouterDialogTest(page_test.PageTest): """Performs a measurement of Media Route dialog latency.""" def __init__(self): - super(MediaRouterPageTest, self).__init__() - self._media_router_metric = media_router_metric.MediaRouterMetric() + super(MediaRouterDialogTest, self).__init__() + self._metric = media_router_dialog_metric.MediaRouterDialogMetric() def DidNavigateToPage(self, page, tab): - self._media_router_metric.Start(page, tab) + self._metric.Start(page, tab) def ValidateAndMeasurePage(self, page, tab, results): - self._media_router_metric.Stop(page, tab) - self._media_router_metric.AddResults(tab, results) + self._metric.Stop(page, tab) + self._metric.AddResults(tab, results) + + +class MediaRouterCPUMemoryTest(page_test.PageTest): + """Performs a measurement of Media Route CPU/memory usage.""" + + def __init__(self): + super(MediaRouterCPUMemoryTest, self).__init__() + self._metric = media_router_cpu_memory_metric.MediaRouterCPUMemoryMetric() + + def ValidateAndMeasurePage(self, page, tab, results): + self._metric.AddResults(tab, results)
diff --git a/chrome/test/media_router/telemetry/benchmarks/pagesets/basic_test.html b/chrome/test/media_router/telemetry/benchmarks/pagesets/basic_test.html index 8162c09..1d0c9de8 100644 --- a/chrome/test/media_router/telemetry/benchmarks/pagesets/basic_test.html +++ b/chrome/test/media_router/telemetry/benchmarks/pagesets/basic_test.html
@@ -3,9 +3,13 @@ <head> <title>MR Integration Basic Test</title> <script type="text/javascript" src="common.js"></script> + <script type="text/javascript" src="cpu_memory_script.js"></script> + <script type="text/javascript" + src="https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"> + </script> </head> <body> - <button id="start_session_button" onclick="startSession()"> + <button id="start_session_button" onclick="startFlingingSession()"> Start session </button> </body>
diff --git a/chrome/test/media_router/telemetry/benchmarks/pagesets/common.js b/chrome/test/media_router/telemetry/benchmarks/pagesets/common.js index d99810d..b95f705 100644 --- a/chrome/test/media_router/telemetry/benchmarks/pagesets/common.js +++ b/chrome/test/media_router/telemetry/benchmarks/pagesets/common.js
@@ -3,80 +3,99 @@ * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. * - * @fileoverview Common APIs for presentation integration tests. + * @fileoverview Common APIs for media router performance tests. * */ -var startSessionPromise = null; -var startedSession = null; -var reconnectedSession = null; -var presentationUrl = "http://www.google.com/#__testprovider__=true"; -var startSessionRequest = new PresentationRequest(presentationUrl); -var defaultRequestSessionId = null; +var initialized = false; +var currentSession = null; +var currentMedia = null; -window.navigator.presentation.defaultRequest = startSessionRequest; -window.navigator.presentation.defaultRequest.onconnectionavailable = function(e) -{ - defaultRequestSessionId = e.connection.id; -}; + +window['__onGCastApiAvailable'] = function(loaded, errorInfo) { + if (loaded) { + initializeCastApi(); + } else { + console.log(errorInfo); + } +} /** - * Waits until one device is available. + * Initialize Cast APIs. */ -function waitUntilDeviceAvailable() { - startSessionRequest.getAvailability(presentationUrl).then( - function(availability) { - console.log('availability ' + availability.value + '\n'); - if (availability.value) { - console.log('device available'); - } else { - availability.onchange = function(newAvailability) { - if (newAvailability) - console.log('got new availability'); - } - } - }).catch(function(){ - console.log('error'); +function initializeCastApi() { + // Load Cast APIs + console.info('Initializing API'); + var sessionRequest = new chrome.cast.SessionRequest( + chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID); + var apiConfig = new chrome.cast.ApiConfig( + sessionRequest, + null, // session listener + function(availability) { // receiver listener + console.info('Receiver listener: ' + JSON.stringify(availability)); + initialized = true; + }); + chrome.cast.initialize( + apiConfig, + function() { // Successful callback + console.info('Initialize successfully'); + }, + function(error) { // Error callback + console.error('Initialize failed, error: ' + JSON.stringify(error)); }); } /** - * Starts session. + * Start a new session for flinging scenario. */ -function startSession() { - startSessionPromise = startSessionRequest.start(); - console.log('start session'); +function startFlingingSession() { + console.info('Starting Session'); + chrome.cast.requestSession( + function(session) { // Request session successful callback + console.info('Request session successfully'); + currentSession = session; + }, + function(error) { // Request session Error callback + console.error('Request session failed, error: ' + JSON.stringify(error)); + }); } /** - * Checks if the session has been started successfully. + * Loads the specific video on Chromecast. + * + * @param {string} mediaUrl the url which points to a mp4 video. */ -function checkSession() { - if (!startSessionPromise) { - sendResult(false, 'Did not attempt to start session'); - } else { - startSessionPromise.then(function(session) { - if(!session) { - console.log('Failed to start session'); - } else { - // set the new session - startedSession = session; - console.log('Session has been started'); - } - }).catch(function() { - // terminate old session if exists - terminateSession(); - console.log('Failed to start session'); - }) +function loadMedia(mediaUrl) { + if (!currentSession) { + console.warn('Cannot load media without a live session'); } + console.info('loading ' + mediaUrl); + var mediaInfo = new chrome.cast.media.MediaInfo(mediaUrl, 'video/mp4'); + var request = new chrome.cast.media.LoadRequest(mediaInfo); + request.autoplay = true; + request.currentTime = 0; + currentSession.loadMedia(request, + function(media) { + console.info('Load media successfully'); + currentMedia = media; + }, + function(error) { // Error callback + console.error('Load media failed, error: ' + JSON.stringify(error)); + }); } /** - * Terminates current session. + * Stops current session. */ -function terminateSession() { - if (startedSession) { - startedSession.terminate(); +function stopSession() { + if (currentSession) { + currentSession.stop( + function() { + console.info('Stop session successfully'); + currentSession = null; + }, + function(error) { // Error callback + console.error('Stop session failed, error: ' + JSON.stringify(error)); + }); } } -
diff --git a/chrome/test/media_router/telemetry/benchmarks/pagesets/cpu_memory_script.js b/chrome/test/media_router/telemetry/benchmarks/pagesets/cpu_memory_script.js new file mode 100644 index 0000000..06da0a8 --- /dev/null +++ b/chrome/test/media_router/telemetry/benchmarks/pagesets/cpu_memory_script.js
@@ -0,0 +1,55 @@ +/** + * 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. + * + * @fileoverview Script to interact with test extension to get CPU/memory usage. + * + */ + + +// MR test extension ID. +var extensionId = 'ocihafebdemjoofhbdnamghkfobfgbal'; + +/** + * The dictionary to store the performance results with the following format: + * key: the metric, e.g. CPU, private memory + * value: map of the performance results for different processes. + * key: process type, e.g. tab, browser, gpu, extension. + * value: list of the performance results. + */ +window.perfResults = {}; + +/** + * Connects to the test extension and starts to collect CPU/memory usage data. + */ +function collectPerfData() { + processCpuPort_ = openPort_('collectData'); + if (processCpuPort_) { + processCpuPort_.onMessage.addListener(function(message) { + for (metric in message) { + if (!window.perfResults[metric]) { + window.perfResults[metric] = {}; + } + for (process_type in message[metric]) { + if (!window.perfResults[metric][process_type]) { + window.perfResults[metric][process_type] = [] + } + window.perfResults[metric][process_type].push( + message[metric][process_type]); + } + } + }); + } else { + console.log('Unable to connect to port'); + } +} + +function openPort_(name) { + var rt = window.chrome.runtime; + if (rt && rt.connect) { + console.info('Opening port named ' + name); + return rt.connect(extensionId, {'name': name}); + } + return null; +}
diff --git a/chrome/test/media_router/telemetry/benchmarks/pagesets/media_router_page.py b/chrome/test/media_router/telemetry/benchmarks/pagesets/media_router_page.py new file mode 100644 index 0000000..1ba7fa7 --- /dev/null +++ b/chrome/test/media_router/telemetry/benchmarks/pagesets/media_router_page.py
@@ -0,0 +1,66 @@ +# 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 os +import time + +from telemetry import page +from telemetry import story +from telemetry.core import exceptions + + +class CastPage(page.Page): + """Abstract Cast page for Media Router Telemetry tests.""" + + def ChooseSink(self, tab, sink_name): + """Chooses a specific sink in the list.""" + + tab.ExecuteJavaScript( + 'var sinks = window.document.getElementById("media-router-container").' + ' shadowRoot.getElementById("sink-list").getElementsByTagName("span");' + 'for (var i=0; i<sinks.length; i++) {' + ' if(sinks[i].textContent.trim() == "%s") {' + ' sinks[i].click();' + ' break;' + '}}' % sink_name); + + def CloseDialog(self, tab): + """Closes media router dialog.""" + + try: + tab.ExecuteJavaScript( + 'window.document.getElementById("media-router-container").' + + 'shadowRoot.getElementById("container-header").shadowRoot.' + + 'getElementById("close-button").click();') + except exceptions.DevtoolsTargetCrashException: + # Ignore the crash exception, this exception is caused by the js + # code which closes the dialog, it is expected. + pass + + def ExecuteAsyncJavaScript(self, action_runner, script, verify_func, + error_message, timeout=5): + """Executes async javascript function and waits until it finishes.""" + + action_runner.ExecuteJavaScript(script) + self._WaitForResult(action_runner, verify_func, error_message, + timeout=timeout) + + def _WaitForResult(self, action_runner, verify_func, error_message, + timeout=5): + """Waits until the function finishes or timeout.""" + + start_time = time.time() + while (not verify_func() and + time.time() - start_time < timeout): + action_runner.Wait(1) + if not verify_func(): + raise page.page_test.Failure(error_message) + + def _GetDeviceName(self): + """Gets device name from environment variable RECEIVER_NAME.""" + if 'RECEIVER_NAME' not in os.environ or not os.environ.get('RECEIVER_NAME'): + raise page.page_test.Failure( + 'Your test machine is not set up correctly, ' + 'RECEIVER_NAME enviroment variable is missing.') + return os.environ.get('RECEIVER_NAME')
diff --git a/chrome/test/media_router/telemetry/benchmarks/pagesets/media_router_pages.py b/chrome/test/media_router/telemetry/benchmarks/pagesets/media_router_pages.py deleted file mode 100644 index e1b89e5..0000000 --- a/chrome/test/media_router/telemetry/benchmarks/pagesets/media_router_pages.py +++ /dev/null
@@ -1,43 +0,0 @@ -# Copyright 2016 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -from telemetry import page -from telemetry import story -from telemetry.page import shared_page_state -from telemetry.core import exceptions - - -class CastPage(page.Page): - - def __init__(self, page_set): - super(CastPage, self).__init__( - url='file://basic_test.html', - page_set=page_set) - - def RunPageInteractions(self, action_runner): - with action_runner.CreateInteraction('LaunchDialog'): - # Wait for 5s after Chrome is opened in order to get consistent results. - action_runner.Wait(5) - action_runner.TapElement(selector='#start_session_button') - action_runner.Wait(5) - for tab in action_runner.tab.browser.tabs: - # Close media router dialog - if tab.url == 'chrome://media-router/': - try: - tab.ExecuteJavaScript( - 'window.document.getElementById("media-router-container").' + - 'shadowRoot.getElementById("container-header").shadowRoot.' + - 'getElementById("close-button").click();') - except exceptions.DevtoolsTargetCrashException: - # Ignore the crash exception, this exception is caused by the js - # code which closes the dialog, it is expected. - pass - - -class MediaRouterPageSet(story.StorySet): - - def __init__(self): - super(MediaRouterPageSet, self).__init__( - cloud_storage_bucket=story.PARTNER_BUCKET) - self.AddStory(CastPage(self))
diff --git a/chrome/test/media_router/telemetry/benchmarks/pagesets/media_router_perf_pages.py b/chrome/test/media_router/telemetry/benchmarks/pagesets/media_router_perf_pages.py new file mode 100644 index 0000000..16e1ca8 --- /dev/null +++ b/chrome/test/media_router/telemetry/benchmarks/pagesets/media_router_perf_pages.py
@@ -0,0 +1,138 @@ +# 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. + +from telemetry import page +from telemetry import story +from benchmarks.pagesets import media_router_page +from telemetry.core import exceptions +from telemetry.page import shared_page_state + + +class SharedState(shared_page_state.SharedPageState): + """Shared state that restarts the browser for every single story.""" + + def __init__(self, test, finder_options, story_set): + super(SharedState, self).__init__( + test, finder_options, story_set) + + def DidRunStory(self, results): + super(SharedState, self).DidRunStory(results) + self._StopBrowser() + + +class CastDialogPage(media_router_page.CastPage): + """Cast page to open a cast-enabled page and open media router dialog.""" + + def __init__(self, page_set, url='file://basic_test.html', + shared_page_state_class=shared_page_state.SharedPageState): + super(CastDialogPage, self).__init__( + url=url, page_set=page_set, + shared_page_state_class=shared_page_state_class) + + def RunPageInteractions(self, action_runner): + # Wait for 5s after Chrome is opened in order to get consistent results. + action_runner.Wait(5) + with action_runner.CreateInteraction('LaunchDialog'): + action_runner.ExecuteJavaScript('collectPerfData();') + self._WaitForResult( + action_runner, + lambda: action_runner.EvaluateJavaScript('initialized'), + 'Failed to initialize') + + action_runner.TapElement(selector='#start_session_button') + action_runner.Wait(5) + for tab in action_runner.tab.browser.tabs: + # Close media router dialog + if tab.url == 'chrome://media-router/': + self.CloseDialog(tab) + + +class CastIdlePage(CastDialogPage): + """Cast page to open a cast-enabled page and do nothing.""" + + def __init__(self, page_set): + super(CastIdlePage, self).__init__( + page_set=page_set, + url='file://basic_test.html', + shared_page_state_class=SharedState) + + def RunPageInteractions(self, action_runner): + super(CastIdlePage, self).RunPageInteractions(action_runner) + action_runner.Wait(15) + + +class CastFlingingPage(media_router_page.CastPage): + """Cast page to fling a video to Chromecast device.""" + + def __init__(self, page_set): + super(CastFlingingPage, self).__init__( + page_set=page_set, + url='file://basic_test.html#flinging', + shared_page_state_class=SharedState) + + def RunPageInteractions(self, action_runner): + # Wait for 5s after Chrome is opened in order to get consistent results. + action_runner.Wait(5) + with action_runner.CreateInteraction('flinging'): + action_runner.ExecuteJavaScript('collectPerfData();') + + self._WaitForResult( + action_runner, + lambda: action_runner.EvaluateJavaScript('initialized'), + 'Failed to initialize') + + # Start session + action_runner.TapElement(selector='#start_session_button') + self._WaitForResult( + action_runner, + lambda: len(action_runner.tab.browser.tabs) >= 2, + 'MR dialog never showed up.') + + # Wait for 2s to make sure the dialog is fully loaded. + action_runner.Wait(2) + for tab in action_runner.tab.browser.tabs: + # Choose sink + if tab.url == 'chrome://media-router/': + self.ChooseSink(tab, self._GetDeviceName()) + + self._WaitForResult( + action_runner, + lambda: action_runner.EvaluateJavaScript('currentSession'), + 'Failed to start session', + timeout=10) + + # Load Media + # TODO: use local video instead of the public one. + self.ExecuteAsyncJavaScript( + action_runner, + 'loadMedia("http://easyhtml5video.com/images/happyfit2.mp4");', + lambda: action_runner.EvaluateJavaScript('currentMedia'), + 'Failed to load media') + + action_runner.Wait(20) + # Stop session + self.ExecuteAsyncJavaScript( + action_runner, + 'stopSession();', + lambda: not action_runner.EvaluateJavaScript('currentSession'), + 'Failed to stop session') + + +class MediaRouterDialogPageSet(story.StorySet): + """Pageset for media router dialog latency tests.""" + + def __init__(self): + super(MediaRouterDailogPageSet, self).__init__( + cloud_storage_bucket=story.PARTNER_BUCKET) + self.AddStory(CastDialogPage(self)) + + +class MediaRouterCPUMemoryPageSet(story.StorySet): + """Pageset for media router CPU/memory usage tests.""" + + def __init__(self): + super(MediaRouterCPUMemoryPageSet, self).__init__( + cloud_storage_bucket=story.PARTNER_BUCKET) + self.AddStory(CastIdlePage(self)) + self.AddStory(CastFlingingPage(self))
diff --git a/chrome/test/media_router/telemetry/extension/README.md b/chrome/test/media_router/telemetry/extension/README.md new file mode 100644 index 0000000..8fb2dab9 --- /dev/null +++ b/chrome/test/media_router/telemetry/extension/README.md
@@ -0,0 +1,3 @@ +This is the test extension which is used to get CPU/memory usage for media router performance test. + +chrome/test/media_router/telemetry/benchmarks/pagesets/cpu_memory_script.js shows how to interact with this test extension to get CPU/memory usage.
diff --git a/chrome/test/media_router/telemetry/extension/manifest.json b/chrome/test/media_router/telemetry/extension/manifest.json new file mode 100644 index 0000000..75db8a5 --- /dev/null +++ b/chrome/test/media_router/telemetry/extension/manifest.json
@@ -0,0 +1,24 @@ +// 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. + +{ + // Extension ID: ocihafebdemjoofhbdnamghkfobfgbal + "key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAx1nP6oOqlQh79uPMoPJQT1aj7z1vM4UkQ3y8rhgnH56FApNWIIr8NqRqSBc1WeCXskdQjctvjW/1ZSYmYAplLziEjlFED2yfCATRl8V5spsZjCqtBw4O8IjzKkEhsNYBlBrpOu0jSLP4Nr/enJvzLwe4tQ80XuLSItJzxF72SoPbxCQCCbm3NKe5dyqZYKmroiLDjwDa8jz3FM6uohfJaWVFzp+fSK1CiKPRxlGvp0Oy5LM03vJFDGwdwJM6nXdy3eM4tIH5arbJ1EfPs5M2AKPNPo55wOLhFjyZzo1TBj9wP1V/r6WmR4Q8XVvpWTIVcRH5VxeOTWoFKYRGQ6OICQIDAQAB", + "description": "This extension helps in retreiving the CPU/memory usage stats for MR extension.", + "name": "MR Test Extension", + "version": "1.0", + "manifest_version": 2, + "externally_connectable": { + "matches": [ + "http://127.0.0.1:*/*" + ] + }, + "background": { + "scripts": ["script.js"], + "persistent": true + }, + "permissions": [ + "processes" + ] +}
diff --git a/chrome/test/media_router/telemetry/extension/script.js b/chrome/test/media_router/telemetry/extension/script.js new file mode 100644 index 0000000..1af1dfd --- /dev/null +++ b/chrome/test/media_router/telemetry/extension/script.js
@@ -0,0 +1,69 @@ +// 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. + + +// Collects CPU/memory usage information and posts to the page. +function collectData(port) { + function processCpuListener(processes) { + _postData(processes, port, 'cpu'); + } + + function processMemoryListener(processes) { + _postData(processes, port, 'privateMemory'); + } + + chrome.processes.onUpdated.addListener(processCpuListener); + chrome.processes.onUpdatedWithMemory.addListener(processMemoryListener); + port.onDisconnect.addListener(function() { + chrome.processes.onUpdated.removeListener(processCpuListener); + chrome.processes.onUpdated.removeListener(processMemoryListener); + }); +} + +/** + * Posts the metric data to the page. + * + * @param processes list of current processes. + * @param port the port used for the communication between the page and + * extension. + * @param metric_name the metric name, e.g cpu. + */ +function _postData(processes, port, metric_name) { + var tabPid = port.sender.tab.id; + if (!tabPid) { + return; + } + var tabProcess = processes[tabPid]; + if (!tabProcess) { + return; + } + var message = {}; + message[metric_name] = {'current_tab': tabProcess[metric_name]}; + for (var pid in processes) { + var process = processes[pid]; + data = process[metric_name]; + if (['browser', 'gpu', 'extension'].indexOf(process.type) > -1) { + if (process.type == 'extension'){ + for (var index in process.tasks) { + var task = process.tasks[index]; + if (task.title && task.title.indexOf('Chrome Media Router') > -1) { + message[metric_name]['mr_' + process.type] = data; + } + } + } else { + message[metric_name][process.type] = data; + } + } + } + port.postMessage(message); +} + +chrome.runtime.onConnectExternal.addListener(function(port) { + if (port.name == 'collectData') { + collectData(port); + } else { + console.warn('Unknown port, disconnect the port.'); + port.disconnect(); + } +});
diff --git a/chrome/third_party/mozilla_security_manager/nsNSSCertHelper.h b/chrome/third_party/mozilla_security_manager/nsNSSCertHelper.h index ffa3ef5..6f495f9 100644 --- a/chrome/third_party/mozilla_security_manager/nsNSSCertHelper.h +++ b/chrome/third_party/mozilla_security_manager/nsNSSCertHelper.h
@@ -45,7 +45,6 @@ #include <string> -#include "base/memory/scoped_ptr.h" #include "net/cert/cert_database.h" namespace mozilla_security_manager {
diff --git a/chrome/tools/mac_helpers/infoplist_strings_util.mm b/chrome/tools/mac_helpers/infoplist_strings_util.mm index ede5a28..932005f3 100644 --- a/chrome/tools/mac_helpers/infoplist_strings_util.mm +++ b/chrome/tools/mac_helpers/infoplist_strings_util.mm
@@ -8,14 +8,14 @@ #import <Foundation/Foundation.h> #include <stdint.h> - #include <stdio.h> #include <unistd.h> +#include <memory> + #include "base/files/file_path.h" #include "base/files/file_util.h" #include "base/mac/scoped_nsautorelease_pool.h" -#include "base/memory/scoped_ptr.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_piece.h" #include "base/strings/string_util.h" @@ -222,10 +222,8 @@ const char* cur_lang = lang_list[loop]; // Open the branded string pak file - scoped_ptr<ui::DataPack> branded_data_pack( - LoadResourceDataPack(grit_output_dir, - branding_strings_name, - cur_lang)); + std::unique_ptr<ui::DataPack> branded_data_pack( + LoadResourceDataPack(grit_output_dir, branding_strings_name, cur_lang)); if (branded_data_pack.get() == NULL) { fprintf(stderr, "ERROR: Failed to load branded pak for language: %s\n", cur_lang);
diff --git a/chrome/tools/service_discovery_sniffer/service_discovery_sniffer.cc b/chrome/tools/service_discovery_sniffer/service_discovery_sniffer.cc index e48edb8..5d51f58 100644 --- a/chrome/tools/service_discovery_sniffer/service_discovery_sniffer.cc +++ b/chrome/tools/service_discovery_sniffer/service_discovery_sniffer.cc
@@ -2,14 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "chrome/tools/service_discovery_sniffer/service_discovery_sniffer.h" + +#include <memory> #include <vector> #include "base/at_exit.h" #include "base/bind.h" -#include "base/memory/scoped_ptr.h" #include "base/message_loop/message_loop.h" #include "chrome/browser/local_discovery/service_discovery_client_impl.h" -#include "chrome/tools/service_discovery_sniffer/service_discovery_sniffer.h" #include "net/dns/mdns_client.h" namespace local_discovery { @@ -102,11 +103,13 @@ return 1; } - scoped_ptr<net::MDnsClient> mdns_client = net::MDnsClient::CreateDefault(); - scoped_ptr<net::MDnsSocketFactory> socket_factory = + std::unique_ptr<net::MDnsClient> mdns_client = + net::MDnsClient::CreateDefault(); + std::unique_ptr<net::MDnsSocketFactory> socket_factory = net::MDnsSocketFactory::CreateDefault(); mdns_client->StartListening(socket_factory.get()); - scoped_ptr<local_discovery::ServiceDiscoveryClient> service_discovery_client; + std::unique_ptr<local_discovery::ServiceDiscoveryClient> + service_discovery_client; service_discovery_client.reset( new local_discovery::ServiceDiscoveryClientImpl(mdns_client.get())); {
diff --git a/chrome/tools/service_discovery_sniffer/service_discovery_sniffer.h b/chrome/tools/service_discovery_sniffer/service_discovery_sniffer.h index bbb575d3..f6caf84 100644 --- a/chrome/tools/service_discovery_sniffer/service_discovery_sniffer.h +++ b/chrome/tools/service_discovery_sniffer/service_discovery_sniffer.h
@@ -6,6 +6,7 @@ #define CHROME_TOOLS_SERVICE_DISCOVERY_SNIFFER_SERVICE_DISCOVERY_SNIFFER_H_ #include <map> +#include <memory> #include <string> #include "base/macros.h" @@ -31,7 +32,7 @@ const ServiceDescription& service); bool changed_; - scoped_ptr<ServiceResolver> service_resolver_; + std::unique_ptr<ServiceResolver> service_resolver_; DISALLOW_COPY_AND_ASSIGN(ServicePrinter); }; @@ -52,7 +53,7 @@ typedef std::map<std::string, linked_ptr<ServicePrinter> > ServiceMap; ServiceMap services_; - scoped_ptr<ServiceWatcher> watcher_; + std::unique_ptr<ServiceWatcher> watcher_; ServiceDiscoveryClient* client_; DISALLOW_COPY_AND_ASSIGN(ServiceTypePrinter);
diff --git a/chrome/utility/chrome_content_utility_client.cc b/chrome/utility/chrome_content_utility_client.cc index f00b01c9..8bd49b4 100644 --- a/chrome/utility/chrome_content_utility_client.cc +++ b/chrome/utility/chrome_content_utility_client.cc
@@ -203,7 +203,7 @@ } void ChromeContentUtilityClient::AddHandler( - scoped_ptr<UtilityMessageHandler> handler) { + std::unique_ptr<UtilityMessageHandler> handler) { handlers_.push_back(std::move(handler)); }
diff --git a/chrome/utility/chrome_content_utility_client.h b/chrome/utility/chrome_content_utility_client.h index 2850ec5a..9ad1dca9 100644 --- a/chrome/utility/chrome_content_utility_client.h +++ b/chrome/utility/chrome_content_utility_client.h
@@ -7,13 +7,13 @@ #include <stdint.h> +#include <memory> #include <set> #include <string> #include <vector> #include "base/compiler_specific.h" #include "base/macros.h" -#include "base/memory/scoped_ptr.h" #include "base/memory/scoped_vector.h" #include "build/build_config.h" #include "content/public/utility/content_utility_client.h" @@ -35,7 +35,7 @@ bool OnMessageReceived(const IPC::Message& message) override; void RegisterMojoServices(content::ServiceRegistry* registry) override; - void AddHandler(scoped_ptr<UtilityMessageHandler> handler); + void AddHandler(std::unique_ptr<UtilityMessageHandler> handler); static void PreSandboxStartup();
diff --git a/chrome/utility/cloud_print/bitmap_image.h b/chrome/utility/cloud_print/bitmap_image.h index 3692755..2988588d10 100644 --- a/chrome/utility/cloud_print/bitmap_image.h +++ b/chrome/utility/cloud_print/bitmap_image.h
@@ -7,8 +7,9 @@ #include <stdint.h> +#include <memory> + #include "base/macros.h" -#include "base/memory/scoped_ptr.h" #include "ui/gfx/geometry/point.h" #include "ui/gfx/geometry/size.h" @@ -37,7 +38,7 @@ private: gfx::Size size_; Colorspace colorspace_; - scoped_ptr<uint8_t[]> data_; + std::unique_ptr<uint8_t[]> data_; DISALLOW_COPY_AND_ASSIGN(BitmapImage); };
diff --git a/chrome/utility/cloud_print/pwg_encoder.cc b/chrome/utility/cloud_print/pwg_encoder.cc index c0a9959..0615dc53 100644 --- a/chrome/utility/cloud_print/pwg_encoder.cc +++ b/chrome/utility/cloud_print/pwg_encoder.cc
@@ -8,10 +8,10 @@ #include <string.h> #include <algorithm> +#include <memory> #include "base/big_endian.h" #include "base/logging.h" -#include "base/memory/scoped_ptr.h" #include "chrome/utility/cloud_print/bitmap_image.h" namespace cloud_print {
diff --git a/chrome/utility/cloud_print/pwg_encoder_unittest.cc b/chrome/utility/cloud_print/pwg_encoder_unittest.cc index a60b6f4..8264ed0 100644 --- a/chrome/utility/cloud_print/pwg_encoder_unittest.cc +++ b/chrome/utility/cloud_print/pwg_encoder_unittest.cc
@@ -2,13 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "chrome/utility/cloud_print/pwg_encoder.h" + #include <stdint.h> +#include <memory> + #include "base/files/file_util.h" -#include "base/memory/scoped_ptr.h" #include "base/sha1.h" #include "chrome/utility/cloud_print/bitmap_image.h" -#include "chrome/utility/cloud_print/pwg_encoder.h" #include "testing/gtest/include/gtest/gtest.h" namespace cloud_print { @@ -26,10 +28,9 @@ const int kRasterHeight = 792; const int kRasterDPI = 72; -scoped_ptr<BitmapImage> MakeSampleBitmap() { - scoped_ptr<BitmapImage> bitmap_image( - new BitmapImage(gfx::Size(kRasterWidth, kRasterHeight), - BitmapImage::RGBA)); +std::unique_ptr<BitmapImage> MakeSampleBitmap() { + std::unique_ptr<BitmapImage> bitmap_image(new BitmapImage( + gfx::Size(kRasterWidth, kRasterHeight), BitmapImage::RGBA)); uint32_t* bitmap_data = reinterpret_cast<uint32_t*>(bitmap_image->pixel_data()); @@ -67,7 +68,7 @@ TEST(PwgRasterTest, CompareWithMaster) { std::string output; PwgEncoder encoder; - scoped_ptr<BitmapImage> image = MakeSampleBitmap(); + std::unique_ptr<BitmapImage> image = MakeSampleBitmap(); PwgHeaderInfo header_info; header_info.dpi = kRasterDPI; header_info.total_pages = 1;
diff --git a/chrome/utility/extensions/extensions_handler.cc b/chrome/utility/extensions/extensions_handler.cc index 6b5beee..859e8444 100644 --- a/chrome/utility/extensions/extensions_handler.cc +++ b/chrome/utility/extensions/extensions_handler.cc
@@ -129,7 +129,7 @@ int64_t total_size, bool get_attached_images) { // Only one IPCDataSource may be created and added to the list of handlers. - scoped_ptr<metadata::IPCDataSource> source( + std::unique_ptr<metadata::IPCDataSource> source( new metadata::IPCDataSource(total_size)); metadata::MediaMetadataParser* parser = new metadata::MediaMetadataParser( source.get(), mime_type, get_attached_images); @@ -196,7 +196,7 @@ #if defined(OS_WIN) void ExtensionsHandler::OnGetWiFiCredentials(const std::string& network_guid) { - scoped_ptr<wifi::WiFiService> wifi_service(wifi::WiFiService::Create()); + std::unique_ptr<wifi::WiFiService> wifi_service(wifi::WiFiService::Create()); wifi_service->Initialize(NULL); std::string key_data;
diff --git a/chrome/utility/image_decoder_impl.cc b/chrome/utility/image_decoder_impl.cc index 77c03b4..91cea1b 100644 --- a/chrome/utility/image_decoder_impl.cc +++ b/chrome/utility/image_decoder_impl.cc
@@ -53,9 +53,8 @@ if (codec == mojom::ImageCodec::ROBUST_JPEG) { // Our robust jpeg decoding is using IJG libjpeg. if (encoded_data.size()) { - scoped_ptr<SkBitmap> decoded_jpeg( - gfx::JPEGCodecRobustSlow::Decode(encoded_data.storage().data(), - encoded_data.size())); + std::unique_ptr<SkBitmap> decoded_jpeg(gfx::JPEGCodecRobustSlow::Decode( + encoded_data.storage().data(), encoded_data.size())); if (decoded_jpeg.get() && !decoded_jpeg->empty()) decoded_image = *decoded_jpeg; }
diff --git a/chrome/utility/image_writer/disk_unmounter_mac.cc b/chrome/utility/image_writer/disk_unmounter_mac.cc index 8d3155a..7f2777cf 100644 --- a/chrome/utility/image_writer/disk_unmounter_mac.cc +++ b/chrome/utility/image_writer/disk_unmounter_mac.cc
@@ -89,8 +89,8 @@ } // static -scoped_ptr<base::MessagePump> DiskUnmounterMac::CreateMessagePump() { - return scoped_ptr<base::MessagePump>(new base::MessagePumpCFRunLoop); +std::unique_ptr<base::MessagePump> DiskUnmounterMac::CreateMessagePump() { + return std::unique_ptr<base::MessagePump>(new base::MessagePumpCFRunLoop); } void DiskUnmounterMac::UnmountOnWorker(const std::string& device_path) {
diff --git a/chrome/utility/image_writer/disk_unmounter_mac.h b/chrome/utility/image_writer/disk_unmounter_mac.h index 2b0992b..81a5641 100644 --- a/chrome/utility/image_writer/disk_unmounter_mac.h +++ b/chrome/utility/image_writer/disk_unmounter_mac.h
@@ -8,10 +8,11 @@ #include <CoreFoundation/CoreFoundation.h> #include <DiskArbitration/DiskArbitration.h> +#include <memory> + #include "base/bind.h" #include "base/callback.h" #include "base/mac/foundation_util.h" -#include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/single_thread_task_runner.h" #include "base/threading/thread.h" @@ -51,7 +52,7 @@ void* context); // A |MessagePumpFactory| for creating the thread. - static scoped_ptr<base::MessagePump> CreateMessagePump(); + static std::unique_ptr<base::MessagePump> CreateMessagePump(); // Starts the unmount process. Should be posted to the |cf_thread_|. void UnmountOnWorker(const std::string& device_path);
diff --git a/chrome/utility/image_writer/image_writer.cc b/chrome/utility/image_writer/image_writer.cc index 4b3569e..9249613 100644 --- a/chrome/utility/image_writer/image_writer.cc +++ b/chrome/utility/image_writer/image_writer.cc
@@ -119,7 +119,7 @@ } // DASD buffers require memory alignment on some systems. - scoped_ptr<char, base::AlignedFreeDeleter> buffer(static_cast<char*>( + std::unique_ptr<char, base::AlignedFreeDeleter> buffer(static_cast<char*>( base::AlignedAlloc(kBurningBlockSize, kMemoryAlignment))); memset(buffer.get(), 0, kBurningBlockSize); @@ -160,10 +160,11 @@ return; } - scoped_ptr<char[]> image_buffer(new char[kBurningBlockSize]); + std::unique_ptr<char[]> image_buffer(new char[kBurningBlockSize]); // DASD buffers require memory alignment on some systems. - scoped_ptr<char, base::AlignedFreeDeleter> device_buffer(static_cast<char*>( - base::AlignedAlloc(kBurningBlockSize, kMemoryAlignment))); + std::unique_ptr<char, base::AlignedFreeDeleter> device_buffer( + static_cast<char*>( + base::AlignedAlloc(kBurningBlockSize, kMemoryAlignment))); int bytes_read = image_file_.Read(bytes_processed_, image_buffer.get(), kBurningBlockSize);
diff --git a/chrome/utility/image_writer/image_writer.h b/chrome/utility/image_writer/image_writer.h index ad7b0bc..7129bdd 100644 --- a/chrome/utility/image_writer/image_writer.h +++ b/chrome/utility/image_writer/image_writer.h
@@ -7,13 +7,13 @@ #include <stdint.h> +#include <memory> #include <vector> #include "base/bind.h" #include "base/callback.h" #include "base/files/file.h" #include "base/files/file_path.h" -#include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "build/build_config.h" @@ -88,7 +88,7 @@ #if defined(OS_MACOSX) friend class DiskUnmounterMac; - scoped_ptr<DiskUnmounterMac> unmounter_; + std::unique_ptr<DiskUnmounterMac> unmounter_; #endif ImageWriterHandler* handler_;
diff --git a/chrome/utility/image_writer/image_writer_handler.h b/chrome/utility/image_writer/image_writer_handler.h index e8f7ee2..4543dec 100644 --- a/chrome/utility/image_writer/image_writer_handler.h +++ b/chrome/utility/image_writer/image_writer_handler.h
@@ -7,9 +7,9 @@ #include <stdint.h> +#include <memory> #include <string> -#include "base/memory/scoped_ptr.h" #include "chrome/utility/image_writer/image_writer.h" #include "chrome/utility/utility_message_handler.h" #include "ipc/ipc_message.h" @@ -45,7 +45,7 @@ void OnVerifyStart(const base::FilePath& image, const base::FilePath& device); void OnCancel(); - scoped_ptr<ImageWriter> image_writer_; + std::unique_ptr<ImageWriter> image_writer_; }; } // namespace image_writer
diff --git a/chrome/utility/image_writer/image_writer_unittest.cc b/chrome/utility/image_writer/image_writer_unittest.cc index ba6bab5..1facc07a 100644 --- a/chrome/utility/image_writer/image_writer_unittest.cc +++ b/chrome/utility/image_writer/image_writer_unittest.cc
@@ -40,7 +40,7 @@ void TearDown() override {} void FillFile(const base::FilePath& path, int pattern) { - scoped_ptr<char[]> buffer(new char[kTestFileSize]); + std::unique_ptr<char[]> buffer(new char[kTestFileSize]); memset(buffer.get(), pattern, kTestFileSize); ASSERT_TRUE(base::WriteFile(path, buffer.get(), kTestFileSize));
diff --git a/chrome/utility/image_writer/image_writer_win.cc b/chrome/utility/image_writer/image_writer_win.cc index 795e80a..548f035d 100644 --- a/chrome/utility/image_writer/image_writer_win.cc +++ b/chrome/utility/image_writer/image_writer_win.cc
@@ -33,7 +33,7 @@ query.QueryType = PropertyStandardQuery; DWORD bytes_returned; - scoped_ptr<char[]> output_buf(new char[kStorageQueryBufferSize]); + std::unique_ptr<char[]> output_buf(new char[kStorageQueryBufferSize]); BOOL status = DeviceIoControl( device_handle.Get(), // Device handle. IOCTL_STORAGE_QUERY_PROPERTY, // Flag to request device properties.
diff --git a/chrome/utility/importer/edge_database_reader_unittest_win.cc b/chrome/utility/importer/edge_database_reader_unittest_win.cc index 154296c..964d3f2 100644 --- a/chrome/utility/importer/edge_database_reader_unittest_win.cc +++ b/chrome/utility/importer/edge_database_reader_unittest_win.cc
@@ -134,7 +134,7 @@ ASSERT_TRUE(CopyTestDatabase(L"testdata.edb", &database_path)); EdgeDatabaseReader reader; EXPECT_TRUE(reader.OpenDatabase(database_path.value())); - scoped_ptr<EdgeDatabaseTableEnumerator> table_enum = + std::unique_ptr<EdgeDatabaseTableEnumerator> table_enum = reader.OpenTableEnumerator(L"TestTable"); EXPECT_NE(nullptr, table_enum); } @@ -148,7 +148,7 @@ ASSERT_TRUE(CopyTestDatabase(L"testdata.edb", &database_path)); EdgeDatabaseReader reader; EXPECT_TRUE(reader.OpenDatabase(database_path.value())); - scoped_ptr<EdgeDatabaseTableEnumerator> table_enum = + std::unique_ptr<EdgeDatabaseTableEnumerator> table_enum = reader.OpenTableEnumerator(L"NotARealTableName"); EXPECT_EQ(nullptr, table_enum); } @@ -159,7 +159,7 @@ return; EdgeDatabaseReader reader; - scoped_ptr<EdgeDatabaseTableEnumerator> table_enum = + std::unique_ptr<EdgeDatabaseTableEnumerator> table_enum = reader.OpenTableEnumerator(L"TestTable"); EXPECT_EQ(nullptr, table_enum); EXPECT_EQ(JET_errDatabaseNotFound, reader.last_error()); @@ -187,7 +187,7 @@ ASSERT_TRUE(CopyTestDatabase(L"testdata.edb", &database_path)); EdgeDatabaseReader reader; EXPECT_TRUE(reader.OpenDatabase(database_path.value())); - scoped_ptr<EdgeDatabaseTableEnumerator> table_enum = + std::unique_ptr<EdgeDatabaseTableEnumerator> table_enum = reader.OpenTableEnumerator(L"TestTable"); EXPECT_NE(nullptr, table_enum); int row_count = 0; @@ -250,7 +250,7 @@ ASSERT_TRUE(CopyTestDatabase(L"testdata.edb", &database_path)); EdgeDatabaseReader reader; EXPECT_TRUE(reader.OpenDatabase(database_path.value())); - scoped_ptr<EdgeDatabaseTableEnumerator> table_enum = + std::unique_ptr<EdgeDatabaseTableEnumerator> table_enum = reader.OpenTableEnumerator(L"TestTable"); EXPECT_NE(nullptr, table_enum); int row_count = 0; @@ -274,7 +274,7 @@ ASSERT_TRUE(CopyTestDatabase(L"testdata.edb", &database_path)); EdgeDatabaseReader reader; EXPECT_TRUE(reader.OpenDatabase(database_path.value())); - scoped_ptr<EdgeDatabaseTableEnumerator> table_enum = + std::unique_ptr<EdgeDatabaseTableEnumerator> table_enum = reader.OpenTableEnumerator(L"TestTable"); EXPECT_NE(nullptr, table_enum); int32_t int_col_value = 0; @@ -291,7 +291,7 @@ ASSERT_TRUE(CopyTestDatabase(L"testdata.edb", &database_path)); EdgeDatabaseReader reader; EXPECT_TRUE(reader.OpenDatabase(database_path.value())); - scoped_ptr<EdgeDatabaseTableEnumerator> table_enum = + std::unique_ptr<EdgeDatabaseTableEnumerator> table_enum = reader.OpenTableEnumerator(L"NoColsTable"); EXPECT_NE(nullptr, table_enum); int32_t int_col_value = 0; @@ -308,7 +308,7 @@ ASSERT_TRUE(CopyTestDatabase(L"testdata.edb", &database_path)); EdgeDatabaseReader reader; EXPECT_TRUE(reader.OpenDatabase(database_path.value())); - scoped_ptr<EdgeDatabaseTableEnumerator> table_enum = + std::unique_ptr<EdgeDatabaseTableEnumerator> table_enum = reader.OpenTableEnumerator(L"EmptyTable"); EXPECT_NE(nullptr, table_enum); int32_t int_col_value = 0; @@ -335,7 +335,7 @@ ASSERT_TRUE(CopyTestDatabase(L"testdata.edb", &database_path)); EdgeDatabaseReader reader; EXPECT_TRUE(reader.OpenDatabase(database_path.value())); - scoped_ptr<EdgeDatabaseTableEnumerator> table_enum = + std::unique_ptr<EdgeDatabaseTableEnumerator> table_enum = reader.OpenTableEnumerator(L"UnicodeTable"); EXPECT_NE(nullptr, table_enum); size_t utf8_strings_count = arraysize(utf8_strings); @@ -360,7 +360,7 @@ ASSERT_TRUE(CopyTestDatabase(L"testdata.edb", &database_path)); EdgeDatabaseReader reader; EXPECT_TRUE(reader.OpenDatabase(database_path.value())); - scoped_ptr<EdgeDatabaseTableEnumerator> table_enum = + std::unique_ptr<EdgeDatabaseTableEnumerator> table_enum = reader.OpenTableEnumerator(L"NonUnicodeTable"); EXPECT_NE(nullptr, table_enum); base::string16 str_col_value; @@ -377,7 +377,7 @@ ASSERT_TRUE(CopyTestDatabase(L"testdata.edb", &database_path)); EdgeDatabaseReader reader; EXPECT_TRUE(reader.OpenDatabase(database_path.value())); - scoped_ptr<EdgeDatabaseTableEnumerator> table_enum = + std::unique_ptr<EdgeDatabaseTableEnumerator> table_enum = reader.OpenTableEnumerator(L"NullTable"); EXPECT_NE(nullptr, table_enum); @@ -428,7 +428,7 @@ ASSERT_TRUE(CopyTestDatabase(L"testdata.edb", &database_path)); EdgeDatabaseReader reader; EXPECT_TRUE(reader.OpenDatabase(database_path.value())); - scoped_ptr<EdgeDatabaseTableEnumerator> table_enum = + std::unique_ptr<EdgeDatabaseTableEnumerator> table_enum = reader.OpenTableEnumerator(L"TestTable"); EXPECT_NE(nullptr, table_enum);
diff --git a/chrome/utility/importer/edge_database_reader_win.cc b/chrome/utility/importer/edge_database_reader_win.cc index 01dfb5e0..dd5d455 100644 --- a/chrome/utility/importer/edge_database_reader_win.cc +++ b/chrome/utility/importer/edge_database_reader_win.cc
@@ -10,6 +10,8 @@ #include <vector> +#include "base/memory/ptr_util.h" + namespace { // This is an arbitary size chosen for the database error message buffer. @@ -241,8 +243,8 @@ return true; } -scoped_ptr<EdgeDatabaseTableEnumerator> EdgeDatabaseReader::OpenTableEnumerator( - const base::string16& table_name) { +std::unique_ptr<EdgeDatabaseTableEnumerator> +EdgeDatabaseReader::OpenTableEnumerator(const base::string16& table_name) { JET_TABLEID table_id; if (!IsOpen()) { @@ -254,6 +256,6 @@ nullptr, 0, JET_bitTableReadOnly, &table_id))) return nullptr; - return make_scoped_ptr( + return base::WrapUnique( new EdgeDatabaseTableEnumerator(table_name, session_id_, table_id)); }
diff --git a/chrome/utility/importer/edge_database_reader_win.h b/chrome/utility/importer/edge_database_reader_win.h index 1b87801..623918a3 100644 --- a/chrome/utility/importer/edge_database_reader_win.h +++ b/chrome/utility/importer/edge_database_reader_win.h
@@ -10,9 +10,9 @@ #undef JET_UNICODE #include <map> +#include <memory> #include "base/macros.h" -#include "base/memory/scoped_ptr.h" #include "base/strings/string16.h" class EdgeErrorObject { @@ -79,7 +79,7 @@ bool OpenDatabase(const base::string16& database_file); // Open a row enumerator for a specified table. Returns a nullptr on error. - scoped_ptr<EdgeDatabaseTableEnumerator> OpenTableEnumerator( + std::unique_ptr<EdgeDatabaseTableEnumerator> OpenTableEnumerator( const base::string16& table_name); private:
diff --git a/chrome/utility/importer/edge_importer_win.cc b/chrome/utility/importer/edge_importer_win.cc index 7421f7e..39097279 100644 --- a/chrome/utility/importer/edge_importer_win.cc +++ b/chrome/utility/importer/edge_importer_win.cc
@@ -8,6 +8,7 @@ #include <algorithm> #include <map> +#include <memory> #include <string> #include <tuple> #include <vector> @@ -16,7 +17,6 @@ #include "base/files/file_path.h" #include "base/files/file_util.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "base/strings/string16.h" #include "base/strings/string_util.h" #include "base/time/time.h" @@ -215,7 +215,7 @@ return; } - scoped_ptr<EdgeDatabaseTableEnumerator> enumerator = + std::unique_ptr<EdgeDatabaseTableEnumerator> enumerator = database.OpenTableEnumerator(L"Favorites"); if (!enumerator) { DVLOG(1) << "Error opening database table " << database.GetErrorMessage();
diff --git a/chrome/utility/importer/external_process_importer_bridge.h b/chrome/utility/importer/external_process_importer_bridge.h index 29c98fd..0a22e7e 100644 --- a/chrome/utility/importer/external_process_importer_bridge.h +++ b/chrome/utility/importer/external_process_importer_bridge.h
@@ -5,12 +5,12 @@ #ifndef CHROME_UTILITY_IMPORTER_EXTERNAL_PROCESS_IMPORTER_BRIDGE_H_ #define CHROME_UTILITY_IMPORTER_EXTERNAL_PROCESS_IMPORTER_BRIDGE_H_ +#include <memory> #include <string> #include <vector> #include "base/compiler_specific.h" #include "base/macros.h" -#include "base/memory/scoped_ptr.h" #include "build/build_config.h" #include "chrome/common/importer/importer_bridge.h" #include "components/favicon_base/favicon_usage_data.h" @@ -92,7 +92,7 @@ // Holds strings needed by the external importer because the resource // bundle isn't available to the external process. - scoped_ptr<base::DictionaryValue> localized_strings_; + std::unique_ptr<base::DictionaryValue> localized_strings_; IPC::Sender* sender_; scoped_refptr<base::TaskRunner> task_runner_;
diff --git a/chrome/utility/importer/firefox_importer.cc b/chrome/utility/importer/firefox_importer.cc index 6875290..cbeab3b 100644 --- a/chrome/utility/importer/firefox_importer.cc +++ b/chrome/utility/importer/firefox_importer.cc
@@ -4,13 +4,13 @@ #include "chrome/utility/importer/firefox_importer.h" +#include <memory> #include <set> #include "base/files/file_enumerator.h" #include "base/files/file_util.h" #include "base/json/json_file_value_serializer.h" #include "base/macros.h" -#include "base/memory/scoped_ptr.h" #include "base/message_loop/message_loop.h" #include "base/stl_util.h" #include "base/strings/string_util.h" @@ -542,7 +542,7 @@ base::FilePath search_metadata_json_file = source_path_.AppendASCII("search-metadata.json"); JSONFileValueDeserializer metadata_deserializer(search_metadata_json_file); - scoped_ptr<base::Value> metadata_root = + std::unique_ptr<base::Value> metadata_root = metadata_deserializer.Deserialize(NULL, NULL); const base::DictionaryValue* search_metadata_root = NULL; if (metadata_root) @@ -554,7 +554,7 @@ return; JSONFileValueDeserializer deserializer(search_json_file); - scoped_ptr<base::Value> root = deserializer.Deserialize(NULL, NULL); + std::unique_ptr<base::Value> root = deserializer.Deserialize(NULL, NULL); const base::DictionaryValue* search_root = NULL; if (!root || !root->GetAsDictionary(&search_root)) return;
diff --git a/chrome/utility/importer/firefox_importer_unittest_utils.h b/chrome/utility/importer/firefox_importer_unittest_utils.h index a0b3e689..f368dae 100644 --- a/chrome/utility/importer/firefox_importer_unittest_utils.h +++ b/chrome/utility/importer/firefox_importer_unittest_utils.h
@@ -5,9 +5,10 @@ #ifndef CHROME_UTILITY_IMPORTER_FIREFOX_IMPORTER_UNITTEST_UTILS_H_ #define CHROME_UTILITY_IMPORTER_FIREFOX_IMPORTER_UNITTEST_UTILS_H_ +#include <memory> + #include "base/files/file_util.h" #include "base/macros.h" -#include "base/memory/scoped_ptr.h" #include "base/process/process.h" #include "build/build_config.h" #include "chrome/utility/importer/nss_decryptor.h" @@ -59,9 +60,9 @@ bool WaitForClientResponse(); base::Process child_process_; - scoped_ptr<IPC::Channel> channel_; - scoped_ptr<FFDecryptorServerChannelListener> listener_; - scoped_ptr<base::MessageLoopForIO> message_loop_; + std::unique_ptr<IPC::Channel> channel_; + std::unique_ptr<FFDecryptorServerChannelListener> listener_; + std::unique_ptr<base::MessageLoopForIO> message_loop_; #else NSSDecryptor decryptor_; #endif // !OS_MACOSX
diff --git a/chrome/utility/importer/firefox_importer_unittest_utils_mac.cc b/chrome/utility/importer/firefox_importer_unittest_utils_mac.cc index 445f9df..d7270665 100644 --- a/chrome/utility/importer/firefox_importer_unittest_utils_mac.cc +++ b/chrome/utility/importer/firefox_importer_unittest_utils_mac.cc
@@ -284,8 +284,8 @@ base::MessageLoopForIO main_message_loop; FFDecryptorClientChannelListener listener; - scoped_ptr<IPC::Channel> channel = IPC::Channel::CreateClient( - kTestChannelID, &listener); + std::unique_ptr<IPC::Channel> channel = + IPC::Channel::CreateClient(kTestChannelID, &listener); CHECK(channel->Connect()); listener.SetSender(channel.get());
diff --git a/chrome/utility/importer/nss_decryptor.cc b/chrome/utility/importer/nss_decryptor.cc index 5e5172f..3f3d8383 100644 --- a/chrome/utility/importer/nss_decryptor.cc +++ b/chrome/utility/importer/nss_decryptor.cc
@@ -6,13 +6,13 @@ #include <stddef.h> +#include <memory> #include <string> #include <vector> #include "base/base64.h" #include "base/files/file_util.h" #include "base/json/json_reader.h" -#include "base/memory/scoped_ptr.h" #include "base/strings/string_split.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" @@ -295,7 +295,8 @@ std::vector<autofill::PasswordForm>* forms) { std::string json_content; base::ReadFileToString(json_file, &json_content); - scoped_ptr<base::Value> parsed_json(base::JSONReader::Read(json_content)); + std::unique_ptr<base::Value> parsed_json( + base::JSONReader::Read(json_content)); const base::DictionaryValue* password_dict; const base::ListValue* password_list; const base::ListValue* blacklist_domains;
diff --git a/chrome/utility/media_galleries/media_metadata_parser.cc b/chrome/utility/media_galleries/media_metadata_parser.cc index 43f8052..26d6d42 100644 --- a/chrome/utility/media_galleries/media_metadata_parser.cc +++ b/chrome/utility/media_galleries/media_metadata_parser.cc
@@ -22,13 +22,13 @@ namespace { void SetStringScopedPtr(const std::string& value, - scoped_ptr<std::string>* destination) { + std::unique_ptr<std::string>* destination) { DCHECK(destination); if (!value.empty()) destination->reset(new std::string(value)); } -void SetIntScopedPtr(int value, scoped_ptr<int>* destination) { +void SetIntScopedPtr(int value, std::unique_ptr<int>* destination) { DCHECK(destination); if (value >= 0) destination->reset(new int(value));
diff --git a/chrome/utility/media_galleries/media_metadata_parser.h b/chrome/utility/media_galleries/media_metadata_parser.h index aee7a7fe..1e7720b 100644 --- a/chrome/utility/media_galleries/media_metadata_parser.h +++ b/chrome/utility/media_galleries/media_metadata_parser.h
@@ -5,12 +5,12 @@ #ifndef CHROME_UTILITY_MEDIA_GALLERIES_MEDIA_METADATA_PARSER_H_ #define CHROME_UTILITY_MEDIA_GALLERIES_MEDIA_METADATA_PARSER_H_ +#include <memory> #include <string> #include <vector> #include "base/callback.h" #include "base/macros.h" -#include "base/memory/scoped_ptr.h" #include "chrome/common/extensions/api/media_galleries.h" #include "chrome/common/media_galleries/metadata_types.h" @@ -58,7 +58,7 @@ // handles messages from the browser process. // TODO(tommycli): Replace with a reference to a WorkerPool if we ever use // this class in batch mode. - scoped_ptr<base::Thread> media_thread_; + std::unique_ptr<base::Thread> media_thread_; DISALLOW_COPY_AND_ASSIGN(MediaMetadataParser); };
diff --git a/chrome/utility/media_galleries/pmp_column_reader.h b/chrome/utility/media_galleries/pmp_column_reader.h index 7f885ea..9510f39 100644 --- a/chrome/utility/media_galleries/pmp_column_reader.h +++ b/chrome/utility/media_galleries/pmp_column_reader.h
@@ -7,11 +7,11 @@ #include <stdint.h> +#include <memory> #include <string> #include <vector> #include "base/macros.h" -#include "base/memory/scoped_ptr.h" #include "chrome/common/media_galleries/pmp_constants.h" namespace base { @@ -49,7 +49,7 @@ int64_t IndexStrings(); // Source data - scoped_ptr<uint8_t[]> data_; + std::unique_ptr<uint8_t[]> data_; int64_t length_; // Header data
diff --git a/chrome/utility/profile_import_handler.h b/chrome/utility/profile_import_handler.h index cf7c909..02c43a5a 100644 --- a/chrome/utility/profile_import_handler.h +++ b/chrome/utility/profile_import_handler.h
@@ -7,9 +7,10 @@ #include <stdint.h> +#include <memory> + #include "base/compiler_specific.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "chrome/utility/utility_message_handler.h" class ExternalProcessImporterBridge; @@ -45,7 +46,7 @@ // Thread that importer runs on, while ProfileImportThread handles messages // from the browser process. - scoped_ptr<base::Thread> import_thread_; + std::unique_ptr<base::Thread> import_thread_; // Bridge object is passed to importer, so that it can send IPC calls // directly back to the ProfileImportProcessHost.
diff --git a/chrome/utility/safe_browsing/mac/crdmg.cc b/chrome/utility/safe_browsing/mac/crdmg.cc index a6cb076..18a5ea1 100644 --- a/chrome/utility/safe_browsing/mac/crdmg.cc +++ b/chrome/utility/safe_browsing/mac/crdmg.cc
@@ -177,7 +177,7 @@ if (partition_type != "Apple_HFS" && partition_type != "Apple_HFSX") continue; - scoped_ptr<safe_browsing::dmg::ReadStream> partition_stream( + std::unique_ptr<safe_browsing::dmg::ReadStream> partition_stream( udif_parser.GetPartitionReadStream(i)); safe_browsing::dmg::HFSIterator iterator(partition_stream.get()); if (!iterator.Open()) { @@ -221,7 +221,7 @@ continue; } - scoped_ptr<safe_browsing::dmg::ReadStream> stream( + std::unique_ptr<safe_browsing::dmg::ReadStream> stream( iterator.GetReadStream()); size_t read_this_pass = 0; do {
diff --git a/chrome/utility/safe_browsing/mac/dmg_analyzer.cc b/chrome/utility/safe_browsing/mac/dmg_analyzer.cc index 43f8b6fe..94cb913 100644 --- a/chrome/utility/safe_browsing/mac/dmg_analyzer.cc +++ b/chrome/utility/safe_browsing/mac/dmg_analyzer.cc
@@ -7,10 +7,10 @@ #include <stddef.h> #include <stdint.h> +#include <memory> #include <vector> #include "base/macros.h" -#include "base/memory/scoped_ptr.h" #include "base/strings/utf_string_conversions.h" #include "chrome/common/safe_browsing/binary_feature_extractor.h" #include "chrome/common/safe_browsing/csd.pb.h" @@ -94,7 +94,7 @@ return false; buffer_.clear(); - scoped_ptr<crypto::SecureHash> sha256( + std::unique_ptr<crypto::SecureHash> sha256( crypto::SecureHash::Create(crypto::SecureHash::SHA256)); size_t bytes_read; @@ -128,7 +128,7 @@ return; while (iterator.Next()) { - scoped_ptr<ReadStream> stream = iterator.GetReadStream(); + std::unique_ptr<ReadStream> stream = iterator.GetReadStream(); if (!stream || !feature_extractor.IsMachO(stream.get())) continue;
diff --git a/chrome/utility/safe_browsing/mac/dmg_iterator.cc b/chrome/utility/safe_browsing/mac/dmg_iterator.cc index 834e9310..d1e0192 100644 --- a/chrome/utility/safe_browsing/mac/dmg_iterator.cc +++ b/chrome/utility/safe_browsing/mac/dmg_iterator.cc
@@ -75,7 +75,7 @@ return hfs_->GetPath(); } -scoped_ptr<ReadStream> DMGIterator::GetReadStream() { +std::unique_ptr<ReadStream> DMGIterator::GetReadStream() { return hfs_->GetReadStream(); }
diff --git a/chrome/utility/safe_browsing/mac/dmg_iterator.h b/chrome/utility/safe_browsing/mac/dmg_iterator.h index 0c6c4aa..f4ebc0c 100644 --- a/chrome/utility/safe_browsing/mac/dmg_iterator.h +++ b/chrome/utility/safe_browsing/mac/dmg_iterator.h
@@ -7,8 +7,9 @@ #include <stddef.h> +#include <memory> + #include "base/macros.h" -#include "base/memory/scoped_ptr.h" #include "base/memory/scoped_vector.h" #include "base/strings/string16.h" #include "chrome/utility/safe_browsing/mac/udif.h" @@ -44,13 +45,14 @@ base::string16 GetPath(); // Returns a ReadStream for the current file item. - scoped_ptr<ReadStream> GetReadStream(); + std::unique_ptr<ReadStream> GetReadStream(); private: UDIFParser udif_; // The UDIF parser that accesses the partitions. ScopedVector<ReadStream> partitions_; // Streams for all the HFS partitions. size_t current_partition_; // The index in |partitions_| of the current one. - scoped_ptr<HFSIterator> hfs_; // The HFSIterator for |current_partition_|. + std::unique_ptr<HFSIterator> + hfs_; // The HFSIterator for |current_partition_|. DISALLOW_COPY_AND_ASSIGN(DMGIterator); };
diff --git a/chrome/utility/safe_browsing/mac/hfs.cc b/chrome/utility/safe_browsing/mac/hfs.cc index 3407c54..f984636 100644 --- a/chrome/utility/safe_browsing/mac/hfs.cc +++ b/chrome/utility/safe_browsing/mac/hfs.cc
@@ -14,6 +14,7 @@ #include "base/logging.h" #include "base/macros.h" +#include "base/memory/ptr_util.h" #include "base/numerics/safe_math.h" #include "base/strings/utf_string_conversions.h" #include "chrome/utility/safe_browsing/mac/convert_big_endian.h" @@ -304,12 +305,12 @@ return catalog_->current_record()->path; } -scoped_ptr<ReadStream> HFSIterator::GetReadStream() { +std::unique_ptr<ReadStream> HFSIterator::GetReadStream() { if (IsDirectory() || IsHardLink()) return nullptr; DCHECK_EQ(kHFSPlusFileRecord, catalog_->current_record()->record_type); - return make_scoped_ptr( + return base::WrapUnique( new HFSForkReadStream(this, catalog_->current_record()->file->dataFork)); }
diff --git a/chrome/utility/safe_browsing/mac/hfs.h b/chrome/utility/safe_browsing/mac/hfs.h index 8a4a6d7..d1bd2da 100644 --- a/chrome/utility/safe_browsing/mac/hfs.h +++ b/chrome/utility/safe_browsing/mac/hfs.h
@@ -8,8 +8,9 @@ #include <hfs/hfs_format.h> #include <stdint.h> +#include <memory> + #include "base/macros.h" -#include "base/memory/scoped_ptr.h" #include "base/strings/string16.h" namespace safe_browsing { @@ -68,7 +69,7 @@ // Returns a stream for the data fork of the current iterator item. This may // only be called if IsDirectory() and IsHardLink() returns false. - scoped_ptr<ReadStream> GetReadStream(); + std::unique_ptr<ReadStream> GetReadStream(); private: friend class HFSForkReadStream; @@ -84,8 +85,10 @@ ReadStream* const stream_; // The stream backing the filesystem. HFSPlusVolumeHeader volume_header_; - scoped_ptr<HFSForkReadStream> catalog_file_; // Data of the catalog file. - scoped_ptr<HFSBTreeIterator> catalog_; // Iterator over the catalog file. + std::unique_ptr<HFSForkReadStream> + catalog_file_; // Data of the catalog file. + std::unique_ptr<HFSBTreeIterator> + catalog_; // Iterator over the catalog file. DISALLOW_COPY_AND_ASSIGN(HFSIterator); };
diff --git a/chrome/utility/safe_browsing/mac/hfs_unittest.cc b/chrome/utility/safe_browsing/mac/hfs_unittest.cc index df94e6a..9b9416946 100644 --- a/chrome/utility/safe_browsing/mac/hfs_unittest.cc +++ b/chrome/utility/safe_browsing/mac/hfs_unittest.cc
@@ -131,14 +131,14 @@ private: base::File hfs_file_; - scoped_ptr<FileReadStream> hfs_stream_; - scoped_ptr<HFSIterator> hfs_reader_; + std::unique_ptr<FileReadStream> hfs_stream_; + std::unique_ptr<HFSIterator> hfs_reader_; }; TEST_P(HFSFileReadTest, ReadReadme) { ASSERT_TRUE(GoToFile("README.txt")); - scoped_ptr<ReadStream> stream = hfs_reader()->GetReadStream(); + std::unique_ptr<ReadStream> stream = hfs_reader()->GetReadStream(); ASSERT_TRUE(stream.get()); EXPECT_FALSE(hfs_reader()->IsSymbolicLink()); @@ -168,7 +168,7 @@ TEST_P(HFSFileReadTest, ReadRandom) { ASSERT_TRUE(GoToFile("fifth/random")); - scoped_ptr<ReadStream> stream = hfs_reader()->GetReadStream(); + std::unique_ptr<ReadStream> stream = hfs_reader()->GetReadStream(); ASSERT_TRUE(stream.get()); EXPECT_FALSE(hfs_reader()->IsSymbolicLink()); @@ -183,7 +183,7 @@ TEST_P(HFSFileReadTest, Symlink) { ASSERT_TRUE(GoToFile("symlink-random")); - scoped_ptr<ReadStream> stream = hfs_reader()->GetReadStream(); + std::unique_ptr<ReadStream> stream = hfs_reader()->GetReadStream(); ASSERT_TRUE(stream.get()); EXPECT_TRUE(hfs_reader()->IsSymbolicLink()); @@ -209,7 +209,7 @@ TEST_P(HFSFileReadTest, DecmpfsFile) { ASSERT_TRUE(GoToFile("first/second/goat-output.txt")); - scoped_ptr<ReadStream> stream = hfs_reader()->GetReadStream(); + std::unique_ptr<ReadStream> stream = hfs_reader()->GetReadStream(); ASSERT_TRUE(stream.get()); EXPECT_FALSE(hfs_reader()->IsSymbolicLink());
diff --git a/chrome/utility/safe_browsing/mac/read_stream_unittest.cc b/chrome/utility/safe_browsing/mac/read_stream_unittest.cc index 335fe90..1223b67d 100644 --- a/chrome/utility/safe_browsing/mac/read_stream_unittest.cc +++ b/chrome/utility/safe_browsing/mac/read_stream_unittest.cc
@@ -7,12 +7,13 @@ #include <stddef.h> #include <stdint.h> +#include <memory> #include <vector> #include "base/files/file.h" #include "base/files/file_path.h" #include "base/files/scoped_temp_dir.h" -#include "base/memory/scoped_ptr.h" +#include "base/memory/ptr_util.h" #include "base/path_service.h" #include "chrome/common/chrome_paths.h" #include "chrome/utility/safe_browsing/mac/dmg_test_utils.h" @@ -56,26 +57,26 @@ ADD_FAILURE() << "Failing type is " << test_helper_.TestName(); } - scoped_ptr<ReadStream> CreateStream(size_t data_size); + std::unique_ptr<ReadStream> CreateStream(size_t data_size); private: T test_helper_; }; template <> -scoped_ptr<ReadStream> -ReadStreamTest<MemoryReadStreamTest>::CreateStream(size_t data_size) { +std::unique_ptr<ReadStream> ReadStreamTest<MemoryReadStreamTest>::CreateStream( + size_t data_size) { test_helper_.data.resize(data_size); for (size_t i = 0; i < data_size; ++i) { test_helper_.data[i] = i % 255; } - return make_scoped_ptr( + return base::WrapUnique( new MemoryReadStream(&test_helper_.data[0], data_size)); } template <> -scoped_ptr<ReadStream> -ReadStreamTest<FileReadStreamTest>::CreateStream(size_t data_size) { +std::unique_ptr<ReadStream> ReadStreamTest<FileReadStreamTest>::CreateStream( + size_t data_size) { base::FilePath path = test_helper_.temp_dir.path().Append("stream"); test_helper_.file.Initialize(path, base::File::FLAG_CREATE | base::File::FLAG_WRITE); @@ -98,7 +99,7 @@ return nullptr; } - return make_scoped_ptr( + return base::WrapUnique( new FileReadStream(test_helper_.file.GetPlatformFile())); } @@ -107,7 +108,8 @@ TYPED_TEST_CASE(ReadStreamTest, ReadStreamImpls); TYPED_TEST(ReadStreamTest, Read) { - scoped_ptr<ReadStream> stream = ReadStreamTest<TypeParam>::CreateStream(128); + std::unique_ptr<ReadStream> stream = + ReadStreamTest<TypeParam>::CreateStream(128); uint8_t buf[128] = {0}; size_t bytes_read; @@ -128,7 +130,7 @@ TYPED_TEST(ReadStreamTest, ReadAll) { const size_t kStreamSize = 4242; - scoped_ptr<ReadStream> stream = + std::unique_ptr<ReadStream> stream = ReadStreamTest<TypeParam>::CreateStream(kStreamSize); std::vector<uint8_t> data; @@ -137,7 +139,8 @@ } TYPED_TEST(ReadStreamTest, SeekSet) { - scoped_ptr<ReadStream> stream = ReadStreamTest<TypeParam>::CreateStream(255); + std::unique_ptr<ReadStream> stream = + ReadStreamTest<TypeParam>::CreateStream(255); uint8_t buf[32] = {0}; size_t bytes_read; @@ -159,7 +162,8 @@ } TYPED_TEST(ReadStreamTest, SeekEnd) { - scoped_ptr<ReadStream> stream = ReadStreamTest<TypeParam>::CreateStream(32); + std::unique_ptr<ReadStream> stream = + ReadStreamTest<TypeParam>::CreateStream(32); uint8_t buf[32] = {0}; size_t bytes_read; @@ -179,7 +183,8 @@ } TYPED_TEST(ReadStreamTest, SeekCur) { - scoped_ptr<ReadStream> stream = ReadStreamTest<TypeParam>::CreateStream(100); + std::unique_ptr<ReadStream> stream = + ReadStreamTest<TypeParam>::CreateStream(100); uint8_t buf[32] = {0}; size_t bytes_read;
diff --git a/chrome/utility/safe_browsing/mac/udif.cc b/chrome/utility/safe_browsing/mac/udif.cc index 8e3ce0f..90fde88 100644 --- a/chrome/utility/safe_browsing/mac/udif.cc +++ b/chrome/utility/safe_browsing/mac/udif.cc
@@ -16,6 +16,7 @@ #include "base/mac/foundation_util.h" #include "base/mac/scoped_cftyperef.h" #include "base/macros.h" +#include "base/memory/ptr_util.h" #include "base/numerics/safe_math.h" #include "base/strings/sys_string_conversions.h" #include "chrome/utility/safe_browsing/mac/convert_big_endian.h" @@ -234,7 +235,7 @@ const UDIFBlock* const block_; // The block for this partition. uint64_t current_chunk_; // The current chunk number. // The current chunk stream. - scoped_ptr<UDIFBlockChunkReadStream> chunk_stream_; + std::unique_ptr<UDIFBlockChunkReadStream> chunk_stream_; DISALLOW_COPY_AND_ASSIGN(UDIFPartitionReadStream); }; @@ -338,9 +339,10 @@ return size.ValueOrDie(); } -scoped_ptr<ReadStream> UDIFParser::GetPartitionReadStream(size_t part_number) { +std::unique_ptr<ReadStream> UDIFParser::GetPartitionReadStream( + size_t part_number) { DCHECK_LT(part_number, blocks_.size()); - return make_scoped_ptr( + return base::WrapUnique( new UDIFPartitionReadStream(stream_, block_size_, blocks_[part_number])); } @@ -434,7 +436,7 @@ // Copy the block table out of the plist. auto block_data = reinterpret_cast<const UDIFBlockData*>(CFDataGetBytePtr(data)); - scoped_ptr<UDIFBlock> block(new UDIFBlock(block_data)); + std::unique_ptr<UDIFBlock> block(new UDIFBlock(block_data)); if (block->signature() != UDIFBlockData::kSignature) { DLOG(ERROR) << "Skipping block " << i << " because its signature does not"
diff --git a/chrome/utility/safe_browsing/mac/udif.h b/chrome/utility/safe_browsing/mac/udif.h index bb8cdc0..3b1a29d 100644 --- a/chrome/utility/safe_browsing/mac/udif.h +++ b/chrome/utility/safe_browsing/mac/udif.h
@@ -8,15 +8,14 @@ #include <CoreFoundation/CoreFoundation.h> #include <stddef.h> #include <stdint.h> +#include <sys/types.h> +#include <memory> #include <string> #include <vector> -#include <sys/types.h> - #include "base/mac/scoped_cftyperef.h" #include "base/macros.h" -#include "base/memory/scoped_ptr.h" #include "base/memory/scoped_vector.h" namespace safe_browsing { @@ -71,7 +70,7 @@ // Returns a stream of the raw partition data for the given partition // number. - scoped_ptr<ReadStream> GetPartitionReadStream(size_t part_number); + std::unique_ptr<ReadStream> GetPartitionReadStream(size_t part_number); private: // Parses the blkx plist trailer structure.
diff --git a/chrome/utility/safe_browsing/mac/udif_unittest.cc b/chrome/utility/safe_browsing/mac/udif_unittest.cc index 6cd5007..3b0e64f 100644 --- a/chrome/utility/safe_browsing/mac/udif_unittest.cc +++ b/chrome/utility/safe_browsing/mac/udif_unittest.cc
@@ -94,7 +94,7 @@ size_t total_size = udif.GetPartitionSize(i); size_t total_bytes_read = 0; - scoped_ptr<ReadStream> stream = udif.GetPartitionReadStream(i); + std::unique_ptr<ReadStream> stream = udif.GetPartitionReadStream(i); bool success = false; do { @@ -134,7 +134,7 @@ for (size_t i = 0; i < udif.GetNumberOfPartitions(); ++i) { SCOPED_TRACE(base::StringPrintf("partition %zu", i)); - scoped_ptr<ReadStream> stream = udif.GetPartitionReadStream(i); + std::unique_ptr<ReadStream> stream = udif.GetPartitionReadStream(i); // Apple_HFS will match both HFS and HFSX. if (udif.GetPartitionType(i).find("Apple_HFS") != std::string::npos) {
diff --git a/chrome/utility/safe_json_parser_handler.h b/chrome/utility/safe_json_parser_handler.h index 8eeaf3e..efbc144b 100644 --- a/chrome/utility/safe_json_parser_handler.h +++ b/chrome/utility/safe_json_parser_handler.h
@@ -5,8 +5,9 @@ #ifndef CHROME_UTILITY_SAFE_JSON_PARSER_HANDLER_H_ #define CHROME_UTILITY_SAFE_JSON_PARSER_HANDLER_H_ +#include <memory> + #include "base/macros.h" -#include "base/memory/scoped_ptr.h" #include "chrome/utility/utility_message_handler.h" namespace safe_json { @@ -26,7 +27,7 @@ bool OnMessageReceived(const IPC::Message& message) override; private: - scoped_ptr<safe_json::SafeJsonParserMessageFilter> handler_; + std::unique_ptr<safe_json::SafeJsonParserMessageFilter> handler_; DISALLOW_COPY_AND_ASSIGN(SafeJsonParserHandler); };
diff --git a/chrome/utility/shell_handler_win.cc b/chrome/utility/shell_handler_win.cc index 96cce541..92ae501 100644 --- a/chrome/utility/shell_handler_win.cc +++ b/chrome/utility/shell_handler_win.cc
@@ -6,8 +6,9 @@ #include <commdlg.h> +#include <memory> + #include "base/files/file_path.h" -#include "base/memory/scoped_ptr.h" #include "chrome/common/chrome_utility_messages.h" #include "content/public/utility/utility_thread.h" #include "ui/base/win/open_file_name_win.h"
diff --git a/chromecast/media/audio/cast_audio_manager.cc b/chromecast/media/audio/cast_audio_manager.cc index b098b56..e3b56d9c7 100644 --- a/chromecast/media/audio/cast_audio_manager.cc +++ b/chromecast/media/audio/cast_audio_manager.cc
@@ -25,10 +25,15 @@ namespace chromecast { namespace media { -CastAudioManager::CastAudioManager(::media::AudioLogFactory* audio_log_factory, - MediaPipelineBackendManager* backend_manager) - : AudioManagerBase(audio_log_factory), backend_manager_(backend_manager) { -} +CastAudioManager::CastAudioManager( + scoped_refptr<base::SingleThreadTaskRunner> task_runner, + scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner, + ::media::AudioLogFactory* audio_log_factory, + MediaPipelineBackendManager* backend_manager) + : AudioManagerBase(std::move(task_runner), + std::move(worker_task_runner), + audio_log_factory), + backend_manager_(backend_manager) {} CastAudioManager::~CastAudioManager() { Shutdown();
diff --git a/chromecast/media/audio/cast_audio_manager.h b/chromecast/media/audio/cast_audio_manager.h index 97e3e3cf..572b99fe 100644 --- a/chromecast/media/audio/cast_audio_manager.h +++ b/chromecast/media/audio/cast_audio_manager.h
@@ -20,9 +20,11 @@ class CastAudioManager : public ::media::AudioManagerBase { public: - CastAudioManager(::media::AudioLogFactory* audio_log_factory, - MediaPipelineBackendManager* backend_manager); - ~CastAudioManager() override; + CastAudioManager( + scoped_refptr<base::SingleThreadTaskRunner> task_runner, + scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner, + ::media::AudioLogFactory* audio_log_factory, + MediaPipelineBackendManager* backend_manager); // AudioManager implementation. bool HasAudioOutputDevices() override; @@ -38,6 +40,9 @@ virtual std::unique_ptr<MediaPipelineBackend> CreateMediaPipelineBackend( const MediaPipelineDeviceParams& params); + protected: + ~CastAudioManager() override; + private: // AudioManagerBase implementation. ::media::AudioOutputStream* MakeLinearOutputStream(
diff --git a/chromecast/media/audio/cast_audio_manager_factory.cc b/chromecast/media/audio/cast_audio_manager_factory.cc index c932c4b..c6b7794 100644 --- a/chromecast/media/audio/cast_audio_manager_factory.cc +++ b/chromecast/media/audio/cast_audio_manager_factory.cc
@@ -17,9 +17,15 @@ CastAudioManagerFactory::~CastAudioManagerFactory() {} -::media::AudioManager* CastAudioManagerFactory::CreateInstance( +scoped_ptr<::media::AudioManager, ::media::AudioManagerDeleter> +CastAudioManagerFactory::CreateInstance( + scoped_refptr<base::SingleThreadTaskRunner> task_runner, + scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner, ::media::AudioLogFactory* audio_log_factory) { - return new CastAudioManager(audio_log_factory, backend_manager_); + return scoped_ptr<::media::AudioManager, ::media::AudioManagerDeleter>( + new CastAudioManager(std::move(task_runner), + std::move(worker_task_runner), audio_log_factory, + backend_manager_)); } } // namespace media
diff --git a/chromecast/media/audio/cast_audio_manager_factory.h b/chromecast/media/audio/cast_audio_manager_factory.h index 627a68d..d80cc84 100644 --- a/chromecast/media/audio/cast_audio_manager_factory.h +++ b/chromecast/media/audio/cast_audio_manager_factory.h
@@ -20,8 +20,10 @@ ~CastAudioManagerFactory() override; // ::media::AudioManagerFactory overrides. - ::media::AudioManager* CreateInstance( - ::media::AudioLogFactory* audio_log_factory) override; + scoped_ptr<::media::AudioManager, ::media::AudioManagerDeleter> + CreateInstance(scoped_refptr<base::SingleThreadTaskRunner> task_runner, + scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner, + ::media::AudioLogFactory* audio_log_factory) override; private: MediaPipelineBackendManager* const backend_manager_;
diff --git a/chromecast/media/audio/cast_audio_output_stream_unittest.cc b/chromecast/media/audio/cast_audio_output_stream_unittest.cc index d529077..67bf295 100644 --- a/chromecast/media/audio/cast_audio_output_stream_unittest.cc +++ b/chromecast/media/audio/cast_audio_output_stream_unittest.cc
@@ -10,7 +10,9 @@ #include "base/bind.h" #include "base/macros.h" +#include "base/run_loop.h" #include "base/synchronization/waitable_event.h" +#include "base/thread_task_runner_handle.h" #include "chromecast/base/metrics/cast_metrics_test_helper.h" #include "chromecast/media/audio/cast_audio_manager.h" #include "chromecast/media/base/media_message_loop.h" @@ -184,8 +186,9 @@ class FakeAudioManager : public CastAudioManager { public: - FakeAudioManager() - : CastAudioManager(nullptr, nullptr), media_pipeline_backend_(nullptr) {} + FakeAudioManager(scoped_refptr<base::SingleThreadTaskRunner> task_runner) + : CastAudioManager(task_runner, task_runner, nullptr, nullptr), + media_pipeline_backend_(nullptr) {} ~FakeAudioManager() override {} // CastAudioManager overrides. @@ -231,9 +234,9 @@ void SetUp() override { metrics::InitializeMetricsHelperForTesting(); - audio_manager_.reset(new FakeAudioManager); - audio_task_runner_ = audio_manager_->GetTaskRunner(); + audio_task_runner_ = base::ThreadTaskRunnerHandle::Get(); backend_task_runner_ = media::MediaMessageLoop::GetTaskRunner(); + audio_manager_.reset(new FakeAudioManager(audio_task_runner_)); } void TearDown() override { @@ -256,107 +259,68 @@ // Synchronous utility functions. ::media::AudioOutputStream* CreateStream() { - ::media::AudioOutputStream* stream = nullptr; - - base::WaitableEvent completion_event(false, false); - audio_task_runner_->PostTask( - FROM_HERE, - base::Bind(&CastAudioOutputStreamTest::CreateStreamOnAudioThread, - base::Unretained(this), GetAudioParams(), &stream, - &completion_event)); - completion_event.Wait(); - - return stream; + return audio_manager_->MakeAudioOutputStream(GetAudioParams(), + kDefaultDeviceId); } bool OpenStream(::media::AudioOutputStream* stream) { - DCHECK(stream); - - bool success = false; - base::WaitableEvent completion_event(false, false); - audio_task_runner_->PostTask( - FROM_HERE, - base::Bind(&CastAudioOutputStreamTest::OpenStreamOnAudioThread, - base::Unretained(this), stream, &success, - &completion_event)); - completion_event.Wait(); - + bool success = stream->Open(); // Drain the backend task runner so that appropriate states are set on // the backend pipeline devices. RunUntilIdle(backend_task_runner_.get()); return success; } void CloseStream(::media::AudioOutputStream* stream) { - audio_task_runner_->PostTask(FROM_HERE, - base::Bind(&::media::AudioOutputStream::Close, - base::Unretained(stream))); - RunUntilIdle(audio_task_runner_.get()); + stream->Close(); RunUntilIdle(backend_task_runner_.get()); // Backend task runner may have posted more tasks to the audio task runner. // So we need to drain it once more. - RunUntilIdle(audio_task_runner_.get()); + message_loop_.RunUntilIdle(); } void StartStream( ::media::AudioOutputStream* stream, ::media::AudioOutputStream::AudioSourceCallback* source_callback) { - audio_task_runner_->PostTask( - FROM_HERE, base::Bind(&::media::AudioOutputStream::Start, - base::Unretained(stream), source_callback)); - // Drain the audio task runner twice so that tasks posted by + stream->Start(source_callback); + // Drain the audio task runner so that tasks posted by // media::AudioOutputStream::Start are run as well. - RunUntilIdle(audio_task_runner_.get()); - RunUntilIdle(audio_task_runner_.get()); + message_loop_.RunUntilIdle(); // Drain the backend task runner so that appropriate states are set on // the backend pipeline devices. RunUntilIdle(backend_task_runner_.get()); // Drain the audio task runner again to run the tasks posted by the // backend on audio task runner. - RunUntilIdle(audio_task_runner_.get()); + message_loop_.RunUntilIdle(); } void StopStream(::media::AudioOutputStream* stream) { - audio_task_runner_->PostTask(FROM_HERE, - base::Bind(&::media::AudioOutputStream::Stop, - base::Unretained(stream))); - RunUntilIdle(audio_task_runner_.get()); + stream->Stop(); // Drain the backend task runner so that appropriate states are set on // the backend pipeline devices. RunUntilIdle(backend_task_runner_.get()); } void SetStreamVolume(::media::AudioOutputStream* stream, double volume) { - audio_task_runner_->PostTask( - FROM_HERE, base::Bind(&::media::AudioOutputStream::SetVolume, - base::Unretained(stream), volume)); - RunUntilIdle(audio_task_runner_.get()); + stream->SetVolume(volume); // Drain the backend task runner so that appropriate states are set on // the backend pipeline devices. RunUntilIdle(backend_task_runner_.get()); } double GetStreamVolume(::media::AudioOutputStream* stream) { double volume = 0.0; - audio_task_runner_->PostTask( - FROM_HERE, base::Bind(&::media::AudioOutputStream::GetVolume, - base::Unretained(stream), &volume)); - RunUntilIdle(audio_task_runner_.get()); + stream->GetVolume(&volume); // No need to drain the backend task runner because getting the volume // does not involve posting any task to the backend. return volume; } - void CreateStreamOnAudioThread(const ::media::AudioParameters& audio_params, - ::media::AudioOutputStream** stream, - base::WaitableEvent* completion_event) { - DCHECK(audio_task_runner_->BelongsToCurrentThread()); - *stream = audio_manager_->MakeAudioOutputStream(GetAudioParams(), - kDefaultDeviceId); - completion_event->Signal(); - } - void OpenStreamOnAudioThread(::media::AudioOutputStream* stream, - bool* success, - base::WaitableEvent* completion_event) { - DCHECK(audio_task_runner_->BelongsToCurrentThread()); - *success = stream->Open(); - completion_event->Signal(); + void RunAudioLoopFor(int frames) { + ::media::AudioParameters audio_params = GetAudioParams(); + base::TimeDelta duration = audio_params.GetBufferDuration() * frames; + + base::RunLoop run_loop; + message_loop_.task_runner()->PostDelayedTask( + FROM_HERE, run_loop.QuitClosure(), duration); + run_loop.Run(); } + base::MessageLoop message_loop_; std::unique_ptr<FakeAudioManager> audio_manager_; scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner_; scoped_refptr<base::SingleThreadTaskRunner> backend_task_runner_; @@ -476,6 +440,7 @@ std::unique_ptr<FakeAudioSourceCallback> source_callback( new FakeAudioSourceCallback); StartStream(stream, source_callback.get()); + RunAudioLoopFor(2); StopStream(stream); // Verify that the stream pushed frames to the backend. @@ -518,10 +483,7 @@ // Sleep for a few frames and verify that more frames were not pushed // because the backend device was busy. - ::media::AudioParameters audio_params = GetAudioParams(); - base::TimeDelta pause = audio_params.GetBufferDuration() * 5; - base::PlatformThread::Sleep(pause); - RunUntilIdle(audio_task_runner_.get()); + RunAudioLoopFor(5); RunUntilIdle(backend_task_runner_.get()); EXPECT_EQ(1u, audio_decoder->pushed_buffer_count()); @@ -532,9 +494,7 @@ base::Bind(&FakeAudioDecoder::set_pipeline_status, base::Unretained(audio_decoder), FakeAudioDecoder::PIPELINE_STATUS_OK)); - - base::PlatformThread::Sleep(pause); - RunUntilIdle(audio_task_runner_.get()); + RunAudioLoopFor(5); RunUntilIdle(backend_task_runner_.get()); EXPECT_LT(1u, audio_decoder->pushed_buffer_count()); EXPECT_FALSE(source_callback->error()); @@ -555,6 +515,7 @@ std::unique_ptr<FakeAudioSourceCallback> source_callback( new FakeAudioSourceCallback); StartStream(stream, source_callback.get()); + RunAudioLoopFor(2); // Make sure that AudioOutputStream attempted to push the initial frame. EXPECT_LT(0u, audio_decoder->pushed_buffer_count()); @@ -578,6 +539,7 @@ std::unique_ptr<FakeAudioSourceCallback> source_callback( new FakeAudioSourceCallback); StartStream(stream, source_callback.get()); + RunAudioLoopFor(5); // Make sure that one frame was pushed. EXPECT_EQ(1u, audio_decoder->pushed_buffer_count()); @@ -590,7 +552,7 @@ base::Unretained(audio_decoder), FakeAudioDecoder::PIPELINE_STATUS_OK)); - RunUntilIdle(audio_task_runner_.get()); + RunAudioLoopFor(5); RunUntilIdle(backend_task_runner_.get()); // AudioOutputStream must report error to source callback. EXPECT_TRUE(source_callback->error()); @@ -625,16 +587,11 @@ std::unique_ptr<FakeAudioSourceCallback> source_callback( new FakeAudioSourceCallback); - audio_task_runner_->PostTask( - FROM_HERE, base::Bind(&::media::AudioOutputStream::Start, - base::Unretained(stream), source_callback.get())); - audio_task_runner_->PostTask( - FROM_HERE, - base::Bind(&::media::AudioOutputStream::Stop, base::Unretained(stream))); - audio_task_runner_->PostTask( - FROM_HERE, base::Bind(&::media::AudioOutputStream::Start, - base::Unretained(stream), source_callback.get())); - RunUntilIdle(audio_task_runner_.get()); + stream->Start(source_callback.get()); + RunAudioLoopFor(2); + stream->Stop(); + stream->Start(source_callback.get()); + RunAudioLoopFor(2); RunUntilIdle(backend_task_runner_.get()); FakeAudioDecoder* audio_device = GetAudio();
diff --git a/chromeos/audio/audio_device.cc b/chromeos/audio/audio_device.cc index d689c00..1d626b7 100644 --- a/chromeos/audio/audio_device.cc +++ b/chromeos/audio/audio_device.cc
@@ -35,7 +35,7 @@ case AUDIO_TYPE_INTERNAL_MIC: return 1; case AUDIO_TYPE_KEYBOARD_MIC: - case AUDIO_TYPE_AOKR: + case AUDIO_TYPE_HOTWORD: case AUDIO_TYPE_POST_MIX_LOOPBACK: case AUDIO_TYPE_POST_DSP_LOOPBACK: case AUDIO_TYPE_OTHER: @@ -65,8 +65,8 @@ return "INTERNAL_MIC"; case AUDIO_TYPE_KEYBOARD_MIC: return "KEYBOARD_MIC"; - case AUDIO_TYPE_AOKR: - return "AOKR"; + case AUDIO_TYPE_HOTWORD: + return "HOTWORD"; case AUDIO_TYPE_POST_MIX_LOOPBACK: return "POST_MIX_LOOPBACK"; case AUDIO_TYPE_POST_DSP_LOOPBACK: @@ -96,8 +96,12 @@ return AUDIO_TYPE_HDMI; else if (node_type.find("INTERNAL_SPEAKER") != std::string::npos) return AUDIO_TYPE_INTERNAL_SPEAKER; + // TODO(hychao): Remove the 'AOKR' matching line after CRAS switches + // node type naming to 'HOTWORD'. else if (node_type.find("AOKR") != std::string::npos) - return AUDIO_TYPE_AOKR; + return AUDIO_TYPE_HOTWORD; + else if (node_type.find("HOTWORD") != std::string::npos) + return AUDIO_TYPE_HOTWORD; else if (node_type.find("POST_MIX_LOOPBACK") != std::string::npos) return AUDIO_TYPE_POST_MIX_LOOPBACK; else if (node_type.find("POST_DSP_LOOPBACK") != std::string::npos)
diff --git a/chromeos/audio/audio_device.h b/chromeos/audio/audio_device.h index d5078edf..724798c 100644 --- a/chromeos/audio/audio_device.h +++ b/chromeos/audio/audio_device.h
@@ -26,7 +26,7 @@ AUDIO_TYPE_INTERNAL_SPEAKER, AUDIO_TYPE_INTERNAL_MIC, AUDIO_TYPE_KEYBOARD_MIC, - AUDIO_TYPE_AOKR, + AUDIO_TYPE_HOTWORD, AUDIO_TYPE_POST_MIX_LOOPBACK, AUDIO_TYPE_POST_DSP_LOOPBACK, AUDIO_TYPE_OTHER, @@ -45,7 +45,7 @@ // Indicates that an input or output audio device is for simple usage like // playback or recording for user. In contrast, audio device such as - // loopback, always on keyword recognition (AOKR), and keyboard mic are + // loopback, always on keyword recognition (HOTWORD), and keyboard mic are // not for simple usage. bool is_for_simple_usage() const { return (type == AUDIO_TYPE_HEADPHONE ||
diff --git a/components/BUILD.gn b/components/BUILD.gn index 999d71d0..636cecf14 100644 --- a/components/BUILD.gn +++ b/components/BUILD.gn
@@ -31,18 +31,6 @@ } } -bundle_data("components_unittests_bundle_data") { - sources = [ - "//third_party/dom_distiller_js/dist/test/data", - "dom_distiller/core/javascript", - "test/data", - ] - outputs = [ - "{{bundle_resources_dir}}/" + - "{{source_root_relative_dir}}/{{source_file_part}}", - ] -} - # To add a unit test to this target, make a "unit_test" source_set in your # component (it's important to use a source_set instead of a static library or # no tests will run) and add a reference here. You can add more than one unit @@ -67,33 +55,71 @@ # test source set and not here. deps = [ - ":components_unittests_bundle_data", "//base", "//base/test:test_support", + "//components/auto_login_parser:unit_tests", + "//components/autofill/core/browser:unit_tests", + "//components/autofill/core/common:unit_tests", "//components/bookmarks/browser:unit_tests", "//components/bookmarks/managed:unit_tests", + "//components/browser_sync/browser:unit_tests", + "//components/bubble:unit_tests", + "//components/captive_portal:unit_tests", "//components/client_update_protocol:unit_tests", + "//components/cloud_devices/common:unit_tests", + "//components/component_updater:unit_tests", "//components/content_settings/core/browser:unit_tests", - "//components/content_settings/core/common", "//components/content_settings/core/common:unit_tests", + "//components/crx_file:unit_tests", + "//components/data_reduction_proxy/core/browser:unit_tests", + "//components/data_reduction_proxy/core/common:unit_tests", "//components/data_usage/core:unit_tests", + "//components/device_event_log:unit_tests", "//components/dom_distiller/core:unit_tests", + "//components/favicon/core:unit_tests", + "//components/favicon_base:unit_tests", "//components/flags_ui:unit_tests", + "//components/gcm_driver:unit_tests", + "//components/gcm_driver/crypto:unit_tests", "//components/google/core/browser:unit_tests", + "//components/history/core/browser:unit_tests", + "//components/history/core/common:unit_tests", + "//components/json_schema:unit_tests", "//components/keyed_service/core:unit_tests", + "//components/language_usage_metrics:unit_tests", "//components/leveldb_proto:unit_tests", + "//components/login:unit_tests", + "//components/memory_pressure:unit_tests", "//components/metrics:unit_tests", + "//components/mime_util:unit_tests", "//components/net_log:unit_tests", "//components/network_time:unit_tests", "//components/ntp_snippets:unit_tests", + "//components/offline_pages:unit_tests", + "//components/omnibox/browser:unit_tests", "//components/open_from_clipboard:unit_tests", "//components/os_crypt:unit_tests", + "//components/password_manager/core/browser:unit_tests", + "//components/password_manager/core/common:unit_tests", + "//components/password_manager/sync/browser:unit_tests", + "//components/precache/core:unit_tests", "//components/prefs:unit_tests", "//components/proxy_config:unit_tests", + "//components/query_parser:unit_tests", + "//components/rappor:unit_tests", + "//components/search:unit_tests", + "//components/search_engines:unit_tests", + "//components/search_provider_logos:unit_tests", "//components/security_state:unit_tests", "//components/sessions:unit_tests", + "//components/signin/core/browser:unit_tests", + "//components/ssl_config:unit_tests", + "//components/ssl_errors:unit_tests", "//components/suggestions:unit_tests", "//components/supervised_user_error_page:unit_tests", + "//components/sync_bookmarks:unit_tests", + "//components/sync_driver:unit_tests", + "//components/sync_sessions:unit_tests", "//components/syncable_prefs:unit_tests", "//components/translate/core/browser:unit_tests", "//components/translate/core/common:unit_tests", @@ -101,9 +127,16 @@ "//components/undo:unit_tests", "//components/update_client:unit_tests", "//components/upload_list:unit_tests", + "//components/url_formatter:unit_tests", + "//components/url_matcher:unit_tests", + "//components/user_prefs/tracked:unit_tests", "//components/variations:unit_tests", "//components/variations/service:unit_tests", "//components/web_resource:unit_tests", + "//components/webdata/common:unit_tests", + + # Direct dependencies of components/test/run_all_unittests.cc. + "//components/content_settings/core/common", "//net", "//testing/gtest", "//ui/base", @@ -122,82 +155,38 @@ } } else { # !iOS deps += [ - "//components/auto_login_parser:unit_tests", "//components/autofill/content/browser:unit_tests", "//components/autofill/content/renderer:unit_tests", - "//components/autofill/core/browser:unit_tests", - "//components/autofill/core/common:unit_tests", - "//components/browser_sync/browser:unit_tests", - "//components/bubble:unit_tests", - "//components/captive_portal:unit_tests", "//components/certificate_transparency:unit_tests", - "//components/cloud_devices/common:unit_tests", - "//components/component_updater:unit_tests", - "//components/crx_file:unit_tests", "//components/data_reduction_proxy/content/browser:unit_tests", - "//components/data_reduction_proxy/core/browser:unit_tests", - "//components/data_reduction_proxy/core/common:unit_tests", "//components/data_use_measurement/content:unit_tests", - "//components/device_event_log:unit_tests", "//components/devtools_http_handler:unit_tests", "//components/dom_distiller/content/browser:unit_tests", "//components/domain_reliability:unit_tests", "//components/error_page/renderer:unit_tests", "//components/favicon/content:unit_tests", - "//components/favicon/core:unit_tests", - "//components/favicon_base:unit_tests", - "//components/gcm_driver:unit_tests", - "//components/gcm_driver/crypto:unit_tests", "//components/guest_view/browser:unit_tests", "//components/history/content/browser:unit_tests", - "//components/history/core/browser:unit_tests", - "//components/history/core/common:unit_tests", "//components/invalidation/impl:unit_tests", - "//components/json_schema:unit_tests", "//components/keyed_service/content:unit_tests", - "//components/language_usage_metrics:unit_tests", - "//components/login:unit_tests", - "//components/memory_pressure:unit_tests", - "//components/mime_util:unit_tests", "//components/navigation_interception:unit_tests", "//components/network_hints/renderer:unit_tests", - "//components/offline_pages:unit_tests", - "//components/omnibox/browser:unit_tests", "//components/packed_ct_ev_whitelist:unit_tests", "//components/page_load_metrics/browser:unit_tests", "//components/page_load_metrics/renderer:unit_tests", "//components/password_manager/content/browser:unit_tests", - "//components/password_manager/core/browser:unit_tests", - "//components/password_manager/core/common:unit_tests", - "//components/password_manager/sync/browser:unit_tests", "//components/power:unit_tests", "//components/precache/content:unit_tests", - "//components/precache/core:unit_tests", - "//components/query_parser:unit_tests", - "//components/rappor:unit_tests", "//components/safe_browsing_db:unit_tests", "//components/safe_json:unit_tests", "//components/scheduler:unit_tests", - "//components/search:unit_tests", - "//components/search_engines:unit_tests", - "//components/search_provider_logos:unit_tests", - "//components/signin/core/browser:unit_tests", - "//components/ssl_config:unit_tests", - "//components/ssl_errors:unit_tests", - "//components/sync_bookmarks:unit_tests", - "//components/sync_driver:unit_tests", - "//components/sync_sessions:unit_tests", "//components/test_runner:test_runner", "//components/tracing:unit_tests", "//components/ui/zoom:unit_tests", - "//components/url_formatter:unit_tests", - "//components/url_matcher:unit_tests", - "//components/user_prefs/tracked:unit_tests", "//components/visitedlink/test:unit_tests", "//components/wallpaper:unit_tests", "//components/web_cache/browser:unit_tests", "//components/webcrypto:unit_tests", - "//components/webdata/common:unit_tests", "//mojo/edk/system", # These are the deps required by the code in this target.
diff --git a/components/app_modal/javascript_dialog_manager.cc b/components/app_modal/javascript_dialog_manager.cc index 65f212f..d0e30cf 100644 --- a/components/app_modal/javascript_dialog_manager.cc +++ b/components/app_modal/javascript_dialog_manager.cc
@@ -267,8 +267,8 @@ base::string16 url_string = url_formatter::ElideHost(origin_url, gfx::FontList(), kUrlElideWidth); #else - base::string16 url_string = - url_formatter::FormatUrlForSecurityDisplayOmitScheme(origin_url); + base::string16 url_string = url_formatter::FormatUrlForSecurityDisplay( + origin_url, url_formatter::SchemeDisplay::OMIT_HTTP_AND_HTTPS); #endif return l10n_util::GetStringFUTF16( is_same_origin_as_main_frame ? IDS_JAVASCRIPT_MESSAGEBOX_TITLE
diff --git a/components/arc.gypi b/components/arc.gypi index 7660ad95..b5cfdcd 100644 --- a/components/arc.gypi +++ b/components/arc.gypi
@@ -54,8 +54,6 @@ 'arc/ime/arc_ime_bridge_impl.h', 'arc/ime/arc_ime_service.cc', 'arc/ime/arc_ime_service.h', - 'arc/input/arc_input_bridge.cc', - 'arc/input/arc_input_bridge.h', 'arc/intent_helper/arc_intent_helper_bridge.cc', 'arc/intent_helper/arc_intent_helper_bridge.h', 'arc/intent_helper/font_size_util.cc', @@ -111,7 +109,6 @@ 'arc/common/clipboard.mojom', 'arc/common/crash_collector.mojom', 'arc/common/ime.mojom', - 'arc/common/input.mojom', 'arc/common/intent_helper.mojom', 'arc/common/net.mojom', 'arc/common/notifications.mojom',
diff --git a/components/arc/BUILD.gn b/components/arc/BUILD.gn index 8634459..fe00492 100644 --- a/components/arc/BUILD.gn +++ b/components/arc/BUILD.gn
@@ -32,8 +32,6 @@ "ime/arc_ime_bridge_impl.h", "ime/arc_ime_service.cc", "ime/arc_ime_service.h", - "input/arc_input_bridge.cc", - "input/arc_input_bridge.h", "intent_helper/arc_intent_helper_bridge.cc", "intent_helper/arc_intent_helper_bridge.h", "intent_helper/font_size_util.cc", @@ -88,7 +86,6 @@ "common/clipboard.mojom", "common/crash_collector.mojom", "common/ime.mojom", - "common/input.mojom", "common/intent_helper.mojom", "common/net.mojom", "common/notifications.mojom",
diff --git a/components/arc/arc_bridge_service.cc b/components/arc/arc_bridge_service.cc index 4666bf2..c9713c4 100644 --- a/components/arc/arc_bridge_service.cc +++ b/components/arc/arc_bridge_service.cc
@@ -72,8 +72,6 @@ observer->OnCrashCollectorInstanceReady(); if (ime_instance()) observer->OnImeInstanceReady(); - if (input_instance()) - observer->OnInputInstanceReady(); if (net_instance()) observer->OnNetInstanceReady(); if (notifications_instance()) @@ -266,30 +264,6 @@ FOR_EACH_OBSERVER(Observer, observer_list(), OnImeInstanceClosed()); } -void ArcBridgeService::OnInputInstanceReady(mojom::InputInstancePtr input_ptr) { - DCHECK(CalledOnValidThread()); - temporary_input_ptr_ = std::move(input_ptr); - temporary_input_ptr_.QueryVersion(base::Bind( - &ArcBridgeService::OnInputVersionReady, weak_factory_.GetWeakPtr())); -} - -void ArcBridgeService::OnInputVersionReady(int32_t version) { - DCHECK(CalledOnValidThread()); - input_ptr_ = std::move(temporary_input_ptr_); - input_ptr_.set_connection_error_handler(base::Bind( - &ArcBridgeService::CloseInputChannel, weak_factory_.GetWeakPtr())); - FOR_EACH_OBSERVER(Observer, observer_list(), OnInputInstanceReady()); -} - -void ArcBridgeService::CloseInputChannel() { - DCHECK(CalledOnValidThread()); - if (!input_ptr_) - return; - - input_ptr_.reset(); - FOR_EACH_OBSERVER(Observer, observer_list(), OnInputInstanceClosed()); -} - void ArcBridgeService::OnIntentHelperInstanceReady( mojom::IntentHelperInstancePtr intent_helper_ptr) { DCHECK(CalledOnValidThread()); @@ -494,7 +468,6 @@ CloseClipboardChannel(); CloseCrashCollectorChannel(); CloseImeChannel(); - CloseInputChannel(); CloseIntentHelperChannel(); CloseNetChannel(); CloseNotificationsChannel();
diff --git a/components/arc/arc_bridge_service.h b/components/arc/arc_bridge_service.h index a47682e3..8ad21bf9 100644 --- a/components/arc/arc_bridge_service.h +++ b/components/arc/arc_bridge_service.h
@@ -101,10 +101,6 @@ virtual void OnImeInstanceReady() {} virtual void OnImeInstanceClosed() {} - // Called whenever the ARC input interface state changes. - virtual void OnInputInstanceReady() {} - virtual void OnInputInstanceClosed() {} - // Called whenever the ARC intent helper interface state changes. virtual void OnIntentHelperInstanceReady() {} virtual void OnIntentHelperInstanceClosed() {} @@ -183,7 +179,6 @@ return crash_collector_ptr_.get(); } mojom::ImeInstance* ime_instance() { return ime_ptr_.get(); } - mojom::InputInstance* input_instance() { return input_ptr_.get(); } mojom::IntentHelperInstance* intent_helper_instance() { return intent_helper_ptr_.get(); } @@ -205,7 +200,6 @@ return crash_collector_ptr_.version(); } int32_t ime_version() const { return ime_ptr_.version(); } - int32_t input_version() const { return input_ptr_.version(); } int32_t intent_helper_version() const { return intent_helper_ptr_.version(); } int32_t net_version() const { return net_ptr_.version(); } int32_t notifications_version() const { return notifications_ptr_.version(); } @@ -225,7 +219,6 @@ void OnCrashCollectorInstanceReady( mojom::CrashCollectorInstancePtr crash_collector_ptr) override; void OnImeInstanceReady(mojom::ImeInstancePtr ime_ptr) override; - void OnInputInstanceReady(mojom::InputInstancePtr input_ptr) override; void OnIntentHelperInstanceReady( mojom::IntentHelperInstancePtr intent_helper_ptr) override; void OnNetInstanceReady(mojom::NetInstancePtr net_ptr) override; @@ -273,7 +266,6 @@ void CloseClipboardChannel(); void CloseCrashCollectorChannel(); void CloseImeChannel(); - void CloseInputChannel(); void CloseIntentHelperChannel(); void CloseNetChannel(); void CloseNotificationsChannel(); @@ -290,7 +282,6 @@ void OnClipboardVersionReady(int32_t version); void OnCrashCollectorVersionReady(int32_t version); void OnImeVersionReady(int32_t version); - void OnInputVersionReady(int32_t version); void OnIntentHelperVersionReady(int32_t version); void OnNetVersionReady(int32_t version); void OnNotificationsVersionReady(int32_t version); @@ -307,7 +298,6 @@ mojom::ClipboardInstancePtr clipboard_ptr_; mojom::CrashCollectorInstancePtr crash_collector_ptr_; mojom::ImeInstancePtr ime_ptr_; - mojom::InputInstancePtr input_ptr_; mojom::IntentHelperInstancePtr intent_helper_ptr_; mojom::NetInstancePtr net_ptr_; mojom::NotificationsInstancePtr notifications_ptr_; @@ -329,7 +319,6 @@ mojom::ClipboardInstancePtr temporary_clipboard_ptr_; mojom::CrashCollectorInstancePtr temporary_crash_collector_ptr_; mojom::ImeInstancePtr temporary_ime_ptr_; - mojom::InputInstancePtr temporary_input_ptr_; mojom::IntentHelperInstancePtr temporary_intent_helper_ptr_; mojom::NetInstancePtr temporary_net_ptr_; mojom::NotificationsInstancePtr temporary_notifications_ptr_;
diff --git a/components/arc/arc_service_manager.cc b/components/arc/arc_service_manager.cc index cb5c6ee..93cd645 100644 --- a/components/arc/arc_service_manager.cc +++ b/components/arc/arc_service_manager.cc
@@ -14,7 +14,6 @@ #include "components/arc/clipboard/arc_clipboard_bridge.h" #include "components/arc/crash_collector/arc_crash_collector_bridge.h" #include "components/arc/ime/arc_ime_service.h" -#include "components/arc/input/arc_input_bridge.h" #include "components/arc/intent_helper/arc_intent_helper_bridge.h" #include "components/arc/metrics/arc_metrics_service.h" #include "components/arc/net/arc_net_host_impl.h" @@ -51,7 +50,6 @@ AddService( make_scoped_ptr(new ArcCrashCollectorBridge(arc_bridge_service()))); AddService(make_scoped_ptr(new ArcImeService(arc_bridge_service()))); - AddService(make_scoped_ptr(new ArcInputBridge(arc_bridge_service()))); AddService(make_scoped_ptr(new ArcIntentHelperBridge(arc_bridge_service()))); AddService(make_scoped_ptr(new ArcMetricsService(arc_bridge_service()))); AddService(make_scoped_ptr(new ArcNetHostImpl(arc_bridge_service())));
diff --git a/components/arc/common/arc_bridge.mojom b/components/arc/common/arc_bridge.mojom index 027db5d..4d01e5f0 100644 --- a/components/arc/common/arc_bridge.mojom +++ b/components/arc/common/arc_bridge.mojom
@@ -11,7 +11,6 @@ import "clipboard.mojom"; import "crash_collector.mojom"; import "ime.mojom"; -import "input.mojom"; import "intent_helper.mojom"; import "net.mojom"; import "notifications.mojom"; @@ -47,9 +46,6 @@ // Notifies Chrome that the ImeInstance interface is ready. [MinVersion=3] OnImeInstanceReady@110(ImeInstance instance_ptr); - // Notifies Chrome that the InputInstance interface is ready. - OnInputInstanceReady@101(InputInstance instance_ptr); - // Notifies Chrome that the IntentHelperInstance interface is ready. [MinVersion=4] OnIntentHelperInstanceReady@111( IntentHelperInstance instance_ptr);
diff --git a/components/arc/input/DEPS b/components/arc/input/DEPS deleted file mode 100644 index 6c46762..0000000 --- a/components/arc/input/DEPS +++ /dev/null
@@ -1,4 +0,0 @@ -include_rules = [ - "+ui/aura", - "+ui/events", -]
diff --git a/components/arc/input/arc_input_bridge.cc b/components/arc/input/arc_input_bridge.cc deleted file mode 100644 index 5c28427..0000000 --- a/components/arc/input/arc_input_bridge.cc +++ /dev/null
@@ -1,375 +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 "components/arc/input/arc_input_bridge.h" - -#include <linux/input.h> -#include <fcntl.h> -#include <stddef.h> - -#include <string> - -#include "base/logging.h" -#include "base/posix/eintr_wrapper.h" -#include "base/thread_task_runner_handle.h" -#include "base/time/time.h" -#include "components/arc/arc_bridge_service.h" -#include "mojo/edk/embedder/embedder.h" -#include "ui/aura/env.h" -#include "ui/aura/env_observer.h" -#include "ui/aura/window.h" -#include "ui/aura/window_observer.h" -#include "ui/events/event.h" -#include "ui/events/event_handler.h" -#include "ui/events/event_utils.h" -#include "ui/events/keycodes/dom/keycode_converter.h" - -namespace { - -// ARC runs as 32-bit in all platforms, so we need to make sure to send a -// struct input_event that is the same size it expects. -struct timeval32 { - int32_t tv_sec; - int32_t tv_usec; -}; - -struct input_event32 { - struct timeval32 time; - uint16_t type; - uint16_t code; - int32_t value; -}; - -// input_event values for keyboard events. -const int kKeyReleased = 0; -const int kKeyPressed = 1; -const int kKeyRepeated = 2; - -// maximum number of supported multi-touch slots (simultaneous fingers). -const int kMaxSlots = 64; - -// tracking id of an empty slot. -const int kEmptySlot = -1; - -// maximum possible pressure as defined in EventHubARC. -// TODO(denniskempin): communicate maximum during initialization. -const int kMaxPressure = 65536; - -// speed of the scroll emulation. Scroll events are reported at about 100 times -// the speed of a scroll wheel. -const float kScrollEmulationSpeed = 100.0f; - -struct MouseButtonMapping { - int ui_flag; - int evdev_code; -} kMouseButtonMap[] = { - {ui::EF_LEFT_MOUSE_BUTTON, BTN_LEFT}, - {ui::EF_RIGHT_MOUSE_BUTTON, BTN_RIGHT}, - {ui::EF_MIDDLE_MOUSE_BUTTON, BTN_MIDDLE}, -}; - -// Offset between evdev key codes and chrome native key codes -const int kXkbKeycodeOffset = 8; - -} // namespace - -namespace arc { - -ArcInputBridge::ArcInputBridge(ArcBridgeService* bridge_service) - : ArcService(bridge_service), - offset_x_acc_(0.5f), - offset_y_acc_(0.5f), - current_slot_(-1), - current_slot_tracking_ids_(kMaxSlots, kEmptySlot), - origin_task_runner_(base::ThreadTaskRunnerHandle::Get()), - weak_factory_(this) { - arc_bridge_service()->AddObserver(this); - - aura::Env* env = aura::Env::GetInstanceDontCreate(); - if (env) - env->AddObserver(this); -} - -ArcInputBridge::~ArcInputBridge() { - DCHECK(origin_task_runner_->RunsTasksOnCurrentThread()); - arc_bridge_service()->RemoveObserver(this); - - aura::Env* env = aura::Env::GetInstanceDontCreate(); - if (env) - env->RemoveObserver(this); - - for (aura::Window* window : arc_windows_.windows()) { - window->RemovePreTargetHandler(this); - } -} - -void ArcInputBridge::OnInputInstanceReady() { - DCHECK(origin_task_runner_->RunsTasksOnCurrentThread()); - - keyboard_fd_ = CreateBridgeInputDevice("ChromeOS Keyboard", "keyboard"); - mouse_fd_ = CreateBridgeInputDevice("ChromeOS Mouse", "mouse"); - touchscreen_fd_ = - CreateBridgeInputDevice("ChromeOS Touchscreen", "touchscreen"); -} - -// Translates and sends a ui::Event to the appropriate bridge device of the -// ARC instance. If the devices have not yet been initialized, the event -// will be ignored. -void ArcInputBridge::OnEvent(ui::Event* event) { - DCHECK(origin_task_runner_->RunsTasksOnCurrentThread()); - if (event->IsKeyEvent()) { - SendKeyEvent(static_cast<ui::KeyEvent*>(event)); - } else if (event->IsMouseEvent() || event->IsScrollEvent()) { - SendMouseEvent(static_cast<ui::MouseEvent*>(event)); - } else if (event->IsTouchEvent()) { - SendTouchEvent(static_cast<ui::TouchEvent*>(event)); - } -} - -// Attaches the input bridge to the window if it is marked as an ARC window. -void ArcInputBridge::OnWindowInitialized(aura::Window* new_window) { - if (new_window->name() == "ExoSurface") { - arc_windows_.Add(new_window); - new_window->AddPreTargetHandler(this); - } -} - -void ArcInputBridge::SendKeyEvent(ui::KeyEvent* event) { - if (keyboard_fd_.get() < 0) { - VLOG(2) << "No keyboard bridge device available."; - return; - } - - uint16_t evdev_code = DomCodeToEvdevCode(event->code()); - int evdev_value = 0; - if (event->type() == ui::ET_KEY_PRESSED) { - if (event->flags() & ui::EF_IS_REPEAT) { - evdev_value = kKeyRepeated; - } else { - evdev_value = kKeyPressed; - } - } else if (event->type() == ui::ET_KEY_RELEASED) { - evdev_value = kKeyReleased; - } else { - NOTREACHED() << "Key should be either PRESSED or RELEASED."; - } - - base::TimeDelta time_stamp = event->time_stamp(); - SendKernelEvent(keyboard_fd_, time_stamp, EV_KEY, evdev_code, evdev_value); - SendSynReport(keyboard_fd_, time_stamp); -} - -void ArcInputBridge::SendTouchEvent(ui::TouchEvent* event) { - if (touchscreen_fd_.get() < 0) { - VLOG(2) << "No touchscreen bridge device available."; - return; - } - - ui::PointerDetails details = event->pointer_details(); - base::TimeDelta time_stamp = event->time_stamp(); - - // find or assing a slot for this tracking id - int slot_id = AcquireTouchSlot(event); - if (slot_id < 0) { - VLOG(1) << "Ran out of slot IDs."; - return; - } - - // we only need to send the slot ID when it has changed. - if (slot_id != current_slot_) { - current_slot_ = slot_id; - SendKernelEvent(touchscreen_fd_, time_stamp, EV_ABS, ABS_MT_SLOT, - current_slot_); - } - - // update tracking id - if (event->type() == ui::ET_TOUCH_PRESSED) { - SendKernelEvent(touchscreen_fd_, time_stamp, EV_ABS, ABS_MT_TRACKING_ID, - event->touch_id()); - } else if (event->type() == ui::ET_TOUCH_RELEASED) { - SendKernelEvent(touchscreen_fd_, time_stamp, EV_ABS, ABS_MT_TRACKING_ID, - kEmptySlot); - } - - // update touch information - if (event->type() == ui::ET_TOUCH_MOVED || - event->type() == ui::ET_TOUCH_PRESSED) { - SendKernelEvent(touchscreen_fd_, time_stamp, EV_ABS, ABS_MT_POSITION_X, - event->x()); - SendKernelEvent(touchscreen_fd_, time_stamp, EV_ABS, ABS_MT_POSITION_Y, - event->y()); - SendKernelEvent(touchscreen_fd_, time_stamp, EV_ABS, ABS_MT_TOUCH_MAJOR, - details.radius_x); - SendKernelEvent(touchscreen_fd_, time_stamp, EV_ABS, ABS_MT_TOUCH_MINOR, - details.radius_y); - SendKernelEvent(touchscreen_fd_, time_stamp, EV_ABS, ABS_MT_PRESSURE, - details.force * kMaxPressure); - } - SendSynReport(touchscreen_fd_, time_stamp); -} - -void ArcInputBridge::SendMouseEvent(ui::MouseEvent* event) { - if (mouse_fd_.get() < 0) { - VLOG(2) << "No mouse bridge device available."; - return; - } - - base::TimeDelta time_stamp = event->time_stamp(); - - // update location - if (event->type() == ui::ET_MOUSE_MOVED || - event->type() == ui::ET_MOUSE_DRAGGED) { - SendKernelEvent(mouse_fd_, time_stamp, EV_ABS, ABS_X, event->x()); - SendKernelEvent(mouse_fd_, time_stamp, EV_ABS, ABS_Y, event->y()); - } - - // update buttons - if (event->type() == ui::ET_MOUSE_PRESSED || - event->type() == ui::ET_MOUSE_RELEASED) { - int evdev_value = static_cast<int>(event->type() == ui::ET_MOUSE_PRESSED); - for (MouseButtonMapping mapping : kMouseButtonMap) { - if (event->changed_button_flags() & mapping.ui_flag) { - SendKernelEvent(mouse_fd_, time_stamp, EV_KEY, mapping.evdev_code, - evdev_value); - } - } - } - - // update scroll wheel - if (event->type() == ui::ET_SCROLL) { - ui::ScrollEvent* scroll_event = static_cast<ui::ScrollEvent*>(event); - // accumulate floating point scroll offset since we can only send full - // integer - // wheel events. - offset_x_acc_ += scroll_event->x_offset_ordinal() / kScrollEmulationSpeed; - offset_y_acc_ += scroll_event->y_offset_ordinal() / kScrollEmulationSpeed; - - int wheel = floor(offset_y_acc_); - if (wheel != 0) { - SendKernelEvent(mouse_fd_, time_stamp, EV_REL, REL_WHEEL, wheel); - offset_y_acc_ -= static_cast<float>(wheel); - } - - int hwheel = floor(offset_x_acc_); - if (hwheel != 0) { - SendKernelEvent(mouse_fd_, time_stamp, EV_REL, REL_HWHEEL, hwheel); - offset_x_acc_ -= static_cast<float>(hwheel); - } - } - - SendSynReport(mouse_fd_, time_stamp); -} - -void ArcInputBridge::SendKernelEvent(const base::ScopedFD& fd, - base::TimeDelta time_stamp, - uint16_t type, - uint16_t code, - int value) { - DCHECK(fd.is_valid()); - - struct input_event32 event; - event.time.tv_sec = time_stamp.InSeconds(); - base::TimeDelta remainder = - time_stamp - base::TimeDelta::FromSeconds(event.time.tv_sec); - event.time.tv_usec = remainder.InMicroseconds(); - event.type = type; - event.code = code; - event.value = value; - - // Write event to file descriptor - size_t num_written = write(fd.get(), reinterpret_cast<void*>(&event), - sizeof(struct input_event32)); - DCHECK_EQ(num_written, sizeof(struct input_event32)); -} - -void ArcInputBridge::SendSynReport(const base::ScopedFD& fd, - base::TimeDelta time) { - DCHECK(origin_task_runner_->RunsTasksOnCurrentThread()); - - SendKernelEvent(fd, time, EV_SYN, SYN_REPORT, 0); -} - -int ArcInputBridge::AcquireTouchSlot(ui::TouchEvent* event) { - int slot_id; - if (event->type() == ui::ET_TOUCH_PRESSED) { - slot_id = FindTouchSlot(kEmptySlot); - } else { - slot_id = FindTouchSlot(event->touch_id()); - } - if (slot_id < 0) { - return -1; - } - - if (event->type() == ui::ET_TOUCH_RELEASED) { - current_slot_tracking_ids_[slot_id] = kEmptySlot; - } else if (event->type() == ui::ET_TOUCH_PRESSED) { - current_slot_tracking_ids_[slot_id] = event->touch_id(); - } - return slot_id; -} - -int ArcInputBridge::FindTouchSlot(int tracking_id) { - for (int i = 0; i < kMaxSlots; ++i) { - if (current_slot_tracking_ids_[i] == tracking_id) { - return i; - } - } - return -1; -} - -uint16_t ArcInputBridge::DomCodeToEvdevCode(ui::DomCode dom_code) { - int native_code = ui::KeycodeConverter::DomCodeToNativeKeycode(dom_code); - if (native_code == ui::KeycodeConverter::InvalidNativeKeycode()) - return KEY_RESERVED; - - return native_code - kXkbKeycodeOffset; -} - -base::ScopedFD ArcInputBridge::CreateBridgeInputDevice( - const std::string& name, - const std::string& device_type) { - // Create file descriptor pair for communication - int fd[2]; - int res = HANDLE_EINTR(pipe(fd)); - if (res < 0) { - VPLOG(1) << "Cannot create pipe"; - return base::ScopedFD(); - } - base::ScopedFD read_fd(fd[0]); - base::ScopedFD write_fd(fd[1]); - - // The read end is sent to the instance, ownership of fd transfers. - mojom::InputInstance* input_instance = arc_bridge_service()->input_instance(); - if (!input_instance) { - VLOG(1) << "ArcBridgeService InputInstance disappeared."; - return base::ScopedFD(); - } - MojoHandle wrapped_handle; - MojoResult wrap_result = mojo::edk::CreatePlatformHandleWrapper( - mojo::edk::ScopedPlatformHandle( - mojo::edk::PlatformHandle(read_fd.release())), - &wrapped_handle); - if (wrap_result != MOJO_RESULT_OK) { - LOG(WARNING) << "Pipe failed to wrap handles. Closing: " << wrap_result; - return base::ScopedFD(); - } - input_instance->RegisterInputDevice( - name, device_type, mojo::ScopedHandle(mojo::Handle(wrapped_handle))); - - // setup write end as non blocking - int flags = HANDLE_EINTR(fcntl(write_fd.get(), F_GETFL, 0)); - if (res < 0) { - VPLOG(1) << "Cannot get file descriptor flags"; - return base::ScopedFD(); - } - - res = HANDLE_EINTR(fcntl(write_fd.get(), F_SETFL, flags | O_NONBLOCK)); - if (res < 0) { - VPLOG(1) << "Cannot set file descriptor flags"; - return base::ScopedFD(); - } - return write_fd; -} - -} // namespace arc
diff --git a/components/arc/input/arc_input_bridge.h b/components/arc/input/arc_input_bridge.h deleted file mode 100644 index be44676..0000000 --- a/components/arc/input/arc_input_bridge.h +++ /dev/null
@@ -1,141 +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 COMPONENTS_ARC_INPUT_ARC_INPUT_BRIDGE_H_ -#define COMPONENTS_ARC_INPUT_ARC_INPUT_BRIDGE_H_ - -#include <stdint.h> -#include <string> -#include <vector> - -#include "base/files/scoped_file.h" -#include "base/macros.h" -#include "components/arc/arc_bridge_service.h" -#include "components/arc/arc_service.h" -#include "ui/aura/env_observer.h" -#include "ui/aura/window_tracker.h" -#include "ui/events/event_handler.h" - -namespace aura { -class Window; -} - -namespace ui { -enum class DomCode; -class Event; -} - -namespace arc { - -class ArcBridgeService; - -// The ArcInputBridge is responsible for sending input events from ARC -// windows to the ARC instance. -// It hooks into aura::Env to watch for ExoSurface windows that are running ARC -// applications. On those windows the input bridge will attach an EventPreTarget -// to capture all input events. -// To send those events to the ARC instance it will create bridge input devices -// through the ArcBridgeService, which will provide a file descriptor to which -// we can send linux input_event's. -// ui::Events to the ARC windows are translated to linux input_event's, which -// are then sent through the respective file descriptor. -class ArcInputBridge : public ArcService, - public ArcBridgeService::Observer, - public aura::EnvObserver, - public ui::EventHandler { - public: - // The constructor will register an Observer with aura::Env and the - // ArcBridgeService. From then on, no further interaction with this class - // is needed. - explicit ArcInputBridge(ArcBridgeService* bridge_service); - ~ArcInputBridge() override; - - // Overridden from ui::EventHandler: - void OnEvent(ui::Event* event) override; - - // Overridden from aura::EnvObserver: - void OnWindowInitialized(aura::Window* new_window) override; - - // Overridden from ArcBridgeService::Observer: - void OnInputInstanceReady() override; - - private: - // Specialized method to translate and send events to the right file - // descriptor. - void SendKeyEvent(ui::KeyEvent* event); - void SendTouchEvent(ui::TouchEvent* event); - void SendMouseEvent(ui::MouseEvent* event); - - // Helper method to send a struct input_event to the file descriptor. This - // method is to be called on the ui thread and will post a request to send - // the event to the io thread. - // The parameters map directly to the members of input_event as - // defined by the evdev protocol. - // |type| is the type of event to sent, such as EV_SYN, EV_KEY, EV_ABS. - // |code| is either interpreted as axis (ABS_X, ABS_Y, ...) or as key-code - // (KEY_A, KEY_B, ...). - // |value| is either the value of that axis or the boolean value of the key - // as in 0 (released), 1 (pressed) or 2 (repeated press). - void SendKernelEvent(const base::ScopedFD& fd, - base::TimeDelta timestamp, - uint16_t type, - uint16_t code, - int value); - - // Shorthand for sending EV_SYN/SYN_REPORT - void SendSynReport(const base::ScopedFD& fd, base::TimeDelta timestamp); - - // Return existing or new slot for this event. - int AcquireTouchSlot(ui::TouchEvent* event); - - // Return touch slot for tracking id. - int FindTouchSlot(int tracking_id); - - // Maps DOM key codes to evdev key codes - uint16_t DomCodeToEvdevCode(ui::DomCode dom_code); - - // Setup bridge devices on the instance side. This needs to be called after - // the InstanceBootPhase::SYSTEM_SERVICES_READY has been reached. - void SetupBridgeDevices(); - - // Creates and registers file descriptor pair with the ARC bridge service, - // the write end is returned while the read end is sent through the bridge - // to the ARC instance. - // TODO(denniskempin): Make this interface more typesafe. - // |name| should be the displayable name of the emulated device (e.g. "Chrome - // OS Keyboard"), |device_type| the name of the device type (e.g. "keyboard") - // and |fd| a file descriptor that emulates the kernel events of the device. - // This can only be called on the thread that this class was created on. - base::ScopedFD CreateBridgeInputDevice(const std::string& name, - const std::string& device_type); - - // File descriptors for the different device types. - base::ScopedFD keyboard_fd_; - base::ScopedFD mouse_fd_; - base::ScopedFD touchscreen_fd_; - - // Scroll accumlator. - float offset_x_acc_; - float offset_y_acc_; - - // Currently selected slot for multi-touch events. - int current_slot_; - - // List of touch tracking id to slot assignments. - std::vector<int> current_slot_tracking_ids_; - - scoped_refptr<base::SequencedTaskRunner> origin_task_runner_; - - // List of windows we are hooked into - aura::WindowTracker arc_windows_; - - // WeakPtrFactory to use for callbacks. - base::WeakPtrFactory<ArcInputBridge> weak_factory_; - - DISALLOW_COPY_AND_ASSIGN(ArcInputBridge); -}; - -} // namespace arc - -#endif // COMPONENTS_ARC_INPUT_ARC_INPUT_BRIDGE_H_
diff --git a/components/audio_modem/BUILD.gn b/components/audio_modem/BUILD.gn index d14a7b3..83cd882 100644 --- a/components/audio_modem/BUILD.gn +++ b/components/audio_modem/BUILD.gn
@@ -63,6 +63,7 @@ deps = [ ":test_support", "//base", + "//base/test:test_support", "//content/test:test_support", "//media", "//media:shared_memory_support",
diff --git a/components/audio_modem/audio_player_impl.cc b/components/audio_modem/audio_player_impl.cc index cd52f05..2a02f5a 100644 --- a/components/audio_modem/audio_player_impl.cc +++ b/components/audio_modem/audio_player_impl.cc
@@ -8,11 +8,9 @@ #include <string> #include "base/bind.h" -#include "base/bind_helpers.h" +#include "base/location.h" #include "base/logging.h" -#include "base/run_loop.h" #include "components/audio_modem/public/audio_modem_types.h" -#include "content/public/browser/browser_thread.h" #include "media/audio/audio_manager.h" #include "media/audio/audio_parameters.h" #include "media/base/audio_bus.h" @@ -162,19 +160,4 @@ base::Unretained(this))); } -void AudioPlayerImpl::FlushAudioLoopForTesting() { - if (media::AudioManager::Get()->GetTaskRunner()->BelongsToCurrentThread()) - return; - - // Queue task on the audio thread, when it is executed, that means we've - // successfully executed all the tasks before us. - base::RunLoop rl; - media::AudioManager::Get()->GetTaskRunner()->PostTaskAndReply( - FROM_HERE, - base::Bind(base::IgnoreResult(&AudioPlayerImpl::FlushAudioLoopForTesting), - base::Unretained(this)), - rl.QuitClosure()); - rl.Run(); -} - } // namespace audio_modem
diff --git a/components/audio_modem/audio_player_impl.h b/components/audio_modem/audio_player_impl.h index 7ea518b..50f10bf 100644 --- a/components/audio_modem/audio_player_impl.h +++ b/components/audio_modem/audio_player_impl.h
@@ -65,10 +65,6 @@ uint32_t frames_skipped) override; void OnError(media::AudioOutputStream* stream) override; - // Flushes the audio loop, making sure that any queued operations are - // performed. - void FlushAudioLoopForTesting(); - bool is_playing_; // Self-deleting object.
diff --git a/components/audio_modem/audio_player_unittest.cc b/components/audio_modem/audio_player_unittest.cc index 153e6c0..2a96c0f9 100644 --- a/components/audio_modem/audio_player_unittest.cc +++ b/components/audio_modem/audio_player_unittest.cc
@@ -8,11 +8,12 @@ #include "base/location.h" #include "base/macros.h" #include "base/memory/weak_ptr.h" -#include "base/single_thread_task_runner.h" +#include "base/run_loop.h" +#include "base/test/test_message_loop.h" +#include "base/thread_task_runner_handle.h" #include "components/audio_modem/audio_player_impl.h" #include "components/audio_modem/public/audio_modem_types.h" #include "components/audio_modem/test/random_samples.h" -#include "media/audio/audio_manager.h" #include "media/audio/audio_manager_base.h" #include "media/base/audio_bus.h" #include "testing/gtest/include/gtest/gtest.h" @@ -77,8 +78,9 @@ public base::SupportsWeakPtr<AudioPlayerTest> { public: AudioPlayerTest() : buffer_index_(0), player_(nullptr) { - if (!media::AudioManager::Get()) - media::AudioManager::CreateForTesting(); + audio_manager_ = media::AudioManager::CreateForTesting( + base::ThreadTaskRunnerHandle::Get()); + base::RunLoop().RunUntilIdle(); } ~AudioPlayerTest() override { DeletePlayer(); } @@ -91,6 +93,7 @@ kMaxFrameCount, base::Bind(&AudioPlayerTest::GatherSamples, AsWeakPtr()))); player_->Initialize(); + base::RunLoop().RunUntilIdle(); } void DeletePlayer() { @@ -98,6 +101,7 @@ return; player_->Finalize(); player_ = nullptr; + base::RunLoop().RunUntilIdle(); } void PlayAndVerifySamples( @@ -107,8 +111,8 @@ buffer_ = media::AudioBus::Create(1, kMaxFrameCount); buffer_index_ = 0; player_->Play(samples); - player_->FlushAudioLoopForTesting(); player_->Stop(); + base::RunLoop().RunUntilIdle(); int differences = 0; for (int i = 0; i < kMaxFrameCount; ++i) { @@ -129,19 +133,20 @@ protected: bool IsPlaying() { - player_->FlushAudioLoopForTesting(); + base::RunLoop().RunUntilIdle(); return player_->is_playing_; } static const int kDefaultFrameCount = 1024; static const int kMaxFrameCount = 1024 * 100; + base::TestMessageLoop message_loop_; + media::ScopedAudioManagerPtr audio_manager_; scoped_ptr<media::AudioBus> buffer_; int buffer_index_; // Deleted by calling Finalize() on the object. AudioPlayerImpl* player_; - base::MessageLoop message_loop_; }; TEST_F(AudioPlayerTest, BasicPlayAndStop) { @@ -151,16 +156,19 @@ player_->Play(samples); EXPECT_TRUE(IsPlaying()); + player_->Stop(); EXPECT_FALSE(IsPlaying()); - player_->Play(samples); + player_->Play(samples); EXPECT_TRUE(IsPlaying()); + player_->Stop(); EXPECT_FALSE(IsPlaying()); - player_->Play(samples); + player_->Play(samples); EXPECT_TRUE(IsPlaying()); + player_->Stop(); EXPECT_FALSE(IsPlaying());
diff --git a/components/audio_modem/audio_recorder_impl.cc b/components/audio_modem/audio_recorder_impl.cc index 8d1b2c5..06bc728 100644 --- a/components/audio_modem/audio_recorder_impl.cc +++ b/components/audio_modem/audio_recorder_impl.cc
@@ -198,20 +198,4 @@ base::Unretained(this))); } -void AudioRecorderImpl::FlushAudioLoopForTesting() { - if (media::AudioManager::Get()->GetTaskRunner()->BelongsToCurrentThread()) - return; - - // Queue task on the audio thread, when it is executed, that means we've - // successfully executed all the tasks before us. - base::RunLoop rl; - media::AudioManager::Get()->GetTaskRunner()->PostTaskAndReply( - FROM_HERE, - base::Bind( - base::IgnoreResult(&AudioRecorderImpl::FlushAudioLoopForTesting), - base::Unretained(this)), - rl.QuitClosure()); - rl.Run(); -} - } // namespace audio_modem
diff --git a/components/audio_modem/audio_recorder_impl.h b/components/audio_modem/audio_recorder_impl.h index cce75fb..b0f5486c 100644 --- a/components/audio_modem/audio_recorder_impl.h +++ b/components/audio_modem/audio_recorder_impl.h
@@ -79,10 +79,6 @@ double volume) override; void OnError(media::AudioInputStream* stream) override; - // Flushes the audio loop, making sure that any queued operations are - // performed. - void FlushAudioLoopForTesting(); - bool is_recording_; media::AudioInputStream* stream_;
diff --git a/components/audio_modem/audio_recorder_unittest.cc b/components/audio_modem/audio_recorder_unittest.cc index e960cd389..08b9a52 100644 --- a/components/audio_modem/audio_recorder_unittest.cc +++ b/components/audio_modem/audio_recorder_unittest.cc
@@ -12,6 +12,7 @@ #include "base/macros.h" #include "base/memory/aligned_memory.h" #include "base/run_loop.h" +#include "base/thread_task_runner_handle.h" #include "build/build_config.h" #include "components/audio_modem/audio_recorder_impl.h" #include "components/audio_modem/public/audio_modem_types.h" @@ -82,8 +83,9 @@ class AudioRecorderTest : public testing::Test { public: AudioRecorderTest() : total_samples_(0), recorder_(nullptr) { - if (!media::AudioManager::Get()) - media::AudioManager::CreateForTesting(); + audio_manager_ = media::AudioManager::CreateForTesting( + base::ThreadTaskRunnerHandle::Get()); + base::RunLoop().RunUntilIdle(); } ~AudioRecorderTest() override { @@ -101,6 +103,7 @@ recorder_ = new AudioRecorderImpl(); recorder_->Initialize(base::Bind(&AudioRecorderTest::DecodeSamples, base::Unretained(this))); + base::RunLoop().RunUntilIdle(); } else { CreateRecorder(kSomeNumber); } @@ -124,6 +127,7 @@ recorder_->set_params_for_testing(new media::AudioParameters(params_)); recorder_->Initialize( base::Bind(&AudioRecorderTest::DecodeSamples, base::Unretained(this))); + base::RunLoop().RunUntilIdle(); } void DeleteRecorder() { @@ -131,6 +135,7 @@ return; recorder_->Finalize(); recorder_ = nullptr; + base::RunLoop().RunUntilIdle(); } void RecordAndVerifySamples() { @@ -183,10 +188,13 @@ return samples; } bool IsRecording() { - recorder_->FlushAudioLoopForTesting(); + base::RunLoop().RunUntilIdle(); return recorder_->is_recording_; } + content::TestBrowserThreadBundle thread_bundle_; + media::ScopedAudioManagerPtr audio_manager_; + std::vector<float*> channel_data_; media::AudioParameters params_; size_t total_samples_; @@ -197,7 +205,6 @@ std::string received_samples_; scoped_ptr<base::RunLoop> run_loop_; - content::TestBrowserThreadBundle thread_bundle_; }; @@ -213,16 +220,19 @@ recorder_->Record(); EXPECT_TRUE(IsRecording()); + recorder_->Stop(); EXPECT_FALSE(IsRecording()); - recorder_->Record(); + recorder_->Record(); EXPECT_TRUE(IsRecording()); + recorder_->Stop(); EXPECT_FALSE(IsRecording()); - recorder_->Record(); + recorder_->Record(); EXPECT_TRUE(IsRecording()); + recorder_->Stop(); EXPECT_FALSE(IsRecording());
diff --git a/components/autofill/core/browser/BUILD.gn b/components/autofill/core/browser/BUILD.gn index f0e080e1..42904aff 100644 --- a/components/autofill/core/browser/BUILD.gn +++ b/components/autofill/core/browser/BUILD.gn
@@ -254,6 +254,29 @@ ] } +bundle_data("unit_tests_bundle_data") { + sources = [ + "//components/test/data/autofill/merge/input/ambiguous.in", + "//components/test/data/autofill/merge/input/case.in", + "//components/test/data/autofill/merge/input/email.in", + "//components/test/data/autofill/merge/input/identical.in", + "//components/test/data/autofill/merge/input/primarycase.in", + "//components/test/data/autofill/merge/input/singlemerge.in", + "//components/test/data/autofill/merge/input/validation.in", + "//components/test/data/autofill/merge/output/ambiguous.out", + "//components/test/data/autofill/merge/output/case.out", + "//components/test/data/autofill/merge/output/email.out", + "//components/test/data/autofill/merge/output/identical.out", + "//components/test/data/autofill/merge/output/primarycase.out", + "//components/test/data/autofill/merge/output/singlemerge.out", + "//components/test/data/autofill/merge/output/validation.out", + ] + outputs = [ + "{{bundle_resources_dir}}/" + + "{{source_root_relative_dir}}/{{source_file_part}}", + ] +} + source_set("unit_tests") { testonly = true sources = [ @@ -299,6 +322,7 @@ deps = [ ":browser", ":test_support", + ":unit_tests_bundle_data", "//base", "//base/test:test_support", "//components/autofill/core/common",
diff --git a/components/autofill/core/browser/autofill_client.h b/components/autofill/core/browser/autofill_client.h index 4b8c8a5..4a16967 100644 --- a/components/autofill/core/browser/autofill_client.h +++ b/components/autofill/core/browser/autofill_client.h
@@ -87,6 +87,14 @@ NETWORK_ERROR, }; + enum UnmaskCardReason { + // The card is being unmasked for PaymentRequest. + UNMASK_FOR_PAYMENT_REQUEST, + + // The card is being unmasked for Autofill. + UNMASK_FOR_AUTOFILL, + }; + typedef base::Callback<void(RequestAutocompleteResult, const base::string16&, const FormStructure*)> ResultCallback; @@ -124,6 +132,7 @@ // A user has attempted to use a masked card. Prompt them for further // information to proceed. virtual void ShowUnmaskPrompt(const CreditCard& card, + UnmaskCardReason reason, base::WeakPtr<CardUnmaskDelegate> delegate) = 0; virtual void OnUnmaskVerificationResult(PaymentsRpcResult result) = 0;
diff --git a/components/autofill/core/browser/autofill_data_util.cc b/components/autofill/core/browser/autofill_data_util.cc index 63dc4821..7387ed73 100644 --- a/components/autofill/core/browser/autofill_data_util.cc +++ b/components/autofill/core/browser/autofill_data_util.cc
@@ -9,6 +9,7 @@ #include "base/strings/string_split.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" +#include "components/autofill/core/browser/field_types.h" namespace autofill { namespace data_util { @@ -128,5 +129,44 @@ return parts; } +bool ProfileMatchesFullName(const base::string16 full_name, + const autofill::AutofillProfile& profile) { + const base::string16 kSpace = base::ASCIIToUTF16(" "); + const base::string16 kPeriodSpace = base::ASCIIToUTF16(". "); + + // First Last + base::string16 candidate = profile.GetRawInfo(autofill::NAME_FIRST) + kSpace + + profile.GetRawInfo(autofill::NAME_LAST); + if (!full_name.compare(candidate)) { + return true; + } + + // First Middle Last + candidate = profile.GetRawInfo(autofill::NAME_FIRST) + kSpace + + profile.GetRawInfo(autofill::NAME_MIDDLE) + kSpace + + profile.GetRawInfo(autofill::NAME_LAST); + if (!full_name.compare(candidate)) { + return true; + } + + // First M Last + candidate = profile.GetRawInfo(autofill::NAME_FIRST) + kSpace + + profile.GetRawInfo(autofill::NAME_MIDDLE_INITIAL) + kSpace + + profile.GetRawInfo(autofill::NAME_LAST); + if (!full_name.compare(candidate)) { + return true; + } + + // First M. Last + candidate = profile.GetRawInfo(autofill::NAME_FIRST) + kSpace + + profile.GetRawInfo(autofill::NAME_MIDDLE_INITIAL) + kPeriodSpace + + profile.GetRawInfo(autofill::NAME_LAST); + if (!full_name.compare(candidate)) { + return true; + } + + return false; +} + } // namespace data_util } // namespace autofill
diff --git a/components/autofill/core/browser/autofill_data_util.h b/components/autofill/core/browser/autofill_data_util.h index 1cba1b3e..1c1e135 100644 --- a/components/autofill/core/browser/autofill_data_util.h +++ b/components/autofill/core/browser/autofill_data_util.h
@@ -6,6 +6,7 @@ #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_DATA_UTIL_H_ #include "base/strings/string16.h" +#include "components/autofill/core/browser/autofill_profile.h" namespace autofill { namespace data_util { @@ -22,6 +23,11 @@ // |name| passed as a parameter. NameParts SplitName(const base::string16& name); +// Returns true iff |full_name| is a concatenation of some combination of the +// first/middle/last (incl. middle initial) in |profile|. +bool ProfileMatchesFullName(const base::string16 full_name, + const autofill::AutofillProfile& profile); + } // namespace data_util } // namespace autofill
diff --git a/components/autofill/core/browser/autofill_data_util_unittest.cc b/components/autofill/core/browser/autofill_data_util_unittest.cc index ebed1f7..707ac49 100644 --- a/components/autofill/core/browser/autofill_data_util_unittest.cc +++ b/components/autofill/core/browser/autofill_data_util_unittest.cc
@@ -5,6 +5,7 @@ #include "components/autofill/core/browser/autofill_data_util.h" #include "base/strings/utf_string_conversions.h" +#include "components/autofill/core/browser/autofill_test_utils.h" #include "testing/gtest/include/gtest/gtest.h" namespace autofill { @@ -42,5 +43,26 @@ } } +TEST(AutofillDataUtilTest, ProfileMatchesFullName) { + autofill::AutofillProfile profile; + autofill::test::SetProfileInfo( + &profile, "First", "Middle", "Last", "fml@example.com", "Acme inc", + "123 Main", "Apt 2", "Laredo", "TX", "77300", "US", "832-555-1000"); + + EXPECT_TRUE(ProfileMatchesFullName(base::UTF8ToUTF16("First Last"), profile)); + + EXPECT_TRUE( + ProfileMatchesFullName(base::UTF8ToUTF16("First Middle Last"), profile)); + + EXPECT_TRUE( + ProfileMatchesFullName(base::UTF8ToUTF16("First M Last"), profile)); + + EXPECT_TRUE( + ProfileMatchesFullName(base::UTF8ToUTF16("First M. Last"), profile)); + + EXPECT_FALSE( + ProfileMatchesFullName(base::UTF8ToUTF16("Kirby Puckett"), profile)); +} + } // namespace data_util } // namespace autofill
diff --git a/components/autofill/core/browser/autofill_manager.cc b/components/autofill/core/browser/autofill_manager.cc index ea4c155b..e8e7664 100644 --- a/components/autofill/core/browser/autofill_manager.cc +++ b/components/autofill/core/browser/autofill_manager.cc
@@ -613,6 +613,7 @@ unmasking_field_ = field; payments_client_->Prepare(); client_->ShowUnmaskPrompt(unmask_request_.card, + AutofillClient::UNMASK_FOR_AUTOFILL, weak_ptr_factory_.GetWeakPtr()); client_->LoadRiskData(base::Bind(&AutofillManager::OnDidGetUnmaskRiskData, weak_ptr_factory_.GetWeakPtr()));
diff --git a/components/autofill/core/browser/test_autofill_client.cc b/components/autofill/core/browser/test_autofill_client.cc index 2b6deb0b..3cebffa 100644 --- a/components/autofill/core/browser/test_autofill_client.cc +++ b/components/autofill/core/browser/test_autofill_client.cc
@@ -50,6 +50,7 @@ void TestAutofillClient::ShowUnmaskPrompt( const CreditCard& card, + UnmaskCardReason reason, base::WeakPtr<CardUnmaskDelegate> delegate) { }
diff --git a/components/autofill/core/browser/test_autofill_client.h b/components/autofill/core/browser/test_autofill_client.h index f9ebbaaa..a4a5cae0 100644 --- a/components/autofill/core/browser/test_autofill_client.h +++ b/components/autofill/core/browser/test_autofill_client.h
@@ -35,6 +35,7 @@ void HideRequestAutocompleteDialog() override; void ShowAutofillSettings() override; void ShowUnmaskPrompt(const CreditCard& card, + UnmaskCardReason reason, base::WeakPtr<CardUnmaskDelegate> delegate) override; void OnUnmaskVerificationResult(PaymentsRpcResult result) override; void ConfirmSaveCreditCardLocally(const CreditCard& card,
diff --git a/components/autofill/core/browser/ui/card_unmask_prompt_controller.h b/components/autofill/core/browser/ui/card_unmask_prompt_controller.h index 0a9b1b5..98a4fa59 100644 --- a/components/autofill/core/browser/ui/card_unmask_prompt_controller.h +++ b/components/autofill/core/browser/ui/card_unmask_prompt_controller.h
@@ -26,6 +26,7 @@ // State. virtual base::string16 GetWindowTitle() const = 0; virtual base::string16 GetInstructionsMessage() const = 0; + virtual base::string16 GetOkButtonLabel() const = 0; virtual int GetCvcImageRid() const = 0; virtual bool ShouldRequestExpirationDate() const = 0; virtual bool CanStoreLocally() const = 0;
diff --git a/components/autofill/core/browser/ui/card_unmask_prompt_controller_impl.cc b/components/autofill/core/browser/ui/card_unmask_prompt_controller_impl.cc index 9b5bfeb..cb86a0d9 100644 --- a/components/autofill/core/browser/ui/card_unmask_prompt_controller_impl.cc +++ b/components/autofill/core/browser/ui/card_unmask_prompt_controller_impl.cc
@@ -42,6 +42,7 @@ void CardUnmaskPromptControllerImpl::ShowPrompt( CardUnmaskPromptView* card_unmask_view, const CreditCard& card, + AutofillClient::UnmaskCardReason reason, base::WeakPtr<CardUnmaskDelegate> delegate) { if (card_unmask_view_) card_unmask_view_->ControllerGone(); @@ -51,6 +52,7 @@ pending_response_ = CardUnmaskDelegate::UnmaskResponse(); card_unmask_view_ = card_unmask_view; card_ = card; + reason_ = reason; delegate_ = delegate; card_unmask_view_->Show(); unmasking_result_ = AutofillClient::NONE; @@ -218,14 +220,25 @@ // unnecessary. return card_.TypeAndLastFourDigits(); #else - int ids = ShouldRequestExpirationDate() - ? IDS_AUTOFILL_CARD_UNMASK_PROMPT_UPDATE_TITLE - : IDS_AUTOFILL_CARD_UNMASK_PROMPT_TITLE; + int ids; + if (reason_ == AutofillClient::UNMASK_FOR_PAYMENT_REQUEST) + ids = IDS_AUTOFILL_CARD_UNMASK_PROMPT_PAY_TITLE; + else if (ShouldRequestExpirationDate()) + ids = IDS_AUTOFILL_CARD_UNMASK_PROMPT_UPDATE_TITLE; + else + ids = IDS_AUTOFILL_CARD_UNMASK_PROMPT_TITLE; return l10n_util::GetStringFUTF16(ids, card_.TypeAndLastFourDigits()); #endif } base::string16 CardUnmaskPromptControllerImpl::GetInstructionsMessage() const { + if (reason_ == AutofillClient::UNMASK_FOR_PAYMENT_REQUEST) { + return l10n_util::GetStringUTF16( + card_.type() == kAmericanExpressCard + ? IDS_AUTOFILL_CARD_UNMASK_PROMPT_PAY_INSTRUCTIONS_AMEX + : IDS_AUTOFILL_CARD_UNMASK_PROMPT_PAY_INSTRUCTIONS); + } + if (ShouldRequestExpirationDate()) { return l10n_util::GetStringUTF16( card_.type() == kAmericanExpressCard @@ -239,6 +252,13 @@ : IDS_AUTOFILL_CARD_UNMASK_PROMPT_INSTRUCTIONS); } +base::string16 CardUnmaskPromptControllerImpl::GetOkButtonLabel() const { + return l10n_util::GetStringUTF16( + reason_ == AutofillClient::UNMASK_FOR_PAYMENT_REQUEST + ? IDS_AUTOFILL_CARD_UNMASK_CONTINUE_BUTTON + : IDS_AUTOFILL_CARD_UNMASK_CONFIRM_BUTTON); +} + int CardUnmaskPromptControllerImpl::GetCvcImageRid() const { return card_.type() == kAmericanExpressCard ? IDR_CREDIT_CARD_CVC_HINT_AMEX : IDR_CREDIT_CARD_CVC_HINT; @@ -253,6 +273,8 @@ // Never offer to save for incognito. if (is_off_the_record_) return false; + if (reason_ == AutofillClient::UNMASK_FOR_PAYMENT_REQUEST) + return false; return OfferStoreUnmaskedCards(); }
diff --git a/components/autofill/core/browser/ui/card_unmask_prompt_controller_impl.h b/components/autofill/core/browser/ui/card_unmask_prompt_controller_impl.h index ef311e9..e6b6af6 100644 --- a/components/autofill/core/browser/ui/card_unmask_prompt_controller_impl.h +++ b/components/autofill/core/browser/ui/card_unmask_prompt_controller_impl.h
@@ -30,6 +30,7 @@ // Functions called by ChromeAutofillClient. void ShowPrompt(CardUnmaskPromptView* view, const CreditCard& card, + AutofillClient::UnmaskCardReason reason, base::WeakPtr<CardUnmaskDelegate> delegate); // The CVC the user entered went through validation. void OnVerificationResult(AutofillClient::PaymentsRpcResult result); @@ -43,6 +44,7 @@ void NewCardLinkClicked() override; base::string16 GetWindowTitle() const override; base::string16 GetInstructionsMessage() const override; + base::string16 GetOkButtonLabel() const override; int GetCvcImageRid() const override; bool ShouldRequestExpirationDate() const override; bool CanStoreLocally() const override; @@ -65,6 +67,7 @@ bool new_card_link_clicked_; bool is_off_the_record_; CreditCard card_; + AutofillClient::UnmaskCardReason reason_; base::WeakPtr<CardUnmaskDelegate> delegate_; CardUnmaskPromptView* card_unmask_view_;
diff --git a/components/autofill/core/browser/ui/card_unmask_prompt_controller_impl_unittest.cc b/components/autofill/core/browser/ui/card_unmask_prompt_controller_impl_unittest.cc index e7597e5..be69a99 100644 --- a/components/autofill/core/browser/ui/card_unmask_prompt_controller_impl_unittest.cc +++ b/components/autofill/core/browser/ui/card_unmask_prompt_controller_impl_unittest.cc
@@ -99,12 +99,14 @@ void ShowPrompt() { controller_->ShowPrompt(test_unmask_prompt_view_.get(), test::GetMaskedServerCard(), + AutofillClient::UNMASK_FOR_AUTOFILL, delegate_->GetWeakPtr()); } void ShowPromptAmex() { controller_->ShowPrompt(test_unmask_prompt_view_.get(), test::GetMaskedServerCardAmex(), + AutofillClient::UNMASK_FOR_AUTOFILL, delegate_->GetWeakPtr()); }
diff --git a/components/autofill_strings.grdp b/components/autofill_strings.grdp index faabd2e..24782d88 100644 --- a/components/autofill_strings.grdp +++ b/components/autofill_strings.grdp
@@ -225,12 +225,21 @@ <message name="IDS_AUTOFILL_CARD_UNMASK_PROMPT_UPDATE_TITLE" desc="Title for the credit card unmasking dialog when the credit card is expired."> Update and verify your <ph name="CREDIT_CARD">$1<ex>Visa - 5679</ex></ph> </message> + <message name="IDS_AUTOFILL_CARD_UNMASK_PROMPT_PAY_TITLE" desc="Title for the dialog for unmasking a credit card and using this card to pay."> + Pay with <ph name="CREDIT_CARD">$1<ex>Visa - 5679</ex></ph> + </message> <message name="IDS_AUTOFILL_CARD_UNMASK_PROMPT_INSTRUCTIONS" desc="Text explaining what the user should do in the card unmasking dialog."> Enter the 3-digit CVC from the back of your card </message> <message name="IDS_AUTOFILL_CARD_UNMASK_PROMPT_INSTRUCTIONS_AMEX" desc="Text explaining what the user should do in the card unmasking dialog for amex cards."> Enter the 4-digit CVC from the front of your card </message> + <message name="IDS_AUTOFILL_CARD_UNMASK_PROMPT_PAY_INSTRUCTIONS" desc="Text explaining what the user should do in the dialog for unmasking a credit card and paying with this card."> + Enter the 3-digit CVC from the back of your card for verification + </message> + <message name="IDS_AUTOFILL_CARD_UNMASK_PROMPT_PAY_INSTRUCTIONS_AMEX" desc="Text explaining what the user should do in the dialog for unmasking an amex card and paying with this card."> + Enter the 4-digit CVC from the front of your card for verification + </message> <message name="IDS_AUTOFILL_CARD_UNMASK_PROMPT_INSTRUCTIONS_EXPIRED" desc="Text explaining what the user should do in the card unmasking dialog to update an expired card."> Enter the expiration date and 3-digit CVC from the back of your card </message> @@ -264,9 +273,12 @@ </message> </if> </if> - <message name="IDS_AUTOFILL_CARD_UNMASK_CONFIRM_BUTTON" desc="Text for button that confirms the credit card CVC entry dialog." formatter_data="android_java"> + <message name="IDS_AUTOFILL_CARD_UNMASK_CONFIRM_BUTTON" desc="Text for button that confirms the credit card CVC entry dialog."> Verify </message> + <message name="IDS_AUTOFILL_CARD_UNMASK_CONTINUE_BUTTON" desc="Text for button that confirms the credit card CVC entry dialog and initiates payment."> + Continue + </message> <message name="IDS_AUTOFILL_CARD_UNMASK_VERIFICATION_IN_PROGRESS" desc="Message displayed while credit card is being verified." formatter_data="android_java"> Verifying card </message>
diff --git a/components/bookmarks/browser/BUILD.gn b/components/bookmarks/browser/BUILD.gn index 66ffe44..39d3cdb 100644 --- a/components/bookmarks/browser/BUILD.gn +++ b/components/bookmarks/browser/BUILD.gn
@@ -68,6 +68,19 @@ } } +bundle_data("unit_tests_bundle_data") { + visibility = [ ":unit_tests" ] + testonly = true + sources = [ + "//components/test/data/bookmarks/meta_info_as_string.json", + "//components/test/data/bookmarks/model_without_sync.json", + ] + outputs = [ + "{{bundle_resources_dir}}/" + + "{{source_root_relative_dir}}/{{source_file_part}}", + ] +} + source_set("unit_tests") { testonly = true sources = [ @@ -86,6 +99,7 @@ deps = [ ":browser", + ":unit_tests_bundle_data", "//components/bookmarks/common", "//components/bookmarks/test", "//components/favicon_base",
diff --git a/components/components.gyp b/components/components.gyp index fd1bf30..48ae7646 100644 --- a/components/components.gyp +++ b/components/components.gyp
@@ -23,7 +23,6 @@ 'cloud_devices.gypi', 'component_updater.gypi', 'content_settings.gypi', - 'contextual_search.gypi', 'cookie_config.gypi', 'crash.gypi', 'cronet.gypi', @@ -114,6 +113,7 @@ 'browsing_data.gypi', 'cdm.gypi', 'certificate_transparency.gypi', + 'contextual_search.gypi', 'devtools_discovery.gypi', 'devtools_http_handler.gypi', 'domain_reliability.gypi',
diff --git a/components/components_tests.gyp b/components/components_tests.gyp index dff613f..244ff1c 100644 --- a/components/components_tests.gyp +++ b/components/components_tests.gyp
@@ -639,6 +639,7 @@ 'safe_browsing_db/safe_browsing_api_handler_unittest.cc', ], 'safe_browsing_db_unittest_sources': [ + 'safe_browsing_db/database_manager_unittest.cc', 'safe_browsing_db/prefix_set_unittest.cc', 'safe_browsing_db/testing_util.h', 'safe_browsing_db/util_unittest.cc', @@ -1271,6 +1272,7 @@ 'components.gyp:sessions_content', 'components.gyp:storage_monitor', 'components.gyp:storage_monitor_test_support', + 'components.gyp:test_database_manager', 'components.gyp:ui_zoom', 'components.gyp:url_matcher', 'components.gyp:visitedlink_browser',
diff --git a/components/contextual_search.gypi b/components/contextual_search.gypi index 32a1e00..3cbd154 100644 --- a/components/contextual_search.gypi +++ b/components/contextual_search.gypi
@@ -31,6 +31,7 @@ 'dependencies': [ 'contextual_search_mojo_bindings', '../base/base.gyp:base', + '../content/content.gyp:content_common', ], 'sources': [ 'contextual_search/renderer/contextual_search_wrapper.cc',
diff --git a/components/data_reduction_proxy/core/browser/BUILD.gn b/components/data_reduction_proxy/core/browser/BUILD.gn index 3e9ea6b8..6b96e08 100644 --- a/components/data_reduction_proxy/core/browser/BUILD.gn +++ b/components/data_reduction_proxy/core/browser/BUILD.gn
@@ -122,6 +122,25 @@ ] } +bundle_data("unit_tests_bundle_data") { + visibility = [ ":unit_tests" ] + testonly = true + sources = [ + "//components/test/data/data_reduction_proxy/direct/block10.html", + "//components/test/data/data_reduction_proxy/direct/block10.html.mock-http-headers", + "//components/test/data/data_reduction_proxy/direct/noblock.html", + "//components/test/data/data_reduction_proxy/direct/noblock.html.mock-http-headers", + "//components/test/data/data_reduction_proxy/proxy/block10.html", + "//components/test/data/data_reduction_proxy/proxy/block10.html.mock-http-headers", + "//components/test/data/data_reduction_proxy/proxy/noblock.html", + "//components/test/data/data_reduction_proxy/proxy/noblock.html.mock-http-headers", + ] + outputs = [ + "{{bundle_resources_dir}}/" + + "{{source_root_relative_dir}}/{{source_file_part}}", + ] +} + source_set("unit_tests") { testonly = true sources = [ @@ -149,6 +168,7 @@ deps = [ ":browser", ":test_support", + ":unit_tests_bundle_data", "//base", "//base/test:test_support", "//components/data_reduction_proxy/core/common:test_support",
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.cc index ee6589a2..2c655ca 100644 --- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.cc +++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.cc
@@ -6,15 +6,19 @@ #include <stddef.h> #include <utility> -#include <vector> #include "base/bind.h" #include "base/bind_helpers.h" #include "base/macros.h" #include "base/metrics/field_trial.h" +#include "base/metrics/histogram.h" +#include "base/metrics/histogram_base.h" #include "base/metrics/histogram_macros.h" #include "base/metrics/sparse_histogram.h" +#include "base/single_thread_task_runner.h" +#include "base/stl_util.h" #include "base/strings/string_number_conversions.h" +#include "base/time/default_tick_clock.h" #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_configurator.h" #include "components/data_reduction_proxy/core/common/data_reduction_proxy_config_values.h" #include "components/data_reduction_proxy/core/common/data_reduction_proxy_event_creator.h" @@ -78,6 +82,46 @@ return false; } +// Returns a descriptive name corresponding to |connection_type|. +const char* GetNameForConnectionType( + net::NetworkChangeNotifier::ConnectionType connection_type) { + switch (connection_type) { + case net::NetworkChangeNotifier::CONNECTION_UNKNOWN: + return "Unknown"; + case net::NetworkChangeNotifier::CONNECTION_ETHERNET: + return "Ethernet"; + case net::NetworkChangeNotifier::CONNECTION_WIFI: + return "WiFi"; + case net::NetworkChangeNotifier::CONNECTION_2G: + return "2G"; + case net::NetworkChangeNotifier::CONNECTION_3G: + return "3G"; + case net::NetworkChangeNotifier::CONNECTION_4G: + return "4G"; + case net::NetworkChangeNotifier::CONNECTION_NONE: + return "None"; + case net::NetworkChangeNotifier::CONNECTION_BLUETOOTH: + return "Bluetooth"; + } + NOTREACHED(); + return ""; +} + +// Returns an enumerated histogram that should be used to record the given +// statistic. |max_limit| is the maximum value that can be stored in the +// histogram. Number of buckets in the enumerated histogram are one more than +// |max_limit|. +base::HistogramBase* GetEnumeratedHistogram( + const std::string& prefix, + net::NetworkChangeNotifier::ConnectionType type, + int32_t max_limit) { + DCHECK_GT(max_limit, 0); + + return base::Histogram::FactoryGet( + prefix + GetNameForConnectionType(type), 0, max_limit, max_limit + 1, + base::HistogramBase::kUmaTargetedHistogramFlag); +} + // Following UMA is plotted to measure how frequently Lo-Fi state changes. // Too frequent changes are undesirable. void RecordAutoLoFiRequestHeaderStateChange(bool previous_header_low, @@ -227,6 +271,7 @@ }; DataReductionProxyConfig::DataReductionProxyConfig( + scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, net::NetLog* net_log, std::unique_ptr<DataReductionProxyConfigValues> config_values, DataReductionProxyConfigurator* configurator, @@ -235,21 +280,23 @@ unreachable_(false), enabled_by_user_(false), config_values_(std::move(config_values)), + io_task_runner_(io_task_runner), net_log_(net_log), configurator_(configurator), event_creator_(event_creator), auto_lofi_minimum_rtt_(base::TimeDelta::Max()), auto_lofi_maximum_kbps_(0), auto_lofi_hysteresis_(base::TimeDelta::Max()), - network_quality_last_checked_(base::TimeTicks()), network_prohibitively_slow_(false), connection_type_(net::NetworkChangeNotifier::GetConnectionType()), lofi_off_(false), - last_query_(base::TimeTicks::Now()), network_quality_at_last_query_(NETWORK_QUALITY_AT_LAST_QUERY_UNKNOWN), - previous_state_lofi_on_(false) { + previous_state_lofi_on_(false), + weak_factory_(this) { + DCHECK(io_task_runner_); DCHECK(configurator); DCHECK(event_creator); + if (params::IsLoFiDisabledViaFlags()) SetLoFiModeOff(); // Constructed on the UI thread, but should be checked on the IO thread. @@ -271,6 +318,16 @@ PopulateAutoLoFiParams(); AddDefaultProxyBypassRules(); net::NetworkChangeNotifier::AddIPAddressObserver(this); + + // Record accuracy at 3 different intervals. The values used here must remain + // in sync with the suffixes specified in + // tools/metrics/histograms/histograms.xml. + lofi_accuracy_recording_intervals_.push_back( + base::TimeDelta::FromSeconds(15)); + lofi_accuracy_recording_intervals_.push_back( + base::TimeDelta::FromSeconds(30)); + lofi_accuracy_recording_intervals_.push_back( + base::TimeDelta::FromSeconds(60)); } void DataReductionProxyConfig::ReloadConfig() { @@ -419,17 +476,32 @@ network_quality_at_last_query_ = is_network_currently_slow ? NETWORK_QUALITY_AT_LAST_QUERY_SLOW : NETWORK_QUALITY_AT_LAST_QUERY_NOT_SLOW; + + if ((params::IsIncludedInLoFiEnabledFieldTrial() || + params::IsIncludedInLoFiControlFieldTrial()) && + !params::IsLoFiSlowConnectionsOnlyViaFlags()) { + // Post tasks to record accuracy of network quality prediction at + // different intervals. + for (const base::TimeDelta& measuring_delay : + GetLofiAccuracyRecordingIntervals()) { + io_task_runner_->PostDelayedTask( + FROM_HERE, + base::Bind(&DataReductionProxyConfig::RecordAutoLoFiAccuracyRate, + weak_factory_.GetWeakPtr(), network_quality_estimator, + measuring_delay), + measuring_delay); + } + } } // Return the cached entry if the last update was within the hysteresis // duration and if the connection type has not changed. if (!network_type_changed && !network_quality_last_checked_.is_null() && - base::TimeTicks::Now() - network_quality_last_checked_ <= - auto_lofi_hysteresis_) { + GetTicksNow() - network_quality_last_checked_ <= auto_lofi_hysteresis_) { return network_prohibitively_slow_; } - network_quality_last_checked_ = base::TimeTicks::Now(); + network_quality_last_checked_ = GetTicksNow(); if (!is_network_quality_available) return false; @@ -493,8 +565,7 @@ net::ProxyRetryInfoMap::const_iterator found = retry_map.find(proxy_server.ToURI()); - if (found == retry_map.end() || - found->second.bad_until < base::TimeTicks::Now()) { + if (found == retry_map.end() || found->second.bad_until < GetTicksNow()) { return false; } @@ -622,6 +693,10 @@ DCHECK(config_values_->allowed()); RecordNetworkChangeEvent(IP_CHANGED); + // Reset |network_quality_at_last_query_| to prevent recording of network + // quality prediction accuracy if there was a change in the IP address. + network_quality_at_last_query_ = NETWORK_QUALITY_AT_LAST_QUERY_UNKNOWN; + bool should_use_secure_proxy = params::ShouldUseSecureProxyByDefault(); if (!should_use_secure_proxy && secure_proxy_allowed_) { secure_proxy_allowed_ = false; @@ -691,12 +766,31 @@ } void DataReductionProxyConfig::RecordAutoLoFiAccuracyRate( - const net::NetworkQualityEstimator* network_quality_estimator) const { + const net::NetworkQualityEstimator* network_quality_estimator, + const base::TimeDelta& measuring_duration) const { DCHECK(thread_checker_.CalledOnValidThread()); DCHECK(network_quality_estimator); - DCHECK(params::IsIncludedInLoFiEnabledFieldTrial()); - DCHECK_NE(network_quality_at_last_query_, - NETWORK_QUALITY_AT_LAST_QUERY_UNKNOWN); + DCHECK((params::IsIncludedInLoFiEnabledFieldTrial() || + params::IsIncludedInLoFiControlFieldTrial()) && + !params::IsLoFiSlowConnectionsOnlyViaFlags()); + DCHECK_EQ(0, measuring_duration.InMilliseconds() % 1000); + DCHECK( + ContainsValue(GetLofiAccuracyRecordingIntervals(), measuring_duration)); + + if (network_quality_at_last_query_ == NETWORK_QUALITY_AT_LAST_QUERY_UNKNOWN) + return; + + const base::TimeTicks now = GetTicksNow(); + + // Return if the time since |last_query_| is less than |measuring_duration|. + // This may happen if another main frame request started during last + // |measuring_duration|. + if (now - last_query_ < measuring_duration) + return; + + // Return if the time since |last_query_| is off by a factor of 2. + if (now - last_query_ > 2 * measuring_duration) + return; base::TimeDelta rtt_since_last_page_load; if (!network_quality_estimator->GetRecentURLRequestRTTMedian( @@ -746,48 +840,20 @@ } } - switch (connection_type_) { - case net::NetworkChangeNotifier::CONNECTION_UNKNOWN: - UMA_HISTOGRAM_ENUMERATION("DataReductionProxy.AutoLoFiAccuracy.Unknown", - accuracy, AUTO_LOFI_ACCURACY_INDEX_BOUNDARY); - break; - case net::NetworkChangeNotifier::CONNECTION_ETHERNET: - UMA_HISTOGRAM_ENUMERATION("DataReductionProxy.AutoLoFiAccuracy.Ethernet", - accuracy, AUTO_LOFI_ACCURACY_INDEX_BOUNDARY); - break; - case net::NetworkChangeNotifier::CONNECTION_WIFI: - UMA_HISTOGRAM_ENUMERATION("DataReductionProxy.AutoLoFiAccuracy.WiFi", - accuracy, AUTO_LOFI_ACCURACY_INDEX_BOUNDARY); - break; - case net::NetworkChangeNotifier::CONNECTION_2G: - UMA_HISTOGRAM_ENUMERATION("DataReductionProxy.AutoLoFiAccuracy.2G", - accuracy, AUTO_LOFI_ACCURACY_INDEX_BOUNDARY); - break; - case net::NetworkChangeNotifier::CONNECTION_3G: - UMA_HISTOGRAM_ENUMERATION("DataReductionProxy.AutoLoFiAccuracy.3G", - accuracy, AUTO_LOFI_ACCURACY_INDEX_BOUNDARY); - break; - case net::NetworkChangeNotifier::CONNECTION_4G: - UMA_HISTOGRAM_ENUMERATION("DataReductionProxy.AutoLoFiAccuracy.4G", - accuracy, AUTO_LOFI_ACCURACY_INDEX_BOUNDARY); - break; - case net::NetworkChangeNotifier::CONNECTION_NONE: - UMA_HISTOGRAM_ENUMERATION("DataReductionProxy.AutoLoFiAccuracy.None", - accuracy, AUTO_LOFI_ACCURACY_INDEX_BOUNDARY); - break; - case net::NetworkChangeNotifier::CONNECTION_BLUETOOTH: - UMA_HISTOGRAM_ENUMERATION("DataReductionProxy.AutoLoFiAccuracy.Bluetooth", - accuracy, AUTO_LOFI_ACCURACY_INDEX_BOUNDARY); - break; - default: - NOTREACHED(); - break; - } + static const char prefix[] = "DataReductionProxy.LoFi.Accuracy."; + base::HistogramBase* accuracy_histogram = GetEnumeratedHistogram( + prefix + base::IntToString(measuring_duration.InSeconds()) + ".", + connection_type_, AUTO_LOFI_ACCURACY_INDEX_BOUNDARY - 1); + + accuracy_histogram->Add(accuracy); } bool DataReductionProxyConfig::ShouldEnableLoFiMode( const net::URLRequest& request) { DCHECK(thread_checker_.CalledOnValidThread()); + DCHECK((request.load_flags() & net::LOAD_MAIN_FRAME) != 0); + DCHECK(!request.url().SchemeIsCryptographic()); + net::NetworkQualityEstimator* network_quality_estimator; network_quality_estimator = request.context() ? request.context()->network_quality_estimator() @@ -814,16 +880,7 @@ const net::NetworkQualityEstimator* network_quality_estimator) { DCHECK(thread_checker_.CalledOnValidThread()); - // Record Lo-Fi accuracy rate only if the session is Lo-Fi enabled - // field trial, and the user has not enabled Lo-Fi on slow connections - // via flags. - if (network_quality_estimator && - network_quality_at_last_query_ != NETWORK_QUALITY_AT_LAST_QUERY_UNKNOWN && - params::IsIncludedInLoFiEnabledFieldTrial() && - !params::IsLoFiSlowConnectionsOnlyViaFlags()) { - RecordAutoLoFiAccuracyRate(network_quality_estimator); - } - last_query_ = base::TimeTicks::Now(); + last_query_ = GetTicksNow(); network_quality_at_last_query_ = NETWORK_QUALITY_AT_LAST_QUERY_UNKNOWN; // If Lo-Fi has been turned off, its status can't change. @@ -856,4 +913,15 @@ net::GetNetworkList(interfaces, policy); } +const std::vector<base::TimeDelta>& +DataReductionProxyConfig::GetLofiAccuracyRecordingIntervals() const { + DCHECK(thread_checker_.CalledOnValidThread()); + return lofi_accuracy_recording_intervals_; +} + +base::TimeTicks DataReductionProxyConfig::GetTicksNow() const { + DCHECK(thread_checker_.CalledOnValidThread()); + return base::TimeTicks::Now(); +} + } // namespace data_reduction_proxy
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.h b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.h index 62e46d7f..4a452824 100644 --- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.h +++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.h
@@ -9,11 +9,14 @@ #include <memory> #include <string> +#include <vector> #include "base/callback.h" #include "base/gtest_prod_util.h" #include "base/macros.h" #include "base/memory/ref_counted.h" +#include "base/memory/scoped_ptr.h" +#include "base/memory/weak_ptr.h" #include "base/threading/thread_checker.h" #include "base/time/time.h" #include "net/base/net_errors.h" @@ -25,6 +28,10 @@ class GURL; +namespace base { +class SingleThreadTaskRunner; +} + namespace net { class HostPortPair; class NetLog; @@ -84,13 +91,13 @@ public: // The caller must ensure that all parameters remain alive for the lifetime // of the |DataReductionProxyConfig| instance, with the exception of - // |config_values| which is owned by |this|. |io_task_runner| is used to - // validate calls on the correct thread. |event_creator| is used for logging - // the start and end of a secure proxy check; |net_log| is used to create a - // net::BoundNetLog for correlating the start and end of the check. + // |config_values| which is owned by |this|. |event_creator| is used for + // logging the start and end of a secure proxy check; |net_log| is used to + // create a net::BoundNetLog for correlating the start and end of the check. // |config_values| contains the Data Reduction Proxy configuration values. // |configurator| is the target for a configuration update. DataReductionProxyConfig( + scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, net::NetLog* net_log, std::unique_ptr<DataReductionProxyConfigValues> config_values, DataReductionProxyConfigurator* configurator, @@ -200,6 +207,13 @@ virtual void GetNetworkList(net::NetworkInterfaceList* interfaces, int policy); + // Virtualized for testing. Returns the list of intervals at which accuracy of + // network quality prediction should be recorded. + virtual const std::vector<base::TimeDelta>& + GetLofiAccuracyRecordingIntervals() const; + + virtual base::TimeTicks GetTicksNow() const; + private: friend class DataReductionProxyConfigTest; friend class MockDataReductionProxyConfig; @@ -219,7 +233,9 @@ FRIEND_TEST_ALL_PREFIXES(DataReductionProxyConfigTest, AutoLoFiParams); FRIEND_TEST_ALL_PREFIXES(DataReductionProxyConfigTest, AutoLoFiParamsSlowConnectionsFlag); - FRIEND_TEST_ALL_PREFIXES(DataReductionProxyConfigTest, AutoLoFiAccuracy); + FRIEND_TEST_ALL_PREFIXES(DataReductionProxyConfigTest, LoFiAccuracy); + FRIEND_TEST_ALL_PREFIXES(DataReductionProxyConfigTest, + LoFiAccuracyNonZeroDelay); // Values of the estimated network quality at the beginning of the most // recent query of the Network Quality Estimator. @@ -281,9 +297,13 @@ virtual bool IsNetworkQualityProhibitivelySlow( const net::NetworkQualityEstimator* network_quality_estimator); - // Records Lo-Fi accuracy metric. + // Records Lo-Fi accuracy metric. |measuring_duration| should belong to the + // vector returned by LofiAccuracyRecordingIntervals(). + // RecordAutoLoFiAccuracyRate should be called |measuring_duration| after a + // main frame request is observed. void RecordAutoLoFiAccuracyRate( - const net::NetworkQualityEstimator* network_quality_estimator) const; + const net::NetworkQualityEstimator* network_quality_estimator, + const base::TimeDelta& measuring_duration) const; std::unique_ptr<SecureProxyChecker> secure_proxy_checker_; @@ -296,6 +316,8 @@ // Contains the configuration data being used. std::unique_ptr<DataReductionProxyConfigValues> config_values_; + scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; + // The caller must ensure that the |net_log_|, if set, outlives this instance. // It is used to create new instances of |bound_net_log_| on secure proxy // checks. |bound_net_log_| permits the correlation of the begin and end @@ -357,6 +379,12 @@ // request headers are never modified in the control group. bool previous_state_lofi_on_; + // Intervals after the main frame request arrives at which accuracy of network + // quality prediction is recorded. + std::vector<base::TimeDelta> lofi_accuracy_recording_intervals_; + + base::WeakPtrFactory<DataReductionProxyConfig> weak_factory_; + DISALLOW_COPY_AND_ASSIGN(DataReductionProxyConfig); };
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_test_utils.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_test_utils.cc index 1f17abd..0468747 100644 --- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_test_utils.cc +++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_test_utils.cc
@@ -9,6 +9,8 @@ #include <utility> #include "base/memory/ptr_util.h" +#include "base/single_thread_task_runner.h" +#include "base/time/tick_clock.h" #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_mutable_config_values.h" #include "components/data_reduction_proxy/core/common/data_reduction_proxy_params_test_utils.h" #include "net/url_request/test_url_fetcher_factory.h" @@ -26,6 +28,7 @@ TestDataReductionProxyConfig::TestDataReductionProxyConfig( int params_flags, unsigned int params_definitions, + scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, net::NetLog* net_log, DataReductionProxyConfigurator* configurator, DataReductionProxyEventCreator* event_creator) @@ -33,20 +36,26 @@ base::WrapUnique( new TestDataReductionProxyParams(params_flags, params_definitions)), + io_task_runner, net_log, configurator, event_creator) {} TestDataReductionProxyConfig::TestDataReductionProxyConfig( std::unique_ptr<DataReductionProxyConfigValues> config_values, + scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, net::NetLog* net_log, DataReductionProxyConfigurator* configurator, DataReductionProxyEventCreator* event_creator) - : DataReductionProxyConfig(net_log, + : DataReductionProxyConfig(io_task_runner, + net_log, std::move(config_values), configurator, event_creator), - network_quality_prohibitively_slow_(false) { + tick_clock_(nullptr), + network_quality_prohibitively_slow_set_(false), + network_quality_prohibitively_slow_(false), + lofi_accuracy_recording_intervals_set_(false) { network_interfaces_.reset(new net::NetworkInterfaceList()); } @@ -55,7 +64,10 @@ bool TestDataReductionProxyConfig::IsNetworkQualityProhibitivelySlow( const net::NetworkQualityEstimator* network_quality_estimator) { - return network_quality_prohibitively_slow_; + if (network_quality_prohibitively_slow_set_) + return network_quality_prohibitively_slow_; + return DataReductionProxyConfig::IsNetworkQualityProhibitivelySlow( + network_quality_estimator); } void TestDataReductionProxyConfig::GetNetworkList( @@ -95,15 +107,41 @@ void TestDataReductionProxyConfig::SetNetworkProhibitivelySlow( bool network_quality_prohibitively_slow) { + network_quality_prohibitively_slow_set_ = true; network_quality_prohibitively_slow_ = network_quality_prohibitively_slow; } +void TestDataReductionProxyConfig::SetLofiAccuracyRecordingIntervals( + const std::vector<base::TimeDelta>& lofi_accuracy_recording_intervals) { + lofi_accuracy_recording_intervals_set_ = true; + lofi_accuracy_recording_intervals_ = lofi_accuracy_recording_intervals; +} + +const std::vector<base::TimeDelta>& +TestDataReductionProxyConfig::GetLofiAccuracyRecordingIntervals() const { + if (lofi_accuracy_recording_intervals_set_) + return lofi_accuracy_recording_intervals_; + return DataReductionProxyConfig::GetLofiAccuracyRecordingIntervals(); +} + +void TestDataReductionProxyConfig::SetTickClock(base::TickClock* tick_clock) { + tick_clock_ = tick_clock; +} + +base::TimeTicks TestDataReductionProxyConfig::GetTicksNow() const { + if (tick_clock_) + return tick_clock_->NowTicks(); + return DataReductionProxyConfig::GetTicksNow(); +} + MockDataReductionProxyConfig::MockDataReductionProxyConfig( std::unique_ptr<DataReductionProxyConfigValues> config_values, + scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, net::NetLog* net_log, DataReductionProxyConfigurator* configurator, DataReductionProxyEventCreator* event_creator) : TestDataReductionProxyConfig(std::move(config_values), + io_task_runner, net_log, configurator, event_creator) {}
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_test_utils.h b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_test_utils.h index 5f994a8..cd6143e2 100644 --- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_test_utils.h +++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_test_utils.h
@@ -6,11 +6,20 @@ #define COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_CONFIG_TEST_UTILS_H_ #include <memory> +#include <vector> +#include "base/macros.h" +#include "base/memory/ref_counted.h" +#include "base/time/time.h" #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_config.h" #include "net/base/network_interfaces.h" #include "testing/gmock/include/gmock/gmock.h" +namespace base { +class SingleThreadTaskRunner; +class TickClock; +} + namespace net { class NetworkQualityEstimator; class NetLog; @@ -33,6 +42,7 @@ TestDataReductionProxyConfig( int params_flags, unsigned int params_definitions, + scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, net::NetLog* net_log, DataReductionProxyConfigurator* configurator, DataReductionProxyEventCreator* event_creator); @@ -42,6 +52,7 @@ // DataReductionProxyParams or DataReductionProxyMutableConfigValues). TestDataReductionProxyConfig( std::unique_ptr<DataReductionProxyConfigValues> config_values, + scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, net::NetLog* net_log, DataReductionProxyConfigurator* configurator, DataReductionProxyEventCreator* event_creator); @@ -81,11 +92,31 @@ return network_interfaces_.get(); } + void SetLofiAccuracyRecordingIntervals( + const std::vector<base::TimeDelta>& lofi_accuracy_recording_intervals); + + const std::vector<base::TimeDelta>& GetLofiAccuracyRecordingIntervals() + const override; + + // Sets the |tick_clock_| to |tick_clock|. Ownership of |tick_clock| is not + // passed to the callee. + void SetTickClock(base::TickClock* tick_clock); + + base::TimeTicks GetTicksNow() const override; + private: + base::TickClock* tick_clock_; + std::unique_ptr<net::NetworkInterfaceList> network_interfaces_; - // True if network quality is slow enough to turn Auto Lo-Fi ON. + bool network_quality_prohibitively_slow_set_; + // True if the network quality is slow enough to turn Lo-Fi ON. bool network_quality_prohibitively_slow_; + + bool lofi_accuracy_recording_intervals_set_; + std::vector<base::TimeDelta> lofi_accuracy_recording_intervals_; + + DISALLOW_COPY_AND_ASSIGN(TestDataReductionProxyConfig); }; // A |TestDataReductionProxyConfig| which permits mocking of methods for @@ -95,6 +126,7 @@ // Creates a |MockDataReductionProxyConfig|. MockDataReductionProxyConfig( std::unique_ptr<DataReductionProxyConfigValues> config_values, + scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, net::NetLog* net_log, DataReductionProxyConfigurator* configurator, DataReductionProxyEventCreator* event_creator);
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_unittest.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_unittest.cc index 2d067d5..48b1a0a8 100644 --- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_unittest.cc +++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_unittest.cc
@@ -14,11 +14,14 @@ #include "base/command_line.h" #include "base/macros.h" #include "base/memory/ptr_util.h" +#include "base/memory/ref_counted.h" #include "base/metrics/field_trial.h" #include "base/strings/safe_sprintf.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" #include "base/test/histogram_tester.h" +#include "base/test/simple_test_tick_clock.h" +#include "base/threading/platform_thread.h" #include "base/time/time.h" #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_config_test_utils.h" #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_configurator_test_utils.h" @@ -30,6 +33,7 @@ #include "components/data_reduction_proxy/core/common/data_reduction_proxy_switches.h" #include "components/variations/variations_associated_data.h" #include "net/base/external_estimate_provider.h" +#include "net/base/load_flags.h" #include "net/base/network_quality_estimator.h" #include "net/http/http_status_code.h" #include "net/log/test_net_log.h" @@ -82,6 +86,10 @@ config()->ResetParamFlagsForTest(flags); } + scoped_refptr<base::SingleThreadTaskRunner> task_runner() { + return message_loop_.task_runner(); + } + void ExpectSecureProxyCheckResult(SecureProxyCheckFetchResult result) { EXPECT_CALL(*config(), RecordSecureProxyCheckFetchResult(result)).Times(1); } @@ -129,7 +137,7 @@ std::unique_ptr<DataReductionProxyParams> params) { params->EnableQuic(false); return base::WrapUnique(new DataReductionProxyConfig( - test_context_->net_log(), std::move(params), + task_runner(), test_context_->net_log(), std::move(params), test_context_->configurator(), test_context_->event_creator())); } @@ -536,8 +544,9 @@ new TestDataReductionProxyParams(flags, has_definitions)); DataReductionProxyTypeInfo proxy_type_info; std::unique_ptr<DataReductionProxyConfig> config( - new DataReductionProxyConfig(net_log(), std::move(params), - configurator(), event_creator())); + new DataReductionProxyConfig(task_runner(), net_log(), + std::move(params), configurator(), + event_creator())); EXPECT_EQ( tests[i].expected_result, config->IsDataReductionProxy(tests[i].host_port_pair, &proxy_type_info)) @@ -633,7 +642,8 @@ DataReductionProxyMutableConfigValues::CreateFromParams(params()); config_values->UpdateValues(proxies_for_http); std::unique_ptr<DataReductionProxyConfig> config(new DataReductionProxyConfig( - net_log(), std::move(config_values), configurator(), event_creator())); + task_runner(), net_log(), std::move(config_values), configurator(), + event_creator())); for (size_t i = 0; i < arraysize(tests); ++i) { DataReductionProxyTypeInfo proxy_type_info; EXPECT_EQ(tests[i].expected_result, @@ -761,6 +771,7 @@ net::TestDelegate delegate_; std::unique_ptr<net::URLRequest> request = context_.CreateRequest(GURL(), net::IDLE, &delegate_); + request->SetLoadFlags(request->load_flags() | net::LOAD_MAIN_FRAME); bool should_enable_lofi = config()->ShouldEnableLoFiMode(*request.get()); if (tests[i].expect_bucket_count != 0) { histogram_tester.ExpectBucketCount( @@ -829,8 +840,8 @@ }; TEST_F(DataReductionProxyConfigTest, AutoLoFiParams) { - DataReductionProxyConfig config(nullptr, nullptr, configurator(), - event_creator()); + DataReductionProxyConfig config(task_runner(), nullptr, nullptr, + configurator(), event_creator()); variations::testing::ClearAllVariationParams(); std::map<std::string, std::string> variation_params; std::map<std::string, std::string> variation_params_flag; @@ -934,8 +945,8 @@ } TEST_F(DataReductionProxyConfigTest, AutoLoFiParamsSlowConnectionsFlag) { - DataReductionProxyConfig config(nullptr, nullptr, configurator(), - event_creator()); + DataReductionProxyConfig config(task_runner(), nullptr, nullptr, + configurator(), event_creator()); variations::testing::ClearAllVariationParams(); base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( @@ -989,12 +1000,116 @@ &test_network_quality_estimator)); } -// Tests if metrics for LoFi accuracy are recorded properly. -TEST_F(DataReductionProxyConfigTest, AutoLoFiAccuracy) { - base::HistogramTester histogram_tester; +// Tests if metrics for Lo-Fi accuracy are recorded properly. +TEST_F(DataReductionProxyConfigTest, LoFiAccuracy) { + scoped_ptr<base::SimpleTestTickClock> tick_clock( + new base::SimpleTestTickClock()); - DataReductionProxyConfig config(nullptr, nullptr, configurator(), - event_creator()); + std::vector<base::TimeDelta> lofi_accuracy_recording_intervals; + lofi_accuracy_recording_intervals.push_back(base::TimeDelta::FromSeconds(0)); + + TestDataReductionProxyConfig config( + DataReductionProxyParams::kAllowed | + DataReductionProxyParams::kFallbackAllowed, + TestDataReductionProxyParams::HAS_EVERYTHING, task_runner(), nullptr, + configurator(), event_creator()); + config.SetLofiAccuracyRecordingIntervals(lofi_accuracy_recording_intervals); + config.SetTickClock(tick_clock.get()); + + variations::testing::ClearAllVariationParams(); + std::map<std::string, std::string> variation_params; + + int expected_rtt_msec = 120; + int expected_hysteresis_sec = 360; + + variation_params["rtt_msec"] = base::IntToString(expected_rtt_msec); + variation_params["hysteresis_period_seconds"] = + base::IntToString(expected_hysteresis_sec); + + const struct { + std::string description; + std::string field_trial_group; + base::TimeDelta rtt; + base::TimeDelta recent_rtt; + bool expect_network_quality_slow; + uint32_t bucket_to_check; + uint32_t expected_bucket_count; + } tests[] = { + {"Predicted slow, actually slow, Enabled group", "Enabled", + base::TimeDelta::FromMilliseconds(expected_rtt_msec + 1), + base::TimeDelta::FromMilliseconds(expected_rtt_msec + 1), true, 0, 1}, + {"Predicted slow, actually slow, Enabled_NoControl group", + "Enabled_NoControl", + base::TimeDelta::FromMilliseconds(expected_rtt_msec + 1), + base::TimeDelta::FromMilliseconds(expected_rtt_msec + 1), true, 0, 1}, + {"Predicted slow, actually slow, Control group", "Control", + base::TimeDelta::FromMilliseconds(expected_rtt_msec + 1), + base::TimeDelta::FromMilliseconds(expected_rtt_msec + 1), true, 0, 1}, + {"Predicted slow, actually not slow", "Enabled", + base::TimeDelta::FromMilliseconds(expected_rtt_msec + 1), + base::TimeDelta::FromMilliseconds(expected_rtt_msec - 1), true, 1, 1}, + {"Predicted not slow, actually slow", "Enabled", + base::TimeDelta::FromMilliseconds(expected_rtt_msec - 1), + base::TimeDelta::FromMilliseconds(expected_rtt_msec + 1), false, 2, 1}, + {"Predicted not slow, actually not slow", "Enabled", + base::TimeDelta::FromMilliseconds(expected_rtt_msec - 1), + base::TimeDelta::FromMilliseconds(expected_rtt_msec - 1), false, 3, 1}, + }; + + for (const auto& test : tests) { + base::FieldTrialList field_trial_list(nullptr); + variations::testing::ClearAllVariationIDs(); + variations::testing::ClearAllVariationParams(); + ASSERT_TRUE(variations::AssociateVariationParams( + params::GetLoFiFieldTrialName(), test.field_trial_group, + variation_params)) + << test.description; + + ASSERT_NE(nullptr, + base::FieldTrialList::CreateFieldTrial( + params::GetLoFiFieldTrialName(), test.field_trial_group)) + << test.description; + config.PopulateAutoLoFiParams(); + + std::map<std::string, std::string> network_quality_estimator_params; + TestNetworkQualityEstimator test_network_quality_estimator( + network_quality_estimator_params); + + base::HistogramTester histogram_tester; + // RTT is higher than threshold. Network is slow. + // Network was predicted to be slow and actually was slow. + test_network_quality_estimator.SetRTT(test.rtt); + test_network_quality_estimator.SetMedianRTTSince(test.recent_rtt); + ASSERT_EQ(test.expect_network_quality_slow, + config.IsNetworkQualityProhibitivelySlow( + &test_network_quality_estimator)) + << test.description; + RunUntilIdle(); + histogram_tester.ExpectTotalCount( + "DataReductionProxy.LoFi.Accuracy.0.Unknown", 1); + histogram_tester.ExpectBucketCount( + "DataReductionProxy.LoFi.Accuracy.0.Unknown", test.bucket_to_check, + test.expected_bucket_count); + } +} + +// Tests if metrics for Lo-Fi accuracy are recorded properly at the specified +// interval. +TEST_F(DataReductionProxyConfigTest, LoFiAccuracyNonZeroDelay) { + scoped_ptr<base::SimpleTestTickClock> tick_clock( + new base::SimpleTestTickClock()); + + std::vector<base::TimeDelta> lofi_accuracy_recording_intervals; + lofi_accuracy_recording_intervals.push_back(base::TimeDelta::FromSeconds(1)); + + TestDataReductionProxyConfig config( + DataReductionProxyParams::kAllowed | + DataReductionProxyParams::kFallbackAllowed, + TestDataReductionProxyParams::HAS_EVERYTHING, task_runner(), nullptr, + configurator(), event_creator()); + config.SetLofiAccuracyRecordingIntervals(lofi_accuracy_recording_intervals); + config.SetTickClock(tick_clock.get()); + variations::testing::ClearAllVariationParams(); std::map<std::string, std::string> variation_params; @@ -1017,56 +1132,24 @@ TestNetworkQualityEstimator test_network_quality_estimator( network_quality_estimator_params); + base::HistogramTester histogram_tester; // RTT is higher than threshold. Network is slow. // Network was predicted to be slow and actually was slow. test_network_quality_estimator.SetRTT( base::TimeDelta::FromMilliseconds(expected_rtt_msec + 1)); test_network_quality_estimator.SetMedianRTTSince( base::TimeDelta::FromMilliseconds(expected_rtt_msec + 1)); - EXPECT_TRUE(config.IsNetworkQualityProhibitivelySlow( + ASSERT_TRUE(config.IsNetworkQualityProhibitivelySlow( &test_network_quality_estimator)); - config.RecordAutoLoFiAccuracyRate(&test_network_quality_estimator); + tick_clock->Advance(base::TimeDelta::FromSeconds(1)); + + // Sleep to ensure that the delayed task is posted. + base::PlatformThread::Sleep(base::TimeDelta::FromSeconds(1)); + RunUntilIdle(); + histogram_tester.ExpectTotalCount( + "DataReductionProxy.LoFi.Accuracy.1.Unknown", 1); histogram_tester.ExpectBucketCount( - "DataReductionProxy.AutoLoFiAccuracy.Unknown", 0, 1); - - // Network was predicted to be slow but actually was not slow. - test_network_quality_estimator.SetMedianRTTSince( - base::TimeDelta::FromMilliseconds(expected_rtt_msec - 1)); - EXPECT_TRUE(config.IsNetworkQualityProhibitivelySlow( - &test_network_quality_estimator)); - config.RecordAutoLoFiAccuracyRate(&test_network_quality_estimator); - histogram_tester.ExpectBucketCount( - "DataReductionProxy.AutoLoFiAccuracy.Unknown", 1, 1); - - config.network_quality_last_checked_ = - base::TimeTicks::Now() - - base::TimeDelta::FromSeconds(expected_hysteresis_sec + 1); - - // Network was predicted to be not slow but actually was slow. - test_network_quality_estimator.SetRTT( - base::TimeDelta::FromMilliseconds(expected_rtt_msec - 1)); - test_network_quality_estimator.SetMedianRTTSince( - base::TimeDelta::FromMilliseconds(expected_rtt_msec + 1)); - EXPECT_FALSE(config.IsNetworkQualityProhibitivelySlow( - &test_network_quality_estimator)); - config.RecordAutoLoFiAccuracyRate(&test_network_quality_estimator); - histogram_tester.ExpectBucketCount( - "DataReductionProxy.AutoLoFiAccuracy.Unknown", 2, 1); - - // Network was predicted to be not slow but actually was not slow. - test_network_quality_estimator.SetMedianRTTSince( - base::TimeDelta::FromMilliseconds(expected_rtt_msec - 1)); - EXPECT_FALSE(config.IsNetworkQualityProhibitivelySlow( - &test_network_quality_estimator)); - config.RecordAutoLoFiAccuracyRate(&test_network_quality_estimator); - histogram_tester.ExpectBucketCount( - "DataReductionProxy.AutoLoFiAccuracy.Unknown", 3, 1); - - // Make sure that all buckets contain exactly one value. - for (size_t bucket = 0; bucket < 4; ++bucket) { - histogram_tester.ExpectBucketCount( - "DataReductionProxy.AutoLoFiAccuracy.Unknown", bucket, 1); - } + "DataReductionProxy.LoFi.Accuracy.1.Unknown", 0, 1); } } // namespace data_reduction_proxy
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_delegate_unittest.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_delegate_unittest.cc index ee5ddfb..89a1faf 100644 --- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_delegate_unittest.cc +++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_delegate_unittest.cc
@@ -146,8 +146,9 @@ std::unique_ptr<DataReductionProxyConfig> config( new DataReductionProxyConfig( - test_context->net_log(), std::move(config_values), - test_context->configurator(), test_context->event_creator())); + message_loop_.task_runner(), test_context->net_log(), + std::move(config_values), test_context->configurator(), + test_context->event_creator())); DataReductionProxyDelegate delegate( test_context->io_data()->request_options(), config.get(),
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.cc index b57de90..ae152f62 100644 --- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.cc +++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.cc
@@ -124,11 +124,12 @@ DataReductionProxyMutableConfigValues::CreateFromParams(params.get()); raw_mutable_config = mutable_config.get(); config_.reset(new DataReductionProxyConfig( - net_log, std::move(mutable_config), configurator_.get(), + io_task_runner, net_log, std::move(mutable_config), configurator_.get(), event_creator_.get())); } else { config_.reset(new DataReductionProxyConfig( - net_log, std::move(params), configurator_.get(), event_creator_.get())); + io_task_runner, net_log, std::move(params), configurator_.get(), + event_creator_.get())); } // It is safe to use base::Unretained here, since it gets executed
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate_unittest.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate_unittest.cc index c8488ee..5bc90cc 100644 --- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate_unittest.cc +++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate_unittest.cc
@@ -455,6 +455,7 @@ std::unique_ptr<net::URLRequest> fake_request( FetchURLRequest(GURL("http://www.google.com/"), nullptr, response_headers, kResponseContentLength)); + fake_request->SetLoadFlags(fake_request->load_flags() | net::LOAD_MAIN_FRAME); base::TimeDelta freshness_lifetime = fake_request->response_info().headers->GetFreshnessLifetimes( @@ -531,6 +532,8 @@ fake_request = (FetchURLRequest(GURL("http://www.example.com/"), nullptr, response_headers, kResponseContentLength)); + fake_request->SetLoadFlags(fake_request->load_flags() | + net::LOAD_MAIN_FRAME); // Histograms are accumulative, so get the sum of all the tests so far. int expected_count = 0;
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_test_utils.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_test_utils.cc index 8b6f7680..4b0d000 100644 --- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_test_utils.cc +++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_test_utils.cc
@@ -416,16 +416,16 @@ DataReductionProxyMutableConfigValues::CreateFromParams(params.get()); raw_mutable_config = mutable_config.get(); config.reset(new TestDataReductionProxyConfig( - std::move(mutable_config), net_log.get(), configurator.get(), - event_creator.get())); + std::move(mutable_config), task_runner, net_log.get(), + configurator.get(), event_creator.get())); } else if (use_mock_config_) { test_context_flags |= USE_MOCK_CONFIG; config.reset(new MockDataReductionProxyConfig( - std::move(params), net_log.get(), configurator.get(), + std::move(params), task_runner, net_log.get(), configurator.get(), event_creator.get())); } else { config.reset(new TestDataReductionProxyConfig( - std::move(params), net_log.get(), configurator.get(), + std::move(params), task_runner, net_log.get(), configurator.get(), event_creator.get())); }
diff --git a/components/dom_distiller/core/BUILD.gn b/components/dom_distiller/core/BUILD.gn index 7c6dbb6..8406d9b 100644 --- a/components/dom_distiller/core/BUILD.gn +++ b/components/dom_distiller/core/BUILD.gn
@@ -111,6 +111,19 @@ ] } +bundle_data("unit_tests_bundle_data") { + visibility = [ ":unit_tests" ] + testonly = true + sources = [ + "//components/test/data/dom_distiller/core_features.json", + "//components/test/data/dom_distiller/derived_features.json", + ] + outputs = [ + "{{bundle_resources_dir}}/" + + "{{source_root_relative_dir}}/{{source_file_part}}", + ] +} + source_set("unit_tests") { testonly = true sources = [ @@ -133,6 +146,7 @@ deps = [ ":core", ":test_support", + ":unit_tests_bundle_data", "//base", "//components/leveldb_proto:test_support", "//components/pref_registry:test_support",
diff --git a/components/domain_reliability/OWNERS b/components/domain_reliability/OWNERS index 6abaef7..5532f10 100644 --- a/components/domain_reliability/OWNERS +++ b/components/domain_reliability/OWNERS
@@ -1,6 +1,6 @@ davidben@chromium.org rdsmith@chromium.org -ttuttle@chromium.org +juliatuttle@chromium.org per-file quic_error_mapping*=rch@chromium.org per-file quic_error_mapping*=rtenneti@chromium.org
diff --git a/components/domain_reliability/context.cc b/components/domain_reliability/context.cc index 4d7c83e..2d244e6 100644 --- a/components/domain_reliability/context.cc +++ b/components/domain_reliability/context.cc
@@ -91,7 +91,7 @@ "DomainReliability.ReportedBeaconError_HasServerIP", -beacon->chrome_error); } - // TODO(ttuttle): Histogram HTTP response code? + // TODO(juliatuttle): Histogram HTTP response code? // Allow beacons about reports, but don't schedule an upload for more than // one layer of recursion, to avoid infinite report loops.
diff --git a/components/domain_reliability/context_manager.cc b/components/domain_reliability/context_manager.cc index b7036d43..c85f82b 100644 --- a/components/domain_reliability/context_manager.cc +++ b/components/domain_reliability/context_manager.cc
@@ -49,7 +49,7 @@ << origin.spec() << "."; return; } - // TODO(ttuttle): Make Context accept Config changes. + // TODO(juliatuttle): Make Context accept Config changes. } DVLOG(1) << "Adding/replacing context for existing origin " << origin.spec() @@ -77,7 +77,7 @@ DomainReliabilityContext* DomainReliabilityContextManager::AddContextForConfig( scoped_ptr<const DomainReliabilityConfig> config) { std::string key = config->origin.host(); - // TODO(ttuttle): Convert this to actual origin. + // TODO(juliatuttle): Convert this to actual origin. scoped_ptr<DomainReliabilityContext> context = context_factory_->CreateContextForConfig(std::move(config)); @@ -114,7 +114,7 @@ if (dot_pos == std::string::npos) return nullptr; - // TODO(ttuttle): Make sure parent is not in PSL before using. + // TODO(juliatuttle): Make sure parent is not in PSL before using. std::string parent_host = host.substr(dot_pos + 1); context_it = contexts_.find(parent_host);
diff --git a/components/domain_reliability/context_manager.h b/components/domain_reliability/context_manager.h index 302671e9..b3690678 100644 --- a/components/domain_reliability/context_manager.h +++ b/components/domain_reliability/context_manager.h
@@ -41,8 +41,9 @@ // the contexts themselves intact. void ClearBeaconsInAllContexts(); - // TODO(ttuttle): Once unit tests test ContextManager directly, they can use - // a custom Context::Factory to get the created Context, and this can be void. + // TODO(juliatuttle): Once unit tests test ContextManager directly, they can + // use a custom Context::Factory to get the created Context, and this can be + // void. DomainReliabilityContext* AddContextForConfig( scoped_ptr<const DomainReliabilityConfig> config);
diff --git a/components/domain_reliability/context_unittest.cc b/components/domain_reliability/context_unittest.cc index a54a176..5a47bf0 100644 --- a/components/domain_reliability/context_unittest.cc +++ b/components/domain_reliability/context_unittest.cc
@@ -535,7 +535,7 @@ EXPECT_EQ(0u, beacons.size()); } -// TODO(ttuttle): Add beacon_unittest.cc to test serialization. +// TODO(juliatuttle): Add beacon_unittest.cc to test serialization. } // namespace } // namespace domain_reliability
diff --git a/components/domain_reliability/dispatcher.cc b/components/domain_reliability/dispatcher.cc index 5d0ed1e..70ef49d 100644 --- a/components/domain_reliability/dispatcher.cc +++ b/components/domain_reliability/dispatcher.cc
@@ -45,7 +45,7 @@ : time_(time) {} DomainReliabilityDispatcher::~DomainReliabilityDispatcher() { - // TODO(ttuttle): STLElementDeleter? + // TODO(juliatuttle): STLElementDeleter? STLDeleteElements(&tasks_); }
diff --git a/components/domain_reliability/monitor.cc b/components/domain_reliability/monitor.cc index 2fdafadc..3a59810 100644 --- a/components/domain_reliability/monitor.cc +++ b/components/domain_reliability/monitor.cc
@@ -346,7 +346,7 @@ // This is not foolproof -- it's possible that we'll see the same error twice // (e.g. an SSL error during connection on one attempt, and then an error // that maps to the same code during a read). - // TODO(ttuttle): Find a way for this code to reliably tell whether we + // TODO(juliatuttle): Find a way for this code to reliably tell whether we // eventually established a connection or not. bool url_request_attempt_is_duplicate = false; for (const auto& attempt : request.connection_attempts) {
diff --git a/components/domain_reliability/monitor_unittest.cc b/components/domain_reliability/monitor_unittest.cc index ac9c7f2..2467f7d 100644 --- a/components/domain_reliability/monitor_unittest.cc +++ b/components/domain_reliability/monitor_unittest.cc
@@ -255,7 +255,7 @@ } // Will fail when baked-in configs expire, as a reminder to update them. -// (Contact ttuttle@chromium.org if this starts failing.) +// (Contact juliatuttle@chromium.org if this starts failing.) TEST_F(DomainReliabilityMonitorTest, AddBakedInConfigs) { // AddBakedInConfigs DCHECKs that the baked-in configs parse correctly, so // this unittest will fail if someone tries to add an invalid config to the
diff --git a/components/domain_reliability/quic_error_mapping.cc b/components/domain_reliability/quic_error_mapping.cc index 7331d50..3dee2777 100644 --- a/components/domain_reliability/quic_error_mapping.cc +++ b/components/domain_reliability/quic_error_mapping.cc
@@ -240,7 +240,7 @@ std::string* beacon_quic_error_out) { if (quic_error != net::QUIC_NO_ERROR) { // Convert a QUIC error. - // TODO(ttuttle): Consider sorting and using binary search? + // TODO(juliatuttle): Consider sorting and using binary search? for (size_t i = 0; i < arraysize(kQuicErrorMap); i++) { if (kQuicErrorMap[i].quic_error == quic_error) { *beacon_quic_error_out = kQuicErrorMap[i].beacon_quic_error;
diff --git a/components/domain_reliability/util.cc b/components/domain_reliability/util.cc index 8dd4e43e..4c4648c 100644 --- a/components/domain_reliability/util.cc +++ b/components/domain_reliability/util.cc
@@ -90,7 +90,7 @@ return true; } - // TODO(ttuttle): Consider sorting and using binary search? + // TODO(juliatuttle): Consider sorting and using binary search? for (size_t i = 0; i < arraysize(net_error_map); i++) { if (net_error_map[i].net_error == net_error) { *beacon_status_out = net_error_map[i].beacon_status; @@ -100,8 +100,8 @@ return false; } -// TODO(ttuttle): Consider using NPN/ALPN instead, if there's a good way to -// differentiate HTTP and HTTPS. +// TODO(juliatuttle): Consider using NPN/ALPN instead, if there's a good way to +// differentiate HTTP and HTTPS. std::string GetDomainReliabilityProtocol( net::HttpResponseInfo::ConnectionInfo connection_info, bool ssl_info_populated) {
diff --git a/components/domain_reliability/util.h b/components/domain_reliability/util.h index 3cbf469b..50447f1 100644 --- a/components/domain_reliability/util.h +++ b/components/domain_reliability/util.h
@@ -57,7 +57,7 @@ // Mockable wrapper around TimeTicks::Now and Timer. Mock version is in // test_util.h. -// TODO(ttuttle): Rename to Time{Provider,Source,?}. +// TODO(juliatuttle): Rename to Time{Provider,Source,?}. class DOMAIN_RELIABILITY_EXPORT MockableTime : public base::Clock, public base::TickClock { public:
diff --git a/components/drive.gypi b/components/drive.gypi index 003cbc04..537dc38 100644 --- a/components/drive.gypi +++ b/components/drive.gypi
@@ -129,62 +129,61 @@ '../google_apis/google_apis.gyp:google_apis', '../net/net.gyp:net', ], - # TODO(yawano): move these files under components/drive/chromeos. 'sources': [ - 'drive/change_list_loader.cc', - 'drive/change_list_loader.h', - 'drive/change_list_loader_observer.h', - 'drive/change_list_processor.cc', - 'drive/change_list_processor.h', - 'drive/directory_loader.cc', - 'drive/directory_loader.h', - 'drive/file_cache.cc', - 'drive/file_cache.h', - 'drive/file_system.cc', - 'drive/file_system.h', - 'drive/file_system_interface.cc', - 'drive/file_system_interface.h', - 'drive/file_system_observer.h', - 'drive/file_system/copy_operation.cc', - 'drive/file_system/copy_operation.h', - 'drive/file_system/create_directory_operation.cc', - 'drive/file_system/create_directory_operation.h', - 'drive/file_system/create_file_operation.cc', - 'drive/file_system/create_file_operation.h', - 'drive/file_system/download_operation.cc', - 'drive/file_system/download_operation.h', - 'drive/file_system/get_file_for_saving_operation.cc', - 'drive/file_system/get_file_for_saving_operation.h', - 'drive/file_system/move_operation.cc', - 'drive/file_system/move_operation.h', - 'drive/file_system/open_file_operation.cc', - 'drive/file_system/open_file_operation.h', - 'drive/file_system/operation_delegate.cc', - 'drive/file_system/operation_delegate.h', - 'drive/file_system/remove_operation.cc', - 'drive/file_system/remove_operation.h', - 'drive/file_system/search_operation.cc', - 'drive/file_system/search_operation.h', - 'drive/file_system/set_property_operation.cc', - 'drive/file_system/set_property_operation.h', - 'drive/file_system/touch_operation.cc', - 'drive/file_system/touch_operation.h', - 'drive/file_system/truncate_operation.cc', - 'drive/file_system/truncate_operation.h', - 'drive/remove_stale_cache_files.cc', - 'drive/remove_stale_cache_files.h', - 'drive/resource_metadata.cc', - 'drive/resource_metadata.h', - 'drive/search_metadata.cc', - 'drive/search_metadata.h', - 'drive/sync_client.cc', - 'drive/sync_client.h', - 'drive/sync/entry_revert_performer.cc', - 'drive/sync/entry_revert_performer.h', - 'drive/sync/entry_update_performer.cc', - 'drive/sync/entry_update_performer.h', - 'drive/sync/remove_performer.cc', - 'drive/sync/remove_performer.h', + 'drive/chromeos/change_list_loader.cc', + 'drive/chromeos/change_list_loader.h', + 'drive/chromeos/change_list_loader_observer.h', + 'drive/chromeos/change_list_processor.cc', + 'drive/chromeos/change_list_processor.h', + 'drive/chromeos/directory_loader.cc', + 'drive/chromeos/directory_loader.h', + 'drive/chromeos/file_cache.cc', + 'drive/chromeos/file_cache.h', + 'drive/chromeos/file_system.cc', + 'drive/chromeos/file_system.h', + 'drive/chromeos/file_system/copy_operation.cc', + 'drive/chromeos/file_system/copy_operation.h', + 'drive/chromeos/file_system/create_directory_operation.cc', + 'drive/chromeos/file_system/create_directory_operation.h', + 'drive/chromeos/file_system/create_file_operation.cc', + 'drive/chromeos/file_system/create_file_operation.h', + 'drive/chromeos/file_system/download_operation.cc', + 'drive/chromeos/file_system/download_operation.h', + 'drive/chromeos/file_system/get_file_for_saving_operation.cc', + 'drive/chromeos/file_system/get_file_for_saving_operation.h', + 'drive/chromeos/file_system/move_operation.cc', + 'drive/chromeos/file_system/move_operation.h', + 'drive/chromeos/file_system/open_file_operation.cc', + 'drive/chromeos/file_system/open_file_operation.h', + 'drive/chromeos/file_system/operation_delegate.cc', + 'drive/chromeos/file_system/operation_delegate.h', + 'drive/chromeos/file_system/remove_operation.cc', + 'drive/chromeos/file_system/remove_operation.h', + 'drive/chromeos/file_system/search_operation.cc', + 'drive/chromeos/file_system/search_operation.h', + 'drive/chromeos/file_system/set_property_operation.cc', + 'drive/chromeos/file_system/set_property_operation.h', + 'drive/chromeos/file_system/touch_operation.cc', + 'drive/chromeos/file_system/touch_operation.h', + 'drive/chromeos/file_system/truncate_operation.cc', + 'drive/chromeos/file_system/truncate_operation.h', + 'drive/chromeos/file_system_interface.cc', + 'drive/chromeos/file_system_interface.h', + 'drive/chromeos/file_system_observer.h', + 'drive/chromeos/remove_stale_cache_files.cc', + 'drive/chromeos/remove_stale_cache_files.h', + 'drive/chromeos/resource_metadata.cc', + 'drive/chromeos/resource_metadata.h', + 'drive/chromeos/search_metadata.cc', + 'drive/chromeos/search_metadata.h', + 'drive/chromeos/sync/entry_revert_performer.cc', + 'drive/chromeos/sync/entry_revert_performer.h', + 'drive/chromeos/sync/entry_update_performer.cc', + 'drive/chromeos/sync/entry_update_performer.h', + 'drive/chromeos/sync/remove_performer.cc', + 'drive/chromeos/sync/remove_performer.h', + 'drive/chromeos/sync_client.cc', + 'drive/chromeos/sync_client.h', ], }, @@ -203,14 +202,14 @@ '../content/content_shell_and_tests.gyp:test_support_content', ], 'sources': [ - "drive/drive_test_util.cc", - "drive/drive_test_util.h", - "drive/dummy_file_system.cc", - "drive/dummy_file_system.h", - "drive/fake_file_system.cc", - "drive/fake_file_system.h", - "drive/fake_free_disk_space_getter.cc", - "drive/fake_free_disk_space_getter.h", + "drive/chromeos/drive_test_util.cc", + "drive/chromeos/drive_test_util.h", + "drive/chromeos/dummy_file_system.cc", + "drive/chromeos/dummy_file_system.h", + "drive/chromeos/fake_file_system.cc", + "drive/chromeos/fake_file_system.h", + "drive/chromeos/fake_free_disk_space_getter.cc", + "drive/chromeos/fake_free_disk_space_getter.h", ] } ]
diff --git a/components/drive/BUILD.gn b/components/drive/BUILD.gn index 806e4023..8c7e8e8 100644 --- a/components/drive/BUILD.gn +++ b/components/drive/BUILD.gn
@@ -68,62 +68,61 @@ } source_set("drive_chromeos") { - # TODO(yawano): move these files under components/drive/chromeos. sources = [ - "change_list_loader.cc", - "change_list_loader.h", - "change_list_loader_observer.h", - "change_list_processor.cc", - "change_list_processor.h", - "directory_loader.cc", - "directory_loader.h", - "file_cache.cc", - "file_cache.h", - "file_system.cc", - "file_system.h", - "file_system/copy_operation.cc", - "file_system/copy_operation.h", - "file_system/create_directory_operation.cc", - "file_system/create_directory_operation.h", - "file_system/create_file_operation.cc", - "file_system/create_file_operation.h", - "file_system/download_operation.cc", - "file_system/download_operation.h", - "file_system/get_file_for_saving_operation.cc", - "file_system/get_file_for_saving_operation.h", - "file_system/move_operation.cc", - "file_system/move_operation.h", - "file_system/open_file_operation.cc", - "file_system/open_file_operation.h", - "file_system/operation_delegate.cc", - "file_system/operation_delegate.h", - "file_system/remove_operation.cc", - "file_system/remove_operation.h", - "file_system/search_operation.cc", - "file_system/search_operation.h", - "file_system/set_property_operation.cc", - "file_system/set_property_operation.h", - "file_system/touch_operation.cc", - "file_system/touch_operation.h", - "file_system/truncate_operation.cc", - "file_system/truncate_operation.h", - "file_system_interface.cc", - "file_system_interface.h", - "file_system_observer.h", - "remove_stale_cache_files.cc", - "remove_stale_cache_files.h", - "resource_metadata.cc", - "resource_metadata.h", - "search_metadata.cc", - "search_metadata.h", - "sync/entry_revert_performer.cc", - "sync/entry_revert_performer.h", - "sync/entry_update_performer.cc", - "sync/entry_update_performer.h", - "sync/remove_performer.cc", - "sync/remove_performer.h", - "sync_client.cc", - "sync_client.h", + "chromeos/change_list_loader.cc", + "chromeos/change_list_loader.h", + "chromeos/change_list_loader_observer.h", + "chromeos/change_list_processor.cc", + "chromeos/change_list_processor.h", + "chromeos/directory_loader.cc", + "chromeos/directory_loader.h", + "chromeos/file_cache.cc", + "chromeos/file_cache.h", + "chromeos/file_system.cc", + "chromeos/file_system.h", + "chromeos/file_system/copy_operation.cc", + "chromeos/file_system/copy_operation.h", + "chromeos/file_system/create_directory_operation.cc", + "chromeos/file_system/create_directory_operation.h", + "chromeos/file_system/create_file_operation.cc", + "chromeos/file_system/create_file_operation.h", + "chromeos/file_system/download_operation.cc", + "chromeos/file_system/download_operation.h", + "chromeos/file_system/get_file_for_saving_operation.cc", + "chromeos/file_system/get_file_for_saving_operation.h", + "chromeos/file_system/move_operation.cc", + "chromeos/file_system/move_operation.h", + "chromeos/file_system/open_file_operation.cc", + "chromeos/file_system/open_file_operation.h", + "chromeos/file_system/operation_delegate.cc", + "chromeos/file_system/operation_delegate.h", + "chromeos/file_system/remove_operation.cc", + "chromeos/file_system/remove_operation.h", + "chromeos/file_system/search_operation.cc", + "chromeos/file_system/search_operation.h", + "chromeos/file_system/set_property_operation.cc", + "chromeos/file_system/set_property_operation.h", + "chromeos/file_system/touch_operation.cc", + "chromeos/file_system/touch_operation.h", + "chromeos/file_system/truncate_operation.cc", + "chromeos/file_system/truncate_operation.h", + "chromeos/file_system_interface.cc", + "chromeos/file_system_interface.h", + "chromeos/file_system_observer.h", + "chromeos/remove_stale_cache_files.cc", + "chromeos/remove_stale_cache_files.h", + "chromeos/resource_metadata.cc", + "chromeos/resource_metadata.h", + "chromeos/search_metadata.cc", + "chromeos/search_metadata.h", + "chromeos/sync/entry_revert_performer.cc", + "chromeos/sync/entry_revert_performer.h", + "chromeos/sync/entry_update_performer.cc", + "chromeos/sync/entry_update_performer.h", + "chromeos/sync/remove_performer.cc", + "chromeos/sync/remove_performer.h", + "chromeos/sync_client.cc", + "chromeos/sync_client.h", ] deps = [ ":drive", @@ -168,14 +167,14 @@ source_set("test_support_chromeos") { testonly = true sources = [ - "drive_test_util.cc", - "drive_test_util.h", - "dummy_file_system.cc", - "dummy_file_system.h", - "fake_file_system.cc", - "fake_file_system.h", - "fake_free_disk_space_getter.cc", - "fake_free_disk_space_getter.h", + "chromeos/drive_test_util.cc", + "chromeos/drive_test_util.h", + "chromeos/dummy_file_system.cc", + "chromeos/dummy_file_system.h", + "chromeos/fake_file_system.cc", + "chromeos/fake_file_system.h", + "chromeos/fake_free_disk_space_getter.cc", + "chromeos/fake_free_disk_space_getter.h", ] deps = [ ":drive",
diff --git a/components/drive/change_list_loader_unittest.cc b/components/drive/change_list_loader_unittest.cc index 42a847f..c044132 100644 --- a/components/drive/change_list_loader_unittest.cc +++ b/components/drive/change_list_loader_unittest.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/drive/change_list_loader.h" +#include "components/drive/chromeos/change_list_loader.h" #include <stdint.h> @@ -14,14 +14,14 @@ #include "base/run_loop.h" #include "base/single_thread_task_runner.h" #include "base/thread_task_runner_handle.h" -#include "components/drive/change_list_loader_observer.h" -#include "components/drive/drive_test_util.h" +#include "components/drive/chromeos/change_list_loader_observer.h" +#include "components/drive/chromeos/drive_test_util.h" +#include "components/drive/chromeos/file_cache.h" +#include "components/drive/chromeos/resource_metadata.h" #include "components/drive/event_logger.h" -#include "components/drive/file_cache.h" #include "components/drive/file_change.h" #include "components/drive/file_system_core_util.h" #include "components/drive/job_scheduler.h" -#include "components/drive/resource_metadata.h" #include "components/drive/service/fake_drive_service.h" #include "components/drive/service/test_util.h" #include "components/prefs/testing_pref_service.h"
diff --git a/components/drive/change_list_processor_unittest.cc b/components/drive/change_list_processor_unittest.cc index e9662d2..8a5097a 100644 --- a/components/drive/change_list_processor_unittest.cc +++ b/components/drive/change_list_processor_unittest.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/drive/change_list_processor.h" +#include "components/drive/chromeos/change_list_processor.h" #include <stddef.h> #include <stdint.h> @@ -13,13 +13,13 @@ #include "base/single_thread_task_runner.h" #include "base/thread_task_runner_handle.h" #include "base/values.h" +#include "components/drive/chromeos/drive_test_util.h" +#include "components/drive/chromeos/fake_free_disk_space_getter.h" +#include "components/drive/chromeos/file_cache.h" +#include "components/drive/chromeos/resource_metadata.h" #include "components/drive/drive.pb.h" -#include "components/drive/drive_test_util.h" -#include "components/drive/fake_free_disk_space_getter.h" -#include "components/drive/file_cache.h" #include "components/drive/file_change.h" #include "components/drive/file_system_core_util.h" -#include "components/drive/resource_metadata.h" #include "content/public/test/test_browser_thread_bundle.h" #include "google_apis/drive/drive_api_parser.h" #include "google_apis/drive/test_util.h"
diff --git a/components/drive/change_list_loader.cc b/components/drive/chromeos/change_list_loader.cc similarity index 98% rename from components/drive/change_list_loader.cc rename to components/drive/chromeos/change_list_loader.cc index 02f2c74..780bc089 100644 --- a/components/drive/change_list_loader.cc +++ b/components/drive/chromeos/change_list_loader.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/drive/change_list_loader.h" +#include "components/drive/chromeos/change_list_loader.h" #include <stddef.h> @@ -18,12 +18,12 @@ #include "base/synchronization/cancellation_flag.h" #include "base/thread_task_runner_handle.h" #include "base/time/time.h" -#include "components/drive/change_list_loader_observer.h" -#include "components/drive/change_list_processor.h" +#include "components/drive/chromeos/change_list_loader_observer.h" +#include "components/drive/chromeos/change_list_processor.h" +#include "components/drive/chromeos/resource_metadata.h" #include "components/drive/event_logger.h" #include "components/drive/file_system_core_util.h" #include "components/drive/job_scheduler.h" -#include "components/drive/resource_metadata.h" #include "google_apis/drive/drive_api_parser.h" #include "url/gurl.h"
diff --git a/components/drive/change_list_loader.h b/components/drive/chromeos/change_list_loader.h similarity index 97% rename from components/drive/change_list_loader.h rename to components/drive/chromeos/change_list_loader.h index 04510a7..514cb3a3 100644 --- a/components/drive/change_list_loader.h +++ b/components/drive/chromeos/change_list_loader.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef COMPONENTS_DRIVE_CHANGE_LIST_LOADER_H_ -#define COMPONENTS_DRIVE_CHANGE_LIST_LOADER_H_ +#ifndef COMPONENTS_DRIVE_CHROMEOS_CHANGE_LIST_LOADER_H_ +#define COMPONENTS_DRIVE_CHROMEOS_CHANGE_LIST_LOADER_H_ #include <stdint.h> @@ -250,4 +250,4 @@ } // namespace internal } // namespace drive -#endif // COMPONENTS_DRIVE_CHANGE_LIST_LOADER_H_ +#endif // COMPONENTS_DRIVE_CHROMEOS_CHANGE_LIST_LOADER_H_
diff --git a/components/drive/change_list_loader_observer.h b/components/drive/chromeos/change_list_loader_observer.h similarity index 86% rename from components/drive/change_list_loader_observer.h rename to components/drive/chromeos/change_list_loader_observer.h index 0a9e81060..d795f891 100644 --- a/components/drive/change_list_loader_observer.h +++ b/components/drive/chromeos/change_list_loader_observer.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef COMPONENTS_DRIVE_CHANGE_LIST_LOADER_OBSERVER_H_ -#define COMPONENTS_DRIVE_CHANGE_LIST_LOADER_OBSERVER_H_ +#ifndef COMPONENTS_DRIVE_CHROMEOS_CHANGE_LIST_LOADER_OBSERVER_H_ +#define COMPONENTS_DRIVE_CHROMEOS_CHANGE_LIST_LOADER_OBSERVER_H_ namespace base { class FilePath; @@ -41,4 +41,4 @@ } // namespace internal } // namespace drive -#endif // COMPONENTS_DRIVE_CHANGE_LIST_LOADER_OBSERVER_H_ +#endif // COMPONENTS_DRIVE_CHROMEOS_CHANGE_LIST_LOADER_OBSERVER_H_
diff --git a/components/drive/change_list_processor.cc b/components/drive/chromeos/change_list_processor.cc similarity index 99% rename from components/drive/change_list_processor.cc rename to components/drive/chromeos/change_list_processor.cc index 26c7e5d..ca26e5b0 100644 --- a/components/drive/change_list_processor.cc +++ b/components/drive/chromeos/change_list_processor.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/drive/change_list_processor.h" +#include "components/drive/chromeos/change_list_processor.h" #include <stddef.h> #include <utility> @@ -10,12 +10,12 @@ #include "base/metrics/histogram.h" #include "base/strings/string_number_conversions.h" #include "base/synchronization/cancellation_flag.h" +#include "components/drive/chromeos/resource_metadata.h" #include "components/drive/drive.pb.h" #include "components/drive/drive_api_util.h" #include "components/drive/file_change.h" #include "components/drive/file_system_core_util.h" #include "components/drive/resource_entry_conversion.h" -#include "components/drive/resource_metadata.h" #include "google_apis/drive/drive_api_parser.h" namespace drive {
diff --git a/components/drive/change_list_processor.h b/components/drive/chromeos/change_list_processor.h similarity index 96% rename from components/drive/change_list_processor.h rename to components/drive/chromeos/change_list_processor.h index 3195721..75e4742 100644 --- a/components/drive/change_list_processor.h +++ b/components/drive/chromeos/change_list_processor.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef COMPONENTS_DRIVE_CHANGE_LIST_PROCESSOR_H_ -#define COMPONENTS_DRIVE_CHANGE_LIST_PROCESSOR_H_ +#ifndef COMPONENTS_DRIVE_CHROMEOS_CHANGE_LIST_PROCESSOR_H_ +#define COMPONENTS_DRIVE_CHROMEOS_CHANGE_LIST_PROCESSOR_H_ #include <stdint.h> @@ -170,4 +170,4 @@ } // namespace internal } // namespace drive -#endif // COMPONENTS_DRIVE_CHANGE_LIST_PROCESSOR_H_ +#endif // COMPONENTS_DRIVE_CHROMEOS_CHANGE_LIST_PROCESSOR_H_
diff --git a/components/drive/directory_loader.cc b/components/drive/chromeos/directory_loader.cc similarity index 98% rename from components/drive/directory_loader.cc rename to components/drive/chromeos/directory_loader.cc index ab42637..4c910db 100644 --- a/components/drive/directory_loader.cc +++ b/components/drive/chromeos/directory_loader.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/drive/directory_loader.h" +#include "components/drive/chromeos/directory_loader.h" #include <stddef.h> #include <utility> @@ -13,13 +13,13 @@ #include "base/metrics/histogram.h" #include "base/strings/string_number_conversions.h" #include "base/time/time.h" -#include "components/drive/change_list_loader.h" -#include "components/drive/change_list_loader_observer.h" -#include "components/drive/change_list_processor.h" +#include "components/drive/chromeos/change_list_loader.h" +#include "components/drive/chromeos/change_list_loader_observer.h" +#include "components/drive/chromeos/change_list_processor.h" +#include "components/drive/chromeos/resource_metadata.h" #include "components/drive/event_logger.h" #include "components/drive/file_system_core_util.h" #include "components/drive/job_scheduler.h" -#include "components/drive/resource_metadata.h" #include "google_apis/drive/drive_api_parser.h" #include "url/gurl.h"
diff --git a/components/drive/directory_loader.h b/components/drive/chromeos/directory_loader.h similarity index 95% rename from components/drive/directory_loader.h rename to components/drive/chromeos/directory_loader.h index afea5fc..63c7f97 100644 --- a/components/drive/directory_loader.h +++ b/components/drive/chromeos/directory_loader.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef COMPONENTS_DRIVE_DIRECTORY_LOADER_H_ -#define COMPONENTS_DRIVE_DIRECTORY_LOADER_H_ +#ifndef COMPONENTS_DRIVE_CHROMEOS_DIRECTORY_LOADER_H_ +#define COMPONENTS_DRIVE_CHROMEOS_DIRECTORY_LOADER_H_ #include <stdint.h> @@ -18,8 +18,8 @@ #include "base/memory/ref_counted.h" #include "base/observer_list.h" #include "base/threading/thread_checker.h" +#include "components/drive/chromeos/file_system_interface.h" #include "components/drive/file_errors.h" -#include "components/drive/file_system_interface.h" #include "google_apis/drive/drive_api_error_codes.h" #include "google_apis/drive/drive_common_callbacks.h" @@ -150,4 +150,4 @@ } // namespace internal } // namespace drive -#endif // COMPONENTS_DRIVE_DIRECTORY_LOADER_H_ +#endif // COMPONENTS_DRIVE_CHROMEOS_DIRECTORY_LOADER_H_
diff --git a/components/drive/drive_test_util.cc b/components/drive/chromeos/drive_test_util.cc similarity index 95% rename from components/drive/drive_test_util.cc rename to components/drive/chromeos/drive_test_util.cc index d80f4d9..0800830 100644 --- a/components/drive/drive_test_util.cc +++ b/components/drive/chromeos/drive_test_util.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/drive/drive_test_util.h" +#include "components/drive/chromeos/drive_test_util.h" #include "components/drive/drive.pb.h" #include "components/drive/drive_pref_names.h"
diff --git a/components/drive/drive_test_util.h b/components/drive/chromeos/drive_test_util.h similarity index 91% rename from components/drive/drive_test_util.h rename to components/drive/chromeos/drive_test_util.h index 88bb9b2..d448e6c 100644 --- a/components/drive/drive_test_util.h +++ b/components/drive/chromeos/drive_test_util.h
@@ -2,14 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef COMPONENTS_DRIVE_DRIVE_TEST_UTIL_H_ -#define COMPONENTS_DRIVE_DRIVE_TEST_UTIL_H_ +#ifndef COMPONENTS_DRIVE_CHROMEOS_DRIVE_TEST_UTIL_H_ +#define COMPONENTS_DRIVE_CHROMEOS_DRIVE_TEST_UTIL_H_ #include <stdint.h> #include <string> -#include "components/drive/file_cache.h" +#include "components/drive/chromeos/file_cache.h" #include "content/public/test/test_utils.h" #include "google_apis/drive/test_util.h" #include "net/base/completion_callback.h" @@ -83,4 +83,4 @@ } // namespace test_util } // namespace drive -#endif // COMPONENTS_DRIVE_DRIVE_TEST_UTIL_H_ +#endif // COMPONENTS_DRIVE_CHROMEOS_DRIVE_TEST_UTIL_H_
diff --git a/components/drive/dummy_file_system.cc b/components/drive/chromeos/dummy_file_system.cc similarity index 90% rename from components/drive/dummy_file_system.cc rename to components/drive/chromeos/dummy_file_system.cc index 7c92271..1d18223 100644 --- a/components/drive/dummy_file_system.cc +++ b/components/drive/chromeos/dummy_file_system.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/drive/dummy_file_system.h" +#include "components/drive/chromeos/dummy_file_system.h" namespace drive {
diff --git a/components/drive/dummy_file_system.h b/components/drive/chromeos/dummy_file_system.h similarity index 95% rename from components/drive/dummy_file_system.h rename to components/drive/chromeos/dummy_file_system.h index 9a13654b..f78dfca 100644 --- a/components/drive/dummy_file_system.h +++ b/components/drive/chromeos/dummy_file_system.h
@@ -2,12 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef COMPONENTS_DRIVE_DUMMY_FILE_SYSTEM_H_ -#define COMPONENTS_DRIVE_DUMMY_FILE_SYSTEM_H_ +#ifndef COMPONENTS_DRIVE_CHROMEOS_DUMMY_FILE_SYSTEM_H_ +#define COMPONENTS_DRIVE_CHROMEOS_DUMMY_FILE_SYSTEM_H_ #include <stdint.h> -#include "components/drive/file_system_interface.h" +#include "components/drive/chromeos/file_system_interface.h" namespace drive { @@ -110,4 +110,4 @@ } // namespace drive -#endif // COMPONENTS_DRIVE_DUMMY_FILE_SYSTEM_H_ +#endif // COMPONENTS_DRIVE_CHROMEOS_DUMMY_FILE_SYSTEM_H_
diff --git a/components/drive/fake_file_system.cc b/components/drive/chromeos/fake_file_system.cc similarity index 99% rename from components/drive/fake_file_system.cc rename to components/drive/chromeos/fake_file_system.cc index 6bc518a0..695c15d 100644 --- a/components/drive/fake_file_system.cc +++ b/components/drive/chromeos/fake_file_system.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/drive/fake_file_system.h" +#include "components/drive/chromeos/fake_file_system.h" #include <stddef.h> #include <utility>
diff --git a/components/drive/fake_file_system.h b/components/drive/chromeos/fake_file_system.h similarity index 97% rename from components/drive/fake_file_system.h rename to components/drive/chromeos/fake_file_system.h index 153b105..88d1aef24 100644 --- a/components/drive/fake_file_system.h +++ b/components/drive/chromeos/fake_file_system.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef COMPONENTS_DRIVE_FAKE_FILE_SYSTEM_H_ -#define COMPONENTS_DRIVE_FAKE_FILE_SYSTEM_H_ +#ifndef COMPONENTS_DRIVE_CHROMEOS_FAKE_FILE_SYSTEM_H_ +#define COMPONENTS_DRIVE_CHROMEOS_FAKE_FILE_SYSTEM_H_ #include <stdint.h> @@ -13,8 +13,8 @@ #include "base/callback_forward.h" #include "base/files/scoped_temp_dir.h" #include "base/macros.h" +#include "components/drive/chromeos/file_system_interface.h" #include "components/drive/file_errors.h" -#include "components/drive/file_system_interface.h" #include "google_apis/drive/drive_api_error_codes.h" namespace google_apis { @@ -196,4 +196,4 @@ } // namespace test_util } // namespace drive -#endif // COMPONENTS_DRIVE_FAKE_FILE_SYSTEM_H_ +#endif // COMPONENTS_DRIVE_CHROMEOS_FAKE_FILE_SYSTEM_H_
diff --git a/components/drive/fake_free_disk_space_getter.cc b/components/drive/chromeos/fake_free_disk_space_getter.cc similarity index 84% rename from components/drive/fake_free_disk_space_getter.cc rename to components/drive/chromeos/fake_free_disk_space_getter.cc index 14445175..3620c22 100644 --- a/components/drive/fake_free_disk_space_getter.cc +++ b/components/drive/chromeos/fake_free_disk_space_getter.cc
@@ -2,9 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/drive/fake_free_disk_space_getter.h" +#include "components/drive/chromeos/fake_free_disk_space_getter.h" -#include "components/drive/drive_test_util.h" +#include "components/drive/chromeos/drive_test_util.h" namespace drive {
diff --git a/components/drive/fake_free_disk_space_getter.h b/components/drive/chromeos/fake_free_disk_space_getter.h similarity index 82% rename from components/drive/fake_free_disk_space_getter.h rename to components/drive/chromeos/fake_free_disk_space_getter.h index 5d39ab9..3a71b3c8 100644 --- a/components/drive/fake_free_disk_space_getter.h +++ b/components/drive/chromeos/fake_free_disk_space_getter.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 COMPONENTS_DRIVE_FAKE_FREE_DISK_SPACE_GETTER_H_ -#define COMPONENTS_DRIVE_FAKE_FREE_DISK_SPACE_GETTER_H_ +#ifndef COMPONENTS_DRIVE_CHROMEOS_FAKE_FREE_DISK_SPACE_GETTER_H_ +#define COMPONENTS_DRIVE_CHROMEOS_FAKE_FREE_DISK_SPACE_GETTER_H_ #include <stdint.h> #include <list> #include "base/macros.h" -#include "components/drive/file_cache.h" +#include "components/drive/chromeos/file_cache.h" namespace drive { @@ -43,4 +43,4 @@ } // namespace drive -#endif // COMPONENTS_DRIVE_FAKE_FREE_DISK_SPACE_GETTER_H_ +#endif // COMPONENTS_DRIVE_CHROMEOS_FAKE_FREE_DISK_SPACE_GETTER_H_
diff --git a/components/drive/file_cache.cc b/components/drive/chromeos/file_cache.cc similarity index 99% rename from components/drive/file_cache.cc rename to components/drive/chromeos/file_cache.cc index 6faa09a0..f3df512 100644 --- a/components/drive/file_cache.cc +++ b/components/drive/chromeos/file_cache.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/drive/file_cache.h" +#include "components/drive/chromeos/file_cache.h" #include <queue> #include <vector>
diff --git a/components/drive/file_cache.h b/components/drive/chromeos/file_cache.h similarity index 97% rename from components/drive/file_cache.h rename to components/drive/chromeos/file_cache.h index b4340f7..2b9848e 100644 --- a/components/drive/file_cache.h +++ b/components/drive/chromeos/file_cache.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef COMPONENTS_DRIVE_FILE_CACHE_H_ -#define COMPONENTS_DRIVE_FILE_CACHE_H_ +#ifndef COMPONENTS_DRIVE_CHROMEOS_FILE_CACHE_H_ +#define COMPONENTS_DRIVE_CHROMEOS_FILE_CACHE_H_ #include <stddef.h> #include <stdint.h> @@ -229,4 +229,4 @@ } // namespace internal } // namespace drive -#endif // COMPONENTS_DRIVE_FILE_CACHE_H_ +#endif // COMPONENTS_DRIVE_CHROMEOS_FILE_CACHE_H_
diff --git a/components/drive/file_system.cc b/components/drive/chromeos/file_system.cc similarity index 96% rename from components/drive/file_system.cc rename to components/drive/chromeos/file_system.cc index ee2e370..4900c5f 100644 --- a/components/drive/file_system.cc +++ b/components/drive/chromeos/file_system.cc
@@ -2,38 +2,38 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/drive/file_system.h" +#include "components/drive/chromeos/file_system.h" #include <stddef.h> #include <utility> #include "base/bind.h" #include "base/files/file_util.h" -#include "components/drive/change_list_loader.h" -#include "components/drive/directory_loader.h" +#include "components/drive/chromeos/change_list_loader.h" +#include "components/drive/chromeos/directory_loader.h" +#include "components/drive/chromeos/file_cache.h" +#include "components/drive/chromeos/file_system/copy_operation.h" +#include "components/drive/chromeos/file_system/create_directory_operation.h" +#include "components/drive/chromeos/file_system/create_file_operation.h" +#include "components/drive/chromeos/file_system/download_operation.h" +#include "components/drive/chromeos/file_system/get_file_for_saving_operation.h" +#include "components/drive/chromeos/file_system/move_operation.h" +#include "components/drive/chromeos/file_system/open_file_operation.h" +#include "components/drive/chromeos/file_system/remove_operation.h" +#include "components/drive/chromeos/file_system/search_operation.h" +#include "components/drive/chromeos/file_system/set_property_operation.h" +#include "components/drive/chromeos/file_system/touch_operation.h" +#include "components/drive/chromeos/file_system/truncate_operation.h" +#include "components/drive/chromeos/file_system_observer.h" +#include "components/drive/chromeos/remove_stale_cache_files.h" +#include "components/drive/chromeos/search_metadata.h" +#include "components/drive/chromeos/sync_client.h" #include "components/drive/drive.pb.h" #include "components/drive/drive_pref_names.h" -#include "components/drive/file_cache.h" #include "components/drive/file_change.h" -#include "components/drive/file_system/copy_operation.h" -#include "components/drive/file_system/create_directory_operation.h" -#include "components/drive/file_system/create_file_operation.h" -#include "components/drive/file_system/download_operation.h" -#include "components/drive/file_system/get_file_for_saving_operation.h" -#include "components/drive/file_system/move_operation.h" -#include "components/drive/file_system/open_file_operation.h" -#include "components/drive/file_system/remove_operation.h" -#include "components/drive/file_system/search_operation.h" -#include "components/drive/file_system/set_property_operation.h" -#include "components/drive/file_system/touch_operation.h" -#include "components/drive/file_system/truncate_operation.h" #include "components/drive/file_system_core_util.h" -#include "components/drive/file_system_observer.h" #include "components/drive/job_scheduler.h" -#include "components/drive/remove_stale_cache_files.h" #include "components/drive/resource_entry_conversion.h" -#include "components/drive/search_metadata.h" -#include "components/drive/sync_client.h" #include "components/prefs/pref_service.h" #include "google_apis/drive/drive_api_parser.h"
diff --git a/components/drive/file_system.h b/components/drive/chromeos/file_system.h similarity index 97% rename from components/drive/file_system.h rename to components/drive/chromeos/file_system.h index c0fcda1..714950c 100644 --- a/components/drive/file_system.h +++ b/components/drive/chromeos/file_system.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef COMPONENTS_DRIVE_FILE_SYSTEM_H_ -#define COMPONENTS_DRIVE_FILE_SYSTEM_H_ +#ifndef COMPONENTS_DRIVE_CHROMEOS_FILE_SYSTEM_H_ +#define COMPONENTS_DRIVE_CHROMEOS_FILE_SYSTEM_H_ #include <stdint.h> @@ -15,9 +15,9 @@ #include "base/memory/weak_ptr.h" #include "base/observer_list.h" #include "base/threading/thread_checker.h" -#include "components/drive/change_list_loader_observer.h" -#include "components/drive/file_system/operation_delegate.h" -#include "components/drive/file_system_interface.h" +#include "components/drive/chromeos/change_list_loader_observer.h" +#include "components/drive/chromeos/file_system/operation_delegate.h" +#include "components/drive/chromeos/file_system_interface.h" #include "google_apis/drive/drive_api_error_codes.h" class PrefService; @@ -312,4 +312,4 @@ } // namespace drive -#endif // COMPONENTS_DRIVE_FILE_SYSTEM_H_ +#endif // COMPONENTS_DRIVE_CHROMEOS_FILE_SYSTEM_H_
diff --git a/components/drive/file_system/copy_operation.cc b/components/drive/chromeos/file_system/copy_operation.cc similarity index 98% rename from components/drive/file_system/copy_operation.cc rename to components/drive/chromeos/file_system/copy_operation.cc index 7d431af..de5e0b4 100644 --- a/components/drive/file_system/copy_operation.cc +++ b/components/drive/chromeos/file_system/copy_operation.cc
@@ -2,23 +2,23 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/drive/file_system/copy_operation.h" +#include "components/drive/chromeos/file_system/copy_operation.h" #include <stdint.h> #include <string> #include "base/task_runner_util.h" +#include "components/drive/chromeos/file_cache.h" +#include "components/drive/chromeos/file_system/create_file_operation.h" +#include "components/drive/chromeos/file_system/operation_delegate.h" +#include "components/drive/chromeos/resource_metadata.h" #include "components/drive/drive.pb.h" #include "components/drive/drive_api_util.h" -#include "components/drive/file_cache.h" #include "components/drive/file_change.h" -#include "components/drive/file_system/create_file_operation.h" -#include "components/drive/file_system/operation_delegate.h" #include "components/drive/file_system_core_util.h" #include "components/drive/job_scheduler.h" #include "components/drive/resource_entry_conversion.h" -#include "components/drive/resource_metadata.h" #include "google_apis/drive/drive_api_parser.h" namespace drive {
diff --git a/components/drive/file_system/copy_operation.h b/components/drive/chromeos/file_system/copy_operation.h similarity index 96% rename from components/drive/file_system/copy_operation.h rename to components/drive/chromeos/file_system/copy_operation.h index f9161fe2..c66926e 100644 --- a/components/drive/file_system/copy_operation.h +++ b/components/drive/chromeos/file_system/copy_operation.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef COMPONENTS_DRIVE_FILE_SYSTEM_COPY_OPERATION_H_ -#define COMPONENTS_DRIVE_FILE_SYSTEM_COPY_OPERATION_H_ +#ifndef COMPONENTS_DRIVE_CHROMEOS_FILE_SYSTEM_COPY_OPERATION_H_ +#define COMPONENTS_DRIVE_CHROMEOS_FILE_SYSTEM_COPY_OPERATION_H_ #include <memory> #include <string> @@ -178,4 +178,4 @@ } // namespace file_system } // namespace drive -#endif // COMPONENTS_DRIVE_FILE_SYSTEM_COPY_OPERATION_H_ +#endif // COMPONENTS_DRIVE_CHROMEOS_FILE_SYSTEM_COPY_OPERATION_H_
diff --git a/components/drive/file_system/create_directory_operation.cc b/components/drive/chromeos/file_system/create_directory_operation.cc similarity index 96% rename from components/drive/file_system/create_directory_operation.cc rename to components/drive/chromeos/file_system/create_directory_operation.cc index 664ae7f..512c5e1 100644 --- a/components/drive/file_system/create_directory_operation.cc +++ b/components/drive/chromeos/file_system/create_directory_operation.cc
@@ -2,16 +2,16 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/drive/file_system/create_directory_operation.h" +#include "components/drive/chromeos/file_system/create_directory_operation.h" #include <stddef.h> +#include "components/drive/chromeos/file_system/operation_delegate.h" +#include "components/drive/chromeos/resource_metadata.h" #include "components/drive/drive.pb.h" #include "components/drive/file_change.h" -#include "components/drive/file_system/operation_delegate.h" #include "components/drive/file_system_core_util.h" #include "components/drive/job_scheduler.h" -#include "components/drive/resource_metadata.h" namespace drive { namespace file_system {
diff --git a/components/drive/file_system/create_directory_operation.h b/components/drive/chromeos/file_system/create_directory_operation.h similarity index 91% rename from components/drive/file_system/create_directory_operation.h rename to components/drive/chromeos/file_system/create_directory_operation.h index f4a040d..4a17c2d 100644 --- a/components/drive/file_system/create_directory_operation.h +++ b/components/drive/chromeos/file_system/create_directory_operation.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef COMPONENTS_DRIVE_FILE_SYSTEM_CREATE_DIRECTORY_OPERATION_H_ -#define COMPONENTS_DRIVE_FILE_SYSTEM_CREATE_DIRECTORY_OPERATION_H_ +#ifndef COMPONENTS_DRIVE_CHROMEOS_FILE_SYSTEM_CREATE_DIRECTORY_OPERATION_H_ +#define COMPONENTS_DRIVE_CHROMEOS_FILE_SYSTEM_CREATE_DIRECTORY_OPERATION_H_ #include <set> @@ -76,4 +76,4 @@ } // namespace file_system } // namespace drive -#endif // COMPONENTS_DRIVE_FILE_SYSTEM_CREATE_DIRECTORY_OPERATION_H_ +#endif // COMPONENTS_DRIVE_CHROMEOS_FILE_SYSTEM_CREATE_DIRECTORY_OPERATION_H_
diff --git a/components/drive/file_system/create_file_operation.cc b/components/drive/chromeos/file_system/create_file_operation.cc similarity index 95% rename from components/drive/file_system/create_file_operation.cc rename to components/drive/chromeos/file_system/create_file_operation.cc index 19a238e3..4eb5fc5 100644 --- a/components/drive/file_system/create_file_operation.cc +++ b/components/drive/chromeos/file_system/create_file_operation.cc
@@ -2,16 +2,16 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/drive/file_system/create_file_operation.h" +#include "components/drive/chromeos/file_system/create_file_operation.h" #include <string> #include "base/files/file_util.h" +#include "components/drive/chromeos/file_system/operation_delegate.h" +#include "components/drive/chromeos/resource_metadata.h" #include "components/drive/drive.pb.h" #include "components/drive/file_change.h" -#include "components/drive/file_system/operation_delegate.h" #include "components/drive/job_scheduler.h" -#include "components/drive/resource_metadata.h" #include "net/base/mime_util.h" namespace drive {
diff --git a/components/drive/file_system/create_file_operation.h b/components/drive/chromeos/file_system/create_file_operation.h similarity index 91% rename from components/drive/file_system/create_file_operation.h rename to components/drive/chromeos/file_system/create_file_operation.h index 996b580..e761b7a 100644 --- a/components/drive/file_system/create_file_operation.h +++ b/components/drive/chromeos/file_system/create_file_operation.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef COMPONENTS_DRIVE_FILE_SYSTEM_CREATE_FILE_OPERATION_H_ -#define COMPONENTS_DRIVE_FILE_SYSTEM_CREATE_FILE_OPERATION_H_ +#ifndef COMPONENTS_DRIVE_CHROMEOS_FILE_SYSTEM_CREATE_FILE_OPERATION_H_ +#define COMPONENTS_DRIVE_CHROMEOS_FILE_SYSTEM_CREATE_FILE_OPERATION_H_ #include "base/macros.h" #include "base/memory/ref_counted.h" @@ -73,4 +73,4 @@ } // namespace file_system } // namespace drive -#endif // COMPONENTS_DRIVE_FILE_SYSTEM_CREATE_FILE_OPERATION_H_ +#endif // COMPONENTS_DRIVE_CHROMEOS_FILE_SYSTEM_CREATE_FILE_OPERATION_H_
diff --git a/components/drive/file_system/download_operation.cc b/components/drive/chromeos/file_system/download_operation.cc similarity index 98% rename from components/drive/file_system/download_operation.cc rename to components/drive/chromeos/file_system/download_operation.cc index 63dd89f8..ba8e57c 100644 --- a/components/drive/file_system/download_operation.cc +++ b/components/drive/chromeos/file_system/download_operation.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/drive/file_system/download_operation.h" +#include "components/drive/chromeos/file_system/download_operation.h" #include <stdint.h> @@ -15,14 +15,14 @@ #include "base/macros.h" #include "base/memory/ptr_util.h" #include "base/task_runner_util.h" +#include "components/drive/chromeos/file_cache.h" +#include "components/drive/chromeos/file_system/operation_delegate.h" +#include "components/drive/chromeos/resource_metadata.h" #include "components/drive/drive.pb.h" -#include "components/drive/file_cache.h" #include "components/drive/file_change.h" #include "components/drive/file_errors.h" -#include "components/drive/file_system/operation_delegate.h" #include "components/drive/file_system_core_util.h" #include "components/drive/job_scheduler.h" -#include "components/drive/resource_metadata.h" #include "google_apis/drive/drive_api_error_codes.h" namespace drive {
diff --git a/components/drive/file_system/download_operation.h b/components/drive/chromeos/file_system/download_operation.h similarity index 94% rename from components/drive/file_system/download_operation.h rename to components/drive/chromeos/file_system/download_operation.h index 3abd116..300b415 100644 --- a/components/drive/file_system/download_operation.h +++ b/components/drive/chromeos/file_system/download_operation.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 COMPONENTS_DRIVE_FILE_SYSTEM_DOWNLOAD_OPERATION_H_ -#define COMPONENTS_DRIVE_FILE_SYSTEM_DOWNLOAD_OPERATION_H_ +#ifndef COMPONENTS_DRIVE_CHROMEOS_FILE_SYSTEM_DOWNLOAD_OPERATION_H_ +#define COMPONENTS_DRIVE_CHROMEOS_FILE_SYSTEM_DOWNLOAD_OPERATION_H_ #include <memory> #include "base/macros.h" #include "base/threading/thread_checker.h" +#include "components/drive/chromeos/file_system_interface.h" #include "components/drive/file_errors.h" -#include "components/drive/file_system_interface.h" #include "components/drive/job_list.h" #include "google_apis/drive/drive_api_error_codes.h" @@ -131,4 +131,4 @@ } // namespace file_system } // namespace drive -#endif // COMPONENTS_DRIVE_FILE_SYSTEM_DOWNLOAD_OPERATION_H_ +#endif // COMPONENTS_DRIVE_CHROMEOS_FILE_SYSTEM_DOWNLOAD_OPERATION_H_
diff --git a/components/drive/file_system/get_file_for_saving_operation.cc b/components/drive/chromeos/file_system/get_file_for_saving_operation.cc similarity index 94% rename from components/drive/file_system/get_file_for_saving_operation.cc rename to components/drive/chromeos/file_system/get_file_for_saving_operation.cc index f38070c..c997ecb 100644 --- a/components/drive/file_system/get_file_for_saving_operation.cc +++ b/components/drive/chromeos/file_system/get_file_for_saving_operation.cc
@@ -2,18 +2,18 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/drive/file_system/get_file_for_saving_operation.h" +#include "components/drive/chromeos/file_system/get_file_for_saving_operation.h" #include <utility> #include "base/bind.h" #include "base/bind_helpers.h" #include "base/callback_helpers.h" +#include "components/drive/chromeos/file_cache.h" +#include "components/drive/chromeos/file_system/create_file_operation.h" +#include "components/drive/chromeos/file_system/download_operation.h" +#include "components/drive/chromeos/file_system/operation_delegate.h" #include "components/drive/event_logger.h" -#include "components/drive/file_cache.h" -#include "components/drive/file_system/create_file_operation.h" -#include "components/drive/file_system/download_operation.h" -#include "components/drive/file_system/operation_delegate.h" #include "components/drive/file_write_watcher.h" #include "components/drive/job_scheduler.h"
diff --git a/components/drive/file_system/get_file_for_saving_operation.h b/components/drive/chromeos/file_system/get_file_for_saving_operation.h similarity index 92% rename from components/drive/file_system/get_file_for_saving_operation.h rename to components/drive/chromeos/file_system/get_file_for_saving_operation.h index 6b013ca..ba461bd4 100644 --- a/components/drive/file_system/get_file_for_saving_operation.h +++ b/components/drive/chromeos/file_system/get_file_for_saving_operation.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef COMPONENTS_DRIVE_FILE_SYSTEM_GET_FILE_FOR_SAVING_OPERATION_H_ -#define COMPONENTS_DRIVE_FILE_SYSTEM_GET_FILE_FOR_SAVING_OPERATION_H_ +#ifndef COMPONENTS_DRIVE_CHROMEOS_FILE_SYSTEM_GET_FILE_FOR_SAVING_OPERATION_H_ +#define COMPONENTS_DRIVE_CHROMEOS_FILE_SYSTEM_GET_FILE_FOR_SAVING_OPERATION_H_ #include <memory> @@ -11,8 +11,8 @@ #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" #include "base/threading/thread_checker.h" +#include "components/drive/chromeos/file_system_interface.h" #include "components/drive/file_errors.h" -#include "components/drive/file_system_interface.h" namespace base { class FilePath; @@ -107,4 +107,4 @@ } // namespace file_system } // namespace drive -#endif // COMPONENTS_DRIVE_FILE_SYSTEM_GET_FILE_FOR_SAVING_OPERATION_H_ +#endif // COMPONENTS_DRIVE_CHROMEOS_FILE_SYSTEM_GET_FILE_FOR_SAVING_OPERATION_H_
diff --git a/components/drive/file_system/move_operation.cc b/components/drive/chromeos/file_system/move_operation.cc similarity index 95% rename from components/drive/file_system/move_operation.cc rename to components/drive/chromeos/file_system/move_operation.cc index ff1edd6..5a392077 100644 --- a/components/drive/file_system/move_operation.cc +++ b/components/drive/chromeos/file_system/move_operation.cc
@@ -2,14 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/drive/file_system/move_operation.h" +#include "components/drive/chromeos/file_system/move_operation.h" #include "base/sequenced_task_runner.h" +#include "components/drive/chromeos/file_system/operation_delegate.h" +#include "components/drive/chromeos/resource_metadata.h" #include "components/drive/drive.pb.h" #include "components/drive/file_change.h" -#include "components/drive/file_system/operation_delegate.h" #include "components/drive/job_scheduler.h" -#include "components/drive/resource_metadata.h" namespace drive { namespace file_system {
diff --git a/components/drive/file_system/move_operation.h b/components/drive/chromeos/file_system/move_operation.h similarity index 91% rename from components/drive/file_system/move_operation.h rename to components/drive/chromeos/file_system/move_operation.h index 0718525..123318e 100644 --- a/components/drive/file_system/move_operation.h +++ b/components/drive/chromeos/file_system/move_operation.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef COMPONENTS_DRIVE_FILE_SYSTEM_MOVE_OPERATION_H_ -#define COMPONENTS_DRIVE_FILE_SYSTEM_MOVE_OPERATION_H_ +#ifndef COMPONENTS_DRIVE_CHROMEOS_FILE_SYSTEM_MOVE_OPERATION_H_ +#define COMPONENTS_DRIVE_CHROMEOS_FILE_SYSTEM_MOVE_OPERATION_H_ #include <memory> #include <set> @@ -76,4 +76,4 @@ } // namespace file_system } // namespace drive -#endif // COMPONENTS_DRIVE_FILE_SYSTEM_MOVE_OPERATION_H_ +#endif // COMPONENTS_DRIVE_CHROMEOS_FILE_SYSTEM_MOVE_OPERATION_H_
diff --git a/components/drive/file_system/open_file_operation.cc b/components/drive/chromeos/file_system/open_file_operation.cc similarity index 94% rename from components/drive/file_system/open_file_operation.cc rename to components/drive/chromeos/file_system/open_file_operation.cc index 807e482..9c6e0fe 100644 --- a/components/drive/file_system/open_file_operation.cc +++ b/components/drive/chromeos/file_system/open_file_operation.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/drive/file_system/open_file_operation.h" +#include "components/drive/chromeos/file_system/open_file_operation.h" #include "base/bind.h" #include "base/bind_helpers.h" @@ -11,12 +11,12 @@ #include "base/logging.h" #include "base/task_runner_util.h" #include "base/thread_task_runner_handle.h" +#include "components/drive/chromeos/file_cache.h" +#include "components/drive/chromeos/file_system/create_file_operation.h" +#include "components/drive/chromeos/file_system/download_operation.h" +#include "components/drive/chromeos/file_system/operation_delegate.h" #include "components/drive/drive.pb.h" -#include "components/drive/file_cache.h" #include "components/drive/file_errors.h" -#include "components/drive/file_system/create_file_operation.h" -#include "components/drive/file_system/download_operation.h" -#include "components/drive/file_system/operation_delegate.h" #include "components/drive/job_scheduler.h" namespace drive {
diff --git a/components/drive/file_system/open_file_operation.h b/components/drive/chromeos/file_system/open_file_operation.h similarity index 92% rename from components/drive/file_system/open_file_operation.h rename to components/drive/chromeos/file_system/open_file_operation.h index 22bf439..a64ddd72 100644 --- a/components/drive/file_system/open_file_operation.h +++ b/components/drive/chromeos/file_system/open_file_operation.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef COMPONENTS_DRIVE_FILE_SYSTEM_OPEN_FILE_OPERATION_H_ -#define COMPONENTS_DRIVE_FILE_SYSTEM_OPEN_FILE_OPERATION_H_ +#ifndef COMPONENTS_DRIVE_CHROMEOS_FILE_SYSTEM_OPEN_FILE_OPERATION_H_ +#define COMPONENTS_DRIVE_CHROMEOS_FILE_SYSTEM_OPEN_FILE_OPERATION_H_ #include <map> #include <memory> @@ -12,8 +12,8 @@ #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" #include "base/threading/thread_checker.h" +#include "components/drive/chromeos/file_system_interface.h" #include "components/drive/file_errors.h" -#include "components/drive/file_system_interface.h" namespace base { class FilePath; @@ -106,4 +106,4 @@ } // namespace file_system } // namespace drive -#endif // COMPONENTS_DRIVE_FILE_SYSTEM_OPEN_FILE_OPERATION_H_ +#endif // COMPONENTS_DRIVE_CHROMEOS_FILE_SYSTEM_OPEN_FILE_OPERATION_H_
diff --git a/components/drive/file_system/operation_delegate.cc b/components/drive/chromeos/file_system/operation_delegate.cc similarity index 84% rename from components/drive/file_system/operation_delegate.cc rename to components/drive/chromeos/file_system/operation_delegate.cc index f6e2dad..0570e4a 100644 --- a/components/drive/file_system/operation_delegate.cc +++ b/components/drive/chromeos/file_system/operation_delegate.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/drive/file_system/operation_delegate.h" +#include "components/drive/chromeos/file_system/operation_delegate.h" namespace drive { namespace file_system {
diff --git a/components/drive/file_system/operation_delegate.h b/components/drive/chromeos/file_system/operation_delegate.h similarity index 90% rename from components/drive/file_system/operation_delegate.h rename to components/drive/chromeos/file_system/operation_delegate.h index ec1de18..ac6ec9a 100644 --- a/components/drive/file_system/operation_delegate.h +++ b/components/drive/chromeos/file_system/operation_delegate.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef COMPONENTS_DRIVE_FILE_SYSTEM_OPERATION_DELEGATE_H_ -#define COMPONENTS_DRIVE_FILE_SYSTEM_OPERATION_DELEGATE_H_ +#ifndef COMPONENTS_DRIVE_CHROMEOS_FILE_SYSTEM_OPERATION_DELEGATE_H_ +#define COMPONENTS_DRIVE_CHROMEOS_FILE_SYSTEM_OPERATION_DELEGATE_H_ #include "components/drive/file_errors.h" @@ -58,4 +58,4 @@ } // namespace file_system } // namespace drive -#endif // COMPONENTS_DRIVE_FILE_SYSTEM_OPERATION_DELEGATE_H_ +#endif // COMPONENTS_DRIVE_CHROMEOS_FILE_SYSTEM_OPERATION_DELEGATE_H_
diff --git a/components/drive/file_system/remove_operation.cc b/components/drive/chromeos/file_system/remove_operation.cc similarity index 93% rename from components/drive/file_system/remove_operation.cc rename to components/drive/chromeos/file_system/remove_operation.cc index 9cfc56c..813f11e0 100644 --- a/components/drive/file_system/remove_operation.cc +++ b/components/drive/chromeos/file_system/remove_operation.cc
@@ -2,16 +2,16 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/drive/file_system/remove_operation.h" +#include "components/drive/chromeos/file_system/remove_operation.h" #include "base/sequenced_task_runner.h" +#include "components/drive/chromeos/file_cache.h" +#include "components/drive/chromeos/file_system/operation_delegate.h" +#include "components/drive/chromeos/resource_metadata.h" #include "components/drive/drive.pb.h" -#include "components/drive/file_cache.h" #include "components/drive/file_change.h" -#include "components/drive/file_system/operation_delegate.h" #include "components/drive/file_system_core_util.h" #include "components/drive/job_scheduler.h" -#include "components/drive/resource_metadata.h" namespace drive { namespace file_system {
diff --git a/components/drive/file_system/remove_operation.h b/components/drive/chromeos/file_system/remove_operation.h similarity index 92% rename from components/drive/file_system/remove_operation.h rename to components/drive/chromeos/file_system/remove_operation.h index 93816be..17ce7f0b 100644 --- a/components/drive/file_system/remove_operation.h +++ b/components/drive/chromeos/file_system/remove_operation.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef COMPONENTS_DRIVE_FILE_SYSTEM_REMOVE_OPERATION_H_ -#define COMPONENTS_DRIVE_FILE_SYSTEM_REMOVE_OPERATION_H_ +#ifndef COMPONENTS_DRIVE_CHROMEOS_FILE_SYSTEM_REMOVE_OPERATION_H_ +#define COMPONENTS_DRIVE_CHROMEOS_FILE_SYSTEM_REMOVE_OPERATION_H_ #include <memory> @@ -75,4 +75,4 @@ } // namespace file_system } // namespace drive -#endif // COMPONENTS_DRIVE_FILE_SYSTEM_REMOVE_OPERATION_H_ +#endif // COMPONENTS_DRIVE_CHROMEOS_FILE_SYSTEM_REMOVE_OPERATION_H_
diff --git a/components/drive/file_system/search_operation.cc b/components/drive/chromeos/file_system/search_operation.cc similarity index 96% rename from components/drive/file_system/search_operation.cc rename to components/drive/chromeos/file_system/search_operation.cc index 0b6d39e..7bcfb96 100644 --- a/components/drive/file_system/search_operation.cc +++ b/components/drive/chromeos/file_system/search_operation.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/drive/file_system/search_operation.h" +#include "components/drive/chromeos/file_system/search_operation.h" #include <stddef.h> #include <string> @@ -13,12 +13,12 @@ #include "base/bind_helpers.h" #include "base/callback.h" #include "base/task_runner_util.h" -#include "components/drive/change_list_loader.h" +#include "components/drive/chromeos/change_list_loader.h" +#include "components/drive/chromeos/resource_metadata.h" #include "components/drive/drive_api_util.h" #include "components/drive/file_system_core_util.h" #include "components/drive/job_scheduler.h" #include "components/drive/resource_entry_conversion.h" -#include "components/drive/resource_metadata.h" #include "google_apis/drive/drive_api_parser.h" #include "url/gurl.h"
diff --git a/components/drive/file_system/search_operation.h b/components/drive/chromeos/file_system/search_operation.h similarity index 90% rename from components/drive/file_system/search_operation.h rename to components/drive/chromeos/file_system/search_operation.h index 2a11100..7193f6d 100644 --- a/components/drive/file_system/search_operation.h +++ b/components/drive/chromeos/file_system/search_operation.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef COMPONENTS_DRIVE_FILE_SYSTEM_SEARCH_OPERATION_H_ -#define COMPONENTS_DRIVE_FILE_SYSTEM_SEARCH_OPERATION_H_ +#ifndef COMPONENTS_DRIVE_CHROMEOS_FILE_SYSTEM_SEARCH_OPERATION_H_ +#define COMPONENTS_DRIVE_CHROMEOS_FILE_SYSTEM_SEARCH_OPERATION_H_ #include <memory> @@ -11,8 +11,8 @@ #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" #include "base/threading/thread_checker.h" +#include "components/drive/chromeos/file_system_interface.h" #include "components/drive/file_errors.h" -#include "components/drive/file_system_interface.h" #include "google_apis/drive/drive_api_error_codes.h" namespace base { @@ -83,4 +83,4 @@ } // namespace file_system } // namespace drive -#endif // COMPONENTS_DRIVE_FILE_SYSTEM_SEARCH_OPERATION_H_ +#endif // COMPONENTS_DRIVE_CHROMEOS_FILE_SYSTEM_SEARCH_OPERATION_H_
diff --git a/components/drive/file_system/set_property_operation.cc b/components/drive/chromeos/file_system/set_property_operation.cc similarity index 95% rename from components/drive/file_system/set_property_operation.cc rename to components/drive/chromeos/file_system/set_property_operation.cc index 0620f2e..72387b9 100644 --- a/components/drive/file_system/set_property_operation.cc +++ b/components/drive/chromeos/file_system/set_property_operation.cc
@@ -2,16 +2,16 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/drive/file_system/set_property_operation.h" +#include "components/drive/chromeos/file_system/set_property_operation.h" #include "base/bind.h" #include "base/files/file_path.h" #include "base/sequenced_task_runner.h" +#include "components/drive/chromeos/file_system/operation_delegate.h" +#include "components/drive/chromeos/resource_metadata.h" #include "components/drive/drive.pb.h" #include "components/drive/file_errors.h" -#include "components/drive/file_system/operation_delegate.h" #include "components/drive/job_scheduler.h" -#include "components/drive/resource_metadata.h" namespace drive { namespace file_system {
diff --git a/components/drive/file_system/set_property_operation.h b/components/drive/chromeos/file_system/set_property_operation.h similarity index 90% rename from components/drive/file_system/set_property_operation.h rename to components/drive/chromeos/file_system/set_property_operation.h index 2e044417..41fd8fd 100644 --- a/components/drive/file_system/set_property_operation.h +++ b/components/drive/chromeos/file_system/set_property_operation.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef COMPONENTS_DRIVE_FILE_SYSTEM_SET_PROPERTY_OPERATION_H_ -#define COMPONENTS_DRIVE_FILE_SYSTEM_SET_PROPERTY_OPERATION_H_ +#ifndef COMPONENTS_DRIVE_CHROMEOS_FILE_SYSTEM_SET_PROPERTY_OPERATION_H_ +#define COMPONENTS_DRIVE_CHROMEOS_FILE_SYSTEM_SET_PROPERTY_OPERATION_H_ #include <string> @@ -67,4 +67,4 @@ } // namespace file_system } // namespace drive -#endif // COMPONENTS_DRIVE_FILE_SYSTEM_SET_PROPERTY_OPERATION_H_ +#endif // COMPONENTS_DRIVE_CHROMEOS_FILE_SYSTEM_SET_PROPERTY_OPERATION_H_
diff --git a/components/drive/file_system/touch_operation.cc b/components/drive/chromeos/file_system/touch_operation.cc similarity index 94% rename from components/drive/file_system/touch_operation.cc rename to components/drive/chromeos/file_system/touch_operation.cc index 63272d7..685fff7 100644 --- a/components/drive/file_system/touch_operation.cc +++ b/components/drive/chromeos/file_system/touch_operation.cc
@@ -2,17 +2,17 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/drive/file_system/touch_operation.h" +#include "components/drive/chromeos/file_system/touch_operation.h" #include "base/bind.h" #include "base/files/file_path.h" #include "base/sequenced_task_runner.h" #include "base/time/time.h" +#include "components/drive/chromeos/file_system/operation_delegate.h" +#include "components/drive/chromeos/resource_metadata.h" #include "components/drive/file_change.h" #include "components/drive/file_errors.h" -#include "components/drive/file_system/operation_delegate.h" #include "components/drive/job_scheduler.h" -#include "components/drive/resource_metadata.h" namespace drive { namespace file_system {
diff --git a/components/drive/file_system/touch_operation.h b/components/drive/chromeos/file_system/touch_operation.h similarity index 91% rename from components/drive/file_system/touch_operation.h rename to components/drive/chromeos/file_system/touch_operation.h index 46c53e7..c67bf760 100644 --- a/components/drive/file_system/touch_operation.h +++ b/components/drive/chromeos/file_system/touch_operation.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef COMPONENTS_DRIVE_FILE_SYSTEM_TOUCH_OPERATION_H_ -#define COMPONENTS_DRIVE_FILE_SYSTEM_TOUCH_OPERATION_H_ +#ifndef COMPONENTS_DRIVE_CHROMEOS_FILE_SYSTEM_TOUCH_OPERATION_H_ +#define COMPONENTS_DRIVE_CHROMEOS_FILE_SYSTEM_TOUCH_OPERATION_H_ #include "base/macros.h" #include "base/memory/ref_counted.h" @@ -65,4 +65,4 @@ } // namespace file_system } // namespace drive -#endif // COMPONENTS_DRIVE_FILE_SYSTEM_TOUCH_OPERATION_H_ +#endif // COMPONENTS_DRIVE_CHROMEOS_FILE_SYSTEM_TOUCH_OPERATION_H_
diff --git a/components/drive/file_system/truncate_operation.cc b/components/drive/chromeos/file_system/truncate_operation.cc similarity index 94% rename from components/drive/file_system/truncate_operation.cc rename to components/drive/chromeos/file_system/truncate_operation.cc index 6bee5b7..942887a 100644 --- a/components/drive/file_system/truncate_operation.cc +++ b/components/drive/chromeos/file_system/truncate_operation.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/drive/file_system/truncate_operation.h" +#include "components/drive/chromeos/file_system/truncate_operation.h" #include "base/bind.h" #include "base/callback_helpers.h" @@ -12,11 +12,11 @@ #include "base/sequenced_task_runner.h" #include "base/task_runner_util.h" #include "base/thread_task_runner_handle.h" +#include "components/drive/chromeos/file_cache.h" +#include "components/drive/chromeos/file_system/download_operation.h" +#include "components/drive/chromeos/file_system/operation_delegate.h" #include "components/drive/drive.pb.h" -#include "components/drive/file_cache.h" #include "components/drive/file_errors.h" -#include "components/drive/file_system/download_operation.h" -#include "components/drive/file_system/operation_delegate.h" #include "components/drive/job_scheduler.h" namespace drive {
diff --git a/components/drive/file_system/truncate_operation.h b/components/drive/chromeos/file_system/truncate_operation.h similarity index 92% rename from components/drive/file_system/truncate_operation.h rename to components/drive/chromeos/file_system/truncate_operation.h index d2e46ea..ee60310 100644 --- a/components/drive/file_system/truncate_operation.h +++ b/components/drive/chromeos/file_system/truncate_operation.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef COMPONENTS_DRIVE_FILE_SYSTEM_TRUNCATE_OPERATION_H_ -#define COMPONENTS_DRIVE_FILE_SYSTEM_TRUNCATE_OPERATION_H_ +#ifndef COMPONENTS_DRIVE_CHROMEOS_FILE_SYSTEM_TRUNCATE_OPERATION_H_ +#define COMPONENTS_DRIVE_CHROMEOS_FILE_SYSTEM_TRUNCATE_OPERATION_H_ #include <stdint.h> @@ -89,4 +89,4 @@ } // namespace file_system } // namespace drive -#endif // COMPONENTS_DRIVE_FILE_SYSTEM_TRUNCATE_OPERATION_H_ +#endif // COMPONENTS_DRIVE_CHROMEOS_FILE_SYSTEM_TRUNCATE_OPERATION_H_
diff --git a/components/drive/file_system_interface.cc b/components/drive/chromeos/file_system_interface.cc similarity index 90% rename from components/drive/file_system_interface.cc rename to components/drive/chromeos/file_system_interface.cc index e7d86fe6..242538a 100644 --- a/components/drive/file_system_interface.cc +++ b/components/drive/chromeos/file_system_interface.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/drive/file_system_interface.h" +#include "components/drive/chromeos/file_system_interface.h" namespace drive {
diff --git a/components/drive/file_system_interface.h b/components/drive/chromeos/file_system_interface.h similarity index 98% rename from components/drive/file_system_interface.h rename to components/drive/chromeos/file_system_interface.h index 5fe8f69..92ea362 100644 --- a/components/drive/file_system_interface.h +++ b/components/drive/chromeos/file_system_interface.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef COMPONENTS_DRIVE_FILE_SYSTEM_INTERFACE_H_ -#define COMPONENTS_DRIVE_FILE_SYSTEM_INTERFACE_H_ +#ifndef COMPONENTS_DRIVE_CHROMEOS_FILE_SYSTEM_INTERFACE_H_ +#define COMPONENTS_DRIVE_CHROMEOS_FILE_SYSTEM_INTERFACE_H_ #include <stdint.h> @@ -11,9 +11,9 @@ #include <string> #include <vector> +#include "components/drive/chromeos/resource_metadata.h" #include "components/drive/drive.pb.h" #include "components/drive/file_system_metadata.h" -#include "components/drive/resource_metadata.h" #include "google_apis/drive/base_requests.h" #include "google_apis/drive/drive_api_requests.h" @@ -476,4 +476,4 @@ } // namespace drive -#endif // COMPONENTS_DRIVE_FILE_SYSTEM_INTERFACE_H_ +#endif // COMPONENTS_DRIVE_CHROMEOS_FILE_SYSTEM_INTERFACE_H_
diff --git a/components/drive/file_system_observer.h b/components/drive/chromeos/file_system_observer.h similarity index 81% rename from components/drive/file_system_observer.h rename to components/drive/chromeos/file_system_observer.h index cf0d141..7b9379f 100644 --- a/components/drive/file_system_observer.h +++ b/components/drive/chromeos/file_system_observer.h
@@ -2,11 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef COMPONENTS_DRIVE_FILE_SYSTEM_OBSERVER_H_ -#define COMPONENTS_DRIVE_FILE_SYSTEM_OBSERVER_H_ +#ifndef COMPONENTS_DRIVE_CHROMEOS_FILE_SYSTEM_OBSERVER_H_ +#define COMPONENTS_DRIVE_CHROMEOS_FILE_SYSTEM_OBSERVER_H_ +#include "components/drive/chromeos/file_system/operation_delegate.h" #include "components/drive/file_errors.h" -#include "components/drive/file_system/operation_delegate.h" namespace base { class FilePath; @@ -38,4 +38,4 @@ } // namespace drive -#endif // COMPONENTS_DRIVE_FILE_SYSTEM_OBSERVER_H_ +#endif // COMPONENTS_DRIVE_CHROMEOS_FILE_SYSTEM_OBSERVER_H_
diff --git a/components/drive/remove_stale_cache_files.cc b/components/drive/chromeos/remove_stale_cache_files.cc similarity index 85% rename from components/drive/remove_stale_cache_files.cc rename to components/drive/chromeos/remove_stale_cache_files.cc index efe14e8..082d7a2 100644 --- a/components/drive/remove_stale_cache_files.cc +++ b/components/drive/chromeos/remove_stale_cache_files.cc
@@ -2,12 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/drive/remove_stale_cache_files.h" +#include "components/drive/chromeos/remove_stale_cache_files.h" #include "base/logging.h" +#include "components/drive/chromeos/file_cache.h" +#include "components/drive/chromeos/resource_metadata.h" #include "components/drive/drive.pb.h" -#include "components/drive/file_cache.h" -#include "components/drive/resource_metadata.h" namespace drive { namespace internal {
diff --git a/components/drive/remove_stale_cache_files.h b/components/drive/chromeos/remove_stale_cache_files.h similarity index 74% rename from components/drive/remove_stale_cache_files.h rename to components/drive/chromeos/remove_stale_cache_files.h index d3e922c..c7cf9bb 100644 --- a/components/drive/remove_stale_cache_files.h +++ b/components/drive/chromeos/remove_stale_cache_files.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef COMPONENTS_DRIVE_REMOVE_STALE_CACHE_FILES_H_ -#define COMPONENTS_DRIVE_REMOVE_STALE_CACHE_FILES_H_ +#ifndef COMPONENTS_DRIVE_CHROMEOS_REMOVE_STALE_CACHE_FILES_H_ +#define COMPONENTS_DRIVE_CHROMEOS_REMOVE_STALE_CACHE_FILES_H_ namespace drive{ namespace internal { @@ -19,4 +19,4 @@ } // namespace internal } // namespace drive -#endif // COMPONENTS_DRIVE_REMOVE_STALE_CACHE_FILES_H_ +#endif // COMPONENTS_DRIVE_CHROMEOS_REMOVE_STALE_CACHE_FILES_H_
diff --git a/components/drive/resource_metadata.cc b/components/drive/chromeos/resource_metadata.cc similarity index 99% rename from components/drive/resource_metadata.cc rename to components/drive/chromeos/resource_metadata.cc index f295b52b..4d1011a 100644 --- a/components/drive/resource_metadata.cc +++ b/components/drive/chromeos/resource_metadata.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/drive/resource_metadata.h" +#include "components/drive/chromeos/resource_metadata.h" #include <limits.h> #include <stddef.h> @@ -15,8 +15,8 @@ #include "base/strings/string_number_conversions.h" #include "base/strings/stringprintf.h" #include "base/sys_info.h" +#include "components/drive/chromeos/file_cache.h" #include "components/drive/drive.pb.h" -#include "components/drive/file_cache.h" #include "components/drive/file_system_core_util.h" #include "components/drive/resource_metadata_storage.h"
diff --git a/components/drive/resource_metadata.h b/components/drive/chromeos/resource_metadata.h similarity index 96% rename from components/drive/resource_metadata.h rename to components/drive/chromeos/resource_metadata.h index deeb13d..e2aa0dd 100644 --- a/components/drive/resource_metadata.h +++ b/components/drive/chromeos/resource_metadata.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef COMPONENTS_DRIVE_RESOURCE_METADATA_H_ -#define COMPONENTS_DRIVE_RESOURCE_METADATA_H_ +#ifndef COMPONENTS_DRIVE_CHROMEOS_RESOURCE_METADATA_H_ +#define COMPONENTS_DRIVE_CHROMEOS_RESOURCE_METADATA_H_ #include <stdint.h> @@ -146,4 +146,4 @@ } // namespace internal } // namespace drive -#endif // COMPONENTS_DRIVE_RESOURCE_METADATA_H_ +#endif // COMPONENTS_DRIVE_CHROMEOS_RESOURCE_METADATA_H_
diff --git a/components/drive/search_metadata.cc b/components/drive/chromeos/search_metadata.cc similarity index 99% rename from components/drive/search_metadata.cc rename to components/drive/chromeos/search_metadata.cc index 99d3cabf..9471e6c6 100644 --- a/components/drive/search_metadata.cc +++ b/components/drive/chromeos/search_metadata.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/drive/search_metadata.h" +#include "components/drive/chromeos/search_metadata.h" #include <algorithm> #include <queue>
diff --git a/components/drive/search_metadata.h b/components/drive/chromeos/search_metadata.h similarity index 92% rename from components/drive/search_metadata.h rename to components/drive/chromeos/search_metadata.h index e298daae..3a0a6cc 100644 --- a/components/drive/search_metadata.h +++ b/components/drive/chromeos/search_metadata.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 COMPONENTS_DRIVE_SEARCH_METADATA_H_ -#define COMPONENTS_DRIVE_SEARCH_METADATA_H_ +#ifndef COMPONENTS_DRIVE_CHROMEOS_SEARCH_METADATA_H_ +#define COMPONENTS_DRIVE_CHROMEOS_SEARCH_METADATA_H_ #include <stddef.h> #include <string> #include "base/memory/scoped_vector.h" -#include "components/drive/file_system_interface.h" +#include "components/drive/chromeos/file_system_interface.h" namespace base { namespace i18n { @@ -68,4 +68,4 @@ } // namespace internal } // namespace drive -#endif // COMPONENTS_DRIVE_SEARCH_METADATA_H_ +#endif // COMPONENTS_DRIVE_CHROMEOS_SEARCH_METADATA_H_
diff --git a/components/drive/sync/entry_revert_performer.cc b/components/drive/chromeos/sync/entry_revert_performer.cc similarity index 95% rename from components/drive/sync/entry_revert_performer.cc rename to components/drive/chromeos/sync/entry_revert_performer.cc index 4fa1fdb..a5cb7b1 100644 --- a/components/drive/sync/entry_revert_performer.cc +++ b/components/drive/chromeos/sync/entry_revert_performer.cc
@@ -2,16 +2,16 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/drive/sync/entry_revert_performer.h" +#include "components/drive/chromeos/sync/entry_revert_performer.h" -#include "components/drive/change_list_processor.h" +#include "components/drive/chromeos/change_list_processor.h" +#include "components/drive/chromeos/file_system/operation_delegate.h" +#include "components/drive/chromeos/resource_metadata.h" #include "components/drive/drive.pb.h" #include "components/drive/drive_api_util.h" #include "components/drive/file_change.h" -#include "components/drive/file_system/operation_delegate.h" #include "components/drive/job_scheduler.h" #include "components/drive/resource_entry_conversion.h" -#include "components/drive/resource_metadata.h" #include "google_apis/drive/drive_api_parser.h" namespace drive {
diff --git a/components/drive/sync/entry_revert_performer.h b/components/drive/chromeos/sync/entry_revert_performer.h similarity index 93% rename from components/drive/sync/entry_revert_performer.h rename to components/drive/chromeos/sync/entry_revert_performer.h index 34c9964b..6b9d9c32 100644 --- a/components/drive/sync/entry_revert_performer.h +++ b/components/drive/chromeos/sync/entry_revert_performer.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef COMPONENTS_DRIVE_SYNC_ENTRY_REVERT_PERFORMER_H_ -#define COMPONENTS_DRIVE_SYNC_ENTRY_REVERT_PERFORMER_H_ +#ifndef COMPONENTS_DRIVE_CHROMEOS_SYNC_ENTRY_REVERT_PERFORMER_H_ +#define COMPONENTS_DRIVE_CHROMEOS_SYNC_ENTRY_REVERT_PERFORMER_H_ #include <memory> #include <set> @@ -90,4 +90,4 @@ } // namespace internal } // namespace drive -#endif // COMPONENTS_DRIVE_SYNC_ENTRY_REVERT_PERFORMER_H_ +#endif // COMPONENTS_DRIVE_CHROMEOS_SYNC_ENTRY_REVERT_PERFORMER_H_
diff --git a/components/drive/sync/entry_update_performer.cc b/components/drive/chromeos/sync/entry_update_performer.cc similarity index 97% rename from components/drive/sync/entry_update_performer.cc rename to components/drive/chromeos/sync/entry_update_performer.cc index 133cc8d..b0855c3 100644 --- a/components/drive/sync/entry_update_performer.cc +++ b/components/drive/chromeos/sync/entry_update_performer.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/drive/sync/entry_update_performer.h" +#include "components/drive/chromeos/sync/entry_update_performer.h" #include <stdint.h> @@ -10,16 +10,16 @@ #include "base/callback_helpers.h" #include "base/files/file_util.h" -#include "components/drive/change_list_loader.h" +#include "components/drive/chromeos/change_list_loader.h" +#include "components/drive/chromeos/file_cache.h" +#include "components/drive/chromeos/file_system/operation_delegate.h" +#include "components/drive/chromeos/resource_metadata.h" +#include "components/drive/chromeos/sync/entry_revert_performer.h" +#include "components/drive/chromeos/sync/remove_performer.h" #include "components/drive/drive.pb.h" -#include "components/drive/file_cache.h" #include "components/drive/file_change.h" -#include "components/drive/file_system/operation_delegate.h" #include "components/drive/file_system_core_util.h" #include "components/drive/job_scheduler.h" -#include "components/drive/resource_metadata.h" -#include "components/drive/sync/entry_revert_performer.h" -#include "components/drive/sync/remove_performer.h" #include "google_apis/drive/drive_api_parser.h" namespace drive {
diff --git a/components/drive/sync/entry_update_performer.h b/components/drive/chromeos/sync/entry_update_performer.h similarity index 94% rename from components/drive/sync/entry_update_performer.h rename to components/drive/chromeos/sync/entry_update_performer.h index e52a34e7..96bc4d79 100644 --- a/components/drive/sync/entry_update_performer.h +++ b/components/drive/chromeos/sync/entry_update_performer.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef COMPONENTS_DRIVE_SYNC_ENTRY_UPDATE_PERFORMER_H_ -#define COMPONENTS_DRIVE_SYNC_ENTRY_UPDATE_PERFORMER_H_ +#ifndef COMPONENTS_DRIVE_CHROMEOS_SYNC_ENTRY_UPDATE_PERFORMER_H_ +#define COMPONENTS_DRIVE_CHROMEOS_SYNC_ENTRY_UPDATE_PERFORMER_H_ #include <memory> @@ -104,4 +104,4 @@ } // namespace internal } // namespace drive -#endif // COMPONENTS_DRIVE_SYNC_ENTRY_UPDATE_PERFORMER_H_ +#endif // COMPONENTS_DRIVE_CHROMEOS_SYNC_ENTRY_UPDATE_PERFORMER_H_
diff --git a/components/drive/sync/remove_performer.cc b/components/drive/chromeos/sync/remove_performer.cc similarity index 96% rename from components/drive/sync/remove_performer.cc rename to components/drive/chromeos/sync/remove_performer.cc index a28435d1..fa59c4ab 100644 --- a/components/drive/sync/remove_performer.cc +++ b/components/drive/chromeos/sync/remove_performer.cc
@@ -2,17 +2,17 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/drive/sync/remove_performer.h" +#include "components/drive/chromeos/sync/remove_performer.h" #include "base/sequenced_task_runner.h" +#include "components/drive/chromeos/file_system/operation_delegate.h" +#include "components/drive/chromeos/resource_metadata.h" +#include "components/drive/chromeos/sync/entry_revert_performer.h" #include "components/drive/drive.pb.h" #include "components/drive/drive_api_util.h" -#include "components/drive/file_system/operation_delegate.h" #include "components/drive/file_system_core_util.h" #include "components/drive/job_scheduler.h" #include "components/drive/resource_entry_conversion.h" -#include "components/drive/resource_metadata.h" -#include "components/drive/sync/entry_revert_performer.h" #include "google_apis/drive/drive_api_parser.h" namespace drive {
diff --git a/components/drive/sync/remove_performer.h b/components/drive/chromeos/sync/remove_performer.h similarity index 95% rename from components/drive/sync/remove_performer.h rename to components/drive/chromeos/sync/remove_performer.h index 616f2c1..4e1bf91 100644 --- a/components/drive/sync/remove_performer.h +++ b/components/drive/chromeos/sync/remove_performer.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef COMPONENTS_DRIVE_SYNC_REMOVE_PERFORMER_H_ -#define COMPONENTS_DRIVE_SYNC_REMOVE_PERFORMER_H_ +#ifndef COMPONENTS_DRIVE_CHROMEOS_SYNC_REMOVE_PERFORMER_H_ +#define COMPONENTS_DRIVE_CHROMEOS_SYNC_REMOVE_PERFORMER_H_ #include <memory> @@ -112,4 +112,4 @@ } // namespace internal } // namespace drive -#endif // COMPONENTS_DRIVE_SYNC_REMOVE_PERFORMER_H_ +#endif // COMPONENTS_DRIVE_CHROMEOS_SYNC_REMOVE_PERFORMER_H_
diff --git a/components/drive/sync_client.cc b/components/drive/chromeos/sync_client.cc similarity index 97% rename from components/drive/sync_client.cc rename to components/drive/chromeos/sync_client.cc index ef2d9c1..00d55ad4 100644 --- a/components/drive/sync_client.cc +++ b/components/drive/chromeos/sync_client.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/drive/sync_client.h" +#include "components/drive/chromeos/sync_client.h" #include <stddef.h> @@ -10,13 +10,13 @@ #include "base/bind.h" #include "base/thread_task_runner_handle.h" +#include "components/drive/chromeos/file_cache.h" +#include "components/drive/chromeos/file_system/download_operation.h" +#include "components/drive/chromeos/file_system/operation_delegate.h" +#include "components/drive/chromeos/sync/entry_update_performer.h" #include "components/drive/drive.pb.h" -#include "components/drive/file_cache.h" -#include "components/drive/file_system/download_operation.h" -#include "components/drive/file_system/operation_delegate.h" #include "components/drive/file_system_core_util.h" #include "components/drive/job_scheduler.h" -#include "components/drive/sync/entry_update_performer.h" #include "google_apis/drive/task_util.h" namespace drive {
diff --git a/components/drive/sync_client.h b/components/drive/chromeos/sync_client.h similarity index 96% rename from components/drive/sync_client.h rename to components/drive/chromeos/sync_client.h index ad9926ce8..e562d0c 100644 --- a/components/drive/sync_client.h +++ b/components/drive/chromeos/sync_client.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef COMPONENTS_DRIVE_SYNC_CLIENT_H_ -#define COMPONENTS_DRIVE_SYNC_CLIENT_H_ +#ifndef COMPONENTS_DRIVE_CHROMEOS_SYNC_CLIENT_H_ +#define COMPONENTS_DRIVE_CHROMEOS_SYNC_CLIENT_H_ #include <map> #include <memory> @@ -15,9 +15,9 @@ #include "base/memory/weak_ptr.h" #include "base/threading/thread_checker.h" #include "base/time/time.h" +#include "components/drive/chromeos/resource_metadata.h" #include "components/drive/file_errors.h" #include "components/drive/job_scheduler.h" -#include "components/drive/resource_metadata.h" namespace base { class SequencedTaskRunner; @@ -198,4 +198,4 @@ } // namespace internal } // namespace drive -#endif // COMPONENTS_DRIVE_SYNC_CLIENT_H_ +#endif // COMPONENTS_DRIVE_CHROMEOS_SYNC_CLIENT_H_
diff --git a/components/drive/directory_loader_unittest.cc b/components/drive/directory_loader_unittest.cc index eb06c20..06e243a 100644 --- a/components/drive/directory_loader_unittest.cc +++ b/components/drive/directory_loader_unittest.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/drive/directory_loader.h" +#include "components/drive/chromeos/directory_loader.h" #include <memory> @@ -12,14 +12,14 @@ #include "base/run_loop.h" #include "base/single_thread_task_runner.h" #include "base/thread_task_runner_handle.h" -#include "components/drive/change_list_loader.h" -#include "components/drive/change_list_loader_observer.h" -#include "components/drive/drive_test_util.h" +#include "components/drive/chromeos/change_list_loader.h" +#include "components/drive/chromeos/change_list_loader_observer.h" +#include "components/drive/chromeos/drive_test_util.h" +#include "components/drive/chromeos/file_cache.h" +#include "components/drive/chromeos/resource_metadata.h" #include "components/drive/event_logger.h" -#include "components/drive/file_cache.h" #include "components/drive/file_system_core_util.h" #include "components/drive/job_scheduler.h" -#include "components/drive/resource_metadata.h" #include "components/drive/service/fake_drive_service.h" #include "components/drive/service/test_util.h" #include "components/prefs/testing_pref_service.h"
diff --git a/components/drive/fake_file_system_unittest.cc b/components/drive/fake_file_system_unittest.cc index 9c94ef68..ee8cd7f 100644 --- a/components/drive/fake_file_system_unittest.cc +++ b/components/drive/fake_file_system_unittest.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/drive/fake_file_system.h" +#include "components/drive/chromeos/fake_file_system.h" #include "base/files/file_util.h" #include "base/run_loop.h"
diff --git a/components/drive/file_cache_unittest.cc b/components/drive/file_cache_unittest.cc index 89111271..c60756a 100644 --- a/components/drive/file_cache_unittest.cc +++ b/components/drive/file_cache_unittest.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/drive/file_cache.h" +#include "components/drive/chromeos/file_cache.h" #include <stddef.h> #include <stdint.h> @@ -20,9 +20,9 @@ #include "base/strings/stringprintf.h" #include "base/thread_task_runner_handle.h" #include "base/time/time.h" +#include "components/drive/chromeos/drive_test_util.h" +#include "components/drive/chromeos/fake_free_disk_space_getter.h" #include "components/drive/drive.pb.h" -#include "components/drive/drive_test_util.h" -#include "components/drive/fake_free_disk_space_getter.h" #include "components/drive/file_system_core_util.h" #include "components/drive/resource_metadata_storage.h" #include "content/public/test/test_browser_thread_bundle.h"
diff --git a/components/drive/file_system/copy_operation_unittest.cc b/components/drive/file_system/copy_operation_unittest.cc index 164af14..3540bcf7 100644 --- a/components/drive/file_system/copy_operation_unittest.cc +++ b/components/drive/file_system/copy_operation_unittest.cc
@@ -2,16 +2,16 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/drive/file_system/copy_operation.h" +#include "components/drive/chromeos/file_system/copy_operation.h" #include "base/files/file_util.h" #include "base/task_runner_util.h" +#include "components/drive/chromeos/file_cache.h" +#include "components/drive/chromeos/resource_metadata.h" #include "components/drive/drive_api_util.h" -#include "components/drive/file_cache.h" #include "components/drive/file_change.h" #include "components/drive/file_system/operation_test_base.h" #include "components/drive/file_system_core_util.h" -#include "components/drive/resource_metadata.h" #include "components/drive/service/fake_drive_service.h" #include "content/public/test/test_utils.h" #include "google_apis/drive/drive_api_parser.h"
diff --git a/components/drive/file_system/create_directory_operation_unittest.cc b/components/drive/file_system/create_directory_operation_unittest.cc index df70157..325129c 100644 --- a/components/drive/file_system/create_directory_operation_unittest.cc +++ b/components/drive/file_system/create_directory_operation_unittest.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/drive/file_system/create_directory_operation.h" +#include "components/drive/chromeos/file_system/create_directory_operation.h" #include "components/drive/file_system/operation_test_base.h" #include "content/public/test/test_utils.h"
diff --git a/components/drive/file_system/create_file_operation_unittest.cc b/components/drive/file_system/create_file_operation_unittest.cc index 79b4456..4e5217c 100644 --- a/components/drive/file_system/create_file_operation_unittest.cc +++ b/components/drive/file_system/create_file_operation_unittest.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/drive/file_system/create_file_operation.h" +#include "components/drive/chromeos/file_system/create_file_operation.h" #include "components/drive/file_change.h" #include "components/drive/file_system/operation_test_base.h"
diff --git a/components/drive/file_system/download_operation_unittest.cc b/components/drive/file_system/download_operation_unittest.cc index 4498a9d..c714bd9 100644 --- a/components/drive/file_system/download_operation_unittest.cc +++ b/components/drive/file_system/download_operation_unittest.cc
@@ -2,15 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/drive/file_system/download_operation.h" +#include "components/drive/chromeos/file_system/download_operation.h" #include <stddef.h> #include <stdint.h> #include "base/files/file_util.h" #include "base/task_runner_util.h" -#include "components/drive/fake_free_disk_space_getter.h" -#include "components/drive/file_cache.h" +#include "components/drive/chromeos/fake_free_disk_space_getter.h" +#include "components/drive/chromeos/file_cache.h" #include "components/drive/file_change.h" #include "components/drive/file_system/operation_test_base.h" #include "components/drive/file_system_core_util.h"
diff --git a/components/drive/file_system/get_file_for_saving_operation_unittest.cc b/components/drive/file_system/get_file_for_saving_operation_unittest.cc index f2a5bb2..a7664f5 100644 --- a/components/drive/file_system/get_file_for_saving_operation_unittest.cc +++ b/components/drive/file_system/get_file_for_saving_operation_unittest.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/drive/file_system/get_file_for_saving_operation.h" +#include "components/drive/chromeos/file_system/get_file_for_saving_operation.h" #include <stdint.h>
diff --git a/components/drive/file_system/move_operation_unittest.cc b/components/drive/file_system/move_operation_unittest.cc index 835a9f7..43a5117 100644 --- a/components/drive/file_system/move_operation_unittest.cc +++ b/components/drive/file_system/move_operation_unittest.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/drive/file_system/move_operation.h" +#include "components/drive/chromeos/file_system/move_operation.h" #include "components/drive/file_change.h" #include "components/drive/file_system/operation_test_base.h"
diff --git a/components/drive/file_system/open_file_operation_unittest.cc b/components/drive/file_system/open_file_operation_unittest.cc index 0991a2c5..1c43e76 100644 --- a/components/drive/file_system/open_file_operation_unittest.cc +++ b/components/drive/file_system/open_file_operation_unittest.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/drive/file_system/open_file_operation.h" +#include "components/drive/chromeos/file_system/open_file_operation.h" #include <stdint.h> @@ -12,8 +12,8 @@ #include "base/files/file_path.h" #include "base/files/file_util.h" #include "base/task_runner_util.h" +#include "components/drive/chromeos/file_cache.h" #include "components/drive/drive.pb.h" -#include "components/drive/file_cache.h" #include "components/drive/file_change.h" #include "components/drive/file_errors.h" #include "components/drive/file_system/operation_test_base.h"
diff --git a/components/drive/file_system/operation_test_base.cc b/components/drive/file_system/operation_test_base.cc index 0aad574d..e496538 100644 --- a/components/drive/file_system/operation_test_base.cc +++ b/components/drive/file_system/operation_test_base.cc
@@ -5,14 +5,14 @@ #include "components/drive/file_system/operation_test_base.h" #include "base/threading/sequenced_worker_pool.h" -#include "components/drive/change_list_loader.h" +#include "components/drive/chromeos/change_list_loader.h" +#include "components/drive/chromeos/fake_free_disk_space_getter.h" +#include "components/drive/chromeos/file_cache.h" +#include "components/drive/chromeos/file_system/operation_delegate.h" +#include "components/drive/chromeos/resource_metadata.h" #include "components/drive/event_logger.h" -#include "components/drive/fake_free_disk_space_getter.h" -#include "components/drive/file_cache.h" #include "components/drive/file_change.h" -#include "components/drive/file_system/operation_delegate.h" #include "components/drive/job_scheduler.h" -#include "components/drive/resource_metadata.h" #include "components/drive/service/fake_drive_service.h" #include "components/drive/service/test_util.h" #include "components/prefs/testing_pref_service.h"
diff --git a/components/drive/file_system/operation_test_base.h b/components/drive/file_system/operation_test_base.h index 3d13258..d60ec9f 100644 --- a/components/drive/file_system/operation_test_base.h +++ b/components/drive/file_system/operation_test_base.h
@@ -8,11 +8,11 @@ #include <set> #include "base/files/scoped_temp_dir.h" +#include "components/drive/chromeos/drive_test_util.h" +#include "components/drive/chromeos/file_system/operation_delegate.h" #include "components/drive/drive.pb.h" -#include "components/drive/drive_test_util.h" #include "components/drive/file_change.h" #include "components/drive/file_errors.h" -#include "components/drive/file_system/operation_delegate.h" #include "content/public/test/test_browser_thread_bundle.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/components/drive/file_system/remove_operation_unittest.cc b/components/drive/file_system/remove_operation_unittest.cc index 54012752..75d90736 100644 --- a/components/drive/file_system/remove_operation_unittest.cc +++ b/components/drive/file_system/remove_operation_unittest.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/drive/file_system/remove_operation.h" +#include "components/drive/chromeos/file_system/remove_operation.h" #include "components/drive/file_change.h" #include "components/drive/file_system/operation_test_base.h"
diff --git a/components/drive/file_system/search_operation_unittest.cc b/components/drive/file_system/search_operation_unittest.cc index 92ea51b5..ea94868 100644 --- a/components/drive/file_system/search_operation_unittest.cc +++ b/components/drive/file_system/search_operation_unittest.cc
@@ -2,12 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/drive/file_system/search_operation.h" +#include "components/drive/chromeos/file_system/search_operation.h" #include <stddef.h> #include "base/callback_helpers.h" -#include "components/drive/change_list_loader.h" +#include "components/drive/chromeos/change_list_loader.h" #include "components/drive/file_system/operation_test_base.h" #include "components/drive/service/fake_drive_service.h" #include "content/public/test/test_utils.h"
diff --git a/components/drive/file_system/set_property_operation_unittest.cc b/components/drive/file_system/set_property_operation_unittest.cc index 093fbb2..f71aef9 100644 --- a/components/drive/file_system/set_property_operation_unittest.cc +++ b/components/drive/file_system/set_property_operation_unittest.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/drive/file_system/set_property_operation.h" +#include "components/drive/chromeos/file_system/set_property_operation.h" #include "base/files/file_path.h" #include "components/drive/drive.pb.h"
diff --git a/components/drive/file_system/touch_operation_unittest.cc b/components/drive/file_system/touch_operation_unittest.cc index c7b9cfe..8c15010a 100644 --- a/components/drive/file_system/touch_operation_unittest.cc +++ b/components/drive/file_system/touch_operation_unittest.cc
@@ -2,14 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/drive/file_system/touch_operation.h" +#include "components/drive/chromeos/file_system/touch_operation.h" #include "base/files/file_path.h" #include "base/time/time.h" +#include "components/drive/chromeos/resource_metadata.h" #include "components/drive/drive.pb.h" #include "components/drive/file_errors.h" #include "components/drive/file_system/operation_test_base.h" -#include "components/drive/resource_metadata.h" #include "google_apis/drive/test_util.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/components/drive/file_system/truncate_operation_unittest.cc b/components/drive/file_system/truncate_operation_unittest.cc index cc803a80..16e08742 100644 --- a/components/drive/file_system/truncate_operation_unittest.cc +++ b/components/drive/file_system/truncate_operation_unittest.cc
@@ -2,15 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/drive/file_system/truncate_operation.h" +#include "components/drive/chromeos/file_system/truncate_operation.h" #include <stdint.h> #include "base/files/file_path.h" #include "base/files/file_util.h" #include "base/task_runner_util.h" +#include "components/drive/chromeos/fake_free_disk_space_getter.h" #include "components/drive/drive.pb.h" -#include "components/drive/fake_free_disk_space_getter.h" #include "components/drive/file_system/operation_test_base.h" #include "content/public/test/test_utils.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/components/drive/file_system_unittest.cc b/components/drive/file_system_unittest.cc index eecebd5..2b97208 100644 --- a/components/drive/file_system_unittest.cc +++ b/components/drive/file_system_unittest.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/drive/file_system.h" +#include "components/drive/chromeos/file_system.h" #include <stddef.h> #include <stdint.h> @@ -19,19 +19,19 @@ #include "base/run_loop.h" #include "base/single_thread_task_runner.h" #include "base/thread_task_runner_handle.h" -#include "components/drive/change_list_loader.h" +#include "components/drive/chromeos/change_list_loader.h" +#include "components/drive/chromeos/drive_test_util.h" +#include "components/drive/chromeos/fake_free_disk_space_getter.h" +#include "components/drive/chromeos/file_system_observer.h" +#include "components/drive/chromeos/sync_client.h" #include "components/drive/drive.pb.h" #include "components/drive/drive_api_util.h" -#include "components/drive/drive_test_util.h" #include "components/drive/event_logger.h" -#include "components/drive/fake_free_disk_space_getter.h" #include "components/drive/file_change.h" #include "components/drive/file_system_core_util.h" -#include "components/drive/file_system_observer.h" #include "components/drive/job_scheduler.h" #include "components/drive/service/fake_drive_service.h" #include "components/drive/service/test_util.h" -#include "components/drive/sync_client.h" #include "components/prefs/testing_pref_service.h" #include "content/public/browser/browser_thread.h" #include "content/public/test/test_browser_thread_bundle.h"
diff --git a/components/drive/job_scheduler_unittest.cc b/components/drive/job_scheduler_unittest.cc index f4452d3..982822ef 100644 --- a/components/drive/job_scheduler_unittest.cc +++ b/components/drive/job_scheduler_unittest.cc
@@ -17,8 +17,8 @@ #include "base/stl_util.h" #include "base/strings/stringprintf.h" #include "base/thread_task_runner_handle.h" +#include "components/drive/chromeos/drive_test_util.h" #include "components/drive/drive_pref_names.h" -#include "components/drive/drive_test_util.h" #include "components/drive/event_logger.h" #include "components/drive/service/fake_drive_service.h" #include "components/drive/service/test_util.h"
diff --git a/components/drive/local_file_reader_unittest.cc b/components/drive/local_file_reader_unittest.cc index c2b6ddc..7fcd785 100644 --- a/components/drive/local_file_reader_unittest.cc +++ b/components/drive/local_file_reader_unittest.cc
@@ -16,7 +16,7 @@ #include "base/message_loop/message_loop.h" #include "base/rand_util.h" #include "base/threading/thread.h" -#include "components/drive/drive_test_util.h" +#include "components/drive/chromeos/drive_test_util.h" #include "google_apis/drive/test_util.h" #include "net/base/io_buffer.h" #include "net/base/test_completion_callback.h"
diff --git a/components/drive/remove_stale_cache_files_unittest.cc b/components/drive/remove_stale_cache_files_unittest.cc index dbda555..e02c0cd 100644 --- a/components/drive/remove_stale_cache_files_unittest.cc +++ b/components/drive/remove_stale_cache_files_unittest.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/drive/remove_stale_cache_files.h" +#include "components/drive/chromeos/remove_stale_cache_files.h" #include <memory> #include <string> @@ -12,11 +12,11 @@ #include "base/files/scoped_temp_dir.h" #include "base/single_thread_task_runner.h" #include "base/thread_task_runner_handle.h" +#include "components/drive/chromeos/drive_test_util.h" +#include "components/drive/chromeos/fake_free_disk_space_getter.h" +#include "components/drive/chromeos/resource_metadata.h" #include "components/drive/drive.pb.h" -#include "components/drive/drive_test_util.h" -#include "components/drive/fake_free_disk_space_getter.h" #include "components/drive/file_system_core_util.h" -#include "components/drive/resource_metadata.h" #include "content/public/test/test_browser_thread_bundle.h" #include "google_apis/drive/test_util.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/components/drive/resource_metadata_storage_unittest.cc b/components/drive/resource_metadata_storage_unittest.cc index 05db4bd..b45494f 100644 --- a/components/drive/resource_metadata_storage_unittest.cc +++ b/components/drive/resource_metadata_storage_unittest.cc
@@ -15,8 +15,8 @@ #include "base/single_thread_task_runner.h" #include "base/strings/string_split.h" #include "base/thread_task_runner_handle.h" +#include "components/drive/chromeos/drive_test_util.h" #include "components/drive/drive.pb.h" -#include "components/drive/drive_test_util.h" #include "content/public/test/test_browser_thread_bundle.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/leveldatabase/src/include/leveldb/db.h"
diff --git a/components/drive/resource_metadata_unittest.cc b/components/drive/resource_metadata_unittest.cc index 1a00ed79..7446efc 100644 --- a/components/drive/resource_metadata_unittest.cc +++ b/components/drive/resource_metadata_unittest.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/drive/resource_metadata.h" +#include "components/drive/chromeos/resource_metadata.h" #include <stddef.h> #include <stdint.h> @@ -15,10 +15,10 @@ #include "base/single_thread_task_runner.h" #include "base/strings/stringprintf.h" #include "base/thread_task_runner_handle.h" +#include "components/drive/chromeos/drive_test_util.h" +#include "components/drive/chromeos/fake_free_disk_space_getter.h" +#include "components/drive/chromeos/file_cache.h" #include "components/drive/drive.pb.h" -#include "components/drive/drive_test_util.h" -#include "components/drive/fake_free_disk_space_getter.h" -#include "components/drive/file_cache.h" #include "components/drive/file_system_core_util.h" #include "content/public/test/test_browser_thread_bundle.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/components/drive/search_metadata_unittest.cc b/components/drive/search_metadata_unittest.cc index 1b66cd7..143454f 100644 --- a/components/drive/search_metadata_unittest.cc +++ b/components/drive/search_metadata_unittest.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/drive/search_metadata.h" +#include "components/drive/chromeos/search_metadata.h" #include <stddef.h> #include <stdint.h> @@ -16,10 +16,10 @@ #include "base/single_thread_task_runner.h" #include "base/strings/utf_string_conversions.h" #include "base/thread_task_runner_handle.h" +#include "components/drive/chromeos/drive_test_util.h" +#include "components/drive/chromeos/fake_free_disk_space_getter.h" +#include "components/drive/chromeos/file_cache.h" #include "components/drive/drive_api_util.h" -#include "components/drive/drive_test_util.h" -#include "components/drive/fake_free_disk_space_getter.h" -#include "components/drive/file_cache.h" #include "components/drive/file_system_core_util.h" #include "content/public/test/test_browser_thread_bundle.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/components/drive/sync/entry_revert_performer_unittest.cc b/components/drive/sync/entry_revert_performer_unittest.cc index 4987ed7..4143ad6 100644 --- a/components/drive/sync/entry_revert_performer_unittest.cc +++ b/components/drive/sync/entry_revert_performer_unittest.cc
@@ -2,14 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/drive/sync/entry_revert_performer.h" +#include "components/drive/chromeos/sync/entry_revert_performer.h" #include "base/task_runner_util.h" +#include "components/drive/chromeos/resource_metadata.h" #include "components/drive/file_change.h" #include "components/drive/file_system/operation_test_base.h" #include "components/drive/file_system_core_util.h" #include "components/drive/job_scheduler.h" -#include "components/drive/resource_metadata.h" #include "components/drive/service/fake_drive_service.h" #include "content/public/test/test_utils.h" #include "google_apis/drive/test_util.h"
diff --git a/components/drive/sync/entry_update_performer_unittest.cc b/components/drive/sync/entry_update_performer_unittest.cc index efce275..80bd156 100644 --- a/components/drive/sync/entry_update_performer_unittest.cc +++ b/components/drive/sync/entry_update_performer_unittest.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/drive/sync/entry_update_performer.h" +#include "components/drive/chromeos/sync/entry_update_performer.h" #include <stdint.h> @@ -10,12 +10,12 @@ #include "base/files/file_util.h" #include "base/md5.h" #include "base/task_runner_util.h" +#include "components/drive/chromeos/file_cache.h" +#include "components/drive/chromeos/file_system/download_operation.h" +#include "components/drive/chromeos/resource_metadata.h" #include "components/drive/drive_api_util.h" -#include "components/drive/file_cache.h" -#include "components/drive/file_system/download_operation.h" #include "components/drive/file_system/operation_test_base.h" #include "components/drive/job_scheduler.h" -#include "components/drive/resource_metadata.h" #include "components/drive/service/fake_drive_service.h" #include "content/public/test/test_utils.h" #include "google_apis/drive/drive_api_parser.h"
diff --git a/components/drive/sync/remove_performer_unittest.cc b/components/drive/sync/remove_performer_unittest.cc index 1fd6bef92..bd0c50f 100644 --- a/components/drive/sync/remove_performer_unittest.cc +++ b/components/drive/sync/remove_performer_unittest.cc
@@ -2,13 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/drive/sync/remove_performer.h" +#include "components/drive/chromeos/sync/remove_performer.h" #include "base/task_runner_util.h" +#include "components/drive/chromeos/resource_metadata.h" #include "components/drive/file_system/operation_test_base.h" #include "components/drive/file_system_core_util.h" #include "components/drive/job_scheduler.h" -#include "components/drive/resource_metadata.h" #include "components/drive/service/fake_drive_service.h" #include "content/public/test/test_utils.h" #include "google_apis/drive/drive_api_parser.h"
diff --git a/components/drive/sync_client_unittest.cc b/components/drive/sync_client_unittest.cc index ac74b81..c9630048 100644 --- a/components/drive/sync_client_unittest.cc +++ b/components/drive/sync_client_unittest.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/drive/sync_client.h" +#include "components/drive/chromeos/sync_client.h" #include <memory> @@ -13,20 +13,20 @@ #include "base/single_thread_task_runner.h" #include "base/test/test_timeouts.h" #include "base/thread_task_runner_handle.h" -#include "components/drive/change_list_loader.h" +#include "components/drive/chromeos/change_list_loader.h" +#include "components/drive/chromeos/drive_test_util.h" +#include "components/drive/chromeos/fake_free_disk_space_getter.h" +#include "components/drive/chromeos/file_cache.h" +#include "components/drive/chromeos/file_system/move_operation.h" +#include "components/drive/chromeos/file_system/operation_delegate.h" +#include "components/drive/chromeos/file_system/remove_operation.h" +#include "components/drive/chromeos/resource_metadata.h" #include "components/drive/drive.pb.h" -#include "components/drive/drive_test_util.h" #include "components/drive/event_logger.h" -#include "components/drive/fake_free_disk_space_getter.h" -#include "components/drive/file_cache.h" #include "components/drive/file_change.h" -#include "components/drive/file_system/move_operation.h" -#include "components/drive/file_system/operation_delegate.h" -#include "components/drive/file_system/remove_operation.h" #include "components/drive/file_system_core_util.h" #include "components/drive/job_scheduler.h" #include "components/drive/resource_entry_conversion.h" -#include "components/drive/resource_metadata.h" #include "components/drive/service/fake_drive_service.h" #include "components/prefs/testing_pref_service.h" #include "content/public/test/test_browser_thread_bundle.h"
diff --git a/components/error_page/OWNERS b/components/error_page/OWNERS index a479fb96..44a878b 100644 --- a/components/error_page/OWNERS +++ b/components/error_page/OWNERS
@@ -1,2 +1,2 @@ mmenke@chromium.org -ttuttle@chromium.org +juliatuttle@chromium.org
diff --git a/components/exo/keyboard.cc b/components/exo/keyboard.cc index 526455bf..2d4c66b09 100644 --- a/components/exo/keyboard.cc +++ b/components/exo/keyboard.cc
@@ -10,10 +10,52 @@ #include "components/exo/surface.h" #include "ui/aura/client/focus_client.h" #include "ui/aura/window.h" +#include "ui/base/ime/input_method.h" +#include "ui/events/base_event_utils.h" #include "ui/events/event.h" +#include "ui/views/widget/widget.h" namespace exo { +bool ConsumedByIme(Surface* focus, const ui::KeyEvent* event) { + // Check if IME consumed the event, to avoid it to be doubly processed. + // First let us see whether IME is active and is in text input mode. + views::Widget* widget = + focus ? views::Widget::GetTopLevelWidgetForNativeView(focus) : nullptr; + ui::InputMethod* ime = widget ? widget->GetInputMethod() : nullptr; + if (!ime || ime->GetTextInputType() == ui::TEXT_INPUT_TYPE_NONE) + return false; + + // Case 1: + // When IME ate a key event but did not emit character insertion event yet + // (e.g., when it is still showing a candidate list UI to the user,) the + // consumed key event is re-sent after masked |key_code| by VKEY_PROCESSKEY. + if (event->key_code() == ui::VKEY_PROCESSKEY) + return true; + + // Case 2: + // When IME ate a key event and generated a single character input, it leaves + // the key event as-is, and in addition calls the active ui::TextInputClient's + // InsertChar() method. (In our case, arc::ArcImeService::InsertChar()). + // + // In Chrome OS (and Web) convention, the two calls wont't cause duplicates, + // because key-down events do not mean any character inputs there. + // (InsertChar issues a DOM "keypress" event, which is distinct from keydown.) + // Unfortunately, this is not necessary the case for our clients that may + // treat keydown as a trigger of text inputs. We need suppression for keydown. + if (event->type() == ui::ET_KEY_PRESSED) { + // Same condition as components/arc/ime/arc_ime_service.cc#InsertChar. + const base::char16 ch = event->GetCharacter(); + const bool is_control_char = + (0x00 <= ch && ch <= 0x1f) || (0x7f <= ch && ch <= 0x9f); + // TODO(kinaba, crbug,com/604615): Filter out [Enter] key events as well. + if (!is_control_char && !ui::IsSystemKeyModifier(event->flags())) + return true; + } + + return false; +} + //////////////////////////////////////////////////////////////////////////////// // Keyboard, public: @@ -52,11 +94,10 @@ delegate_->OnKeyboardModifiers(modifier_flags_); } - // When IME ate a key event, it re-sends the event after masking |key_code| - // by VKEY_PROCESSKEY. Although such events can be used to track the key - // states, they should not be sent as unmasked key events. Otherwise they are - // handled in two places (IME and client) and cause undesired behavior. - bool consumed_by_ime = (event->key_code() == ui::VKEY_PROCESSKEY); + // When IME ate a key event, we use the event only for tracking key states and + // ignore for further processing. Otherwise it is handled in two places (IME + // and client) and causes undesired behavior. + bool consumed_by_ime = ConsumedByIme(focus_, event); switch (event->type()) { case ui::ET_KEY_PRESSED: {
diff --git a/components/font_service/public/cpp/font_service_thread.cc b/components/font_service/public/cpp/font_service_thread.cc index 496d415..062aa93e 100644 --- a/components/font_service/public/cpp/font_service_thread.cc +++ b/components/font_service/public/cpp/font_service_thread.cc
@@ -65,7 +65,7 @@ done_event.Wait(); if (!stream_file.IsValid()) { - NOTREACHED(); + // The font-service may have been killed. return nullptr; } @@ -92,6 +92,12 @@ SkFontStyle* out_style) { DCHECK_EQ(GetThreadId(), base::PlatformThread::CurrentId()); + if (font_service_.encountered_error()) { + *out_valid = false; + done_event->Signal(); + return; + } + TypefaceStylePtr style(TypefaceStyle::New()); style->weight = requested_style.weight(); style->width = requested_style.width(); @@ -136,6 +142,10 @@ base::File* output_file, const uint32_t id_number) { DCHECK_EQ(GetThreadId(), base::PlatformThread::CurrentId()); + if (font_service_.encountered_error()) { + done_event->Signal(); + return; + } font_service_->OpenStream( id_number, base::Bind(&FontServiceThread::OnOpenStreamComplete, this,
diff --git a/components/gcm_driver/crypto/gcm_message_cryptographer.cc b/components/gcm_driver/crypto/gcm_message_cryptographer.cc index bb89e7e..e76a5518 100644 --- a/components/gcm_driver/crypto/gcm_message_cryptographer.cc +++ b/components/gcm_driver/crypto/gcm_message_cryptographer.cc
@@ -54,11 +54,13 @@ break; } - uint16_t local_len = base::HostToNet16(recipient_public_key.size()); + uint16_t local_len = + base::HostToNet16(static_cast<uint16_t>(recipient_public_key.size())); info_stream.write(reinterpret_cast<char*>(&local_len), sizeof(local_len)); info_stream << recipient_public_key; - uint16_t peer_len = base::HostToNet16(sender_public_key.size()); + uint16_t peer_len = + base::HostToNet16(static_cast<uint16_t>(sender_public_key.size())); info_stream.write(reinterpret_cast<char*>(&peer_len), sizeof(peer_len)); info_stream << sender_public_key;
diff --git a/components/history/core/browser/BUILD.gn b/components/history/core/browser/BUILD.gn index bd330ed2..8291fe3 100644 --- a/components/history/core/browser/BUILD.gn +++ b/components/history/core/browser/BUILD.gn
@@ -134,6 +134,44 @@ configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] } +bundle_data("unit_tests_bundle_data") { + visibility = [ ":unit_tests" ] + testonly = true + sources = [ + "//components/test/data/history/Favicons.v3.sql", + "//components/test/data/history/Favicons.v4.sql", + "//components/test/data/history/Favicons.v5.sql", + "//components/test/data/history/Favicons.v6.sql", + "//components/test/data/history/Favicons.v7.sql", + "//components/test/data/history/Favicons.v8.sql", + "//components/test/data/history/HistoryNoDuration", + "//components/test/data/history/HistoryNoSource", + "//components/test/data/history/History_with_starred", + "//components/test/data/history/TopSites.v1.sql", + "//components/test/data/history/TopSites.v2.sql", + "//components/test/data/history/TopSites.v3.sql", + "//components/test/data/history/history.22.sql", + "//components/test/data/history/history.26.sql", + "//components/test/data/history/history.27.sql", + "//components/test/data/history/history.28.sql", + "//components/test/data/history/history.29.sql", + "//components/test/data/history/history.30.sql", + "//components/test/data/history/thumbnail_wild/Favicons.corrupt_meta.disable", + "//components/test/data/history/thumbnail_wild/Favicons.v2.init.sql", + "//components/test/data/history/thumbnail_wild/Favicons.v3.init.sql", + "//components/test/data/history/thumbnail_wild/Favicons.v4.init.sql", + "//components/test/data/history/thumbnail_wild/Favicons.v5.icon_type.sql", + "//components/test/data/history/thumbnail_wild/Favicons.v5.icon_type2.sql", + "//components/test/data/history/thumbnail_wild/Favicons.v5.init.sql", + "//components/test/data/history/thumbnail_wild/Favicons.v5.sizes.sql", + "//components/test/data/history/thumbnail_wild/Favicons.v6.init.sql", + ] + outputs = [ + "{{bundle_resources_dir}}/" + + "{{source_root_relative_dir}}/{{source_file_part}}", + ] +} + source_set("unit_tests") { testonly = true sources = [ @@ -157,6 +195,7 @@ ] deps = [ ":browser", + ":unit_tests_bundle_data", "//base", "//base/test:test_support", "//components/favicon_base", @@ -170,7 +209,8 @@ "//sql:test_support", "//sync:test_support_sync_api", "//testing/gtest", - "//ui/gfx:gfx", + "//ui/gfx", + "//ui/gfx:test_support", "//url", ] if (is_android) {
diff --git a/components/history/core/browser/history_backend.cc b/components/history/core/browser/history_backend.cc index 9cee47e..c332cb67 100644 --- a/components/history/core/browser/history_backend.cc +++ b/components/history/core/browser/history_backend.cc
@@ -424,24 +424,29 @@ return top_hosts; } -OriginCountMap HistoryBackend::GetCountsForOrigins( +OriginCountAndLastVisitMap HistoryBackend::GetCountsAndLastVisitForOrigins( const std::set<GURL>& origins) const { if (!db_) - return OriginCountMap(); + return OriginCountAndLastVisitMap(); URLDatabase::URLEnumerator it; if (!db_->InitURLEnumeratorForEverything(&it)) - return OriginCountMap(); + return OriginCountAndLastVisitMap(); - OriginCountMap origin_count_map; + OriginCountAndLastVisitMap origin_count_map; for (const GURL& origin : origins) - origin_count_map[origin] = 0; + origin_count_map[origin] = std::make_pair(0, base::Time()); URLRow row; while (it.GetNextURL(&row)) { GURL origin = row.url().GetOrigin(); - if (ContainsValue(origins, origin)) - ++origin_count_map[origin]; + auto iter = origin_count_map.find(origin); + if (iter != origin_count_map.end()) { + std::pair<int, base::Time>& value = iter->second; + ++(value.first); + if (value.second.is_null() || value.second < row.last_visit()) + value.second = row.last_visit(); + } } return origin_count_map;
diff --git a/components/history/core/browser/history_backend.h b/components/history/core/browser/history_backend.h index 573a401..dc971434 100644 --- a/components/history/core/browser/history_backend.h +++ b/components/history/core/browser/history_backend.h
@@ -213,11 +213,12 @@ // generating internal metrics. TopHostsList TopHosts(size_t num_hosts) const; - // Gets the counts of URLs that belong to |origins| in the history database. - // Origins that are not in the history database will be in the map with a - // count of 0. + // Gets the counts and last last time of URLs that belong to |origins| in the + // history database. Origins that are not in the history database will be in + // the map with a count and time of 0. // Returns an empty map if db_ is not initialized. - OriginCountMap GetCountsForOrigins(const std::set<GURL>& origins) const; + OriginCountAndLastVisitMap GetCountsAndLastVisitForOrigins( + const std::set<GURL>& origins) const; // Returns, for the given URL, a 0-based index into the list produced by // TopHosts(), corresponding to that URL's host. If TopHosts() has not @@ -557,7 +558,7 @@ FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, TopHosts_IgnoreUnusualURLs); FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, HostRankIfAvailable); FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, RecordTopHostsMetrics); - FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, GetCountsForOrigins); + FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, GetCountsAndLastVisitForOrigins); FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, UpdateVisitDuration); FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, ExpireHistoryForTimes); FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, DeleteFTSIndexDatabases);
diff --git a/components/history/core/browser/history_backend_unittest.cc b/components/history/core/browser/history_backend_unittest.cc index a99b360..39998525 100644 --- a/components/history/core/browser/history_backend_unittest.cc +++ b/components/history/core/browser/history_backend_unittest.cc
@@ -3163,33 +3163,49 @@ ElementsAre(base::Bucket(1, 1), base::Bucket(51, 1))); } -TEST_F(HistoryBackendTest, GetCountsForOrigins) { - std::vector<GURL> urls; - urls.push_back(GURL("http://cnn.com/us")); - urls.push_back(GURL("http://cnn.com/intl")); - urls.push_back(GURL("https://cnn.com/intl")); - urls.push_back(GURL("http://cnn.com:8080/path")); - urls.push_back(GURL("http://dogtopia.com/pups?q=poods")); - for (const GURL& url : urls) { - backend_->AddPageVisit(url, base::Time::Now(), 0, ui::PAGE_TRANSITION_LINK, - history::SOURCE_BROWSED); - } +TEST_F(HistoryBackendTest, GetCountsAndLastVisitForOrigins) { + base::Time now = base::Time::Now(); + base::Time tomorrow = now + base::TimeDelta::FromDays(1); + base::Time yesterday = now - base::TimeDelta::FromDays(1); + base::Time last_week = now - base::TimeDelta::FromDays(7); + + backend_->AddPageVisit(GURL("http://cnn.com/intl"), yesterday, 0, + ui::PAGE_TRANSITION_LINK, history::SOURCE_BROWSED); + backend_->AddPageVisit(GURL("http://cnn.com/us"), last_week, 0, + ui::PAGE_TRANSITION_LINK, history::SOURCE_BROWSED); + backend_->AddPageVisit(GURL("http://cnn.com/ny"), now, 0, + ui::PAGE_TRANSITION_LINK, history::SOURCE_BROWSED); + backend_->AddPageVisit(GURL("https://cnn.com/intl"), yesterday, 0, + ui::PAGE_TRANSITION_LINK, history::SOURCE_BROWSED); + backend_->AddPageVisit(GURL("http://cnn.com:8080/path"), yesterday, 0, + ui::PAGE_TRANSITION_LINK, history::SOURCE_BROWSED); + backend_->AddPageVisit(GURL("http://dogtopia.com/pups?q=poods"), now, 0, + ui::PAGE_TRANSITION_LINK, history::SOURCE_BROWSED); std::set<GURL> origins; origins.insert(GURL("http://cnn.com/")); - EXPECT_THAT(backend_->GetCountsForOrigins(origins), - ElementsAre(std::make_pair(GURL("http://cnn.com/"), 2))); + EXPECT_THAT(backend_->GetCountsAndLastVisitForOrigins(origins), + ElementsAre(std::make_pair(GURL("http://cnn.com/"), + std::make_pair(3, now)))); origins.insert(GURL("http://dogtopia.com/")); origins.insert(GURL("http://cnn.com:8080/")); origins.insert(GURL("https://cnn.com/")); origins.insert(GURL("http://notpresent.com/")); - EXPECT_THAT(backend_->GetCountsForOrigins(origins), - ElementsAre(std::make_pair(GURL("http://cnn.com/"), 2), - std::make_pair(GURL("http://cnn.com:8080/"), 1), - std::make_pair(GURL("http://dogtopia.com/"), 1), - std::make_pair(GURL("http://notpresent.com/"), 0), - std::make_pair(GURL("https://cnn.com/"), 1))); + backend_->AddPageVisit(GURL("http://cnn.com/"), tomorrow, 0, + ui::PAGE_TRANSITION_LINK, history::SOURCE_BROWSED); + + EXPECT_THAT( + backend_->GetCountsAndLastVisitForOrigins(origins), + ElementsAre( + std::make_pair(GURL("http://cnn.com/"), std::make_pair(4, tomorrow)), + std::make_pair(GURL("http://cnn.com:8080/"), + std::make_pair(1, yesterday)), + std::make_pair(GURL("http://dogtopia.com/"), std::make_pair(1, now)), + std::make_pair(GURL("http://notpresent.com/"), + std::make_pair(0, base::Time())), + std::make_pair(GURL("https://cnn.com/"), + std::make_pair(1, yesterday)))); } TEST_F(HistoryBackendTest, UpdateVisitDuration) {
diff --git a/components/history/core/browser/history_service.cc b/components/history/core/browser/history_service.cc index 126322a..557a1693 100644 --- a/components/history/core/browser/history_service.cc +++ b/components/history/core/browser/history_service.cc
@@ -368,15 +368,16 @@ callback); } -void HistoryService::GetCountsForOrigins( +void HistoryService::GetCountsAndLastVisitForOrigins( const std::set<GURL>& origins, - const GetCountsForOriginsCallback& callback) const { + const GetCountsAndLastVisitForOriginsCallback& callback) const { DCHECK(thread_) << "History service being called after cleanup"; DCHECK(thread_checker_.CalledOnValidThread()); - PostTaskAndReplyWithResult(thread_->task_runner().get(), FROM_HERE, - base::Bind(&HistoryBackend::GetCountsForOrigins, - history_backend_.get(), origins), - callback); + PostTaskAndReplyWithResult( + thread_->task_runner().get(), FROM_HERE, + base::Bind(&HistoryBackend::GetCountsAndLastVisitForOrigins, + history_backend_.get(), origins), + callback); } void HistoryService::HostRankIfAvailable(
diff --git a/components/history/core/browser/history_service.h b/components/history/core/browser/history_service.h index c830e25..a27e4e0d 100644 --- a/components/history/core/browser/history_service.h +++ b/components/history/core/browser/history_service.h
@@ -152,9 +152,10 @@ // KeyedService: void Shutdown() override; - // Callback for value asynchronously returned by GetCountsForOrigins(). - typedef base::Callback<void(const OriginCountMap&)> - GetCountsForOriginsCallback; + // Callback for value asynchronously returned by + // GetCountsAndLastVisitForOrigins(). + typedef base::Callback<void(const OriginCountAndLastVisitMap&)> + GetCountsAndLastVisitForOriginsCallback; // Computes the |num_hosts| most-visited hostnames in the past 30 days and // returns a list of those hosts paired with their visit counts. The following @@ -171,9 +172,11 @@ virtual void TopHosts(size_t num_hosts, const TopHostsCallback& callback) const; - // Gets the counts of URLs that belong to |origins| in the history database. - void GetCountsForOrigins(const std::set<GURL>& origins, - const GetCountsForOriginsCallback& callback) const; + // Gets the counts and most recent visit date of URLs that belong to |origins| + // in the history database. + void GetCountsAndLastVisitForOrigins( + const std::set<GURL>& origins, + const GetCountsAndLastVisitForOriginsCallback& callback) const; // Returns, for the given URL, a 0-based index into the list produced by // TopHosts(), corresponding to that URL's host. If TopHosts() has not
diff --git a/components/history/core/browser/history_types.h b/components/history/core/browser/history_types.h index 51e948c1..64260e1a 100644 --- a/components/history/core/browser/history_types.h +++ b/components/history/core/browser/history_types.h
@@ -459,8 +459,9 @@ // Map from host to visit count, sorted by visit count descending. typedef std::vector<std::pair<std::string, int>> TopHostsList; -// Map from origins to a count of matching URLs. -typedef std::map<GURL, int> OriginCountMap; +// Map from origins to a count of matching URLs and the last visited time to any +// URL under that origin. +typedef std::map<GURL, std::pair<int, base::Time>> OriginCountAndLastVisitMap; // Statistics -----------------------------------------------------------------
diff --git a/components/json_schema/BUILD.gn b/components/json_schema/BUILD.gn index 0ef0b96..68502ea 100644 --- a/components/json_schema/BUILD.gn +++ b/components/json_schema/BUILD.gn
@@ -16,6 +16,24 @@ ] } +bundle_data("unit_tests_bundle_data") { + visibility = [ ":unit_tests" ] + testonly = true + sources = [ + "//components/test/data/json_schema/array_tuple_schema.json", + "//components/test/data/json_schema/choices_schema.json", + "//components/test/data/json_schema/complex_instance.json", + "//components/test/data/json_schema/complex_schema.json", + "//components/test/data/json_schema/enum_schema.json", + "//components/test/data/json_schema/pattern_properties_dot.json", + "//components/test/data/json_schema/reference_types.json", + ] + outputs = [ + "{{bundle_resources_dir}}/" + + "{{source_root_relative_dir}}/{{source_file_part}}", + ] +} + source_set("unit_tests") { testonly = true sources = [ @@ -25,6 +43,7 @@ ] deps = [ ":json_schema", + ":unit_tests_bundle_data", "//base", "//testing/gtest", ]
diff --git a/components/metrics/file_metrics_provider.cc b/components/metrics/file_metrics_provider.cc index 78fb90a..36a60df 100644 --- a/components/metrics/file_metrics_provider.cc +++ b/components/metrics/file_metrics_provider.cc
@@ -26,21 +26,24 @@ // This structure stores all the information about the files being monitored // and their current reporting state. struct FileMetricsProvider::FileInfo { - FileInfo() {} + FileInfo(FileType file_type) : type(file_type) {} ~FileInfo() {} + // How to access this file (atomic/active). + const FileType type; + // Where on disk the file is located. base::FilePath path; - // How to access this file (atomic/active). - FileType type; - // Name used inside prefs to persistent metadata. std::string prefs_key; // The last-seen time of this file to detect change. base::Time last_seen; + // Indicates if the data has been read out or not. + bool read_complete = false; + // Once a file has been recognized as needing to be read, it is |mapped| // into memory. If that file is "atomic" then the data from that file // will be copied to |data| and the mapped file released. If the file is @@ -68,9 +71,8 @@ const base::StringPiece prefs_key) { DCHECK(thread_checker_.CalledOnValidThread()); - scoped_ptr<FileInfo> file(new FileInfo()); + scoped_ptr<FileInfo> file(new FileInfo(type)); file->path = path; - file->type = type; file->prefs_key = prefs_key.as_string(); // |prefs_key| may be empty if the caller does not wish to persist the @@ -148,6 +150,7 @@ file->mapped.reset(); } + file->read_complete = false; return ACCESS_RESULT_SUCCESS; } @@ -232,6 +235,7 @@ void FileMetricsProvider::RecordFileAsSeen(FileInfo* file) { DCHECK(thread_checker_.CalledOnValidThread()); + file->read_complete = true; if (pref_service_ && !file->prefs_key.empty()) { pref_service_->SetInt64(metrics::prefs::kMetricsLastSeenPrefix + file->prefs_key, @@ -245,7 +249,15 @@ // Move finished metric files back to list of monitored files. for (auto iter = files_to_read_.begin(); iter != files_to_read_.end();) { auto temp = iter++; - const FileInfo* file = temp->get(); + FileInfo* file = temp->get(); + + // Atomic files are read once and then ignored unless they change. + if (file->type == FILE_HISTOGRAMS_ATOMIC && file->read_complete) { + DCHECK(!file->mapped); + file->allocator.reset(); + file->data.clear(); + } + if (!file->allocator && !file->mapped && file->data.empty()) files_to_check_.splice(files_to_check_.end(), files_to_read_, temp); } @@ -262,6 +274,10 @@ DCHECK(thread_checker_.CalledOnValidThread()); for (scoped_ptr<FileInfo>& file : files_to_read_) { + // Skip this file if the data has already been read. + if (file->read_complete) + continue; + // If the file is mapped or loaded then it needs to have an allocator // attached to it in order to read histograms out of it. if (file->mapped || !file->data.empty()) @@ -278,13 +294,8 @@ // Dump all histograms contained within the file to the snapshot-manager. RecordHistogramSnapshotsFromFile(snapshot_manager, file.get()); - // Atomic files are read once and then ignored unless they change. - if (file->type == FILE_HISTOGRAMS_ATOMIC) { - DCHECK(!file->mapped); - file->allocator.reset(); - file->data.clear(); - RecordFileAsSeen(file.get()); - } + // Update the last-seen time so it isn't read again unless it changes. + RecordFileAsSeen(file.get()); } }
diff --git a/components/mus/BUILD.gn b/components/mus/BUILD.gn index e3fb4524..d8bf2ce2 100644 --- a/components/mus/BUILD.gn +++ b/components/mus/BUILD.gn
@@ -79,6 +79,7 @@ "//components/mus/public/interfaces", "//components/mus/surfaces", "//components/mus/ws:lib", + "//components/mus/ws:test_interface", "//components/resource_provider/public/cpp", "//mojo/common:common_base", "//services/shell/public/cpp",
diff --git a/components/mus/common/args.cc b/components/mus/common/args.cc index 634828a..04bdc2f 100644 --- a/components/mus/common/args.cc +++ b/components/mus/common/args.cc
@@ -8,7 +8,8 @@ namespace mus { // Initializes X11 in threaded mode, and sets the |override_redirect| flag when -// creating X11 windows. -const char MUS_COMMON_EXPORT kUseX11TestConfig[] = "use-x11-test-config"; +// creating X11 windows. Also, exposes the WindowServerTest interface to clients +// when launched with this flag. +const char kUseTestConfig[] = "use-test-config"; } // namespace mus
diff --git a/components/mus/common/args.h b/components/mus/common/args.h index 02c1b52..772c524 100644 --- a/components/mus/common/args.h +++ b/components/mus/common/args.h
@@ -11,7 +11,7 @@ // All args in alphabetical order. The switches should be documented // alongside the definition of their values in the .cc file. -extern const char MUS_COMMON_EXPORT kUseX11TestConfig[]; +extern const char MUS_COMMON_EXPORT kUseTestConfig[]; } // namespace mus
diff --git a/components/mus/gles2/command_buffer_driver.cc b/components/mus/gles2/command_buffer_driver.cc index 1968114..3bb89a7 100644 --- a/components/mus/gles2/command_buffer_driver.cc +++ b/components/mus/gles2/command_buffer_driver.cc
@@ -129,12 +129,14 @@ // TODO(piman): ShaderTranslatorCache is currently per-ContextGroup but // only needs to be per-thread. const bool bind_generates_resource = attrib_helper.bind_generates_resource; + scoped_refptr<gpu::gles2::FeatureInfo> feature_info = + new gpu::gles2::FeatureInfo(gpu_state_->gpu_driver_bug_workarounds()); scoped_refptr<gpu::gles2::ContextGroup> context_group = new gpu::gles2::ContextGroup( gpu_state_->gpu_preferences(), gpu_state_->mailbox_manager(), new GpuMemoryTracker, new gpu::gles2::ShaderTranslatorCache(gpu_state_->gpu_preferences()), - new gpu::gles2::FramebufferCompletenessCache, nullptr, nullptr, + new gpu::gles2::FramebufferCompletenessCache, feature_info, nullptr, nullptr, bind_generates_resource); command_buffer_.reset(
diff --git a/components/mus/gles2/gpu_state.cc b/components/mus/gles2/gpu_state.cc index fce2d438..3733ff8 100644 --- a/components/mus/gles2/gpu_state.cc +++ b/components/mus/gles2/gpu_state.cc
@@ -21,6 +21,7 @@ GpuState::GpuState() : gpu_thread_("gpu_thread"), control_thread_("gpu_command_buffer_control"), + gpu_driver_bug_workarounds_(base::CommandLine::ForCurrentProcess()), hardware_rendering_available_(false) { base::ThreadRestrictions::ScopedAllowWait allow_wait; gpu_thread_.Start();
diff --git a/components/mus/gles2/gpu_state.h b/components/mus/gles2/gpu_state.h index aec23e4..27e239ad 100644 --- a/components/mus/gles2/gpu_state.h +++ b/components/mus/gles2/gpu_state.h
@@ -14,6 +14,7 @@ #include "gpu/command_buffer/service/gpu_preferences.h" #include "gpu/command_buffer/service/mailbox_manager_impl.h" #include "gpu/command_buffer/service/sync_point_manager.h" +#include "gpu/config/gpu_driver_bug_workarounds.h" #include "gpu/config/gpu_info.h" #include "ui/gl/gl_share_group.h" @@ -42,6 +43,10 @@ return gpu_preferences_; } + const gpu::GpuDriverBugWorkarounds& gpu_driver_bug_workarounds() const { + return gpu_driver_bug_workarounds_; + } + CommandBufferTaskRunner* command_buffer_task_runner() const { return command_buffer_task_runner_.get(); } @@ -86,6 +91,7 @@ scoped_refptr<base::SingleThreadTaskRunner> control_thread_task_runner_; gpu::GpuPreferences gpu_preferences_; + const gpu::GpuDriverBugWorkarounds gpu_driver_bug_workarounds_; scoped_refptr<CommandBufferTaskRunner> command_buffer_task_runner_; scoped_ptr<CommandBufferDriverManager> driver_manager_; scoped_ptr<gpu::SyncPointManager> sync_point_manager_;
diff --git a/components/mus/gles2/mojo_gpu_memory_buffer_manager.cc b/components/mus/gles2/mojo_gpu_memory_buffer_manager.cc index 08d9a38..6fe0ef00 100644 --- a/components/mus/gles2/mojo_gpu_memory_buffer_manager.cc +++ b/components/mus/gles2/mojo_gpu_memory_buffer_manager.cc
@@ -13,7 +13,7 @@ MojoGpuMemoryBufferManager::~MojoGpuMemoryBufferManager() {} -scoped_ptr<gfx::GpuMemoryBuffer> +std::unique_ptr<gfx::GpuMemoryBuffer> MojoGpuMemoryBufferManager::AllocateGpuMemoryBuffer(const gfx::Size& size, gfx::BufferFormat format, gfx::BufferUsage usage, @@ -21,7 +21,7 @@ return MojoGpuMemoryBufferImpl::Create(size, format, usage); } -scoped_ptr<gfx::GpuMemoryBuffer> +std::unique_ptr<gfx::GpuMemoryBuffer> MojoGpuMemoryBufferManager::CreateGpuMemoryBufferFromHandle( const gfx::GpuMemoryBufferHandle& handle, const gfx::Size& size,
diff --git a/components/mus/gles2/mojo_gpu_memory_buffer_manager.h b/components/mus/gles2/mojo_gpu_memory_buffer_manager.h index d7aae7be..d8b2287 100644 --- a/components/mus/gles2/mojo_gpu_memory_buffer_manager.h +++ b/components/mus/gles2/mojo_gpu_memory_buffer_manager.h
@@ -5,6 +5,8 @@ #ifndef COMPONENTS_MUS_GLES2_MOJO_GPU_MEMORY_BUFFER_MANAGER_H_ #define COMPONENTS_MUS_GLES2_MOJO_GPU_MEMORY_BUFFER_MANAGER_H_ +#include <memory> + #include "base/macros.h" #include "gpu/command_buffer/client/gpu_memory_buffer_manager.h" @@ -16,12 +18,12 @@ ~MojoGpuMemoryBufferManager() override; // Overridden from gpu::GpuMemoryBufferManager: - scoped_ptr<gfx::GpuMemoryBuffer> AllocateGpuMemoryBuffer( + std::unique_ptr<gfx::GpuMemoryBuffer> AllocateGpuMemoryBuffer( const gfx::Size& size, gfx::BufferFormat format, gfx::BufferUsage usage, int32_t surface_id) override; - scoped_ptr<gfx::GpuMemoryBuffer> CreateGpuMemoryBufferFromHandle( + std::unique_ptr<gfx::GpuMemoryBuffer> CreateGpuMemoryBufferFromHandle( const gfx::GpuMemoryBufferHandle& handle, const gfx::Size& size, gfx::BufferFormat format) override;
diff --git a/components/mus/mus_app.cc b/components/mus/mus_app.cc index f3f0a9b..b80e60f 100644 --- a/components/mus/mus_app.cc +++ b/components/mus/mus_app.cc
@@ -6,8 +6,9 @@ #include <set> +#include "base/bind.h" +#include "base/command_line.h" #include "base/memory/weak_ptr.h" -#include "base/stl_util.h" #include "base/threading/platform_thread.h" #include "build/build_config.h" #include "components/mus/common/args.h" @@ -17,6 +18,7 @@ #include "components/mus/ws/display_manager.h" #include "components/mus/ws/user_display_manager.h" #include "components/mus/ws/window_server.h" +#include "components/mus/ws/window_server_test_impl.h" #include "components/mus/ws/window_tree.h" #include "components/mus/ws/window_tree_binding.h" #include "components/mus/ws/window_tree_factory.h" @@ -34,7 +36,6 @@ #if defined(USE_X11) #include <X11/Xlib.h> -#include "base/command_line.h" #include "ui/platform_window/x11/x11_window.h" #elif defined(USE_OZONE) #include "ui/events/ozone/layout/keyboard_layout_engine.h" @@ -44,8 +45,9 @@ using shell::Connection; using mojo::InterfaceRequest; -using mus::mojom::WindowTreeHostFactory; using mus::mojom::Gpu; +using mus::mojom::WindowServerTest; +using mus::mojom::WindowTreeHostFactory; namespace mus { @@ -64,11 +66,10 @@ }; struct MandolineUIServicesApp::UserState { - scoped_ptr<ws::WindowTreeFactory> window_tree_factory; scoped_ptr<ws::WindowTreeHostFactory> window_tree_host_factory; }; -MandolineUIServicesApp::MandolineUIServicesApp() {} +MandolineUIServicesApp::MandolineUIServicesApp() : test_config_(false) {} MandolineUIServicesApp::~MandolineUIServicesApp() { // Destroy |window_server_| first, since it depends on |event_source_|. @@ -130,12 +131,12 @@ tracing_.Initialize(connector, identity.name()); TRACE_EVENT0("mus", "MandolineUIServicesApp::Initialize started"); + test_config_ = + base::CommandLine::ForCurrentProcess()->HasSwitch(kUseTestConfig); #if defined(USE_X11) XInitThreads(); - base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); - if (command_line->HasSwitch(kUseX11TestConfig)) { + if (test_config_) ui::test::SetUseOverrideRedirectWindowByDefault(true); - } #endif InitializeResources(connector); @@ -179,6 +180,8 @@ connection->AddInterface<WindowTreeHostFactory>(this); connection->AddInterface<mojom::WindowManagerFactoryService>(this); connection->AddInterface<mojom::WindowTreeFactory>(this); + if (test_config_) + connection->AddInterface<WindowServerTest>(this); return true; } @@ -195,6 +198,10 @@ base::MessageLoop::current()->QuitWhenIdle(); } +bool MandolineUIServicesApp::IsTestConfig() const { + return test_config_; +} + void MandolineUIServicesApp::CreateDefaultDisplays() { // Display manages its own lifetime. ws::Display* host_impl = @@ -235,12 +242,9 @@ return; } AddUserIfNecessary(connection); - UserState* user_state = GetUserState(connection); - if (!user_state->window_tree_factory) { - user_state->window_tree_factory.reset(new ws::WindowTreeFactory( - window_server_.get(), connection->GetRemoteIdentity().user_id())); - } - user_state->window_tree_factory->AddBinding(std::move(request)); + new ws::WindowTreeFactory( + window_server_.get(), connection->GetRemoteIdentity().user_id(), + connection->GetRemoteIdentity().name(), std::move(request)); } void MandolineUIServicesApp::Create( @@ -255,6 +259,13 @@ user_state->window_tree_host_factory->AddBinding(std::move(request)); } +void MandolineUIServicesApp::Create(Connection* connection, + mojom::WindowServerTestRequest request) { + if (!test_config_) + return; + new ws::WindowServerTestImpl(window_server_.get(), std::move(request)); +} + void MandolineUIServicesApp::Create(shell::Connection* connection, mojom::GpuRequest request) { DCHECK(platform_display_init_params_.gpu_state);
diff --git a/components/mus/mus_app.h b/components/mus/mus_app.h index e07f0bd..e9cff2d 100644 --- a/components/mus/mus_app.h +++ b/components/mus/mus_app.h
@@ -16,6 +16,7 @@ #include "components/mus/public/interfaces/gpu.mojom.h" #include "components/mus/public/interfaces/user_access_manager.mojom.h" #include "components/mus/public/interfaces/window_manager_factory.mojom.h" +#include "components/mus/public/interfaces/window_server_test.mojom.h" #include "components/mus/public/interfaces/window_tree.mojom.h" #include "components/mus/public/interfaces/window_tree_host.mojom.h" #include "components/mus/ws/platform_display_init_params.h" @@ -52,6 +53,7 @@ public shell::InterfaceFactory<mojom::WindowManagerFactoryService>, public shell::InterfaceFactory<mojom::WindowTreeFactory>, public shell::InterfaceFactory<mojom::WindowTreeHostFactory>, + public shell::InterfaceFactory<mojom::WindowServerTest>, public shell::InterfaceFactory<mojom::Gpu> { public: MandolineUIServicesApp(); @@ -84,6 +86,7 @@ // WindowServerDelegate: void OnFirstDisplayReady() override; void OnNoMoreDisplays() override; + bool IsTestConfig() const override; void CreateDefaultDisplays() override; // shell::InterfaceFactory<mojom::DisplayManager> implementation. @@ -106,6 +109,10 @@ void Create(shell::Connection* connection, mojom::WindowTreeHostFactoryRequest request) override; + // shell::InterfaceFactory<mojom::WindowServerTest> implementation. + void Create(shell::Connection* connection, + mojom::WindowServerTestRequest request) override; + // shell::InterfaceFactory<mojom::Gpu> implementation. void Create(shell::Connection* connection, mojom::GpuRequest request) override; @@ -119,6 +126,7 @@ UserIdToUserState user_id_to_user_state_; + bool test_config_; #if defined(USE_OZONE) scoped_ptr<ui::ClientNativePixmapFactory> client_native_pixmap_factory_; #endif
diff --git a/components/mus/public/cpp/tests/window_server_shelltest_base.cc b/components/mus/public/cpp/tests/window_server_shelltest_base.cc index 3f97150..b7cc079 100644 --- a/components/mus/public/cpp/tests/window_server_shelltest_base.cc +++ b/components/mus/public/cpp/tests/window_server_shelltest_base.cc
@@ -45,7 +45,7 @@ WindowServerShellTestBase::WindowServerShellTestBase() : ShellTest(kTestAppName) { - EnsureCommandLineSwitch(kUseX11TestConfig); + EnsureCommandLineSwitch(kUseTestConfig); EnsureCommandLineSwitch(switches::kOverrideUseGLWithOSMesaForTests); }
diff --git a/components/mus/public/interfaces/BUILD.gn b/components/mus/public/interfaces/BUILD.gn index aec2de5..f31b08b3 100644 --- a/components/mus/public/interfaces/BUILD.gn +++ b/components/mus/public/interfaces/BUILD.gn
@@ -23,6 +23,7 @@ "window_manager.mojom", "window_manager_constants.mojom", "window_manager_factory.mojom", + "window_server_test.mojom", "window_tree.mojom", "window_tree_host.mojom", ] @@ -37,7 +38,4 @@ "//ui/mojo/geometry:interfaces", "//ui/mojo/ime:interfaces", ] - - typemaps = [ "//gpu/command_buffer/common/mojo.typemap" ] - typemap_deps = [ "//gpu/ipc/common:command_buffer_traits" ] }
diff --git a/components/mus/public/interfaces/window_server_test.mojom b/components/mus/public/interfaces/window_server_test.mojom new file mode 100644 index 0000000..6e03ab23 --- /dev/null +++ b/components/mus/public/interfaces/window_server_test.mojom
@@ -0,0 +1,9 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module mus.mojom; + +interface WindowServerTest { + EnsureClientHasDrawnWindow(string client_name) => (bool success); +};
diff --git a/components/mus/surfaces/surfaces_context_provider.cc b/components/mus/surfaces/surfaces_context_provider.cc index 44e45798..a2271d21 100644 --- a/components/mus/surfaces/surfaces_context_provider.cc +++ b/components/mus/surfaces/surfaces_context_provider.cc
@@ -31,7 +31,6 @@ gfx::AcceleratedWidget widget, const scoped_refptr<GpuState>& state) : delegate_(nullptr), widget_(widget), command_buffer_local_(nullptr) { - capabilities_.gpu.image = true; command_buffer_local_ = new CommandBufferLocal(this, widget_, state); }
diff --git a/components/mus/ws/BUILD.gn b/components/mus/ws/BUILD.gn index 4d7608b82..d9326fe 100644 --- a/components/mus/ws/BUILD.gn +++ b/components/mus/ws/BUILD.gn
@@ -116,6 +116,20 @@ } } +source_set("test_interface") { + sources = [ + "window_server_test_impl.cc", + "window_server_test_impl.h", + ] + + deps = [ + ":lib", + "//components/mus/public/interfaces", + "//mojo/public/cpp/bindings:bindings", + "//ui/gfx", + ] +} + source_set("test_support") { testonly = true
diff --git a/components/mus/ws/server_window_surface.cc b/components/mus/ws/server_window_surface.cc index 48fa3c6..3484200 100644 --- a/components/mus/ws/server_window_surface.cc +++ b/components/mus/ws/server_window_surface.cc
@@ -75,8 +75,8 @@ surface_factory_.SubmitCompositorFrame(surface_id_, ConvertCompositorFrame(frame), base::Bind(&CallCallback, callback)); - window()->delegate()->OnScheduleWindowPaint(window()); last_submitted_frame_size_ = frame_size; + window()->delegate()->OnScheduleWindowPaint(window()); } void ServerWindowSurface::DestroySurfacesScheduledForDestruction() {
diff --git a/components/mus/ws/server_window_surface_manager.cc b/components/mus/ws/server_window_surface_manager.cc index 83323d2..e9ab658 100644 --- a/components/mus/ws/server_window_surface_manager.cc +++ b/components/mus/ws/server_window_surface_manager.cc
@@ -53,16 +53,16 @@ type_to_surface_map_[surface_type] = std::move(surface); } -ServerWindowSurface* ServerWindowSurfaceManager::GetDefaultSurface() { +ServerWindowSurface* ServerWindowSurfaceManager::GetDefaultSurface() const { return GetSurfaceByType(mojom::SurfaceType::DEFAULT); } -ServerWindowSurface* ServerWindowSurfaceManager::GetUnderlaySurface() { +ServerWindowSurface* ServerWindowSurfaceManager::GetUnderlaySurface() const { return GetSurfaceByType(mojom::SurfaceType::UNDERLAY); } ServerWindowSurface* ServerWindowSurfaceManager::GetSurfaceByType( - mojom::SurfaceType type) { + mojom::SurfaceType type) const { auto iter = type_to_surface_map_.find(type); return iter == type_to_surface_map_.end() ? nullptr : iter->second.get(); } @@ -72,7 +72,7 @@ return type_to_surface_map_.count(type) > 0; } -bool ServerWindowSurfaceManager::HasAnySurface() { +bool ServerWindowSurfaceManager::HasAnySurface() const { return GetDefaultSurface() || GetUnderlaySurface(); }
diff --git a/components/mus/ws/server_window_surface_manager.h b/components/mus/ws/server_window_surface_manager.h index 872e477..cfa5524 100644 --- a/components/mus/ws/server_window_surface_manager.h +++ b/components/mus/ws/server_window_surface_manager.h
@@ -40,11 +40,11 @@ ServerWindow* window() { return window_; } - ServerWindowSurface* GetDefaultSurface(); - ServerWindowSurface* GetUnderlaySurface(); - ServerWindowSurface* GetSurfaceByType(mojom::SurfaceType type); + ServerWindowSurface* GetDefaultSurface() const; + ServerWindowSurface* GetUnderlaySurface() const; + ServerWindowSurface* GetSurfaceByType(mojom::SurfaceType type) const; bool HasSurfaceOfType(mojom::SurfaceType type) const; - bool HasAnySurface(); + bool HasAnySurface() const; uint32_t id_namespace() const { return surface_id_allocator_.id_namespace(); } cc::SurfaceManager* GetSurfaceManager();
diff --git a/components/mus/ws/test_utils.cc b/components/mus/ws/test_utils.cc index d1563da..895556ee 100644 --- a/components/mus/ws/test_utils.cc +++ b/components/mus/ws/test_utils.cc
@@ -329,6 +329,10 @@ AddDisplay(); } +bool TestWindowServerDelegate::IsTestConfig() const { + return true; +} + ServerWindow* FirstRoot(WindowTree* tree) { return tree->roots().size() == 1u ? tree->GetWindow((*tree->roots().begin())->id())
diff --git a/components/mus/ws/test_utils.h b/components/mus/ws/test_utils.h index e10672bb..9918185 100644 --- a/components/mus/ws/test_utils.h +++ b/components/mus/ws/test_utils.h
@@ -369,6 +369,7 @@ mojom::WindowTreeRequest* tree_request, mojom::WindowTreeClientPtr* client) override; void CreateDefaultDisplays() override; + bool IsTestConfig() const override; private: // If CreateDefaultDisplays() this is the number of Displays that are
diff --git a/components/mus/ws/window_server.cc b/components/mus/ws/window_server.cc index 6d73462..3fff3c2 100644 --- a/components/mus/ws/window_server.cc +++ b/components/mus/ws/window_server.cc
@@ -171,6 +171,15 @@ return iter == tree_map_.end() ? nullptr : iter->second.get(); } +WindowTree* WindowServer::GetTreeWithConnectionName( + const std::string& connection_name) { + for (const auto& entry : tree_map_) { + if (entry.second->connection_name() == connection_name) + return entry.second.get(); + } + return nullptr; +} + ServerWindow* WindowServer::GetWindow(const WindowId& id) { // kInvalidConnectionId is used for Display and WindowManager nodes. if (id.connection_id == kInvalidConnectionId) { @@ -399,6 +408,14 @@ display->OnCursorUpdated(window); } +void WindowServer::SetPaintCallback( + const base::Callback<void(ServerWindow*)>& callback) { + DCHECK(delegate_->IsTestConfig()) << "Paint callbacks are expensive, and " + << "allowed only in tests."; + DCHECK(window_paint_callback_.is_null() || callback.is_null()); + window_paint_callback_ = callback; +} + void WindowServer::ProcessViewportMetricsChanged( Display* display, const mojom::ViewportMetrics& old_metrics, @@ -448,8 +465,12 @@ } void WindowServer::OnScheduleWindowPaint(ServerWindow* window) { - if (!in_destructor_) - SchedulePaint(window, gfx::Rect(window->bounds().size())); + if (in_destructor_) + return; + + SchedulePaint(window, gfx::Rect(window->bounds().size())); + if (!window_paint_callback_.is_null()) + window_paint_callback_.Run(window); } const ServerWindow* WindowServer::GetRootWindow(
diff --git a/components/mus/ws/window_server.h b/components/mus/ws/window_server.h index e831809..309788f 100644 --- a/components/mus/ws/window_server.h +++ b/components/mus/ws/window_server.h
@@ -90,6 +90,8 @@ // Returns the connection by id. WindowTree* GetTreeWithId(ConnectionSpecificId connection_id); + WindowTree* GetTreeWithConnectionName(const std::string& connection_name); + size_t num_trees() const { return tree_map_.size(); } // Returns the Window identified by |id|. @@ -186,6 +188,10 @@ void ProcessWillChangeWindowPredefinedCursor(ServerWindow* window, int32_t cursor_id); + // Sets a callback to be called whenever a ServerWindow is scheduled for + // a [re]paint. This should only be called in a test configuration. + void SetPaintCallback(const base::Callback<void(ServerWindow*)>& callback); + private: friend class Operation; @@ -298,6 +304,8 @@ // Next id supplied to the window manager. uint32_t next_wm_change_id_; + base::Callback<void(ServerWindow*)> window_paint_callback_; + WindowManagerFactoryRegistry window_manager_factory_registry_; DISALLOW_COPY_AND_ASSIGN(WindowServer);
diff --git a/components/mus/ws/window_server_delegate.h b/components/mus/ws/window_server_delegate.h index 05e32a01..9ccc561 100644 --- a/components/mus/ws/window_server_delegate.h +++ b/components/mus/ws/window_server_delegate.h
@@ -46,6 +46,8 @@ virtual void OnNoMoreDisplays() = 0; + virtual bool IsTestConfig() const = 0; + // Creates a WindowTreeBinding. Default implementation returns null, which // creates DefaultBinding. virtual scoped_ptr<WindowTreeBinding> CreateWindowTreeBinding(
diff --git a/components/mus/ws/window_server_test_impl.cc b/components/mus/ws/window_server_test_impl.cc new file mode 100644 index 0000000..d679b45 --- /dev/null +++ b/components/mus/ws/window_server_test_impl.cc
@@ -0,0 +1,66 @@ +// 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 "components/mus/ws/window_server_test_impl.h" + +#include "components/mus/public/interfaces/window_tree.mojom.h" +#include "components/mus/ws/server_window.h" +#include "components/mus/ws/server_window_surface_manager.h" +#include "components/mus/ws/window_server.h" +#include "components/mus/ws/window_tree.h" + +namespace mus { +namespace ws { + +namespace { + +bool WindowHasValidFrame(const ServerWindow* window) { + const ServerWindowSurfaceManager* manager = window->surface_manager(); + return manager && + !manager->GetDefaultSurface()->last_submitted_frame_size().IsEmpty(); +} + +} // namespace + +WindowServerTestImpl::WindowServerTestImpl( + WindowServer* window_server, + mojo::InterfaceRequest<WindowServerTest> request) + : window_server_(window_server), binding_(this, std::move(request)) {} + +WindowServerTestImpl::~WindowServerTestImpl() {} + +void WindowServerTestImpl::OnWindowPaint( + const std::string& name, + const EnsureClientHasDrawnWindowCallback& cb, + ServerWindow* window) { + WindowTree* tree = window_server_->GetTreeWithConnectionName(name); + if (!tree) + return; + if (tree->HasRoot(window) && WindowHasValidFrame(window)) { + cb.Run(true); + window_server_->SetPaintCallback(base::Callback<void(ServerWindow*)>()); + } +} + +void WindowServerTestImpl::EnsureClientHasDrawnWindow( + const mojo::String& client_name, + const EnsureClientHasDrawnWindowCallback& callback) { + std::string name = client_name.To<std::string>(); + WindowTree* tree = window_server_->GetTreeWithConnectionName(name); + if (tree) { + for (const ServerWindow* window : tree->roots()) { + if (WindowHasValidFrame(window)) { + callback.Run(true); + return; + } + } + } + + window_server_->SetPaintCallback( + base::Bind(&WindowServerTestImpl::OnWindowPaint, base::Unretained(this), + name, std::move(callback))); +} + +} // namespace ws +} // namespace mus
diff --git a/components/mus/ws/window_server_test_impl.h b/components/mus/ws/window_server_test_impl.h new file mode 100644 index 0000000..deacb77 --- /dev/null +++ b/components/mus/ws/window_server_test_impl.h
@@ -0,0 +1,45 @@ +// 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 COMPONENTS_MUS_WS_WINDOW_SERVER_TEST_IMPL_H_ +#define COMPONENTS_MUS_WS_WINDOW_SERVER_TEST_IMPL_H_ + +#include "components/mus/public/interfaces/window_server_test.mojom.h" +#include "mojo/public/cpp/bindings/strong_binding.h" + +namespace mus { +namespace ws { + +class ServerWindow; +class WindowServer; +class WindowTree; +struct WindowId; + +class WindowServerTestImpl : public mojom::WindowServerTest { + public: + WindowServerTestImpl(WindowServer* server, + mojo::InterfaceRequest<WindowServerTest> request); + + private: + ~WindowServerTestImpl() override; + + void OnWindowPaint(const std::string& name, + const EnsureClientHasDrawnWindowCallback& cb, + ServerWindow* window); + + // mojom::WindowServerTest: + void EnsureClientHasDrawnWindow( + const mojo::String& client_name, + const EnsureClientHasDrawnWindowCallback& callback) override; + + WindowServer* window_server_; + mojo::StrongBinding<WindowServerTest> binding_; + + DISALLOW_COPY_AND_ASSIGN(WindowServerTestImpl); +}; + +} // namespace ws +} // namespace mus + +#endif // COMPONENTS_MUS_WS_WINDOW_SERVER_TEST_IMPL_H_
diff --git a/components/mus/ws/window_tree.h b/components/mus/ws/window_tree.h index ab8e624..6156d24 100644 --- a/components/mus/ws/window_tree.h +++ b/components/mus/ws/window_tree.h
@@ -109,6 +109,9 @@ std::set<const ServerWindow*> roots() { return roots_; } + void set_connection_name(const std::string& name) { connection_name_ = name; } + const std::string& connection_name() const { return connection_name_; } + const Display* GetDisplay(const ServerWindow* window) const; Display* GetDisplay(const ServerWindow* window) { return const_cast<Display*>( @@ -407,6 +410,7 @@ // Id of this tree as assigned by WindowServer. const ConnectionSpecificId id_; + std::string connection_name_; ConnectionSpecificId next_window_id_;
diff --git a/components/mus/ws/window_tree_factory.cc b/components/mus/ws/window_tree_factory.cc index 4d2552c..f31b286 100644 --- a/components/mus/ws/window_tree_factory.cc +++ b/components/mus/ws/window_tree_factory.cc
@@ -13,16 +13,16 @@ namespace ws { WindowTreeFactory::WindowTreeFactory(WindowServer* window_server, - const UserId& user_id) - : window_server_(window_server), user_id_(user_id) {} + const UserId& user_id, + const std::string& connection_name, + mojom::WindowTreeFactoryRequest request) + : window_server_(window_server), + user_id_(user_id), + connection_name_(connection_name), + binding_(this, std::move(request)) {} WindowTreeFactory::~WindowTreeFactory() {} -void WindowTreeFactory::AddBinding( - mojo::InterfaceRequest<mus::mojom::WindowTreeFactory> request) { - binding_.AddBinding(this, std::move(request)); -} - void WindowTreeFactory::CreateWindowTree( mojo::InterfaceRequest<mojom::WindowTree> tree_request, mojom::WindowTreeClientPtr client) { @@ -33,6 +33,7 @@ new ws::DefaultWindowTreeBinding(service.get(), window_server_, std::move(tree_request), std::move(client))); + service->set_connection_name(connection_name_); window_server_->AddTree(std::move(service), std::move(binding), nullptr); }
diff --git a/components/mus/ws/window_tree_factory.h b/components/mus/ws/window_tree_factory.h index 5ace24f..1884b04 100644 --- a/components/mus/ws/window_tree_factory.h +++ b/components/mus/ws/window_tree_factory.h
@@ -8,7 +8,7 @@ #include "base/macros.h" #include "components/mus/public/interfaces/window_tree.mojom.h" #include "components/mus/ws/user_id.h" -#include "mojo/public/cpp/bindings/binding_set.h" +#include "mojo/public/cpp/bindings/strong_binding.h" namespace mus { namespace ws { @@ -17,21 +17,21 @@ class WindowTreeFactory : public mus::mojom::WindowTreeFactory { public: - WindowTreeFactory(WindowServer* window_server, const UserId& user_id); + WindowTreeFactory(WindowServer* window_server, + const UserId& user_id, + const std::string& connection_name, + mojom::WindowTreeFactoryRequest request); + private: ~WindowTreeFactory() override; - void AddBinding( - mojo::InterfaceRequest<mus::mojom::WindowTreeFactory> request); - // mus::mojom::WindowTreeFactory: void CreateWindowTree(mojo::InterfaceRequest<mojom::WindowTree> tree_request, mojom::WindowTreeClientPtr client) override; - private: WindowServer* window_server_; const UserId user_id_; - - mojo::BindingSet<mus::mojom::WindowTreeFactory> binding_; + const std::string connection_name_; + mojo::StrongBinding<mus::mojom::WindowTreeFactory> binding_; DISALLOW_COPY_AND_ASSIGN(WindowTreeFactory); };
diff --git a/components/nacl/browser/nacl_process_host.cc b/components/nacl/browser/nacl_process_host.cc index f1af838..63216d6b 100644 --- a/components/nacl/browser/nacl_process_host.cc +++ b/components/nacl/browser/nacl_process_host.cc
@@ -719,20 +719,6 @@ ScopedChannelHandle ppapi_channel_handle, ScopedChannelHandle trusted_channel_handle, ScopedChannelHandle manifest_service_channel_handle) { -#if defined(OS_WIN) - // If we are on 64-bit Windows, the NaCl process's sandbox is - // managed by a different process from the renderer's sandbox. We - // need to inform the renderer's sandbox about the NaCl process so - // that the renderer can send handles to the NaCl process using - // BrokerDuplicateHandle(). - if (RunningOnWOW64()) { - if (!content::BrokerAddTargetPeer(process_->GetData().handle)) { - SendErrorToRenderer("BrokerAddTargetPeer() failed"); - return; - } - } -#endif - // Hereafter, we always send an IPC message with handles created above // which, on Windows, are not closable in this process. std::string error_message;
diff --git a/components/neterror/OWNERS b/components/neterror/OWNERS index 0c27a2f..fd1666b4 100644 --- a/components/neterror/OWNERS +++ b/components/neterror/OWNERS
@@ -1,3 +1,3 @@ jar@chromium.org mmenke@chromium.org -ttuttle@chromium.org +juliatuttle@chromium.org
diff --git a/components/network_hints/OWNERS b/components/network_hints/OWNERS index 1535646..76224884 100644 --- a/components/network_hints/OWNERS +++ b/components/network_hints/OWNERS
@@ -1,2 +1,2 @@ jar@chromium.org -ttuttle@chromium.org +juliatuttle@chromium.org
diff --git a/components/ntp_snippets/ntp_snippet.cc b/components/ntp_snippets/ntp_snippet.cc index 863f577..dcac6d2 100644 --- a/components/ntp_snippets/ntp_snippet.cc +++ b/components/ntp_snippets/ntp_snippet.cc
@@ -17,6 +17,8 @@ const char kSnippet[] = "snippet"; const char kPublishDate[] = "creationTimestampSec"; const char kExpiryDate[] = "expiryTimestampSec"; +const char kSourceCorpusInfo[] = "sourceCorpusInfo"; +const char kAmpUrl[] = "ampUrl"; } // namespace @@ -64,6 +66,20 @@ if (dict.GetString(kExpiryDate, &expiry_timestamp_str)) snippet->set_expiry_date(TimeFromJsonString(expiry_timestamp_str)); + const base::ListValue* corpus_infos_list = nullptr; + if (dict.GetList(kSourceCorpusInfo, &corpus_infos_list)) { + for (base::Value* value : *corpus_infos_list) { + const base::DictionaryValue* dict_value = nullptr; + if (value->GetAsDictionary(&dict_value)) { + std::string amp_url; + if (dict_value->GetString(kAmpUrl, &_url)) { + snippet->set_amp_url(GURL(amp_url)); + break; + } + } + } + } + return snippet; } @@ -85,7 +101,14 @@ dict->SetString(kPublishDate, TimeToJsonString(publish_date_)); if (!expiry_date_.is_null()) dict->SetString(kExpiryDate, TimeToJsonString(expiry_date_)); - + if (amp_url_.is_valid()) { + std::unique_ptr<base::ListValue> corpus_infos_list(new base::ListValue); + std::unique_ptr<base::DictionaryValue> corpus_info_dict( + new base::DictionaryValue); + corpus_info_dict->SetString(kAmpUrl, amp_url_.spec()); + corpus_infos_list->Set(0, std::move(corpus_info_dict)); + dict->Set(kSourceCorpusInfo, std::move(corpus_infos_list)); + } return dict; }
diff --git a/components/ntp_snippets/ntp_snippet.h b/components/ntp_snippets/ntp_snippet.h index d3a4060..6880984 100644 --- a/components/ntp_snippets/ntp_snippet.h +++ b/components/ntp_snippets/ntp_snippet.h
@@ -79,6 +79,9 @@ expiry_date_ = expiry_date; } + const GURL& amp_url() const { return amp_url_; } + void set_amp_url(const GURL& amp_url) { amp_url_ = amp_url; } + // Public for testing. static base::Time TimeFromJsonString(const std::string& timestamp_str); static std::string TimeToJsonString(const base::Time& time); @@ -92,6 +95,7 @@ std::string snippet_; base::Time publish_date_; base::Time expiry_date_; + GURL amp_url_; DISALLOW_COPY_AND_ASSIGN(NTPSnippet); };
diff --git a/components/ntp_snippets/ntp_snippets_scheduler.h b/components/ntp_snippets/ntp_snippets_scheduler.h index c374409..d46e03b1 100644 --- a/components/ntp_snippets/ntp_snippets_scheduler.h +++ b/components/ntp_snippets/ntp_snippets_scheduler.h
@@ -14,13 +14,18 @@ class NTPSnippetsScheduler { public: // Schedule periodic fetching of snippets, with different period depending on - // network and charging state. The concrete implementation should call - // NTPSnippetsService::FetchSnippets once per period. + // network and charging state, and also set up a delay after which the periods + // may change. The concrete implementation should call + // NTPSnippetsService::FetchSnippets once per period, and + // NTPSnippetsService::RescheduleFetching at |reschedule_time|. + // Any of the values can be zero to indicate that the corresponding task + // should not be scheduled. virtual bool Schedule(base::TimeDelta period_wifi_charging, base::TimeDelta period_wifi, - base::TimeDelta period_fallback) = 0; + base::TimeDelta period_fallback, + base::Time reschedule_time) = 0; - // Cancel the scheduled fetching task, if any. + // Cancel any scheduled tasks. virtual bool Unschedule() = 0; protected:
diff --git a/components/ntp_snippets/ntp_snippets_service.cc b/components/ntp_snippets/ntp_snippets_service.cc index 79cdcb3..781604d 100644 --- a/components/ntp_snippets/ntp_snippets_service.cc +++ b/components/ntp_snippets/ntp_snippets_service.cc
@@ -35,6 +35,11 @@ const int kFetchingIntervalWifiSeconds = 2 * 60 * 60; const int kFetchingIntervalFallbackSeconds = 24 * 60 * 60; +// These define the times of day during which we will fetch via Wifi (without +// charging) - 6 AM to 10 PM. +const int kWifiFetchingHourMin = 6; +const int kWifiFetchingHourMax = 22; + const int kDefaultExpiryTimeMins = 24 * 60; base::TimeDelta GetFetchingInterval(const char* switch_name, @@ -57,9 +62,16 @@ kFetchingIntervalWifiChargingSeconds); } -base::TimeDelta GetFetchingIntervalWifi() { - return GetFetchingInterval(switches::kFetchingIntervalWifiSeconds, - kFetchingIntervalWifiSeconds); +base::TimeDelta GetFetchingIntervalWifi(const base::Time& now) { + // Only fetch via Wifi (without charging) during the proper times of day. + base::Time::Exploded exploded; + now.LocalExplode(&exploded); + if (kWifiFetchingHourMin <= exploded.hour && + exploded.hour < kWifiFetchingHourMax) { + return GetFetchingInterval(switches::kFetchingIntervalWifiSeconds, + kFetchingIntervalWifiSeconds); + } + return base::TimeDelta(); } base::TimeDelta GetFetchingIntervalFallback() { @@ -67,6 +79,31 @@ kFetchingIntervalFallbackSeconds); } +base::Time GetRescheduleTime(const base::Time& now) { + base::Time::Exploded exploded; + now.LocalExplode(&exploded); + // The scheduling changes at both |kWifiFetchingHourMin| and + // |kWifiFetchingHourMax|. Find the time of the next one that we'll hit. + bool next_day = false; + if (exploded.hour < kWifiFetchingHourMin) { + exploded.hour = kWifiFetchingHourMin; + } else if (exploded.hour < kWifiFetchingHourMax) { + exploded.hour = kWifiFetchingHourMax; + } else { + next_day = true; + exploded.hour = kWifiFetchingHourMin; + } + // In any case, reschedule at the full hour. + exploded.minute = 0; + exploded.second = 0; + exploded.millisecond = 0; + base::Time reschedule = base::Time::FromLocalExploded(exploded); + if (next_day) + reschedule += base::TimeDelta::FromDays(1); + + return reschedule; +} + // Extracts the hosts from |suggestions| and returns them in a set. std::set<std::string> GetSuggestionsHostsImpl( const SuggestionsProfile& suggestions) { @@ -124,7 +161,8 @@ NTPSnippetsScheduler* scheduler, scoped_ptr<NTPSnippetsFetcher> snippets_fetcher, const ParseJSONCallback& parse_json_callback) - : pref_service_(pref_service), + : enabled_(false), + pref_service_(pref_service), suggestions_service_(suggestions_service), file_task_runner_(file_task_runner), application_language_code_(application_language_code), @@ -146,7 +184,8 @@ } void NTPSnippetsService::Init(bool enabled) { - if (enabled) { + enabled_ = enabled; + if (enabled_) { // |suggestions_service_| can be null in tests. if (suggestions_service_) { suggestions_service_subscription_ = suggestions_service_->AddCallback( @@ -163,22 +202,13 @@ FetchSnippets(); } - // The scheduler only exists on Android so far, it's null on other platforms. - if (!scheduler_) - return; - - if (enabled) { - scheduler_->Schedule(GetFetchingIntervalWifiCharging(), - GetFetchingIntervalWifi(), - GetFetchingIntervalFallback()); - } else { - scheduler_->Unschedule(); - } + RescheduleFetching(); } void NTPSnippetsService::Shutdown() { FOR_EACH_OBSERVER(NTPSnippetsServiceObserver, observers_, NTPSnippetsServiceShutdown()); + enabled_ = false; } void NTPSnippetsService::FetchSnippets() { @@ -196,6 +226,21 @@ snippets_fetcher_->FetchSnippets(hosts); } +void NTPSnippetsService::RescheduleFetching() { + // The scheduler only exists on Android so far, it's null on other platforms. + if (!scheduler_) + return; + + if (enabled_) { + base::Time now = base::Time::Now(); + scheduler_->Schedule( + GetFetchingIntervalWifiCharging(), GetFetchingIntervalWifi(now), + GetFetchingIntervalFallback(), GetRescheduleTime(now)); + } else { + scheduler_->Unschedule(); + } +} + void NTPSnippetsService::ClearSnippets() { snippets_.clear(); @@ -239,7 +284,6 @@ void NTPSnippetsService::AddObserver(NTPSnippetsServiceObserver* observer) { observers_.AddObserver(observer); - observer->NTPSnippetsServiceLoaded(); } void NTPSnippetsService::RemoveObserver(NTPSnippetsServiceObserver* observer) {
diff --git a/components/ntp_snippets/ntp_snippets_service.h b/components/ntp_snippets/ntp_snippets_service.h index 39e8dc8..4269f941 100644 --- a/components/ntp_snippets/ntp_snippets_service.h +++ b/components/ntp_snippets/ntp_snippets_service.h
@@ -79,6 +79,10 @@ // suggestions from the suggestion service) and adds them to the current ones. void FetchSnippetsFromHosts(const std::set<std::string>& hosts); + // (Re)schedules the periodic fetching of snippets. This is necessary because + // the schedule depends on the time of day + void RescheduleFetching(); + // Deletes all currently stored snippets. void ClearSnippets(); @@ -148,6 +152,8 @@ void RemoveExpiredSnippets(); + bool enabled_; + PrefService* pref_service_; suggestions::SuggestionsService* suggestions_service_;
diff --git a/components/ntp_snippets/ntp_snippets_service_unittest.cc b/components/ntp_snippets/ntp_snippets_service_unittest.cc index b42a450..02be166 100644 --- a/components/ntp_snippets/ntp_snippets_service_unittest.cc +++ b/components/ntp_snippets/ntp_snippets_service_unittest.cc
@@ -39,7 +39,10 @@ "\"snippet\" : \"Snippet\"," "\"thumbnailUrl\" : \"http://localhost/salient_image\"," "\"creationTimestampSec\" : \"%s\"," - "\"expiryTimestampSec\" : \"%s\"" + "\"expiryTimestampSec\" : \"%s\"," + "\"sourceCorpusInfo\" : [ " + "{\"ampUrl\" : \"http://localhost/amp\"}," + "{\"corpusId\" : \"id\"}]" "}}" "]}"; @@ -181,6 +184,7 @@ EXPECT_EQ(snippet.salient_image_url(), GURL("http://localhost/salient_image")); EXPECT_EQ(GetDefaultCreationTime(), snippet.publish_date()); + EXPECT_EQ(snippet.amp_url(), GURL("http://localhost/amp")); } }
diff --git a/components/omnibox/browser/BUILD.gn b/components/omnibox/browser/BUILD.gn index fdef09d..6f6ae15 100644 --- a/components/omnibox/browser/BUILD.gn +++ b/components/omnibox/browser/BUILD.gn
@@ -191,6 +191,21 @@ ] } +bundle_data("unit_tests_bundle_data") { + visibility = [ ":unit_tests" ] + testonly = true + sources = [ + "//components/test/data/omnibox/Shortcuts.no_fill_into_edit.sql", + "//components/test/data/omnibox/Shortcuts.v0.sql", + "//components/test/data/omnibox/in_memory_url_index_test.db.txt", + "//components/test/data/omnibox/in_memory_url_index_test_limited.db.txt", + ] + outputs = [ + "{{bundle_resources_dir}}/" + + "{{source_root_relative_dir}}/{{source_file_part}}", + ] +} + source_set("unit_tests") { testonly = true sources = [ @@ -223,6 +238,7 @@ deps = [ ":browser", ":test_support", + ":unit_tests_bundle_data", "//base", "//base/test:test_support", "//components/bookmarks/browser",
diff --git a/components/page_load_metrics/OWNERS b/components/page_load_metrics/OWNERS index 558b9927..d275084 100644 --- a/components/page_load_metrics/OWNERS +++ b/components/page_load_metrics/OWNERS
@@ -1,4 +1,4 @@ csharrison@chromium.org kinuko@chromium.org rdsmith@chromium.org -ttuttle@chromium.org +juliatuttle@chromium.org
diff --git a/components/password_manager.gypi b/components/password_manager.gypi index a1110b5..da98e25 100644 --- a/components/password_manager.gypi +++ b/components/password_manager.gypi
@@ -258,12 +258,12 @@ 'target_name': 'password_manager_content_mojo_bindings_mojom', 'type': 'none', 'variables': { - 'mojom_extra_generator_args': [ - '--typemap', '<(DEPTH)/url/mojo/origin.typemap', - ], 'mojom_files': [ 'password_manager/content/public/interfaces/credential_manager.mojom', ], + 'mojom_typemaps': [ + '<(DEPTH)/url/mojo/origin.typemap', + ], }, 'include_dirs': [ '..',
diff --git a/components/password_manager/content/public/interfaces/BUILD.gn b/components/password_manager/content/public/interfaces/BUILD.gn index 4c29ae1..e032e8af 100644 --- a/components/password_manager/content/public/interfaces/BUILD.gn +++ b/components/password_manager/content/public/interfaces/BUILD.gn
@@ -9,8 +9,6 @@ "credential_manager.mojom", ] - typemaps = [ "//url/mojo/origin.typemap" ] - public_deps = [ "//url/mojo:url_mojom_origin", ]
diff --git a/components/password_manager/core/browser/BUILD.gn b/components/password_manager/core/browser/BUILD.gn index 7752be8..2fa30ff 100644 --- a/components/password_manager/core/browser/BUILD.gn +++ b/components/password_manager/core/browser/BUILD.gn
@@ -193,6 +193,38 @@ ] } +bundle_data("unit_tests_bundle_data") { + visibility = [ ":unit_tests" ] + testonly = true + sources = [ + "//components/test/data/password_manager/login_db_v1.sql", + "//components/test/data/password_manager/login_db_v10.sql", + "//components/test/data/password_manager/login_db_v11.sql", + "//components/test/data/password_manager/login_db_v12.sql", + "//components/test/data/password_manager/login_db_v13.sql", + "//components/test/data/password_manager/login_db_v14.sql", + "//components/test/data/password_manager/login_db_v15.sql", + "//components/test/data/password_manager/login_db_v16.sql", + "//components/test/data/password_manager/login_db_v17.sql", + "//components/test/data/password_manager/login_db_v1_broken.sql", + "//components/test/data/password_manager/login_db_v2.sql", + "//components/test/data/password_manager/login_db_v2_broken.sql", + "//components/test/data/password_manager/login_db_v3.sql", + "//components/test/data/password_manager/login_db_v3_broken.sql", + "//components/test/data/password_manager/login_db_v4.sql", + "//components/test/data/password_manager/login_db_v5.sql", + "//components/test/data/password_manager/login_db_v6.sql", + "//components/test/data/password_manager/login_db_v7.sql", + "//components/test/data/password_manager/login_db_v8.sql", + "//components/test/data/password_manager/login_db_v9.sql", + "//components/test/data/password_manager/login_db_v9_without_use_additional_auth_field.sql", + ] + outputs = [ + "{{bundle_resources_dir}}/" + + "{{source_root_relative_dir}}/{{source_file_part}}", + ] +} + source_set("unit_tests") { testonly = true sources = [ @@ -228,6 +260,7 @@ ] deps = [ ":test_support", + ":unit_tests_bundle_data", "//base/test:test_support", "//components/autofill/core/browser:test_support", "//components/autofill/core/browser/proto",
diff --git a/components/password_manager/core/browser/password_ui_utils.cc b/components/password_manager/core/browser/password_ui_utils.cc index 0693bd99..2392131 100644 --- a/components/password_manager/core/browser/password_ui_utils.cc +++ b/components/password_manager/core/browser/password_ui_utils.cc
@@ -52,8 +52,9 @@ } std::string GetShownOrigin(const GURL& origin) { - std::string original = base::UTF16ToUTF8( - url_formatter::FormatUrlForSecurityDisplayOmitScheme(origin)); + std::string original = + base::UTF16ToUTF8(url_formatter::FormatUrlForSecurityDisplay( + origin, url_formatter::SchemeDisplay::OMIT_HTTP_AND_HTTPS)); base::StringPiece result = original; for (base::StringPiece prefix : kRemovedPrefixes) { if (base::StartsWith(result, prefix,
diff --git a/components/password_manager/core/browser/password_ui_utils.h b/components/password_manager/core/browser/password_ui_utils.h index 034c98a4..e876af2 100644 --- a/components/password_manager/core/browser/password_ui_utils.h +++ b/components/password_manager/core/browser/password_ui_utils.h
@@ -18,10 +18,10 @@ namespace password_manager { // Returns a string suitable for security display to the user (just like -// |FormatUrlForSecurityDisplayOmitScheme| based on origin of |password_form| -// and without prefixes "m.", "mobile." or "www.". Also returns the full URL of -// the origin as |link_url|. |link_url| will be also shown as tooltip on the -// password page. +// |FormatUrlForSecurityDisplay| with OMIT_HTTP_AND_HTTPS) based on origin of +// |password_form| and without prefixes "m.", "mobile." or "www.". Also +// returns the full URL of the origin as |link_url|. |link_url| will be also +// shown as tooltip on the password page. // For Android forms with empty |password_form.affiliated_web_realm|, // returns the result of GetHumanReadableOriginForAndroidUri. For other Android // forms, returns |password_form.affiliated_web_realm|. @@ -35,8 +35,8 @@ bool* origin_is_clickable); // Returns a string suitable for security display to the user (just like -// |FormatUrlForSecurityDisplayOmitScheme| based on origin of |password_form|) -// and without prefixes "m.", "mobile." or "www.". +// |FormatUrlForSecurityDisplay| with OMIT_HTTP_AND_HTTPS) based on origin of +// |password_form|) and without prefixes "m.", "mobile." or "www.". std::string GetShownOrigin(const GURL& origin); } // namespace password_manager
diff --git a/components/password_manager/sync/browser/password_manager_setting_migrator_service_unittest.cc b/components/password_manager/sync/browser/password_manager_setting_migrator_service_unittest.cc index 7079598..78b788f 100644 --- a/components/password_manager/sync/browser/password_manager_setting_migrator_service_unittest.cc +++ b/components/password_manager/sync/browser/password_manager_setting_migrator_service_unittest.cc
@@ -264,8 +264,19 @@ } } +// TODO(crbug.com/604721): original CL never compiled this file with gyp and +// thus the test was never run on iOS and is now failing. Disabled until the +// bug is fixed to unblock conversion to gn. +#if !defined(OS_IOS) +#define MAYBE_ReconcileWhenWhenBothPrefsTypesArrivesFromSync \ + ReconcileWhenWhenBothPrefsTypesArrivesFromSync +#else +#define MAYBE_ReconcileWhenWhenBothPrefsTypesArrivesFromSync \ + DISABLED_ReconcileWhenWhenBothPrefsTypesArrivesFromSync +#endif + TEST_F(PasswordManagerSettingMigratorServiceTest, - ReconcileWhenWhenBothPrefsTypesArrivesFromSync) { + MAYBE_ReconcileWhenWhenBothPrefsTypesArrivesFromSync) { const struct { BooleanPrefState new_pref_local_value; BooleanPrefState old_pref_local_value;
diff --git a/components/policy/OWNERS b/components/policy/OWNERS index 20268c3..96cbb40 100644 --- a/components/policy/OWNERS +++ b/components/policy/OWNERS
@@ -2,3 +2,4 @@ atwilson@chromium.org cschuet@chromium.org tnagel@chromium.org +pastarmovj@chromium.org
diff --git a/components/policy/resources/policy_templates.json b/components/policy/resources/policy_templates.json index 3b37a9d..a876cd25 100644 --- a/components/policy/resources/policy_templates.json +++ b/components/policy/resources/policy_templates.json
@@ -137,7 +137,7 @@ # persistent IDs for all fields (but not for groups!) are needed. These are # specified by the 'id' keys of each policy. NEVER CHANGE EXISTING IDs, # because doing so would break the deployed wire format! -# For your editing convenience: highest ID currently used: 325 +# For your editing convenience: highest ID currently used: 327 # # Placeholders: # The following placeholder strings are automatically substituted: @@ -8461,6 +8461,25 @@ If SystemTimezone policy is set, it overrides this policy. In this case automatic timezone detection is completely disabled.''', }, + { + 'name': 'TaskManagerEndProcessEnabled', + 'caption': '''Enables ending processes in Task Manager''', + 'desc': '''Enables ending processes in <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph>'s Task Manager. + + If set to false, the 'End process' button is disabled in the Task Manager. + + If set to true or not configured, the user can end processes in the Task Manager.''', + 'type': 'main', + 'schema': { 'type': 'boolean' }, + 'supported_on': ['chrome.*:52-','chrome_os:52-'], + 'features': { + 'dynamic_refresh': True, + 'per_profile': False, + }, + 'example_value': True, + 'tags': [], + 'id': 327, + }, ], 'messages': { # Messages that are not associated to any policies.
diff --git a/components/policy/resources/policy_templates_am.xtb b/components/policy/resources/policy_templates_am.xtb index 2c012485..e05f19c 100644 --- a/components/policy/resources/policy_templates_am.xtb +++ b/components/policy/resources/policy_templates_am.xtb
@@ -160,6 +160,18 @@ <translation id="1561424797596341174">መመሪያ ለርቀት መዳረሻ አስተናጋጅ እርማት ግንቦች ይሽራል</translation> <translation id="1583248206450240930"><ph name="PRODUCT_FRAME_NAME" />ን በነባሪነት ይጠቀሙ</translation> <translation id="1608755754295374538">የድምጽ ቀረጻ መሣሪያዎች መዳረሻ ያለጥያቄ የሚሰጣቸው ዩ አር ኤሎች</translation> +<translation id="1613574633990410986">እርስዎ <ph name="PRODUCT_NAME" /> እና የኤአርሲ መተግበሪያዎች የሚጠቀመው ተኪ አገልጋይ እንዲገልጹ ያስችልዎታል፣ እና ተጠቃሚዎች የተኪ ቅንብሮችን እንዳይቀይሩ ይከለክላል። + + ተኪ አገልጋይ በጭራሽ ላለመጠቀም ሁልጊዜ በቀጥታ ለመገናኘት ከመረጡ፣ ሌሎች አማራጮች ሁሉ ችላ ይባላሉ። + + የተኪ አገልጋዩ በራስ እንዲገኝ ከመረጡ ሌሎች አማራጮች ሁሉ ችላ ይባላሉ። + + ለዝርዝር ምሳሌዎች ይህንን ይጎብኙ፦ + <ph name="PROXY_HELP_URL" /> + + ይህን ቅንብር ካነቁት <ph name="PRODUCT_NAME" /> እና የኤአርሲ መተግበሪያዎች ከትዕዛዝ መስመሩ የተገለጹ ሁሉንም ከተኪ ጋር የሚዛመዱ አማራጮች ችላ ይሏቸዋል። + + እነዚህን መመሪያዎች እንዳልተዋቀሩ መተው ተጠቃሚዎች በራሳቸው የተኪ ቅንብሮችን እንዲመርጡ አይፈቅድላቸውም።</translation> <translation id="1617235075406854669">የአሳሽ እና ውርድ ታሪክ መሰረዝን ያንቁ</translation> <translation id="1617384279878333801">በመገለጫ አስተዳዳሪ ውስጥ ሰው አክልን ያንቁ</translation> <translation id="1655229863189977773">የዲስክ መሸጎጫ መጠን በባይቶች ያስቀምጡ</translation> @@ -236,6 +248,15 @@ ይህን ቅንብር ካሰናከሉት ተጠቃሚው የፋይል መምረጫ መገናኛ የሚያስመጣ እርምጃ (እንደ ዕልባቶችን ማስመጣት፣ ፋይሎችን መስቀል፣ አገናኞችን ማስቀመጥ፣ ወዘተ. ያሉ) በፈጸመ ቁጥር ይልቁንስ መገናኛ ይታይና ተጠቃሚው በፋይል መምረጫ መልዕክቱ ላይ ሰርዝ የሚለውን ጠቅ እንዳደረገው ይወሰዳል። ይህ ቅንብር ካልተዋቀረ ተጠቃሚዎች የፋይል መምረጫ መገናኛዎችን በመደበኛ መልኩ ሊከፍቱት ይችላሉ።</translation> +<translation id="1879485426724769439">ለመሣሪያ ሥራ ላይ የሚውለው የሰዓት ሰቅ ይገልጻል። ተጠቃሚዎች ለአሁኑ ክፍለ-ጊዜ የተገለጸውን ሰዓት ሰቅ መሻር ይችላሉ። ይሁንና፣ ተዘግቶ ሲወጣ ወደተገለጸው የሰዓት ሰቅ ይቀለበሳል። ልክ ያልሆነ እሴት ከተሰጠ መመሪያው አሁንም በምትኩ «ጂኤምቲ» በመጠቀም ገቢር ይሆናል። ባዶ ሕብረቁምፊ ከተሰጠ መመሪያው መመሪያ ችላ ይባላል። + + ይህ መመሪያ ሥራ ላይ ካልዋለ የአሁኑ ገቢር የሰዓት ሰቅ በሥራ ላይ እንዳለ ይቆያል፣ ይሁንና ተጠቃሚዎች የሰዓት ሰቁን ቀይረው ለውጡንም ቋሚ ማድረግ ይችላሉ። ስለዚህ፣ በአንድ ተጠቃሚ የተደረገ ለውጥ በመግቢያ ገጹ እና በሌሎች ተጠቃሚዎች ሁሉ ላይ ተጽዕኖ አለው። + + አዲስ መሣሪያዎች የሰዓት ሰቃቸው ወደ «አሜሪካ/ፓሲፊክ» ተዋቅሮ ይጀምራሉ። + + የእሴቱ ቅርጸት በ«IANA Time Zone Database» («https://en.wikipedia.org/wiki/Tz_database» ይመልከቱ) ውስጥ ያሉ የሰዓት ሰቆች ስሞችን ነው የሚከተለው። በተለይ ደግሞ አብዛኛዎቹ የሰዓት ሰቆች በ«አህጉር/ትልቅ_ከተማ» ወይም «ውቅያኖስ/ትልቅ_ከተማ» ሊጠቀሱ ይችላሉ። + + ይህን መመሪያ ማዋቀር የሰዓት ሰቅን በራስ-ሰር በመሣሪያ አካባቢ ማግኘትን ያሰናክላል። እንዲሁም የSystemTimezoneAutomaticDetection መመሪያውንም ይሽረዋል።</translation> <translation id="1897365952389968758">ሁሉም ጣቢያዎች ጃቫስክሪፕት እንዲያሄዱ ፍቀድ</translation> <translation id="193259052151668190">የተፈቀደላቸው ሊላቀቁ የሚችሉ የዩኤስቢ መሣሪያዎች ዝርዝር</translation> <translation id="1933378685401357864">ልጣፍ ምስል</translation> @@ -642,6 +663,24 @@ <translation id="3072847235228302527">የመሣሪያ-አካባቢያዊ መለያ አገልግሎት ውል ያዋቅሩ</translation> <translation id="3096595567015595053">የነቁ ተሰኪዎች ዝርዝር</translation> <translation id="3101501961102569744">የተኪ አገልጋይ ቅንብሮች እንዴት እንደሚገለጹ ይምረጡ</translation> +<translation id="3125884964575432854">እርስዎ <ph name="PRODUCT_NAME" /> እና የኤአርሲ መተግበሪያዎች የሚጠቀመው ተኪ አገልጋይ እንዲገልጹ ያስችልዎታል፣ እና ተጠቃሚዎች የተኪ ቅንብሮችን እንዳይቀይሩ ይከለክላል። + + ተኪ አገልጋይ በጭራሽ ላለመጠቀም ሁልጊዜ በቀጥታ ለመገናኘት ከመረጡ፣ ሌሎች አማራጮች ሁሉ ችላ ይባላሉ። + + የስርዓት ተኪ ቅንብሮችን ለመጠቀም ከመረጡ ሌሎች አማራጮች ሁሉ ችላ ይባላሉ። + + የተኪ አገልጋዩ በራስ እንዲገኝ ከመረጡ ሌሎች አማራጮች ሁሉ ችላ ይባላሉ። + + የቋሚ አገልጋይ ተኪ ሁነታ ከመረጡ በ«የተኪ አገልጋይ አድራሻ ወይም ዩአርኤል» እና «በኮማ የተለዩ የተኪ ማለፊያ ደንቦች ዝርዝር» ውስጥ ተጨማሪ አማራጮችን መግለጽ ይችላሉ። የኤአርሲ መተግበሪያዎች የኤችቲቲፒ ተኪ አገልጋዩን ከከፍተኛ ቅድሚያ ጋር ብቻ ነው የሚጠቀመው። + + የ .pac ተኪ ስክሪፕት ለመጠቀም ከመረጡ ወደ ስክሪፕቱ የሚወስደውን ዩአርኤል በ«ወደ ተኪ .pac ፋይል የሚወስድ ዩአርኤል» መግለጽ አለብዎት። + + ለዝርዝር ምሳሌዎች ይህንን ይጎብኙ፦ + <ph name="PROXY_HELP_URL" /> + + ይህን ቅንብር ካነቁት <ph name="PRODUCT_NAME" /> እና የኤአርሲ መተግበሪያዎች ከትዕዛዝ መስመሩ የተገለጹ ሁሉንም ከተኪ ጋር የሚዛመዱ አማራጮች ችላ ይሏቸዋል። + + እነዚህን መመሪያዎች እንዳልተዋቀሩ መተው ተጠቃሚዎች በራሳቸው የተኪ ቅንብሮችን እንዲመርጡ አይፈቅድላቸውም።</translation> <translation id="3153348162326497318">የትኛዎቹ ቅጥያዎች ተጠቃሚዎች መጫን እንደማይችሉ እንዲገልጹ ያስችልዎታል። አስቀድመው የተጫኑ ቅጥያዎች በቅጣት መዝገብ ውስጥ ካሉ ይወገዳሉ። የ«*» እሴት ያለው የክልከላ ዝርዝር እሴት ማለት በግልጽ በተፈቀዱ ዝርዝር ውስጥ በግልጽ እስካልተጠቀሱ ድረስ ሁሉም ቅጥያዎች በተከለከሉ ዝርዝር ውስጥ ናቸው ማለት ነው። @@ -718,6 +757,19 @@ ይህ መመሪያ እንዳልተዋቀረ ከተተወ የ«DefaultKeygenSetting» መመሪያው ከተዋቀረ ሁለገብ ነባሪ እሴቱ ለሁሉም ጣቢያዎች ጥቅም ላይ ይውላል፣ አለበለዚያ ደግሞ የተጠቃሚው የግል ውቅር ጥቅም ላይ ይውላል።</translation> <translation id="3381968327636295719">አስተናጋጅ አሳሹን በነበሪነት ይጠቀሙ</translation> +<translation id="3398137877608138703">የቪዲዮ ቀረጻን ይፍቀዱ ወይም ይከልክሉ። + + ከነቃ ወይም ካልተዋቀረ (ነባሪ) ተጠቃሚው በVideoCaptureAllowedUrls + ዝርዝር ውስጥ ከተዋቀሩ ዩአርኤሎች በስተቀር የቪዲዮ ቀረጻ እንዲሰጥ + ይጠየቃል፣ በዝርዝሩ ውስጥ ያሉት ያለጥያቄ ነው መዳረሻ የሚሰጣቸው። + የኤአርሲ መተግበሪያዎች ፈቃድ ከተሰጣቸው ካሜራውን መድረስ ይችላሉ። + + ይህ መመሪያ ሲሰናከል ተጠቃሚው በጭራሽ አይጠየቅም፣ እና የቪዲዮ ቀረጻ + በVideoCaptureAllowedUrls ውስጥ ለተዋቀሩ ዩአርኤሎች ብቻ ነው የሚገኘው። + የኤአርሲ መተግበሪያዎች ካሜራውን መድረስ አይችሉም። + + ከኤአርሲ መተግበሪያዎች ውጭ ይህ መመሪያ በአብሮገነቡ ካሜራ ላይ ብቻ ሳይሆን + በሁሉም የቪዲዮ ግቤቶች ላይ ተጽዕኖ ይኖረዋል።</translation> <translation id="3417418267404583991">ይህ መመሪያ ወደ እውነት ከተዋቀረ ወይም እንዲያውም ካልተዋቀረ <ph name="PRODUCT_OS_NAME" /> የእንግዶች መግቢያዎችን ያነቃል። የእንግዳ መግቢያዎች የይለፍ ቃል የማያስፈልጋቸው የተጠቃሚ ስም-አልባ ክፍለ-ጊዜዎች ናቸው። ይህ መመሪያ ወደ ሐሰት ከተዋቀረ <ph name="PRODUCT_OS_NAME" /> የእንግዳ ክፍለ-ጊዜዎችን እንዲጀመር አይፈቅድም።</translation> @@ -735,6 +787,8 @@ <translation id="3478024346823118645">የተጠቃሚ ውሂብ ያጽዱ እና ዘግተው ይውጡ</translation> <translation id="348495353354674884">ምናባዊ የቁልፍ ሰሌዳን ያንቁ</translation> <translation id="3496296378755072552">የይለፍ ቃል አቀናባሪ</translation> +<translation id="349667858031092827">የሰዓት ሰቅን በጭራሽ በራስ አታግኝ።</translation> +<translation id="350443680860256679">ኤአርሲን አዋቅር</translation> <translation id="3504791027627803580">የምስል ፍለጋ በሚደረግበት ወቅት ጥቅም ላይ የዋለውን የፍለጋ ፕሮግራሙ ዩ አር ኤልን ይጠቅሳል። የፍለጋ ጥያቄዎች የGET ስልትን በመጠቀም ይላካሉ። የDefaultSearchProviderImageURLPostParams መመሪያው ከተዘጋጀ የምስል ፍለጋ ጥያቄዎች ከሱ ይልቅ POST ስልትን ይጠቀማሉ። @@ -885,6 +939,22 @@ ይህ መመሪያ ወደ ፞«ኩኪዎችን ለክፍለ-ጊዜው ቆይታ አቆይ» ከተዋቀረ ክፍለ-ጊዜው በሚያበቃበት ጊዜ ኩኪዎቹ ይጸዳሉ። <ph name="PRODUCT_NAME" /> በ«በስተጀርባ ሁነታ» ላይ እያሄደ ከሆነ የመጨረሻው መስኮት በሚዘጋበት ጊዜ ክፍለ-ጊዜው ላይዘጋ እንደሚችል ልብ ይበሉ። ይህንን ባህሪ ስለማወቀር ተጨማሪ መረጃ ከፈለጉ እባክዎ የ«BackgroundModeEnabled» መመሪያውን ይመልከቱ። ይህ መመሪያ ሳይዋቀር ከቀረ «AllowCookies» ስራ ላይ ይውላል፣ እና ተጠቃሚው ሊለውጠው ይችላል።</translation> +<translation id="4098957623809244159">ይህ መመሪያ ተቋርጧል፣ በምትኩ ProxyModeን ይጠቀሙ። + + <ph name="PRODUCT_NAME" /> እና የኤአርሲ መተግበሪያዎች የሚጠቀሙበት ተኪ አገልጋይ እንዲገልጹ ያስችልዎታል፣ እና ተጠቃሚዎች የተኪ ቅንብሮችን እንዳይቀይሩ ይከለክላቸዋል። + + የተኪ አገልጋይ በጭራሽ ላለመጠቀምና ሁልጊዜ በቀጥታ ለመገናኘት ከመረጡ ሌሎች አማራጮች ሁሉ ችላ ይባላሉ። + + የስርዓት ተኪ ቅንብሮችን ለመጠቀም ወይም የተኪ አገልጋዩን በራስ ለማግኘት ከመረጡ ሌሎች አማራጮች ሁሉ ችላ ይባላሉ። + + ራስዎ የሚያቀናብሯቸው የተኪ ቅንብሮችን ከመረጡ በ«የተኪ አገልጋይ አድራሻ ወይም ዩአርኤል»፣ «የተኪ .pac ፋይል ዩአርኤል» ወይም «በኮማ የተለዩ የተኪ ማለፊያ ደንቦች ዝርዝር» ውስጥ ተጨማሪ አማራጮችን መግለጽ ይችላሉ። + + ተጨማሪ ምሳሌዎችን ለማግኘት ይህንን ይመልከቱ፦ + <ph name="PROXY_HELP_URL" /> + + ይህን ቅንብር ካነቁት <ph name="PRODUCT_NAME" /> ከትዕዛዝ መስመሩ የተገለጹ ሁሉንም ከተኪ ጋር የተገናኙ አማራጮችን ችላ ይላቸዋል። + + ይህን መመሪያ እንዳልተዋቀረ መተው ተጠቃሚዎች የተኪ ቅንብሮችን በራሳቸው እንዲመርጡ ይፈቅድላቸዋል።</translation> <translation id="4103289232974211388">ከተጠቃሚ ማረጋገጥ በኋላ ወደ SAML IdP አዙር</translation> <translation id="410478022164847452">በሶኬት ኃይል ላይ ሲሆን የስራ ፈት እርምጃ ከመወሰዱ በፊት ተጠቃሚው ግብዓት ሳያስገባ የሚቆየው የጊዜ ርዝመት ይገልጻል። @@ -1368,6 +1438,14 @@ <translation id="5893553533827140852">ይህ ቅንብር ከነቃ የgnubby ማረጋገጫ ጣቄዎች በርቀት አስተናጋጅ ግንኙነት ላይ በተኪ ይተላለፋሉ። ይህ ቅንብር ከተሰናከለ ወይም ካልተዋቀረ የgnubby ማረጋገጫ ጥያቄዎች በተኪ አይተላለፉም።</translation> +<translation id="5900959132054596599"><ph name="PRODUCT_NAME" /> የኤአርሲ መተግበሪያዎች ማንኛውም እዚህ የተሰጡት አስተናጋጆች ዝርዝር ተኪን ያልፋል። + + ይህ መምሪያ በ«የተኪ አገልጋይ ቅንብሮች እንዴት እንደሚገለጹ ይምረጡ» ላይ የእራስዎ ተኪ ቅንብሮችን ከመረጡ ብቻ ነው የሚተገበረው። + + ተኪ መምሪያዎችን ለማዋቀር ሌላ ማንኛውም ዓይነት ሁነታን ከመረጡ ይህ መምሪያ እንዳልተዋቀረ ነው መተው ያለብዎት። + + ለተጨማሪ ዝርዝር ምሳሌዎች ይህንን ይጎብኙ፦ + <ph name="PROXY_HELP_URL" /></translation> <translation id="5921713479449475707">የራስ-ዝማኔ ውርዶች በHTTP በኩል ይፍቀዱ</translation> <translation id="5921888683953999946">በመግቢያ ገጹ ላይ ያለው ነባሪውን የትልቅ ጠቋሚ ተደራሽነት ባህሪ ያዋቅሩ። @@ -1517,6 +1595,7 @@ <translation id="637934607141010488">በቅርቡ በመለያ የገቡ የመሣሪያ ተጠቃሚዎች ዝርዝር ሪፖርት ያድርጉ። መመሪያው ወደ ሐሰት ከተዋቀረ ተጠቃሚዎቹ ሪፖርት አይደረጉም።</translation> +<translation id="639009029157091157">ተጠቃሚዎች ይወስኑ።</translation> <translation id="6392973646875039351">የ<ph name="PRODUCT_NAME" /> ራስ-ሙላ ባህሪ እንደ አድራሻ ወይም የክሬዲት ካርድ መረጃ ያሉ ከዚህ በፊት የተከማቹ መረጃዎችን በመጠቀም ተጠቃሚዎች የድር ቅጾች በራስ እንዲያጠናቅቁ ያስችላቸዋል። ይህን ቅንብር ካሰናከሉ ራስ-ሙላ ለተጠቃሚዎች የማይደረስ ይሆናል። @@ -1781,11 +1860,6 @@ የ«RestoreOnStartup» መመሪያው ዩአርኤሎች ከቀዳሚዎቹ ክፍለ-ጊዜዎች ወደነበሩበት ለመመለስ ከተዋቀረ ይሄ መመሪያ አይከበርም፣ እና ኩኪዎች ለእነዚያ ጣቢያዎች በዘላቂነት ይከማቻሉ።</translation> <translation id="7207095846245296855">Google SafeSearchን ያስገድዱ</translation> -<translation id="7213425178181578730">ይህ መመሪያ ወደ ሀሰት ከተቀናበረ <ph name="PRODUCT_OS_NAME" /> ብሉቱዝን ያሰናክላል፣ እና ተጠቀሚው መልሶ ሊያነቃው አይችልም። - - ይህ መመሪያ ወደ እውነት ከተቀናበረ ወይም ሳይቀናበር ከተተወ ተጠቃሚው እንደፈለገ ብሉቱዝን ሊያነቃ ወይም ሊያሰናክል ይችላል። - - ይህ መመሪያ ከተቀናበረ ተጠቃሚው ሊለውጠው ወይም ሊሽረው አይችልም።</translation> <translation id="7216442368414164495">ተጠቃሚዎች የጥንቃቄ አሰሳ የተቀጠለ ሪፓርት ማድረግ ውስጥ መርጠው እንዲገቡ ይፍቀዱ</translation> <translation id="7227967227357489766">ወደ መሣሪያው ውስጥ መግባት የሚችሉ የተጠቃሚዎች ዝርዝር ይገልጻል። ግቤቶች እንደ <ph name="USER_WHITELIST_ENTRY_EXAMPLE" /> ያሉ የ<ph name="USER_WHITELIST_ENTRY_FORMAT" /> ቅርጽ ነው ያላቸው። የዘፈቀደ የሆኑ ተጠቃሚዎች በአንድ ጎራ ላይ ለመፍቀድ የ<ph name="USER_WHITELIST_ENTRY_WILDCARD" /> ቅጽ ግቤቶችን ይጠቀሙ። @@ -1900,6 +1974,9 @@ ይህ ቅንብር ከተሰናከለ ወይም ካልተዋቀረ <ph name="PRODUCT_NAME" /> በተጠቃሚ የተገለጸውን አካባቢ (ከተዋቀረ)፣ የስርዓቱ አካባቢ ወይም ተጠባባቂ የሆነውን አካባቢ «en-US» ይጠቀማል።</translation> <translation id="7651739109954974365">የውሂብ ዝውውር ለዚህ መሣሪያ መንቃት ካለበት ይወስናል። ወደ እውነት ከተዋቀረ የውሂብ ዝውውር ይፈቀዳል። እንዳልተዋቀረ ከተተወ ወይም ወደ ሐሰት ከተዋቀረ የውሂብ ዝውውር አይገኝም።</translation> +<translation id="7667184304362487902">የ<ph name="PRODUCT_NAME" /> እና የኤአርሲ መተግበሪያዎች ተኪ ቅንብሮችን ያዋቅራል። + + ይህ መመሪያ ጥቅም ላይ ለመዋል ገና ዝግጁ አይደለም፣ እባክዎ አይጠቀሙበት።</translation> <translation id="76810863974142048">የርቀት መዳረሻ ደንበኛዎች የማረጋገጫ ማስመሰያቸውን ማግኘት ያለባቸው ዩአርኤል። ይህ መመሪያ ከተዋቀረ የርቀት መዳረሻ አስተናጋጁ የሚያረጋግጡ ደንበኛዎች መገናኘት እንዲችሉ ከዚህ ዩአርኤል የማረጋገጫ ማስመሰያ እንዲያገኙ ይፈልግባቸዋል። ከ RemoteAccessHostTokenValidationUrl ጋር በጥምረት ጥቅም ላይ መዋል አለበት። @@ -1974,6 +2051,19 @@ <translation id="7848840259379156480"><ph name="PRODUCT_FRAME_NAME" /> ሲጫን ነባሪውን የኤች ቲ ኤም ኤል ማሳያ እንዲያዋቅሩ ያስችልዎታል። ነባሪው ቅንብር አስተናጋጅ አሳሹ ማሳየቱን እንዲያደርግ ነው፣ ግን እንደ አማራጭ ይህንን ሽረው <ph name="PRODUCT_FRAME_NAME" /> የኤች ቲ ኤም ኤል ገጾች በነባሪነት እንዲያሳይ ማድረግ ይችላሉ።</translation> +<translation id="7853178359124471330">ይህ መመሪያ ሲዋቀር ራስ-ሰር የሰዓት ሰቅ ማወቅ ፍሰት በቅንብሩ ላይ የሚወሰን ሆኖ ከሚከተሉት መንገዶች ውስጥ አንዱ ይሆናል፦ + + ወደ TimezoneAutomaticDetectionUsersDecide ከተዋቀረ ተጠቃሚዎች በchrome://settings ውስጥ ያሉ መደበኛ መቆጣጠሪያዎችን በመጠቀም ራስ-ሰር የሰዓት ሰቅ ማውቂያን መቆጣጠር ይችላሉ። + + ወደ TimezoneAutomaticDetectionDisabled ከተዋቀረ በchrome://settings ውስጥ ያሉ ራስ-ሰር የሰዓት ሰቅ ማወቂያ መቆጣጠሪያዎች ይሰናከላሉ። ራስ-ሰር የሰዓት ሰቅ ማወቂያ ሁልጊዜ ይጠፋል። + + ወደ TimezoneAutomaticDetectionIPOnly ከተዋቀረ በchrome://settings ውስጥ ያሉ የሰዓት ሰቅ መቆጣጠሪያዎች ይሰናከላሉ። ራስ-ሰር የሰዓት ሰቅ ማወቂያ ሁልጊዜ ይበራል። የሰዓት ሰቅ ማወቂያ አካባቢን ለማወቅ የአይፒ ብቻ ስልት ነው የሚጠቀመው። + + ወደ TimezoneAutomaticDetectionSendWiFiAccessPoints ከተዋቀረ በchrome://settings ውስጥ ያሉ የሰዓት ሰቅ መቆጣጠሪያዎች ይሰናከላሉ። ራስ-ሰር የሰዓት ሰቅ ማወቂያ ሁልጊዘ እይበራል። የሚታዩ የWiFi መዳረሻ ነጥቦች ዝርዝር ለተጣራ ትክክለኛ ሰዓት ሰቅ ማወቂያ ሁልጊዜ ለGeolocation ኤፒአይ አገልጋዩ ይላካል። + + ይህ መመሪያ ካልተዋቀረ TimezoneAutomaticDetectionUsersDecide እንደተዋቀረ ሆኖ ይሠራል። + + የSystemTimezone መመሪያ ከተዋቀረ ይህን መመሪያ ይሽረዋል። በዚህ አጋጣሚ ራስ-ሰር የሰዓት ሰቅ ማወቂያው ሙሉ ለሙሉ ይሰናከላል።</translation> <translation id="7882585827992171421">ይህ መመሪያ በችርቻሮ ሁነታ ብቻ ነው ገባሪ የሚሆነው። በመግቢያ ገጹ ላይ እንደ ማያ ገጽ አዳኝ የሚያገለግለውን የቅጥያ መታወቂያን ይወስናል። ቅጥያው በDeviceAppPack መመሪያ በኩል ለዚህ ጎራ የተዋቀረ የAppPack አካል መሆን አለበት።</translation> @@ -2015,6 +2105,7 @@ ይህ መመሪያ ሳይዘጋጅ የተተወ ከሆነ ቅንብሩ ይነቃል።</translation> <translation id="8073243368829195">Smart Lock በአገልግሎት ላይ እንዲውል ያስችላል</translation> +<translation id="8074052133552427532">ሁልጊዜ ግምታዊ የሰዓት ሰቅ ማወቂያን ተጠቀም።</translation> <translation id="8099880303030573137">በባትሪ ኃያል ላይ ሲሆን የስራ ፈትቶ መዘግየት</translation> <translation id="8102913158860568230">ነባሪው የሚዲያ ዥረት ቅንብር</translation> <translation id="8104962233214241919">የእውቅና ማረጋገጫዎች ለእነዚህ ጣቢያዎች በራስ-ሰር ይምረጡ</translation> @@ -2119,6 +2210,7 @@ <translation id="8424255554404582727">ነባሪው የማሳያ እሽክርክሪት አዘጋጅ፣ በእያንዳንዱ ዳግም ማስነሳት ላይ ዳግም የሚተገበር</translation> <translation id="8426231401662877819">ማያ ገጹን በሰዓት አቅጣጫ 90 ዲግሪ አሽከርክር</translation> <translation id="8451988835943702790">አዲስ የትር ገጹን እንደ መነሻ ገጽ ተጠቀም</translation> +<translation id="8458790683633857482">ለኤአርሲ አሂድ ጊዜው የሚሰጠው የመመሪያዎች ስብስብ ይገልጻል። እሴቱ የሚሠራ JSON መሆን አለበት።</translation> <translation id="8465065632133292531">POST የሚጠቀም የፈጣን ዩአርኤል ግቤቶች</translation> <translation id="847472800012384958">ምንም ጣቢያ ብቅ-ባዮችን እንዲያሳይ አይፍቀዱ</translation> <translation id="8477885780684655676">TLS 1.0</translation> @@ -2248,9 +2340,12 @@ ይህ መመሪያ ወደ ሐሰት ከተቀናበረ ተጠቃሚውም ሆነ ማናቸውም መተግበሪያዎች ወይም ቅጥያዎች ወደ የሙሉ ማያ ገጽ ሁነታ መግባት አይችሉም። ሙሉ ማያ ገጽ ሁነታ ሲሰናከል የኪዮስክ ሁነታ ከ<ph name="PRODUCT_OS_NAME" /> በስተቀር በሁሉም መሣሪያ ስርዓቶች ላይ አይገኝም።</translation> +<translation id="8795495354632096254">የሰዓት ሰቅ እየተፈታ ሳለ ሁልጊዜ የWiFi መዳረሻ-ነጥቦችን ወደ ወደ አገልጋይ ላክ።</translation> <translation id="8818173863808665831">የመሣሪያውን ምድራዊ አካባቢ ሪፖርት ያድርጉ። መምሪያው ካልተዋቀረ ወይም ወደ ሐሰት ከተዋቀረ አካባቢ ሪፖርት አይደረግም።</translation> +<translation id="8818768076343557335">የተንቀሳቃሽ ስልክ ባልሆነ ማንኛውም አውታረ መረብ ላይ የአውታረ መረብ እርምጃዎችን ገምት። + (በ50 ውስጥ የተቋረጠ፣ በ52 ውስጥ የተወገደ። ከ52 በኋላ እሴቱ 1 ከተዘጋጀ 0 እንደሆነ ነው የሚቆጠረው - በማንኛውም የአውታረ መረብ ግንኙነት ላይ የአውታረ መረብ እርምጃዎችን ገምት።)</translation> <translation id="8828766846428537606"><ph name="PRODUCT_NAME" /> ውስጥ ነባሪውን የመነሻ ገጽ ያዋቅሩና ተጠቃሚዎች እንዳይቀይሩት ያግዱ። የመነሻ ገጹ የአዲሱ ትር ገጽ እንዲሆን ከመረጡ ወይም ዩአርኤል እንዲሆን ካዋቀሩት እና የመነሻ ገጽ ዩአርኤል ከገለጹ፣ የተጠቃሚው መነሻ ገጽ ቅንብሮች ብቻ ሙሉ ለሙሉ ይቆለፋሉ። የመነሻ ገጽ ዩአርኤሉን ካልገለጹ ተጠቃሚው «chrome://newtab»ን በመግለጽ መነሻ ገጹን አሁንም ሊያዋቅረው ይችላል።</translation> <translation id="8833109046074170275">በነባሪው የGAIA ፍሰቱ በኩል ማረጋገጥ</translation> @@ -2311,6 +2406,7 @@ <translation id="9042911395677044526">የአውታረ መረብ ውቅር መግፋት በእያንዳንዱ ተጠቃሚ በ<ph name="PRODUCT_OS_NAME" /> መሣሪያ ላይ እንዲተገበር ያስችላል። የአውታረ መረቡ ውቅር በ<ph name="ONC_SPEC_URL" /> ላይ እንደተብራራው በክፍት አውታረ መረብ ውቅር ቅርጸት የተገለጸ የJSON ቅርጸት ህብረቁምፊ ነው</translation> <translation id="9084985621503260744">የቪዲዮ እንቅስቃሴ የኃይል አስተዳደሩ ላይ ተጽዕኖ ይኖርበት ወይም አይኖርበት ይገልጻል</translation> <translation id="9088433379343318874">ክትትል የሚደረግበት የተጠቃሚ ይዘት አቅራቢን አንቃ</translation> +<translation id="9088444059179765143">የራስ-ሰር ሰዓት ሰቅ ማወቂያ ስልቱን ያዋቅሩ</translation> <translation id="9096086085182305205">የተፈቀደላቸው የማረጋገጫ አገልጋይ ዝርዝር</translation> <translation id="9098553063150791878">የኤችቲቲፒ ማረጋገጫ መመሪያዎች</translation> <translation id="9104138886225968319">አገልጋዩ መሣሪያው ከመስመር ውጪ ከሆነ እንዲያውቅ ለማስቻል
diff --git a/components/policy/resources/policy_templates_ar.xtb b/components/policy/resources/policy_templates_ar.xtb index ff2b0eb..137af1d 100644 --- a/components/policy/resources/policy_templates_ar.xtb +++ b/components/policy/resources/policy_templates_ar.xtb
@@ -140,6 +140,18 @@ <translation id="1561424797596341174">إلغاء السياسة لإصدارات تصحيح الأخطاء لمضيف الوصول البعيد</translation> <translation id="1583248206450240930">استخدام <ph name="PRODUCT_FRAME_NAME" /> افتراضيًا</translation> <translation id="1608755754295374538">عناوين URL التي سيتم منحها إمكانية الدخول إلى أجهزة التقاط الصوت بدون إذن</translation> +<translation id="1613574633990410986">للسماح بتحديد الخادم الوكيل الذي يستخدمه <ph name="PRODUCT_NAME" /> وتطبيقات ARC، ومنع المستخدمين من تغيير إعدادات الخادم الوكيل. + + إذا اخترت عدم استخدام الخادم الوكيل مطلقًا، والاتصال دائمًا بشكل مباشر، فسيتم تجاهل جميع الخيارات الأخرى. + + وإذا اخترت الاكتشاف التلقائي للخادم الوكيل، فسيتم تجاهل جميع الخيارات الأخرى. + + للحصول على أمثلة تفصيلية، انتقل إلى: + <ph name="PROXY_HELP_URL" /> + + إذا مكّنت هذا الإعداد، فسيتجاهل <ph name="PRODUCT_NAME" /> وتطبيقات ARC جميع الخيارات المتعلقة بالخادم الوكيل، والتي تم تحديدها من خلال سطر الأوامر. + + يؤدي ترك هذه السياسات بدون تعيين إلى السماح للمستخدمين باختيار إعدادات الخادم الوكيل بأنفسهم.</translation> <translation id="1617235075406854669">تمكين حذف سجل المتصفح والتنزيل</translation> <translation id="1617384279878333801">تمكين إضافة شخص في مدير الملف الشخصي</translation> <translation id="1655229863189977773">تعيين حجم ذاكرة التخزين المؤقت للقرص بالبايت</translation> @@ -209,6 +221,15 @@ <translation id="1865417998205858223">الأذونات الرئيسية</translation> <translation id="186719019195685253">إجراء يمكن اتخاذه عند الوصول إلى حد التأخير "بعيد" أثناء التشغيل على طاقة التيار المتردد</translation> <translation id="187819629719252111">للسماح بالدخول إلى الملفات المحلية على الجهاز من خلال السماح لـ <ph name="PRODUCT_NAME" /> بعرض مربعات حوار تحديد الملفات. إذا تم تمكين هذا الإعداد، يتمكن المستخدمون من فتح مربعات حوار تحديد الملفات كالعادة. إذا تم تعطيل هذا الإعداد، فعند إجراء المستخدم أي إجراء من شأنه أن يؤدي إلى ظهور مربع حوار تحديد ملف (مثل، استيراد الإشارات المرجعية وتحميل الملفات وحفظ الروابط وما إلى ذلك)، يتم عرض رسالة بدلاً من ذلك ويكون من المفترض أن ينقر المستخدم على "إلغاء" في مربع حوار تحديد الملف. إذا لم يتم تعيين الإعداد، يتمكن المستخدمون من فتح مربعات حوار تحديد الملفات كالعادة.</translation> +<translation id="1879485426724769439">لتحديد المنطقة الزمنية التي سيتم استخدامها لهذا الجهاز. ويمكن للمستخدمين إلغاء المنطقة الزمنية المحددة للجلسة الحالية. لكن، عند الخروج يتم تعينها إلى المنطقة الزمنية المحددة مرة أخرى. وفي حالة تقديم قيمة غير صحيحة، ستظل السياسة نشطة باستخدام توقيت جرينتش (GMT) بدلاً من ذلك. وإذا تم تقديم سلسلة فارغة، فسيتم تجاهل هذه السياسة. + + وإذا لم تُستخدم هذه السياسة، فستظل المنطقة الزمنية النشطة حاليًا قيد الاستخدام، ومع ذلك يمكن للمستخدمين تغيير المنطقة الزمنية بصفة مستمرة. وبالتالي، فإن إجراء التغيير بواسطة أحد المستخدمين من شأنه التأثير على شاشة تسجيل الدخول وعلى جميع المستخدمين الآخرين. + + مع العلم بأنه يتم تعيين المنطقة الزمنية للأجهزة الجديدة على "الولايات المتحدة/المحيط الهادي" عند بدء التشغيل. + + حيث يتبع تنسيق القيمة أسماء المناطق الزمنية في "قاعدة بيانات المناطق الزمنية (IANA)" (يُرجى الاطلاع على "https://en.wikipedia.org/wiki/Tz_database"). وعلى وجه الخصوص، يمكن الإشارة إلى معظم المناطق الزمنية من خلال "continent/large_city" أو "ocean/large_city" + + يؤدي تعيين هذه السياسة إلى تعطيل حل المنطقة الزمنية تلقائيًا من خلال موقع الجهاز. ويؤدي أيضًا إلى إلغاء سياسة SystemTimezoneAutomaticDetection.</translation> <translation id="1897365952389968758">السماح لجميع المواقع بتشغيل جافا سكريبت</translation> <translation id="193259052151668190">القائمة البيضاء لأجهزة USB القابلة للفصل</translation> <translation id="1933378685401357864">صورة الخلفية</translation> @@ -583,6 +604,24 @@ <translation id="3072847235228302527">تعيين بنود الخدمة لحساب محلي على الجهاز</translation> <translation id="3096595567015595053">قائمة المكونات الإضافية الممَّكنة</translation> <translation id="3101501961102569744">اختيار كيفية تحديد إعدادات الخادم الوكيل</translation> +<translation id="3125884964575432854">للسماح لك بتحديد الخادم الوكيل الذي يستخدمه <ph name="PRODUCT_NAME" /> وتطبيقات ARC ومنع المستخدمين من تغيير إعدادات الخادم الوكيل. + + إذا اخترت عدم استخدام الخادم الوكيل مطلقًا والاتصال دائمًا بشكل مباشر، فسيتم تجاهل جميع الخيارات الأخرى. + + وإذا اخترت استخدام إعدادات الخادم الوكيل للنظام، فسيتم تجاهل جميع الخيارات الأخرى. + + وإذا اخترت استخدام اكتشاف الخادم الوكيل تلقائيًا، فسيتم تجاهل جميع الخيارات الأخرى. + + وإذا اخترت وضع الخادم الوكيل الثابت، يمكنك تحديد المزيد من الخيارات في "العنوان أو عنوان URL للخادم الوكيل" و"قائمة مفصولة بفواصل لقواعد تجاوز الخادم الوكيل". ولن تستخدم تطبيقات ARC إلا الخادم الوكيل HTTP مع الأولوية القصوى. + + وإذا اخترت استخدام نص برمجي لملف .pac للخادم الوكيل، يجب عليك تحديد عنوان URL للنص البرمجي في "عنوان URL لملف pac. للخادم الوكيل". + + للحصول على أمثلة تفصيلية، انتقل إلى: + <ph name="PROXY_HELP_URL" /> + + إذا مكّنت هذا الإعداد، فسيتجاهل <ph name="PRODUCT_NAME" /> وتطبيقات ARC جميع الخيارات المتعلقة بالخادم الوكيل والتي تم تحديدها من خلال سطر الأوامر. + + سيؤدي عدم تعيين هذه السياسة إلى السماح للمستخدمين باختيار إعدادات الخادم الوكيل بأنفسهم.</translation> <translation id="3153348162326497318">للسماح لك بتحديد الإضافات التي لا يمكن للمستخدمين تثبيتها. وستتم إزالة الإضافات المثبّتة بالفعل إذا تم حظرها. تعني القيمة "*" في قائمة الحظر، حظر جميع الإضافات ما لم يتم إدراجها بشكل صريح في قائمة السماح. إذا تم ترك هذه السياسة بدون تعيين، يمكن للمستخدم تثبيت أية إضافات في <ph name="PRODUCT_NAME" />.</translation> <translation id="316778957754360075">لقد تمّ إيقاف هذا الإعداد اعتبارًا من الإصدار 29 من <ph name="PRODUCT_NAME" />. وإن الطريقة الموصى بها لإعداد مجموعة التطبيقات أو الإضافات التي تستضيفها المؤسسة، عبارة عن تضمين الموقع الذي يستضيف حزم CRX في ExtensionInstallSources وع وضع روابط للتنزيل المباشر في الحزم على صفحة الويب. ويُمكن إنشاء مشغّل لصفحة الويب هذه باستخدام سياسة ExtensionInstallForcelist.</translation> <translation id="3185009703220253572">منذ الإصدار <ph name="SINCE_VERSION" /></translation> @@ -651,6 +690,20 @@ ..........إذا لم تتعيَّن هذه السياسة، فسوف تُستخدَم القيمة الافتراضية العامة لجميع المواقع إما من السياسة 'DefaultKeygenSetting' إذا كان قد تم تعيينها أو من التهيئة الشخصية للمستخدم.</translation> <translation id="3381968327636295719">استخدام المتصفح المضيف افتراضيًا</translation> +<translation id="3398137877608138703">السماح بالتقاط الفيديو أو رفضه. + + في حالة تمكين هذه السياسة أو عدم تهيئتها (الإعداد الافتراضي)، ستتم مطالبة المستخدم + بالدخول لالتقاط الفيديو وذلك باستثناء عناوين URL التي تمت تهيئتها في قائمة + VideoCaptureAllowedUrls والتي سيتم منح المستخدمين فيها إمكانية الدخول بدون مطالبة. + سيتم تمكين تطبيقات ARC من الدخول إلى الكاميرا إذا تم منح الإذن + لها. + + في حالة تعطيل هذه السياسة، لن تتم مطالبة المستخدم مطلقًا، + وستكون ميزة التقاط الفيديو متاحة فقط لعناوين URL التي تمت تهيئتها في VideoCaptureAllowedUrls. + ولن تتمكن تطبيقات ARC من الدخول إلى الكاميرا. + + بخلاف تطبيقات ARC، تؤثر هذه السياسة في كل أنواع إدخالات الفيديو + وليس فقط في الكاميرا المدمجة.</translation> <translation id="3417418267404583991">إذا تم تعيين هذه السياسة على "true" أو لم تتم تهيئتها، فإن <ph name="PRODUCT_OS_NAME" /> سيمكن عمليات تسجيل دخول الضيوف. وتُعد عمليات تسجيل دخول الضيوف جلسات مستخدمين مجهولين ولا تتطلب كلمة مرور. وإذا تم تعيين هذه السياسة على "false"، فإن <ph name="PRODUCT_OS_NAME" /> لن يسمح ببدء جلسات الضيوف.</translation> @@ -664,6 +717,8 @@ <translation id="3478024346823118645">مسح بيانات المستخدم عند الخروج</translation> <translation id="348495353354674884">تمكين لوحة المفاتيح الظاهرية</translation> <translation id="3496296378755072552">مدير كلمات المرور</translation> +<translation id="349667858031092827">عدم اكتشاف المنطقة الزمنية تلقائيًا مطلقًا.</translation> +<translation id="350443680860256679">تهيئة ARC</translation> <translation id="3504791027627803580">لتحديد عنوان URL لمحرك البحث المستخدم لتوفير إمكانية البحث عن الصور. سيتم إرسال طلبات البحث باستخدام طريقة GET. وعند تعيين سياسة DefaultSearchProviderImageURLPostParams فستستخدم طلبات البحث عن الصور طريقة المشاركة بدلاً من ذلك. تعد هذه السياسة سياسة اختيارية. وعند تعيينها، لن يتم استخدام أي بحث صور. @@ -798,6 +853,22 @@ إذا تم تعيين هذه السياسة إلى "الاحتفاظ بملفات تعريف الارتباط طوال مدة الجلسة"، فحينئذٍ سيتم محو ملفات تعريف الارتباط عند إغلاق الجلسة. وتجدر الإشارة إلى أنه إذا كان <ph name="PRODUCT_NAME" /> يعمل في وضع الخلفية، فقد لا يمكن إغلاق الجلسة عند إغلاق آخر نافذة. يُرجى الاطلاع على سياسة "BackgroundModeEnabled" لمزيد من المعلومات عن تهيئة هذا السلوك. إذا تُركت هذه السياسة بدون تعيين، فسيتم استخدام "AllowCookies" وسيتمكن المستخدم من تغييرها.</translation> +<translation id="4098957623809244159">هذه السياسة متوقفة، استخدم ProxyMode بدلاً من ذلك. + + تسمح لك بتحديد الخادم الوكيل الذي يستخدمه <ph name="PRODUCT_NAME" /> وتطبيقات ARC ومنع المستخدمين من تغيير إعدادات الخادم الوكيل. + + إذا اخترت عدم استخدام الخادم الوكيل مطلقًا والاتصال دائمًا بشكل مباشر، فسيتم تجاهل جميع الخيارات الأخرى. + + وإذا اخترت استخدام إعدادات الخادم الوكيل للنظام أو اكتشاف الخادم الوكيل تلقائيًا، فسيتم تجاهل جميع الخيارات الأخرى. + + وإذا اخترت الإعدادات اليدوية للخادم الوكيل، يمكنك تحديد المزيد من الخيارات في "العنوان أو عنوان URL للخادم الوكيل" و"عنوان URL لملف pac. للخادم الوكيل" و"قائمة مفصولة بفواصل لقواعد تجاوز الخادم الوكيل". + + للحصول على أمثلة تفصيلية، انتقل إلى: + <ph name="PROXY_HELP_URL" /> + + إذا مكّنت هذا الإعداد، فسيتجاهل <ph name="PRODUCT_NAME" /> جميع الخيارات المتعلقة بالخادم الوكيل والتي تم تحديدها من خلال سطر الأوامر. + + يؤدي ترك هذه السياسة بدون تعيين إلى السماح للمستخدمين باختيار إعدادات الخادم الوكيل بأنفسهم.</translation> <translation id="4103289232974211388">إعادة توجيه إلى SAML IdP بعد تأكيد المستخدم</translation> <translation id="410478022164847452">لتحديد المدة الزمنية التي تنقضي بدون تعامل المستخدم مع الجهاز، والتي سيتم اتخاذ إجراء وضع الخمول بعد انقضائها عند استخدام طاقة التيار المتردد. @@ -1212,6 +1283,14 @@ <translation id="5893553533827140852">عند تمكين هذا الإعداد، سيتم توكيل طلبات مصادقة gnubby على اتصال مضيف بعيد. وعند تعطيله أو عدم تهيئته، لن يتم توكيل طلبات مصادقة gnubby.</translation> +<translation id="5900959132054596599">سيتجاوز <ph name="PRODUCT_NAME" /> وتطبيقات ARC أي خادم وكيل في قائمة المضيفين الواردة هنا. + + لا تسري هذه السياسة إلا إذا حددت إعدادات الخادم الوكيل يدويًا في "اختيار كيفية تحديد إعدادات الخادم الوكيل". + + يجب ترك هذه السياسة بدون تعيين في حالة اختيار أي وضع آخر لإعداد سياسات الخادم الوكيل. + + للحصول على المزيد من الأمثلة التفصيلية، انتقل إلى: + <ph name="PROXY_HELP_URL" /></translation> <translation id="5921713479449475707">السماح بتنزيلات التحديث التلقائي عبر HTTP</translation> <translation id="5921888683953999946">تعيين الحالة الافتراضية لميزة الدخول إلى المؤشر الكبير في شاشة تسجيل الدخول. @@ -1341,6 +1420,7 @@ <translation id="6376659517206731212">يمكن أن تكون إلزامية</translation> <translation id="6378076389057087301">تحديد ما إذا كان النشاط الصوتي يؤثر في إدارة الطاقة</translation> <translation id="637934607141010488">الإبلاغ عن قائمة المستخدمين الذين سجّلوا الدخول مؤخرًا. وفي حالة تعيين هذه السياسة على "خطأ"، فلن يتم الإبلاغ عن المستخدمين.</translation> +<translation id="639009029157091157">السماح للمستخدمين باتخاذ القرار.</translation> <translation id="6392973646875039351">لتمكين ميزة الملء التلقائي في <ph name="PRODUCT_NAME" /> والسماح للمستخدمين بإكمال نماذج الويب تلقائيًا باستخدام معلومات مخزنة مسبقًا، مثل معلومات العنوان أو البطاقة الائتمانية. إذا تم تعطيل هذا الإعداد، فلن تكون ميزة الملء التلقائي متاحة للوصول لدى المستخدمين. إذا تم تمكين هذا الإعداد أو لم يتم تعيين قيمة، فستظل ميزة الملء التلقائي تخضع لتحكم المستخدم. وسيسمح ذلك له بتهيئة الملفات الشخصية الخاصة بالملء التلقائي وتشغيل الملء التلقائي أو إيقافه بحسب تقديره.</translation> <translation id="6394350458541421998">تمّ إيقاف هذه السياسة اعتبارًا من الإصدار 29 من <ph name="PRODUCT_OS_NAME" />. يُرجى استخدام سياسة PresentationScreenDimDelayScale بدلاً منها.</translation> <translation id="6401669939808766804">تسجيل خروج المستخدم</translation> @@ -1583,11 +1663,6 @@ في حالة تعيين سياسة "RestoreOnStartup" لاستعادة عناوين URL من جلسات سابقة، لن يتم الانتباه لهذه السياسة وسيتم تخزين ملفات تعريف الارتباط باستمرار لمواقع الويب هذه.</translation> <translation id="7207095846245296855">فرض البحث الآمن في Google</translation> -<translation id="7213425178181578730">إذا تم تعيين هذه السياسة إلى "خطأ"، فإنّ <ph name="PRODUCT_OS_NAME" /> سيعطّل البلوتوث، ولن يتمكن المستخدم من تمكينه مرةً أخرى. - - إذا تم تعيين هذه السياسة إلى "صواب"، أو تم تركها بدون تعيين، سيكون المستخدم قادرًا على تمكين البلوتوث أو تعطيله كما يشاء. - - إذا تم تعيين هذه السياسة، فلا يمكن للمستخدم تغييرها أو إلغاؤها.</translation> <translation id="7216442368414164495">السماح للمستخدمين بتمكين إعداد التقارير الموسع حول "التصفح الآمن"</translation> <translation id="7227967227357489766">لتحديد قائمة بالمستخدمين المسموح لهم بتسجيل الدخول إلى الجهاز. تكون الإدخالات بالشكل <ph name="USER_WHITELIST_ENTRY_FORMAT" />، مثل <ph name="USER_WHITELIST_ENTRY_EXAMPLE" />. وللسماح بمستخدمين عشوائيين على أحد النطاقات، استخدم الإدخالات بالشكل <ph name="USER_WHITELIST_ENTRY_WILDCARD" />. @@ -1692,6 +1767,9 @@ إذا تم تعطيل هذا الإعداد، فسيستخدم <ph name="PRODUCT_NAME" /> اللغة المفضلة التي حددها المستخدم (إذا تمت تهيئتها) أو لغة النظام أو اللغة البديلة 'en-US'.</translation> <translation id="7651739109954974365">لتحديد ما إذا كان يجب تمكين تجوال البيانات للجهاز أم لا. إذا تم التعيين على "true"، يتم السماح بتجوال البيانات. وإذا تم تركه بدون تهيئته أو تعيينه على "false"، فإن تجوال البيانات لن يكون متاحًا.</translation> +<translation id="7667184304362487902">لتهيئة إعدادات الخادم الوكيل لـ <ph name="PRODUCT_NAME" /> وتطبيقات ARC. + + هذه السياسة غير جاهزة للاستخدام بعدُ، الرجاء عدم استخدامها.</translation> <translation id="76810863974142048">عنوان URL الذي ينبغي أن يحصل عملاء الوصول البعيد من خلاله على الرموز المميزة للمصادقة. في حالة تعيين هذه السياسة، سيتطلب مضيف الوصول البعيد عملاء للمصادقة للحصول على رمز المصادقة من عنوان URL هذا للاتصال. ويجب استخدامه مع emoteAccessHostTokenValidationUrl. @@ -1759,6 +1837,19 @@ <translation id="7843525027689416831">يحدد العلامات التي ينبغي أن يتم وضعها على <ph name="PRODUCT_NAME" /> عند بدء تشغيله. يتم وضع العلامات المحددة على شاشة تسجيل الدخول فقط. ولا تنشر العلامات التي تم تعيينها عبر هذه السياسة في جلسات المستخدمين.</translation> <translation id="7848840259379156480">للسماح لك بتهيئة عارض HTML الافتراضي عندما يتم تثبيت <ph name="PRODUCT_FRAME_NAME" />. والإعداد الافتراضي هو السماح للمتصفح المضيف بالعرض، ولكن يمكنك اختياريًا تجاوز ذلك وعرض صفحات HTML افتراضيًا في <ph name="PRODUCT_FRAME_NAME" />.</translation> +<translation id="7853178359124471330">عند تعيين هذه السياسة، سيكون تدفق اكتشاف المنطقة الزمنية تلقائيًا من خلال إحدى الطرق التالية اعتمادًا على قيمة الإعداد: + + في حالة التعيين على "TimezoneAutomaticDetectionUsersDecide"، سيتمكن المستخدمون من التحكم في اكتشاف المنطقة الزمنية تلقائيًا باستخدام عناصر التحكم العادية في chrome://settings. + + في حالة التعيين على "TimezoneAutomaticDetectionDisabled"، سيتم تعطيل عناصر التحكم التلقائي في المنطقة الزمنية في chrome://settings. وسيتم إيقاف تشغيل اكتشاف المنطقة الزمنية تلقائيًا بشكل دائم. + + في حالة التعيين على "TimezoneAutomaticDetectionIPOnly"، سيتم تعطيل عناصر التحكم في المنطقة الزمنية في chrome://settings. وسيتم تشغيل اكتشاف المنطقة الزمنية تلقائيًا بشكلٍ دائم. وسيستخدم اكتشاف المنطقة الزمنية طريقة IP فقط لحل الموقع. + + في حالة التعيين على "TimezoneAutomaticDetectionSendWiFiAccessPoints"، سيتم تعطيل عناصر التحكم في المنطقة الزمنية في chrome://settings. وسيتم تشغيل اكتشاف المنطقة الزمنية تلقائيًا بشكلٍ دائم. وسيتم دائمًا إرسال قائمة نقاط الوصول المرئية إلى شبكة WiFi إلى خادم واجهة برمجة تطبيقات الموقع الجغرافي لاكتشاف المنطقة الزمنية بدقة. + + إذا لم يتم تعيين هذه السياسة، فستعمل كما لو تم التعيين على TimezoneAutomaticDetectionUsersDecide. + + إذا تم تعيين سياسة SystemTimezone، فستُلغى هذه السياسة. وفي هذه الحالة، يتم تعطيل اكتشاف المنطقة الزمنية تلقائيًا تمامًا.</translation> <translation id="7882585827992171421">لا تكون هذه السياسة نشطة سوى في وضع البيع بالتجزئة فقط. لتحديد معرف الإضافة المراد استخدامها كشاشة توقف على شاشة تسجيل الدخول. يجب أن تكون الإضافة جزءًا من AppPack والذي تمت تهيئته لهذا النطاق عبر السياسة DeviceAppPack.</translation> @@ -1796,6 +1887,7 @@ لاحظ أنه إذا تم تعطيل السياسة <ph name="REMOTEACCESSHOSTFIREWALLTRAVERSAL_POLICY_NAME" />، فسيتم تجاهل هذه السياسة. إذا تم ترك هذه السياسة غير معينة، فسيتم تمكين الإعداد.</translation> <translation id="8073243368829195">تسمح باستخدام Smart Lock</translation> +<translation id="8074052133552427532">استخدام الاكتشاف التقريبي للمنطقة الزمنية دائمًا.</translation> <translation id="8099880303030573137">مهلة وضع الخمول عند استخدام طاقة البطارية</translation> <translation id="8102913158860568230">الإعداد الافتراضي لتدفق الوسائط</translation> <translation id="8104962233214241919">تحديد شهادات العميل لهذه المواقع تلقائيًا</translation> @@ -1899,6 +1991,7 @@ <translation id="8424255554404582727">إعداد تدوير شاشة العرض الافتراضية، المعاد تطبيقه في كل إعادة تشغيل</translation> <translation id="8426231401662877819">تدوير الشاشة في اتجاه عقارب الساعة بمقدار 90 درجة</translation> <translation id="8451988835943702790">استخدام صفحة علامة التبويب الجديدة كصفحة رئيسية</translation> +<translation id="8458790683633857482">لتحديد مجموعة من السياسات التي سيتم تحويلها إلى وقت تشغيل ARC. يجب أن تكون القيمة ملف JSON صالحًا.</translation> <translation id="8465065632133292531">معلمات عنوان URL الفوري الذي يستخدم المشاركة</translation> <translation id="847472800012384958">عدم السماح لأي موقع بعرض النوافذ المنبثقة</translation> <translation id="8477885780684655676">طبقة النقل الآمنة 1.0</translation> @@ -2023,9 +2116,12 @@ عند تعيين هذه السياسة على "خطأ"، لن يتمكن المستخدم أو التطبيقات أو الإضافات من الدخول إلى وضع ملء الشاشة. على جميع أنظمة التشغيل باستثناء <ph name="PRODUCT_OS_NAME" />، لا يكون وضع الكشك متاحًا عند تعطيل وضع ملء الشاشة.</translation> +<translation id="8795495354632096254">إرسال نقاط الوصول إلى شبكة WiFi إلى الخادم أثناء حل المنطقة الزمنية دائمًا.</translation> <translation id="8818173863808665831">الإبلاغ عن الموقع الجغرافي للجهاز. إذا لم يتم تعيين هذه السياسة، أو تم تعيينها على false، فلن يتم الإبلاغ عن الموقع.</translation> +<translation id="8818768076343557335">التنبؤ بإجراءات الشبكة على أي شبكة غير خلوية. + (إيقاف في 50، إزالة في 52. بعد 52، إذا تم تعيين القيمة على 1، فستتم معاملتها كـ 0، وسيتم التنبؤ بإجراءات الشبكة على أي اتصال بالشبكة).</translation> <translation id="8828766846428537606">تهيئة الصفحة الرئيسية الافتراضية في <ph name="PRODUCT_NAME" /> ومنع المستخدمين من تغييرها. ويتم تأمين إعدادات الصفحة الرئيسية للمستخدم بالكامل فقط في حالة تحديد الصفحة الرئيسية لتكون صفحة علامة تبويب جديدة، أو تعيين الصفحة الرئيسية لتكون عنوان URL معينًا. فإذا لم تحدد عنوان URL للصفحة الرئيسية، فسيظل المستخدم قادرًا على تعيين الصفحة الرئيسية لتكون صفحة علامة تبويب جديدة من خلال تحديد "chrome://newtab".</translation> @@ -2085,6 +2181,7 @@ <translation id="9042911395677044526">للسماح لتهيئة الشبكة المدفوعة أن يتم تطبيقها على كل مستخدم لجهاز <ph name="PRODUCT_OS_NAME" />. إن تهيئة الشبكة هي عبارة عن سلسلة بتنسيق JSON كما هو محدد في تنسيق تهيئة الشبكة المفتوحة الموضح في <ph name="ONC_SPEC_URL" /></translation> <translation id="9084985621503260744">تحديد ما إذا كان نشاط الفيديو يؤثر في إدارة الطاقة</translation> <translation id="9088433379343318874">تمكين موفر المحتوى للمستخدمين تحت الإشراف</translation> +<translation id="9088444059179765143">تهيئة طريقة اكتشاف المنطقة الزمنية تلقائيًا</translation> <translation id="9096086085182305205">قائمة السماح لخادم المصادقة</translation> <translation id="9098553063150791878">سياسات مصادقة HTTP</translation> <translation id="9104138886225968319">إرسال مراقبة النبضات إلى خادم الإدارة، للسماح
diff --git a/components/policy/resources/policy_templates_bg.xtb b/components/policy/resources/policy_templates_bg.xtb index 415e2c4..ff474438 100644 --- a/components/policy/resources/policy_templates_bg.xtb +++ b/components/policy/resources/policy_templates_bg.xtb
@@ -1609,11 +1609,6 @@ Ако за „RestoreOnStartup“ е зададено да се възстановяват URL адресите от предишните сесии, това правило се пренебрегва и „бисквитките“ за съответните сайтове ще се съхраняват за постоянно.</translation> <translation id="7207095846245296855">Принудително използване на Google Безопасно търсене</translation> -<translation id="7213425178181578730">Ако това правило е false, <ph name="PRODUCT_OS_NAME" /> ще деактивира функцията за Bluetooth и потребителят няма да може да я активира отново. - -В случай че правилото е true или не е зададено, потребителят ще е в състояние да активира или деактивира Bluetooth, когато пожелае. - -Ако правилото е зададено, потребителят няма да може да го променя или отменя.</translation> <translation id="7216442368414164495">Разрешаване на потребителите да включат разширената функция на Безопасно сърфиране за подаване на сигнали</translation> <translation id="7227967227357489766">Дефинира списъка с потребители, на които е разрешено да влизат в устройството. Записите са във формат <ph name="USER_WHITELIST_ENTRY_FORMAT" />, например <ph name="USER_WHITELIST_ENTRY_EXAMPLE" />. За да разрешите произволни потребители от даден домейн, използвайте записи във формат <ph name="USER_WHITELIST_ENTRY_WILDCARD" />.
diff --git a/components/policy/resources/policy_templates_bn.xtb b/components/policy/resources/policy_templates_bn.xtb index bfe51ef..001a06c7 100644 --- a/components/policy/resources/policy_templates_bn.xtb +++ b/components/policy/resources/policy_templates_bn.xtb
@@ -1743,11 +1743,6 @@ যদি "RestoreOnStartup" নীতিটি আগের সেশনগুলি থেকে URLগুলি পূর্বাবস্থায় ফিরিয়ে আনতে সেট করা থাকে, তাহলে এই নীতিটি মান্য করা হবে না এবং ঐসব সাইটের জন্য কুকিজ স্থায়ীভাবে সংরক্ষণ করা হবে।</translation> <translation id="7207095846245296855">Google নিরাপদ অনুসন্ধান বলবৎ করে</translation> -<translation id="7213425178181578730">এই নীতিটি মিথ্যাতে সেট করা থাকলে, <ph name="PRODUCT_OS_NAME" /> Bluetooth অক্ষম করবে এবং ব্যবহারকারী এটিকে ফিরিয়ে আনতে পারবে না। - - এই নীতিটি সত্যতে সেট করা থাকলে বা সেট করা না থাকলে, ব্যবহারকারী তার ইচ্ছা মতো Bluetooth সক্ষম বা অক্ষম করতে পারবে। - - এই নীতিটি সেট করা থাকলে, ব্যবহারকারী এটিকে পরিবর্তন বা ওভাররাইড করতে পারবে না।</translation> <translation id="7216442368414164495">ব্যবহারকারীদের নিরাপদ ব্রাউজিং এর বর্ধিত প্রতিবেদনের নির্বাচন করা অনুমোদন করে</translation> <translation id="7227967227357489766">যেসব ব্যবহারকারীরা ডিভাইসে লগইন করার মঞ্জুরিপ্রাপ্ত তাদের তালিকা নির্ধারণ করে৷ প্রবেশকার্যগুলি <ph name="USER_WHITELIST_ENTRY_FORMAT" /> ফর্মের, যেমন <ph name="USER_WHITELIST_ENTRY_EXAMPLE" />৷ কোনো ডোমেনে অবাধ ব্যবহারকারীদের মঞ্জুরি করতে <ph name="USER_WHITELIST_ENTRY_WILDCARD" /> ফর্মের প্রবেশকার্যগুলি ব্যবহার করুন৷
diff --git a/components/policy/resources/policy_templates_ca.xtb b/components/policy/resources/policy_templates_ca.xtb index 5a31fe4b..dcb222f 100644 --- a/components/policy/resources/policy_templates_ca.xtb +++ b/components/policy/resources/policy_templates_ca.xtb
@@ -82,7 +82,7 @@ <translation id="1359553908012294236">Si aquesta política s'estableix en "true" o no es configura, <ph name="PRODUCT_NAME" /> permetrà els inicis de sessió en mode de convidat. Aquests inicis són perfils de <ph name="PRODUCT_NAME" /> on totes les finestres utilitzen el mode d'incògnit. Si aquesta política s'estableix en "false", <ph name="PRODUCT_NAME" /> no permetrà que s'iniciïn els perfils de convidat.</translation> -<translation id="1363275621236827384">Activa l'opció d'enviar consultes al servidor de Quirks per als perfils de maquinari</translation> +<translation id="1363275621236827384">Activa l'opció d'enviar consultes a Quirks Server per als perfils de maquinari</translation> <translation id="1397855852561539316">URL de suggeriments del proveïdor de cerca predeterminat</translation> <translation id="1398889361882383850">Permet definir si els llocs web poden executar connectors automàticament. Podeu permetre o denegar l'execució automàtica de connectors a tots els llocs web. @@ -1611,11 +1611,6 @@ Si la política RestoreOnStartup s'estableix per restaurar els URL de les sessions anteriors, aquesta política no es respectarà i les galetes s'emmagatzemaran permanentment per a aquests llocs.</translation> <translation id="7207095846245296855">Força l'aplicació de Google SafeSearch</translation> -<translation id="7213425178181578730">Si aquesta política s'estableix en "false", <ph name="PRODUCT_OS_NAME" /> desactivarà el Bluetooth i l'usuari no el podrà tornar a activar. - - Si aquesta política s'estableix en "true" o es deixa sense establir, l'usuari podrà activar o desactivar el Bluetooth com vulgui. - - Si aquesta política s'estableix, l'usuari no la podrà canviar ni substituir.</translation> <translation id="7216442368414164495">Permet que els usuaris activin els informes ampliats de Navegació segura</translation> <translation id="7227967227357489766">Defineix la llista d'usuaris que poden iniciar la sessió al dispositiu. El text introduït té el format <ph name="USER_WHITELIST_ENTRY_FORMAT" />, com ara <ph name="USER_WHITELIST_ENTRY_EXAMPLE" />. Perquè els usuaris arbitraris puguin accedir a un domini, utilitzeu text que tingui el format <ph name="USER_WHITELIST_ENTRY_WILDCARD" />.
diff --git a/components/policy/resources/policy_templates_cs.xtb b/components/policy/resources/policy_templates_cs.xtb index 1d48132177..0876680 100644 --- a/components/policy/resources/policy_templates_cs.xtb +++ b/components/policy/resources/policy_templates_cs.xtb
@@ -1732,11 +1732,6 @@ Pokud je zásada „RestoreOnStartup“ nastavena na obnovení adres URL z předcházejících relací, nebude tato zásada dodržována a soubory cookie se pro tyto webové stránky budou ukládat natrvalo.</translation> <translation id="7207095846245296855">Vynutit Bezpečné vyhledávání Google</translation> -<translation id="7213425178181578730">Pokud je tato zásada nastavena na hodnotu false, systém <ph name="PRODUCT_OS_NAME" /> zakáže rozhraní Bluetooth a uživatel jej nebude moci povolit. - - Pokud je tato zásada nastavena na hodnotu true nebo ponechána nenastavená, uživatel může rozhraní Bluetooth povolit nebo zakázat podle svého uvážení. - - Pokud je tato zásada nastavena, uživatel ji nemůže změnit ani přepsat.</translation> <translation id="7216442368414164495">Umožnit uživatelům přihlášení k rozšířeným přehledům Bezpečného prohlížení</translation> <translation id="7227967227357489766">Určuje seznam uživatelů, kteří se do zařízení mohou přihlásit. Položky jsou ve tvaru <ph name="USER_WHITELIST_ENTRY_FORMAT" />, například <ph name="USER_WHITELIST_ENTRY_EXAMPLE" />. Chcete-li v doméně povolit libovolné uživatele, použijte položky ve tvaru <ph name="USER_WHITELIST_ENTRY_WILDCARD" />.
diff --git a/components/policy/resources/policy_templates_da.xtb b/components/policy/resources/policy_templates_da.xtb index 1e51705..ea5bbaca 100644 --- a/components/policy/resources/policy_templates_da.xtb +++ b/components/policy/resources/policy_templates_da.xtb
@@ -82,7 +82,7 @@ <translation id="1359553908012294236">Hvis denne politik er angivet til sand eller ikke er konfigureret, aktiverer <ph name="PRODUCT_NAME" /> gæstelogins. Gæstelogins er <ph name="PRODUCT_NAME" />-profiler, hvor alle vinduer er i inkognitotilstand. Hvis denne politik er angivet til falsk, tillader <ph name="PRODUCT_NAME" /> ikke, at der startes gæsteprofiler.</translation> -<translation id="1363275621236827384">Aktivér forespørgsler til Quirks-serveren om hardwareprofiler</translation> +<translation id="1363275621236827384">Aktivér forespørgsler til Quirks Server om hardwareprofiler</translation> <translation id="1397855852561539316">Foreslået webadresse fra standardsøgemaskinen</translation> <translation id="1398889361882383850">Giver dig mulighed for at angive, om websites automatisk har tilladelse til at køre plugins. Plugins, der kører automatisk, kan enten tillades eller nægtes for alle websites. @@ -1621,11 +1621,6 @@ Hvis politikken "RestoreOnStartup" er indstillet til at gendanne webadresser fra tidligere sessioner, overholdes denne politik ikke, og cookies gemmes permanent for disse websites.</translation> <translation id="7207095846245296855">Gennemtving Google Beskyttet søgning</translation> -<translation id="7213425178181578730">Hvis denne politik angives som falsk, deaktiverer <ph name="PRODUCT_OS_NAME" /> Bluetooth, og brugeren kan ikke aktivere det igen. - - Hvis denne politik er angivet til sand eller ikke angives, kan brugeren aktivere og deaktivere Bluetooth efter forgodtbefindende. - - Hvis denne politik er angivet, kan brugeren ikke ændre eller tilsidesætte den.</translation> <translation id="7216442368414164495">Giv brugerne tilladelse til at vælge udvidet rapportering af Beskyttet browsing</translation> <translation id="7227967227357489766">Definerer en liste over brugere, der kan logge på enheden. Indtastningerne er i formatet <ph name="USER_WHITELIST_ENTRY_FORMAT" /> som f.eks. <ph name="USER_WHITELIST_ENTRY_EXAMPLE" />. Hvis du vil tillade vilkårlige brugere på et domæne, skal du bruge indtastninger med formatet <ph name="USER_WHITELIST_ENTRY_WILDCARD" />. @@ -2079,13 +2074,13 @@ <translation id="8858642179038618439">Gennemtving Beskyttet tilstand på YouTube</translation> <translation id="8864975621965365890">Undertrykker opfordringen til afvisning, som vises, når et website gengives af <ph name="PRODUCT_FRAME_NAME" />.</translation> <translation id="8870318296973696995">Startside</translation> -<translation id="8889588091638298603">Quirks-serveren leverer hardwarespecifikke konfigurationsfiler, som f.eks. ICC-profiler til visning, til justering af skærmkalibrering. +<translation id="8889588091638298603">Quirks Server leverer hardwarespecifikke konfigurationsfiler, som f.eks. ICC-profiler til visning, til justering af skærmkalibrering. - Når denne politik er angivet som falsk, forsøger enheden ikke at kontakte Quirks-serveren for at downloade konfigurationsfiler. + Når denne politik er angivet som falsk, forsøger enheden ikke at kontakte Quirks Server for at downloade konfigurationsfiler. Hvis denne politik er angivet som sand eller ikke er konfigureret, kontakter <ph name="PRODUCT_OS_NAME" /> - automatisk Quirks-serveren og downloader konfigurationsfiler, + automatisk Quirks Server og downloader konfigurationsfiler, hvis de er tilgængelige, som derefter gemmes på enheden. Sådanne filer kan f.eks. anvendes til at forbedre kvaliteten af visningen af tilsluttede skærme.</translation> <translation id="8905426178924715309">Denne politik er udfaset. Brug ForceGoogleSafeSearch og ForceYouTubeSafetyMode i stedet. Denne politik ignoreres, hvis en af politikkerne ForceGoogleSafeSearch eller ForceYouTubeSafetyMode er angivet.
diff --git a/components/policy/resources/policy_templates_de.xtb b/components/policy/resources/policy_templates_de.xtb index a56a0be..42476e1b 100644 --- a/components/policy/resources/policy_templates_de.xtb +++ b/components/policy/resources/policy_templates_de.xtb
@@ -1600,11 +1600,6 @@ Falls die Richtlinie "RestoreOnStartup" zur Wiederherstellung von URLs aus vorherigen Sitzungen festgelegt ist, wird diese Richtlinie ignoriert und Cookies werden dauerhaft für die jeweiligen Websites gespeichert.</translation> <translation id="7207095846245296855">Google SafeSearch erzwingen</translation> -<translation id="7213425178181578730">Wenn diese Richtlinie auf "falsch" gesetzt ist, wird Bluetooth von <ph name="PRODUCT_OS_NAME" /> deaktiviert und der Nutzer kann es nicht wieder aktivieren. - - Wenn diese Richtlinie auf "wahr" gesetzt oder gar nicht eingestellt wird, kann der Nutzer Bluetooth nach Belieben aktivieren und deaktivieren. - - Wenn diese Richtlinie eingestellt ist, kann der Nutzer dies nicht außer Kraft setzen.</translation> <translation id="7216442368414164495">Ermöglicht Nutzern die Aktivierung erweiterter Berichterstellung bei Verwendung von Safe Browsing</translation> <translation id="7227967227357489766">Definiert eine Liste mit Nutzern, die sich auf dem Gerät anmelden dürfen. Die Einträge haben das Format <ph name="USER_WHITELIST_ENTRY_FORMAT" />, zum Beispiel <ph name="USER_WHITELIST_ENTRY_EXAMPLE" />. Um allen Nutzern in einer Domain die Anmeldung zu erlauben, verwenden Sie Einträge im Format <ph name="USER_WHITELIST_ENTRY_WILDCARD" />.
diff --git a/components/policy/resources/policy_templates_el.xtb b/components/policy/resources/policy_templates_el.xtb index c8329c3..ce10984 100644 --- a/components/policy/resources/policy_templates_el.xtb +++ b/components/policy/resources/policy_templates_el.xtb
@@ -1761,11 +1761,6 @@ Αν η πολιτική "RestoreOnStartup" έχει οριστεί, ώστε να επαναφέρει URL από προηγούμενες περιόδους σύνδεσης, αυτή η πολιτική δεν θα ισχύσει και τα cookie θα αποθηκευτούν μόνιμα για αυτούς τους ιστότοπους.</translation> <translation id="7207095846245296855">Επιβολή Ασφαλούς Αναζήτησης Google</translation> -<translation id="7213425178181578730">Εάν αυτή η πολιτική οριστεί ως ψευδής, το <ph name="PRODUCT_OS_NAME" /> θα απενεργοποιήσει το Bluetooth και ο χρήστης δεν θα μπορεί να το ενεργοποιήσει ξανά. - - Εάν αυτή η πολιτική οριστεί ως αληθής ή δεν οριστεί, ο χρήστης θα μπορεί να ενεργοποιήσει ή να απενεργοποιήσει το Bluetooth κατά βούληση. - - Εάν αυτή η πολιτική οριστεί, ο χρήστης δεν θα μπορεί να την αλλάξει ή να την παρακάμψει.</translation> <translation id="7216442368414164495">Αποδοχή της συμμετοχής των χρηστών στις εκτεταμένες αναφορές της Ασφαλούς περιήγησης</translation> <translation id="7227967227357489766">Καθορίζει τη λίστα των χρηστών στους οποίους επιτρέπεται να συνδέονται στη συσκευή. Οι καταχωρίσεις έχουν τη μορφή <ph name="USER_WHITELIST_ENTRY_FORMAT" />, όπως η καταχώριση <ph name="USER_WHITELIST_ENTRY_EXAMPLE" />. Για να επιτρέπεται η πρόσβαση σε τυχαίους χρήστες σε κάποιον τομέα, χρησιμοποιήστε καταχωρίσεις της μορφής <ph name="USER_WHITELIST_ENTRY_WILDCARD" />.
diff --git a/components/policy/resources/policy_templates_en-GB.xtb b/components/policy/resources/policy_templates_en-GB.xtb index 6e23c50..c65641e5 100644 --- a/components/policy/resources/policy_templates_en-GB.xtb +++ b/components/policy/resources/policy_templates_en-GB.xtb
@@ -161,6 +161,18 @@ <translation id="1561424797596341174">Policy overrides for Debug builds of the remote access host</translation> <translation id="1583248206450240930">Use <ph name="PRODUCT_FRAME_NAME" /> by default</translation> <translation id="1608755754295374538">URLs that will be granted access to audio capture devices without prompt</translation> +<translation id="1613574633990410986">Allows you to specify the proxy server used by <ph name="PRODUCT_NAME" /> and ARC-apps and prevents users from changing proxy settings. + + If you choose to never use a proxy server and always connect directly, all other options are ignored. + + If you choose to auto detect the proxy server, all other options are ignored. + + For detailed examples, visit: + <ph name="PROXY_HELP_URL" /> + + If you enable this setting, <ph name="PRODUCT_NAME" /> and ARC-apps ignore all proxy-related options specified from the command line. + + Leaving these policies not set will allow the users to choose the proxy settings on their own.</translation> <translation id="1617235075406854669">Enable deleting browser and download history</translation> <translation id="1617384279878333801">Enable add person in profile manager</translation> <translation id="1655229863189977773">Set disk cache size in bytes</translation> @@ -234,6 +246,15 @@ If you disable this setting, whenever the user performs an action which would provoke a file selection dialogue (like importing bookmarks, uploading files, saving links, etc.) a message is displayed instead and the user is assumed to have clicked Cancel on the file selection dialogue. If this setting is not set, users can open file selection dialogues as normal.</translation> +<translation id="1879485426724769439">Specifies the timezone to be used for the device. Users can override the specified timezone for the current session. However, on logout it is set back to the specified timezone. If an invalid value is provided, the policy is still activated using "GMT" instead. If an empty string is provided, the policy is ignored. + + If this policy is not used, the currently active timezone will remain in use however users can change the timezone and the change is persistent. Thus a change by one user affects the login-screen and all other users. + + New devices start out with the timezone set to "US/Pacific". + + The format of the value follows the names of timezones in the "IANA Time Zone Database" (see "https://en.wikipedia.org/wiki/Tz_database"). In particular, most timezones can be referred to by "continent/large_city" or "ocean/large_city". + + Setting this policy completely disables automatic timezone resolve by device location. It also overrides SystemTimezoneAutomaticDetection policy.</translation> <translation id="1897365952389968758">Allow all sites to run JavaScript (recommended)</translation> <translation id="193259052151668190">Whitelist of USB detachable devices</translation> <translation id="1933378685401357864">Wallpaper image</translation> @@ -640,6 +661,24 @@ <translation id="3072847235228302527">Set the Terms of Service for a device-local account</translation> <translation id="3096595567015595053">List of enabled plug-ins</translation> <translation id="3101501961102569744">Choose how to specify proxy server settings</translation> +<translation id="3125884964575432854">Allows you to specify the proxy server used by <ph name="PRODUCT_NAME" /> and ARC-apps and prevents users from changing proxy settings. + + If you choose to never use a proxy server and always connect directly, all other options are ignored. + + If you choose to use system proxy settings, all other options are ignored. + + If you choose to auto detect the proxy server, all other options are ignored. + + If you choose fixed server proxy mode, you can specify further options in 'Address or URL of proxy server' and 'Comma-separated list of proxy bypass rules'. ARC-apps will only use the HTTP proxy server with the highest priority. + + If you choose to use a .pac proxy script, you must specify the URL to the script in 'URL to a proxy .pac file'. + + For detailed examples, visit: + <ph name="PROXY_HELP_URL" /> + + If you enable this setting, <ph name="PRODUCT_NAME" /> and ARC-apps ignore all proxy-related options specified from the command line. + + Leaving this policy not set will allow the users to choose the proxy settings on their own.</translation> <translation id="3153348162326497318">Allows you to specify which extensions the users CANNOT install. Extensions already installed will be removed if blacklisted. A blacklist value of '*' means all extensions are blacklisted unless they are explicitly listed in the whitelist. @@ -716,6 +755,20 @@ If this policy is left not set the global default value will be used for all sites either from the 'DefaultKeygenSetting' policy if it is set or the user's personal configuration otherwise.</translation> <translation id="3381968327636295719">Use the host browser by default</translation> +<translation id="3398137877608138703">Allow or deny video capture. + + If enabled or not configured (default), the user will be prompted for + video capture access except for URLs configured in the + VideoCaptureAllowedUrls list which will be granted access without prompting. + ARC-apps will be able to access the camera if they have been given + permission. + + When this policy is disabled, the user will never be prompted and video + capture only be available to URLs configured in VideoCaptureAllowedUrls. + ARC-apps will not be able to access the camera. + + Outside of ARC-apps, this policy affects all types of video inputs and + not only the built-in camera.</translation> <translation id="3417418267404583991">If this policy is set to true or not configured, <ph name="PRODUCT_OS_NAME" /> will enable guest logins. Guest logins are anonymous user sessions and do not require a password. If this policy is set to false, <ph name="PRODUCT_OS_NAME" /> will not allow guest sessions to be started.</translation> @@ -733,6 +786,8 @@ <translation id="3478024346823118645">Wipe user data on sign-out</translation> <translation id="348495353354674884">Enable virtual keyboard</translation> <translation id="3496296378755072552">Password manager</translation> +<translation id="349667858031092827">Never auto-detect timezone.</translation> +<translation id="350443680860256679">Configure ARC</translation> <translation id="3504791027627803580">Specifies the URL of the search engine used to provide image search. Search requests will be sent using the GET method. If the DefaultSearchProviderImageURLPostParams policy is set then image search requests will use the POST method instead. This policy is optional. If not set, no image search will be used. @@ -883,6 +938,22 @@ If this policy is set to 'Keep cookies for the duration of the session' then cookies will be cleared when the session closes. Note that if <ph name="PRODUCT_NAME" /> is running in 'background mode', the session may not close when the last window is closed. Please see the 'BackgroundModeEnabled' policy for more information about configuring this behaviour. If this policy is left not set, 'AllowCookies' will be used and the user will be able to change it.</translation> +<translation id="4098957623809244159">This policy is deprecated, use ProxyMode instead. + + Allows you to specify the proxy server used by <ph name="PRODUCT_NAME" /> and ARC-apps and prevents users from changing proxy settings. + + If you choose to never use a proxy server and always connect directly, all other options are ignored. + + If you choose to use system proxy settings or auto detect the proxy server, all other options are ignored. + + If you choose manual proxy settings, you can specify further options in 'Address or URL of proxy server', 'URL to a proxy .pac file' and 'Comma-separated list of proxy bypass rules'. + + For detailed examples, visit: + <ph name="PROXY_HELP_URL" /> + + If you enable this setting, <ph name="PRODUCT_NAME" /> ignores all proxy-related options specified from the command line. + + Leaving this policy not set will allow the users to choose the proxy settings on their own.</translation> <translation id="4103289232974211388">Redirect to SAML IdP after user confirmation</translation> <translation id="410478022164847452">Specifies the length of time without user input after which the idle action is taken when running on AC power. @@ -1368,6 +1439,14 @@ <translation id="5893553533827140852">If this setting is enabled, then gnubby authentication requests will be proxied across a remote host connection. If this setting is disabled or not configured, gnubby authentication requests will not be proxied.</translation> +<translation id="5900959132054596599"><ph name="PRODUCT_NAME" /> and ARC-apps will bypass any proxy for the list of hosts given here. + + This policy only takes effect if you have selected manual proxy settings at 'Choose how to specify proxy server settings'. + + You should leave this policy not set if you have selected any other mode for setting proxy policies. + + For more detailed examples, visit: + <ph name="PROXY_HELP_URL" /></translation> <translation id="5921713479449475707">Allow autoupdate downloads via HTTP</translation> <translation id="5921888683953999946">Set the default state of the large cursor accessibility feature on the login screen. @@ -1513,6 +1592,7 @@ <translation id="637934607141010488">Report list of device users that have recently logged in. If the policy is set to false, the users will not be reported.</translation> +<translation id="639009029157091157">Let users decide.</translation> <translation id="6392973646875039351">Enables <ph name="PRODUCT_NAME" />'s Auto-fill feature and allows users to auto-complete web forms using previously stored information such as address or credit card information. If you disable this setting, Auto-fill will be inaccessible to users. @@ -1778,11 +1858,6 @@ If the "RestoreOnStartup" policy is set to restore URLs from previous sessions this policy will not be respected and cookies will be stored permanently for those sites.</translation> <translation id="7207095846245296855">Force Google SafeSearch</translation> -<translation id="7213425178181578730">If this policy is set to false, <ph name="PRODUCT_OS_NAME" /> will disable Bluetooth and the user cannot enable it back. - - If this policy is set to true or left unset, the user will be able to enable or disable Bluetooth as he wishes. - - If this policy is set, the user cannot change or override it.</translation> <translation id="7216442368414164495">Allow users to opt in to Safe Browsing extended reporting</translation> <translation id="7227967227357489766">Defines the list of users that are allowed to login to the device. Entries are of the form <ph name="USER_WHITELIST_ENTRY_FORMAT" />, such as <ph name="USER_WHITELIST_ENTRY_EXAMPLE" />. To allow arbitrary users on a domain, use entries of the form <ph name="USER_WHITELIST_ENTRY_WILDCARD" />. @@ -1897,6 +1972,9 @@ If this setting is disabled or not set, <ph name="PRODUCT_NAME" /> uses either the user-specified preferred locale (if configured), the system locale or the default locale 'en-US'.</translation> <translation id="7651739109954974365">Determines whether data roaming should be enabled for the device. If set to true, data roaming is allowed. If left unconfigured or set to false, data roaming will be unavailable.</translation> +<translation id="7667184304362487902">Configures the proxy settings for <ph name="PRODUCT_NAME" /> and ARC-apps. + + This policy isn't ready for usage yet, please don't use it.</translation> <translation id="76810863974142048">URL where remote access clients should obtain their authentication token. If this policy is set, the remote access host will require authenticating clients to obtain an authentication token from this URL in order to connect. Must be used in conjunction with RemoteAccessHostTokenValidationUrl. @@ -1971,6 +2049,19 @@ <translation id="7848840259379156480">Allows you to configure the default HTML renderer when <ph name="PRODUCT_FRAME_NAME" /> is installed. The default setting is to allow the host browser do the rendering, but you can optionally override this and have <ph name="PRODUCT_FRAME_NAME" /> render HTML pages by default.</translation> +<translation id="7853178359124471330">When this policy is set, automatic timezone detection flow will be in one of the following ways depending on the value of the setting: + + If set to TimezoneAutomaticDetectionUsersDecide, users would be able to control automatic timezone detection using normal controls in chrome://settings. + + If set to TimezoneAutomaticDetectionDisabled, automatic timezone controls in chrome://settings will be disabled. Automatic timezone detection will be always off. + + If set to TimezoneAutomaticDetectionIPOnly, timezone controls in chrome://settings will be disabled. Automatic timezone detection will be always on. Timezone detection will use IP-only method to resolve location. + + If set to TimezoneAutomaticDetectionSendWiFiAccessPoints, timezone controls in chrome://settings will be disabled. Automatic timezone detection will be always on. The list of visible Wi-Fi access-points will be always sent to Geolocation API server for fine-grained timezone detection. + + If this policy is not set, it will behave as if TimezoneAutomaticDetectionUsersDecide is set. + + If SystemTimezone policy is set, it overrides this policy. In this case automatic timezone detection is completely disabled.</translation> <translation id="7882585827992171421">This policy is active in retail mode only. Determines the id of the extension to be used as a screen saver on the sign-in screen. The extension must be part of the AppPack that is configured for this domain through the DeviceAppPack policy.</translation> @@ -2013,6 +2104,7 @@ If this policy is not set, the setting will be enabled.</translation> <translation id="8073243368829195">Allows Smart Lock to be used</translation> +<translation id="8074052133552427532">Always use coarse timezone detection.</translation> <translation id="8099880303030573137">Idle delay when running on battery power</translation> <translation id="8102913158860568230">Default mediastream setting</translation> <translation id="8104962233214241919">Automatically select client certificates for these sites</translation> @@ -2127,6 +2219,7 @@ <translation id="8424255554404582727">Set default display rotation, reapplied on every reboot</translation> <translation id="8426231401662877819">Rotate screen clockwise by 90 degrees</translation> <translation id="8451988835943702790">Use New Tab Page as homepage</translation> +<translation id="8458790683633857482">Specifies a set of policies that will be handed over to the ARC runtime. The value must be valid JSON.</translation> <translation id="8465065632133292531">Parameters for instant URL which uses POST</translation> <translation id="847472800012384958">Do not allow any site to show pop-ups</translation> <translation id="8477885780684655676">TLS 1.0</translation> @@ -2262,9 +2355,12 @@ If this policy is set to false, neither the user nor any apps or extensions can enter full screen mode. On all platforms except <ph name="PRODUCT_OS_NAME" />, kiosk mode is unavailable when full screen mode is disabled.</translation> +<translation id="8795495354632096254">Always send Wi-Fi acess-points to server while resolving timezone.</translation> <translation id="8818173863808665831">Report the geographic location of the device. If the policy is not set or set to false, the location will not be reported.</translation> +<translation id="8818768076343557335">Predict network actions on any network that is not cellular. + (Deprecated in 50, removed in 52. After 52, if value 1 is set, it will be treated as 0 – predict network actions on any network connection.)</translation> <translation id="8828766846428537606">Configure the default home page in <ph name="PRODUCT_NAME" /> and prevent users from changing it. The user's home page settings are only completely locked down, if you either select the home page to be the new tab page, or set it to be a URL and specify a home page URL. If you don't specify the home page URL, then the user is still able to set the home page to the new tab page by specifying 'chrome://newtab'.</translation> @@ -2316,6 +2412,7 @@ <translation id="9042911395677044526">Allows pushing network configuration to be applied per-user to a <ph name="PRODUCT_OS_NAME" /> device. The network configuration is a JSON-formatted string as defined by the Open Network Configuration format described at <ph name="ONC_SPEC_URL" /></translation> <translation id="9084985621503260744">Specify whether video activity affects power management</translation> <translation id="9088433379343318874">Enable the supervised user content provider</translation> +<translation id="9088444059179765143">Configure the automatic timezone detection method</translation> <translation id="9096086085182305205">Authentication server whitelist</translation> <translation id="9098553063150791878">Policies for HTTP authentication</translation> <translation id="9104138886225968319">Send monitoring heartbeats to the management server, to allow
diff --git a/components/policy/resources/policy_templates_es-419.xtb b/components/policy/resources/policy_templates_es-419.xtb index 0ec0462..25fb352 100644 --- a/components/policy/resources/policy_templates_es-419.xtb +++ b/components/policy/resources/policy_templates_es-419.xtb
@@ -1569,7 +1569,7 @@ Si no se configura esta política, el usuario podrá cambiar la lista de aplicaciones fijas en el menú de aplicaciones.</translation> <translation id="7132877481099023201">Las URL que recibirán acceso a dispositivos de captura de video sin solicitarlo</translation> -<translation id="7167436895080860385">Permitir que los usuarios muestren las contraseñas en el administrador de contraseñas (ya no está disponible)</translation> +<translation id="7167436895080860385">Permitir que los usuarios muestren las contraseñas en el administrador de contraseñas (dejó de estar disponible)</translation> <translation id="7173856672248996428">Perfil efímero</translation> <translation id="7187256234726597551">Si está establecida como verdadera, se permitirá la confirmación remota para el dispositivo, y se generará automáticamente un certificado que se subirá al servidor de administración de dispositivos. @@ -1591,11 +1591,6 @@ Si la política "RestoreOnStartup" se establece en la opción de restaurar las URL de las sesiones anteriores, esta política no se respetará y las cookies se almacenarán de forma permanente para esos sitios.</translation> <translation id="7207095846245296855">Forzar Google SafeSearch</translation> -<translation id="7213425178181578730">Si esta política se establece como falsa, <ph name="PRODUCT_OS_NAME" /> inhabilitará Bluetooth y el usuario no podrá volver a habilitarlo. - - Si esta política se establece como verdadera o no se establece, el usuario podrá habilitar o inhabilitar Bluetooth como lo desee. - - Si esta política está establecida, el usuario no puede cambiarla ni anularla.</translation> <translation id="7216442368414164495">Permitir que los usuarios acepten informes extendidos de navegación segura</translation> <translation id="7227967227357489766">Define la lista de usuarios con permiso para acceder al dispositivo. Las entradas tienen el formato <ph name="USER_WHITELIST_ENTRY_FORMAT" />, como <ph name="USER_WHITELIST_ENTRY_EXAMPLE" />. Para permitir usuarios arbitrarios en un dominio, utiliza las entradas del formulario <ph name="USER_WHITELIST_ENTRY_WILDCARD" />.
diff --git a/components/policy/resources/policy_templates_es.xtb b/components/policy/resources/policy_templates_es.xtb index 018abe9..252402ca 100644 --- a/components/policy/resources/policy_templates_es.xtb +++ b/components/policy/resources/policy_templates_es.xtb
@@ -96,7 +96,7 @@ <translation id="1359553908012294236">Si se asigna el valor true a esta política o si esta no se configura, <ph name="PRODUCT_NAME" /> habilitará los inicios de sesión como invitado. Los inicios de sesión como invitado son perfiles de <ph name="PRODUCT_NAME" /> en los que todas las ventanas están en modo incógnito. Si se asigna el valor false a esta política, <ph name="PRODUCT_NAME" /> no permitirá que se inicien los perfiles de invitado.</translation> -<translation id="1363275621236827384">Habilitar consultas al servidor de Quirks para los perfiles de hardware</translation> +<translation id="1363275621236827384">Habilitar consultas a Quirks Server para los perfiles de hardware</translation> <translation id="1397855852561539316">URL de sugerencia del proveedor de búsquedas predeterminadas</translation> <translation id="1398889361882383850">Permite establecer si los sitios web pueden ejecutar complementos automáticamente. La ejecución automática de complementos se puede permitir o denegar para todos los sitios web. @@ -751,7 +751,7 @@ El valor de la política debe estar especificado en milisegundos. Los valores están fijados en un intervalo de entre 30 segundos y 24 horas.</translation> <translation id="3528000905991875314">Habilitar páginas de error alternativas</translation> -<translation id="3538538104630456270">La opción asociada se utilizó antes de que se introdujese la nueva autenticación en las contraseñas visibles. Desde entonces, la opción y, por lo tanto, esta política, no han afectado al comportamiento de Chrome. El comportamiento actual de Chrome es el mismo que si se hubiese establecido la política para inhabilitar que se muestren las contraseñas sin cifrar en la página de configuración del Administrador de Contraseñas. Esto significa que la página de configuración incluye un solo marcador de posición y Chrome solo muestra la contraseña cuando el usuario hace clic en Mostrar (y al volver a autenticarse, si procede). A continuación se muestra la descripción original de la política. +<translation id="3538538104630456270">La opción asociada se utilizó antes de que se introdujese la nueva autenticación para ver las contraseñas. Desde entonces, la opción y, por lo tanto, esta política, no han afectado al comportamiento de Chrome. El comportamiento actual de Chrome es el mismo que si se hubiese establecido la política para inhabilitar que se muestren las contraseñas sin cifrar en la página de configuración del Administrador de Contraseñas. Esto significa que la página de configuración incluye un solo marcador de posición y Chrome solo muestra la contraseña cuando el usuario hace clic en Mostrar (y al volver a autenticarse, si procede). A continuación se muestra la descripción original de la política. Permite controlar si las contraseñas se pueden mostrar sin cifrar a los usuarios en el Administrador de Contraseñas. @@ -1768,11 +1768,6 @@ Si la política RestoreOnStartup se configura para restaurar las URL de sesiones anteriores, esta política no se respetará y las cookies se almacenarán de forma permanente para estos sitios web.</translation> <translation id="7207095846245296855">Forzar Google SafeSearch</translation> -<translation id="7213425178181578730">Si se asigna el valor False a esta política, <ph name="PRODUCT_OS_NAME" /> inhabilitará la conexión Bluetooth, y el usuario no podrá volver a habilitarla. - - Si se asigna el valor True a esta política o si esta no se configura, el usuario podrá habilitar o inhabilitar la conexión Bluetooth cuando lo desee. - - Si se establece esta política, el usuario no podrá cambiar esta opción ni anularla.</translation> <translation id="7216442368414164495">Permitir a los usuarios habilitar los informes ampliados de la función de navegación segura</translation> <translation id="7227967227357489766">Permite definir la lista de usuarios con permiso para iniciar sesión en el dispositivo. Las entradas tienen el formato <ph name="USER_WHITELIST_ENTRY_FORMAT" /> (por ejemplo, <ph name="USER_WHITELIST_ENTRY_EXAMPLE" />). Para permitir usuarios arbitrarios en un dominio, utiliza entradas del formulario <ph name="USER_WHITELIST_ENTRY_WILDCARD" />. @@ -2265,15 +2260,15 @@ <translation id="8858642179038618439">Forzar el modo de seguridad de YouTube</translation> <translation id="8864975621965365890">Elimina el mensaje de desactivación que aparece cuando <ph name="PRODUCT_FRAME_NAME" /> muestra un sitio.</translation> <translation id="8870318296973696995">Página de inicio</translation> -<translation id="8889588091638298603">El servidor de Quirks proporciona archivos de configuración específicos del hardware, como +<translation id="8889588091638298603">Quirks Server proporciona archivos de configuración específicos del hardware, como los perfiles de pantalla ICC para ajustar la calibración del monitor. Cuando se asigna el valor false a esta política, el dispositivo no intenta - ponerse en contacto con el servidor de Quirks para descargar los archivos de configuración. + ponerse en contacto con Quirks Server para descargar los archivos de configuración. Si se asigna el valor true a esta política o si esta no se configura, <ph name="PRODUCT_OS_NAME" /> se pondrá en contacto - automáticamente con el servidor de Quirks, descargará los archivos de configuración + automáticamente con Quirks Server, descargará los archivos de configuración si están disponibles y los almacenará en el dispositivo. Estos archivos pueden utilizarse, por ejemplo, para mejorar la calidad de la pantalla de los monitores conectados.</translation> <translation id="8905426178924715309">Esta política está obsoleta, utiliza ForceGoogleSafeSearch y ForceYouTubeSafetyMode en su lugar. Esta política se ignorará si están establecidas ForceGoogleSafeSearch o ForceYouTubeSafetyMode.
diff --git a/components/policy/resources/policy_templates_et.xtb b/components/policy/resources/policy_templates_et.xtb index aa92da4d..1e77e2fc 100644 --- a/components/policy/resources/policy_templates_et.xtb +++ b/components/policy/resources/policy_templates_et.xtb
@@ -97,7 +97,7 @@ <translation id="1359553908012294236">Kui selle reegli väärtuseks määratakse Tõene või seda ei seadistata, lubab teenus <ph name="PRODUCT_NAME" /> külaliste sisselogimise. Külaliste sisselogimised on teenuse <ph name="PRODUCT_NAME" /> profiilid, kus kõik aknad on inkognito režiimis. Kui selle reegli väärtuseks määratakse Väär, ei luba teenus <ph name="PRODUCT_NAME" /> külaliste profiile käivitada.</translation> -<translation id="1363275621236827384">Lubatakse riistvaraprofiilide päringud Quirksi serverist</translation> +<translation id="1363275621236827384">Lubatakse riistvaraprofiilide päringud Quirks Serverist</translation> <translation id="1397855852561539316">Vaikeotsingupakkuja soovitatud URL</translation> <translation id="1398889361882383850">Saate määrata, kas veebisaitidel on lubatud pistikprogramme automaatselt käitada. Pistikprogrammide automaatse käitamise saab kõigi veebisaitide puhul lubada või keelata. @@ -1763,11 +1763,6 @@ Kui reegel „RestoreOnStartup” on seadistatud nii, et eelmiste seansside URL-id taastatakse, ei järgita seda reeglit ja nende saitide küpsisefailid talletatakse jäädavalt.</translation> <translation id="7207095846245296855">Google SafeSearchi jõustamine</translation> -<translation id="7213425178181578730">Kui reegli väärtuseks määratakse Väär, keelab operatsioonisüsteem <ph name="PRODUCT_OS_NAME" /> Bluetoothi ja kasutaja ei saa seda enam uuesti lubada. - - Kui reegli väärtuseks määratakse Tõene või seda ei määrata, saab kasutaja Bluetoothi lubada või keelata oma soovi järgi. - - Kui see reegel määratakse, ei saa kasutaja seda muuta ega alistada.</translation> <translation id="7216442368414164495">Kasutajatel lubatakse ohutu sirvimise laiendatud aruannete lubamine</translation> <translation id="7227967227357489766">Määrab loendi kasutajatest, kellel on luba seadmesse sisse logida. Kirjete vorming on <ph name="USER_WHITELIST_ENTRY_FORMAT" />, näiteks <ph name="USER_WHITELIST_ENTRY_EXAMPLE" />. Kui soovite juhukasutajaid domeeni lubada, siis kasutage kirjete vormingut <ph name="USER_WHITELIST_ENTRY_WILDCARD" />. @@ -2249,15 +2244,15 @@ <translation id="8858642179038618439">YouTube’i ohutu režiimi jõustamine</translation> <translation id="8864975621965365890">Keelab tagasilükkamisviiba, mis kuvatakse, kui saiti renderdab <ph name="PRODUCT_FRAME_NAME" />.</translation> <translation id="8870318296973696995">Avaleht</translation> -<translation id="8889588091638298603">Quirksi server pakub riistvarapõhiseid konfiguratsioonifaile, nagu +<translation id="8889588091638298603">Quirks Server pakub riistvarapõhiseid konfiguratsioonifaile, nagu ICC ekraaniprofiilid, et saaksite monitori kalibreerimist kohandada. - Kui selle reegli väärtuseks määratakse Väär, ei ürita seade Quirksi - serveriga konfiguratsioonifailide allalaadimiseks ühendust võtta. + Kui selle reegli väärtuseks määratakse Väär, ei ürita seade Quirks + Serveriga konfiguratsioonifailide allalaadimiseks ühendust võtta. Kui selle reegli väärtuseks määratakse Tõene või seda ei seadistata, võtab teenus <ph name="PRODUCT_OS_NAME" /> - Quirksi serveriga automaatselt ühendust, laadib konfiguratsioonifailid alla, + Quirks Serveriga automaatselt ühendust, laadib konfiguratsioonifailid alla, kui need on saadaval, ja salvestab need seadmesse. Neid faile võib näiteks kasutada ühendatud monitoride pildikvaliteedi parandamiseks.</translation> <translation id="8905426178924715309">Selle reegli tugi on katkestatud, kasutage selle asemel reegleid ForceGoogleSafeSearch ja ForceYouTubeSafetyMode. Seda reeglit eiratakse, kui reegel ForceGoogleSafeSearch või ForceYouTubeSafetyMode on määratud.
diff --git a/components/policy/resources/policy_templates_fa.xtb b/components/policy/resources/policy_templates_fa.xtb index b9af9eb..266e181 100644 --- a/components/policy/resources/policy_templates_fa.xtb +++ b/components/policy/resources/policy_templates_fa.xtb
@@ -678,7 +678,7 @@ مقدار خطمشی باید بر حسب میلی ثانیه باشد. مقادیر در محدوده ۳۰ ثانیه تا ۲۴ ساعت نگهداشته میشوند.</translation> <translation id="3528000905991875314">فعال کردن صفحات خطای جایگزین</translation> -<translation id="3538538104630456270">تنظیم مرتبط، قبل از معرفی احراز هویت مجدد مربوط به تماشای گذرواژهها استفاده شد. از آن پس، این تنظیم و در نتیجه این خطمشی تأثیری بر رفتار Chrome نداشتند. اکنون رفتار فعلی Chrome مانند زمانی است که خطمشی روی غیرفعال کردن نمایش گذرواژهها بهصورت متن آشکار در صفحه تنظیمات مدیر گذرواژه تنظیم شده باشد. به این معنی که آن صفحه تنظیمات فقط حاوی یک جایبان است و فقط با کلیک کردن کاربر روی «نمایش» (و احراز هویت مجدد در صورت امکان) Chrome گذرواژه را نشان میدهد. شرح اصلی خطمشی در زیر آمده است. +<translation id="3538538104630456270">تنظیم مرتبط، قبل از معرفی احراز هویت مجدد مربوط به تماشای گذرواژهها استفاده شد. از آن پس، این تنظیم و در نتیجه این خطمشی تأثیری بر رفتار Chrome نداشتند. اکنون رفتار فعلی Chrome مانند زمانی است که خطمشی روی غیرفعال کردن نمایش گذرواژهها بهصورت متن آشکار (رمزنگاری نشده) در صفحه تنظیمات مدیر گذرواژه تنظیم شده باشد. به این معنی که آن صفحه تنظیمات فقط حاوی یک جایبان است و فقط با کلیک کردن کاربر روی «نمایش» (و احراز هویت مجدد در صورت امکان) Chrome گذرواژه را نشان میدهد. شرح اصلی خطمشی در زیر آمده است. کنترل میکند کاربر میتواند گذرواژهها را بهصورت متن آشکار در مدیر گذرواژه نشان دهد یا خیر. @@ -1594,11 +1594,6 @@ اگر خطمشی «RestoreOnStartup» برای بازیابی نشانیهای وب از جلسات قبلی تنظیم شود، این خطمشی درنظر گرفته نمیشود و کوکیها بهصورتی دائمی برای آن سایتها ذخیره میشوند.</translation> <translation id="7207095846245296855">اجبار کردن جستجوی ایمن Google</translation> -<translation id="7213425178181578730">اگر این خطمشی روی نادرست تنظیم شود، <ph name="PRODUCT_OS_NAME" /> بلوتوث را غیرفعال میکند و کاربر نمیتواند آن را دوباره فعال کند. - - اگر این خطمشی روی درست تنظیم شود یا تنظیمنشده رها شود، کاربر میتواند در صورت تمایل آن را فعال کند یا بلوتوث را غیرفعال میکند. - - اگر این خطمشی تنظیم شود، کاربر نمیتواند آن را تغییر دهد یا لغو کند.</translation> <translation id="7216442368414164495">به کاربران اجازه میدهد تا گزارش تفصیلی مرور امن را فعال کنند</translation> <translation id="7227967227357489766">لیستی از کاربران را مشخص میکند که مجاز به ورود به سیستم دستگاه هستند. ورودیها به شکل <ph name="USER_WHITELIST_ENTRY_FORMAT" />، مانند <ph name="USER_WHITELIST_ENTRY_EXAMPLE" /> هستند. برای اجازه به کاربران اختیاری موجود در یک دامنه، از ورودیهای <ph name="USER_WHITELIST_ENTRY_WILDCARD" /> استفاده کنید.
diff --git a/components/policy/resources/policy_templates_fi.xtb b/components/policy/resources/policy_templates_fi.xtb index 0e946d05..b403df092 100644 --- a/components/policy/resources/policy_templates_fi.xtb +++ b/components/policy/resources/policy_templates_fi.xtb
@@ -1608,11 +1608,6 @@ Jos RestoreOnStartup-käytäntö on määritetty palauttamaan aiempien käyttökertojen URL-osoitteet, tätä käytäntöä ei noudateta, vaan kyseisten sivustojen evästeet tallennetaan pysyvästi.</translation> <translation id="7207095846245296855">Pakota Googlen SafeSearch</translation> -<translation id="7213425178181578730">Jos käytännön arvo on epätosi, <ph name="PRODUCT_OS_NAME" /> poistaa Bluetoothin käytöstä, eikä käyttäjä voi ottaa sitä käyttöön. - - Jos käytännön arvo on tosi tai sitä ei aseteta, käyttäjä voi halutessaan ottaa Bluetoothin käyttöön tai poistaa sen käytöstä. - - Jos käytäntö on asetettu, käyttäjä ei voi muuttaa tai ohittaa sitä.</translation> <translation id="7216442368414164495">Anna käyttäjien sallia Selaussuojan laajempi raportointi</translation> <translation id="7227967227357489766">Määrittää luettelon käyttäjistä, jotka voivat kirjautua laitteeseen. Merkinnät määritetään muodossa <ph name="USER_WHITELIST_ENTRY_FORMAT" />, esimerkiksi <ph name="USER_WHITELIST_ENTRY_EXAMPLE" />. Voit sallia toimialueen kaikkien käyttäjien kirjautumisen merkintätavalla <ph name="USER_WHITELIST_ENTRY_WILDCARD" />.
diff --git a/components/policy/resources/policy_templates_fil.xtb b/components/policy/resources/policy_templates_fil.xtb index c6a2284..3f5e40d 100644 --- a/components/policy/resources/policy_templates_fil.xtb +++ b/components/policy/resources/policy_templates_fil.xtb
@@ -750,7 +750,7 @@ Ang halaga ng patakaran ay dapat tukuyin gamit ang milliseconds. Limitado ang mga halaga sa sakop na 30 segundo hanggang 24 na oras.</translation> <translation id="3528000905991875314">Paganahin ang mga kahaliling pahina ng error</translation> -<translation id="3538538104630456270">Ang nauugnay na setting ay ginamit bago ipinatupad ang muling pagpapatotoo sa pagtingin ng mga password. Mula noon, walang naging epekto ang setting at ang patakaran na ito sa gawi ng Chrome. Sa ngayon, ang kasalukuyang gawi ng Chrome ay parang itinakda ang patakaran na i-disable ang pagpapakita ng mga password sa malinaw na text sa page ng mga setting ng password manager. Ibig sabihin, ang mga page ng setting ay naglalaman lang ng placeholder, at ipapakita lang ng Chrome ang password kapag na-click ng user ang "Ipakita" (at muling nagpatotoo, kung naaangkop). Nasa ibaba ang orihinal na paglalarawan ng patakaran. +<translation id="3538538104630456270">Ang nauugnay na setting ay ginamit bago ipinatupad ang muling pagpapatotoo sa pagtingin ng mga password. Mula noon, walang naging epekto ang setting at ang patakaran na ito sa gawi ng Chrome. Sa ngayon, ang kasalukuyang gawi ng Chrome ay parang itinakda ang patakaran na i-disable ang pagpapakita ng mga password sa malinaw na text sa page ng mga setting ng password manager. Ibig sabihin, ang mga page ng setting ay naglalaman lang ng placeholder at ipapakita lang ng Chrome ang password kapag na-click ng user ang "Ipakita" (at muling nagpatotoo, kung naaangkop). Nasa ibaba ang orihinal na paglalarawan ng patakaran. Nakokontrol kung maaaring ipakita ng user ang mga password sa malinaw na text sa password manager. @@ -1772,10 +1772,6 @@ Kung nakatakda ang patakaran na "RestoreOnStartup" na magpanumbalik ng mga URL mula sa mga dating session, hindi susundin ang patakarang ito at permanenteng iiimbak ang cookies para sa mga site na ito.</translation> <translation id="7207095846245296855">Puwersahin ang Google SafeSearch</translation> -<translation id="7213425178181578730">Kung itatakda ang patakarang ito sa false, idi-disable ng <ph name="PRODUCT_OS_NAME" /> ang Bluetooth at hindi na ito muling mae-enable ng user. - Kung itatakda ang patakarang ito sa true o hahayaang hindi nakatakda, mae-enable o madi-disable ng user ang Bluetooth kailanman niya gustuhin. - - Kung itatakda ang patakarang ito, hindi na ito mababago o mao-override ng user.</translation> <translation id="7216442368414164495">Binibigyang-daan ang mga user na mag-opt in sa pinalawak na pag-uulat sa Ligtas na Pagba-browse</translation> <translation id="7227967227357489766">Tinutukoy ang listahan ng mga user na pinapayagang mag-login sa device. Ang mga entry ay nasa anyo ng <ph name="USER_WHITELIST_ENTRY_FORMAT" />, gaya ng <ph name="USER_WHITELIST_ENTRY_EXAMPLE" />. Upang payagan ang mga arbitrary user sa isang domain, na gumamit ng mga entry na may anyong <ph name="USER_WHITELIST_ENTRY_WILDCARD" />.
diff --git a/components/policy/resources/policy_templates_fr.xtb b/components/policy/resources/policy_templates_fr.xtb index 4b56baa..9185470 100644 --- a/components/policy/resources/policy_templates_fr.xtb +++ b/components/policy/resources/policy_templates_fr.xtb
@@ -1786,11 +1786,6 @@ Si la règle RestoreOnStartup est définie de manière à restaurer les URL des sessions précédentes, elle n'est pas respectée. Les cookies sont alors stockés de façon permanente pour ces sites.</translation> <translation id="7207095846245296855">Forcer Google SafeSearch</translation> -<translation id="7213425178181578730">Si cette règle est définie sur "False", <ph name="PRODUCT_OS_NAME" /> désactivera le Bluetooth, et l'utilisateur ne pourra pas le réactiver. - - Si cette règle est définie sur "True" ou n'est pas configurée, l'utilisateur pourra activer ou désactiver le Bluetooth comme il le souhaite. - - Si cette règle est configurée, l'utilisateur ne pourra pas la modifier ni l'ignorer.</translation> <translation id="7216442368414164495">Permettre aux utilisateurs d'activer la création de rapports détaillés dans le cadre de la navigation sécurisée</translation> <translation id="7227967227357489766">Définit la liste des utilisateurs autorisés à se connecter à l'appareil. Les entrées se présentent sous la forme suivante : <ph name="USER_WHITELIST_ENTRY_FORMAT" /> (<ph name="USER_WHITELIST_ENTRY_EXAMPLE" />, par exemple). Pour autoriser des utilisateurs arbitraires sur un domaine, utilisez les entrées sous la forme suivante : <ph name="USER_WHITELIST_ENTRY_WILDCARD" />.
diff --git a/components/policy/resources/policy_templates_gu.xtb b/components/policy/resources/policy_templates_gu.xtb index ddfc4d6..06d0e18 100644 --- a/components/policy/resources/policy_templates_gu.xtb +++ b/components/policy/resources/policy_templates_gu.xtb
@@ -1763,11 +1763,6 @@ જો પહેલાંના સત્રોમાંથી URL ને પુનઃસ્થાપિત કરવા માટે "RestoreOnStartup" નીતિ સેટ કરવામાં આવી હોય, તો આ નીતિ જળવાશે નહીં અને તે સાઇટ્સ માટે કુકીઝ સ્થાયી રૂપે સંગ્રહિત થશે.</translation> <translation id="7207095846245296855">Google સલામત શોધને ફરજ પાડવી</translation> -<translation id="7213425178181578730">જો આ નીતિ ફૉલ્સ પર સેટ કરેલ છે, તો <ph name="PRODUCT_OS_NAME" />, Bluetooth ને અક્ષમ કરશે અને વપરાશકર્તા તેને પાછી સક્ષમ કરી શકતાં નથી. - - જો આ નીતિ ટ્રુ પર સેટ કરેલ છે અથવા સેટ કર્યા વગરની છોડી દીધેલ છે, તો વપરાશકર્તા તેની ઇચ્છા મુજબ Bluetooth ને સક્ષમ અથવા અક્ષમ કરી શકશે. - - જો આ નીતિ સેટ કરેલ છે, તો વપરાશકર્તા તેને બદલી કે ઓવરરાઇડ કરી શકતાં નથી.</translation> <translation id="7216442368414164495">વપરાશકર્તાઓને સુરક્ષિત બ્રાઉઝિંગ એક્સ્ટેન્ડેડ રિપોર્ટિંગને પસંદ કરવાની મંજૂરી આપવી</translation> <translation id="7227967227357489766">ઉપકરણ પર લૉગિન કરવા માટેની વપરાશકર્તાઓની સૂચિને નિર્ધારિત કરે છે. એન્ટ્રીઓ <ph name="USER_WHITELIST_ENTRY_FORMAT" /> નું ફોર્મ છે, જેમ કે <ph name="USER_WHITELIST_ENTRY_EXAMPLE" />. ડોમેન પર સ્વૈચ્છિક વપરાશકર્તાઓને મંજૂરી આપવા માટે, <ph name="USER_WHITELIST_ENTRY_WILDCARD" /> ફોર્મની એન્ટ્રીઓનો ઉપયોગ કરે છે.
diff --git a/components/policy/resources/policy_templates_hi.xtb b/components/policy/resources/policy_templates_hi.xtb index f3d28b2..40d5ee9 100644 --- a/components/policy/resources/policy_templates_hi.xtb +++ b/components/policy/resources/policy_templates_hi.xtb
@@ -720,7 +720,7 @@ नीति का मान मिलीसेकंड में निर्दिष्ट किया जाना चाहिए. मानों को 30 सेकंड से 24 घंटे की सीमा में क्लैम्प किया जाता है.</translation> <translation id="3528000905991875314">वैकल्पिक त्रुटि पृष्ठों को सक्षम करें</translation> -<translation id="3538538104630456270">पासवर्ड देखने के लिए पुनः प्रमाणीकरण के शुरू होने से पहले संबद्ध सेटिंग का उपयोग किया था. तब से, उस सेटिंग का और इस पॉलिसी का Chrome के व्यवहार पर कोई प्रभाव नहीं पड़ता था. यदि पॉलिसी को पासवर्ड प्रबंधक सेटिंग पृष्ठ में स्पष्ट रूप से लेख में पासवर्ड दिखाना अक्षम करने पर सेट किया गया था, तो Chrome का वर्तमान व्यवहार अभी वही है. इसका अर्थ यह है कि सेटिंग पृष्ठ में बस प्लेसहोल्डर है और उपयोगकर्ता द्वारा केवल “दिखाएं” (और यदि लागू हो, तो पुनः प्रमाणीकरण) क्लिक करने पर Chrome पासवर्ड दिखा देता है. नीति का मूलभूत वर्णन निम्न का पालन करता है. +<translation id="3538538104630456270">पासवर्ड देखने के लिए पुनः प्रमाणीकरण के शुरू होने से पहले संबद्ध सेटिंग का उपयोग किया था. तब से, उस सेटिंग का और इस पॉलिसी का Chrome के व्यवहार पर कोई प्रभाव नहीं पड़ता था. यदि पॉलिसी को पासवर्ड प्रबंधक सेटिंग पृष्ठ में स्पष्ट रूप से लेख में पासवर्ड दिखाना अक्षम करने पर सेट किया गया था, तो Chrome का वर्तमान व्यवहार अभी वही है. इसका अर्थ यह है कि सेटिंग पृष्ठ में बस प्लेसहोल्डर है और उपयोगकर्ता द्वारा केवल “दिखाएं” (और यदि लागू हो, तो पुनः प्रमाणीकरण) क्लिक करने पर Chrome पासवर्ड दिखा देता है. पॉलिसी का मूलभूत वर्णन निम्न का पालन करता है. यह नियंत्रित करती है कि क्या उपयोगकर्ता पासवर्ड प्रबंधक में पासवर्ड को स्पष्ट रूप से लेख में दिखा सकता है. @@ -1711,11 +1711,6 @@ यदि "RestoreOnStartup" पॉलिसी को पिछले सत्रों के URL पुन: स्थापित करने के लिए सेट किया गया हो तो इस पॉलिसी पर ध्यान नहीं दिया जाएगा और उन साइटों के लिए कुकी को स्थायी रूप से संग्रहीत किया जाएगा.</translation> <translation id="7207095846245296855">Google सुरक्षित खोज लागू करें</translation> -<translation id="7213425178181578730">यदि यह पॉलिसी गलत पर सेट है, तो <ph name="PRODUCT_OS_NAME" /> ब्लूटूथ को अक्षम कर देगा और उपयोगकर्ता उसे वापस सक्षम नहीं कर सकेगा. - - यदि यह पॉलिसी सही पर सेट है या इसे सेट नहीं किया गया है, तो उपयोगकर्ता अपनी इच्छा के अनुसार ब्लूटूथ को सक्षम या अक्षम कर पाएगा. - - यदि यह पॉलिसी सेट की गई है, तो उपयोगकर्ता उसे बदल नहीं सकता या ओवरराइड नहीं कर सकता.</translation> <translation id="7216442368414164495">उपयोगकर्ताओं को सुरक्षित ब्राउज़िंग विस्तारित रिपोर्टिंग की अनुमति देना</translation> <translation id="7227967227357489766">उन उपयोगकर्ताओं की सूची परिभाषित करती है जिन्हें डिवाइस में प्रवेश करने की अनुमति है. प्रविष्टियां <ph name="USER_WHITELIST_ENTRY_FORMAT" /> प्रारूप, जैसे <ph name="USER_WHITELIST_ENTRY_EXAMPLE" /> में हैं. डोमेन पर अनियंत्रित उपोगकर्ताओं की अनुमति के लिए, फ़ॉर्म <ph name="USER_WHITELIST_ENTRY_WILDCARD" /> की प्रविष्टियों का उपयोग करें.
diff --git a/components/policy/resources/policy_templates_hr.xtb b/components/policy/resources/policy_templates_hr.xtb index 60548745..c27629f4 100644 --- a/components/policy/resources/policy_templates_hr.xtb +++ b/components/policy/resources/policy_templates_hr.xtb
@@ -82,7 +82,7 @@ <translation id="1359553908012294236">Ako se pravilo postavi na "True" ili se ne konfigurira, <ph name="PRODUCT_NAME" /> omogućit će prijave gostiju. Prijave gostiju predstavljaju profile preglednika <ph name="PRODUCT_NAME" /> u kojima se svi prozori otvaraju u anonimnom načinu. Ako se pravilo postavi na "False", <ph name="PRODUCT_NAME" /> neće dopustiti pokretanje profila gostiju.</translation> -<translation id="1363275621236827384">Omogući slanje upita Quirksovu poslužitelju za hardverske profile</translation> +<translation id="1363275621236827384">Omogući slanje upita na Quirks Server za hardverske profile</translation> <translation id="1397855852561539316">Predloženi URL zadanog davatelja usluge pretraživanja</translation> <translation id="1398889361882383850">Omogućuje vam da postavite hoće li web-lokacijama biti dopušteno automatsko pokretanje dodataka. Automatsko pokretanje dodataka može biti dopušteno za sve web-lokacije ili odbijeno za sve web-lokacije. @@ -1607,11 +1607,6 @@ Ako se pravilo "RestoreOnStartup" postavi na vraćanje URL-ova iz prethodnih sesija, ovo se pravilo neće poštovati i za te će se web-lokacije kolačići trajno pohranjivati.</translation> <translation id="7207095846245296855">Nametni Google sigurno pretraživanje</translation> -<translation id="7213425178181578730">Ako se to pravilo postavi na False, <ph name="PRODUCT_OS_NAME" /> onemogućit će Bluetooth i korisnik ga neće moći omogućiti. - - Ako se to pravilo postavi na True ili se ne postavi, korisnik će moći omogućiti ili onemogućiti Bluetooth prema želji. - - Ako se to pravilo postavi, korisnik ga ne može promijeniti niti nadjačati.</translation> <translation id="7216442368414164495">Omogućivanje korisnicima da se uključe u prošireno izvješćivanje Sigurnog pregledavanja</translation> <translation id="7227967227357489766">Definira popis korisnika kojima je dopuštena prijava na uređaj. Unosi su u obliku <ph name="USER_WHITELIST_ENTRY_FORMAT" />, na primjer, <ph name="USER_WHITELIST_ENTRY_EXAMPLE" />. Da bi slučajnim korisnicima bio dopušten pristup domeni, upotrijebite unose u obliku <ph name="USER_WHITELIST_ENTRY_WILDCARD" />. @@ -2055,15 +2050,15 @@ <translation id="8858642179038618439">Nametni Siguran način rada na YouTubeu</translation> <translation id="8864975621965365890">Zaustavlja upit za odbijanje koji se pojavljuje kada web-lokaciju generira <ph name="PRODUCT_FRAME_NAME" />.</translation> <translation id="8870318296973696995">Početna stranica</translation> -<translation id="8889588091638298603">Quirksov poslužitelj pruža konfiguracijske datoteke za hardver, primjerice +<translation id="8889588091638298603">Quirks Server pruža konfiguracijske datoteke za hardver, primjerice profile ICC zaslona za kalibriranje monitora. Kad se to pravilo postavi na "false", uređaj neće pokušavati - kontaktirati Quirksov poslužitelj radi preuzimanja konfiguracijskih datoteka. + kontaktirati Quirks Server radi preuzimanja konfiguracijskih datoteka. Ako se pravilo postavi na "true" ili se ne konfigurira, operativni sustav <ph name="PRODUCT_OS_NAME" /> - automatski će kontaktirati Quirksov poslužitelj i preuzeti konfiguracijske datoteke + automatski će kontaktirati Quirks Server i preuzeti konfiguracijske datoteke ako su dostupne i pohraniti ih na uređaj. Pomoću tih se datoteka, na primjer, može poboljšati kvaliteta prikaza priključenih monitora.</translation> <translation id="8905426178924715309">To je pravilo obustavljeno, pa umjesto njega upotrijebite "ForceGoogleSafeSearch" i "ForceYouTubeSafetyMode". Pravilo će se zanemariti ako se postave pravila "ForceGoogleSafeSearch" ili "ForceYouTubeSafetyMode".
diff --git a/components/policy/resources/policy_templates_hu.xtb b/components/policy/resources/policy_templates_hu.xtb index 9549e204..bab59f26 100644 --- a/components/policy/resources/policy_templates_hu.xtb +++ b/components/policy/resources/policy_templates_hu.xtb
@@ -145,6 +145,18 @@ <translation id="1561424797596341174">A házirend felülírja a távoli elérésű gazdagép hibakeresés végzésére szolgáló buildjeit</translation> <translation id="1583248206450240930">A <ph name="PRODUCT_FRAME_NAME" /> használata alapértelmezés szerint</translation> <translation id="1608755754295374538">Azon URL-ek, amelyek rákérdezés nélkül hozzáférést kapnak a hangrögzítő eszközökhöz</translation> +<translation id="1613574633990410986">Lehetővé teszi a <ph name="PRODUCT_NAME" /> és az ARC-alkalmazások által használt proxyszerver meghatározását, és megakadályozza, hogy a felhasználók megváltoztassák a proxybeállításokat. + + Ha úgy dönt, hogy soha nem használ proxyszervert, és mindig közvetlenül kapcsolódik, az összes többi lehetőség figyelmen kívül marad. + + Ha a proxyszerver automatikus észlelése mellett dönt, az összes többi lehetőség figyelmen kívül marad. + + Részletes példákért látogasson el a következő címre: + <ph name="PROXY_HELP_URL" /> + + Ha engedélyezi ezt a házirendet, a <ph name="PRODUCT_NAME" /> és az ARC-alkalmazások figyelmen kívül hagynak a proxyval kapcsolatban a parancssorból megadott minden beállítást. + + Ha beállítatlanul hagyja ezeket a házirendeket, akkor a felhasználók maguk választhatják ki proxybeállításaikat.</translation> <translation id="1617235075406854669">Böngészési és letöltési előzmények törlésének engedélyezése</translation> <translation id="1617384279878333801">Engedélyezi a személyek hozzáadását a profilkezelőben</translation> <translation id="1655229863189977773">Lemezgyorsítótár méretének beállítása bájtban</translation> @@ -213,6 +225,15 @@ <translation id="1865417998205858223">Kulcsengedélyek</translation> <translation id="186719019195685253">Végrehajtandó művelet a tétlenségi késleltetés elérésekor hálózati áramforrásról történő üzemelés során</translation> <translation id="187819629719252111">Lehetővé teszi a hozzáférést a gépen lévő helyi fájlokhoz azáltal, hogy engedélyezi a(z) <ph name="PRODUCT_NAME" /> számára a fájlkiválasztási párbeszédablakok megjelenítését. Ha engedélyezi ezt a beállítást, a felhasználók a szokásos módon nyithatják meg a fájlkiválasztási párbeszédablakokat. Ha letiltja a beállítást, minden alkalommal, amikor a felhasználó olyan műveletet hajt végre, amely fájlkiválasztási párbeszédablakot hívna elő (például könyvjelzők importálása, fájlok feltöltése, linkek mentése stb.), egy üzenet jelenik meg helyette, a rendszer pedig úgy tekinti, hogy a felhasználó a Mégse gombra kattintott a fájlkiválasztási párbeszédablakban. Ha ez nincs beállítva, a felhasználók a szokásos módon nyithatnak meg fájlkiválasztási párbeszédablakokat.</translation> +<translation id="1879485426724769439">Meghatározza az eszköz által használandó időzónát. A felhasználók az aktuális munkamenet idejére felülbírálhatják a megadott időzónát. Kijelentkezéskor azonban visszaáll a megadott időzóna. Érvénytelen érték megadása esetén a házirend a „GMT” értékkel működik. Üres karakterlánc megadása esetén a házirendet figyelmen kívül hagyja a rendszer. + + Ha a házirend nincs használatban, akkor a jelenleg aktív időzóna marad érvényben, azonban a felhasználók megváltoztathatják az időzónát, és ez a módosítás így is marad. Ily módon az egyik felhasználó által végzett módosítás kihat a bejelentkező képernyőre és az összes többi felhasználóra. + + Az új eszközöknél a kezdeti időzóna-beállítás „US/Pacific”. + + Az érték formátuma megfelel az időzónák „IANA Time Zone Database” adatbázisban (lásd: „https://en.wikipedia.org/wiki/Tz_database”) található neveinek. A legtöbb időzónára lehetséges „földrész/nagyváros” vagy „óceán/nagyváros” formátumban hivatkozni. + + A házirend beállítása teljesen letiltja az eszköz helye szerinti automatikus időzóna-meghatározást, továbbá felülírja a SystemTimezoneAutomaticDetection házirendet is.</translation> <translation id="1897365952389968758">JavaScript futtatásának engedélyezése minden webhelyen</translation> <translation id="193259052151668190">A leválasztható USB-eszközök engedélyezőlistája</translation> <translation id="1933378685401357864">Háttérkép</translation> @@ -582,6 +603,24 @@ <translation id="3072847235228302527">Általános Szerződési Feltételek beállítása egy eszközszinten helyi fiók számára</translation> <translation id="3096595567015595053">Engedélyezett bővítmények listája</translation> <translation id="3101501961102569744">Válassza ki, hogyan adja meg a proxyszerver beállításait</translation> +<translation id="3125884964575432854">Lehetővé teszi, hogy Ön adja meg a <ph name="PRODUCT_NAME" /> és az ARC-alkalmazások által használt proxyszervert, és megakadályozza, hogy a felhasználók megváltoztassák a proxybeállításokat. + + Ha úgy dönt, hogy soha nem használ proxyszervert, és mindig közvetlenül kapcsolódik, az összes többi beállítás figyelmen kívül marad. + + Ha úgy dönt, hogy a rendszer proxybeállításait használja, az összes többi beállítás figyelmen kívül marad. + + Ha a proxyszerver automatikus észlelése mellett dönt, az összes többi beállítás figyelmen kívül marad. + + Ha a fix proxyszerver módot választja, további beállításokat adhat meg "A proxyszerver címe vagy URL-je" és a "Proxykihagyási szabályok vesszővel elválasztott listája" lehetőségeknél. Az ARC-alkalmazások csak a legmagasabb prioritású HTTP-proxyszervert használják. + + Ha .pac proxy szkriptet használ, meg kell adnia a szkript URL-jét "A proxy .pac fájl URL-je" lehetőségnél. + + Részletes példákért látogassa meg a következő címet: + <ph name="PROXY_HELP_URL" /> + + Ha engedélyezi ezt a házirendet, a <ph name="PRODUCT_NAME" /> és az ARC-alkalmazások figyelmen kívül hagynak a proxyval kapcsolatban a parancssorból megadott minden beállítást. + + Ha beállítatlanul hagyja ezt a házirendet, akkor a felhasználók saját maguk választhatják ki a proxybeállításaikat.</translation> <translation id="3153348162326497318">Lehetővé teszi annak meghatározását, hogy melyek azok a bővítmények, amelyeket NEM telepíthetnek a felhasználók. A már telepített, de a tiltólistán szereplő bővítményeket a rendszer eltávolítja. A tiltólista "*" értéke azt jelenti, hogy az összes bővítmény tiltólistás, kivéve, ha az adott bővítményt az engedélyezőlista tartalmazza. Ha ez a házirend beállítatlanul marad, a felhasználó bármilyen bővítményt telepíthet a(z) <ph name="PRODUCT_NAME" /> alkalmazásban.</translation> <translation id="316778957754360075">Ez a házirend többé nincs jelen a <ph name="PRODUCT_NAME" /> 29-es verziójától kezdve. A szervezet által tárolt bővítmény- és alkalmazásgyűjtemények beállításához azt javasoljuk, hogy a CRX-csomagokat tartalmazó webhelyet vegye fel az ExtensionInstallSources házirendbe, és helyezzen el a csomagokra mutató közvetlen letöltési linkeket egy weboldalon. A weboldalhoz az ExtensionInstallForcelist házirend használatával lehet indítót létrehozni.</translation> <translation id="3185009703220253572">a(z) <ph name="SINCE_VERSION" /> verzió óta</translation> @@ -650,6 +689,20 @@ Ha a házirend konfigurálatlanul marad, akkor a rendszer a globális alapértelmezett értéket használja a „DefaultKeygenSetting” házirendből (ha az be van állítva), egyéb esetben pedig a felhasználó saját személyes beállításából.</translation> <translation id="3381968327636295719">Alapértelmezés szerint használja a gazdagép böngészőjét</translation> +<translation id="3398137877608138703">Videórögzítés engedélyezése vagy tiltása. + + Ha a házirend engedélyezett, vagy ha nincs beállítva (alapértelmezett), a böngésző + – a VideoCaptureAllowedUrls listában beállított URL-ek kivételével, + amelyek kérdés nélkül megkapják – videórögzítési hozzáférést kér + a felhasználótól. Az ARC-alkalmazások akkor férhetnek hozzá a + kamerához, ha erre engedélyt kaptak. + + Ha a házirend le van tiltva, akkor a felhasználó soha nem kap kérdést, + és a videórögzítés csak a VideoCaptureAllowedUrls listában beállított URL-ek + számára hozzáférhető. Az ARC-alkalmazások nem férhetnek hozzá a kamerához. + + Ez a házirend az ARC-alkalmazásokon kívül minden videóbemenet-típust + befolyásol; nem csupán a beépített kamerát.</translation> <translation id="3417418267404583991">Ha a házirend beállítása igaz, vagy nincs megadva az értéke, akkor a(z) <ph name="PRODUCT_OS_NAME" /> engedélyezi a Vendég módban való bejelentkezéseket. A vendégbejelentkezések névtelen felhasználói munkamenetek, amelyek nem kérik jelszó magadását. Ha a házirend értéke hamis, akkor a(z) <ph name="PRODUCT_OS_NAME" /> nem engedélyezi a vendégmunkamenetek indítását.</translation> @@ -667,6 +720,8 @@ <translation id="3478024346823118645">Felhasználói adatok törlése a kijelentkezésnél</translation> <translation id="348495353354674884">Virtuális billentyűzet engedélyezése</translation> <translation id="3496296378755072552">Jelszókezelő</translation> +<translation id="349667858031092827">Soha ne történjen meg az időzóna automatikus érzékelése.</translation> +<translation id="350443680860256679">Az ARC házirend konfigurálása</translation> <translation id="3504791027627803580">Megadja a képkereséshez használt keresőmotor URL-címét. A keresési kérelmet a rendszer a GET metódus segítségével továbbítja. Ha a DefaultSearchProviderImageURLPostParams házirend be van állítva, akkor a képkeresési kérelmek a POST metódust használják. Ez egy opcionális házirend. Ha nincs beállítva, nem történik képkeresés. @@ -800,6 +855,22 @@ A „Cookie-k megtartása a munkamenet idejére” beállítás esetében a munkamenet befejezése után a cookie-k törlődnek. Felhívjuk figyelmét, hogy ha a <ph name="PRODUCT_NAME" /> „háttérmódban” fut, akkor előfordulhat, hogy a munkamenet nem fejeződik be az utolsó ablak bezárásakor. E viselkedés konfigurálásáról a „BackgroundModeEnabled” házirendnél talál további tájékoztatást. Ha nem állítja be ezt a házirendet, akkor a böngésző az „AllowCookies” beállítást fogja használni, amelyet a felhasználó módosíthat.</translation> +<translation id="4098957623809244159">Ez a házirend már megszűnt – használja helyette a ProxyMode házirendet. + + Lehetővé teszi a <ph name="PRODUCT_NAME" /> és az ARC-alkalmazások által használt proxyszerver meghatározását, és megakadályozza, hogy a felhasználók megváltoztassák a proxybeállításokat. + + Ha úgy dönt, hogy soha nem használ proxyszervert, és mindig közvetlenül kapcsolódik, az összes többi beállítás figyelmen kívül marad. + + Ha úgy dönt, hogy a rendszer proxybeállításait használja, vagy automatikusan észleli a proxyszervert, az összes többi beállítás figyelmen kívül marad. + + Ha a proxybeállítások manuális megadását választja, további beállításokat adhat meg a „Proxyszerver címe vagy URL-je” és „A proxykihagyási szabályok vesszővel elválasztott listája” lehetőségeknél. + + Részletes példákért látogassa meg a következő címet: + <ph name="PROXY_HELP_URL" /> + + Ha engedélyezi ezt a beállítást, a <ph name="PRODUCT_NAME" /> figyelmen kívül hagyja a proxyval kapcsolatban a parancssorból megadott összes beállítást. + + Ha beállítatlanul hagyja ezt a házirendet, akkor a felhasználók saját maguk választhatják ki a proxybeállításaikat.</translation> <translation id="4103289232974211388">A felhasználó megerősítését követően átirányítás a SAML IdP-hez</translation> <translation id="410478022164847452">Meghatározza azt a felhasználói bevitel nélkül eltelt időtartamot, amely után a rendszer tétlen állapotba kerül, ha hálózati áramról működik. @@ -1227,6 +1298,14 @@ <translation id="5893553533827140852">Ha ez a beállítás engedélyezett, akkor a gnubby hitelesítési kéréseket a rendszer távoli szerverkapcsolaton keresztül proxyzza. Ha a beállítás tiltva van, vagy nincs konfigurálva, akkor a rendszer nem proxyzza a gnubby hitelesítési kéréseket.</translation> +<translation id="5900959132054596599">A <ph name="PRODUCT_NAME" /> és az ARC-alkalmazások figyelmen kívül hagynak bármilyen proxyt a listán megadott gazdagépek esetében. + + Ez a házirend csak akkor lép érvénybe, ha a manuális proxybeállításokat választotta a "Válassza ki, hogyan adja meg a proxyszerver beállításait" résznél. + + Ha valamilyen más módját választotta a proxyházirendek beállításának, akkor hagyja ezt a házirendet konfigurálatlanul. + + További részletes példákért látogassa meg a következő oldalt: + <ph name="PROXY_HELP_URL" /></translation> <translation id="5921713479449475707">Automatikus frissítési letöltések engedélyezése HTTP-n keresztül</translation> <translation id="5921888683953999946">A nagy egérmutató kisegítő lehetőség alapértelmezett állapotának megadása a bejelentkezési képernyőn. @@ -1368,6 +1447,7 @@ <translation id="637934607141010488">Jelentés készítése a mostanában bejelentkezett eszközfelhasználókról. Ha az irányelv beállítása hamis, akkor a felhasználókról nem készül jelentés.</translation> +<translation id="639009029157091157">A felhasználók dönthetnek.</translation> <translation id="6392973646875039351">Engedélyezi a(z) <ph name="PRODUCT_NAME" /> automatikus kitöltés funkcióját, és lehetővé teszi a felhasználók számára az internetes űrlapok korábban tárolt adatokkal, például a címmel vagy a bankkártyaadatokkal történő automatikus kitöltését. Ha engedélyezi ezt a beállítást, vagy nem állítja be az értékét, az automatikus kitöltés funkció a felhasználó ellenőrzése alatt marad. Ez lehetővé teszi, hogy a felhasználók automatikus kitöltési profilokat állítsanak be, és saját belátásuk szerint kapcsolják ki- vagy be az automatikus kitöltést.</translation> <translation id="6394350458541421998">Ez a házirend többé nincs jelen a <ph name="PRODUCT_OS_NAME" /> 29-es verziójától kezdve. Kérjük, használja helyette a PresentationScreenDimDelayScale házirendet.</translation> <translation id="6401669939808766804">Felhasználó kijelentkeztetése</translation> @@ -1609,11 +1689,6 @@ Ha a „RestoreOnStartup” házirend úgy van beállítva, hogy helyreállítsa a korábbi munkamenetek URL-jeit, a rendszer nem tartja be ezt a házirendet, és az érintett webhelyek vonatkozásában állandó jelleggel tárolja a cookie-kat.</translation> <translation id="7207095846245296855">A Google Biztonságos Keresés kényszerítése</translation> -<translation id="7213425178181578730">Ha a házirend értéke hamis, a <ph name="PRODUCT_OS_NAME" /> kikapcsolja a Bluetooth funkciót, és a felhasználó nem tudja visszakapcsolni. - - Ha a házirend értéke igaz vagy nincs beállítva, a felhasználó tetszés szerint tudja be- vagy kikapcsolni a Bluetooth funkciót. - - Ha a házirend be van állítva, a felhasználó nem tudja módosítani vagy felülbírálni.</translation> <translation id="7216442368414164495">Lehetővé teszi a felhasználók számára a Biztonságos Böngészés bővített jelentéseinek elérését</translation> <translation id="7227967227357489766">Meghatározza azoknak a felhasználóknak a listáját, akik bejelentkezhetnek az eszközre. A bejegyzések formátuma <ph name="USER_WHITELIST_ENTRY_FORMAT" />, például <ph name="USER_WHITELIST_ENTRY_EXAMPLE" />. Ha egy domain kizárólagos felhasználóit szeretné engedélyezni, használja a következő formátumot: <ph name="USER_WHITELIST_ENTRY_WILDCARD" />. @@ -1714,6 +1789,9 @@ <translation id="7632724434767231364">GSSAPI könyvtár neve</translation> <translation id="7635471475589566552">Beállítja az alkalmazás nyelv- és országkódját a következőben: <ph name="PRODUCT_NAME" />, és megakadályozza, hogy a felhasználók megváltoztassák a kódot. Ha engedélyezi ezt a beállítást, a(z) <ph name="PRODUCT_NAME" /> a megadott nyelv- és országkódot fogja használni. Ha a megadott nyelv- és országkód nem támogatott, az "en-US" lehetőséget használja helyette. Ha ez a beállítás ki van kapcsolva, vagy nincs beállítva, a(z) <ph name="PRODUCT_NAME" /> vagy a felhasználó által meghatározott nyelv- és országkódot használja (ha konfigurálva van), vagy a tartalék "en-US" lehetőséget.</translation> <translation id="7651739109954974365">Meghatározza, hogy engedélyezett legyen-e az adatbarangolás az eszköz esetében. Ha a beállítás igaz, akkor az adatbarangolás engedélyezett. Ha nincs beállítva, vagy a beállítás hamis, akkor az adatbarangolás nem érhető el.</translation> +<translation id="7667184304362487902">Konfigurálja a <ph name="PRODUCT_NAME" /> és az ARC-alkalmazások proxybeállításait. + + Ez a házirend még nem áll készen a használatra, úgyhogy kérjük, ne használja.</translation> <translation id="76810863974142048">Az az URL, ahonnan a távoli elérésű ügyfelek beszerezhetik a hitelesítőtokent. Ha be van állítva ez a házirend, a távoli elérésű gazdagép a csatlakozáshoz megköveteli a hitelesítő-ügyfelektől a hitelesítőtoken lehívását erről az URL-ről. A RemoteAccessHostTokenValidationUrl szabállyal együtt kell használni. @@ -1782,6 +1860,19 @@ <translation id="7842869978353666042">A Google Drive beállításainak konfigurálása</translation> <translation id="7843525027689416831">Azokat a jelölőket adja meg, amelyeket a(z) <ph name="PRODUCT_NAME" />-ra kell alkalmazni az elindításakor. A megadott jelölők alkalmazása csak a bejelentkezési képernyőn történik. A jelen irányelven keresztül megadott jelölők nem terjednek ki a felhasználói munkamenetekre.</translation> <translation id="7848840259379156480">Lehetővé teszi, hogy beállítsa az alapértelmezett HTML-megjelenítőt, ha a <ph name="PRODUCT_FRAME_NAME" /> telepítve van. Az alapértelmezett beállítás az, hogy a gazdagép böngészője végzi a megjelenítést, de opcionálisan ezt felülbírálhatja, és megjelenítheti a HTML oldalakat alapértelmezés szerint a <ph name="PRODUCT_FRAME_NAME" /> segítségével.</translation> +<translation id="7853178359124471330">Ha be van állítva ez a házirend, akkor az automatikus időzóna-érzékelési folyamat az alábbi módok valamelyikén történik a beállítás értékétől függően: + + A TimezoneAutomaticDetectionUsersDecide beállítás esetén a felhasználók normál módon állíthatják be az automatikus időzóna-érzékelést a chrome://settings oldalon. + + A TimezoneAutomaticDetectionDisabled beállítás esetén le vannak tiltva az automatikus időzóna-érzékelésre vonatkozó beállítások a chrome://settings oldalon. Ebben az esetben soha nem történik meg az időzóna automatikus érzékelése. + + A TimezoneAutomaticDetectionIPOnly beállítás esetén le vannak tiltva az időzóna-beállítások a chrome://settings oldalon. Ebben az esetben mindig megtörténik az időzóna automatikus érzékelése. Az időzóna-érzékelés csak IP-címen alapul módszert használ a hely meghatározásához. + + A TimezoneAutomaticDetectionSendWiFiAccessPoints beállítás esetén le vannak tiltva az időzóna-beállítások a chrome://settings oldalon. Ebben az esetben mindig megtörténik az időzóna automatikus érzékelése. A rendszer minden esetben elküldi a látható Wi-Fi hozzáférési pontok listáját a Geolocation API szerver felé a pontos időzóna-érzékelés érdekében. + + Ha nincs beállítva ez a házirend, akkor úgy viselkedik, mintha a TimezoneAutomaticDetectionUsersDecide házirend lenne beállítva. + + Ha be van állítva a SystemTimezone házirend, akkor felülbírálja ezt a házirendet. Ebben az esetben teljes mértékben le van tiltva az automatikus időzóna-érzékelés.</translation> <translation id="7882585827992171421">Ez a házirend csak kiállító módban aktív. Meghatározza a bejelentkezési képernyőn képernyőkímélőként használni kívánt bővítmény azonosítóját. A bővítménynek abban az alkalmazáscsomagban kell lennie, amely meg van határozva ennél a domainnél az DeviceAppPack házirend használatával.</translation> @@ -1819,6 +1910,7 @@ Ha a házirend nincs beállítva, akkor a beállítás engedélyezett lesz.</translation> <translation id="8073243368829195">A Smart Lock használatának engedélyezése</translation> +<translation id="8074052133552427532">Mindig használja a durva időzóna-érzékelést.</translation> <translation id="8099880303030573137">Tétlenség késleltetése akkumulátorról való működés során</translation> <translation id="8102913158860568230">Alapértelmezett adatfolyam beállítás</translation> <translation id="8104962233214241919">Ügyféltanúsítványok automatikus kiválasztása ezeknél a webhelyeknél</translation> @@ -1925,6 +2017,7 @@ <translation id="8424255554404582727">Képernyő alapértelmezett elforgatásának beállítása, minden újraindításkor ismételten alkalmazva</translation> <translation id="8426231401662877819">Képernyő elforgatása 90 fokkal</translation> <translation id="8451988835943702790"> való használata</translation> +<translation id="8458790683633857482">Meghatározza azoknak a házirendeknek a készletét, amelyet a rendszer át fog adni az ARC futási idő számára. Az értéknek érvényes JSON-értéknek kell lennie.</translation> <translation id="8465065632133292531">Paraméterek POST metódust használó azonnali URL-hez</translation> <translation id="847472800012384958">Előugró ablakok tiltása minden webhely esetén</translation> <translation id="8477885780684655676">TLS 1.0</translation> @@ -2046,9 +2139,12 @@ Ha a házirend értéke hamis, akkor sem a felhasználó, sem az alkalmazások és a bővítmények nem használhatják a teljes képernyős módot. A <ph name="PRODUCT_OS_NAME" /> kivételével az összes operációs rendszerre igaz, hogy a kioszk mód nem érhető el, ha a teljes képernyős mód le van tiltva.</translation> +<translation id="8795495354632096254">Mindig elküldi a Wi-Fi hozzáférési pontokat a szervernek az időzóna meghatározása során.</translation> <translation id="8818173863808665831">Az eszköz földrajzi helyének jelentése. Ha nincs beállítva, vagy ha hamis értékre van állítva ez a házirend, akkor a hely nem lesz jelentve.</translation> +<translation id="8818768076343557335">A hálózati műveletek előrejelzése bármely nem mobilos hálózaton. + (Megszüntetve az 50-es, eltávolítva az 52-es verzióban. Az 52-es verzió után az 1 értéket 0-ként kezeli a rendszer – hálózati műveletek előrejelzése minden hálózati kapcsolat esetén.)</translation> <translation id="8828766846428537606">Állítsa be a <ph name="PRODUCT_NAME" /> alapértelmezett kezdőoldalát, és akadályozza meg, hogy a felhasználók megváltoztassák azt. A felhasználó kezdőoldala csak akkor lesz teljesen lezárva, ha a kezdőoldalt választja az új lap oldalnak, vagy URL-ként beállítja, és megad egy kezdőoldal URL-t. Ha nem ad meg kezdőoldal URL-t, akkor a felhasználó továbbra is be tudja állítani kezdőoldalnak az új lap oldalt a "chrome://newtab" meghatározásával.</translation> <translation id="8833109046074170275">Hitelesítés az alapértelmezett GAIA-folyamaton keresztül</translation> <translation id="8838303810937202360">A <ph name="PRODUCT_OS_NAME" /> gyorsítótárba helyezi az egy eszközön több felhasználó által is telepíthető alkalmazásokat és bővítményeket, elkerülve azok ismételt letöltését az egyes felhasználóknál. @@ -2108,6 +2204,7 @@ <translation id="9042911395677044526">Lehetővé teszi a hálózati konfiguráció push módszerrel történő alkalmazását <ph name="PRODUCT_OS_NAME" /> eszközre. A hálózati konfiguráció a JSON formátumú karakterlánc által meghatározott Open Network Configuration formában leírt karakterlánc, amely a következő helyen van meghatározva: <ph name="ONC_SPEC_URL" /></translation> <translation id="9084985621503260744">Megadja, hogy a videotevékenység hatással van-e az energiagazdálkodásra</translation> <translation id="9088433379343318874">Felügyelt felhasználó tartalomszolgáltatójának engedélyezése</translation> +<translation id="9088444059179765143">Az automatikus időzóna-érzékelés módszerének konfigurálása</translation> <translation id="9096086085182305205">Azonosítási szerverek engedélyezési listája</translation> <translation id="9098553063150791878">HTTP-hitelesítési szabályok</translation> <translation id="9104138886225968319">Ellenőrző szívverések küldése a kezelőszervernek,
diff --git a/components/policy/resources/policy_templates_id.xtb b/components/policy/resources/policy_templates_id.xtb index cd7e7be..b7fe9c5 100644 --- a/components/policy/resources/policy_templates_id.xtb +++ b/components/policy/resources/policy_templates_id.xtb
@@ -686,13 +686,13 @@ Nilai kebijakan harus ditentukan dalam milidetik. Nilai ditetapkan dengan rentang antara 30 detik hingga 24 jam.</translation> <translation id="3528000905991875314">Mengaktifkan laman kesalahan alternatif</translation> -<translation id="3538538104630456270">Setelan yang dikaitkan telah digunakan sebelum autentikasi ulang lihat sandi diperkenalkan. Oleh karena itu, setelan dan kebijakan ini tidak berpengaruh pada perilaku Chrome. Perilaku Chrome saat ini sama dengan jika kebijakan ini disetel untuk menonaktifkan menampilkan sandi dalam teks yang jelas di laman setelan pengelola sandi. Artinya, laman setelan tersebut hanya berisi placeholder, dan Chrome hanya akan menampilkan sandi saat pengguna mengeklik "Tampilkan" (dan autentikasi ulang, jika berlaku). Deskripsi asli kebijakan ini tercantum di bawah. +<translation id="3538538104630456270">Setelan terkait telah digunakan sebelum proses autentikasi ulang lihat sandi diperkenalkan. Oleh karena itu, setelan dan kebijakan ini tidak berpengaruh pada perilaku Chrome. Perilaku Chrome saat ini sama seperti ketika kebijakan ini disetel untuk berhenti menampilkan teks sandi di laman setelan pengelola sandi. Artinya, laman setelan tersebut hanya berisi placeholder, dan Chrome hanya akan menampilkan sandi saat pengguna mengeklik "Tampilkan" (dan mengautentikasi ulang, jika berlaku). Deskripsi awal untuk kebijakan ini tercantum di bawah. Mengontrol apakah pengguna dapat menampilkan sandi dalam teks yang jelas di pengelola sandi atau tidak. - Jika Anda menonaktifkan setelan ini, pengelola sandi tidak mengizinkan penampilan sandi tersimpan dalam teks yang jelas di jendela pengelola sandi. + Jika Anda menonaktifkan setelan ini, pengelola sandi tidak mengizinkan sandi untuk ditampilkan dalam teks yang jelas di jendela pengelola sandi. - Jika Anda mengaktifkan atau tidak menyetel kebijakan ini, pengguna dapat melihat sandinya dalam teks yang jelas di pengelola sandi.</translation> + Jika Anda mengaktifkan atau tidak menyetel kebijakan ini, pengguna dapat melihat sandi dalam teks yang jelas di pengelola sandi.</translation> <translation id="3547954654003013442">Setelan proxy</translation> <translation id="3570008976476035109">Mencekal plugin di situs ini</translation> <translation id="3591584750136265240">Mengonfigurasi perilaku autentikasi proses masuk</translation> @@ -1612,11 +1612,6 @@ Jika kebijakan "RestoreOnStartup" disetel untuk memulihkan URL dari sesi sebelumnya, kebijakan ini akan diabaikan dan cookie akan disimpan secara permanen untuk situs tersebut.</translation> <translation id="7207095846245296855">Paksa Google TelusurAman</translation> -<translation id="7213425178181578730">Jika kebijakan ini disetel ke false, <ph name="PRODUCT_OS_NAME" /> akan menonaktifkan Bluetooth dan pengguna tidak dapat mengaktifkannya kembali. - - Jika kebijakan ini disetel ke true atau tidak disetel, pengguna dapat mengaktifkan atau menonaktifkan Bluetooth sesuai keinginan. - - Jika kebijakan ini disetel, pengguna tidak dapat mengubah atau menggantinya.</translation> <translation id="7216442368414164495">Memungkinkan pengguna ikut serta dalam pelaporan yang diperluas Penjelajahan Aman</translation> <translation id="7227967227357489766">Menetapkan daftar pengguna yang diizinkan masuk ke perangkat. Entrinya berformat <ph name="USER_WHITELIST_ENTRY_FORMAT" />, misalnya <ph name="USER_WHITELIST_ENTRY_EXAMPLE" />. Untuk mengizinkan sembarang pengguna di domain, gunakan entri format <ph name="USER_WHITELIST_ENTRY_WILDCARD" />.
diff --git a/components/policy/resources/policy_templates_it.xtb b/components/policy/resources/policy_templates_it.xtb index b69d8d1..b902ef75 100644 --- a/components/policy/resources/policy_templates_it.xtb +++ b/components/policy/resources/policy_templates_it.xtb
@@ -1572,11 +1572,6 @@ Se la norma "RestoreOnStartup" viene impostata in modo da ripristinare gli URL delle sessioni precedenti, questa norma non verrà rispettata e i cookie verranno memorizzati in modo permanente per i siti.</translation> <translation id="7207095846245296855">Forza il filtro SafeSearch di Google</translation> -<translation id="7213425178181578730">Se questa norma è impostata su false, <ph name="PRODUCT_OS_NAME" /> disattiva il Bluetooth e l'utente non può riattivarlo. - - Se questa norma è impostata su true o non viene affatto impostata, l'utente potrà attivare o disattivare il Bluetooth a seconda delle sue preferenze. - - Se questa norma è impostata, l'utente non può modificarla né eseguirne l'override.</translation> <translation id="7216442368414164495">Consenti agli utenti di attivare i rapporti estesi di Navigazione sicura</translation> <translation id="7227967227357489766">Consente di definire l'elenco di utenti che possono eseguire l'accesso sul dispositivo. Le voci sono nel formato <ph name="USER_WHITELIST_ENTRY_FORMAT" />, ad esempio <ph name="USER_WHITELIST_ENTRY_EXAMPLE" />. Per consentire utenti arbitrari su un dominio, le voci devono essere nel formato <ph name="USER_WHITELIST_ENTRY_WILDCARD" />.
diff --git a/components/policy/resources/policy_templates_iw.xtb b/components/policy/resources/policy_templates_iw.xtb index 89e96a3..8cb97aa 100644 --- a/components/policy/resources/policy_templates_iw.xtb +++ b/components/policy/resources/policy_templates_iw.xtb
@@ -144,6 +144,18 @@ <translation id="1561424797596341174">שינויי מדיניות עבור גרסאות Build של ניפוי באגים של מארח הגישה מרחוק</translation> <translation id="1583248206450240930">השתמש ב-<ph name="PRODUCT_FRAME_NAME" /> כברירת מחדל</translation> <translation id="1608755754295374538">כתובות אתרים שיקבלו גישה למכשירי הקלטת אודיו ללא הצגת בקשה</translation> +<translation id="1613574633990410986">מאפשרת לך לציין את שרת ה-proxy שבו משתמש <ph name="PRODUCT_NAME" /> ויישומי ARC ומונעת ממשתמשים לשנות את הגדרות שרת ה-proxy. + + אם תבחר לעולם לא להשתמש בשרת proxy ותמיד להתחבר ישירות, כל האפשרויות האחרות אינן מובאות בחשבון. + + אם תבחר לזהות באופן אוטומטי את שרת ה-proxy, כל האפשרויות האחרות אינן מובאות בחשבון. + + תוכל למצוא דוגמאות מפורטות בכתובת הבאה: + <ph name="PROXY_HELP_URL" /> + + אם תפעיל את ההגדרה הזו, <ph name="PRODUCT_NAME" /> ויישומי ARC יתעלמו מכל האפשרויות הקשורות לשרת proxy שצוינו מפקודת השורה. + + אם לא תגדיר את אפשרויות המדיניות האלה, משתמשים יוכלו לבחור את הגדרות שרת ה-proxy בעצמם.</translation> <translation id="1617235075406854669">הפעל את מחיקת היסטוריית הדפדפן וההורדות</translation> <translation id="1617384279878333801">הפעלת הוספת אדם במנהל הפרופיל</translation> <translation id="1655229863189977773">הגדר גודל קובץ שמור של דיסק בבייטיים</translation> @@ -208,6 +220,15 @@ <translation id="1865417998205858223">הרשאות עיקריות</translation> <translation id="186719019195685253">הפעולה שיש לנקוט כאשר יש עיכוב ללא פעילות בעת שימוש במתח AC</translation> <translation id="187819629719252111">המדיניות מאפשרת גישה לקבצים מקומיים במחשב בכך שהיא מאפשרת ל-<ph name="PRODUCT_NAME" /> להציג תיבות דו-שיח לבחירת קבצים. אם תהפוך הגדרה זו לפעילה, המשתמשים יוכלו לפתוח תיבות דו-שיח לבחירת קבצים כרגיל. אם תשבית הגדרה זו, בכל פעם שהמשתמש יבצע פעולה שתפעיל תיבת דו-שיח לבחירת קבצים (כגון ייבוא סימניות, העלאת קבצים, שמירת קישורים וכדומה), תוצג במקום זאת הודעה והמערכת תניח שהמשתמש לחץ על 'ביטול' בתיבת הדו-שיח של בחירת הקבצים. אם הגדרה זו לא נקבעה, המשתמשים יוכלו לפתוח תיבות דו-שיח לבחירת קבצים כרגיל.</translation> +<translation id="1879485426724769439">מציינת את אזור הזמן שבו ייעשה שימוש במכשיר. משתמשים יכולים לעקוף את אזור הזמן שצוין בהפעלה הנוכחית. עם זאת, לאחר ההתנתקות אזור הזמן חוזר לערך שצוין. אם צוין ערך לא חוקי, המדיניות עדיין מופעלת, אך באמצעות "GMT". אם צוינה מחרוזת ריקה, המדיניות אינה מובאת בחשבון. + + אם לא נעשה שימוש במדיניות הזו, ימשיך להיעשות שימוש באזור הזמן הפעיל הנוכחי, אך משתמשים יוכלו לשנות את אזור הזמן והשינוי יישמר. כך שינוי על-ידי משתמש אחד ישפיע על מסך ההתחברות ועל כל המשתמשים האחרים. + + במכשירים חדשים ההגדרה הראשונית של אזור הזמן היא "US/Pacific". + + פורמט הערך מבוסס על השמות של אזורי הזמן ב-"IANA Time Zone Database" (עיין בכתובת "https://en.wikipedia.org/wiki/Tz_database"). באופן ספציפי, רוב אזורי הזמן יכולים להיכתב בפורמט "continent/large_city" או "ocean/large_city". + + הגדרת המדיניות הזו משביתה לחלוטין את זיהוי אזור הזמן לפי מיקום המכשיר. היא גם עוקפת את המדיניות SystemTimezoneAutomaticDetection.</translation> <translation id="1897365952389968758">אפשר לכל האתרים להריץ JavaScript</translation> <translation id="193259052151668190">רשימת היתרים של מכשירי USB ניתנים לניתוק</translation> <translation id="1933378685401357864">תמונת טפט</translation> @@ -216,7 +237,7 @@ אם אפשרות זו מופעלת, לחצן התנתקות אדום גדול מוצג במגש המערכת בזמן פעילות והמסך אינו נעול. אם אפשרות זו מושבתת או לא מוגדרת, לא יוצג לחצן התנתקות אדום גדול במגש המערכת.</translation> -<translation id="1942957375738056236">כאן תוכל לציין את כתובת האתר של שרת ה-Proxy. מדיניות זו מופעלת רק אם בחרת הגדרות Proxy ידניות ב'בחר כיצד לציין את הגדרות שרת ה-Proxy'. עליך להימנע מהגדרת המדיניות אם בחרת אחד מהמצבים האחרים להגדרת מדיניות Proxy. לקבלת אפשרויות נוספות ודוגמאות מפורטות, בקר בכתובת: <ph name="PROXY_HELP_URL" /></translation> +<translation id="1942957375738056236">כאן תוכל לציין את כתובת האתר של שרת ה-Proxy. מדיניות זו מופעלת רק אם בחרת הגדרות Proxy ידניות ב'בחר כיצד לציין את הגדרות שרת ה-Proxy'. עליך להימנע מהגדרת המדיניות אם בחרת אחד מהמצבים האחרים להגדרת מדיניות Proxy. לקבלת אפשרויות נוספות ודוגמאות מפורטות, היכנס לכתובת: <ph name="PROXY_HELP_URL" /></translation> <translation id="1956493342242507974">הגדר ניהול צריכת חשמל במסך ההתחברות ב-<ph name="PRODUCT_OS_NAME" />. המדיניות הזו מאפשרת לך להגדיר את ההתנהגות של <ph name="PRODUCT_OS_NAME" /> במצב שבו אין פעילות של המשתמש למשך זמן מסוים, כאשר מסך ההתחברות מוצג. המדיניות קובעת מספר הגדרות. לעיון בפרטים ובטווחי ערכים, קרא את המדיניות המתאימה המגדירה את ניהול צריכת החשמל במהלך הפעלה. החריגים היחידים מהמדיניות הזו הם: @@ -579,6 +600,24 @@ <translation id="3072847235228302527">הגדר את התנאים וההגבלות עבור חשבון מקומי של מכשיר</translation> <translation id="3096595567015595053">רשימת יישומי פלאגין מופעלים</translation> <translation id="3101501961102569744">בחר כיצד לציין הגדרות שרת Proxy</translation> +<translation id="3125884964575432854">מאפשרת לך לציין את שרת ה-proxy שבו משתמש <ph name="PRODUCT_NAME" /> ויישומי ARC ומונעת ממשתמשים לשנות את הגדרות שרת ה-proxy. + + אם תבחר לעולם לא להשתמש בשרת proxy ותמיד להתחבר ישירות, כל האפשרויות האחרות אינן מובאות בחשבון. + + אם תבחר להשתמש בהגדרות שרת ה-proxy של המערכת, כל האפשרויות האחרות אינן מובאות בחשבון. + + אם תבחר לזהות באופן אוטומטי את שרת ה-proxy, כל האפשרויות האחרות אינן מובאות בחשבון. + + אם תבחר במצב של שרת proxy קבוע, תוכל לציין אפשרויות נוספות ב'כתובת או כתובת אתר של שרת proxy' וב'רשימה מופרדת בפסיקים של כללי מעקף של שרת proxy'. יישומי ARC ישתמשו רק בשרת ה-proxy ל-HTTP שקיבל את העדיפות הגבוהה ביותר. + + אם תבחר להשתמש בסקריפט .pac לשרת proxy, עליך לציין את כתובת האתר בסקריפט ב'כתובת אתר לקובץ .pac של שרת proxy'. + + תוכל למצוא דוגמאות מפורטות בכתובת הבאה: + <ph name="PROXY_HELP_URL" /> + + אם תפעיל את ההגדרה הזו, <ph name="PRODUCT_NAME" /> ויישומי ARC יתעלמו מכל האפשרויות הקשורות לשרת proxy שצוינו משורת הפקודה. + + אם לא תגדיר את המדיניות הזו, משתמשים יוכלו לבחור את הגדרות שרת ה-proxy בעצמם.</translation> <translation id="3153348162326497318">מאפשר לך לציין אילו תוספים המשתמשים לא יכולים להתקין. תוספים מותקנים שנוספו לרשימה השחורה יוסרו. הערך (*) ברשימה השחורה פירושו שכל התוספים יתווספו לרשימה השחורה אלא אם כן הם רשומים בבירור ברשימה הלבנה. אם מדיניות זו לא הוגדרה המשתמש יכול להתקין כל תוסף שירצה ב-<ph name="PRODUCT_NAME" />.</translation> <translation id="316778957754360075">מדיניות זו הופסקה החל מגרסה 29 של <ph name="PRODUCT_NAME" />. הדרך המומלצת להגדרת אוספים של תוספים/יישומים המתארחים בארגון היא לכלול את האתר המארח את חבילות ה-CRX ב-ExtensionInstallSources ולהציב קישורים להורדה ישירה של החבילות בדף אינטרנט. ניתן ליצור מפעיל עבור דף אינטרנט זה באמצעות המדיניות ExtensionInstallForcelist.</translation> <translation id="3185009703220253572">מאז גרסה <ph name="SINCE_VERSION" /></translation> @@ -647,6 +686,17 @@ אם מדיניות זו לא הוגדרה, המערכת תשתמש בערך ברירת המחדל הכללי עבור כל האתרים לפי המדיניות 'DefaultKeygenSetting' במקרה שהוגדרה, או לפי התצורה האישית שקבע המשתמש במקרה שלא הוגדרה.</translation> <translation id="3381968327636295719">השתמש בדפדפן המארח כברירת מחדל</translation> +<translation id="3398137877608138703">התר או דחה צילום וידאו. + + אם המדיניות הזו מופעלת או אינה מוגדרת (ברירת המחדל), המשתמש יתבקש להעניק גישה לצילום וידאו, מלבד בכתובות אתרים שהוגדרו ברשימה + VideoCaptureAllowedUrls. כתובות אתר אלה יקבלו אישור ללא הצגת בקשה. יישומי ARC + יוכלו לגשת למצלמה אם ניתנה להם רשות. + + כשהמדיניות הזו מושבתת, המשתמש לעולם לא יתבקש להעניק רשות, וצילום וידאו יתאפשר רק לכתובות אתרים שהוגדרו ב-VideoCaptureAllowedUrls. + יישומי ARC לא יוכלו לגשת למצלמה. + + מלבד יישומי ARC, המדיניות הזו משפיעה על כל סוגי קלט הווידאו, ולא רק על המצלמה + המובנית.</translation> <translation id="3417418267404583991">אם מדיניות זו מוגדרת כ'אמת' או אינה מוגדרת, <ph name="PRODUCT_OS_NAME" /> יאפשר כניסות אורח. כניסות אורח הן הפעלות משתמש אנונימיות ואינן דורשות סיסמה. אם מדיניות זו מוגדרת כ'שקר', <ph name="PRODUCT_OS_NAME" /> לא יאפשר התחלת הפעלות אורח.</translation> @@ -664,6 +714,8 @@ <translation id="3478024346823118645">מחק נתוני משתמש בעת יציאה</translation> <translation id="348495353354674884">הפעל מקלדת וירטואלית</translation> <translation id="3496296378755072552">מנהל הסיסמאות</translation> +<translation id="349667858031092827">לעולם אל תזהה אזור זמן באופן אוטומטי.</translation> +<translation id="350443680860256679">הגדר ARC</translation> <translation id="3504791027627803580">מדיניות זו מציינת את כתובת האתר של מנוע החיפוש שנעשה בו שימוש לביצוע חיפוש תמונות. בקשות החיפוש יישלחו באמצעות שיטת GET. אם מוגדרת המדיניות DefaultSearchProviderImageURLPostParams, בקשות לחיפוש תמונות יישלחו במקום זאת באמצעות שיטת POST. מדיניות זו היא אופציונלית. אם היא אינה מוגדרת, לא ייעשה שימוש בחיפוש תמונות. @@ -680,7 +732,7 @@ יש לציין את ערך המדיניות באלפיות השנייה. הערכים מוגבלים לטווח של 30 שניות עד 24 שעות.</translation> <translation id="3528000905991875314">הפעל דפי שגיאה חלופיים</translation> -<translation id="3538538104630456270">ההגדרה המשויכת קדמה לשימוש באימות מחדש בעת הצגת סיסמאות. מאז השינוי אין להגדרה הזו השפעה על ההתנהגות של Chrome, ולכן גם למדיניות הזו אין עליה השפעה. ההתנהגות הנוכחית של Chrome זהה להתנהגות במצב שבו המדיניות הזו מושבתת, והסיסמאות מוצגות כטקסט גלוי בדף ההגדרות של מנהל הסיסמאות. המשמעות היא שדף ההגדרות מציג רק placeholder, ורק לאחר שהמשתמש לוחץ על 'הצג' (ומאמת מחדש את זהותו, במקרה הצורך) Chrome מציג את הסיסמה. להלן התיאור המקורי של המדיניות. +<translation id="3538538104630456270">ההגדרה המשויכת קדמה לשימוש באימות מחדש להצגת סיסמאות. מאז השינוי אין להגדרה הזו השפעה על ההתנהגות של Chrome, ולכן גם למדיניות הזו אין עליה השפעה. ההתנהגות הנוכחית של Chrome זהה להתנהגות במצב שבו המדיניות הזו מושבתת, והסיסמאות מוצגות כטקסט גלוי בדף ההגדרות של מנהל הסיסמאות. המשמעות היא שדף ההגדרות מציג רק Placeholder, ורק לאחר שהמשתמש לוחץ על 'הצג' (ומאמת מחדש את זהותו, במקרה הצורך) Chrome מציג את הסיסמה. הנה התיאור המקורי של המדיניות. קובעת האם המשתמש רשאי להציג סיסמאות בטקסט גלוי במנהל הסיסמאות. @@ -797,6 +849,22 @@ אם מדיניות זו תוגדר לאפשרות 'שמור את קובצי ה-Cookie למשך כל ההפעלה', קובצי ה-Cookie יימחקו כשההפעלה תסתיים. שים לב שאם <ph name="PRODUCT_NAME" /> פועל ב'מצב רקע', ייתכן שההפעלה לא תסתיים כשהחלון האחרון ייסגר. עיין במדיניות BackgroundModeEnabled למידע נוסף על הגדרת התנהגות זו. אם מדיניות זו לא תוגדר, המדיניות AllowCookies תהיה בשימוש והמשתמש יוכל לשנות אותה.</translation> +<translation id="4098957623809244159">המדיניות הזו יצאה משימוש. השתמש במקומה ב-ProxyMode. + + מאפשרת לך להגדיר את שרת ה-proxy שבו נעשה שימוש על-ידי <ph name="PRODUCT_NAME" /> ויישומי ARC ומונעת ממשתמשים לשנות את הגדרות שרת ה-proxy. + + אם תבחר לעולם לא להשתמש בשרת proxy ותמיד להתחבר ישירות, כל האפשרויות האחרות אינן מובאות בחשבון. + + אם תבחר להשתמש בהגדרות שרת ה-proxy של המערכת או לזהות באופן אוטומטי את שרת ה-proxy, כל האפשרויות האחרות אינן מובאות בחשבון. + + אם תבחר בהגדרות ידניות של שרת proxy, תוכל לציין אפשרויות נוספות ב'כתובת או כתובת אתר של שרת proxy', ב'כתובת אתר לקובץ .pac של שרת proxy' וב'רשימה מופרדת בפסיקים של כללי מעקף של שרת proxy'. + + תוכל למצוא דוגמאות מפורטות בכתובת: + <ph name="PROXY_HELP_URL" /> + + אם תפעיל את ההגדרה הזו, <ph name="PRODUCT_NAME" /> יתעלם מכל האפשרויות הקשורות לשרת proxy שצוינו משורת הפקודה. + + אם לא תגדיר את המדיניות הזו, משתמשים יוכלו לבחור את הגדרות שרת ה-proxy בעצמם.</translation> <translation id="4103289232974211388">הפנייה מחדש אל SAML IdP לאחר אישור המשתמש</translation> <translation id="410478022164847452">מציינת את משך הזמן ללא קלט משתמש שלאחריו מבוצעת הפעולה המוגדרת למצב לא פעיל בזמן שימוש בשקע חשמל. @@ -1217,6 +1285,14 @@ <translation id="5893553533827140852">אם ההגדרה הזו פועלת, בקשות אימות של Gnubby יועברו דרך שרת proxy בחיבור מארח מרוחק. אם ההגדרה הזו מושבתת או אינה מוגדרת, בקשות אימות של Gnubby לא יועברו דרך שרת proxy.</translation> +<translation id="5900959132054596599"><ph name="PRODUCT_NAME" /> ויישומי ARC יעקפו כל שרת proxy לרשימת המארחים המסופקת כאן. + + במדיניות זו נעשה שימוש רק אם בחרת הגדרות proxy ידניות באפשרות 'בחר כיצד לציין את הגדרות שרת ה-proxy'. + + אין להגדיר מדיניות זו אם בחרת במצב אחר להגדרת אפשרויות מדיניות של שרת proxy. + + תוכל למצוא דוגמאות מפורטות נוספות בכתובת: + <ph name="PROXY_HELP_URL" /></translation> <translation id="5921713479449475707">אפשר הורדות של עדכונים אוטומטיים דרך HTTP</translation> <translation id="5921888683953999946">הגדר את מצב ברירת המחדל של תכונת הנגישות של הסמן הגדול במסך ההתחברות. @@ -1349,6 +1425,7 @@ <translation id="637934607141010488">העבר דיווח של רשימת משתמשים במכשיר שהתחברו לאחרונה. אם המדיניות מוגדרת כ-False, לא יתבצע דיווח של המשתמשים.</translation> +<translation id="639009029157091157">המשתמשים האחרונים מחליטים.</translation> <translation id="6392973646875039351">המדיניות הופכת את תכונת המילוי האוטומטי של <ph name="PRODUCT_NAME" /> לפעילה ומאפשרת למשתמשים להשלים אוטומטית טפסים באינטרנט באמצעות מידע שאוחסן בעבר, כגון כתובת או פרטי כרטיס אשראי. אם תשבית הגדרה זו, המילוי האוטומטי לא יהיה נגיש למשתמשים. אם תהפוך הגדרה זו לפעילה או לא תקבע ערך, המילוי האוטומטי יישאר תחת שליטתו של המשתמש. דבר זה יאפשר לו להגדיר פרופילי מילוי אוטומטי ולהפעיל או לבטל מילוי אוטומטי על פי שיקול דעתו.</translation> <translation id="6394350458541421998">מדיניות זו הופסקה החל מגרסה 29 של <ph name="PRODUCT_OS_NAME" />. השתמש במדיניות PresentationScreenDimDelayScale במקום זאת.</translation> <translation id="6401669939808766804">הוצא את המשתמש מהמערכת</translation> @@ -1587,11 +1664,6 @@ אם המדיניות "RestoreOnStartup" מוגדרת לשחזר כתובות אתרים מהפעלות קודמות, מדיניות זו לא תכובד, וקובצי Cookie יאוחסנו באתרים אלה לצמיתות.</translation> <translation id="7207095846245296855">אלץ חיפוש בטוח של Google</translation> -<translation id="7213425178181578730">אם המדיניות הזו מוגדרת כ-false, <ph name="PRODUCT_OS_NAME" /> ישבית את ה-Bluetooth והמשתמש לא יוכל להפעיל אותו שוב. - - אם המדיניות הזו מוגדרת כ-true או אינה מוגדרת, המשתמש יוכל להפעיל או להשבית את ה-Bluetooth כרצונו. - - אם המדיניות הזו מוגדרת, המשתמש אינו יכול לשנות אותה או לעקוף אותה.</translation> <translation id="7216442368414164495">מאפשר למשתמשים להביע הסכמה לדיווח מורחב של 'גלישה בטוחה'</translation> <translation id="7227967227357489766">מגדיר את רשימת המשתמשים המורשים להתחבר למכשיר. הרשומות הן בתבנית <ph name="USER_WHITELIST_ENTRY_FORMAT" />, כגון <ph name="USER_WHITELIST_ENTRY_EXAMPLE" />. כדי לאפשר כניסת משתמשים שרירותיים לדומיין השתמש ברשומות מהצורה <ph name="USER_WHITELIST_ENTRY_WILDCARD" />. @@ -1692,6 +1764,9 @@ <translation id="7632724434767231364">שם ספריית GSSAPI</translation> <translation id="7635471475589566552">המדיניות מגדירה את אזור היישום ב-<ph name="PRODUCT_NAME" /> ומונעת מהמשתמשים לשנות זאת. אם תהפוך הגדרה זו לפעילה, <ph name="PRODUCT_NAME" /> ישתמש באזור שצוין. אם האזור המוגדר אינו נתמך, המערכת תשתמש ב-'en-US' במקום זאת. אם הגדרה זו מושבתת או לא מוגדרת, <ph name="PRODUCT_NAME" /> משתמש באזור המועדף שציין המשתמש (אם הוגדר), באזור המערכת או באזור הגיבוי 'en-US'.</translation> <translation id="7651739109954974365">קובעת אם נתוני הנדידה יופעלו עבור המכשיר. אם מוגדרת כ'אמת', תתאפשר נדידת נתונים. אם אינה מוגדרת, או מוגדרת כ'שקר', נדידת נתונים תהיה לא זמינה.</translation> +<translation id="7667184304362487902">קובעת את הגדרות ה-proxy ל-<ph name="PRODUCT_NAME" /> וליישומי ARC. + + מדיניות זו עדיין אינה מוכנה לשימוש, אל תשתמש בה.</translation> <translation id="76810863974142048">כתובת האתר שממנה לקוחות של גישה מרחוק צריכים להשיג את אסימון האימות שלהם. אם מדיניות זו מוגדרת, מארח הגישה מרחוק יחייב לקוחות שעוברים אימות להשיג אסימון אימות מכתובת אתר זו על מנת להתחבר. יש להשתמש במדיניות זו בשילוב עם המדיניות RemoteAccessHostTokenValidationUrl. @@ -1758,6 +1833,19 @@ <translation id="7842869978353666042">הגדרת אפשרויות Google Drive</translation> <translation id="7843525027689416831">מדיניות זו מציינת את הסימונים שיש להחיל על <ph name="PRODUCT_NAME" /> כשהוא מופעל. הסימונים המצוינים מוחלים במסך הכניסה בלבד. סימונים המוגדרים במסגרת מדיניות זו אינם מתפשטים להפעלות המשתמש.</translation> <translation id="7848840259379156480">המדיניות מאפשרת לך להגדיר את מעבד ברירת המחדל של HTML כאשר <ph name="PRODUCT_FRAME_NAME" /> מותקן. הגדרת ברירת המחדל מאפשרת לדפדפן המארח לבצע את העיבוד, אך יש לך אפשרות לעקוף זאת ולקבוע ש-<ph name="PRODUCT_FRAME_NAME" /> יעבד דפי HTML כברירת מחדל.</translation> +<translation id="7853178359124471330">כשהמדיניות הזו מוגדרת, התהליך לזיהוי אוטומטי של אזור זמן יתבצע באחת מהדרכים הבאות, בהתאם לערך ההגדרה: + + אם המדיניות תוגדר כ-TimezoneAutomaticDetectionUsersDecide, משתמשים יוכלו לשלוט בזיהוי אוטומטי של אזור זמן באמצעות פקדים רגילים בכתובת chrome://settings. + + אם המדיניות תוגדר כ-TimezoneAutomaticDetectionDisabled, פקדי אזור זמן אוטומטי ב-chrome://settings יושבתו. זיהוי אוטומטי של אזור זמן תמיד יהיה כבוי. + + אם המדיניות תוגדר כ-TimezoneAutomaticDetectionIPOnly, פקדי אזור הזמן בכתובת chrome://settings יושבתו. זיהוי אוטומטי של אזור זמן תמיד יפעל. זיהוי אזור הזמן ישתמש בשיטת כתובת IP בלבד לזיהוי המיקום. + + אם המדיניות תוגדר כ-TimezoneAutomaticDetectionSendWiFiAccessPoints, פקדי אזור הזמן ב-chrome://settings יושבתו. זיהוי אוטומטי של אזור זמן תמיד יפעל. רשימת נקודות הגישה הגלויות ב-Wi-Fi תישלח תמיד לשרת Geolocation API לזיהוי מדויק של אזור הזמן. + + אם המדיניות הזו לא תוגדר, ההתנהגות תהיה כמו במצב TimezoneAutomaticDetectionUsersDecide. + + אם הוגדרה המדיניות SystemTimezone, היא עוקפת את המדיניות הזו. במקרה זה זיהוי אוטומטי של אזור זמן מושבת לחלוטין.</translation> <translation id="7882585827992171421">מדיניות זו פועלת במצב קמעונאי בלבד. קובעת את מזהה התוסף שישמש כשומר מסך במסך הכניסה. התוסף חייב להיות חלק מה-AppPack שמוגדר עבור דומיין זה באמצעות מדיניות DeviceAppPack.</translation> @@ -1795,6 +1883,7 @@ אם המדיניות הזו לא תוגדר, ההגדרה תופעל.</translation> <translation id="8073243368829195">מאפשר שימוש ב-Smart Lock</translation> +<translation id="8074052133552427532">השתמש תמיד בזיהוי מקורב של אזור הזמן.</translation> <translation id="8099880303030573137">השהיה במצב לא פעיל בזמן שימוש בסוללה</translation> <translation id="8102913158860568230">הגדרת ברירת המחדל של Mediastream</translation> <translation id="8104962233214241919">בחר אישורי לקוח באופן אוטומטי עבור אתרים אלו</translation> @@ -1900,6 +1989,7 @@ <translation id="8424255554404582727">הגדר את ברירת המחדל של סיבוב התצוגה, מיושם בכל הפעלה מחדש</translation> <translation id="8426231401662877819">סובב את המסך ב-90 מעלות בכיוון השעון</translation> <translation id="8451988835943702790">השתמש בדף 'כרטיסייה חדשה' בתור דף הבית</translation> +<translation id="8458790683633857482">מציין קבוצת סעיפי מדיניות שתועבר אל זמן הריצה של ARC. על הערך להיות JSON חוקי.</translation> <translation id="8465065632133292531">פרמטרים עבור כתובת אתר של מופע שמשתמשת ב-POST</translation> <translation id="847472800012384958">אל תאפשר לאף אתר להציג חלונות קופצים</translation> <translation id="8477885780684655676">TLS 1.0</translation> @@ -2013,9 +2103,12 @@ אם המדיניות הזו תוגדר כ-false, לא יתאפשר כלל מעבר למצב מסך מלא על ידי המשתמש או כל יישום או תוסף. בכל הפלטפורמות מלבד <ph name="PRODUCT_OS_NAME" />, מצב קיוסק אינו זמין כשמצב מסך מלא מושבת.</translation> +<translation id="8795495354632096254">שלח תמיד נקודות גישה של Wi-Fi אל השרת בעת זיהוי אזור הזמן.</translation> <translation id="8818173863808665831">דווח על המיקום הגיאוגרפי של המכשיר. אם המדיניות אינה מוגדרת או מוגדרת כ-false, המיקום לא ידווח.</translation> +<translation id="8818768076343557335">הפעל תחזית של פעולות רשת בכל רשת שאינה סלולרית. + (יצא משימוש בגירסה 50, הוסר בגירסה 52, אם הערך שנקבע הוא 1 ההתייחסות תהיה כאל 0 - הפעל תחזית של פעולות רשת בכל חיבור רשת.)</translation> <translation id="8828766846428537606">המדיניות מגדירה את דף הבית המוגדר כברירת מחדל ב-<ph name="PRODUCT_NAME" /> ומונעת ממשתמשים לשנות זאת. הגדרות דף הבית של המשתמש נעולות לחלוטין אם תבחר שדף הבית יהיה דף 'כרטיסייה חדשה', או אם תגדיר אותו ככתובת אתר ותציין כתובת אתר של דף בית. אם לא תציין את כתובת האתר של דף הבית, המשתמש יוכל עדיין להגדיר את דף הבית לדף 'כרטיסייה חדשה' על ידי ציון 'chrome://newtab'.</translation> <translation id="8833109046074170275">אימות דרך תהליך ברירת המחדל של GAIA</translation> <translation id="8838303810937202360"><ph name="PRODUCT_OS_NAME" /> שומר בקובץ השמור אפליקציות ותוספים להתקנה על ידי משתמשים מרובים במכשיר יחיד כדי למנוע הורדה חוזרת שלהם עבור כל משתמש. @@ -2026,10 +2119,10 @@ <translation id="8889588091638298603">ה-Quirks Server מספק קובצי תצורה שהם ספציפיים לרכיבי חומרה מסוימים, כמו פרופילי תצוגה של ICC המשמשים להתאמה של כיול הצג. - כשמדיניות זו מוגדרת כ-false, המכשיר לא ינסה ליצור קשר עם Quirks Server + כשמדיניות זו מוגדרת כ-False, המכשיר לא ינסה ליצור קשר עם Quirks Server להורדה של קובצי התצורה. - אם המדיניות הזו מוגדרת כ-true או שאינה מוגדרת, + אם המדיניות הזו מוגדרת כ-True או שאינה מוגדרת, <ph name="PRODUCT_OS_NAME" /> יצור קשר באופן אוטומטי עם Quirks Server, יוריד קובצי תצורה אם הם זמינים ויאחסן אותם במכשיר. הקבצים האלה יכולים לשמש, לדוגמה, @@ -2074,6 +2167,7 @@ <translation id="9042911395677044526">מאפשרת לדחוף את תצורת הרשת כדי שתיושם עבור משתמש למכשיר <ph name="PRODUCT_OS_NAME" />. תצורת הרשת היא מחרוזת בפורמט JSON כפי שהוגדרה על ידי פורמט תצורת הרשת הפתוחה, באופן המתואר ב-<ph name="ONC_SPEC_URL" /></translation> <translation id="9084985621503260744">ציין האם פעילות וידאו משפיעה על ניהול צריכת החשמל</translation> <translation id="9088433379343318874">הפעלת ספק התוכן של המשתמש בפיקוח</translation> +<translation id="9088444059179765143">קבע את תצורת השיטה לזיהוי אוטומטי של אזור זמן</translation> <translation id="9096086085182305205">רשימת היתרים של שרת אימות</translation> <translation id="9098553063150791878">כללי מדיניות לאימות HTTP</translation> <translation id="9104138886225968319">שלח מעקבי פעימות לב לשרת הניהול כדי לאפשר לו לזהות אם המכשיר פועל במצב לא מקוון.
diff --git a/components/policy/resources/policy_templates_ja.xtb b/components/policy/resources/policy_templates_ja.xtb index 2cb2ff5..4ee6053 100644 --- a/components/policy/resources/policy_templates_ja.xtb +++ b/components/policy/resources/policy_templates_ja.xtb
@@ -680,7 +680,7 @@ ポリシーの値はミリ秒で指定します。値の範囲は 30 秒~24 時間です。</translation> <translation id="3528000905991875314">別のエラー ページを有効にする</translation> -<translation id="3538538104630456270">このポリシーに関連付けられている設定は以前使用されていましたが、パスワード表示での再認証が導入されて以降、その設定(したがってこのポリシー)は Chrome の動作に影響しなくなりました。現在の Chrome の動作は、パスワード マネージャの設定ページでパスワードの平文表示を無効にするようポリシーを設定した場合と同じになります。つまり、設定ページには単にプレースホルダが表示され、ユーザーが [表示] をクリックして(再認証が必要な場合は再認証を行って)初めて Chrome にパスワードが表示されます。ポリシーの元の説明は次のとおりです。 +<translation id="3538538104630456270">このポリシーに関連付けられている設定は以前使用されていましたが、パスワード表示での再認証が導入されて以降、その設定(したがってこのポリシー)は Chrome の動作に影響しなくなりました。現在の Chrome の動作は、パスワード マネージャの設定ページでパスワードの平文表示を無効にするようポリシーを設定した場合と同じになっています。つまり、設定ページにはプレースホルダのみが表示され、ユーザーが [表示] をクリックして(再認証が必要な場合は再認証を行って)初めて Chrome にパスワードが表示されます。ポリシーの元の説明は次のとおりです。 パスワード マネージャでパスワードの平文表示を可能にするかどうかを管理します。 @@ -1604,11 +1604,6 @@ 「RestoreOnStartup」ポリシーが前回のセッションから URL を復元するように設定されている場合、このポリシーは適用されず、該当するサイトの Cookie は永続的に保存されます。</translation> <translation id="7207095846245296855">Google SafeSearch を強制適用する</translation> -<translation id="7213425178181578730">このポリシーが false に設定されている場合、<ph name="PRODUCT_OS_NAME" /> では Bluetooth が無効になります。ユーザーが Bluetooth を再び有効にすることはできません。 - - このポリシーが true に設定されているか未設定の場合、ユーザーは必要に応じて Bluetooth を有効または無効にできます。 - - このポリシーが設定されている場合、ユーザーは設定内容を変更したり他の設定を優先させたりすることはできません。</translation> <translation id="7216442368414164495">セーフ ブラウジングの詳細レポートを有効にすることをユーザーに許可する</translation> <translation id="7227967227357489766">デバイスへのログインを許可するユーザーのリストを定義します。エントリの形式は <ph name="USER_WHITELIST_ENTRY_FORMAT" /> です(例: <ph name="USER_WHITELIST_ENTRY_EXAMPLE" />)。ドメイン上の任意のユーザーを許可するには、<ph name="USER_WHITELIST_ENTRY_WILDCARD" /> のエントリ形式を使用します。
diff --git a/components/policy/resources/policy_templates_kn.xtb b/components/policy/resources/policy_templates_kn.xtb index 38d24bc..e4d735d 100644 --- a/components/policy/resources/policy_templates_kn.xtb +++ b/components/policy/resources/policy_templates_kn.xtb
@@ -666,7 +666,7 @@ ನೀತಿ ಮೌಲ್ಯವನ್ನು ಮಿಲಿಸೆಕೆಂಡ್ಗಳಲ್ಲಿ ನಿರ್ದಿಷ್ಟಪಡಿಸಬೇಕು. ಮೌಲ್ಯಗಳನ್ನು 30 ಸೆಕೆಂಡ್ಗಳಿಂದ 24 ಗಂಟೆಗಳ ವ್ಯಾಪ್ತಿಗೆ ಹಿಡಿದಿಡಲಾಗಿದೆ.</translation> <translation id="3528000905991875314">ಪರ್ಯಾಯ ದೋಷ ಪುಟಗಳನ್ನು ಸಕ್ರಿಯಗೊಳಿಸು</translation> -<translation id="3538538104630456270">ಪಾಸ್ವರ್ಡ್ಗಳನ್ನು ವೀಕ್ಷಿಸುವುದಕ್ಕೆ ಮರುದೃಢೀಕರಣದ ಮೊದಲು ಬಳಸಿದ ಸಂಬಂಧಿಸಿದ ಸೆಟ್ಟಿಂಗ್ ಅನ್ನು ಜಾರಿಗೊಳಿಸಲಾಗಿದೆ. ಆ ಸಮಯದಿಂದ, ಸೆಟ್ಟಿಂಗ್ ಮತ್ತು ಈ ನೀತಿಯು Chrome ನಡವಳಿಕೆಯ ಮೇಲೆ ಯಾವುದೇ ಪರಿಣಾಮವನ್ನು ಹೊಂದಿರಲಿಲ್ಲ. Chrome ನ ಪ್ರಸ್ತುತ ನಡವಳಿಕೆಯು ಪಾಸ್ವರ್ಡ್ ಮ್ಯಾನೇಜರ್ ಸೆಟ್ಟಿಂಗ್ಗಳ ಪುಟದಲ್ಲಿ ಸ್ಪಷ್ಟ ಪಠ್ಯದಲ್ಲಿ ಪಾಸ್ವರ್ಡ್ಗಳನ್ನು ತೋರಿಸುವುದನ್ನು ನಿಷ್ಕ್ರಿಯಗೊಳಿಸುವುದಕ್ಕೆ ನೀತಿಯನ್ನು ಹೊಂದಿಸಲಾಗಿರುವಂತೆಯೇ ಇದೆ. ಇದರರ್ಥ ಸೆಟ್ಟಿಂಗ್ಗಳ ಪುಟವು ಪ್ಲೇಸ್ಹೋಲ್ಡರ್ ಅನ್ನು ಒಳಗೊಂಡಿದೆ ಮತ್ತು ಬಳಕೆದಾರರು "ತೋರಿಸು" (ಮತ್ತು ಅನ್ವಯಿಸಿದರೆ, ಮರುದೃಢೀಕರಿಸುವುದು) ಕ್ಲಿಕ್ ಮಾಡಿದಾಗ ಪಾಸ್ವರ್ಡ್ ಅನ್ನು Chrome ತೋರಿಸುತ್ತದೆ. ನೀತಿಯ ಮೂಲ ವಿವರಣೆಯು ಈ ಕೆಳಗಿನಂತಿದೆ +<translation id="3538538104630456270">ಪಾಸ್ವರ್ಡ್ಗಳನ್ನು ವೀಕ್ಷಿಸುವುದಕ್ಕೆ ಮರುದೃಢೀಕರಣವನ್ನು ಪರಿಚಯಿಸುವ ಮೊದಲೇ ಸಂಬಂಧಿಸಿದ ಸೆಟ್ಟಿಂಗ್ ಅನ್ನು ಬಳಸಲಾಗಿತ್ತು. ಅಂದಿನಿಂದ, ಸೆಟ್ಟಿಂಗ್ ಮತ್ತು ಈ ನೀತಿಯು Chrome ನಡವಳಿಕೆಯ ಮೇಲೆ ಯಾವುದೇ ಪರಿಣಾಮವನ್ನು ಬೀರಿರಲಿಲ್ಲ. Chrome ನ ಪ್ರಸ್ತುತ ನಡವಳಿಕೆಯು ಪಾಸ್ವರ್ಡ್ ಮ್ಯಾನೇಜರ್ ಸೆಟ್ಟಿಂಗ್ಗಳ ಪುಟದಲ್ಲಿ ಸ್ಪಷ್ಟ ಪಠ್ಯದಲ್ಲಿ ಪಾಸ್ವರ್ಡ್ಗಳನ್ನು ತೋರಿಸುವುದನ್ನು ನಿಷ್ಕ್ರಿಯಗೊಳಿಸುವುದಕ್ಕೆ ನೀತಿಯನ್ನು ಹೊಂದಿಸಲಾಗಿರುವಂತೆಯೇ ಇದೆ. ಇದರರ್ಥ ಸೆಟ್ಟಿಂಗ್ಗಳ ಪುಟವು ಪ್ಲೇಸ್ಹೋಲ್ಡರ್ ಅನ್ನು ಒಳಗೊಂಡಿದೆ ಮತ್ತು ಬಳಕೆದಾರರು "ತೋರಿಸು" (ಮತ್ತು ಅನ್ವಯಿಸಿದರೆ, ಮರುದೃಢೀಕರಿಸುವುದು) ಕ್ಲಿಕ್ ಮಾಡಿದಾಗ ಪಾಸ್ವರ್ಡ್ ಅನ್ನು Chrome ತೋರಿಸುತ್ತದೆ. ನೀತಿಯ ಮೂಲ ವಿವರಣೆಯು ಈ ಕೆಳಗಿನಂತಿದೆ ಪಾಸ್ವರ್ಡ್ ಮ್ಯಾನೇಜರ್ನಲ್ಲಿ ಸ್ಪಷ್ಟ ಪಠ್ಯದಲ್ಲಿ ಬಳಕೆದಾರರು ಪಾಸ್ವರ್ಡ್ಗಳನ್ನು ತೋರಿಸಬಹುದೇ ಎಂಬುದನ್ನು ನಿಯಂತ್ರಿಸುತ್ತದೆ. @@ -1597,11 +1597,6 @@ "RestoreOnStartup" ನೀತಿಯನ್ನು ಹಿಂದಿನ ಸೆಶನ್ಗಳಿಂದ URL ಗಳನ್ನು ಮರುಸ್ಥಾಪಿಸಲು ಹೊಂದಿಸಿದಲ್ಲಿ, ಈ ನೀತಿಗೆ ಯಾವುದೇ ಮನ್ನಣೆ ನೀಡಲಾಗುವುದಿಲ್ಲ ಮತ್ತು ಅಂತಹ ಸೈಟ್ಗಳಿಗಾಗಿ ಕುಕೀಸ್ ಅನ್ನು ಶಾಶ್ವತವಾಗಿ ಸಂಗ್ರಹಿಸಲಾಗುವುದು.</translation> <translation id="7207095846245296855">Google SafeSearch ಒತ್ತಾಯಪಡಿಸು</translation> -<translation id="7213425178181578730">ಈ ನೀತಿಯನ್ನು ತಪ್ಪು ಎಂದು ಹೊಂದಿಸಿದರೆ, ಬ್ಲೂಟೂತ್ ಅನ್ನು <ph name="PRODUCT_OS_NAME" /> ನಿಷ್ಕ್ರಿಯಗೊಳಿಸುತ್ತದೆ ಹಾಗೂ ಬಳಕೆದಾರರಿಗೆ ಅದನ್ನು ಮತ್ತೆ ಸಕ್ರಿಯಗೊಳಿಸಲು ಸಾಧ್ಯವಾಗುವುದಿಲ್ಲ. - - ಈ ನೀತಿಯನ್ನು ಸರಿ ಎಂದು ಹೊಂದಿಸಿದಲ್ಲಿ ಅಥವಾ ಹೊಂದಿಸದೆ ಬಿಟ್ಟರೆ, ಬಳಕೆದಾರರಿಗೆ ತಮ್ಮ ಇಚ್ಛೆಯಂತೆ ಬ್ಲೂಟೂತ್ ಅನ್ನು ಸಕ್ರಿಯಗೊಳಿಸಲು ಅಥವಾ ನಿಷ್ಕ್ರಿಯಗೊಳಿಸಲು ಸಾಧ್ಯವಾಗುತ್ತದೆ. - - ಈ ನೀತಿಯನ್ನು ಹೊಂದಿಸಿದರೆ, ಬಳಕೆದಾರರಿಗೆ ಅದನ್ನು ಬದಲಾಯಿಸಲು ಅಥವಾ ಅತಿಕ್ರಮಿಸಲು ಸಾಧ್ಯವಾಗುವುದಿಲ್ಲ.</translation> <translation id="7216442368414164495">ಸುರಕ್ಷಿತ ಬ್ರೌಸಿಂಗ್ ವಿಸ್ತರಿತ ವರದಿ ಮಾಡುವಿಕೆಯನ್ನು ಆಯ್ದುಕೊಳ್ಳಲು ಬಳಕೆದಾರರಿಗೆ ಅನುಮತಿಸುತ್ತದೆ</translation> <translation id="7227967227357489766">ಸಾಧನಕ್ಕೆ ಲಾಗಿನ್ ಮಾಡಲು ಅವಕಾಶವನ್ನು ನೀಡಿರುವಂತಹ ಬಳಕೆದಾರರ ಪಟ್ಟಿಯನ್ನು ವಿವರಿಸುತ್ತದೆ. <ph name="USER_WHITELIST_ENTRY_EXAMPLE" /> ನಂತಹ <ph name="USER_WHITELIST_ENTRY_FORMAT" /> ಸ್ವರೂಪದ ನಮೂದುಗಳಾಗಿವೆ. ಡೊಮೇನ್ನಲ್ಲಿ ನಿರಂಕುಶ ಬಳಕೆದಾರರನ್ನು ಅನುಮತಿಸಲು, <ph name="USER_WHITELIST_ENTRY_WILDCARD" /> ಫಾರ್ಮ್ನ ನಮೂದುಗಳನ್ನು ಬಳಸಿ.
diff --git a/components/policy/resources/policy_templates_ko.xtb b/components/policy/resources/policy_templates_ko.xtb index 123c3e2e4..79013a29 100644 --- a/components/policy/resources/policy_templates_ko.xtb +++ b/components/policy/resources/policy_templates_ko.xtb
@@ -749,11 +749,11 @@ 이 정책 값은 밀리초로 지정되어야 하며 30초에서 24시간 범위 내로 잘립니다.</translation> <translation id="3528000905991875314">대체 오류 페이지 사용</translation> -<translation id="3538538104630456270">비밀번호 조회를 위한 재인증이 시작되기 전에 관련 설정이 사용되었습니다. 이후 설정과 이 정책이 Chrome의 작동에 영향을 주지 않았습니다. 현재 Chrome은 비밀번호 관리자 설정 페이지에서 일반 텍스트로 비밀번호 표시를 사용 중지하도록 정책이 설정된 것과 동일하게 작동합니다. 따라서 설정 페이지에는 자리 표시자만 포함되어 있으며, 사용자가 '표시'를 클릭하는 경우(해당하는 경우 다시 인증)에만 Chrome에서 비밀번호를 표시합니다. 정책의 원본 설명은 아래와 같습니다. +<translation id="3538538104630456270">비밀번호 조회를 위한 재인증 시작 전에 관련 설정을 사용했습니다. 그 이후에는 설정한 사항과 이 정책이 Chrome의 작동에 영향을 주지 않았습니다. 현재 Chrome은 비밀번호 관리자 설정 페이지에서 일반 텍스트로 비밀번호 표시하는 것을 사용 중지하도록 정책을 설정한 것과 동일하게 작동합니다. 따라서 설정 페이지에는 자리 표시자만 포함되어 있으며, 사용자가 '표시'를 클릭하는 경우(해당하는 경우 다시 인증)에만 Chrome에서 비밀번호를 표시합니다. 정책의 원본 설명은 아래와 같습니다. 사용자가 비밀번호 관리자에서 일반 텍스트로 비밀번호를 표시할 수 있는지 여부를 관리합니다. - 이 설정을 사용 중지하면 비밀번호 관리자가 비밀번호 관리자 창에 저장된 비밀번호를 일반 텍스트로 표시할 수 없습니다. + 이 설정을 사용 중지하면 비밀번호 관리자에서 비밀번호 관리자 창에 저장된 비밀번호를 일반 텍스트로 표시할 수 없습니다. 이 설정을 사용하거나 이 정책을 설정하지 않으면 사용자가 비밀번호 관리자에서 일반 텍스트로 비밀번호를 볼 수 있습니다.</translation> <translation id="3547954654003013442">프록시 설정</translation> @@ -1769,11 +1769,6 @@ 이전 세션에서 URL을 복원하도록 'RestoreOnStartup' 정책이 설정된 경우 이 정책이 지켜지지 않으며 해당 사이트의 쿠키는 영구적으로 저장됩니다.</translation> <translation id="7207095846245296855">Google 세이프서치 강제 실행</translation> -<translation id="7213425178181578730">이 정책이 false로 설정되는 경우 <ph name="PRODUCT_OS_NAME" />에서 블루투스를 사용하지 않도록 설정하며 사용자가 블루투스를 다시 사용하도록 설정할 수 없습니다. - - 이 정책이 true로 설정되거나 설정되지 않은 경우 사용자는 블루투스를 사용 또는 사용 중지할 수 있습니다. - - 이 정책이 설정되면 사용자가 변경하거나 무시할 수 없습니다.</translation> <translation id="7216442368414164495">사용자가 세이프 브라우징 확장 보고를 선택하도록 허용</translation> <translation id="7227967227357489766">기기에 로그인할 수 있는 사용자 목록을 정의합니다. 항목은 <ph name="USER_WHITELIST_ENTRY_FORMAT" /> 형식(예: <ph name="USER_WHITELIST_ENTRY_EXAMPLE" />)입니다. 도메인에 임의의 사용자를 허용하려면 <ph name="USER_WHITELIST_ENTRY_WILDCARD" /> 형식의 항목을 사용합니다. @@ -2269,8 +2264,8 @@ 이 정책을 true로 설정하거나 설정하지 않으면 <ph name="PRODUCT_OS_NAME" />에서 자동으로 Quirks 서버에 연결하고 구성 파일을 다운로드하며 - 가능한 경우 기기에 파일을 저장합니다. 예를 들어 이러한 파일은 - 연결된 모니터의 디스플레이 품질 개선에 사용될 수 있습니다.</translation> + 가능한 경우 기기에 파일을 저장합니다. 이러한 파일은 + 연결된 모니터의 디스플레이 품질 개선 등에 사용될 수 있습니다.</translation> <translation id="8905426178924715309">이 정책은 지원 중단되었으므로 대신 ForceGoogleSafeSearch 및 ForceYouTubeSafetyMode를 사용하시기 바랍니다. ForceGoogleSafeSearch 또는 ForceYouTubeSafetyMode 정책이 설정된 경우 이 정책이 무시됩니다. 세이프서치가 활성화되도록 설정된 상태에서 Google 웹 검색이 이루어지며 사용자가 이 설정을 바꾸지 못하도록 합니다. 또한 이 설정은 YouTube에서 안전 모드를 사용하도록 합니다.
diff --git a/components/policy/resources/policy_templates_lt.xtb b/components/policy/resources/policy_templates_lt.xtb index 2da1ca5..e27722f 100644 --- a/components/policy/resources/policy_templates_lt.xtb +++ b/components/policy/resources/policy_templates_lt.xtb
@@ -1780,11 +1780,6 @@ Jei politika „RestoreOnStartup“ nustatyta atkurti URL iš ankstesnių sesijų, į šią politiką nebus atsižvelgiama ir slapukai tose svetainėse bus išsaugomi visam laikui.</translation> <translation id="7207095846245296855">Priverstinis „Google“ saugios paieškos naudojimas</translation> -<translation id="7213425178181578730">Jei ši politika nustatyta į „netiesa“, „<ph name="PRODUCT_OS_NAME" />“ išjungs „Bluetooth“ ir naudotojas negalės jo vėl įjungti. - - Jei ši politika nustatyta į „tiesa“ arba nenustatyta, naudotojas galės pasirinkti įjungti arba išjungti „Bluetooth“. - - Jei ši politika nustatyta, naudotojas negali jos pakeisti ar nepaisyti.</translation> <translation id="7216442368414164495">Naudotojams leidžiama pasirinkti Saugaus naršymo išplėstinių ataskaitų teikimą</translation> <translation id="7227967227357489766">Apibrėžiamas naudotojų, kuriems leidžiama prisijungti prie įrenginio, sąrašas. Įrašai yra tokios formos: <ph name="USER_WHITELIST_ENTRY_FORMAT" />, pvz., <ph name="USER_WHITELIST_ENTRY_EXAMPLE" />. Jei norite leisti atsitiktinius naudotojus domene, naudokite tokios formos įrašus: <ph name="USER_WHITELIST_ENTRY_WILDCARD" />.
diff --git a/components/policy/resources/policy_templates_lv.xtb b/components/policy/resources/policy_templates_lv.xtb index 9974a243..feed80b 100644 --- a/components/policy/resources/policy_templates_lv.xtb +++ b/components/policy/resources/policy_templates_lv.xtb
@@ -1777,11 +1777,6 @@ Ja ir iestatīta politika RestoreOnStartup, lai atjaunotu vietrāžus URL no iepriekšējām sesijām, šī politika netiek ievērota un attiecīgo saišu sīkfaili tiek glabāti pastāvīgi.</translation> <translation id="7207095846245296855">Filtra Google droša meklēšana piespiedu izmantošana</translation> -<translation id="7213425178181578730">Ja politikai iestatīta vērtība Nepatiesa, <ph name="PRODUCT_OS_NAME" /> atspējos Bluetooth un lietotājs nevarēs to iespējot. - - Ja politikai iestatīta vērtība Patiesa vai tā nav iestatīta, lietotājs varēs pēc izvēles iespējot vai atspējot Bluetooth. - - Ja šī politika ir iestatīta, lietotājs to nevar mainīt vai ignorēt.</translation> <translation id="7216442368414164495">Lietotāju atļauja izvēlēties Drošas pārlūkošanas izvērstos pārskatus</translation> <translation id="7227967227357489766">Nosaka to lietotāju sarakstu, kuriem ir atļauts pieteikties ierīcē. Ieraksti ir šādā formātā: <ph name="USER_WHITELIST_ENTRY_FORMAT" /> (piemēram, <ph name="USER_WHITELIST_ENTRY_EXAMPLE" />). Lai ļautu neregulāriem lietotājiem izmantot domēnu, lietojiet ierakstus šādā formātā: <ph name="USER_WHITELIST_ENTRY_WILDCARD" />.
diff --git a/components/policy/resources/policy_templates_ml.xtb b/components/policy/resources/policy_templates_ml.xtb index d8532e06..6010e569 100644 --- a/components/policy/resources/policy_templates_ml.xtb +++ b/components/policy/resources/policy_templates_ml.xtb
@@ -753,7 +753,7 @@ നയ മൂല്യം മില്ലിസെക്കൻഡുകളിലായിരിക്കണം. മൂല്യങ്ങൾ 30 സെക്കൻഡ് മുതൽ 24 മണിക്കൂർ വരെയുള്ള ശ്രേണിയിലാക്കിയിരിക്കുന്നു.</translation> <translation id="3528000905991875314">സമാന്തര പിശക് പേജുകള് പ്രാപ്തമാക്കുക</translation> -<translation id="3538538104630456270">വിശ്വാസ്യത ഉറപ്പാക്കുന്ന സംവിധാനം അവതരിപ്പിക്കുന്നതിന് മുമ്പ്, പാസ്വേഡുകൾ കാണുന്നത് പ്രവർത്തനക്ഷമമാക്കാൻ ബന്ധപ്പെട്ട സജ്ജീകരണമാണ് ഉപയോഗിച്ചിരുന്നത്. അന്ന് മുതൽ, ഈ ക്രമീകരണത്തിനും ഈ നയത്തിനും Chrome-ന്റെ പ്രവർത്തനരീതിയിൽ യാതൊരു സ്വാധീനവും ഇല്ല. പാസ്വേഡ് മാനേജർ ക്രമീകരണ പേജിലെ 'ടെക്സ്റ്റ് മായ്ക്കുക' എന്നതിൽ പാസ്വേഡുകൾ കാണിക്കുന്നത് പ്രവർത്തനരഹിതമാക്കുക എന്ന് സജ്ജമാക്കിയിട്ടുണ്ടെങ്കിൽ, അതിന് സമാനമാണ് ഇപ്പോൾ നിലവിലുള്ള Chrome-ന്റെ പ്രവർത്തനരീതി. ക്രമീകരണ പേജിൽ ഒരു പ്ലെയ്സ്ഹോൾഡർ മാത്രമേ അടങ്ങിയിട്ടുള്ളൂ എന്നും ഉപയോക്താവ്, "കാണിക്കുക" (ഒപ്പം ബാധകമെങ്കിൽ വീണ്ടും വിശ്വാസ്യത ഉറപ്പാക്കുന്നു) എന്നതിൽ ക്ലിക്കുചെയ്യുമ്പോൾ മാത്രമേ Chrome, പാസ്വേഡ് കാണിക്കുകയുള്ളൂ എന്നുമാണ് ഇത് അർത്ഥമാക്കുന്നത്. നയത്തിന്റെ യഥാർത്ഥ വിവരണം ഇനിപ്പറയുന്നതാണ്. +<translation id="3538538104630456270">പാസ്വേഡുകൾ കാണുന്നതിനുള്ള വിശ്വാസ്യത ഉറപ്പാക്കൽ സംവിധാനം അവതരിപ്പിക്കുന്നതിന് മുമ്പ് അതിനായി അനുബന്ധ സജ്ജീകരണമാണ് ഉപയോഗിച്ചിരുന്നത്. അന്ന് മുതൽ, ഈ ക്രമീകരണത്തിനും ഈ നയത്തിനും Chrome-ന്റെ പ്രവർത്തനരീതിയിൽ യാതൊരു സ്വാധീനവും ഇല്ല. പാസ്വേഡ് മാനേജർ ക്രമീകരണ പേജിലെ 'ടെക്സ്റ്റ് മായ്ക്കുക' എന്നതിൽ പാസ്വേഡുകൾ കാണിക്കുന്നത് പ്രവർത്തനരഹിതമാക്കുക എന്ന് സജ്ജമാക്കിയിട്ടുണ്ടെങ്കിൽ, അതിന് സമാനമാണ് ഇപ്പോൾ നിലവിലുള്ള Chrome-ന്റെ പ്രവർത്തനരീതി. ക്രമീകരണ പേജിൽ ഒരു പ്ലെയ്സ്ഹോൾഡർ മാത്രമേ അടങ്ങിയിട്ടുള്ളൂ എന്നും ഉപയോക്താവ്, "കാണിക്കുക" (ഒപ്പം ബാധകമെങ്കിൽ വീണ്ടും വിശ്വാസ്യത ഉറപ്പാക്കുന്നു) എന്നതിൽ ക്ലിക്കുചെയ്യുമ്പോൾ മാത്രമേ Chrome, പാസ്വേഡ് കാണിക്കുകയുള്ളൂ എന്നുമാണ് ഇത് അർത്ഥമാക്കുന്നത്. നയത്തിന്റെ യഥാർത്ഥ വിവരണം ഇനിപ്പറയുന്നതാണ്. പാസ്വേഡ് മാനേജറിലെ 'ടെക്സ്റ്റ് മായ്ക്കുക' എന്നതിൽ ഉപയോക്താവ് പാസ്വേഡുകൾ കാണിക്കാനിടയുണ്ടോ എന്ന് നിയന്ത്രിക്കുന്നു. @@ -1782,11 +1782,6 @@ RestoreOnStartup" നയം സജ്ജമാക്കിയത് മുമ്പത്തെ സെഷനുകളിൽ നിന്ന് URL-കൾ പുനഃസ്ഥാപിക്കാനാണെങ്കിൽ ഈ നയം പരിഗണിക്കപ്പെടുകയില്ല ഒപ്പം അത്തരം സൈറ്റുകൾക്ക് വേണ്ടി കുക്കികൾ ശാശ്വതമായി സൂക്ഷിക്കുകയും ചെയ്യും.</translation> <translation id="7207095846245296855">Google SafeSearch ഉപയോഗിക്കുക</translation> -<translation id="7213425178181578730">ഈ നയം തെറ്റാണെന്ന് സജ്ജമാക്കുകയാണെങ്കിൽ <ph name="PRODUCT_OS_NAME" />, Bluetooth പ്രവർത്തനരഹിതമാക്കും, തുടർന്ന് ഉപയോക്താവിന് ഇത് വീണ്ടും പ്രവർത്തനക്ഷമമാക്കാൻ കഴിയില്ല. - - ഈ നയം ശരിയാണെന്ന് സജ്ജമാക്കുകയോ സജ്ജമാക്കാതെ വിടുകയോ ആണെങ്കിൽ, ഉപയോക്താവിന് ഇഷ്ടമുള്ളപ്പോൾ Bluetooth പ്രവർത്തനക്ഷമമാക്കുകയോ പ്രവർത്തനരഹിതമാക്കുകയോ ചെയ്യാം. - - ഈ നയം സജ്ജമാക്കിയാൽ, ഉപയോക്താവിന് ഇത് മാറ്റാനോ അസാധുവാക്കാനോ കഴിയില്ല.</translation> <translation id="7216442368414164495">സുരക്ഷിത ബ്രൗസുചെയ്യൽ വിപുലീകൃത റിപ്പോർട്ടുചെയ്യൽ തിരഞ്ഞെടുക്കാൻ ഉപയോക്താക്കളെ അനുവദിക്കുക</translation> <translation id="7227967227357489766">ഉപകരണത്തിൽ ലോഗിൻ ചെയ്യാൻ അനുമതിയുള്ള ഉപയോക്താക്കളുടെ ലിസ്റ്റ് നിർവചിക്കുന്നു. <ph name="USER_WHITELIST_ENTRY_FORMAT" /> ഫോമിലെ എൻട്രികൾ <ph name="USER_WHITELIST_ENTRY_EXAMPLE" /> പോലുള്ളതാണ്. ഒരു ഡൊമെയ്നിൽ അനിയന്ത്രിതമായി ഉപയോക്താക്കളെ അനുവദിക്കുന്നതിന്, <ph name="USER_WHITELIST_ENTRY_WILDCARD" /> ഫോം എൻട്രികൾ ഉപയോഗിക്കുക.
diff --git a/components/policy/resources/policy_templates_mr.xtb b/components/policy/resources/policy_templates_mr.xtb index d45163f..7953de8 100644 --- a/components/policy/resources/policy_templates_mr.xtb +++ b/components/policy/resources/policy_templates_mr.xtb
@@ -737,7 +737,7 @@ धोरण मूल्य मिलीसेकंदांमध्ये निर्दिष्ट केले जावे. मूल्ये 30 सेकंद ते 24 तासांच्या श्रेणीपर्यंत पकडली जातात.</translation> <translation id="3528000905991875314">वैकल्पिक त्रुटी पृष्ठे सक्षम करा</translation> -<translation id="3538538104630456270">संकेतशब्द पाहण्यावरील पुन:प्रमाणीकरण सादर करण्यापूर्वी संबद्ध सेटिंग वापरले होते. त्यावेळेपासून नंतर, सेटिंगचा आणि त्यामुळे या धोरणाचा Chrome च्या वर्तनावर कोणताही प्रभाव नव्हता. Chrome चे वर्तमान वर्तन हे संकेतशब्द व्यवस्थापन सेटिंग्ज पृष्ठामध्ये स्पष्ट मजकुरात संकेतशब्द दर्शविणे अक्षम करण्यावर धोरण सेट केले असताना जसे असते तसेच ते आता आहे. याचा अर्थ सेटिंग्ज पृष्ठामध्ये फक्त प्लेसहोल्डर आहे आणि वापरकर्ता "दर्शवा" (आणि पुन:प्रमाणीकरण, लागू असल्यास) क्लिक करतो केवळ तेव्हाच Chrome संकेतशब्द दर्शविते. धोरणाचे मूळ वर्णन खालीलप्रमाणे आहे. +<translation id="3538538104630456270">संकेतशब्द पाहण्याचे पुन:प्रमाणीकरण सादर करण्यापूर्वी संबद्ध सेटिंग वापरले होते. तेव्हापासून, सेटिंगचा आणि त्यामुळे या धोरणाचा Chrome च्या वर्तनावर कोणताही प्रभाव नव्हता. Chrome चे वर्तमान वर्तन हे संकेतशब्द व्यवस्थापन सेटिंग्ज पृष्ठामध्ये स्पष्ट मजकुरात संकेतशब्द दर्शविणे अक्षम करण्यावर धोरण सेट केले असताना जसे असते तसेच ते आता आहे. याचा अर्थ सेटिंग्ज पृष्ठामध्ये फक्त प्लेसहोल्डर आहे आणि वापरकर्ता "दर्शवा" (आणि पुन:प्रमाणीकरण, लागू असल्यास) क्लिक करतो केवळ तेव्हाच Chrome संकेतशब्द दर्शविते. धोरणाचे मूळ वर्णन खालीलप्रमाणे आहे. वापरकर्ता संकेतशब्द व्यवस्थापकामध्ये स्पष्ट मजकुरात संकेतशब्द दर्शवू शकतो किंवा नाही ते नियंत्रित करते. @@ -1742,11 +1742,6 @@ मागील सत्रांवरून URL पुनर्संचयित करण्यासाठी "RestoreOnStartup" धोरण सेट केले असल्यास या धोरणाचे पालन केले जाणार नाही आणि कुकीज कायमच्या त्या साइटसाठी संचयित केल्या जातील.</translation> <translation id="7207095846245296855">Google सुरक्षितशोध ला सक्ती करा</translation> -<translation id="7213425178181578730">हे धोरण असत्यावर सेट असल्यास, <ph name="PRODUCT_OS_NAME" /> Bluetooth अक्षम करेल आणि वापरकर्ता ते परत सक्षम करू शकत नाही. - - हे धोरण सत्यावर सेट असल्यास किंवा सेट न करता सोडले असल्यास, वापरकर्ता त्याच्या इच्छेनुसार Bluetooth सक्षम किंवा अक्षम करण्यास सक्षम असेल. - - हे धोरण सेट केले असल्यास, वापरकर्ता ते बदलू किंवा अधिशून्य करू शकत नाही.</translation> <translation id="7216442368414164495">सुरक्षित ब्राउझिंग विस्तारित अहवालाची निवड करण्याची अनुमती द्या</translation> <translation id="7227967227357489766">डिव्हाइसवर लॉगिन करण्याची अनुमती असलेल्या वापरकर्त्यांची सूची परिभाषित करते. प्रविष्ट्या <ph name="USER_WHITELIST_ENTRY_FORMAT" /> फॉर्म असतात, जसे की <ph name="USER_WHITELIST_ENTRY_EXAMPLE" />. डोमेनवर मध्यस्थ वापरकर्त्यांना अनुमती देण्यासाठी <ph name="USER_WHITELIST_ENTRY_WILDCARD" /> फॉर्ममधील प्रविष्ट्या वापरा. @@ -2222,7 +2217,7 @@ <translation id="8858642179038618439">YouTube सुरक्षितता मोडला सक्ती करा</translation> <translation id="8864975621965365890"><ph name="PRODUCT_FRAME_NAME" /> द्वारे एखादी साइट पूर्तता करते तेव्हा दिसत असलेली नाकारण्याची सूचना दाबते.</translation> <translation id="8870318296973696995">मुख्यपृष्ठ</translation> -<translation id="8889588091638298603">मॉनिटर मापन समायोजित करण्यासाठी Quirks सर्व्हर ICC प्रोफाईल प्रर्दशन सारख्या +<translation id="8889588091638298603">मॉनिटर कॅलिब्रेशन समायोजित करण्यासाठी Quirks सर्व्हर ICC प्रोफाईल प्रर्दशन सारख्या हार्डवेअर-विशिष्ट कॉन्फिगरेशन फायली प्रदान करते. हे धोरण असत्य वर सेट केले असते तेव्हा, डिव्हाइस कॉन्फिगरेशन फायली डाउनलोड करण्यासाठी
diff --git a/components/policy/resources/policy_templates_ms.xtb b/components/policy/resources/policy_templates_ms.xtb index 421f1ee..323e86d3 100644 --- a/components/policy/resources/policy_templates_ms.xtb +++ b/components/policy/resources/policy_templates_ms.xtb
@@ -163,6 +163,18 @@ <translation id="1561424797596341174">Pembatalan dasar untuk binaan Nyahpepijat bagi hos akses jauh</translation> <translation id="1583248206450240930">Gunakan <ph name="PRODUCT_FRAME_NAME" /> secara lalai</translation> <translation id="1608755754295374538">URL yang akan diberikan akses kepada peranti tangkapan audio tanpa gesaan</translation> +<translation id="1613574633990410986">Membolehkan anda menentukan pelayan proksi yang digunakan oleh <ph name="PRODUCT_NAME" /> dan apl ARC serta menghalang pengguna daripada menukar tetapan proksi. + + Jika anda memilih untuk tidak akan menggunakan pelayan proksi dan sentiasa menyambung secara terus, semua pilihan akan diabaikan. + + Jika anda memilih untuk mengesan pelayan proksi secara automatik, semua pilihan lain akan diabaikan. + + Untuk melihat contoh terperinci, lawati: + <ph name="PROXY_HELP_URL" /> + + Jika anda mendayakan tetapan ini, <ph name="PRODUCT_NAME" /> dan apl ARC mengabaikan semua pilihan berkaitan proksi yang ditentukan daripada baris perintah. + + Apabila dasar ini tidak ditetapkan, pengguna akan dibenarkan untuk memilih sendiri tetapan proksi mereka.</translation> <translation id="1617235075406854669">Dayakan pemadaman sejarah penyemak imbas dan muat turun</translation> <translation id="1617384279878333801">Dayakan tambah orang dalam pengurus profil</translation> <translation id="1655229863189977773">Tetapkan saiz cache cakera dalam bait</translation> @@ -240,6 +252,15 @@ Jika anda melumpuhkan tetapan ini, apabila pengguna melaksanakan tindakan yang akan mengancam dialog pemilihan fail (seperti mengimport penanda halaman, memuat naik fail, menyimpan pautan, dsb.), mesej akan dipaparkan sebagai ganti dan pengguna dianggap telah mengklik Batal pada dialog pemilihan fail. Jika tetapan ini tidak ditetapkan, penggguna boleh membuka dialog pemilihan fail seperti biasa.</translation> +<translation id="1879485426724769439">Menentukan zon waktu yang hendak digunakan untuk peranti. Pengguna boleh menolak zon waktu yang ditentukan untuk sesi semasa. Namun, peranti akan ditetapkan semula kepada zon waktu yang ditentukan apabila anda log keluar. Jika nilai yang tidak sah diberikan, dasar ini masih akan diaktifkan menggunakan "GMT" sebagai ganti. Dasar ini akan dibatalkan jika rentetan yang kosong diberikan. + + Jika dasar ini tidak digunakan, zon waktu yang sedang aktif akan terus digunakan, namun begitu, pengguna boleh menukar zon waktu dan perubahan ini berterusan. Oleh itu, perubahan yang dibuat oleh seorang pengguna memberi kesan kepada skrin log masuk dan semua pengguna lain. + + Peranti baharu bermula dengan zon waktu yang ditetapkan kepada "AS/Pasifik". + + Format nilai mengikut nama zon waktu dalam "Pangkalan Data Zon Waktu IANA" (lihat "https://en.wikipedia.org/wiki/Tz_database"). Secara khususnya, kebanyakan zon waktu boleh dirujuk mengikut "continent/large_city" atau "ocean/large_city". + + Zon waktu automatik yang diselesaikan oleh lokasi peranti akan dilumpuhkan sepenuhnya apabila dasar ini ditetapkan. Dasar ini turt mengatasi dasar overrides SystemTimezoneAutomaticDetection.</translation> <translation id="1897365952389968758">Benarkan semua tapak untuk menjalankan JavaScript</translation> <translation id="193259052151668190">Senarai putih peranti boleh tanggal USB</translation> <translation id="1933378685401357864">Imej hias latar</translation> @@ -643,6 +664,24 @@ <translation id="3072847235228302527">Tetapkan Syarat Perkhidmatan untuk akaun setempat peranti</translation> <translation id="3096595567015595053">Senarai pemalam yang didayakan</translation> <translation id="3101501961102569744">Pilih cara untuk menentukan tetapan pelayan proksi</translation> +<translation id="3125884964575432854">Membolehkan anda menentukan pelayan proksi yang digunakan oleh <ph name="PRODUCT_NAME" /> dan apl ARC serta menghalang pengguna daripada menukar tetapan proksi. + + Jika anda memilih untuk tidak akan menggunakan pelayan proksi dan sentiasa menyambung secara terus, semua pilihan akan diabaikan. + + Jika anda memilih untuk menggunakan tetapan proksi sistem, semua pilihan lain diabaikan. + + Jika anda memilih untuk mengesan pelayan proksi secara automatik, semua pilihan lain akan diabaikan. + + Jika anda memilih mod proksi pelayan tetap, anda boleh menentukan pilihan lanjut dalam 'Alamat atau URL pelayan proksi' dan 'Senarai peraturan pintasan proksi yang dipisahkan koma'. Apl ARC hanya akan menggunakan pelayan proksi HTTP dengan keutamaan tertinggi. + + Jika anda memilih untuk menggunakan skrip proksi .pac, anda mesti menentukan URL ke skrip itu dalam 'URL ke fail .pac proksi'. + + Untuk melihat contoh terperinci, lawati: + <ph name="PROXY_HELP_URL" /> + + Jika anda mendayakan tetapan ini, <ph name="PRODUCT_NAME" /> dan apl ARC mengabaikan semua pilihan berkaitan proksi yang ditentukan daripada baris perintah. + + Apabila dasar ini tidak ditetapkan, pengguna akan dibenarkan untuk memilih sendiri tetapan proksi mereka.</translation> <translation id="3153348162326497318">Membolehkan anda menentukan sambungan yang TIDAK boleh dipasang oleh pengguna. Sambungan yang telah dipasang akan dialih keluar jika telah disenaraihitamkan. Nilai senarai hitam '*' bermaksud semua sambungan telah disenaraihitamkan kecuali ia disenaraikan dengan jelas dalam senarai putih. @@ -719,6 +758,20 @@ Jika dasar ini dibiarkan tanpa ditetapkan, nilai lalai global akan digunakan untuk semua tapak, sama ada daripada dasar 'DefaultKeygenSetting' jika ditetapkan atau konfigurasi peribadi pengguna jika tidak ditetapkan.</translation> <translation id="3381968327636295719">Gunakan penyemak imbas hos secara lalai</translation> +<translation id="3398137877608138703">Benarkan atau tolak rakaman video. + + Jika didayakan atau tiak dikonfigurasikan (lalai), pengguna akan digesa supaya memberikan + akses rakaman video kecuali untuk URL yang dikonfigurasi dalam + senarai VideoCaptureAllowedUrls yang akan diberikan akses tanpa memberi gesaan. + Apl ARC akan dapat mengakses kamera jika telah diberikan + kebenaran. + + Apabila dasar ini dilumpuhkan, pengguna tidak akan digesa dan rakaman + video hanya tersedia untuk URL yang dikonfigurasi dalam VideoCaptureAllowedUrls. + Apl ARC tidak akan dapat mengakses kamera. + + Di luar apl ARC, dasar ini memberi kesan kepada semua jenis input video + dan bukan sahaja kamera terbina dalam.</translation> <translation id="3417418267404583991">Jika dasar ini ditetapkan kepada benar atau tidak dikonfigurasi, <ph name="PRODUCT_OS_NAME" /> akan mendayakan log masuk tetamu. Log masuk tetamu adalah sesi pengguna tanpa nama dan tidak memerlukan kata laluan. Jika dasar ini ditetapkan kepada palsu, <ph name="PRODUCT_OS_NAME" /> tidak akan membenarkan sesi tetamu dimulakan.</translation> @@ -736,6 +789,8 @@ <translation id="3478024346823118645">Hapuskan data pengguna semasa log keluar</translation> <translation id="348495353354674884">Dayakan papan kekunci maya</translation> <translation id="3496296378755072552">Pengurus kata laluan</translation> +<translation id="349667858031092827">Jangan sekali-kali kesan zon waktu secara automatik.</translation> +<translation id="350443680860256679">Konfigurasi ARC</translation> <translation id="3504791027627803580">Menentukan URL enjin carian yang digunakan untuk menyediakan carian imej. Permintaan carian akan dihantar menggunakan kaedah GET. Sebaliknya, jika dasar DefaultSearchProviderImageURLPostParams ditetapkan, maka permintaan carian imej akan menggunakan kaedah POST. Dasar ini tidak wajib. Jika tidak ditetapkan, tiada carian imej akan digunakan. @@ -752,11 +807,11 @@ Nilai dasar perlu ditetapkan dalam milisaat. Nilai dibataskan kepada julat 30 saat sehingga 24 jam.</translation> <translation id="3528000905991875314">Dayakan halaman ralat ganti</translation> -<translation id="3538538104630456270">Tetapan yang berkaitan telah digunakan sebelum pengesahan semula bagi melihat kata laluan diperkenalkan. Sejak itu, tetapan dan dasar ini tidak memberi kesan terhadap tingkah laku Chrome. Kini, tingkah laku semasa Chrome adalah sama seperti jika dasar ditetapkan untuk melumpuhkan daripada menunjukkan kata laluan dalam teks yang jelas dalam halaman tetapan pengurus kata laluan. Ini bermakna halaman tetapan hanya mengandungi pemegang tempat dan Chrome menunjukkan kata laluan hanya apabila pengguna mengklik "Tunjukkan" (dan melakukan pengesahan semula jika berkenaan). Perihalan asal adalah seperti d bawah. +<translation id="3538538104630456270">Tetapan yang berkaitan telah digunakan sebelum pengesahan semula bagi melihat kata laluan diperkenalkan. Sejak itu, tetapan dan dasar ini tidak memberi kesan terhadap gelagat Chrome. Kini, gelagat semasa Chrome adalah sama seperti jika dasar ditetapkan untuk melumpuhkan paparan kata laluan dalam teks yang jelas dalam halaman tetapan pengurus kata laluan. Ini bermakna halaman tetapan hanya mengandungi pemegang tempat dan Chrome menunjukkan kata laluan hanya apabila pengguna mengklik "Tunjukkan" (dan melakukan pengesahan semula jika berkenaan). Perihalan asal adalah seperti d bawah. Mengawal sama ada pengguna boleh menunjukkan kata laluan dalam teks jelas dalam pengurus kata laluan. - Jika anda melumpuhkan tetapan ini, pengurus kata laluan tidak membenarkan anda menunjukkna kata laluan yang disimpan dalam teks yang jelas dalam tetingkap pengurus kata laluan. + Jika anda melumpuhkan tetapan ini, pengurus kata laluan tidak membenarkan anda menunjukkan kata laluan yang disimpan dalam teks yang jelas dalam tetingkap pengurus kata laluan. Jika anda mendayakan atau tidak menetapkan dasar ini, pengguna boleh melihat kata laluan mereka dalam teks yang jelas dalam pengurus kata laluan.</translation> <translation id="3547954654003013442">Tetapan proksi</translation> @@ -885,6 +940,22 @@ Jika dasar ini ditetapkan kepada 'Keep cookies for the duration of the session', maka kuki akan dikosongkan apabila sesi ditutup. Beri perhatian bahawa jika <ph name="PRODUCT_NAME" /> sedang dijalankan dalam 'background mode', sesi itu mungkin tidak ditutup apabila tetingkap terakhir ditutup. Sila lihat dasar 'BackgroundModeEnabled' untuk mendapatkan maklumat lanjut tentang mengkonfigurasi gelagat ini. Jika dasar ini dibiarkan tanpa ditetapkan, 'AllowCookies' akan digunakan dan pengguna akan dapat mengubahnya.</translation> +<translation id="4098957623809244159">Dasar ini telah ditamatkan, gunakan ProxyMode sebagai ganti. + + Membolehkan anda menentukan pelayan proksi yang digunakan oleh <ph name="PRODUCT_NAME" /> dan apl ARC serta menghalang pengguna daripada menukar tetapan proksi. + + Jika anda memilih untuk tidak akan menggunakan pelayan proksi dan sentiasa menyambung secara terus, semua pilihan akan diabaikan. + + Jika anda memilih untuk menggunakan tetapan proksi sistem atau kesan pelayan proksi secara automatik, semua pilihan lain diabaikan. + + Jika anda memilih tetapan proksi manual, anda boleh menentukan pilihan lanjut dalam ''Alamat atau URL pelayan proksi', ''URL ke fail .pac proksi' dan ''Senarai peraturan pintasan proksi yang dipisahkan koma'. + + Untuk melihat contoh terperinci, lawati: + <ph name="PROXY_HELP_URL" /> + + Jika anda mendayakan tetapan ini, <ph name="PRODUCT_NAME" /> mengabaikan semua pilihan berkaitan proksi yang ditentukan daripada baris perintah. + + Apabila dasar ini tidak ditetapkan, pengguna akan dibenarkan untuk memilih sendiri tetapan proksi mereka.</translation> <translation id="4103289232974211388">Ubah hala ke SAML IdP selepas pengesahan pengguna</translation> <translation id="410478022164847452">Menyatakan panjang masa tanpa input pengguna dan tindakan melahu akan dilaksanakan selepas tamat masa tersebut apabila dijalan dengan kuasa AC. @@ -1365,6 +1436,14 @@ <translation id="5893553533827140852">Jika tetapan ini didayakan, maka permintaan pengesahan gnubby akan diproksikan merentas sambungan hos jauh. Jika tetapan ini dilumpuhkan atau tidak dikonfigurasikan, permintaan pengesahan gnubby tidak akan diproksikan.</translation> +<translation id="5900959132054596599"><ph name="PRODUCT_NAME" /> dan apl ARC akan melangkau mana-mana proksi untuk senarai hos yang dinyatakan di sini. + + Dasar ini hanya berkuat kuasa jika anda telah memilih tetapan proksi manual di 'Pilih cara untuk menentukan tetapan pelayan proksi'. + + Anda harus membiarkan dasar ini tanpa ditetapkan jika anda telah memilih mana-mana mod lain untuk menetapkan dasar proksi. + + Untuk melihat contoh terperinci, lawati: + <ph name="PROXY_HELP_URL" /></translation> <translation id="5921713479449475707">Benarkan muat turun auto kemas kini melalui HTTP</translation> <translation id="5921888683953999946">Tetapkan keadaan lalai ciri kebolehcapaian kursor besar pada skrin log masuk. @@ -1516,6 +1595,7 @@ <translation id="637934607141010488">Laporkan senarai pengguna peranti yang telah log masuk baru-baru ini. Jika dasar ini tidak ditetapkan atau ditetapkan kepada tidak benar, pengguna tidak akan dilaporkan.</translation> +<translation id="639009029157091157">Biarkan pengguna membuat keputusan.</translation> <translation id="6392973646875039351">Mendayakan ciri Auto Isi <ph name="PRODUCT_NAME" /> dan membolehkan pengguna melengkapkan borang web secara automatik dengan menggunakan maklumat yang disimpan sebelum ini seperti alamat atau maklumat kad kredit. Jika anda melumpuhkan tetapan ini, Auto Isi tidak akan boleh diakses oleh pengguna. @@ -1781,11 +1861,6 @@ Jika dasar "RestoreOnStartup" ditetapkan untuk memulihkan URL daripada sesi sebelumnya, dasar ini tidak akan dilaksanakan dan kuki akan disimpan secara kekal untuk tapak tersebut.</translation> <translation id="7207095846245296855">Paksa Google SafeSearch</translation> -<translation id="7213425178181578730">Jika dasar ini ditetapkan kepada salah, <ph name="PRODUCT_OS_NAME" /> akan melumpuhkan Bluetooth dan pengguna tidak akan dapat mendayakannya semula. - - Jika dasar ini ditetapkan kepada benar atau dibiarkan tidak ditetapkan, pengguna akan dapat mendayakan atau melumpuhkan Bluetooth semahunya. - - Jika dasar ini ditetapkan, pengguna tidak boleh mengubah atau membatalkannya.</translation> <translation id="7216442368414164495">Benarkan pengguna ikut serta untuk pelaporan lanjutan Penyemakan Imbas Selamat</translation> <translation id="7227967227357489766">Mentakrifkan senarai pengguna yang dibenarkan untuk log masuk ke peranti. Masukan ialah dalam bentuk <ph name="USER_WHITELIST_ENTRY_FORMAT" />, seperti <ph name="USER_WHITELIST_ENTRY_EXAMPLE" />. Untuk membenarkan pengguna rambang pada domain, gunakan masukan dalam bentuk <ph name="USER_WHITELIST_ENTRY_WILDCARD" />. @@ -1894,6 +1969,9 @@ Jika tetapan ini dilumpuhkan atau tidak dikonfigurasi, <ph name="PRODUCT_NAME" /> menggunakan sama ada penempatan pilihan yang ditentukan pengguna (jika dikonfigurasi), penempatan sistem atau penempatan bertahan 'en-US'.</translation> <translation id="7651739109954974365">Menentukan sama ada data perayauan perlu didayakan untuk peranti. Jika ditetapkan kepada benar, perayauan data dibenarkan. Jika dibiarkan tanpa dikonfigurasi atau ditetapkan kepada palsu, perayauan data tidak akan tersedia.</translation> +<translation id="7667184304362487902">Mengkonfigurasi tetapan proksi untuk <ph name="PRODUCT_NAME" /> dan apl ACR. + + Dasar ini belum sedia untuk digunakan lagi, jangan gunakannya.</translation> <translation id="76810863974142048">URL di mana pelanggan akses jauh harus mendapatkan token pengesahan mereka. Jika dasar ini ditetapkan, hos akses jauh memerlukan pelanggan yang mengesahkan supaya mendapatkan token pengesahan daripada URL ini agar dapat menyambung. Hendaklah digunakan bersama dengan RemoteAccessHostTokenValidationUrl. @@ -1968,6 +2046,19 @@ <translation id="7848840259379156480">Membenarkan anda untuk mengkonfigurasi pemapar HTML lalai apabila <ph name="PRODUCT_FRAME_NAME" /> dipasang. Tetapan lalai adalah untuk membenarkan hos penyemak imbas melakukan paparan, tetapi anda boleh memilih untuk membatalkan ini dan mengaturkan supaya <ph name="PRODUCT_FRAME_NAME" /> memaparkan halaman HTML secara lalai.</translation> +<translation id="7853178359124471330">Apabila dasar ini ditetapkan, aliran pengesanan zon waktu automatik akan menjadi satu daripada cara berikut bergantung pada nilai tetapan: + + Jika ditetapkan kepada TimezoneAutomaticDetectionUsersDecide, pengguna akan dapat mengawal pengesanan zon waktu automatik menggunakan kawalan biasa dalam chrome://settings. + + Jika ditetapkan kepada TimezoneAutomaticDetectionDisabled, kawalan zon waktu automatik dalam chrome://settings akan dilumpuhkan. Pengesanan zon waktu automatik akan sentiasa dimatikan. + + Jika ditetapkan kepada TimezoneAutomaticDetectionIPOnly, kawalan zon waktu dalam chrome://settings akan dilumpuhkan. Pengesanan zon waktu automatik akan sentiasa dihidupkan. Pengesanan zon waktu akan menggunakan kaedah IP sahaja untuk menyelesaikan lokasi. + + Jika ditetapkan kepada TimezoneAutomaticDetectionSendWiFiAccessPoints, kawalan zon waktu dalam chrome://settings akan dilumpuhkan. Pengesanan zon waktu automatik akan sentiasa dihidupkan. Senarai pusat akses Wi-Fi yang kelihatan akan sentiasa dihantar ke pelayan API Geolokasi untuk pengesanan zon waktu yang terperinci. + + Jika dasar ini tidak ditetapkan, dasar ini akan berkelakuan seolah-olah TimezoneAutomaticDetectionUsersDecide ditetapkan. + + Jika dasar SystemTimezone ditetapkan, dasar tersebut akan melangkau dasar ini. Dalam hal ini, pengesanan zon waktu automatik dilumpuhkan sepenuhnya.</translation> <translation id="7882585827992171421">Dasar ini aktif dalam mod runcit sahaja. Menentukan id sambungan untuk digunakan sebagai penyelamat skrin pada skrin log masuk. Sambungan mestilah sebahagian daripada AppPack yang dikonfigurasikan untuk domain ini melalui dasar DeviceAppPack.</translation> @@ -2010,6 +2101,7 @@ Jika dasar ini tidak ditetapkan, tetapan akan didayakan.</translation> <translation id="8073243368829195">Membenarkan Smart Lock digunakan</translation> +<translation id="8074052133552427532">Sentiasa gunakan pengesanan zon waktu kasar.</translation> <translation id="8099880303030573137">Kelewatan melahu apabila dijalankan dengan kuasa bateri</translation> <translation id="8102913158860568230">Tetapan mediastream lalai</translation> <translation id="8104962233214241919">Memilih sijil klien secara automatik untuk tapak ini</translation> @@ -2125,6 +2217,7 @@ <translation id="8424255554404582727">Tetapkan putaran paparan lalai yang digunakan semula pada setiap but semula</translation> <translation id="8426231401662877819">Putar skrin 90 darjah mengikut arah jam</translation> <translation id="8451988835943702790">Gunakan Halaman Tab Baharu sebagai halaman utama</translation> +<translation id="8458790683633857482">Menentukan set dasar yang akan diserahkan kepada masa jalanan ARC. Nilainya mestilah JSON sah.</translation> <translation id="8465065632133292531">Parameter untuk URL semerta yang menggunakan POST</translation> <translation id="847472800012384958">Jangan benarkan mana-mana tapak untuk menunjukkan pop muncul</translation> <translation id="8477885780684655676">TLS 1.0</translation> @@ -2267,9 +2360,12 @@ Jika dasar ini ditetapkan kepada palsu, pengguna mahupun mana-mana apl atau sambungan tidak boleh memasuki mod skrin penuh. Pada semua platform kecuali <ph name="PRODUCT_OS_NAME" />, mod kios tiada apabila mod skrin penuh dilumpuhkan.</translation> +<translation id="8795495354632096254">Sentiasa hantar pusat akses Wi-Fi ke pelayan semasa menyelesaikan zon waktu.</translation> <translation id="8818173863808665831">Laporkan lokasi geografi peranti. Jika dasar ini tidak ditetapkan atau ditetapkan kepada palsu, lokasi tersebut tidak akan dilaporkan.</translation> +<translation id="8818768076343557335">Ramal tindakan rangkaian pada mana-mana rangkaian yang bukan selular. + (Ditamatkan dalam 50, dialih keluar dalam 52. Selepas 52, jika nilai 1 ditetapkan, nilai ini akan dianggap sebagai 0 - ramal tindakan rangkaian pada mana-mana sambungan rangkaian.)</translation> <translation id="8828766846428537606">Menkonfigurasi halaman utama lalai dalam <ph name="PRODUCT_NAME" /> dan menghalang pengguna daripada mengubahnya. Tetapan halaman utama pengguna hanya dikunci sepenuhnya, jika anda memilih halaman utama sebagai halaman tab baharu atau pun menetapkannya sebagai URL dan menetapkan URL halaman utama. Jika anda tidak menetapkan URL halaman utama, maka pengguna masih boleh menetapkan halaman utama kepada halaman tab baharu dengan menetapkan 'chrome://newtab'.</translation> @@ -2331,6 +2427,7 @@ <translation id="9042911395677044526">Membenarkan penolakan konfigurasi rangkaian digunakan untuk setiap pengguna pada peranti <ph name="PRODUCT_OS_NAME" />. Konfigurasi rangkaian ialah rentetan berformat JSON seperti yang ditakrifkan oleh format Konfigurasi Rangkaian Terbuka yang dihuraikan di <ph name="ONC_SPEC_URL" /></translation> <translation id="9084985621503260744">Menyatakan sama ada aktiviti video menjejaskan pengurusan kuasa</translation> <translation id="9088433379343318874">Dayakan penyedia kandungan pengguna di bawah seliaan</translation> +<translation id="9088444059179765143">Konfigurasi kaedah pengesanan zon waktu automatik</translation> <translation id="9096086085182305205">Senarai putih pelayan pengesahan</translation> <translation id="9098553063150791878">Dasar untuk pengesahan HTTP</translation> <translation id="9104138886225968319">Hantar degupan jantung pemantauan ke pelayan pengurusan, untuk membenarkan
diff --git a/components/policy/resources/policy_templates_nl.xtb b/components/policy/resources/policy_templates_nl.xtb index 14682bd..b769a16 100644 --- a/components/policy/resources/policy_templates_nl.xtb +++ b/components/policy/resources/policy_templates_nl.xtb
@@ -741,7 +741,7 @@ De beleidswaarde moet worden opgegeven in milliseconden. Waarden worden afgerond tot een bereik van 30 seconden tot 24 uur.</translation> <translation id="3528000905991875314">Alternatieve foutpagina's inschakelen</translation> -<translation id="3538538104630456270">De bijbehorende instelling werd gebruikt voordat hernieuwde verificatie voor het weergeven van wachtwoorden werd geïntroduceerd. Sindsdien hebben de instelling en dit beleid geen invloed gehad op het gedrag van Chrome. Het huidige gedrag van Chrome is nu gelijk aan het gedrag als het beleid was ingesteld om het weergeven van wachtwoorden als leesbare tekst op de pagina met instellingen voor Wachtwoordbeheer uit te schakelen. Dat betekent dat de pagina met instellingen alleen een tijdelijke aanduiding bevat. Chrome laat het wachtwoord alleen zien als de gebruiker op Weergeven klikt (en zo nodig de hernieuwde verificatie uitvoert). De oorspronkelijke beschrijving van het beleid volgt hieronder. +<translation id="3538538104630456270">De bijbehorende instelling werd gebruikt voordat hernieuwde verificatie voor het weergeven van wachtwoorden werd geïntroduceerd. Sindsdien hebben de instelling en dit beleid geen invloed gehad op het gedrag van Chrome. Het huidige gedrag van Chrome is nu hetzelfde alsof het beleid was ingesteld om het weergeven van wachtwoorden als leesbare tekst op de pagina met instellingen voor Wachtwoordbeheer uit te schakelen. Dat betekent dat de pagina met instellingen alleen een tijdelijke aanduiding bevat. Chrome laat het wachtwoord alleen zien als de gebruiker op Weergeven klikt (en zo nodig de hernieuwde verificatie uitvoert). De oorspronkelijke beschrijving van het beleid volgt hieronder. Hiermee wordt bepaald of de gebruiker wachtwoorden als leesbare tekst mag weergeven in Wachtwoordbeheer. @@ -1762,11 +1762,6 @@ Als het beleid 'RestoreOnStartup' zo is ingesteld dat URL's van eerdere sessies worden hersteld, geldt dit beleid niet en worden cookies voor deze sites permanent opgeslagen.</translation> <translation id="7207095846245296855">Google SafeSearch afdwingen</translation> -<translation id="7213425178181578730">Bluetooth wordt uitgeschakeld in <ph name="PRODUCT_OS_NAME" /> als dit beleid is ingesteld op 'onwaar' en de gebruiker kan deze niet opnieuw inschakelen. - - De gebruiker kan Bluetooth naar wens in- en uitschakelen als dit beleid is ingesteld op 'waar' of niet is ingesteld. - - De gebruiker kan dit beleid niet wijzigen of overschrijven als dit is ingesteld.</translation> <translation id="7216442368414164495">Hiermee kunnen gebruikers zich aanmelden voor uitgebreide rapportage van Safe Browsing</translation> <translation id="7227967227357489766">Hiermee definieer je de lijst met gebruikers die toestemming hebben om in te loggen bij het apparaat. Vermeldingen hebben de vorm <ph name="USER_WHITELIST_ENTRY_FORMAT" />, zoals <ph name="USER_WHITELIST_ENTRY_EXAMPLE" />. Als je willekeurige gebruikers toegang wilt verlenen tot een domein, gebruik je vermeldingen in de vorm <ph name="USER_WHITELIST_ENTRY_WILDCARD" />.
diff --git a/components/policy/resources/policy_templates_no.xtb b/components/policy/resources/policy_templates_no.xtb index 69aac4d8..95f9d96 100644 --- a/components/policy/resources/policy_templates_no.xtb +++ b/components/policy/resources/policy_templates_no.xtb
@@ -720,13 +720,13 @@ Verdien for innstillingen må spesifiseres i millisekunder. Verdier settes innenfor et spenn fra 30 sekunder til 24 timer.</translation> <translation id="3528000905991875314">Aktiver alternative feilsider</translation> -<translation id="3538538104630456270">Den tilknyttede innstillingen ble brukt før vi implementerte ny autentisering for visning av passord. Etter dette har ikke innstillingen – og dermed heller ikke denne retningslinjen – hatt noen innvirkning på atferden til Chrome. Den nåværende atferden til Chrome er den samme som hvis retningslinjen hadde vært konfigurert til å slå av visningen av passord i klartekst på innstillingssiden i passordbehandlingen. Det betyr at innstillingssiden bare har en plassholder, og brukeren må klikke på «Vis» (og eventuelt utføre en ny autentisering) for å se passordet i Chrome. Den originale beskrivelsen av retningslinjen er som følger. +<translation id="3538538104630456270">Den tilknyttede innstillingen ble brukt før vi implementerte ny autentisering for visning av passord. Etter dette har ikke innstillingen – og dermed heller ikke denne regenel – hatt noen innvirkning på funksjonaliteten i Chrome. Den nåværende funksjonaliteten i Chrome er den samme som hvis denne regelen hadde vært konfigurert til å slå av visning av passord i klartekst på innstillingssiden i passordbehandlingen. Det betyr at innstillingssiden bare har en plassholder, og brukeren må klikke på «Vis» (og eventuelt utføre en ny autentisering) for å se passordet i Chrome. Den originale beskrivelsen av regelen er som følger. - Kontrollerer om brukeren kan vise passord i klartekst i passordbehandlingen. + Kontrollerer hvorvidt brukeren kan vise passord i klartekst i passordbehandlingen. - Hvis du deaktiverer denne innstillingen, tillater ikke passordbehandlingen at lagrede passord vises i klartekst i vinduet til passordbehandlingen. + Hvis du slår av denne innstillingen, tillater ikke passordbehandlingen at lagrede passord vises i klartekst i vinduet til passordbehandlingen. - Hvis du aktiverer eller ikke angir denne retningslinjen, kan brukerne se passordene i klartekst i passordbehandlingen.</translation> + Hvis du slår på eller ikke angir denne regelen, kan brukerne se passordene i klartekst i passordbehandlingen.</translation> <translation id="3547954654003013442">Innstillinger for proxy-tjener</translation> <translation id="3570008976476035109">Blokkér programtillegg på disse nettstedene</translation> <translation id="3591584750136265240">Konfigurer autentiseringsatferden ved pålogging</translation> @@ -1695,7 +1695,7 @@ Hvis denne innstillingen ikke angis, kan brukeren endre listen over programmer som er festet i programlisten.</translation> <translation id="7132877481099023201">Nettadresser som uten forespørsel blir gitt tilgang til enheter med videoopptak</translation> -<translation id="7167436895080860385">Gi brukere tillatelse til å se passord i passordbehandlingen</translation> +<translation id="7167436895080860385">Gi brukere tillatelse til å se passord i passordbehandlingen (avviklet)</translation> <translation id="7173856672248996428">Midlertidig profil</translation> <translation id="7187256234726597551">Hvis angitt til «true», tillates ekstern bekreftelse for enheten, og et sertifikat genereres automatisk og lastes opp til administreringstjeneren for enheten. @@ -1717,11 +1717,6 @@ Hvis «RestoreOnStartup»-regelen er konfigurert til å gjenopprette nettadressene fra forrige økt, overstyrer den denne regelen, og informasjonskapslene for slike nettsteder lagres permanent.</translation> <translation id="7207095846245296855">Fremtving bruk av Google Sikkert Søk</translation> -<translation id="7213425178181578730">Hvis denne regelen er satt til «false» (usann), slår <ph name="PRODUCT_OS_NAME" /> av Bluetooth, og brukeren kan ikke slå det på igjen. - - Hvis denne regelen settes til «true» (sann) eller ikke angis, kan brukeren slå Bluetooth på eller av etter eget ønske. - - Hvis denne regelen er angitt, kan ikke brukeren endre den eller overstyre den.</translation> <translation id="7216442368414164495">Tillat at brukere velger utvidet rapportering for sikker surfing</translation> <translation id="7227967227357489766">Definerer listen over brukere som kan logge seg på enheten. Oppføringer har formatet <ph name="USER_WHITELIST_ENTRY_FORMAT" />, som for eksempel <ph name="USER_WHITELIST_ENTRY_EXAMPLE" />. Hvis du vil tillate vilkårlige brukere på domenet, må oppføringer bruke formatet <ph name="USER_WHITELIST_ENTRY_WILDCARD" />. @@ -2200,7 +2195,7 @@ <translation id="8870318296973696995">Startside</translation> <translation id="8889588091638298603">Med Quirks Server får du konfigurasjonsfiler som er spesifikke for ulike typer maskinvare, for eksempel ICC-visningsprofiler du kan bruke for å justere - skjermkalibreringer. + skjermkalibrering. Når denne retningslinjen er satt til «false» (usann), prøver ikke enheten å kontakte Quirks Server for å laste ned konfigurasjonsfiler.
diff --git a/components/policy/resources/policy_templates_pl.xtb b/components/policy/resources/policy_templates_pl.xtb index be4a5587..08111a5f 100644 --- a/components/policy/resources/policy_templates_pl.xtb +++ b/components/policy/resources/policy_templates_pl.xtb
@@ -1600,11 +1600,6 @@ Jeśli zgodnie z ustawieniem zasady RestoreOnStartup adresy URL z poprzednich sesji mają być wznawiane, ta zasada nie będzie przestrzegana, a pliki cookie witryn będą trwale zapisywane.</translation> <translation id="7207095846245296855">Wymuś stosowanie filtra Google SafeSearch</translation> -<translation id="7213425178181578730">Jeśli ta zasada ma wartość Fałsz, <ph name="PRODUCT_OS_NAME" /> wyłącza moduł Bluetooth i użytkownik nie może włączyć go ponownie. - - Jeśli zasada ma wartość Prawda lub nie ma wartości, użytkownik może swobodnie włączać i wyłączać moduł Bluetooth. - - Jeśli ustawisz wartość tej zasady, użytkownik nie może jej zmienić ani zastąpić.</translation> <translation id="7216442368414164495">Umożliwia użytkownikom wyrażenie zgody na generowanie rozszerzonych raportów przez usługę Bezpieczne przeglądanie</translation> <translation id="7227967227357489766">Określa listę użytkowników, którzy mogą logować się do urządzenia. Pozycje mają postać <ph name="USER_WHITELIST_ENTRY_FORMAT" />, np. <ph name="USER_WHITELIST_ENTRY_EXAMPLE" />. Aby zezwolić na logowanie dowolnym użytkownikom z domeny, użyj wpisów w postaci <ph name="USER_WHITELIST_ENTRY_WILDCARD" />.
diff --git a/components/policy/resources/policy_templates_pt-BR.xtb b/components/policy/resources/policy_templates_pt-BR.xtb index 5285cbe2..04a84c0ef 100644 --- a/components/policy/resources/policy_templates_pt-BR.xtb +++ b/components/policy/resources/policy_templates_pt-BR.xtb
@@ -142,6 +142,18 @@ <translation id="1561424797596341174">A política modifica as versões de depuração do host de acesso remoto</translation> <translation id="1583248206450240930">Usar o <ph name="PRODUCT_FRAME_NAME" /> por padrão</translation> <translation id="1608755754295374538">URLs que terão acesso a dispositivos de captura de áudio sem solicitação</translation> +<translation id="1613574633990410986">Permite que você especifique o servidor proxy usado pelo <ph name="PRODUCT_NAME" /> e por apps ARC e impede que os usuários alterem as configurações de proxy. + + Se você optar por nunca usar um servidor proxy e sempre conectar-se diretamente, todas as outras opções serão ignoradas. + + Se você optar pela detecção automática do servidor proxy, todas as outras opções serão ignoradas. + + Para ver exemplos detalhados, visite: + <ph name="PROXY_HELP_URL" /> + + Se você ativar esta configuração, o <ph name="PRODUCT_NAME" /> e os apps ARC ignorarão todas as opções relacionadas ao proxy especificadas na linha de comando. + + Se estas políticas não forem definidas, aos usuários poderão escolher as próprias configurações de proxy.</translation> <translation id="1617235075406854669">Ativar exclusão do histórico do navegador e de downloads</translation> <translation id="1617384279878333801">Ativar a adição de pessoa no gerenciador de perfil</translation> <translation id="1655229863189977773">Define o tamanho do cache de disco em bytes</translation> @@ -201,6 +213,15 @@ <translation id="1865417998205858223">Principais permissões</translation> <translation id="186719019195685253">Ação a ser executada quando o tempo de inatividade for atingido durante operação com alimentação CA</translation> <translation id="187819629719252111">Permite o acesso a arquivos locais na máquina ao possibilitar que <ph name="PRODUCT_NAME" /> exiba caixas de diálogo de seleção de arquivos. Se ativar esta configuração, os usuários poderão abrir as caixas de diálogo de seleção de arquivos normalmente. Se desativar esta configuração, sempre que o usuário executar uma ação que possa gerar uma caixa de diálogo de seleção de arquivos (como importar favoritos, fazer o upload de arquivos, salvar links etc), uma mensagem será exibida em seu lugar, e será considerado como se o usuário houvesse clicado em "Cancelar" na caixa de diálogo de seleção de arquivos. Se esta configuração não for definida, os usuários poderão abrir caixas de diálogo de seleção de arquivos normalmente.</translation> +<translation id="1879485426724769439">Especifica o fuso horário a ser usado para o dispositivo. Os usuários podem substituir o fuso horário especificado para a sessão atual. No entanto, após o logout, o fuso horário especificado é restaurado. Se um valor inválido for fornecido, a política ainda será ativada usando "GMT". Se uma string vazia for fornecida, a política será ignorada. + + Se esta política não for usada, o fuso horário ativo no momento permanecerá em uso. No entanto, os usuários podem alterar o fuso horário, e a alteração é permanente. Assim, uma alteração feita por um usuário afeta a tela de login de todos os outros usuários. + + Dispositivos novos são iniciados com o fuso horário definido como "EUA/Pacífico". + + O formato do valor segue os nomes dos fusos horários do "IANA Time Zone Database" (consulte "https://en.wikipedia.org/wiki/Tz_database", link em inglês). Em particular, a maioria dos fusos horários pode ser referida como "continente/cidade_grande" ou "oceano/cidade_grande". + + A definição desta política desativa completamente a definição automática de fuso horário pelo local do dispositivo. Ela também substitui a política SystemTimezoneAutomaticDetection.</translation> <translation id="1897365952389968758">Permitir que todos os sites executem o JavaScript</translation> <translation id="193259052151668190">Lista de permissões de dispositivos USB removíveis</translation> <translation id="1933378685401357864">Imagem do plano de fundo</translation> @@ -568,6 +589,24 @@ <translation id="3072847235228302527">Definir os Termos de Serviço para uma conta local do dispositivo</translation> <translation id="3096595567015595053">Lista de plug-ins ativados</translation> <translation id="3101501961102569744">Escolher o modo de especificar as configurações do servidor proxy</translation> +<translation id="3125884964575432854">Permite que você especifique o servidor proxy usado pelo <ph name="PRODUCT_NAME" /> e por apps ARC e impede que os usuários alterem as configurações de proxy. + + Se você optar por nunca usar um servidor proxy e sempre conectar-se diretamente, todas as outras opções serão ignoradas. + + Se você optar por usar as configurações de proxy do sistema, todas as outras opções serão ignoradas. + + Se você optar por detectar automaticamente o servidor proxy, todas as outras opções serão ignoradas. + + Se você optar pelo modo de servidor proxy fixo, pode especificar opções adicionais no "Endereço ou URL do servidor proxy" e na "Lista separada por vírgulas das regras de proxies ignoráveis". Apps ARC usarão apenas o servidor proxy HTTP com a maior prioridade. + + Se você optar por usar um script de proxy .pac, precisará especificar o URL do script em "URL de um arquivo proxy .pac". + + Para ver exemplos detalhados, visite: + <ph name="PROXY_HELP_URL" /> + + Se você ativar esta configuração, o <ph name="PRODUCT_NAME" /> e os apps ARC ignorarão todas as opções relacionadas ao proxy especificadas na linha de comando. + + Se esta política não for definida, os usuários poderão escolher as próprias configurações de proxy.</translation> <translation id="3153348162326497318">Permite que você especifique quais extensões os usuários NÃO podem instalar. Extensões já instaladas serão removidas se adicionadas à lista negra. Um valor "*" na lista negra significa que todas as extensões são proibidas a menos que sejam listadas explicitamente na lista de permissões. Se esta política for deixada sem definição, o usuário pode instalar qualquer extensão em <ph name="PRODUCT_NAME" /> .</translation> <translation id="316778957754360075">Esta configuração foi descontinuada a partir da versão 29 do <ph name="PRODUCT_NAME" />. O modo recomendado de configurar as coleções de extensões/aplicativos hospedados pela organização é incluir na hospedagem do site os pacotes CRX em ExtensionInstallSources e colocar links de download direto para os pacotes em uma página da Web. É possível criar um iniciador da página da Web usando a política ExtensionInstallForcelist.</translation> <translation id="3185009703220253572">desde a versão <ph name="SINCE_VERSION" /></translation> @@ -636,6 +675,20 @@ Se esta política não for definida, o valor padrão global será utilizado para todos os sites a partir da política "DefaultKeygenSetting", caso ela tenha sido definida, ou a partir das configurações pessoais do usuário, caso não tenha sido definida.</translation> <translation id="3381968327636295719">Usar o navegador de host por padrão</translation> +<translation id="3398137877608138703">Permitir ou negar capturas de vídeo. + + Se ativada ou não configurada (padrão), o usuário recebe uma solicitação para + acessar a captura de vídeo, exceto no caso de URLs configurados na lista + VideoCaptureAllowedUrls, os quais terão acesso sem solicitação. + Apps ARC terão acesso à câmera caso tenham recebido + permissão. + + Quando esta política está desativada, o usuário nunca recebe uma solicitação, e a captura + de vídeo fica disponível apenas para URLs configurados em VideoCaptureAllowedUrls. + Apps ARC não terão acesso à câmera. + + Fora dos apps ARC, esta política afeta todos os tipos de entradas de vídeo e + não apenas a câmera integrada.</translation> <translation id="3417418267404583991">Se esta política for definida como true ou não for configurada, o <ph name="PRODUCT_OS_NAME" /> permitirá o login de visitantes. Os logins de visitantes são sessões anônimas de usuários e não requerem uma senha. Se esta política for configurada para false, o <ph name="PRODUCT_OS_NAME" /> não permitirá que sejam iniciadas sessões de visitantes.</translation> <translation id="3428247105888806363">Ativar previsão de rede</translation> <translation id="3460784402832014830">Especifica o URL que um mecanismo de busca usa para exibir uma página "Nova guia". @@ -651,6 +704,8 @@ <translation id="3478024346823118645">Limpa os dados do usuário ao sair</translation> <translation id="348495353354674884">Ativar teclado virtual</translation> <translation id="3496296378755072552">Gerenciador de senhas</translation> +<translation id="349667858031092827">Nunca detectar o fuso horário automaticamente.</translation> +<translation id="350443680860256679">Configurar ARC</translation> <translation id="3504791027627803580">Especifica o URL do mecanismo de pesquisa usado para pesquisas de imagens. As solicitações de pesquisa são enviadas com o método GET. Por outro lado, se a política DefaultSearchProviderImageURLPostParams estiver definida, as solicitações de pesquisa de imagens usarão o método POST. Esta política é opcional. Se não estiver definida, nenhuma pesquisa de imagem será usada. @@ -784,6 +839,22 @@ Se esta política é configurada para "Manter cookies enquanto durar a sessão", os cookies são apagados quando a sessão é encerrada. Se o <ph name="PRODUCT_NAME" /> é executado no "modo de segundo plano", é possível que a sessão não seja encerrada quando a última janela é fechada. Consulte a política "BackgroundModeEnabled" para ver mais informações sobre como configurar esse comportamento. Se esta política não é configurada, "AllowCookies" é usada, e o usuário pode alterá-la.</translation> +<translation id="4098957623809244159">O uso desta política foi suspenso. Use ProxyMode em vez dela. + + Permite que você especifique o servidor proxy usado pelo <ph name="PRODUCT_NAME" /> e pelos apps ARC e impede que os usuários alterem as configurações de proxy. + + Se você optar por nunca usar um servidor e sempre conectar diretamente, todas as outras opções serão ignoradas. + + Se você optar por usar as configurações de proxy do sistema ou detectar automaticamente o servidor proxy, todas as outras opções serão ignoradas. + + Se você optar por usar as configurações manuais de proxy, poderá especificar opções adicionais no "Endereço ou URL do servidor proxy", "URL de um arquivo proxy .pac" e "Lista separada por vírgulas das regras proxies ignoráveis". + + Para ver exemplos detalhados, visite: + <ph name="PROXY_HELP_URL" /> + + Se você ativar esta configuração, o <ph name="PRODUCT_NAME" /> ignorará todas as opções relacionadas ao proxy especificadas na linha de comando. + + Se esta política não for definida, os usuários poderão escolher as próprias configurações de proxy.</translation> <translation id="4103289232974211388">Redireciona para IdP de SAML após confirmação do usuário</translation> <translation id="410478022164847452">Especifica depois de quanto tempo de inatividade do usuário é executada a ação de inatividade no funcionamento com alimentação CA. @@ -1203,6 +1274,14 @@ <translation id="5893553533827140852">Quando essa configuração está ativada, as solicitações de autenticação gnubby são transmitidas por proxy por meio de uma conexão de host remoto. Se essa configuração não está ativada ou configurada, as solicitações de autenticação gnubby não são transmitidas por proxy.</translation> +<translation id="5900959132054596599">O <ph name="PRODUCT_NAME" /> e apps ARC ignorarão qualquer proxy para a lista de hosts apresentada aqui. + + Esta política só tem efeito se você selecionou configurações manuais de proxy em "Escolher como especificar as configurações do servidor proxy". + + Você deve deixar esta política sem definição se tiver selecionado qualquer outro modo de definição de políticas de proxy. + + Para ver exemplos mais detalhados, visite: + <ph name="PROXY_HELP_URL" /></translation> <translation id="5921713479449475707">Permitir atualização automática de downloads via HTTP</translation> <translation id="5921888683953999946">Definir o estado padrão do recurso de acessibilidade do cursor grande na tela de login. @@ -1342,6 +1421,7 @@ <translation id="637934607141010488">Informa a lista de usuários do dispositivo que fizeram login recentemente. Se a política for definida como "False", os usuários não serão informados.</translation> +<translation id="639009029157091157">Deixar os usuários decidirem.</translation> <translation id="6392973646875039351">Ativa o recurso de Preenchimento automático do <ph name="PRODUCT_NAME" /> e permite aos usuários utilizarem o preenchimento automático em formulários da web, utlizando as informações previamente armazenadas, como endereço ou informações de cartão de crédito. Se desativar esta configuração, o Preenchimento automático ficará inacessível para os usuários. Se ativar esta configuração ou não configurar um valor, o Preenchimento automático permanecerá sob o controle do usuário. Isso permitirá que ele configure os perfis de Preenchimento automático e ative ou desative o Preenchimento automático como achar conveniente.</translation> <translation id="6394350458541421998">Esta política teve o uso suspenso a partir da versão 29 do <ph name="PRODUCT_OS_NAME" />. Em vez dela, use a política PresentationScreenDimDelayScale.</translation> <translation id="6401669939808766804">Fazer logout do usuário</translation> @@ -1583,11 +1663,6 @@ Se a política "RestoreOnStartup" é definida para recuperar URLs de sessões anteriores, ela não é respeitada, e os cookies desses sites são armazenados permanentemente.</translation> <translation id="7207095846245296855">Forçar o Google SafeSearch</translation> -<translation id="7213425178181578730">Se esta política for definida como false, o <ph name="PRODUCT_OS_NAME" /> desativará o Bluetooth, e o usuário não poderá habilitá-lo novamente. - - Se esta política for definida como true ou não for definida, o usuário conseguirá ativar ou desativar o Bluetooth conforme desejar. - - Se esta política for definida, o usuário não poderá alterar ou modificá-la.</translation> <translation id="7216442368414164495">Permitir que os usuários ativem os relatórios estendidos do Navegação segura</translation> <translation id="7227967227357489766">Define a lista de usuários que têm permissão para fazer login no dispositivo. As entradas são feitas no formato <ph name="USER_WHITELIST_ENTRY_FORMAT" />, como, por exemplo, <ph name="USER_WHITELIST_ENTRY_EXAMPLE" />. Para permitir usuários arbitrários em um domínio, use entradas no formato <ph name="USER_WHITELIST_ENTRY_WILDCARD" />. @@ -1688,6 +1763,9 @@ <translation id="7632724434767231364">Nome da biblioteca GSSAPI</translation> <translation id="7635471475589566552">Configura a localidade do aplicativo em <ph name="PRODUCT_NAME" /> e impede que os usuários a alterem. Se ativar esta configuração, <ph name="PRODUCT_NAME" /> utilizará a localidade especificada. Se a localidade configurada não for compatível, "pt-BR" será utilizada. Se esta configuração for desativada ou não for configurada, <ph name="PRODUCT_NAME" /> utilizará a localidade preferida especificada pelo usuário (se configurada), a localidade do sistema ou a localidade padrão "pt-BR".</translation> <translation id="7651739109954974365">Determina se o roaming de dados deve ser ativado para o dispositivo. Se configurado para true, o roaming de dados será permitido. Se não for configurado ou for configurado como false, o roaming de dados não estará disponível.</translation> +<translation id="7667184304362487902">Define as configurações de proxy para o <ph name="PRODUCT_NAME" /> e apps ARC. + + Esta política ainda não está pronta para uso,. Não a utilize.</translation> <translation id="76810863974142048">URL no qual os clientes de acesso remoto devem conseguir o token de autenticação. Quando esta política é definida, o host de acesso remoto precisa de clientes autenticados para conseguir um token de autenticação desse URL para conectar-se. Deve ser usada juntamente com RemoteAccessHostTokenValidationUrl. @@ -1756,6 +1834,19 @@ <translation id="7842869978353666042">Configurar opções do Google Drive</translation> <translation id="7843525027689416831">Especifica as sinalizações que devem ser aplicadas a <ph name="PRODUCT_NAME" /> quando ele é iniciado. As sinalizações especificadas são aplicadas apenas na tela de login. As sinalizações definidas por esta política não se propagam para as sessões do usuário.</translation> <translation id="7848840259379156480">Permite configurar o renderizador padrão de HTML, quando o <ph name="PRODUCT_FRAME_NAME" /> estiver instalado. A configuração padrão é permitir que o navegador do host faça a renderização, mas você pode, opcionalmente, substituí-la e fazer com que o <ph name="PRODUCT_FRAME_NAME" /> renderize páginas HTML por padrão.</translation> +<translation id="7853178359124471330">Quando esta política está definida, o fluxo de detecção automática de fuso horário acontece em uma das seguintes formas, dependendo do valor da configuração: + + Se definida para TimezoneAutomaticDetectionUsersDecide, os usuários podem controlar a detecção automática de fuso horário usando controles normais em chrome://settings. + + Se definida para TimezoneAutomaticDetectionDisabled, os controles de fuso horário automático em chrome://settings são desativados. A detecção automática de fuso horário fica sempre desativada. + + Se definida para TimezoneAutomaticDetectionIPOnly, os controles de fuso horário em chrome://settings são desativados. A detecção automática de fuso horário fica sempre ativada. A detecção de fuso horário usa o método "somente IP" para determinar o local. + + Se esta política é definida para TimezoneAutomaticDetectionSendWiFiAccessPoints, os controles de fuso horário em chrome://settings são desativados. A detecção automática de fuso horário fica sempre ativada. A lista de pontos de acesso Wi-Fi visíveis é sempre enviada ao servidor da API de geolocalização para ter uma detecção de fuso horário refinada. + + Se esta política não for definida, ela se comportará como se TimezoneAutomaticDetectionUsersDecide estivesse definida. + + Se a política SystemTimezone for definida, ela substituirá esta política. Nesse caso, a detecção automática de fuso horário será completamente desativada.</translation> <translation id="7882585827992171421">Esta política só fica ativada em modo de varejo. Determina a identificação da extensão a ser usada como protetor de tela na tela de login. A extensão deve ser parte do AppPack configurado para este domínio por meio da política DeviceAppPack.</translation> @@ -1793,6 +1884,7 @@ Se essa política não for definida, a configuração será ativada.</translation> <translation id="8073243368829195">Permite o uso do Smart Lock</translation> +<translation id="8074052133552427532">Sempre usar detecção de fuso horário aproximada.</translation> <translation id="8099880303030573137">Intervalo de inatividade no funcionamento com energia da bateria</translation> <translation id="8102913158860568230">Configuração padrão mediastream</translation> <translation id="8104962233214241919">Selecionar certificados de cliente automaticamente para estes sites</translation> @@ -1895,6 +1987,7 @@ <translation id="8424255554404582727">Definir rotação padrão da tela, reaplicada em cada reinicialização</translation> <translation id="8426231401662877819">Girar tela no sentido horário em 90 graus</translation> <translation id="8451988835943702790">Usar a página "Nova guia" como página inicial</translation> +<translation id="8458790683633857482">Especifica um conjunto de políticas que serão entregues ao tempo de execução de ARC. O valor deve ser um JSON válido.</translation> <translation id="8465065632133292531">Parâmetros para URL de instantâneos que usa POST</translation> <translation id="847472800012384958">Não permite que nenhum site exiba pop-ups</translation> <translation id="8477885780684655676">TLS 1.0</translation> @@ -2014,9 +2107,12 @@ Se essa política for definida como "false", nem o usuário nem quaisquer aplicativos ou extensões poderão entrar no modo de tela cheia. Em todas as plataformas, exceto no <ph name="PRODUCT_OS_NAME" />, o modo quiosque fica indisponível quando o modo de tela cheia está desativado.</translation> +<translation id="8795495354632096254">Sempre enviar pontos de acesso Wi-Fi para o servidor ao determinar o fuso horário.</translation> <translation id="8818173863808665831">Informar a localização geográfica do dispositivo. Se a política não for configurada, ou for configurada como falsa, o local não será informado.</translation> +<translation id="8818768076343557335">Prever ações de rede em qualquer rede que não seja a de celular. + Uso suspenso na versão 50 e removido na 52. Depois da versão 52, se o valor 1 for definido, ele será tratado como 0: prever ações de rede em qualquer conexão de rede.</translation> <translation id="8828766846428537606">Configura a página inicial padrão no <ph name="PRODUCT_NAME" /> e impede que os usuários a modifiquem. As configurações da página inicial do usuário só serão completamente bloqueadas, se você selecionar a página inicial para que seja a página "Nova guia" ou configurá-la para que seja um URL e especificar um URL da página inicial. Se você não especificar o URL da página inicial, o usuário ainda poderá definir a página inicial para a página "Nova guia" especificando 'chrome://newtab'.</translation> <translation id="8833109046074170275">Autenticação por fluxo GAIA padrão</translation> <translation id="8838303810937202360">O <ph name="PRODUCT_OS_NAME" /> armazena aplicativos e extensões em cache para a instalação por vários usuários de um único dispositivo a fim de evitar que o download deles seja feito novamente para cada usuário. @@ -2076,6 +2172,7 @@ <translation id="9042911395677044526">Permite aplicar a configuração de rede por usuário de dispositivo <ph name="PRODUCT_OS_NAME" />. A configuração de rede é uma string formatada em JSON, conforme definido pelo formato Open Network Configuration descrito em <ph name="ONC_SPEC_URL" /></translation> <translation id="9084985621503260744">Especifica se a atividade de vídeo afeta o gerenciamento de energia</translation> <translation id="9088433379343318874">Ativar o provedor de conteúdo de usuário supervisionado</translation> +<translation id="9088444059179765143">Configurar o método de detecção automática de fuso horário</translation> <translation id="9096086085182305205">Lista branca do servidor de autenticação</translation> <translation id="9098553063150791878">Políticas para a autenticação HTTP</translation> <translation id="9104138886225968319">Enviar batimentos cardíacos de monitoramento ao servidor de gerenciamento para permitir
diff --git a/components/policy/resources/policy_templates_pt-PT.xtb b/components/policy/resources/policy_templates_pt-PT.xtb index a729ea2..31d930ba4 100644 --- a/components/policy/resources/policy_templates_pt-PT.xtb +++ b/components/policy/resources/policy_templates_pt-PT.xtb
@@ -89,7 +89,7 @@ <translation id="1359553908012294236">Se esta política for definida como verdadeira ou não for configurada, o <ph name="PRODUCT_NAME" /> permite inícios de sessão de convidados. Os inícios de sessão de convidados são perfis do <ph name="PRODUCT_NAME" /> em que todas as janelas estão no modo de navegação anónima. Se esta política for definida como falsa, o <ph name="PRODUCT_NAME" /> não permite que os perfis de convidado sejam iniciados.</translation> -<translation id="1363275621236827384">Ativar consultas ao Servidor Quirks para perfis de hardware</translation> +<translation id="1363275621236827384">Ativar consultas ao Quirks Server para perfis de hardware</translation> <translation id="1397855852561539316">URL de sugestão do fornecedor de pesquisas padrão</translation> <translation id="1398889361882383850">Permite-lhe definir se os Websites têm automaticamente permissão para executar plug-ins. Os plug-ins automaticamente em execução podem ser permitidos para todos os Websites ou negados para todos os Websites. @@ -153,6 +153,18 @@ <translation id="1561424797596341174">Substituições da política para compilações de Depuração do anfitrião de acesso remoto</translation> <translation id="1583248206450240930">Utilizar o <ph name="PRODUCT_FRAME_NAME" /> por predefinição</translation> <translation id="1608755754295374538">URLs aos quais será concedido acesso a dispositivos de captura de áudio imediatamente</translation> +<translation id="1613574633990410986">Permite-lhe especificar o servidor proxy utilizado pelo <ph name="PRODUCT_NAME" /> e pelas aplicações ARC e impede os utilizadores de alterar as definições de proxy. + + Se optar por nunca utilizar um servidor proxy e estabelecer sempre ligação diretamente, todas as outras opções são ignoradas. + + Se optar por detetar automaticamente o servidor proxy, todas as outras opções são ignoradas. + + Para obter exemplos detalhados, aceda a: + <ph name="PROXY_HELP_URL" /> + + Se ativar esta definição, o <ph name="PRODUCT_NAME" /> e as aplicações ARC ignoram todas as opções relacionadas com o proxy especificadas a partir da linha de comandos. + + Se deixar estas políticas por definir, permite que os utilizadores selecionem as definições de proxy conforme pretendam.</translation> <translation id="1617235075406854669">Ativar a eliminação do histórico de transferências e do navegador</translation> <translation id="1617384279878333801">Ativar adicionar pessoa no gestor de perfis</translation> <translation id="1655229863189977773">Definir o tamanho da cache do disco em bytes</translation> @@ -220,6 +232,15 @@ <translation id="1865417998205858223">Autorizações principais</translation> <translation id="186719019195685253">Ação a executar quando o atraso de inatividade é atingido e estiver a ser utilizada a energia CA</translation> <translation id="187819629719252111">Permite aceder a ficheiros locais no computador, ao permitir que o <ph name="PRODUCT_NAME" /> apresente caixas de diálogo de seleção de ficheiros. Se ativar esta definição, os utilizadores poderão abrir caixas de diálogo de seleção de ficheiros normalmente. Se desativar esta definição, sempre que os utilizadores efetuarem uma ação que origine uma caixa de diálogo de seleção de ficheiros (como importar marcadores, carregar ficheiros, guardar links, etc.), aparecerá uma mensagem e assume-se que os utilizadores clicaram em Cancelar na caixa de diálogo. Se esta definição não for definida, os utilizadores poderão abrir as caixas de diálogo de seleção de ficheiros normalmente.</translation> +<translation id="1879485426724769439">Especifica o fuso horário a utilizar para o dispositivo. Os utilizadores podem substituir o fuso horário especificado da sessão atual. Contudo, quando terminam sessão, este regressa ao fuso horário especificado. Se for fornecido um valor inválido, a política ainda é ativada com "GMT" como alternativa. Se for fornecida uma string vazia, a política é ignorada. + + Se esta política não for utilizada, o fuso horário atualmente ativo permanece em utilização, apesar de os utilizadores poderem alterar o fuso horário e de a alteração ser permanente. Desta forma, uma alteração efetuada por um utilizador afeta o ecrã de início de sessão e todos os outros utilizadores. + + Os novos dispositivos começam com o fuso horário definido como "EUA/Pacífico". + + O formato do valor segue os nomes dos fusos horários na "Base de dados de fuso horário IANA" (consulte "https://en.wikipedia.org/wiki/Tz_database"). Em particular, a maioria dos fusos horários pode ser referida como "continente/grande_cidade" ou "oceano/grande_cidade". + + A definição desta política desativa completamente a resolução automática do fuso horário através da localização do dispositivo. Além disso, substitui a política SystemTimezoneAutomaticDetection.</translation> <translation id="1897365952389968758">Permitir que todos os sites executem JavaScript</translation> <translation id="193259052151668190">Lista de autorizações de dispositivos USB amovíveis</translation> <translation id="1933378685401357864">Imagem de fundo</translation> @@ -591,6 +612,24 @@ <translation id="3072847235228302527">Definir os Termos de Utilização para uma conta local do dispositivo</translation> <translation id="3096595567015595053">Lista de plug-ins ativados</translation> <translation id="3101501961102569744">Escolher como indicar as definições do servidor proxy</translation> +<translation id="3125884964575432854">Permite-lhe especificar o servidor proxy utilizado pelo <ph name="PRODUCT_NAME" /> e pelas aplicações ARC e impede os utilizadores de alterar as definições de proxy. + + Se optar por nunca utilizar um servidor proxy e estabelecer sempre ligação diretamente, todas as outras opções são ignoradas. + + Se optar por utilizar as definições de proxy do sistema, todas as outras opções são ignoradas. + + Se optar por detetar automaticamente o servidor proxy, todas as outras opções são ignoradas. + + Se selecionar o modo de servidor proxy fixo, pode especificar outras opções em "Endereço ou URL do servidor proxy" e "Lista separada por vírgulas das regras para ignorar o proxy". As aplicações ARC utilizam apenas o servidor proxy HTTP com a prioridade mais elevada. + + Se optar por utilizar um script de proxy .pac, tem de especificar o URL para o script em "URL para um ficheiro .pac de proxy". + + Para obter exemplos detalhados, aceda a: + <ph name="PROXY_HELP_URL" /> + + Se ativar esta definição, o <ph name="PRODUCT_NAME" /> e as aplicações ARC ignoram todas as opções relacionadas com o proxy especificadas a partir da linha de comandos. + + Se deixar esta política por definir, permite que os utilizadores selecionem as definições de proxy conforme pretendam.</translation> <translation id="3153348162326497318">Permite especificar as extensões que NÃO podem ser instaladas pelos utilizadores. Se constarem da lista negra, as extensões já instaladas serão removidas. Um valor de lista negra "*" significa que todas as extensões constam da lista negra, a menos que estejam expressamente indicadas na lista de autorizações. Se esta política não for definida, o utilizador pode instalar qualquer extensão no <ph name="PRODUCT_NAME" />.</translation> <translation id="316778957754360075">Esta definição foi removida a partir da versão 29 do <ph name="PRODUCT_NAME" />. A forma recomendada de configurar coleções de extensões/aplicações alojadas na entidade é incluir no alojamento do site os pacotes CRX em ExtensionInstallSources e colocar links de transferência diretos para os pacotes numa página Web. Pode ser criado um iniciador para essa página Web utilizando a política ExtensionInstallForcelist.</translation> <translation id="3185009703220253572">desde a versão <ph name="SINCE_VERSION" /></translation> @@ -659,6 +698,20 @@ Se esta política não for definida, é utilizado o valor global predefinido para todos os sites, seja a partir da política "DefaultKeygenSetting", se estiver definida, ou a partir da configuração pessoal do utilizador.</translation> <translation id="3381968327636295719">Utilizar o navegador anfitrião por predefinição</translation> +<translation id="3398137877608138703">Permitir ou impedir a captura de vídeo. + + Se esta política estiver ativada ou não estiver configurada (predefinição), é solicitado ao utilizador + acesso de captura de vídeo, exceto para os URLs configurados na lista + VideoCaptureAllowedUrls, à qual é concedido acesso sem pedido. + As aplicações ARC podem aceder à câmara se lhes tiver sido dada + autorização. + + Quando esta política está desativada, nunca é solicitado acesso ao utilizador e a captura + de vídeo está disponível apenas para os URLs configurados em VideoCaptureAllowedUrls. + As aplicações ARC não podem aceder à câmara. + + Além das aplicações ARC, esta política afeta todos os tipos de entrada de vídeo e + não apenas a câmara incorporada.</translation> <translation id="3417418267404583991">Se esta política estiver definida como verdadeira ou não estiver configurada, o <ph name="PRODUCT_OS_NAME" /> irá ativar os inícios de sessão de convidado. Os inícios de sessão de convidado são sessões de utilizadores anónimos e não necessitam de uma palavra-passe. Se esta política estiver definida como falsa, o <ph name="PRODUCT_OS_NAME" /> não permitirá que sejam iniciadas sessões de convidado.</translation> @@ -676,6 +729,8 @@ <translation id="3478024346823118645">Limpar os dados do utilizador ao terminar sessão</translation> <translation id="348495353354674884">Ativar teclado virtual</translation> <translation id="3496296378755072552">Gestor de palavras-passe</translation> +<translation id="349667858031092827">Nunca detetar automaticamente o fuso horário.</translation> +<translation id="350443680860256679">Configurar ARC</translation> <translation id="3504791027627803580">Especifique o URL do motor de pesquisa utilizado para fornecer a pesquisa de imagens. Os pedidos de pesquisa serão enviados através do método GET. Se a política DefaultSearchProviderImageURLPostParams estiver definida, os pedidos de pesquisa de imagens utilizarão, em alternativa, o método POST. Esta política é opcional. Se não for definida, não será utilizada a pesquisa de imagens. @@ -692,13 +747,13 @@ O valor da política deverá ser especificado em milissegundos. Os valores estão limitados a um intervalo entre 30 segundos e 24 horas.</translation> <translation id="3528000905991875314">Ativar páginas de erro alternativas</translation> -<translation id="3538538104630456270">A definição associada era utilizada antes da introdução da reautenticação durante a visualização de palavras-passe. Depois disso, a definição e, consequentemente, esta política deixaram de afetar o comportamento do Chrome. Atualmente, o Chrome comporta-se como se a política estivesse definida para desativar a apresentação das palavras-passe em texto não codificado na página de definições do gestor de palavras-passe. Isto significa que a página de definições inclui apenas um marcador de posição e o Chrome só mostra a palavra-passe depois de o utilizador clicar em "Mostrar" (e efetuar a reautenticação, se aplicável). Segue-se a descrição original da política. +<translation id="3538538104630456270">A definição associada era utilizada antes de ser introduzida a reautenticação durante a visualização de palavras-passe. Depois disso, a definição e, consequentemente, esta política deixaram de afetar o comportamento do Chrome. Atualmente, o Chrome comporta-se como se a política estivesse definida para desativar a apresentação das palavras-passe em texto simples na página de definições do gestor de palavras-passe. Isto significa que a página de definições inclui apenas um marcador de posição e o Chrome só mostra a palavra-passe depois de o utilizador clicar em "Mostrar" (e efetuar a reautenticação, se aplicável). Segue-se a descrição original da política. - Controla se os utilizadores podem mostrar palavras-passe em texto não codificado no gestor de palavras-passe. + Controla se os utilizadores podem mostrar palavras-passe em texto simples no gestor de palavras-passe. - Se desativar esta definição, o gestor de palavras-passe não permite mostrar as palavras-passe armazenadas em texto não codificado na janela do gestor. + Se desativar esta definição, o gestor de palavras-passe não permite mostrar as palavras-passe armazenadas em texto simples na janela do gestor. - Se ativar ou não definir esta política, os utilizadores podem ver as palavras-passe em texto não codificado no gestor de palavras-passe.</translation> + Se ativar ou não definir esta política, os utilizadores podem ver as palavras-passe em texto simples no gestor de palavras-passe.</translation> <translation id="3547954654003013442">Definições de proxy</translation> <translation id="3570008976476035109">Bloquear plug-ins nestes sites</translation> <translation id="3591584750136265240">Configurar o comportamento de autenticação de início de sessão</translation> @@ -809,6 +864,22 @@ Se esta política estiver definida como "Manter cookies durante toda a sessão", os cookies são apagados quando a sessão for fechada. Tenha em atenção que se o <ph name="PRODUCT_NAME" /> estiver em execução no "modo de segundo plano", a sessão pode não ser fechada quando a última janela for fechada. Consulte a política "BackgroundModeEnabled" para obter mais informações acerca da configuração deste comportamento. Se esta política não for definida, "AllowCookies" é utilizada e o utilizador pode alterá-la.</translation> +<translation id="4098957623809244159">Esta política foi descontinuada. Em alternativa, utilize ProxyMode. + + Permite-lhe especificar o servidor proxy utilizado pelo <ph name="PRODUCT_NAME" /> e pelas aplicações ARC e impede os utilizadores de alterar as definições de proxy. + + Se optar por nunca utilizar um servidor proxy e estabelecer sempre ligação diretamente, todas as outras opções são ignoradas. + + Se optar por utilizar as definições de proxy do sistema ou detetar automaticamente o servidor proxy, todas as outras opções são ignoradas. + + Se selecionar as definições de proxy manuais, pode especificar outras opções em "Endereço ou URL do servidor proxy", "URL para um ficheiro .pac de proxy" e "Lista separada por vírgulas das regras para ignorar o proxy". + + Para obter exemplos detalhados, aceda a: + <ph name="PROXY_HELP_URL" /> + + Se ativar esta definição, o <ph name="PRODUCT_NAME" /> ignora todas as opções relacionadas com o proxy especificadas a partir da linha de comandos. + + Se deixar esta política por definir, permite que os utilizadores selecionem as definições de proxy conforme pretendam.</translation> <translation id="4103289232974211388">Redirecionar para SAML IdP após confirmação do utilizador</translation> <translation id="410478022164847452">Especifica o período de tempo sem atividade por parte do utilizador após o qual se realiza a ação de inatividade quando o dispositivo está ligado à eletricidade. @@ -1236,6 +1307,14 @@ <translation id="5893553533827140852">Se esta definição estiver ativada, os pedidos de autenticação gnubby serão utilizados com proxy numa ligação de anfitrião remoto. Se esta definição estiver desativada ou não estiver configurada, os pedidos de autenticação não serão utilizados com proxy.</translation> +<translation id="5900959132054596599">O <ph name="PRODUCT_NAME" /> e as aplicações ARC ignoram qualquer proxy para a lista de anfitriões fornecida aqui. + + Esta política só é aplicada se tiver selecionado as definições de proxy manuais em "Escolher como especificar as definições do servidor proxy". + + Deixe esta política por definir se tiver selecionado qualquer outro modo para a definição de políticas de proxy. + + Para obter exemplos mais detalhados, aceda a: + <ph name="PROXY_HELP_URL" /></translation> <translation id="5921713479449475707">Permitir transferências de atualização automática por HTTP</translation> <translation id="5921888683953999946">Definir o estado predefinido da funcionalidade de acessibilidade do cursor grande no ecrã de início de sessão. @@ -1377,6 +1456,7 @@ <translation id="637934607141010488">Comunicar lista de utilizadores do dispositivo que iniciaram sessão recentemente. Se a política estiver definida como "false", os utilizadores não serão comunicados.</translation> +<translation id="639009029157091157">Permitir que os utilizadores decidam.</translation> <translation id="6392973646875039351">Ativa a funcionalidade de Preenchimento Automático do <ph name="PRODUCT_NAME" /> e permite que os utilizadores preencham automaticamente formulários Web utilizando informações anteriormente armazenadas, como endereços ou dados de cartões de crédito. Se desativar esta definição, os utilizadores não poderão aceder à funcionalidade de Preenchimento Automático. Se ativar esta definição ou não definir qualquer valor, os utilizadores poderão controlar o Preenchimento Automático, o que lhes permitirá configurar perfis de Preenchimento Automático e ligar ou desligar esta funcionalidade conforme pretendam.</translation> <translation id="6394350458541421998">Esta política foi removida a partir da versão 29 do <ph name="PRODUCT_OS_NAME" />. Em vez disso, utilize a política PresentationScreenDimDelayScale.</translation> <translation id="6401669939808766804">Terminar a sessão do utilizador</translation> @@ -1618,11 +1698,6 @@ Se a política RestoreOnStartup estiver definida para restaurar URLs de sessões anteriores, esta política não é respeitada e os cookies são armazenados permanentemente para esses sites.</translation> <translation id="7207095846245296855">Forçar Google Pesquisa segura</translation> -<translation id="7213425178181578730">Se esta política estiver definida como falsa, o <ph name="PRODUCT_OS_NAME" /> desativa o Bluetooth e o utilizador não pode voltar a ativá-la. - - Se esta política estiver definida para verdadeira ou não estiver definida, o utilizador pode ativar ou desativar o Bluetooth, conforme pretender. - - Se esta política estiver definida, o utilizador não pode alterá-la nem substituí-la.</translation> <translation id="7216442368414164495">Permite aos utilizadores optar por receber relatórios alargados de Navegação segura</translation> <translation id="7227967227357489766">Define a lista de utilizadores com permissão para iniciar sessão no dispositivo. As entradas são as do formulário <ph name="USER_WHITELIST_ENTRY_FORMAT" />, como <ph name="USER_WHITELIST_ENTRY_EXAMPLE" />. Para permitir utilizadores arbitrários num domínio, utilize entradas do formulário <ph name="USER_WHITELIST_ENTRY_WILDCARD" />. @@ -1723,6 +1798,9 @@ <translation id="7632724434767231364">Nome da biblioteca GSSAPI</translation> <translation id="7635471475589566552">Configura o local da aplicação no <ph name="PRODUCT_NAME" /> e impede que os utilizadores o alterem. Se ativar esta definição, o <ph name="PRODUCT_NAME" /> utilizará o local indicado. Se o local configurado não for suportado, será utilizado "en-US". Se esta definição estiver desativada ou não for definida, o <ph name="PRODUCT_NAME" /> utilizará o local preferencial indicado pelo utilizador (se estiver configurado), o local do sistema ou o local alternativo "en-US".</translation> <translation id="7651739109954974365">Determina se o roaming de dados deve estar ativado para o aparelho. Se a política estiver definida como verdadeira, o roaming de dados é permitido. Se ficar por configurar ou for definida como falsa, o roaming de dados não estará disponível.</translation> +<translation id="7667184304362487902">Configura as definições de proxy para o <ph name="PRODUCT_NAME" /> e as aplicações ARC. + + Esta política ainda não está pronta para ser utilizada, por isso, não a utilize.</translation> <translation id="76810863974142048">URL onde os clientes de acesso remoto devem obter o respetivo símbolo de autenticação. Se esta política estiver definida, o anfitrião de acesso remoto exige que os clientes que tentam efetuar a autenticação obtenham um símbolo de autenticação a partir deste URL para estabelecer ligação. Deve utilizá-la em conjunto com a política RemoteAccessHostTokenValidationUrl. @@ -1791,6 +1869,19 @@ <translation id="7842869978353666042">Configurar as opções do Google Drive</translation> <translation id="7843525027689416831">Especifica os sinalizadores que devem ser aplicados ao <ph name="PRODUCT_NAME" /> quando este inicia. Os sinalizadores especificados são aplicados apenas no ecrã de início de sessão. Os sinalizadores definidos através desta política não se propagam para as sessões de utilizador.</translation> <translation id="7848840259379156480">Permite-lhe configurar o processador de HTML predefinido quando é instalado o <ph name="PRODUCT_FRAME_NAME" />. A predefinição é permitir que o navegador anfitrião efetue o pro, mas, se pretender, pode substituir esta predefinição e fazer com que o <ph name="PRODUCT_FRAME_NAME" /> processe as páginas HTML por predefinição.</translation> +<translation id="7853178359124471330">Quando esta política está definida, o fluxo da deteção automática do fuso horário é um dos seguintes, consoante o valor da definição: + + Se estiver definida como TimezoneAutomaticDetectionUsersDecide, os utilizadores podem controlar a deteção automática do fuso horário ao utilizar controlos normais em chrome://settings. + + Se estiver definida como TimezoneAutomaticDetectionDisabled, os controlos automáticos do fuso horário disponíveis em chrome://settings estão desativados. A deteção automática do fuso horário está sempre desativada. + + Se estiver definida como TimezoneAutomaticDetectionIPOnly, os controlos do fuso horário disponíveis em chrome://settings estão desativados. A deteção automática do fuso horário está sempre ativada. A deteção do fuso horário utiliza o método apenas de IP para resolver a localização. + + Se estiver definida como TimezoneAutomaticDetectionSendWiFiAccessPoints, os controlos do fuso horário disponíveis em chrome://settings estão desativados. A deteção automática do fuso horário está sempre ativada. A lista de pontos de acesso Wi-Fi visíveis é sempre enviada para o servidor da API de geolocalização, de modo a permitir a deteção precisa do fuso horário. + + Se esta política não estiver definida, o comportamento é o mesmo como se TimezoneAutomaticDetectionUsersDecide estivesse definido. + + Se a política SystemTimezone estiver definida, substitui esta política. Nesse caso, a deteção automática do fuso horário está totalmente desativada.</translation> <translation id="7882585827992171421">Esta política está ativa apenas no modo de retalho. Determina a ID da extensão a utilizar como proteção de ecrã no ecrã de início de sessão. A extensão deve ser parte do AppPack que está configurado para este domínio através da política DeviceAppPack.</translation> @@ -1828,6 +1919,7 @@ Se deixar esta política por definir, a definição será ativada.</translation> <translation id="8073243368829195">Permite a utilização do Smart Lock</translation> +<translation id="8074052133552427532">Utilizar sempre a deteção aproximada do fuso horário.</translation> <translation id="8099880303030573137">Atraso de inatividade quando o dispositivo está a utilizar a energia da bateria</translation> <translation id="8102913158860568230">Predefinição da transmissão em sequência de multimédia</translation> <translation id="8104962233214241919">Selecionar automaticamente certificados de cliente para estes Web sites</translation> @@ -1933,6 +2025,7 @@ <translation id="8424255554404582727">Definir a rotação predefinida do ecrã, aplicada novamente em todos os reinícios</translation> <translation id="8426231401662877819">Rodar o ecrã 90 graus para a direita</translation> <translation id="8451988835943702790">Utilizar a página Novo separador como página inicial</translation> +<translation id="8458790683633857482">Especifica um conjunto de políticas que são transmitidas ao tempo de execução ARC. O valor tem de ser um formato JSON válido.</translation> <translation id="8465065632133292531">Parâmetros do URL instantâneo que utilize POST</translation> <translation id="847472800012384958">Não permitir que os sites mostrem pop-ups</translation> <translation id="8477885780684655676">TLS 1.0</translation> @@ -2053,9 +2146,12 @@ Se esta política for definida como falsa, nem o utilizador nem quaisquer aplicações ou extensões podem entrar no modo de ecrã inteiro. Em todas as plataformas, exceto em <ph name="PRODUCT_OS_NAME" />, o modo quiosque está indisponível quando o modo de ecrã inteiro está desativado.</translation> +<translation id="8795495354632096254">Enviar sempre pontos de acesso Wi-Fi para o servidor durante a resolução do fuso horário.</translation> <translation id="8818173863808665831">Comunique a localização geográfica do dispositivo. Se a política não estiver definida, ou estiver definida como falsa, a localização não será comunicada.</translation> +<translation id="8818768076343557335">Prever ações na rede em qualquer rede que não seja móvel. + (Descontinuada na versão 50, removida na versão 52. Após a versão 52, se estiver definido o valor 1, este é tratado como 0: prever ações na rede em qualquer ligação de rede.)</translation> <translation id="8828766846428537606">Configura a página inicial predefinida no <ph name="PRODUCT_NAME" /> e impede que os utilizadores a alterem. As definições da página inicial dos utilizadores só estão totalmente bloqueadas se definir que a página inicial é a página Novo separador ou um URL e que indique um URL para a página inicial. Se não indicar o URL da página inicial, os utilizadores poderão definir a página Novo separador como a página inicial, especificando "chrome://newtab".</translation> <translation id="8833109046074170275">Autenticação através do fluxo GAIA predefinido</translation> <translation id="8838303810937202360">O <ph name="PRODUCT_OS_NAME" /> coloca em cache aplicações e extensões para instalação por vários utilizadores de um único dispositivo para evitar voltar a transferi-las para cada utilizador. @@ -2063,15 +2159,15 @@ <translation id="8858642179038618439">Forçar o Modo de segurança do YouTube</translation> <translation id="8864975621965365890">Suprime o pedido de recusa que aparece quando um site é convertido por <ph name="PRODUCT_FRAME_NAME" />.</translation> <translation id="8870318296973696995">Página inicial</translation> -<translation id="8889588091638298603">O Servidor Quirks fornece ficheiros de configuração específicos do hardware, como +<translation id="8889588091638298603">O Quirks Server fornece ficheiros de configuração específicos do hardware, como perfis de visualização ICC para ajustar a calibração do monitor. Quando esta política está definida como falsa, o dispositivo não tenta - contactar o Servidor Quirks para transferir ficheiros de configuração. + contactar o Quirks Server para transferir ficheiros de configuração. Se esta política estiver definida como verdadeira ou não estiver configurada, o <ph name="PRODUCT_OS_NAME" /> - contacta automaticamente o Servidor Quirks, transfere os ficheiros de configuração, + contacta automaticamente o Quirks Server, transfere os ficheiros de configuração, se estiverem disponíveis, e armazena-os no dispositivo. Estes ficheiros podem ser utilizados, por exemplo, para melhorar a qualidade de visualização dos monitores ligados.</translation> <translation id="8905426178924715309">Esta política foi descontinuada. Utilize ForceGoogleSafeSearch e ForceYouTubeSafetyMode em alternativa. Esta política é ignorada se as políticas ForceGoogleSafeSearch ou ForceYouTubeSafetyMode forem definidas. @@ -2115,6 +2211,7 @@ <translation id="9042911395677044526">Permite que a configuração de rede seja aplicada por utilizador para um aparelho <ph name="PRODUCT_OS_NAME" />. A configuração de rede é uma cadeia de formato JSON, conforme definido pelo formato de Configuração de Rede Aberta descrito em <ph name="ONC_SPEC_URL" /></translation> <translation id="9084985621503260744">Especificar se a atividade do vídeo afeta a gestão da energia</translation> <translation id="9088433379343318874">Ativar o fornecedor de conteúdos do utilizador supervisionado</translation> +<translation id="9088444059179765143">Configurar o método de deteção automática do fuso horário</translation> <translation id="9096086085182305205">Lista de permissões do servidor de autenticação</translation> <translation id="9098553063150791878">Políticas para a autenticação HTTP</translation> <translation id="9104138886225968319">Envia impulsos de monitorização ao servidor de gestão para permitir
diff --git a/components/policy/resources/policy_templates_ro.xtb b/components/policy/resources/policy_templates_ro.xtb index c666d7ee..5c3b457c 100644 --- a/components/policy/resources/policy_templates_ro.xtb +++ b/components/policy/resources/policy_templates_ro.xtb
@@ -1630,11 +1630,6 @@ Dacă politica „RestoreOnStartup” este setată pentru restabilirea adreselor URL din sesiunile anterioare, această politică nu va fi respectată, iar cookie-urile vor fi stocate permanent pentru site-urile respective.</translation> <translation id="7207095846245296855">Impune Căutarea sigură Google</translation> -<translation id="7213425178181578730">Dacă această politică este dezactivată, <ph name="PRODUCT_OS_NAME" /> va dezactiva conexiunea Bluetooth, iar utilizatorul nu o va putea reactiva. - - Dacă această politică este activată sau nu este configurată, utilizatorul va putea activa sau dezactiva conexiunea Bluetooth după cum dorește. - - Dacă această politică este configurată, utilizatorul nu o poate modifica sau ignora.</translation> <translation id="7216442368414164495">Permite utilizatorilor să activeze raportarea detaliată privind Navigarea sigură</translation> <translation id="7227967227357489766">Această politică definește lista de utilizatori care au permisiunea de a se conecta la dispozitiv. Intrările sunt de forma <ph name="USER_WHITELIST_ENTRY_FORMAT" />, cum ar fi <ph name="USER_WHITELIST_ENTRY_EXAMPLE" />. Pentru a accepta utilizatori arbitrari pe un anumit domeniu, utilizați intrări de forma <ph name="USER_WHITELIST_ENTRY_WILDCARD" />.
diff --git a/components/policy/resources/policy_templates_ru.xtb b/components/policy/resources/policy_templates_ru.xtb index 9a752139..28d84476 100644 --- a/components/policy/resources/policy_templates_ru.xtb +++ b/components/policy/resources/policy_templates_ru.xtb
@@ -135,6 +135,18 @@ <translation id="1561424797596341174">Позволяет изменить правила сборок для отладки хоста удаленного доступа</translation> <translation id="1583248206450240930">Использовать <ph name="PRODUCT_FRAME_NAME" /> по умолчанию</translation> <translation id="1608755754295374538">URL, которым доступ к аудиозаписывающим устройствам предоставляется без запроса</translation> +<translation id="1613574633990410986">Позволяет задать прокси-сервер, используемый <ph name="PRODUCT_NAME" /> и приложениями ARC, а также запрещает пользователям менять его настройки. + + Если вы решите отказаться от использования прокси-сервера и всегда устанавливать прямое соединение, все остальные параметры будут игнорироваться. + + Если вы предпочтете автоматически определять прокси-сервер, все остальные параметры будут игнорироваться. + + Подробные примеры приведены на этой странице: + <ph name="PROXY_HELP_URL" /> + + Если этот параметр включен, <ph name="PRODUCT_NAME" /> и приложения ARC игнорируют все настройки прокси-сервера, указанные с помощью командной строки. + + Если он не задан, пользователи могут менять настройки самостоятельно.</translation> <translation id="1617235075406854669">Удаление истории просмотров и загрузок браузера</translation> <translation id="1617384279878333801">Разрешить добавлять людей через менеджер профилей</translation> <translation id="1655229863189977773">Задать объем кеша в байтах</translation> @@ -195,6 +207,15 @@ <translation id="1865417998205858223">Позволяет разрешать или запрещать использование ключей</translation> <translation id="186719019195685253">Действие в случае превышения времени бездействия при работе от сети.</translation> <translation id="187819629719252111">Открывает доступ к локальным файлам на компьютере, разрешая <ph name="PRODUCT_NAME" /> показывать окна выбора файлов. Если этот параметр включен, пользователи могут открывать окна выбора файлов в обычном режиме. Если параметр отключен и пользователь выполняет действия, для которых нужно открыть окно выбора файла (например, импорт закладок, загрузка файлов, сохранение ссылок и т. д.), вместо окна отображается сообщение и предполагается, что пользователь нажал кнопку "Отмена" в окне выбора файлов. Если этот параметр не задан, пользователи могут открывать окна выбора файлов в обычном режиме.</translation> +<translation id="1879485426724769439">Определяет часовой пояс, который используется на устройстве. Пользователи могут изменить часовой пояс текущего сеанса, однако после выхода из системы он снова возвращается к заданному значению. Если введено неправильное значение, правило все равно продолжает действовать, используя вместо него пояс GMT (среднее время по Гринвичу). Если строка пуста, правило не применяется. + + Если это правило не используется, применяется активный в данный момент часовой пояс. Пользователи могут задать другой часовой пояс, и это изменение не будет отменено. Изменение, сделанное одним пользователем, влияет на страницу входа для остальных пользователей. + + Новые устройства начинают работу с часовым поясом, соответствующим Североамериканскому тихоокеанскому времени. + + Формат значений соответствует названиям часовых поясов в базе данных часовых поясов IANA (см. https://ru.wikipedia.org/wiki/Tz_database). В частности, большинство часовых поясов можно описать по принципу "континент/большой_город" или "океан/большой_город". + + Если параметр установлен, это отключает автоматическое обновление часового пояса на основе геоданных и переопределяет правило SystemTimezoneAutomaticDetection.</translation> <translation id="1897365952389968758">Разрешить всем сайтам выполнять JavaScript</translation> <translation id="193259052151668190">Белый список отсоединяемых USB-устройств</translation> <translation id="1933378685401357864">Обои для рабочего стола</translation> @@ -564,6 +585,24 @@ <translation id="3072847235228302527">Установить Условия использования локального аккаунта</translation> <translation id="3096595567015595053">Список включенных плагинов</translation> <translation id="3101501961102569744">Выбрать способ настройки прокси-сервера</translation> +<translation id="3125884964575432854">Позволяет задать прокси-сервер, используемый <ph name="PRODUCT_NAME" /> и приложениями ARC, а также запрещает пользователям менять его настройки. + + Если вы решите отказаться от использования прокси-сервера и всегда устанавливать прямое соединение, все остальные параметры будут игнорироваться. + + Если вы предпочтете использовать системные настройки прокси-сервера, все остальные параметры будут игнорироваться. + + Если вы решите определять прокси-сервер автоматически, все остальные параметры будут игнорироваться. + + Если будет использоваться конкретный прокси-сервер, его параметры можно указать в полях "Адрес или URL прокси-сервера" и "Список правил для игнорирования прокси-сервера". Приложения ARC будут использовать только прокси-сервер HTTP с наивысшим приоритетом. + + Если вы предпочитаете использовать PAC-скрипт, укажите его URL в поле "URL файла PAC прокси-сервера". + + Подробные примеры приведены на этой странице: + <ph name="PROXY_HELP_URL" /> + + Если этот параметр включен, <ph name="PRODUCT_NAME" /> и приложения ARC игнорируют все настройки прокси-сервера, указанные с помощью командной строки. + + Если он не задан, пользователи могут менять настройки самостоятельно.</translation> <translation id="3153348162326497318">Позволяет задать расширения, которые пользователи НЕ МОГУТ устанавливать. Уже установленные расширения, входящие в этот черный список, будут удалены. Звездочка (*) запрещает все расширения, кроме тех, которые внесены в белый список. Если это правило не настроено, пользователи могут добавлять в <ph name="PRODUCT_NAME" /> любые расширения.</translation> <translation id="316778957754360075">Это правило не поддерживается в <ph name="PRODUCT_NAME" /> версии 29 и будет исключено из более поздних версий. Чтобы создать коллекцию приложений и расширений организации, рекомендуем указать адрес сайта, где хранятся CRX-пакеты, в правиле ExtensionInstallSources и разместить прямые ссылки на скачивание приложений на специальной веб-странице. Панель запуска для этой страницы можно создать с помощью правила ExtensionInstallForcelist.</translation> <translation id="3185009703220253572">начиная с версии <ph name="SINCE_VERSION" /></translation> @@ -630,6 +669,20 @@ Если этот параметр отключен, пользователи не могут включить прокси-сервер, и принтеры на этом компьютере нельзя будет использовать как <ph name="CLOUD_PRINT_NAME" />.</translation> <translation id="3322771899429619102">Позволяет задать список шаблонов URL для сайтов, которым разрешено создавать ключи. При этом, если указанный шаблон подпадает под действие правила KeygenBlockedForUrls, сайту все равно будет разрешено создавать ключи. Если правило KeygenAllowedForUrls не настроено, для всех сайтов используется значение по умолчанию на основе правила DefaultKeygenSetting (если оно настроено, в противном случае – на основе пользовательской конфигурации).</translation> <translation id="3381968327636295719">Использовать по умолчанию основной браузер</translation> +<translation id="3398137877608138703">Позволяет включить или отключить функции записи видео. + + Если правило включено или не настроено (значение по умолчанию), + будет появляться запрос на доступ ко всем ресурсам, за исключением + URL из списка VideoCaptureAllowedUrls (для них запрос не требуется). + Приложения ARC получат доступ к камере, + если у них есть соответствующее разрешение. + + Если правило отключено, запрос появляться не будет, а функция записи видео + будет доступна только по ссылкам из списка VideoCaptureAllowedUrls. + Приложения ARC доступ к камере будет закрыт. + + Вне приложений ARC правило действует для всех видеоустройств, + а не только для встроенной камеры.</translation> <translation id="3417418267404583991">Если эти правила заданы (по умолчанию), в <ph name="PRODUCT_OS_NAME" /> будет разрешен вход в учетной записи гостя. Гостевой сеанс полностью анонимен и не требует ввода пароля. Если эти правила не установлены, в <ph name="PRODUCT_OS_NAME" /> будет невозможно открыть гостевой сеанс.</translation> @@ -647,6 +700,8 @@ <translation id="3478024346823118645">Стирать пользовательские данные при выходе</translation> <translation id="348495353354674884">Включить виртуальную клавиатуру</translation> <translation id="3496296378755072552">Диспетчер паролей</translation> +<translation id="349667858031092827">Не определять часовой пояс автоматически</translation> +<translation id="350443680860256679">Настройка ARC</translation> <translation id="3504791027627803580">Содержит URL-адрес поисковой системы, используемой для поиска изображений. По умолчанию запросы отправляются методом GET. Если задана политика DefaultSearchProviderImageURLPostParams, запросы отправляются методом POST. Данная политика является необязательной. Если она не задана, поиск изображений не используется. @@ -779,6 +834,22 @@ Если вы выберете вариант "Хранить файлы cookie до конца сеанса", учтите следующее: когда <ph name="PRODUCT_NAME" /> работает в фоновом режиме, сеанс не завершается даже после того, как закрываются все окна. Подробную информацию вы найдете в описании правила BackgroundModeEnabled. Если вы не настроите DefaultCookiesSetting, будет действовать правило AllowCookies и пользователи смогут самостоятельно изменить его значение.</translation> +<translation id="4098957623809244159">Это правило устарело, используйте вместо него ProxyMode. + + Позволяет задать прокси-сервер, используемый <ph name="PRODUCT_NAME" /> и приложениями ARC, а также запрещает пользователям менять его настройки. + + Если вы решите отказаться от использования прокси-сервера и всегда устанавливать прямое соединение, все остальные параметры будут игнорироваться. + + Если вы предпочтете использовать системные настройки прокси-сервера или определять его автоматически, все остальные параметры будут игнорироваться. + + Если вам требуется настроить прокси-сервер вручную, его параметры можно указать в полях "Адрес или URL прокси-сервера", "URL файла PAC прокси-сервера" и "Список правил для игнорирования прокси-сервера". + + Подробные примеры приведены на этой странице: + <ph name="PROXY_HELP_URL" /> + + Если этот параметр включен, <ph name="PRODUCT_NAME" /> игнорирует все настройки прокси-сервера, указанные с помощью командной строки. + + Если он не задан, пользователи могут менять настройки самостоятельно.</translation> <translation id="4103289232974211388">Входить с помощью поставщика услуг SAML (нужно подтверждение пользователя)</translation> <translation id="410478022164847452">Определяет, через какое время бездействия блокируется экран при работе от сети. @@ -1205,6 +1276,14 @@ <translation id="5893553533827140852">Если этот параметр включен, запросы на авторизацию Gnubby будут передаваться через подключение к удаленному хосту. Если этот параметр отключен или не задан, запросы на авторизацию Gnubby не будут передаваться через прокси.</translation> +<translation id="5900959132054596599"><ph name="PRODUCT_NAME" /> и приложения ARC будут обходить прокси-серверы для перечисленных здесь хостов. + + Правило действует, только если в разделе "Выбрать способ настройки прокси-сервера" выбрана настройка вручную. + + Если включен какой-либо другой режим, не устанавливайте это правило. + + Подробные примеры приведены на этой странице: + <ph name="PROXY_HELP_URL" /></translation> <translation id="5921713479449475707">Разрешить автоматическое скачивание обновлений по протоколу HTTP</translation> <translation id="5921888683953999946">Наличие или отсутствие большого курсора по умолчанию на экране входа. @@ -1346,6 +1425,7 @@ <translation id="637934607141010488">Сообщать о пользователях, недавно выполнявших вход на устройстве. Если эта политика не задана или выбрано значение false, отчет о пользователях предоставляться не будет.</translation> +<translation id="639009029157091157">На усмотрение пользователей</translation> <translation id="6392973646875039351">Включает в <ph name="PRODUCT_NAME" /> функцию автозаполнения и разрешает автоматически заполнять веб-формы, например с полями адреса или номера банковской карты, ранее сохраненными данными. Если этот параметр отключен, функция автозаполнения недоступна пользователям, а если он включен или его значение не указано, пользователь может использовать автозаполнение, настраивать профили автозаполнения, а также включать и отключать эту функцию по своему усмотрению.</translation> <translation id="6394350458541421998">Это правило не поддерживается в <ph name="PRODUCT_OS_NAME" /> версии 29 и будет исключено из более поздних версий. Вместо него используйте правило PresentationScreenDimDelayScale.</translation> <translation id="6401669939808766804">Выход из системы</translation> @@ -1587,11 +1667,6 @@ Если вы настроите правило RestoreOnStartup так, чтобы при запуске браузера открывались вкладки из предыдущего сеанса, то CookiesSessionOnlyForUrls не вступит в силу. Файлы cookie при этом удаляться не будут.</translation> <translation id="7207095846245296855">Позволяет принудительно включить Безопасный поиск Google</translation> -<translation id="7213425178181578730">Если для политики задано значение false, <ph name="PRODUCT_OS_NAME" /> отключит Bluetooth, и пользователь не сможет включить эту функцию. - - Если политика не установлена или задано значение true, пользователь сможет включать и отключать Bluetooth. - - Пользователь не сможет изменить или отменить установленную политику.</translation> <translation id="7216442368414164495">Позволить пользователям включить расширенную отчетность безопасного просмотра</translation> <translation id="7227967227357489766">Определяет список пользователей, которым разрешен вход на устройство. Элементы списка имеют формат <ph name="USER_WHITELIST_ENTRY_FORMAT" /> (пример: <ph name="USER_WHITELIST_ENTRY_EXAMPLE" />). Чтобы добавить в домен произвольного пользователя, используйте элементы в формате <ph name="USER_WHITELIST_ENTRY_WILDCARD" />. @@ -1692,6 +1767,9 @@ <translation id="7632724434767231364">название библиотеки GSSAPI</translation> <translation id="7635471475589566552">Устанавливает региональные настройки приложения в <ph name="PRODUCT_NAME" /> и запрещает пользователям менять их. Если этот параметр включен, <ph name="PRODUCT_NAME" /> использует указанные региональные настройки. Если они не поддерживаются, используется вариант en-US. Если этот параметр отключен или не настроен, <ph name="PRODUCT_NAME" /> использует региональные настройки пользователя (если они выбраны), системные региональные настройки либо резервный вариант en-US.</translation> <translation id="7651739109954974365">Устанавливает возможность для роуминга данных для устройства. Если параметр задан, роуминг данных разрешен. Если нет (по умолчанию), роуминг данных будет недоступен.</translation> +<translation id="7667184304362487902">Позволяет задать настройки прокси-сервера для <ph name="PRODUCT_NAME" /> и приложений ARC. + + Правило находится в стадии разработки, поэтому его использование не рекомендуется.</translation> <translation id="76810863974142048">URL, по которому клиенты удаленного доступа должны получать токены аутентификации. Если это правило настроено, то для подключения хост удаленного доступа потребует от клиента токен, полученный по указанному URL. Правило используется совместно с RemoteAccessHostTokenValidationUrl. @@ -1757,6 +1835,19 @@ <translation id="7842869978353666042">Настройка параметров Google Диска</translation> <translation id="7843525027689416831">Определяет, какие настройки будут применяться при запуске <ph name="PRODUCT_NAME" />. Они используются только на экране входа и не распространяются на сеансы пользователей.</translation> <translation id="7848840259379156480">Позволяет выбрать средство обработки HTML, если установлен модуль <ph name="PRODUCT_FRAME_NAME" />. По умолчанию обработку выполняет основной браузер. При необходимости можно сделать <ph name="PRODUCT_FRAME_NAME" /> средством обработки HTML-страниц по умолчанию.</translation> +<translation id="7853178359124471330">Позволяет настроить автоматическое определение часового пояса с помощью значений ниже. + + Если установлено значение TimezoneAutomaticDetectionUsersDecide, пользователи могут самостоятельно настраивать функцию с помощью элементов управления на странице chrome://settings. + + Если выбрано значение TimezoneAutomaticDetectionDisabled, элементы управления на странице chrome://settings недоступны. Автоматическое определение часового пояса отключено. + + Если установлено значение TimezoneAutomaticDetectionIPOnly, элементы управления на странице chrome://settings недоступны. Функция включена. Часовой пояс определяется только по IP-адресу. Это дает приблизительные результаты. + + Если выбрано значение TimezoneAutomaticDetectionSendWiFiAccessPoints, элементы управления на странице chrome://settings недоступны. Функция включена. Часовой пояс определяется по точкам доступа Wi-Fi, данные о которых отправляются на сервер Geolocation API. Это дает более точные результаты. + + Если правило не задано, будет применять значение TimezoneAutomaticDetectionUsersDecide. + + Если установлено правило SystemTimezone, оно переопределяет этот параметр. Автоматическое определение часового пояса будет отключено.</translation> <translation id="7882585827992171421">Это правило действует только в коммерческой версии. Определяет идентификатор расширения для использования в качестве заставки на экране входа. Расширение должно входить в состав пакета приложений для данного домена, заданного в правиле DeviceAppPack.</translation> @@ -1793,6 +1884,7 @@ Если это правило не задано, использование серверов ретрансляции будет разрешено.</translation> <translation id="8073243368829195">Позволяет использовать функцию Smart Lock</translation> +<translation id="8074052133552427532">Определять часовой пояс приблизительно</translation> <translation id="8099880303030573137">Задержка перехода в спящий режим при работе от батареи</translation> <translation id="8102913158860568230">Настройка MediaStream по умолчанию</translation> <translation id="8104962233214241919">Автоматический выбор клиентских сертификатов для сайтов</translation> @@ -1900,6 +1992,7 @@ <translation id="8424255554404582727">Поворот изображения на экране по умолчанию (применяется при каждой перезагрузке)</translation> <translation id="8426231401662877819">Повернуть экран на 90 градусов по часовой стрелке</translation> <translation id="8451988835943702790">Сделать страницу быстрого доступа главной</translation> +<translation id="8458790683633857482">Задает набор правил, которые будут переданы в среду выполнения ARC. Значение должно быть действительной строкой JSON.</translation> <translation id="8465065632133292531">Параметры для запросов POST к URL-адресу Живого поиска</translation> <translation id="847472800012384958">Блокировать всплывающие окна на всех сайтах</translation> <translation id="8477885780684655676">TLS 1.0</translation> @@ -2019,9 +2112,12 @@ Если задано значение false, полноэкранный режим будет отключен для всех пользователей, приложений и расширений. При отключенном полноэкранном режиме на всех платформах, кроме <ph name="PRODUCT_OS_NAME" />, режим киоска недоступен.</translation> +<translation id="8795495354632096254">Для определения часового пояса отправлять данные о точках доступа Wi-Fi на сервер</translation> <translation id="8818173863808665831">Отправка сведений о географическом местоположении устройства. Если это правило не настроено или настроено неверно, данные о местоположении не отправляются.</translation> +<translation id="8818768076343557335">Предопределяет параметры сети только по Wi-Fi. + Правило устарело в версии 50, удалено в версии 52. В более поздних версиях значение 1 приравнено к значению 0 ("Всегда предопределять параметры сети").</translation> <translation id="8828766846428537606">Настраивает домашнюю страницу по умолчанию в <ph name="PRODUCT_NAME" /> и запрещает пользователям изменять ее. Пользовательские настройки главной страницы полностью блокируются, если в качестве главной страницы выбрана страница быстрого доступа или указан определенный URL. Если URL главной страницы не указан, пользователь может установить страницу быстрого доступа в качестве главной страницы, набрав URL chrome://newtab.</translation> <translation id="8833109046074170275">Входить через GAIA</translation> <translation id="8838303810937202360"><ph name="PRODUCT_OS_NAME" /> кеширует приложения и расширения для установки несколькими пользователями одного устройства, чтобы каждому из них не приходилось скачивать контент заново. @@ -2079,6 +2175,7 @@ <translation id="9042911395677044526">Позволяет принудительно переносить конфигурацию сети конкретного пользователя на любые устройства <ph name="PRODUCT_OS_NAME" />. Конфигурация сети описывается строкой в формате JSON, который определен форматом Open Network Configuration, с которым можно ознакомиться, перейдя по адресу <ph name="ONC_SPEC_URL" /></translation> <translation id="9084985621503260744">Определяет, влияет ли воспроизведение видео на режим энергопотребления</translation> <translation id="9088433379343318874">Открыть доступ к поставщику контента для контролируемых профилей</translation> +<translation id="9088444059179765143">Определять часовой пояс автоматически</translation> <translation id="9096086085182305205">Белый список аутентификации сервера</translation> <translation id="9098553063150791878">Правила для HTTP-аутентификации</translation> <translation id="9104138886225968319">Позволяет отправлять пакеты поддержки связи на сервер управления, чтобы своевременно определять, когда устройство находится не в Сети.
diff --git a/components/policy/resources/policy_templates_sk.xtb b/components/policy/resources/policy_templates_sk.xtb index 91d7722e..ec6bcb55 100644 --- a/components/policy/resources/policy_templates_sk.xtb +++ b/components/policy/resources/policy_templates_sk.xtb
@@ -158,6 +158,18 @@ <translation id="1561424797596341174">Prepísania pravidiel pre zostavy ladenia používané hostiteľom vzdialeného prístupu</translation> <translation id="1583248206450240930">Používať v predvolenom nastavení doplnok <ph name="PRODUCT_FRAME_NAME" /></translation> <translation id="1608755754295374538">Webové adresy, ktorým bude udelený prístup k zariadeniam na zachytávanie zvuku bez zobrazenia výzvy</translation> +<translation id="1613574633990410986">Umožní zadať aplikácie ARC a proxy server, ktorý bude <ph name="PRODUCT_NAME" /> používať. Zabraňuje používateľom zmeniť nastavenia proxy servera. + + Ak sa rozhodnete proxy server nikdy nepoužívať a vždy sa pripájať ručne, budú všetky ostatné možnosti ignorované. + + Ak zvolíte možnosť automatického zisťovania proxy servera, budú všetky ostatné možnosti ignorované. + + Podrobné príklady nájdete na adrese: + <ph name="PROXY_HELP_URL" /> + + Ak toto nastavenie povolíte, <ph name="PRODUCT_NAME" /> a aplikácie ARC budú ignorovať všetky možnosti týkajúce sa proxy serverov zadané pomocou príkazového riadka. + + Ak toto pravidlo ponecháte nenastavené, umožní to používateľom zvoliť si proxy server samostatne.</translation> <translation id="1617235075406854669">Povoliť odstránenie histórie prehliadača a sťahovania</translation> <translation id="1617384279878333801">Povoliť pridanie osoby pomocou správcu profilov</translation> <translation id="1655229863189977773">Nastaviť veľkosť vyrovnávacej pamäte disku v bajtoch</translation> @@ -231,6 +243,15 @@ Ak toto nastavenie zakážete a používateľ vykoná akciu, po ktorej by sa mu v obvyklom prípade zobrazilo dialógové okno na výber súboru (napríklad import záložiek, nahrávanie súborov, ukladanie odkazov a pod.), zobrazí sa mu namiesto tohto dialógového okna správa a prehliadač sa zachová, ako keby používateľ v dialógovom okne na výber súboru klikol na možnosť Zrušiť. Ak toto nastavenie nenastavíte, používatelia budú môcť otvárať dialógové okná na výber súboru obvyklým spôsobom.</translation> +<translation id="1879485426724769439">Určí časové pásmo, ktoré sa má použiť v zariadení. Používatelia môžu prepísať určené časové pásmo pre aktuálnu reláciu. Po odhlásení sa však opäť nastaví určené časové pásmo. Ak poskytnete neplatnú hodnotu, toto pravidlo sa aktivuje a použije sa časové pásmo GMT. Ak poskytnete prázdny reťazec, toto pravidlo sa bude ignorovať. + + Ak toto pravidlo nepoužijete, bude sa naďalej používať aktuálne časové pásmo. Používatelia však môžu časové pásmo zmeniť a táto zmena bude trvalá. Zmena, ktorú vykoná jeden používateľ, teda bude mať vplyv prihlasovaciu obrazovku a všetkých ďalších používateľov. + + Nové zariadenia začínajú s časovým pásmom US/Pacific. + + Formát hodnoty zodpovedá názvom časových pásiem v databáze časových pásiem IANA (nájdete ju na adrese https://en.wikipedia.org/wiki/Tz_database). Konkrétne je väčšina časových pásiem vyjadrená vo formáte „kontinent/veľkomesto“ alebo „oceán/veľkomesto“. + + Nastavenie tohto pravidla zakáže automatické rozlíšenie časového pásma na základe polohy zariadenia. Prepíše tiež pravidlo SystemTimezoneAutomaticDetection.</translation> <translation id="1897365952389968758">Povoliť všetkým webovým stránkam spúšťať jazyk JavaScript</translation> <translation id="193259052151668190">Zoznam povolených odpojiteľných zariadení USB</translation> <translation id="1933378685401357864">Obrázok tapety</translation> @@ -639,6 +660,24 @@ <translation id="3072847235228302527">Nastaviť Zmluvné podmienky pre miestny účet v zariadení</translation> <translation id="3096595567015595053">Zoznam povolených doplnkov</translation> <translation id="3101501961102569744">Zvoľte spôsob konfigurácie nastavení servera proxy</translation> +<translation id="3125884964575432854">Umožní zadať aplikácie ARC a proxy server, ktorý bude <ph name="PRODUCT_NAME" /> používať. Zabraňuje používateľom zmeniť nastavenia proxy servera. + + Ak sa rozhodnete proxy server nikdy nepoužívať a vždy sa pripájať ručne, budú všetky ostatné možnosti ignorované. + + Ak sa rozhodnete používať systémové nastavenia proxy servera, budú všetky ostatné možnosti ignorované. + + Ak zvolíte možnosť automatického zisťovania proxy servera, budú všetky ostatné možnosti ignorované. + + Ak zvolíte režim pevne daného servera proxy, môžete zvoliť ďalšie možnosti v častiach „Adresa (alebo webová adresa) servera proxy“ a „Zoznam pravidiel vynechania servera proxy oddelených čiarkami“. Aplikácie ARC budú používať iba proxy server HTTP s najvyššou prioritou. + + Ak sa rozhodnete použiť skript .pac proxy servera, je potrebné zadať v časti „Webová adresa súboru .pac proxy servera“ webovú adresu. + + Podrobné príklady nájdete na adrese: + <ph name="PROXY_HELP_URL" /> + + Ak toto nastavenie povolíte, <ph name="PRODUCT_NAME" /> a aplikácie ARC budú ignorovať všetky možnosti týkajúce sa proxy serverov zadané pomocou príkazového riadka. + + Ak toto pravidlo nenastavíte, umožníte tým používateľom zvoliť si svoje vlastné nastavenia proxy servera.</translation> <translation id="3153348162326497318">Umožňuje určiť rozšírenia, ktoré používatelia NEMÔŽU nainštalovať. Ak sa v zozname zakázaných rozšírení vyskytuje rozšírenie, ktoré už bolo nainštalované, bude odstránené. Ak je v zozname uvedená hodnota „*“, znamená to, že sú zakázané všetky rozšírenia, ktoré nie sú explicitne uvedené v zozname povolených rozšírení. @@ -714,6 +753,22 @@ Ak toto pravidlo ponecháte nenastavené, pre všetky stránky sa použije globálna predvolená hodnota buď z pravidla DefaultKeygenSetting (ak je nastavené), alebo z osobnej konfigurácie používateľa.</translation> <translation id="3381968327636295719">V predvolenom nastavení použiť hosťovský prehliadač</translation> +<translation id="3398137877608138703">Povolí alebo zakáže zaznamenávanie videa. + + Ak je toto pravidlo povolené alebo nenakonfigurované (predvolené), + používateľovi sa zobrazí výzva na prístup k zaznamenávaniu videa. + Výnimkou sú webové adresy, ktoré sú nakonfigurované v zozname + VideoCaptureAllowedUrls a majú povolený prístup bez zobrazenia výzvy. + Aplikácie ARC budú môcť pristupovať k fotoaparátu, ak dostali + povolenie. + + Ak je pravidlo zakázané, používateľovi sa nikdy nezobrazí výzva + a zaznamenávanie videa bude k dispozícii iba pre webové adresy, + ktoré sú nakonfigurované v zozname VideoCaptureAllowedUrls. + Aplikácie ARC nebudú môcť k fotoaparátu pristupovať. + + Toto pravidlo má vplyv na všetky typy vstupov videa, + nie len na vstavanú kameru.</translation> <translation id="3417418267404583991">Ak je toto pravidlo nastavené na hodnotu true alebo je nenakonfigurované, systém <ph name="PRODUCT_OS_NAME" /> povolí prihlásenie hostí. Prihlásenia hostí predstavujú relácie anonymných používateľov a nevyžadujú heslo. Ak je toto pravidlo nastavené na hodnotu false, systém <ph name="PRODUCT_OS_NAME" /> nepovolí spustenie relácií hosťa.</translation> @@ -731,6 +786,8 @@ <translation id="3478024346823118645">Vymazať údaje používateľa po odhlásení</translation> <translation id="348495353354674884">Povoliť virtuálnu klávesnicu</translation> <translation id="3496296378755072552">Správca hesiel</translation> +<translation id="349667858031092827">Časové pásmo automaticky nezisťovať.</translation> +<translation id="350443680860256679">Konfigurovať ARC</translation> <translation id="3504791027627803580">Určuje webovú adresu vyhľadávača použitého na poskytovanie vyhľadávania obrázkov. Žiadosti o vyhľadávanie sa budú odosielať pomocou metódy GET. Ak je nastavené pravidlo DefaultSearchProviderImageURLPostParams, budú žiadosti o vyhľadávanie obrázkov používať namiesto toho metódu POST. Toto pravidlo je voliteľné. Ak nie je nastavené, nepoužije sa žiadne vyhľadávanie obrázkov. @@ -747,7 +804,7 @@ Hodnota pravidla by mala byť uvedená v milisekundách. Hodnoty musia byť v rozsahu od 30 sekúnd do 24 hodín.</translation> <translation id="3528000905991875314">Povoliť alternatívne chybové stránky</translation> -<translation id="3538538104630456270">Toto súvisiace nastavenie sa používalo predtým, ako bolo prestavené opätovné overenie pri zobrazovaní hesiel. Odvtedy nemalo toto nastavenie, a teda ani toto pravidlo, žiadny vplyv na správanie Chromu. Aktuálne správanie Chromu je teraz rovnaké, ako keby bolo toto pravidlo nastavené na možnosť, ktorá zakazuje zobrazovanie hesiel formou čitateľného textu na stránke s nastaveniami správcu hesiel. Znamená to, že stránka s nastaveniami obsahuje iba zástupný symbol a Chrome zobrazí heslo iba po kliknutí na možnosť Zobraziť (a po opätovnom overení, ak ho používate). Pôvodný popis tohto pravidla je uvedený nižšie. +<translation id="3538538104630456270">Toto súvisiace nastavenie sa používalo predtým, ako bolo predstavené opätovné overenie pri zobrazovaní hesiel. Odvtedy nemalo toto nastavenie, a teda ani toto pravidlo, žiadny vplyv na správanie Chromu. Aktuálne správanie Chromu je teraz rovnaké, ako keby bolo toto pravidlo nastavené na možnosť, ktorá zakazuje zobrazovanie hesiel formou čitateľného textu na stránke s nastaveniami správcu hesiel. Znamená to, že stránka s nastaveniami obsahuje iba zástupný symbol a Chrome zobrazí heslo iba po kliknutí na možnosť Zobraziť (a po opätovnom overení, ak ho používate). Pôvodný popis tohto pravidla je uvedený nižšie. Určuje, či môžu používatelia zobraziť heslá v správcovi hesiel formou čitateľného textu. @@ -873,6 +930,22 @@ Ak je toto pravidlo nastavené na možnosť Uchovať súbory cookie počas trvania relácie, súbory cookie sa po ukončení relácie vymažú. Upozorňujeme, že ak je prehliadač <ph name="PRODUCT_NAME" /> spustený v režime na pozadí, relácia sa nemusí ukončiť po zavretí posledného okna. Ďalšie informácie o konfigurácii tohto správania nájdete pri pravidle BackgroundModeEnabled. Ak ponecháte toto pravidlo nenastavené, použije sa pravidlo AllowCookies a používateľ ho bude môcť zmeniť.</translation> +<translation id="4098957623809244159">Toto pravidlo je zastarané, použite namiesto neho režim ProxyMode. + + Umožní zadať aplikácie ARC a proxy server, ktorý bude <ph name="PRODUCT_NAME" /> používať. Zabraňuje používateľom zmeniť nastavenia proxy servera. + + Ak sa rozhodnete proxy server nikdy nepoužívať a vždy sa pripájať ručne, budú všetky ostatné možnosti ignorované. + + Ak sa rozhodnete používať systémové nastavenia proxy servera alebo proxy server zisťovať automaticky, budú všetky ostatné možnosti ignorované. + + Ak zvolíte možnosť ručného nastavenia proxy servera, môžete zvoliť ďalšie možnosti v častiach „Adresa (alebo webová adresa) proxy servera“, „Webová adresa súboru .pac proxy servera“ a „Zoznam pravidiel vynechania proxy servera oddelených čiarkami“. + + Podrobné príklady nájdete na adrese: + <ph name="PROXY_HELP_URL" /> + + Ak toto nastavenie povolíte, <ph name="PRODUCT_NAME" /> bude ignorovať všetky možnosti týkajúce sa proxy serverov zadané pomocou príkazového riadka. + + Ak toto pravidlo nenastavíte, umožníte tým používateľom zvoliť si svoje vlastné nastavenia proxy servera.</translation> <translation id="4103289232974211388">Presmerovanie na poskytovateľa identity SAML po potvrdení používateľom</translation> <translation id="410478022164847452">Určuje dobu nečinnosti používateľa, po ktorej systém vykoná príslušnú akciu nečinnosti pri používaní napájacieho zdroja. @@ -1356,6 +1429,14 @@ <translation id="5893553533827140852">Ak je toto nastavenie povolené, žiadosti o overenie gnubby budú sprostredkované cez vzdialené pripojenie hostiteľa. Ak je toto nastavenie zakázané alebo nie je nakonfigurované, žiadosti o overenie gnubby nebudú sprostredkované.</translation> +<translation id="5900959132054596599">Pri hostiteľoch v uvedenom zozname <ph name="PRODUCT_NAME" /> a aplikácie ARC vynechajú všetky proxy servery. + + Toto pravidlo sa prejaví len v prípade, ak ste v časti „Zvoľte spôsob konfigurácie nastavení proxy servera“ zvolili ručné nastavenia proxy servera. + + Ak ste zvolili akýkoľvek iný režim nastavenia pravidiel proxy, mali by ste toto pravidlo ponechať nenastavené. + + Viac podrobných príkladov nájdete na adrese: + <ph name="PROXY_HELP_URL" /></translation> <translation id="5921713479449475707">Povoliť stiahnutia automatických aktualizácií prostredníctvom protokolu HTTP</translation> <translation id="5921888683953999946">Nastaví predvolený stav veľkého kurzora (funkcia na uľahčenie prístupu) na prihlasovacej obrazovke. @@ -1504,6 +1585,7 @@ <translation id="637934607141010488">Nahlásenie zoznamu používateľov zariadenia, ktorí sa nedávno prihlásili. Ak je toto pravidlo nastavené na hodnotu False, používatelia sa nenahlásia.</translation> +<translation id="639009029157091157">Ponechať na rozhodnutí používateľov.</translation> <translation id="6392973646875039351">Povoľuje v prehliadači <ph name="PRODUCT_NAME" /> funkciu Automatické dopĺňanie a umožňuje používateľom automaticky dopĺňať polia webových formulárov pomocou uložených údajov (napr. adresa alebo číslo kreditnej karty). Ak toto nastavenie zakážete, používatelia nebudú mať k funkcii Automatické dopĺňanie prístup. @@ -1769,11 +1851,6 @@ Ak nastavíte pravidlo RestoreOnStartup, aby obnovilo webové adresy z predchádzajúcich relácií, nebude dodržané a súbory cookie budú pre dané stránky uložené natrvalo.</translation> <translation id="7207095846245296855">Vynútiť Bezpečné vyhľadávanie Google</translation> -<translation id="7213425178181578730">Ak je toto pravidlo nastavené na možnosť False, <ph name="PRODUCT_OS_NAME" /> vypne Bluetooth a používateľ ho nebude môcť zapnúť späť. - - Ak je toto pravidlo nastavené na možnosť True alebo je ponechané nenastavené, používateľ bude môcť Bluetooth zapnúť či vypnúť podľa potreby. - - Keď je toto pravidlo nastavené, používateľ ho nemôže zmeniť ani prepísať.</translation> <translation id="7216442368414164495">Umožniť používateľom prihlásenie do rozšírených prehľadov Bezpečného prehliadania</translation> <translation id="7227967227357489766">Definuje zoznam používateľov, ktorí majú povolenie prihlásiť sa do zariadenia. Položky majú formát <ph name="USER_WHITELIST_ENTRY_FORMAT" />, napríklad <ph name="USER_WHITELIST_ENTRY_EXAMPLE" />. Ak chcete povoliť všetkých používateľov z niektorej domény, použite položky vo formáte <ph name="USER_WHITELIST_ENTRY_WILDCARD" />. @@ -1882,6 +1959,9 @@ Ak je toto nastavenie zakázané alebo nenastavené, prehliadač <ph name="PRODUCT_NAME" /> použije preferované miestne nastavenie určené používateľom (ak je nakonfigurované) alebo miestne nastavenie systému alebo záložné nastavenie en-US.</translation> <translation id="7651739109954974365">Určuje, či bude v zariadení povolený roaming pre dátové prenosy. Ak je pravidlo nastavené na hodnotu true, roaming pre dátové prenosy bude povolený. Ak ho ponecháte nenakonfigurované alebo ho nastavíte na hodnotu false, roaming pre dátové prenosy nebude k dispozícii.</translation> +<translation id="7667184304362487902">Nakonfiguruje nastavenia servera proxy pre <ph name="PRODUCT_NAME" /> a aplikácie ARC. + + Toto pravidlo ešte nie je pripravené na používanie, preto ho radšej nepoužívajte.</translation> <translation id="76810863974142048">Webová adresa, kde klienti so vzdialeným prístupom získajú token na overenie totožnosti. Ak nastavíte toto pravidlo, hostiteľ vzdialeného prístupu bude od klientov overujúcich svoju totožnosť vyžadovať token na overenie totožnosti z tejto webovej adresy, aby ich mohol pripojiť. Musíte ho použiť v kombinácii s pravidlom RemoteAccessHostTokenValidationUrl. @@ -1954,6 +2034,19 @@ <translation id="7842869978353666042">Konfigurácia možností služby Disk Google</translation> <translation id="7843525027689416831">Určuje príznaky, ktoré sa použijú pri spúšťaní prehliadača <ph name="PRODUCT_NAME" />. Určené príznaky budú použité iba na prihlasovacej obrazovke. Príznaky nastavené prostredníctvom tohto pravidla sa neprenesú do relácií používateľov.</translation> <translation id="7848840259379156480">Umožňuje konfigurovať vykresľovací modul HTML počas inštalácie doplnku <ph name="PRODUCT_FRAME_NAME" />. V predvolenom nastavení môže vykresľovanie vykonávať hostiteľský prehliadač, toto nastavenie však môžete prekonať a namiesto toho vykresľovať stránky HTML pomocou doplnku <ph name="PRODUCT_FRAME_NAME" />.</translation> +<translation id="7853178359124471330">Keď je toto pravidlo nastavené, postup automatického zisťovania časového pásma bude prebiehať jedným z nasledujúcich spôsobov v závislosti od hodnoty nastavenia: + + Ak je nastavená hodnota TimezoneAutomaticDetectionUsersDecide, používatelia budú môcť ovládať automatické zisťovanie časového pásma pomocou normálnych ovládacích prvkov v časti chrome://settings. + + Ak je nastavená hodnota TimezoneAutomaticDetectionDisabled, budú ovládacie prvky automatického časového pásma v časti chrome://settings zakázané. Automatické zisťovanie časového pásma bude vždy vypnuté. + + Ak je nastavená hodnota TimezoneAutomaticDetectionIPOnly, budú ovládacie prvky časového pásma v časti chrome://settings zakázané. Automatické zisťovanie časového pásma bude vždy zapnuté. Zisťovanie časového pásma bude na rozpoznávanie polohy používať iba metódu založenú na adrese IP. + + Ak je nastavená hodnota TimezoneAutomaticDetectionSendWiFiAccessPoints, budú ovládacie prvky časového pásma v časti chrome://settings zakázané. Automatické zisťovanie časového pásma bude vždy zapnuté. Na server s rozhraním Geolocation API sa bude vždy odosielať zoznam viditeľných prístupových bodov Wi-Fi s cieľom zaistiť podrobnejšie zisťovanie časového pásma. + + Ak je toto pravidlo nenastavené, bude sa považovať hodnota TimezoneAutomaticDetectionUsersDecide za nastavenú. + + Ak je nastavené pravidlo SystemTimezone, toto pravidlo prepíše. V tomto prípade bude automatické zisťovanie časového pásma úplne zakázané.</translation> <translation id="7882585827992171421">Toto pravidlo je aktívne iba v režime určenom pre predaj. Určuje identifikátor rozšírenia, ktoré sa má použiť ako šetrič obrazovky na prihlasovacej obrazovke. Rozšírenie musí byť súčasťou balíka AppPack, ktorý bol pre túto doménu nakonfigurovaný v rámci pravidla DeviceAppPack.</translation> @@ -1997,6 +2090,7 @@ Ak toto pravidlo ponecháte nenastavené, nastavenie sa povolí.</translation> <translation id="8073243368829195">Povoliť použitie funkcie Smart Lock</translation> +<translation id="8074052133552427532">Vždy používať hrubé zisťovanie časového pásma.</translation> <translation id="8099880303030573137">Oneskorenie režimu nečinnosti pri napájaní z batérie</translation> <translation id="8102913158860568230">Predvolené nastavenie mediálneho streamu</translation> <translation id="8104962233214241919">Automaticky vybrať certifikáty klienta pre tieto webové stránky</translation> @@ -2110,6 +2204,7 @@ <translation id="8424255554404582727">Nastaviť predvolené otočenie obrazovky, ktoré sa opakovane použije pri každom reštarte</translation> <translation id="8426231401662877819">Otočiť obrazovku v smere hodinových ručičiek o 90 stupňov</translation> <translation id="8451988835943702790">Použiť stránku Nová karta ako domovskú stránku</translation> +<translation id="8458790683633857482">Určuje skupinu pravidiel, ktoré budú postúpené na spustenie ARC. Hodnota musí mať platný formát JSON.</translation> <translation id="8465065632133292531">Parametre pre webovú adresu okamžitého vyhľadávania, ktorá používa metódu POST</translation> <translation id="847472800012384958">Zakázať všetkým stránkam zobrazovať kontextové okná</translation> <translation id="8477885780684655676">TLS 1.0</translation> @@ -2237,9 +2332,12 @@ Ak je toto pravidlo nastavené na hodnotu false, do režimu celej obrazovky nemôžu vstúpiť ani používatelia, ani aplikácie či rozšírenia. Keď je režim celej obrazovky zakázaný, je na všetkých platformách okrem systému <ph name="PRODUCT_OS_NAME" /> zakázaný aj režim verejného terminálu.</translation> +<translation id="8795495354632096254">Počas rozpoznávania časového pásma vždy odosielať prístupové body Wi-Fi na server.</translation> <translation id="8818173863808665831">Nahlási geografickú polohu zariadenia. Ak toto pravidlo nie je nastavené alebo je nastavené na hodnotu false, poloha sa nahlasovať nebude.</translation> +<translation id="8818768076343557335">Predvídať akcie všetkých sietí, ktoré nie sú mobilné. + (Zastarané vo verzii 50, odstránené vo verzii 52. Ak je vo verziách novších ako 52 nastavená hodnota 1, bude považovaná za hodnotu 0 – predvídať akcie siete pri ľubovoľnom sieťovom pripojení.)</translation> <translation id="8828766846428537606">Nakonfiguruje v prehliadači <ph name="PRODUCT_NAME" /> predvolenú domovskú stránku a zabráni ju používateľom zmeniť. Nastavenia domovskej stránky používateľa sú úplne uzamknuté len vtedy, ak nastavíte domovskú stránku na stránku Nová karta alebo na vopred určenú webovú adresu domovskej stránky. Ak túto webovú adresu neurčíte, používateľ bude stále môcť nastaviť domovskú stránku na stránku Nová karta pomocou príkazu „chrome://newtab“.</translation> <translation id="8833109046074170275">Overenie totožnosti prostredníctvom predvoleného postupu GAIA</translation> <translation id="8838303810937202360"><ph name="PRODUCT_OS_NAME" /> ukladá do vyrovnávacej pamäte aplikácie a rozšírenia, ktoré môže nainštalovať viacero používateľov jedného zariadenia. Aplikácie a rozšírenia tak nemusí každý používateľ opätovne sťahovať. @@ -2298,6 +2396,7 @@ <translation id="9042911395677044526">Umožňuje preniesť konfiguráciu siete, ktorá sa použije pre jednotlivých používateľov v zariadení so systémom <ph name="PRODUCT_OS_NAME" />. Konfigurácia siete je reťazec vo formáte JSON, ktorý sa riadi definíciou formátu Open Network Configuration uvedenou na adrese <ph name="ONC_SPEC_URL" /></translation> <translation id="9084985621503260744">Určuje, či prehrávanie videa ovplyvňuje správu napájania</translation> <translation id="9088433379343318874">Povoliť poskytovateľa obsahu pre kontrolovaného používateľa</translation> +<translation id="9088444059179765143">Konfigurovať spôsob automatického zisťovania časového pásma</translation> <translation id="9096086085182305205">Zoznam povolených overovacích serverov</translation> <translation id="9098553063150791878">Pravidlá pre overenie HTTP</translation> <translation id="9104138886225968319">Odosielanie sledovania signálov heartbeat na správcovský server,
diff --git a/components/policy/resources/policy_templates_sl.xtb b/components/policy/resources/policy_templates_sl.xtb index fdffb271..b00ab5e 100644 --- a/components/policy/resources/policy_templates_sl.xtb +++ b/components/policy/resources/policy_templates_sl.xtb
@@ -1780,11 +1780,6 @@ Če je pravilnik »RestoreOnStartup« nastavljen, da se obnovijo URL-ji prejšnjih sej, ta pravilnik ne bo upoštevan in piškotki za ta spletna mesta bodo trajno shranjeni.</translation> <translation id="7207095846245296855">Uveljavi Google Varno iskanje</translation> -<translation id="7213425178181578730">Če je ta pravilnik onemogočen, bo <ph name="PRODUCT_OS_NAME" /> onemogočil Bluetooth in ga uporabnik ne bo mogel znova omogočiti. - - Če je ta pravilnik omogočen ali ni nastavljen, bo uporabnik Bluetooth lahko po želji omogočil ali onemogočil. - - Če je ta pravilnik nastavljen, ga uporabnik ne more spremeniti ali preglasiti.</translation> <translation id="7216442368414164495">Uporabnikom dovoli prijavo za razširjeno poročanje za Varno brskanje</translation> <translation id="7227967227357489766">Določa seznam uporabnikov, ki se lahko prijavijo v napravo. Vnosi so v obliki <ph name="USER_WHITELIST_ENTRY_FORMAT" />, na primer <ph name="USER_WHITELIST_ENTRY_EXAMPLE" />. Če želite omogočiti poljubne uporabnike v domeni, naj bodo vnosi v obliki <ph name="USER_WHITELIST_ENTRY_WILDCARD" />.
diff --git a/components/policy/resources/policy_templates_sr.xtb b/components/policy/resources/policy_templates_sr.xtb index 6a83f15..e953e1a11 100644 --- a/components/policy/resources/policy_templates_sr.xtb +++ b/components/policy/resources/policy_templates_sr.xtb
@@ -1757,11 +1757,6 @@ Ако подесите смернице „RestoreOnStartup“ тако да враћају URL-ове из претходних сесија, те смернице неће бити примењиване и колачићи ће трајно бити чувани за те сајтове.</translation> <translation id="7207095846245296855">Наметни Google сигурну претрагу</translation> -<translation id="7213425178181578730">Ако подесите ове смернице на Нетачно, <ph name="PRODUCT_OS_NAME" /> ће онемогућити Bluetooth и корисник неће моћи да га поново омогући. - - Ако подесите ове смернице на Тачно или их не конфигуришете, корисник ће моћи да омогући или онемогући Bluetooth по жељи. - - Ако подесите ове смернице, корисник не може да их промени или замени.</translation> <translation id="7216442368414164495">Омогући корисницима да изаберу детаљно извештавање о Безбедном прегледању</translation> <translation id="7227967227357489766">Дефинише листу корисника којима је дозвољено да се пријаве на уређај. Уноси су у формату <ph name="USER_WHITELIST_ENTRY_FORMAT" />, као што је <ph name="USER_WHITELIST_ENTRY_EXAMPLE" />. Да бисте омогућили произвољне кориснике на домену, користите уносе у формату <ph name="USER_WHITELIST_ENTRY_WILDCARD" />.
diff --git a/components/policy/resources/policy_templates_sv.xtb b/components/policy/resources/policy_templates_sv.xtb index 899da9d..2d0974f7 100644 --- a/components/policy/resources/policy_templates_sv.xtb +++ b/components/policy/resources/policy_templates_sv.xtb
@@ -1786,11 +1786,6 @@ Om policyn RestoreOnStartup är inställd på att återställa webbadresser från tidigare sessioner fungerar inte den här policyn och cookies sparas inte permanent för dessa webbplatser.</translation> <translation id="7207095846245296855">Tvinga fram användning av Google SafeSearch</translation> -<translation id="7213425178181578730">Om principen är inställd på falskt inaktiveras Bluetooth för <ph name="PRODUCT_OS_NAME" /> och användaren kan inte aktivera det igen. - - Om principen är inställd på sant eller inte inställd alls kan användaren aktivera eller inaktivera Bluetooth när den vill. - - Om principen är inställd kan användaren inte ändra eller åsidosätta den.</translation> <translation id="7216442368414164495">Tillåt användare att välja utökad rapportering i Säker webbsökning</translation> <translation id="7227967227357489766">Definierar listan med användare som får logga in på enheten. Poster har formatet <ph name="USER_WHITELIST_ENTRY_FORMAT" />, till exempel <ph name="USER_WHITELIST_ENTRY_EXAMPLE" />. Om du vill att användare ska kunna logga in på en domän helt godtyckligt använder du poster i formatet <ph name="USER_WHITELIST_ENTRY_WILDCARD" />.
diff --git a/components/policy/resources/policy_templates_sw.xtb b/components/policy/resources/policy_templates_sw.xtb index ba9942f..6bab225 100644 --- a/components/policy/resources/policy_templates_sw.xtb +++ b/components/policy/resources/policy_templates_sw.xtb
@@ -155,6 +155,18 @@ <translation id="1561424797596341174">Ubatilishaji wa sera kwa miundo ya Hitilafu ya seva pangishi ya ufikiaji wa mbali</translation> <translation id="1583248206450240930">Tumia <ph name="PRODUCT_FRAME_NAME" /> kwa chaguo-msingi</translation> <translation id="1608755754295374538">URL ambazo zitapewa ufikiaji wa vifaa vya kunasa sauti bila ushawishi</translation> +<translation id="1613574633990410986">Hukuruhusu kubainisha seva mbadala inayotumiwa na <ph name="PRODUCT_NAME" /> na programu za ARC na huwazuia watumiaji kubadilisha mipangilio ya seva mbadala. + + Ukichagua kutotumia seva mbadala kamwe na kuunganisha moja kwa moja kila wakati, chaguo nyingine zote zitapuuzwa. + + Ukichagua kugundua seva mbadala kiotomatiki, chaguo nyingine zote zitapuuzwa. + + Kwa mifano ya kina, tembelea: + <ph name="PROXY_HELP_URL" /> + + Ukiwasha mipangilio hii, <ph name="PRODUCT_NAME" /> na programu za ARC zipuuze chaguo zote zinazohusishwa na seva mbadala zilizobainishwa kwenye mstari wa amri. + + Kuacha sera hizi bila kuwekwa kutawaruhusu watumiaji kuchagua mipangilio ya seva mbadala wenyewe.</translation> <translation id="1617235075406854669">Washa ufutaji wa historia ya upakuaji na kivinjari</translation> <translation id="1617384279878333801">Washa kipengee cha kuongeza mtu katika kidhibiti cha wasifu</translation> <translation id="1655229863189977773">Weka ukubwa wa akiba ya diski katika baiti</translation> @@ -230,6 +242,15 @@ Ukizima mpangilio huu, wakati wowote mtumiaji anapotekeleza kitendo ambacho kinaweza kufanya kidadisi cha uteuzi faili kionyeshwe (kama kuingiza alamisho, kupakia faili, kuhifadhi viungo, n.k.) ujumbe unaonyeshwa badala yake na mtumiaji anachukuliwa kwamba amebofya Ghairi kwenye kidadisi cha uteuzi wa faili. Ikiwa mpangilio huu haujawekwa, watumiaji wanaweza kufungua kidadisi cha uteuzi faili kama kawaida.</translation> +<translation id="1879485426724769439">Hubainisha saa za eneo zitakazotumiwa kwa kifaa. Watumiaji wanaweza kufuta saa za eneo kwa kipindi cha sasa. Hata hivyo, baada ya kuondoka kwenye akaunti, itarudishwa kwenye saa za eneo lililobainishwa. Ikiwa thamani isiyo sahihi itatolewa, bado sera itawezeshwa kwa kutumia "GMT". Ikiwa mfuatano mtupu utatolewa, sera hii itapuuzwa. + + Sera hii isipotumiwa, saa za sasa za eneo zinazotumika zitaendelea kutumiwa ingawa watumiaji wanaweza kubadilisha saa za eneo na mabadiliko haya yatadumu. Kwa hivyo, mabadiliko yanayofanywa na mtumiaji mmoja yataathiri skrini ya kuingia katika akaunti na watumiaji wengine wote. + + Vifaa vipya huanza huku saa za eneo zikiwa katika hali ya "US/Pacific". + + Muundo wa thamani hufuata majina ya saa za eneo katika "Hifadhidata ya Saa za Eneo za IANA" (tembelea "https://en.wikipedia.org/wiki/Tz_database"). Hususan, saa nyingi za eneo zinaweza kurejelewa kulingana na "bara/jiji_kuu" au "bahari/jiji_kuu". + + Kuweka mipangilio hii kutazima kabisa kipengee cha kutatua saa za eneo kiotomatiki kulingana na eneo la kifaa. Pia kutabatilisha sera ya SystemTimezoneAutomaticDetection.</translation> <translation id="1897365952389968758">Ruhusu tovuti zote ziendeshe JavaScript</translation> <translation id="193259052151668190">Orodha ya vifaa vya USB vinavyoweza kutenganishwa vilivyoidhinishwa</translation> <translation id="1933378685401357864">Picha ya mandhari</translation> @@ -627,6 +648,24 @@ <translation id="3072847235228302527">Weka Sheria na Masharti kwa akaunti ya kifaa cha karibu nawe</translation> <translation id="3096595567015595053">Orodha ya programu jalizi zilizowezeshwa</translation> <translation id="3101501961102569744">Chagua jinsi ya kubainisha mipangilio ya seva mbadala</translation> +<translation id="3125884964575432854">Hukuruhusu kubainisha seva mbadala inayotumiwa na <ph name="PRODUCT_NAME" /> na programu za ARC na huwazuia watumiaji kubadilisha mipangilio ya seva mbadala. + + Ukichagua kutotumia seva mbadala kamwe na kuunganisha moja kwa moja kila wakati, chaguo nyingine zote zitapuuzwa. + + Ukichagua kutumia mipangilio ya mfumo wa seva mbadala, chaguo nyingine zote zitapuuzwa. + + Ukichagua kugundua seva mbadala kiotomatiki, chaguo nyingine zote zitapuuzwa. + + Ukichagua hali isiyobadilika ya seva mbadala, unaweza kubainisha chaguo nyingine katika 'Anwani au URL ya seva mbadala' na 'orodha iliyotenganishwa kwa koma ya sheria za ukwepaji seva mbadala'. Programu za ARC zitatumia tu seva mbadala ya HTTP yenye umuhimu wa juu. + + Ukichagua kutumia hati ya seva mbadala ya .pac, lazima ubainishe URL ya hati katika 'URL kwenye faili ya .pac ya seva mbadala'. + + Kwa mifano ya kina, tembelea: + <ph name="PROXY_HELP_URL" /> + + Ukiwasha mipangilio hii, <ph name="PRODUCT_NAME" /> na programu za ARC zitapuuza chaguo nyingine zote zinazohusishwa na seva mbadala zilizobainishwa kwenye mstari wa amri. + + Kuacha sera hii bila kuiweka kutaruhusu watumiaji wachague mipangilio ya seva mbadala wenyewe.</translation> <translation id="3153348162326497318">Inakuruhusu kubainisha viendelezi vipi ambavyo watumiaji HAWAWEZI kusakinisha. Viendelezi ambavyo tayari vimesakinishwa vitaondolewa ikiwa vitaondolewa idhini. Thamani ilioondolewa idhini ya '*' inamaanisha viendelezi vyote vimeondolewa idhini isipokuwa vimeorodheshwa bayana katika orodha ya kutoa idhini. @@ -703,6 +742,18 @@ Sera hii ikiachwa bila kuwekwa, thamani chaguo-msingi ya kote duniani itatumiwa kwenye tovuti zote iwe ni kutoka sera ya 'DefaultKeygenSetting', ikiwa imewekwa, la sivyo mipangilio ya kibinafsi ya mtumiaji itatumika.</translation> <translation id="3381968327636295719">Tumia kivinjari kipangishi kwa chaguo-msingi</translation> +<translation id="3398137877608138703">Ruhusu au ukatae kurekodi video. + + Kipengee hiki kikiwashwa au kisiposanidiwa (chaguo-msingi), mtumiaji atadokezewa + kufikia kurekodi video isipokuwa kwa URL zilizosanidiwa katika + orodha ya VideoCaptureAllowedUrls ambayo itapewa idhini ya ufikiaji bila kudokeza. + Programu za ARC zitaweza kufikia kamera ikiwa zimeruhusiwa. + + Sera hii inapozimwa, mtumiaji hatawahi kudokezewa tena na kipengee + cha kupiga picha za video kitapatikana tu kwa URL iliyosanidiwa ya VideoCaptureAllowedUrls. + Programu za ARC hazitaweza kufikia kamera. + + Nje ya programu za ARC, sera hii inaathiri aina zote za vifaa vya kuingiza video na siyo tu kamera iliyojumuishwa ndani.</translation> <translation id="3417418267404583991">Ikiwa sera hii itawekwa kwenye Ndivyo au haitasanidiwa, <ph name="PRODUCT_OS_NAME" /> haitawezesha uingiaji wa mgeni. Uingiaji wa mgeni ni vipindi visivyojulikana vya mtumiaji na havihitaji nenosiri.. Ikiwa sera hii itawekwa kwenye Sivyo, <ph name="PRODUCT_OS_NAME" /> haitaruhusu vipindi vya mgeni kuanzishwa.</translation> @@ -720,6 +771,8 @@ <translation id="3478024346823118645">Futa data ya mtumiaji unapoondoka</translation> <translation id="348495353354674884">Wezesha kibodi isiyobayana</translation> <translation id="3496296378755072552">Kidhibiti cha nenosiri</translation> +<translation id="349667858031092827">Usiwahi kugundua saa za eneo kiotomatiki.</translation> +<translation id="350443680860256679">Sanidi ARC</translation> <translation id="3504791027627803580">Hubainisha URL ya injini tafuti inayotumika kutoa utafutaji kwa picha. Maombi ya utafutaji yatatumwa kwa kutumia mbinu ya GET. Kama sera ya DefaultSearchProviderImageURLPostParams imewekwa basi maombi ya utafutaji kwa picha yatatumia mbinu ya POST badala yake. Sera hii ni ya hiari. Isipowekwa, hakuna utafutaji kwa picha utakaotumika. @@ -868,6 +921,22 @@ Sera hii ikiwekwa 'Weka vidakuzi kwa muda wa kipindi' basi vidakuzi vitafutwa kipindi kikifungwa. Kumbuka kwamba ikiwa <ph name="PRODUCT_NAME" /> inatekeleza katika 'hali ya chini chini', huenda kipindi kisifungwe wakati dirisha la mwisho litakapofungwa. Tafadhali angalia sera ya 'BackgroundModeEnabled' kwa maelezo zaidi kuhusu kusanidi tabia hii. Sera hii ikiachwa bila kuwekwa, kipengee cha 'AllowCookies' kitatumiwa na mtumiaji ataweza kukibadilisha.</translation> +<translation id="4098957623809244159">Sera hii imeacha kufanya kazi, badala yake tumia ProxyMode. + + Hukuruhusu kubainisha seva mbadala inayotumiwa na <ph name="PRODUCT_NAME" /> na programu za ARC-na huwazuia watumiaji kubadilisha mipangilio ya seva mbadala. + + Ukichagua kutotumia seva mbadala kamwe na kuunganisha moja kwa moja kila wakati, chaguo nyingine zote zitapuuzwa. + + Ukichagua kutumia mipangilio ya mfumo wa seva mbadala au kugundua seva mbadala kiotomatiki, chaguo nyingine zote zitapuuzwa. + + Ukichagua mipangilio ya kujiundia ya seva mbadala, unaweza kubainisha chaguo zaidi katika 'Anwani au URL ya seva mbadala', 'URL ya seva mbadala ya faili ya .pac' na 'orodha iliyotenganishwa kwa koma ya sheria za ukwepaji wa seva mbadala'. + + Kwa mifano ya kina, tembelea: + <ph name="PROXY_HELP_URL" /> + + Ukiwasha mipangilio hii, <ph name="PRODUCT_NAME" /> itapuuza chaguo zote zinazohusiana na seva mbadala zilizobainishwa kwenye mstari wa amri. + + Ukiwacha sera hii bila kuwekwa utawaruhusu watumiaji kuchagua mipangilio ya seva mbadala wenyewe.</translation> <translation id="4103289232974211388">Elekeza kwenye SAML IdP baada ya uthibitishaji wa mtumiaji</translation> <translation id="410478022164847452">Hubainisha urefu wa muda bila mchango wa mtumiaji ambao baadaye hatua isiyo na shughuli huchukuliwa inapoendeshwa kwenye nishati ya AC. @@ -1344,6 +1413,14 @@ <translation id="5893553533827140852">Mpangilio huu ukiwashwa, basi maombi ya uthibitisho ya gnubby yatawekwa kama proksi kupitia muunganisho wa mpangishi wa mbali. Mpangilio huu ukizimwa au usisanidiwe, maombi ya uthibitisho ya gnubby hayatawekwa kama proksi.</translation> +<translation id="5900959132054596599"><ph name="PRODUCT_NAME" /> na programu za ARC zitakwepa seva mbadala yoyote ya orodha ya seva pangishi zilizotolewa hapa. + + Sera hii itatekelezwa tu ikiwa umechagua mipangilio ya seva mbadala kwenye "Chagua jinsi ya kubainisha mipangilio ya seva mbadala'. + + Unapaswa kuacha sera hii bila kuwekwa ikiwa umechagua hali nyingine yoyote ya kuweka sera za seva mbadala. + + Kwa mifano zaidi ya kina, tembelea: + <ph name="PROXY_HELP_URL" /></translation> <translation id="5921713479449475707">Ruhusu vipakuliwa vya kusasisha kiotomatiki kupitia HTTP</translation> <translation id="5921888683953999946">Weka hali chaguo-msingi ya kipengele cha upatikanaji wa kishale kikubwa kwenye skrini ya kuingia katika akaunti. @@ -1492,6 +1569,7 @@ <translation id="637934607141010488">Ripoti orodha ya watumiaji wa kifaa ambao waliingia katika akaunti hivi karibuni. Ikiwa sera imewekwa kuwa uongo, watumiaji hawataripotiwa.</translation> +<translation id="639009029157091157">Waache watumiaji waamue.</translation> <translation id="6392973646875039351">Inawezesha kipengele cha Mjazo Otomatiki cha <ph name="PRODUCT_NAME" /> na huruhusu watumiaji kukamilisha wavuti kiotomatiki kwa kutumia maelezo ya awali yaliyohifadhiwa kama anwani au maelezo ya kadi ya mkopo. Ukiuzima mpangilio huu, Mjazo Otomatiki hautafikiwa na watumiaji. @@ -1748,11 +1826,6 @@ Ikiwa sera ya "RestoreOnStartup" itawekwa kurejesha URL za vipindi vya awali, sera hii haitazingatiwa na vidakuzi vitahifadhiwa kabisa kwa tovuti hizo.</translation> <translation id="7207095846245296855">Lazimisha Google SafeSearch</translation> -<translation id="7213425178181578730">Sera hii ikiwekwa kuwa sivyo, <ph name="PRODUCT_OS_NAME" /> itazima Bluetooth na mtumiaji hataweza kuiwasha tena. - - Sera hii ikiwekwa kuwa ndivyo au isiwekwe, mtumiaji ataweza kuwasha au kuzima Bluetooth apendavyo. - - Sera hii ikiwekwa, mtumiaji hawezi kuibadilisha au kuibatilisha.</translation> <translation id="7216442368414164495">Ruhusu watumiaji kuchagua kuingia katika kuripoti Kuvinjari Salama kulikopanuliwa</translation> <translation id="7227967227357489766">Inafafanua orodha ya watumiaji ambao wanaruhusiwa kuingia kwenye kifaa. Maingizo yamo kwenye aina <ph name="USER_WHITELIST_ENTRY_FORMAT" />, kama vile <ph name="USER_WHITELIST_ENTRY_EXAMPLE" />. Ili kuruhusu watumiaji wa kufunga kwenye kikoa, tumia maingizo ya aina ya <ph name="USER_WHITELIST_ENTRY_WILDCARD" />. @@ -1866,6 +1939,9 @@ Ikiwa mpangilio huu utalemazwa au haujawekwa, <ph name="PRODUCT_NAME" /> hutumia lugha inayopendelewa iliyobainishwa na mtumiaji (ikiwa imesanidiwa), lugha ya mfumo au lugha mbadala 'en-US'.</translation> <translation id="7651739109954974365">Inathibitisha iwapo utumiaji wa data nje ya mtandao wako unapaswa kuwezeshwa kwa kifaa. Ikiwa itawekwa kuwa Ndivyo, utumiaji wa data nje ya mtandao wako unawezeshwa. Ikiwa hautasanidiwa au kuwekwa kuwa siyo Ndivyo, utumiaji wa data nje ya mtandao wako hautapatikana.</translation> +<translation id="7667184304362487902">Huweka mipangilio ya seva mbadala ya <ph name="PRODUCT_NAME" /> na programu za ARC. + + Sera hii bado haiko tayari kwa matumizi, tafadhali usiitumie.</translation> <translation id="76810863974142048">URL ambapo seva teja za uwezo wa kufikia kwa mbali zanapaswa kupata tokeni yao ya uthibitishaji. Sera hii ikiwekwa, seva pangishi ya uwezo wa kufikia kwa mbali itahitaji seva teja zinazothibitisha kupata tokeni ya uthibitishaji kutoka kwenye URL hii ili kuunganisha. Lazima itumiwe pamoja na RemoteAccessHostTokenValidationUrl. @@ -1937,6 +2013,19 @@ <translation id="7843525027689416831">Hubainisha alama zinazotakiwa kutumika kwenye <ph name="PRODUCT_NAME" /> inapoanza. Alama zinazobainishwa hutumika kwenye skrini ya kuingia katika akaunti pekee. Alama zilizowekwa kupitia sera hii hazienei ndani ya vipindi vya mtumiaji.</translation> <translation id="7848840259379156480">Inakuruhusu kusanidi kionyeshi cha HTML chaguo-msingi wakati <ph name="PRODUCT_FRAME_NAME" /> imesakinishwa. Mpangilio chaguo-msingi ni wa kuruhusu kivinjari kipangishi kufanya uonyeshaji, lakini unaweza kufuta kwa hiari hii na kuruhusu <ph name="PRODUCT_FRAME_NAME" /> kuonyesha kurasa za HTML kwa chaguo-msingi.</translation> +<translation id="7853178359124471330">Sera hii ikiwekwa, mtiririko wa ugunduzi wa saa za eneo kiotomatiki utakuwa katika mojawapo ya njia zinazofuata, kulingana na thamani ya mipangilio: + + Ikiwekwa kuwa TimezoneAutomaticDetectionUsersDecide, watumiaji wataweza kudhibiti ugunduzi wa saa za eneo kiotomatiki kwa kutumia vidhibiti vya kawaida katika chrome://settings. + + Ikiwekwa kuwa TimezoneAutomaticDetectionDisabled, vidhibiti vya saa za eneo za kiotomatiki katika chrome://settings vitazimwa. Kipengee cha ugunduzi wa saa za eneo kiotomatiki kitakuwa kimezimwa wakati wote. + + Ikiwekwa kuwa TimezoneAutomaticDetectionIPOnly, kidhibiti cha saa za eneo katika chrome://settings vitazimwa. Kipengee cha ugunduzi wa saa za eneo kiotomatiki kitatumia njia ya IP pekee kutatua eneo. + + Ikiwekwa kuwa TimezoneAutomaticDetectionSendWiFiAccessPoints, vidhibiti vya saa za eneo katika chrome://settings vitazimwa. Kipengee cha ugunduzi wa saa za eneo kiotomatiki kitakuwa kimewashwa wakati wote. Orodha ya maeneo ya kufikia WiFi yatatumwa kwenye seva ya API ya Kutambulisha Mahali kila wakati kwa ugunduzi sahihi wa saa za eneo. + + Sera hii isipowekwa, itaonekana kama kwamba TimezoneAutomaticDetectionUsersDecide imewekwa. + + Sera ya SystemTimezone ikiwekwa, itabatilisha sera hii. Katika hali hii kipengee cha ugunduzi wa saa za eneo kiotomatiki kitazimwa kabisa.</translation> <translation id="7882585827992171421">Sera hii ni amilifu katika modi rejareja tu. Inaamua kitambulisho cha kiendelezi cha kutumiwa kama taswira ya skrini kwenye skrini ya kuingia. Lazima kiendelezi kiwe kimoja wapo cha AppPack inayosanidiwa kwa ajili ya kikoa hiki kupitia kwenye sera ya DeviceAppPack.</translation> @@ -1979,6 +2068,7 @@ Ikiwa sera hii itaachwa bila kuwekwa mpangilio utawashwa.</translation> <translation id="8073243368829195">Huruhusu Smart Lock kutumiwa</translation> +<translation id="8074052133552427532">Tumia ugunduzi usio laini wa saa za eneo kila wakati</translation> <translation id="8099880303030573137">Kutokuwa na shughuli kunachelewesha wakati wa kuendesha kwa nishati ya betri</translation> <translation id="8102913158860568230">Mpangilio chaguo-msingi wa mkondomedia</translation> <translation id="8104962233214241919">Chagua kiotomatiki vyeti vya mteja vya tovuti hizi</translation> @@ -2088,6 +2178,7 @@ <translation id="8424255554404582727">Weka mzunguko chaguo-msingi wa onyesho, unaotumika kila unapowashwa tena</translation> <translation id="8426231401662877819">Zungusha skrini kwa mwendo wa saa kwa digrii 90</translation> <translation id="8451988835943702790">Tumia Ukurasa Mpya wa Kichupo kama ukurasa wa kwanza</translation> +<translation id="8458790683633857482">Hubainisha kikundi cha sera zitakazotolewa kwa muda wa kutekeleza ARC. Lazima thamani iwe JSON sahihi.</translation> <translation id="8465065632133292531">Vigezo vya URL ya papo hapo inayotumia POST</translation> <translation id="847472800012384958">Usiruhusu tovuti yoyote kuonyesha madirisha ibukizi</translation> <translation id="8477885780684655676">TLS 1.0</translation> @@ -2223,9 +2314,12 @@ Sera hii ikiwekwa kuwa sivyo, mtumiaji ama programu haziwezi kuingia katika hali ya skrini nzima. Kwenye mifumo yote, isipokuwa <ph name="PRODUCT_OS_NAME" />, skrini nzima haipatikani wakati hali ya skrini nzima imezimwa.</translation> +<translation id="8795495354632096254">Tuma maeneo ya kufikia WiFi kwenye seva kila wakati unapotatua saa za eneo.</translation> <translation id="8818173863808665831">Ripoti eneo la jografia ya kifaa. Ikiwa sera haitawekwa, au imewekwa kwenye Sivyo, eneo halitaripotiwa.</translation> +<translation id="8818768076343557335">Tabiri vitendo vya mtandao kwenye mtandao wowote ambao si wa simu ya mkononi. + (Iliacha kufanya katika 50, ikaondolewa katika 52. Baada ya 52, ikiwa thamani 1 imewekwa, itachukuliwa kama 0 - tabiri vitendo vya mtandao kwenye muunganisho wa mtandao wowote.)</translation> <translation id="8828766846428537606">Sanidi ukurasa wa mwanzo chaguo-msingi katika <ph name="PRODUCT_NAME" /> na huzuia watumiaji kuubadilisha. Mipangilio ya ukurasa wa mtumiaji inafungwa kabisa, ukichagua ukurasa wa mwanzo kuwa ukurasa mpya wa kichupo, au uuweke kuwa URL na ubainishe URL ya ukurasa wa mwanzo. Iwapo hutaibainisha URL ya ukurasa wa mwanzo, basi bado mtumiaji anaweza kuweka ukurasa wa mwanzo kwenye ukurasa mpya wa kichupo kwa kubainisha 'chrome://newtab'.</translation> @@ -2286,6 +2380,7 @@ <translation id="9042911395677044526">Inaruhusu kusukuma kwa usanidi wa mtandao kutekelezwa kwa kila mtumiaji katika kifaa cha <ph name="PRODUCT_OS_NAME" />. Usanidi wa mtandao ni mtungo ulioumbizwa wa JSON kama ilivyofasiliwa kwa umbizo la Fungua Usanidi wa Mtandao ilivyofafanuliwa katika <ph name="ONC_SPEC_URL" /></translation> <translation id="9084985621503260744">Bainisha iwapo shughuli za video zinaathiri udhibiti wa nishati</translation> <translation id="9088433379343318874">Washa mtoa huduma za maudhui ya mtumiaji anayesimamiwa</translation> +<translation id="9088444059179765143">Sanidi mbinu ya ugunduzi wa saa za eneo kiotomatiki</translation> <translation id="9096086085182305205">Orodha ya kuidhinisha ya seva ya uthibitishaji</translation> <translation id="9098553063150791878">Sera za uthibitishaji wa HTTP</translation> <translation id="9104138886225968319">Tuma mapigo ya moyo ya ufuatiliaji kwenye seva ya udhibiti, ili uruhusu
diff --git a/components/policy/resources/policy_templates_ta.xtb b/components/policy/resources/policy_templates_ta.xtb index 764809d..d5211ccf 100644 --- a/components/policy/resources/policy_templates_ta.xtb +++ b/components/policy/resources/policy_templates_ta.xtb
@@ -671,7 +671,7 @@ மில்லிவினாடிகளில் கொள்கையின் மதிப்பு குறிப்பிடப்பட வேண்டும். மதிப்புகள் 30 வினாடிகள் முதல் 24 மணிநேரம் வரை என்ற வரம்பைக் கொண்டவை.</translation> <translation id="3528000905991875314">மாற்று பிழைப் பக்கங்களை இயக்கு</translation> -<translation id="3538538104630456270">கடவுச்சொற்களைக் காட்டுவதற்கான மறுஅங்கீகாரத்தை அறிமுகப்படுத்துவதற்கு முன்பாக, தொடர்புடைய அமைப்பு பயன்படுத்தப்பட்டது. அதன் பிறகு, அமைப்பும் இந்தக் கொள்கையும் Chrome இன் நடத்தையில் எந்தவித விளைவையும் ஏற்படுத்தவில்லை. கடவுச்சொல் நிர்வாகி அமைப்புகள் பக்கத்தில் தெளிவான உரையாகக் கடவுச்சொற்கள் காட்டப்படுவதை முடக்கும்படி கொள்கையை அமைத்தால் எப்படி இருக்குமோ, அதுபோல் Chrome இன் தற்போதைய நடத்தை உள்ளது. அதாவது அமைப்புகள் பக்கத்தில் ஒதுக்கிடம் மட்டுமே உள்ளது, மேலும் பயனர் "காட்டு" (மற்றும் பொருந்துமெனில் மறுஅங்கீகாரமளிப்பது) என்பதைக் கிளிக் செய்யும் போது மட்டுமே Chrome கடவுச்சொற்களைக் காட்டும். கொள்கையின் அசல் விளக்கம் பின்வரும்படி கீழே உள்ளது. +<translation id="3538538104630456270">கடவுச்சொற்களைக் காட்டுவதற்கான மறுஅங்கீகாரத்தை அறிமுகப்படுத்துவதற்கு முன்பாக, தொடர்புடைய அமைப்பு பயன்படுத்தப்பட்டது. அதன் பிறகு, அமைப்பும் இந்தக் கொள்கையும் Chrome இன் நடத்தையில் எந்தவித விளைவையும் ஏற்படுத்தவில்லை. கடவுச்சொல் நிர்வாகி அமைப்புகள் பக்கத்தில் தெளிவான உரையாகக் கடவுச்சொற்கள் காட்டப்படுவதை முடக்கும்படி கொள்கையை அமைத்தால் எப்படி இருக்குமோ, அதுபோல் Chrome இன் தற்போதைய நடத்தை உள்ளது. அதாவது அமைப்புகள் பக்கத்தில் ஒதுக்கிடம் மட்டுமே உள்ளது, மேலும் பயனர் "காட்டு" என்பதைக் கிளிக் செய்யும் போது (மற்றும் பொருந்துமெனில் மறுஅங்கீகாரமளிக்கும்போது) மட்டுமே Chrome கடவுச்சொற்களைக் காட்டும். கொள்கையின் அசல் விளக்கம் பின்வரும்படி கீழே உள்ளது. கடவுச்சொல் நிர்வாகியில் தெளிவான உரையாகக் கடவுச்சொற்களைப் பயனர் காட்டலாமா என்பதைக் கட்டுப்படுத்தும். @@ -1592,11 +1592,6 @@ முந்தைய அமர்வுகளில் இருந்து URLகளை மீட்டெடுக்க "RestoreOnStartup" கொள்கை அமைக்கப்பட்டால், இந்தக் கொள்கை மதிக்கப்படாமல் அத்தளங்களில் குக்கீகள் நிரந்தரமாகச் சேமிக்கப்படும்.</translation> <translation id="7207095846245296855">Google பாதுகாப்பானத் தேடலைச் செயல்படுத்தும்</translation> -<translation id="7213425178181578730">இந்தக் கொள்கை தவறு என அமைக்கப்பட்டால், புளூடூத்தை <ph name="PRODUCT_OS_NAME" /> முடக்கும், மேலும் பயனரால் அதைத் திரும்ப இயக்க முடியாது. - - இந்தக் கொள்கை சரி என அமைக்கப்பட்டாலோ அமைக்கப்படவில்லை என்றாலோ, பயனர் அவரது விருப்பத்தின்படி புளூடூத்தை இயக்கலாம் அல்லது முடக்கலாம். - - இந்தக் கொள்கை அமைக்கப்பட்டால், அதைப் பயனரால் மாற்றவோ மேலெழுதவோ முடியாது.</translation> <translation id="7216442368414164495">பாதுகாப்பான உலாவல் நீட்டிக்கப்பட்ட அறிவித்தலைப் பயனர்கள் தேர்வுசெய்ய அனுமதிக்கும்</translation> <translation id="7227967227357489766">சாதனத்தில் உள்நுழைய அனுமதிக்கப்படுபவர்களின் பட்டியலை வரையறுக்கிறது.<ph name="USER_WHITELIST_ENTRY_EXAMPLE" /> போன்று, உள்ளீடுகள் <ph name="USER_WHITELIST_ENTRY_FORMAT" /> முறையில் உள்ளன. களத்தில் தன்னிச்சையாக பயனர்களை அனுமதிக்க, <ph name="USER_WHITELIST_ENTRY_WILDCARD" /> முறையில் உள்ளீடுகளைப் பயன்படுத்தவும். @@ -2022,7 +2017,7 @@ <translation id="8858642179038618439">YouTube பாதுகாப்புப் பயன்முறையைச் செயல்படுத்தும்</translation> <translation id="8864975621965365890"><ph name="PRODUCT_FRAME_NAME" /> ஆல் தளம் வழங்கப்படும்போது தோன்றும் இயக்க அறிவுறுத்துதலை முடக்கும்</translation> <translation id="8870318296973696995">முகப்புப் பக்கம்</translation> -<translation id="8889588091638298603">மானிட்டர் அளவுத்திருத்தத்தைச் சரிசெய்யும், ICC காட்சி சுயவிவரங்களைப் போன்று, +<translation id="8889588091638298603">மானிட்டர் அளவுத்திருத்தத்தைச் சரிசெய்யும், ICC காட்சி புரொஃபைல்களைப் போன்று, வன்பொருள் சார்ந்த உள்ளமைவுக் கோப்புகளை க்விர்க்ஸ் சேவையகம் வழங்குகிறது. இந்தக் கொள்கை தவறு என அமைக்கப்பட்டால், உள்ளமைவுக் கோப்புகளை
diff --git a/components/policy/resources/policy_templates_te.xtb b/components/policy/resources/policy_templates_te.xtb index 18962b3d..35b2e2688 100644 --- a/components/policy/resources/policy_templates_te.xtb +++ b/components/policy/resources/policy_templates_te.xtb
@@ -1624,11 +1624,6 @@ "RestoreOnStartup" విధానాన్ని మునుపటి సెషన్ల నుండి URLలను పునరుద్ధరించడానికి సెట్ చేస్తే, ఈ విధానం పరిగణించబడదు మరియు ఆ సైట్ల కోసం కుక్కీలు శాశ్వతంగా నిల్వ చేయబడతాయి.</translation> <translation id="7207095846245296855">Google సురక్షితశోధనను నిర్బంధం చేస్తుంది</translation> -<translation id="7213425178181578730">ఈ విధానాన్ని తప్పుకి సెట్ చేస్తే, <ph name="PRODUCT_OS_NAME" /> బ్లూటూత్ను నిలిపివేస్తుంది మరియు వినియోగదారు దీన్ని తిరిగి ప్రారంభించలేరు. - - ఈ విధానాన్ని ఒప్పుకి సెట్ చేస్తే లేదా సెట్ చేయకుండా వదిలేస్తే, వినియోగదారు కోరుకున్నప్పుడు బ్లూటూత్ను ప్రారంభించవచ్చు లేదా నిలిపివేయవచ్చు. - - ఈ విధానాన్ని సెట్ చేస్తే, వినియోగదారు దీన్ని మార్చలేరు లేదా భర్తీ చేయలేరు.</translation> <translation id="7216442368414164495">సురక్షిత బ్రౌజింగ్ విస్తారిత నివేదనను ప్రారంభించడానికి వినియోగదారులను అనుమతిస్తుంది</translation> <translation id="7227967227357489766">పరికరానికి లాగిన్ చేయడానికి అనుమతించబడిన వినియోగదారుల జాబితాను నిర్వచిస్తుంది. నమోదులు <ph name="USER_WHITELIST_ENTRY_EXAMPLE" /> వంటి <ph name="USER_WHITELIST_ENTRY_FORMAT" /> రూపంలో ఉంటాయి. డొమైన్లో నిర్హేతుక వినియోగదారులను అనుమతించడానికి, <ph name="USER_WHITELIST_ENTRY_WILDCARD" /> రూపంలో ఉండే నమోదులను ఉపయోగించండి.
diff --git a/components/policy/resources/policy_templates_th.xtb b/components/policy/resources/policy_templates_th.xtb index 88f2c15..c67db9c 100644 --- a/components/policy/resources/policy_templates_th.xtb +++ b/components/policy/resources/policy_templates_th.xtb
@@ -1605,11 +1605,6 @@ หากมีการตั้งค่านโยบาย "RestoreOnStartup" เพื่อเรียกคืน URL จากเซสชันก่อนหน้า นโยบายนี้จะไม่ได้รับการยอมรับและจะไม่มีการจัดเก็บคุกกี้อย่างถาวรสำหรับเว็บไซต์เหล่านั้น</translation> <translation id="7207095846245296855">บังคับใช้ Google ค้นหาปลอดภัย</translation> -<translation id="7213425178181578730">หากตั้งค่านโยบายนี้เป็น False <ph name="PRODUCT_OS_NAME" /> จะปิดใช้บลูทูธและผู้ใช้จะไม่สามารถเปิดใช้ใหม่ได้ - - หากตั้งค่านโยบายนี้เป็น True หรือไม่ได้ตั้งค่า ผู้ใช้จะสามารถเปิดใช้หรือปิดใช้บลูทูธได้ตามต้องการ - - หากมีการตั้งค่านโยบายนี้ ผู้ใช้จะไม่สามารถเปลี่ยนหรือลบล้างได้</translation> <translation id="7216442368414164495">อนุญาตให้ผู้ใช้เลือกใช้การรายงานเพิ่มเติมเกี่ยวกับ Safe Browsing</translation> <translation id="7227967227357489766">กำหนดรายชื่อผู้ใช้ที่ได้รับอนุญาตให้ลงชื่อเข้าใช้อุปกรณ์ โดยมีรูปแบบดังนี้ <ph name="USER_WHITELIST_ENTRY_FORMAT" /> เช่น <ph name="USER_WHITELIST_ENTRY_EXAMPLE" /> หากต้องการอนุญาตให้ผู้ใช้ใดก็ได้ในโดเมน ให้ใช้รูปแบบนี้ <ph name="USER_WHITELIST_ENTRY_WILDCARD" />
diff --git a/components/policy/resources/policy_templates_tr.xtb b/components/policy/resources/policy_templates_tr.xtb index c419b34..5c115a0 100644 --- a/components/policy/resources/policy_templates_tr.xtb +++ b/components/policy/resources/policy_templates_tr.xtb
@@ -97,7 +97,7 @@ <translation id="1359553908012294236">Bu politika doğru seçeneğine ayarlanırsa veya yapılandırılmazsa <ph name="PRODUCT_NAME" />, misafir modunda giriş yapılmasına izin verir. Misafir modunda girişler, tüm pencerelerin gizli modda açıldığı <ph name="PRODUCT_NAME" /> profilleridir. Bu politika yanlış seçeneğine ayarlanırsa, <ph name="PRODUCT_NAME" /> misafir profillerinin başlatılmasına izin vermez.</translation> -<translation id="1363275621236827384">Quirks Sunucusu'ndan donanım profillerini sorgulamayı etkinleştir</translation> +<translation id="1363275621236827384">Quirks Server'dan donanım profillerini sorgulamayı etkinleştir</translation> <translation id="1397855852561539316">Arama önerileri için varsayılan arama sağlayıcı URL'si</translation> <translation id="1398889361882383850">Web sitelerinin, eklentileri otomatik olarak çalıştırmalarına izin verilip verilmeyeceğini ayarlamanızı sağlar. Otomatik olarak çalışan eklentilere ya bütün web sitelerinde izin verilebilir ya da bunlar web sitelerinin tümünde reddedilebilir. @@ -1778,11 +1778,6 @@ "RestoreOnStartup" politikası önceki oturumlara ilişkin URL'leri geri yükleyecek şekilde ayarlanmışsa bu politika yoksayılır ve o siteler için çerezler kalıcı olarak depolanır.</translation> <translation id="7207095846245296855">Google Güvenli Arama'yı zorla</translation> -<translation id="7213425178181578730">Bu politika yanlış değerine ayarlanırsa <ph name="PRODUCT_OS_NAME" />, Bluetooth'u devre dışı bırakır ve kullanıcı, bu işlevi etkinleştiremez. - - Bu politika doğru değerine ayarlanır veya ayarlanmadan bırakılırsa kullanıcı, Bluetooth'u istediği gibi etkinleştirebilir veya devre dışı bırakabilir. - - Bu politika ayarlanırsa kullanıcı, bunu değiştiremez veya geçersiz kılamaz.</translation> <translation id="7216442368414164495">Kullanıcıların Güvenli Tarama genişletilmiş raporlamasını etkinleştirmesine izin ver</translation> <translation id="7227967227357489766">Cihaza giriş yapmalarına izin verilen kullanıcıların listesini tanımlar. Girişler <ph name="USER_WHITELIST_ENTRY_FORMAT" /> biçimindedir (örneğin, <ph name="USER_WHITELIST_ENTRY_EXAMPLE" />). Bir etki alanı üzerinde keyfi kullanıcılara izin vermek için <ph name="USER_WHITELIST_ENTRY_WILDCARD" /> biçiminde girişler kullanın. @@ -2261,14 +2256,14 @@ <translation id="8858642179038618439">YouTube Güvenlik Modunu zorla</translation> <translation id="8864975621965365890">Bir site <ph name="PRODUCT_FRAME_NAME" /> tarafından oluşturulduğunda görülen reddetme sorusunu engeller.</translation> <translation id="8870318296973696995">Ana sayfa</translation> -<translation id="8889588091638298603">Quirks Sunucusu, monitör kalibrasyonunu ayarlamaya yönelik ICC görüntü +<translation id="8889588091638298603">Quirks Server, monitör kalibrasyonunu ayarlamaya yönelik ICC görüntü profilleri gibi donanıma özel yapılandırma dosyaları sağlar. Bu politika false (yanlış) değerine ayarlandığında cihaz, yapılandırma - dosyalarını indirmek için Quirks Sunucusu ile iletişim kurmayı denemez. + dosyalarını indirmek için Quirks Server ile iletişim kurmayı denemez. Bu politika true (doğru) değerine ayarlanırsa veya yapılandırılmamışsa - <ph name="PRODUCT_OS_NAME" />, Quirks Sunucusu ile otomatik olarak iletişim kurar + <ph name="PRODUCT_OS_NAME" />, Quirks Server ile otomatik olarak iletişim kurar ve varsa yapılandırma dosyalarını indirip cihaza kaydeder. Bu tür dosyalar, örneğin bağlı monitörlerin görüntü kalitesini iyileştirmek için kullanılabilir.</translation> <translation id="8905426178924715309">Bu politika kullanımdan kaldırılmıştır. Bunun yerine lütfen ForceGoogleSafeSearch'ü ve ForceYouTubeSafetyMode'u kullanın. ForceGoogleSafeSearch veya ForceYouTubeSafetyMode politikası ayarlanırsa bu politika yoksayılır.
diff --git a/components/policy/resources/policy_templates_uk.xtb b/components/policy/resources/policy_templates_uk.xtb index dce7c34..56bf5e3 100644 --- a/components/policy/resources/policy_templates_uk.xtb +++ b/components/policy/resources/policy_templates_uk.xtb
@@ -148,6 +148,18 @@ <translation id="1561424797596341174">Правило замінює налагоджувальні складання хосту віддаленого доступу</translation> <translation id="1583248206450240930">Використовувати <ph name="PRODUCT_FRAME_NAME" /> за умовчанням</translation> <translation id="1608755754295374538">URL-адреси, яким завжди надаватиметься доступ до пристроїв запису аудіо</translation> +<translation id="1613574633990410986">Дозволяє вказувати проксі-сервер, який використовують <ph name="PRODUCT_NAME" /> та додатки ARC, і забороняє користувачам змінювати налаштування проксі-сервера. + + Якщо відмовитися від використання проксі-сервера та завжди під’єднуватися напряму, усі інші опції ігноруватимуться. + + Якщо вибрати автоматичне визначення проксі-сервера, усі інші опції ігноруватимуться. + + Щоб переглянути детальні приклади, відвідайте сторінку + <ph name="PROXY_HELP_URL" /> + + Якщо ввімкнути це налаштування, <ph name="PRODUCT_NAME" /> і додатки ARC ігноруватимуть усі опції проксі-сервера, указані в командному рядку. + + Якщо ці правила не налаштовано, користувачі зможуть вибирати параметри проксі-сервера самостійно.</translation> <translation id="1617235075406854669">Увімкнути видалення історії веб-перегляду та завантажень</translation> <translation id="1617384279878333801">Додавати користувачів у менеджері профілю</translation> <translation id="1655229863189977773">Установити кеш-пам’ять диска в байтах</translation> @@ -215,6 +227,15 @@ <translation id="1865417998205858223">Основні дозволи</translation> <translation id="186719019195685253">Дія, яка має виконуватися під час живлення від електромережі, коли виникає затримка через неактивність.</translation> <translation id="187819629719252111">Надає доступ до локальних файлів у комп’ютері, дозволяючи <ph name="PRODUCT_NAME" /> відображати діалогові вікна вибору файлів. Якщо це налаштування ввімкнено, користувачі можуть відкривати діалогові вікна звичайним способом. Якщо це налаштування вимкнено, під час виконання дії, яка викликає діалогове вікно вибору файлу (наприклад, імпорт закладок, завантаження файлів, збереження посилань тощо), відображається повідомлення. Користувач має натиснути кнопку "Скасувати" в діалоговому вікні вибору файлу. Якщо це налаштування не встановлено, користувачі можуть відкривати діалогові вікна вибору файлу звичайним способом.</translation> +<translation id="1879485426724769439">Указується часовий пояс для пристрою. Користувачі можуть вибрати інший часовий пояс для поточного сеансу. Однак після завершення сеансу відновиться вказаний часовий пояс. Якщо вказано недійсне значення, правило все одно діє, але використовується час за Гринвічем (GMT). Якщо рядок порожній, правило ігнорується. + + Якщо це правило не використовується, зберігається поточний часовий пояс, однак користувачі можуть його змінити, і ця зміна буде постійною. Тож зміна, внесена одним користувачем, впливає на екран входу та всіх інших користувачів. + + У нових пристроях налаштовано тихоокеанський час (США). + + Формат значень відповідає назвам часових поясів у базі даних IANA (див. сторінку https://uk.wikipedia.org/wiki/Tz_database). Зокрема, більшість часових поясів позначаються як "континент/велике_місто" або "океан/велике_місто". + + Якщо ввімкнути це правило, буде повністю вимкнено автоматичне визначення часового поясу за місцезнаходженням пристрою, а також буде замінено правило SystemTimezoneAutomaticDetection.</translation> <translation id="1897365952389968758">Дозволяти всім сайтам запускати JavaScript</translation> <translation id="193259052151668190">Список USB-пристроїв, які можна від’єднувати</translation> <translation id="1933378685401357864">Фоновий малюнок</translation> @@ -587,6 +608,24 @@ <translation id="3072847235228302527">Установити Умови використання для локального облікового запису на пристрої</translation> <translation id="3096595567015595053">Список увімкнених плагінів</translation> <translation id="3101501961102569744">Вибрати спосіб визначення налаштувань проксі-сервера</translation> +<translation id="3125884964575432854">Дозволяє вказати, який проксі-сервер використовують <ph name="PRODUCT_NAME" /> та додатки ARC, і забороняє користувачам змінювати налаштування проксі-сервера. + + Якщо відмовитися від використання проксі-сервера та завжди під’єднуватися напряму, усі інші опції ігноруватимуться. + + Якщо завжди використовувати системні налаштування проксі-сервера, усі інші опції ігноруватимуться. + + Якщо вибрати автоматичне визначення проксі-сервера, усі інші опції ігноруватимуться. + + Якщо вибрати режим фіксованого проксі-сервера, інші опції можна вказати в полях "Адреса чи URL-адреса проксі-сервера" та "Розділений комами список правил обходу проксі-сервера". Додатки ARC використовуватимуть лише проксі-сервер HTTP з найвищим пріоритетом. + + Якщо використовувати сценарій проксі-сервера у файлі .pac, потрібно вказати URL-адресу сценарію в полі "URL-адреса для файлу .pac проксі-сервера". + + Щоб переглянути детальніші приклади, відвідайте сторінку + <ph name="PROXY_HELP_URL" /> + + Якщо ввімкнути це налаштування, <ph name="PRODUCT_NAME" /> і додатки ARC ігноруватимуть усі опції проксі-сервера, указані в командному рядку. + + Якщо ці правила не налаштовано, користувачі зможуть вибирати параметри проксі-сервера самостійно.</translation> <translation id="3153348162326497318">Дозволяє вказувати розширення, які користувачі НЕ можуть установлювати. Уже встановлені розширення буде видалено, якщо їх внесено в чорний список. Значення чорного списку "*" означає, що всі розширення внесено в чорний список, якщо вони чітко не вказані в списку дозволених розширень. Якщо це правило не встановлено, користувач може встановити будь-яке розширення в <ph name="PRODUCT_NAME" />.</translation> <translation id="316778957754360075">Це налаштування не підтримується від 29-ї версії <ph name="PRODUCT_NAME" />. Рекомендований спосіб налаштування груп розширень і програм, розміщених на корпоративних серверах, – включити сайт, на якому розміщено пакети CRX у правило ExtensionInstallSources і розмістити прямі посилання для завантаження в пакети на веб-сторінці. Панель запуску для веб-сторінки можна створити за допомогою правила ExtensionInstallForcelist.</translation> <translation id="3185009703220253572">від версії <ph name="SINCE_VERSION" /></translation> @@ -655,6 +694,20 @@ Якщо це правило не налаштовано, до всіх сайтів застосовується загальне правило за умовчанням: DefaultKeygenSetting (якщо налаштовано) або правило користувача.</translation> <translation id="3381968327636295719">Використовувати веб-переглядач хосту за умовчанням</translation> +<translation id="3398137877608138703">Дозволити або заборонити відеозйомку. + + Якщо це правило дозволено або не налаштовано (значення + за умовчанням), користувачеві з’являтиметься запит дозволу на відеозйомку, але не для + URL-адрес, указаних у списку правила VideoCaptureAllowedUrls. + Для них дозвіл надається автоматично. Додатки ARC зможуть вмикати + камеру, якщо надати їм дозвіл. + + Якщо це правило вимкнено, запит на дозвіл не з’являтиметься ніколи, + а відеозйомка буде доступна лише для URL-адрес, указаних у правилі + VideoCaptureAllowedUrls. Додатки ARC не матимуть доступу до камери. + + За межами додатків ARC, це правило застосовується до всіх типів відеовходу, + а не лише до вбудованої камери.</translation> <translation id="3417418267404583991">Якщо значення правила встановлено як "true" або правило не налаштовано, <ph name="PRODUCT_OS_NAME" /> увімкне вхід у режимі гостя. Вхід у режимі гостя – це сеанс анонімного користувача, який не потребує пароля. Якщо значення правила встановлено як "false", <ph name="PRODUCT_OS_NAME" /> не дозволить розпочати сеанс у режимі гостя.</translation> @@ -672,6 +725,8 @@ <translation id="3478024346823118645">Стирати дані користувача під час виходу</translation> <translation id="348495353354674884">Увімкнути віртуальну клавіатуру</translation> <translation id="3496296378755072552">Диспетчер паролів</translation> +<translation id="349667858031092827">Ніколи не визначати часовий пояс автоматично.</translation> +<translation id="350443680860256679">Налаштування ARC</translation> <translation id="3504791027627803580">Указує URL-адресу пошукової системи, яка використовується для пошуку зображень. Пошукові запити надсилаються методом GET. Якщо ввімкнено правило "DefaultSearchProviderImageURLPostParams", запити на пошук зображень надсилаються методом POST. Це правило необов’язкове. Якщо його не встановлено, пошук зображень не використовується. @@ -805,6 +860,22 @@ Якщо для цього правила вибрати опцію "Зберігати файли cookie впродовж сеансу", файли cookie видалятимуться після завершення сеансу. Зверніть увагу: якщо <ph name="PRODUCT_NAME" /> працює у фоновому режимі, сеанс може не завершитися, коли ви закриєте останнє вікно. Щоб дізнатися більше про налаштування цієї поведінки, перегляньте правило "BackgroundModeEnabled". Якщо це правило не налаштовано, застосовуватиметься правило "AllowCookies", і користувач зможе його змінити.</translation> +<translation id="4098957623809244159">Це правило більше не використовується. Натомість застосовуйте правило ProxyMode. + + Дозволяє вказувати проксі-сервер, який використовують <ph name="PRODUCT_NAME" /> та додатки ARC, і забороняє користувачам змінювати налаштування проксі-сервера. + + Якщо відмовитися від використання проксі-сервера та завжди під’єднуватися напряму, усі інші опції ігноруватимуться. + + Якщо вибрати використання системних налаштувань проксі-сервера чи автоматичне визначення проксі-сервера, усі інші опції ігноруватимуться. + + Якщо вибрати ручне введення налаштувань проксі-сервера, інші опції можна вказати в полях "Адреса чи URL-адреса проксі-сервера" та "Розділений комами список правил обходу проксі-сервера". + + Щоб переглянути детальніші приклади, відвідайте сторінку + <ph name="PROXY_HELP_URL" /> + + Якщо це правило налаштовано, <ph name="PRODUCT_NAME" /> і додатки ARC ігноруватимуть усі опції проксі-сервера, указані в командному рядку. + + Якщо ці правила не налаштовано, користувачі зможуть вибирати параметри проксі-сервера самостійно.</translation> <translation id="4103289232974211388">Перенаправлення на постачальника ідентифікатора SAML після підтвердження користувача</translation> <translation id="410478022164847452">Визначає період часу неактивності користувача, після якого вмикається режим неактивності, якщо використовується живлення від мережі. @@ -1232,6 +1303,14 @@ <translation id="5893553533827140852">Якщо цей параметр увімкнено, запити на автентифікацію розширення Gnubby надсилаються через віддалене з’єднанння з хостом. Якщо цей параметр вимкнено або не налаштовано, запити на автентифікацію розширення Gnubby не надсилаються.</translation> +<translation id="5900959132054596599"><ph name="PRODUCT_NAME" /> і додатки ARC обходитимуть усі проксі-сервери з наведеного тут списку хостів. + + Це правило діє, лише коли вибрано налаштування проксі-сервера вручну в розділі "Вибрати спосіб визначення параметрів проксі-сервера". + + Це правило не потрібно встановлювати, якщо вибрано інший режим налаштування правил для проксі-сервера. + + Щоб переглянути детальні приклади, відвідайте сторінку + <ph name="PROXY_HELP_URL" /></translation> <translation id="5921713479449475707">Дозволити завантаження автоматичних оновлень через HTTP</translation> <translation id="5921888683953999946">Налаштувати стан за умовчанням для функції доступності великого курсора на екрані входу. @@ -1373,6 +1452,7 @@ <translation id="637934607141010488">Повідомляти про користувачів, які нещодавно входили на пристрій. Якщо це правило не налаштовано або має значення "false", звіт про користувачів не надсилатиметься.</translation> +<translation id="639009029157091157">Вирішують користувачі.</translation> <translation id="6392973646875039351">Вмикає функцію автозаповнення в <ph name="PRODUCT_NAME" /> і дозволяє користувачам автоматично заповнювати веб-форми, використовуючи раніше збережену інформацію, як-от адресу чи дані кредитної картки. Якщо це налаштування вимкнено, функція автозаповнення не доступна для користувачів. Якщо це налаштування ввімкнено або значення не встановлено, функцією автозаповнення керує користувач. Це дозволяє йому налаштовувати профілі автозаповнення та вмикати чи вимикати функцію автозаповнення на власний розсуд.</translation> <translation id="6394350458541421998">Це правило не підтримується від 29-ї версії <ph name="PRODUCT_OS_NAME" />. Натомість використовуйте правило PresentationScreenDimDelayScale.</translation> <translation id="6401669939808766804">Вихід користувача</translation> @@ -1613,11 +1693,6 @@ Якщо правило "RestoreOnStartup" установлено на відновлення URL-адрес попередніх сеансів, це правило не застосовуватиметься, а файли cookie цих сайтів зберігатимуться завжди.</translation> <translation id="7207095846245296855">Примусово активувати Безпечний пошук Google</translation> -<translation id="7213425178181578730">Якщо для цього правила встановлено значення "false", <ph name="PRODUCT_OS_NAME" /> вимкне Bluetooth, і користувач не зможе його ввімкнути. - - Якщо це правило не налаштовано або має значення "true", користувач може будь-коли вмикати та вимикати Bluetooth. - - Якщо це правило налаштовано, користувач не може змінити або замінити його.</translation> <translation id="7216442368414164495">Дозволяти користувачам вмикати розширене звітування Безпечного перегляду</translation> <translation id="7227967227357489766">Визначає перелік користувачів, яким дозволено входити на пристрої. Записи створюються у форматі <ph name="USER_WHITELIST_ENTRY_FORMAT" />, наприклад <ph name="USER_WHITELIST_ENTRY_EXAMPLE" />. Щоб надати доступ до домену довільно вибраним користувачам, використовуйте записи у форматі <ph name="USER_WHITELIST_ENTRY_WILDCARD" />. @@ -1717,6 +1792,9 @@ <translation id="7632724434767231364">Назва бібліотеки GSSAPI</translation> <translation id="7635471475589566552">Установлює мовний код програми в <ph name="PRODUCT_NAME" /> і не дозволяє користувачам змінювати його. Якщо це налаштування ввімкнено, <ph name="PRODUCT_NAME" /> використовує вказаний мовний код. Якщо встановлений мовний код не підтримується, замість нього використовується "en-US". Якщо це налаштування вимкнено чи не встановлено, <ph name="PRODUCT_NAME" /> використовує вказаний користувачем мовний код (якщо налаштовано), мовний код системи або вихідний мовний код "en-US".</translation> <translation id="7651739109954974365">Визначає, чи має бути ввімкнено роумінг даних для пристрою. Якщо значення правила встановлено як "true", роумінг даних дозволено. Якщо правило не налаштовано чи його значення встановлено як "false", роумінг даних буде недоступним.</translation> +<translation id="7667184304362487902">Установлює налаштування проксі-сервера для <ph name="PRODUCT_NAME" /> і додатків ARC. + + Це правило ще не готове до використання. Не користуйтеся ним.</translation> <translation id="76810863974142048">URL-адреса сторінки, де клієнти віддаленого доступу можуть отримати маркер автентифікації. Якщо налаштувати це правило, хост віддаленого доступу під час з’єднання проситиме клієнтів надати маркер автентифікації з цієї сторінки. Це правило потрібно використовувати разом із правилом "RemoteAccessHostTokenValidationUrl". @@ -1785,6 +1863,19 @@ <translation id="7842869978353666042">Налаштування параметрів Google Диска</translation> <translation id="7843525027689416831">Указує позначки, які мають застосовуватися під час запуску <ph name="PRODUCT_NAME" />. Указані позначки застосовуються лише на екрані входу. Позначки, додані за допомогою цього правила, не поширюються на сеанси користувача.</translation> <translation id="7848840259379156480">Дозволяє налаштовувати відтворення у форматі HTML за умовчанням, якщо встановлено <ph name="PRODUCT_FRAME_NAME" />. Налаштування за умовчанням – дозволити веб-переглядачу хосту здійснювати відтворення, однак можна за бажанням замінити це та налаштувати <ph name="PRODUCT_FRAME_NAME" /> на відтворення сторінок HTML за умовчанням.</translation> +<translation id="7853178359124471330">Якщо це правило налаштовано, процес автоматичного визначення часового поясу буде відбуватись одним зі способів нижче, залежно від установленого значення. + + Якщо встановлено значення TimezoneAutomaticDetectionUsersDecide, користувачі зможуть керувати автоматичним визначенням часового поясу за допомогою звичайних елементів керування на сторінці chrome://settings. + + Якщо встановлено значення TimezoneAutomaticDetectionDisabled, елементи керування для автоматичного визначення часового поясу на сторінці chrome://settings будуть недоступні. Автоматичне визначення часового поясу буде завжди вимкнено. + + Якщо встановлено значення TimezoneAutomaticDetectionIPOnly, елементи керування для автоматичного визначення часового поясу на сторінці chrome://settings будуть недоступні. Автоматичне визначення часового поясу завжди ввімкнено. Щоб визначити місцезнаходження, завжди використовуватиметься метод "Лише за IP-адресою". + + Якщо встановлено значення TimezoneAutomaticDetectionSendWiFiAccessPoints, елементи керування для автоматичного визначення часового поясу на сторінці chrome://settings будуть недоступні. Автоматичне визначення часового поясу буде завжди ввімкнено. Список видимих точок доступу Wi-Fi завжди надсилатиметься на сервер API Geolocation для детального визначення часового поясу. + + Якщо це правило не встановлено, застосовуються параметри правила TimezoneAutomaticDetectionUsersDecide. + + Якщо встановлено правило SystemTimezone, воно заміняє це правило. У такому разі автоматичне визначення часового поясу повністю вимкнено.</translation> <translation id="7882585827992171421">Це правило активне лише в режимі роздрібного продажу. Визначає ідентифікатор розширення, яке має використовуватись як заставка на екрані входу. Це розширення має входити в пакет AppPack, налаштований для цього домену за допомогою правила DeviceAppPack.</translation> @@ -1822,6 +1913,7 @@ Якщо це правило не встановлено, його буде ввімкнено.</translation> <translation id="8073243368829195">Використовувати Smart Lock</translation> +<translation id="8074052133552427532">Завжди використовувати приблизне визначення часового поясу.</translation> <translation id="8099880303030573137">Затримка через неактивність, коли використовується заряд акумулятора</translation> <translation id="8102913158860568230">Налаштування потоку медіаданих за умовчанням</translation> <translation id="8104962233214241919">Автоматичний вибір сертифікатів клієнтів для цих сайтів</translation> @@ -1928,6 +2020,7 @@ <translation id="8424255554404582727">Указати значення обертання дисплея за умовчанням, яке відновлюватиметься під час кожного перезапуску</translation> <translation id="8426231401662877819">Обернути екран на 90 градусів за годинниковою стрілкою</translation> <translation id="8451988835943702790">Використати сторінку нової вкладки як домашню сторінку</translation> +<translation id="8458790683633857482">Визначає набір правил, які буде застосовано до середовища виконання ARC. Значення має бути дійсним файлом JSON.</translation> <translation id="8465065632133292531">Параметри URL-адреси миттєвого пошуку, яка використовує метод POST</translation> <translation id="847472800012384958">Забороняти всім сайтам показувати спливаючі вікна</translation> <translation id="8477885780684655676">TLS 1.0</translation> @@ -2048,9 +2141,12 @@ Якщо для цього правила встановлено значення "false", користувач, додатки та розширення не зможуть переходити в повноекранний режим. Якщо вимкнено повноекранний режим, режим термінала доступний лише на платформі <ph name="PRODUCT_OS_NAME" />.</translation> +<translation id="8795495354632096254">Завжди надсилати на сервер точки доступу Wi-Fi під час визначення часового поясу.</translation> <translation id="8818173863808665831">Повідомляє географічне місцезнаходження пристрою. Якщо це правило не встановлено чи його значення встановлено як "false", місцезнаходження не повідомлятиметься.</translation> +<translation id="8818768076343557335">Передбачати дії мережі у всіх мережах, окрім мобільних. + (Не підтримується в 50 версії, видалено а 52 версії. У версіях, новіших за 52, значення 1 сприйматиметься як 0 – передбачати дії мережі у всіх мережевих з’єднаннях.)</translation> <translation id="8828766846428537606">Налаштовує домашню сторінку за умовчанням у <ph name="PRODUCT_NAME" /> і не дозволяє користувачам змінювати її. Налаштування домашньої сторінки користувача повністю заблоковані, лише якщо вибрати домашньою сторінкою сторінку нової вкладки або зробити домашньою сторінкою певну URL-адресу та вказати URL-адресу домашньої сторінки. Якщо не вказати URL-адресу домашньої сторінки, користувач усе ще зможе встановлювати домашньою сторінкою сторінку нової вкладки, вказавши значення "chrome://newtab".</translation> <translation id="8833109046074170275">Автентифікація через процедуру GAIA за умовчанням</translation> <translation id="8838303810937202360"><ph name="PRODUCT_OS_NAME" /> кешує додатки та розширення, щоб вони встановлювалися для кількох користувачів пристрою, а не завантажувалися для кожного окремо. @@ -2069,7 +2165,7 @@ Якщо для цього правила вибрано значення "true" або його не налаштовано, <ph name="PRODUCT_OS_NAME" /> автоматично зв’язується із сервером Quirks, завантажує файли - конфігурації (якщо вони доступні), і зберігає їх на + конфігурації (якщо вони доступні) і зберігає їх на пристрої. Ці файли допомагають, наприклад, покращити якість зображення приєднаних моніторів.</translation> <translation id="8905426178924715309">Це правило більше не використовується. Натомість застосовуйте правила "ForceGoogleSafeSearch" і "ForceYouTubeSafetyMode". Це правило ігноруватиметься, якщо налаштувати "ForceGoogleSafeSearch" або "ForceYouTubeSafetyMode". @@ -2113,6 +2209,7 @@ <translation id="9042911395677044526">Дозволяє надсилати конфігурацію мережі для застосування кожним окремим користувачем на пристрої з <ph name="PRODUCT_OS_NAME" />. Конфігурація мережі – це рядок у форматі JSON, визначений форматом Open Network Configuration, який описано на сторінці <ph name="ONC_SPEC_URL" /></translation> <translation id="9084985621503260744">Визначати, чи дії з відео впливають на керування живленням</translation> <translation id="9088433379343318874">Увімкнути постачальника вмісту для контрольованих користувачів</translation> +<translation id="9088444059179765143">Налаштувати метод автоматичного визначення часового поясу</translation> <translation id="9096086085182305205">Список дозволених серверів для автентифікації</translation> <translation id="9098553063150791878">Правила для автентифікації HTTP</translation> <translation id="9104138886225968319">Надсилати тактові імпульси відстеження на сервер керування, щоб дозволити
diff --git a/components/policy/resources/policy_templates_vi.xtb b/components/policy/resources/policy_templates_vi.xtb index c2703dba..6e264e5 100644 --- a/components/policy/resources/policy_templates_vi.xtb +++ b/components/policy/resources/policy_templates_vi.xtb
@@ -97,7 +97,7 @@ <translation id="1359553908012294236">Nếu chính sách này được đặt thành true hoặc không được định cấu hình, <ph name="PRODUCT_NAME" /> sẽ bật chế độ đăng nhập khách. Chế độ đăng nhập khách là hồ sơ <ph name="PRODUCT_NAME" /> trong đó tất cả cửa sổ đều ở chế độ ẩn danh. Nếu chính sách này được đặt thành false, <ph name="PRODUCT_NAME" /> sẽ không cho phép bắt đầu hồ sơ khách.</translation> -<translation id="1363275621236827384">Bật truy vấn cấu hình phần cứng tới Máy chủ Quirks</translation> +<translation id="1363275621236827384">Bật truy vấn cấu hình Máy chủ Quirks cho phần cứng</translation> <translation id="1397855852561539316">URL đề xuất của nhà cung cấp dịch vụ tìm kiếm mặc định</translation> <translation id="1398889361882383850">Cho phép bạn đặt có cho phép các trang web tự động chạy plugin không. Bạn có thể cho phép hoặc không cho phép tất cả các trang web tự động chạy plugin. @@ -1761,11 +1761,6 @@ Nếu chính sách "RestoreOnStartup" được đặt để khôi phục URL từ các phiên trước đó, chính sách này sẽ không được áp dụng và cookie sẽ được lưu vĩnh viễn cho các trang web đó.</translation> <translation id="7207095846245296855">Bắt buộc bật Tìm kiếm an toàn của Google</translation> -<translation id="7213425178181578730">Nếu chính sách này được đặt thành false, <ph name="PRODUCT_OS_NAME" /> sẽ tắt Bluetooth và người dùng không thể bật trở lại. - - Nếu chính sách này được đặt thành true hoặc không được đặt, người dùng có thể bật hoặc tắt Bluetooth theo ý muốn. - - Nếu chính sách này được đặt, người dùng không thể thay đổi hoặc ghi đè chính sách.</translation> <translation id="7216442368414164495">Cho phép người dùng chọn sử dụng báo cáo mở rộng trong Duyệt web an toàn</translation> <translation id="7227967227357489766">Xác định danh sách những người dùng được phép đăng nhập vào thiết bị. Các mục nhập sẽ có dạng <ph name="USER_WHITELIST_ENTRY_FORMAT" />, chẳng hạn như <ph name="USER_WHITELIST_ENTRY_EXAMPLE" />. Để cho phép bất kỳ người dùng nào trên miền, hãy sử dụng các mục nhập có dạng <ph name="USER_WHITELIST_ENTRY_WILDCARD" />.
diff --git a/components/policy/resources/policy_templates_zh-CN.xtb b/components/policy/resources/policy_templates_zh-CN.xtb index 494a998..7702043 100644 --- a/components/policy/resources/policy_templates_zh-CN.xtb +++ b/components/policy/resources/policy_templates_zh-CN.xtb
@@ -663,7 +663,7 @@ 该策略值应该以毫秒为单位。值的范围限定在 30 秒到 24 小时之间。</translation> <translation id="3528000905991875314">启用备用的错误页面</translation> -<translation id="3538538104630456270">在我们推出“查看密码时需重新验证”这一规定之前,使用的是相关设置。自这一规定推出后,相关设置以及此政策便不再对 Chrome 的行为有任何影响。Chrome 的当前行为等同于此政策设为在密码管理器设置页面中禁止以明文形式显示密码。这意味着,设置页面中包含的只是一个占位符,仅当用户点击“显示”(并进行重新验证,如果适用的话)后,Chrome 才会显示相应密码。此政策的原始描述如下所示: +<translation id="3538538104630456270">在我们推出“查看密码时需重新验证”这一规定之前,我们是使用相关的设置来控制用户能否查看密码。自这一规定推出后,相关设置以及此政策便不再对 Chrome 的行为有任何影响。Chrome 的当前行为等同于此政策设为在密码管理器设置页面中禁止以明文形式显示密码。这意味着,设置页面中包含的只是一个占位符,仅当用户点击“显示”(并进行重新验证,如果适用的话)后,Chrome 才会显示相应密码。此政策的原始描述如下所示: 控制用户是否可以在密码管理器中以明文形式显示密码。 @@ -1577,11 +1577,6 @@ 如果“RestoreOnStartup”政策设为恢复先前会话中的网址,系统将忽略此政策,并且将永久存储这些网站的 Cookie。</translation> <translation id="7207095846245296855">强制启用 Google 安全搜索功能</translation> -<translation id="7213425178181578730">如果此政策设为 false,<ph name="PRODUCT_OS_NAME" />将停用蓝牙功能,并且用户无法重新启用该功能。 - - 如果此政策设为 true 或未设置,用户将能够随意启用或停用蓝牙功能。 - - 如果您设置了此政策,用户将无法更改或覆盖您的设置。</translation> <translation id="7216442368414164495">允许用户启用安全浏览扩展报告功能</translation> <translation id="7227967227357489766">定义可以登录此设备的用户名单。条目格式为 <ph name="USER_WHITELIST_ENTRY_FORMAT" />,例如 <ph name="USER_WHITELIST_ENTRY_EXAMPLE" />。要允许某个域上的任意用户,请使用以下条目格式:<ph name="USER_WHITELIST_ENTRY_WILDCARD" />。
diff --git a/components/policy/resources/policy_templates_zh-TW.xtb b/components/policy/resources/policy_templates_zh-TW.xtb index 224030b..1e5db2b 100644 --- a/components/policy/resources/policy_templates_zh-TW.xtb +++ b/components/policy/resources/policy_templates_zh-TW.xtb
@@ -684,7 +684,7 @@ <translation id="3528000905991875314">啟用替代的錯誤網頁</translation> <translation id="3538538104630456270">先前我們以類似設定來控制使用者是否可查看密碼,不過在新增重新驗證功能後,該設定與這項政策已不再適用於 Chrome 的運作方式。目前 Chrome 的運作方式等同在密碼管理員設定頁面中設定停止以純文字顯示密碼的政策。也就是說,設定頁面只會顯示預留位置,使用者必須點選 [顯示] 並重新驗證 (如果適用),Chrome 才會顯示密碼。這項政策的原始說明如下: - 控制使用者是否能在密碼管理員中看到實際的密碼內容。 + 控管使用者是否能在密碼管理員中看到實際的密碼內容。 如果您停用這項設定,密碼管理員就會禁止在密碼管理員視窗中以純文字顯示儲存的密碼。 @@ -1604,11 +1604,6 @@ 如果將「RestoreOnStartup」政策設為還原先前工作階段的網址,系統就不會遵循這項政策,並且會為這些網站永久儲存 Cookie。</translation> <translation id="7207095846245296855">強制啟用 Google 安全搜尋模式</translation> -<translation id="7213425178181578730">如果將這項政策設為 false,<ph name="PRODUCT_OS_NAME" /> 會停用藍牙功能,且使用者無法重新啟用。 - - 如果將這項政策設為 true 或不予設定,使用者可以視需求啟用或停用藍牙功能。 - - 設定這項政策後,使用者無法變更或覆寫政策。</translation> <translation id="7216442368414164495">允許使用者採用安全瀏覽模式的進階回報功能</translation> <translation id="7227967227357489766">定義可登入裝置的使用者允許清單,項目格式為「<ph name="USER_WHITELIST_ENTRY_FORMAT" />」(例如「<ph name="USER_WHITELIST_ENTRY_EXAMPLE" />」)。如要允許網域的任意使用者,請使用格式為「<ph name="USER_WHITELIST_ENTRY_WILDCARD" />」的項目。
diff --git a/components/resources/OWNERS b/components/resources/OWNERS index 76b652d..20c5b2d 100644 --- a/components/resources/OWNERS +++ b/components/resources/OWNERS
@@ -19,7 +19,7 @@ per-file gcm_driver_resources.grdp=peter@chromium.org per-file gcm_driver_resources.grdp=zea@chromium.org per-file neterror*=mmenke@chromium.org -per-file neterror*=ttuttle@chromium.org +per-file neterror*=juliatuttle@chromium.org per-file proximity_auth*=isherman@chromium.org per-file proximity_auth*=tengs@chromium.org per-file supervised_user_error_page.grpd=aberent@chromium.org
diff --git a/components/safe_browsing_db/BUILD.gn b/components/safe_browsing_db/BUILD.gn index dc5c80a..4f91591 100644 --- a/components/safe_browsing_db/BUILD.gn +++ b/components/safe_browsing_db/BUILD.gn
@@ -219,6 +219,7 @@ source_set("unit_tests") { testonly = true sources = [ + "database_manager_unittest.cc", "prefix_set_unittest.cc", "util_unittest.cc", "v4_get_hash_protocol_manager_unittest.cc", @@ -226,14 +227,17 @@ "v4_update_protocol_manager_unittest.cc", ] deps = [ + ":database_manager", ":prefix_set", ":proto", + ":test_database_manager", ":util", ":v4_get_hash_protocol_manager", ":v4_local_database_manager", ":v4_protocol_manager_util", ":v4_update_protocol_manager", "//base", + "//content/test:test_support", "//net", "//net:test_support", "//testing/gtest",
diff --git a/components/safe_browsing_db/DEPS b/components/safe_browsing_db/DEPS index 8bf7b58..2130e6f 100644 --- a/components/safe_browsing_db/DEPS +++ b/components/safe_browsing_db/DEPS
@@ -2,6 +2,7 @@ "+components/variations", "+content/public/browser", "+content/public/common", + "+content/public/test", "+crypto", "+net", ]
diff --git a/components/safe_browsing_db/database_manager.cc b/components/safe_browsing_db/database_manager.cc index b8998b4..218e8e0 100644 --- a/components/safe_browsing_db/database_manager.cc +++ b/components/safe_browsing_db/database_manager.cc
@@ -25,11 +25,9 @@ net::URLRequestContextGetter* request_context_getter, const V4ProtocolConfig& config) { DCHECK_CURRENTLY_ON(BrowserThread::IO); - if (request_context_getter) { - // Instantiate a V4GetHashProtocolManager. - v4_get_hash_protocol_manager_ = V4GetHashProtocolManager::Create( - request_context_getter, config); - } + + v4_get_hash_protocol_manager_ = V4GetHashProtocolManager::Create( + request_context_getter, config); } // |shutdown| not used. Destroys the v4 protocol managers. This may be called @@ -42,11 +40,78 @@ delete v4_get_hash_protocol_manager_; v4_get_hash_protocol_manager_ = NULL; } + // TODO(kcarattini): Call back clients with pending requests. } -void SafeBrowsingDatabaseManager::CheckApiBlacklistUrl(const GURL& url, +bool SafeBrowsingDatabaseManager::CheckApiBlacklistUrl(const GURL& url, Client* client) { - // TODO(kcarattini): Implement this. + DCHECK_CURRENTLY_ON(BrowserThread::IO); + DCHECK(v4_get_hash_protocol_manager_); + + // Make sure we can check this url. + if (!(url.SchemeIs(url::kHttpScheme) || url.SchemeIs(url::kHttpsScheme))) { + return true; + } + + // Compute a list of hashes for this url. + std::vector<SBFullHash> full_hashes; + UrlToFullHashes(url, false, &full_hashes); + if (full_hashes.empty()) + return true; + + // Copy to prefixes. + std::vector<SBPrefix> prefixes; + for (const SBFullHash& full_hash : full_hashes) { + prefixes.push_back(full_hash.prefix); + } + // Multiple full hashes could share a prefix, remove duplicates. + std::sort(prefixes.begin(), prefixes.end()); + prefixes.erase(std::unique(prefixes.begin(), prefixes.end()), prefixes.end()); + DCHECK(!prefixes.empty()); + + // TODO(kcarattini): Track checks in a map. + std::shared_ptr<SafeBrowsingApiCheck> check( + new SafeBrowsingApiCheck(url, full_hashes, client)); + + // TODO(kcarattini): Implement cache compliance. + v4_get_hash_protocol_manager_->GetFullHashesWithApis(prefixes, + base::Bind(&SafeBrowsingDatabaseManager::HandleGetHashesWithApisResults, + base::Unretained(this), check)); + + return false; +} + +void SafeBrowsingDatabaseManager::HandleGetHashesWithApisResults( + std::shared_ptr<SafeBrowsingApiCheck> check, + const std::vector<SBFullHashResult>& full_hash_results, + const base::TimeDelta& negative_cache_duration) { + DCHECK_CURRENTLY_ON(BrowserThread::IO); + DCHECK(check); + + ThreatMetadata md; + // Merge the metadata from all matching results. + // TODO(kcarattini): This is O(N^2). Look at improving performance by + // using a map, sorting or doing binary search etc.. + for (const SBFullHashResult& result : full_hash_results) { + for (const SBFullHash& full_hash : check->full_hashes()) { + if (SBFullHashEqual(full_hash, result.hash)) { + md.api_permissions.insert(md.api_permissions.end(), + result.metadata.api_permissions.begin(), + result.metadata.api_permissions.end()); + break; + } + } + } + + check->client()->OnCheckApiBlacklistUrlResult(check->url(), md); +} + +SafeBrowsingDatabaseManager::SafeBrowsingApiCheck::SafeBrowsingApiCheck( + const GURL& url, const std::vector<SBFullHash>& full_hashes, Client* client) + : url_(url), full_hashes_(full_hashes), client_(client) { +} + +SafeBrowsingDatabaseManager::SafeBrowsingApiCheck::~SafeBrowsingApiCheck() { } } // namespace safe_browsing
diff --git a/components/safe_browsing_db/database_manager.h b/components/safe_browsing_db/database_manager.h index 12d893d..df5fe35 100644 --- a/components/safe_browsing_db/database_manager.h +++ b/components/safe_browsing_db/database_manager.h
@@ -14,6 +14,8 @@ #include <string> #include <vector> +#include "base/gtest_prod_util.h" +#include "base/macros.h" #include "base/memory/ref_counted.h" #include "components/safe_browsing_db/hit_report.h" #include "components/safe_browsing_db/util.h" @@ -54,6 +56,7 @@ const std::set<std::string>& threats) {} // Called when the result of checking the API blacklist is known. + // TODO(kcarattini): Consider if we need |url| passed here, remove if not. virtual void OnCheckApiBlacklistUrlResult(const GURL& url, const ThreatMetadata& metadata) {} @@ -63,7 +66,6 @@ const std::string& threat_hash) {} }; - // Returns true if URL-checking is supported on this build+device. // If false, calls to CheckBrowseUrl may dcheck-fail. virtual bool IsSupported() const = 0; @@ -148,15 +150,20 @@ virtual bool IsCsdWhitelistKillSwitchOn() = 0; // Called on the IO thread to cancel a pending check if the result is no - // longer needed. Also called after the result has been handled. + // longer needed. Also called after the result has been handled. Api checks + // are handled separately. To cancel an API check use CancelApiCheck. virtual void CancelCheck(Client* client) = 0; + // TODO(kcarattini): Add a CancelApiCheck method. + // Called on the IO thread to check if the given url has blacklisted APIs. // "client" is called asynchronously with the result when it is ready. // This method has the same implementation for both the local and remote // database managers since it pings Safe Browsing servers directly without - // accessing the database at all. - virtual void CheckApiBlacklistUrl(const GURL& url, Client* client); + // accessing the database at all. Returns true if we can synchronously + // determine that the url is safe. Otherwise it returns false, and "client" is + // called asynchronously with the result when it is ready. + virtual bool CheckApiBlacklistUrl(const GURL& url, Client* client); // Called to initialize objects that are used on the io_thread, such as the // v4 protocol manager. This may be called multiple times during the life of @@ -169,13 +176,51 @@ virtual void StopOnIOThread(bool shutdown); protected: + // Bundled client info for an API abuse hash prefix check. + class SafeBrowsingApiCheck { + public: + SafeBrowsingApiCheck(const GURL& url, + const std::vector<SBFullHash>& full_hashes, + Client* client); + ~SafeBrowsingApiCheck(); + + const GURL& url() {return url_;} + std::vector<SBFullHash>& full_hashes() {return full_hashes_;} + SafeBrowsingDatabaseManager::Client* client() {return client_;} + + private: + GURL url_; + std::vector<SBFullHash> full_hashes_; + // Not owned. + SafeBrowsingDatabaseManager::Client* client_; + + DISALLOW_COPY_AND_ASSIGN(SafeBrowsingApiCheck); + }; + SafeBrowsingDatabaseManager(); virtual ~SafeBrowsingDatabaseManager(); friend class base::RefCountedThreadSafe<SafeBrowsingDatabaseManager>; - // Created and destroyed via StartonIOThread/StopOnIOThread. + FRIEND_TEST_ALL_PREFIXES(SafeBrowsingDatabaseManagerTest, + CheckApiBlacklistUrlPrefixes); + FRIEND_TEST_ALL_PREFIXES(SafeBrowsingDatabaseManagerTest, + HandleGetHashesWithApisResults); + FRIEND_TEST_ALL_PREFIXES(SafeBrowsingDatabaseManagerTest, + HandleGetHashesWithApisResultsNoMatch); + FRIEND_TEST_ALL_PREFIXES(SafeBrowsingDatabaseManagerTest, + HandleGetHashesWithApisResultsMatches); + + // Called on the IO thread wheh the SafeBrowsingProtocolManager has received + // the full hash and api results for prefixes of the |url| argument in + // CheckApiBlacklistUrl. + virtual void HandleGetHashesWithApisResults( + std::shared_ptr<SafeBrowsingApiCheck> check, + const std::vector<SBFullHashResult>& full_hash_results, + const base::TimeDelta& negative_cache_duration); + + // Created and destroyed via StartOnIOThread/StopOnIOThread. V4GetHashProtocolManager* v4_get_hash_protocol_manager_; }; // class SafeBrowsingDatabaseManager
diff --git a/components/safe_browsing_db/database_manager_unittest.cc b/components/safe_browsing_db/database_manager_unittest.cc new file mode 100644 index 0000000..c914a08 --- /dev/null +++ b/components/safe_browsing_db/database_manager_unittest.cc
@@ -0,0 +1,203 @@ +// 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 <stddef.h> + +#include <string> +#include <vector> + +#include "base/macros.h" +#include "base/memory/ref_counted.h" +#include "base/memory/scoped_ptr.h" +#include "base/run_loop.h" +#include "components/safe_browsing_db/database_manager.h" +#include "components/safe_browsing_db/test_database_manager.h" +#include "components/safe_browsing_db/v4_get_hash_protocol_manager.h" +#include "content/public/browser/browser_thread.h" +#include "content/public/test/test_browser_thread_bundle.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "url/gurl.h" + +using content::BrowserThread; + +namespace safe_browsing { + +namespace { + +// A TestV4GetHashProtocolManager that returns fixed responses from the +// Safe Browsing server for testing purpose. +class TestV4GetHashProtocolManager : public V4GetHashProtocolManager { + public: + TestV4GetHashProtocolManager( + net::URLRequestContextGetter* request_context_getter, + const V4ProtocolConfig& config) + : V4GetHashProtocolManager(request_context_getter, config) {} + + ~TestV4GetHashProtocolManager() override {} + + void GetFullHashesWithApis(const std::vector<SBPrefix>& prefixes, + FullHashCallback callback) override { + prefixes_ = prefixes; + callback.Run(full_hashes_, base::TimeDelta::FromMinutes(0)); + } + + // Prepare the GetFullHash results for the next request. + void AddGetFullHashResponse(const SBFullHashResult& full_hash_result) { + full_hashes_.push_back(full_hash_result); + } + + // Returns the prefixes that were sent in the last request. + const std::vector<SBPrefix>& GetRequestPrefixes() { return prefixes_; } + + private: + std::vector<SBPrefix> prefixes_; + std::vector<SBFullHashResult> full_hashes_; +}; + +// Factory that creates test protocol manager instances. +class TestV4GetHashProtocolManagerFactory : + public V4GetHashProtocolManagerFactory { + public: + TestV4GetHashProtocolManagerFactory() : pm_(NULL) {} + ~TestV4GetHashProtocolManagerFactory() override {} + + V4GetHashProtocolManager* CreateProtocolManager( + net::URLRequestContextGetter* request_context_getter, + const V4ProtocolConfig& config) override { + pm_ = new TestV4GetHashProtocolManager(request_context_getter, config); + return pm_; + } + + private: + // Owned by the SafeBrowsingDatabaseManager. + TestV4GetHashProtocolManager* pm_; +}; + +class TestClient : public SafeBrowsingDatabaseManager::Client { + public: + TestClient() {} + ~TestClient() override {} + + void OnCheckApiBlacklistUrlResult(const GURL& url, + const ThreatMetadata& metadata) override { + blocked_permissions_ = metadata.api_permissions; + } + + const std::vector<std::string>& GetBlockedPermissions() { + return blocked_permissions_; + } + + private: + std::vector<std::string> blocked_permissions_; + DISALLOW_COPY_AND_ASSIGN(TestClient); +}; + +} // namespace + +class SafeBrowsingDatabaseManagerTest : public testing::Test { + protected: + void SetUp() override { + TestV4GetHashProtocolManagerFactory get_hash_pm_factory; + V4GetHashProtocolManager::RegisterFactory(&get_hash_pm_factory); + + db_manager_ = new TestSafeBrowsingDatabaseManager(); + db_manager_->StartOnIOThread(NULL, V4ProtocolConfig()); + } + + void TearDown() override { + base::RunLoop().RunUntilIdle(); + db_manager_->StopOnIOThread(false); + } + + scoped_refptr<SafeBrowsingDatabaseManager> db_manager_; + + private: + content::TestBrowserThreadBundle test_browser_thread_bundle_; +}; + +TEST_F(SafeBrowsingDatabaseManagerTest, CheckApiBlacklistUrlWrongScheme) { + TestClient client; + const GURL url("file://example.txt"); + EXPECT_TRUE(db_manager_->CheckApiBlacklistUrl(url, &client)); +} + +TEST_F(SafeBrowsingDatabaseManagerTest, CheckApiBlacklistUrlPrefixes) { + TestClient client; + const GURL url("https://www.example.com/more"); + // Generated from the sorted output of UrlToFullHashes in util.h. + std::vector<SBPrefix> expected_prefixes = + {1237562338, 2871045197, 3553205461, 3766933875}; + + EXPECT_FALSE(db_manager_->CheckApiBlacklistUrl(url, &client)); + std::vector<SBPrefix> prefixes = static_cast<TestV4GetHashProtocolManager*>( + db_manager_->v4_get_hash_protocol_manager_)->GetRequestPrefixes(); + EXPECT_EQ(expected_prefixes.size(), prefixes.size()); + for (unsigned int i = 0; i < prefixes.size(); ++i) { + EXPECT_EQ(expected_prefixes[i], prefixes[i]); + } +} + +TEST_F(SafeBrowsingDatabaseManagerTest, HandleGetHashesWithApisResults) { + TestClient client; + const GURL url("https://www.example.com/more"); + TestV4GetHashProtocolManager* pm = static_cast<TestV4GetHashProtocolManager*>( + db_manager_->v4_get_hash_protocol_manager_); + SBFullHashResult full_hash_result; + full_hash_result.hash = SBFullHashForString("example.com/"); + full_hash_result.metadata.api_permissions.push_back("GEOLOCATION"); + pm->AddGetFullHashResponse(full_hash_result); + + EXPECT_FALSE(db_manager_->CheckApiBlacklistUrl(url, &client)); + base::RunLoop().RunUntilIdle(); + + const std::vector<std::string>& permissions = client.GetBlockedPermissions(); + EXPECT_EQ(1ul, permissions.size()); + EXPECT_EQ("GEOLOCATION", permissions[0]); +} + +TEST_F(SafeBrowsingDatabaseManagerTest, HandleGetHashesWithApisResultsNoMatch) { + TestClient client; + const GURL url("https://www.example.com/more"); + TestV4GetHashProtocolManager* pm = static_cast<TestV4GetHashProtocolManager*>( + db_manager_->v4_get_hash_protocol_manager_); + SBFullHashResult full_hash_result; + full_hash_result.hash = SBFullHashForString("wrongexample.com/"); + full_hash_result.metadata.api_permissions.push_back("GEOLOCATION"); + pm->AddGetFullHashResponse(full_hash_result); + + EXPECT_FALSE(db_manager_->CheckApiBlacklistUrl(url, &client)); + base::RunLoop().RunUntilIdle(); + + const std::vector<std::string>& permissions = client.GetBlockedPermissions(); + EXPECT_EQ(0ul, permissions.size()); +} + +TEST_F(SafeBrowsingDatabaseManagerTest, HandleGetHashesWithApisResultsMatches) { + TestClient client; + const GURL url("https://www.example.com/more"); + TestV4GetHashProtocolManager* pm = static_cast<TestV4GetHashProtocolManager*>( + db_manager_->v4_get_hash_protocol_manager_); + SBFullHashResult full_hash_result; + full_hash_result.hash = SBFullHashForString("example.com/"); + full_hash_result.metadata.api_permissions.push_back("GEOLOCATION"); + pm->AddGetFullHashResponse(full_hash_result); + SBFullHashResult full_hash_result2; + full_hash_result2.hash = SBFullHashForString("example.com/more"); + full_hash_result2.metadata.api_permissions.push_back("NOTIFICATIONS"); + pm->AddGetFullHashResponse(full_hash_result2); + SBFullHashResult full_hash_result3; + full_hash_result3.hash = SBFullHashForString("wrongexample.com/"); + full_hash_result3.metadata.api_permissions.push_back("AUDIO_CAPTURE"); + pm->AddGetFullHashResponse(full_hash_result3); + + EXPECT_FALSE(db_manager_->CheckApiBlacklistUrl(url, &client)); + base::RunLoop().RunUntilIdle(); + + const std::vector<std::string>& permissions = client.GetBlockedPermissions(); + EXPECT_EQ(2ul, permissions.size()); + EXPECT_EQ("GEOLOCATION", permissions[0]); + EXPECT_EQ("NOTIFICATIONS", permissions[1]); +} + +} // namespace safe_browsing
diff --git a/components/safe_browsing_db/test_database_manager.cc b/components/safe_browsing_db/test_database_manager.cc index 478e064..1c3a91e 100644 --- a/components/safe_browsing_db/test_database_manager.cc +++ b/components/safe_browsing_db/test_database_manager.cc
@@ -120,17 +120,4 @@ NOTIMPLEMENTED(); } -void TestSafeBrowsingDatabaseManager::CheckApiBlacklistUrl(const GURL& url, - Client* client) { - NOTIMPLEMENTED(); -} - -void TestSafeBrowsingDatabaseManager::StartOnIOThread( - net::URLRequestContextGetter* request_context_getter, - const V4ProtocolConfig& config) { -} - -void TestSafeBrowsingDatabaseManager::StopOnIOThread(bool shutdown) { -} - } // namespace safe_browsing
diff --git a/components/safe_browsing_db/test_database_manager.h b/components/safe_browsing_db/test_database_manager.h index eb7fcfd..ae98b9a1 100644 --- a/components/safe_browsing_db/test_database_manager.h +++ b/components/safe_browsing_db/test_database_manager.h
@@ -21,7 +21,8 @@ // This is a non-pure-virtual implementation of the SafeBrowsingDatabaseManager // interface. It's used in tests by overriding only the functions that get -// called, and it'll complain if you call one that isn't overriden. +// called, and it'll complain if you call one that isn't overriden. The +// non-abstract methods in the base class are not overridden. class TestSafeBrowsingDatabaseManager : public SafeBrowsingDatabaseManager { public: @@ -47,11 +48,6 @@ bool IsMalwareKillSwitchOn() override; bool IsCsdWhitelistKillSwitchOn() override; void CancelCheck(Client* client) override; - void CheckApiBlacklistUrl(const GURL& url, Client* client) override; - void StartOnIOThread( - net::URLRequestContextGetter* request_context_getter, - const V4ProtocolConfig& config) override; - void StopOnIOThread(bool shutdown) override; protected: ~TestSafeBrowsingDatabaseManager() override {};
diff --git a/components/security_state/BUILD.gn b/components/security_state/BUILD.gn index 68cd282..d6b37cf 100644 --- a/components/security_state/BUILD.gn +++ b/components/security_state/BUILD.gn
@@ -32,6 +32,18 @@ } } +bundle_data("unit_tests_bundle_data") { + visibility = [ ":unit_tests" ] + testonly = true + sources = [ + "//net/data/ssl/certificates/sha1_2016.pem", + ] + outputs = [ + "{{bundle_resources_dir}}/" + + "{{source_root_relative_dir}}/{{source_file_part}}", + ] +} + source_set("unit_tests") { testonly = true sources = [ @@ -40,6 +52,7 @@ deps = [ ":security_state", + ":unit_tests_bundle_data", "//net:test_support", "//testing/gtest", ]
diff --git a/components/strings/components_strings_am.xtb b/components/strings/components_strings_am.xtb index fae3e25..fce42e2 100644 --- a/components/strings/components_strings_am.xtb +++ b/components/strings/components_strings_am.xtb
@@ -513,6 +513,7 @@ <translation id="6671697161687535275">የአስተያየት ጥቆማ ከChromium ይወገድ?</translation> <translation id="6685834062052613830">ዘግተው ይውጡ እና ቅንብርን ያጠናቅቁ</translation> <translation id="6710213216561001401">ቀዳሚ</translation> +<translation id="6710594484020273272"><የፍለጋ ቃል ይተይቡ></translation> <translation id="6711464428925977395">በተኪ አገልጋዩ ላይ የሆነ ችግር አለ ወይም አድራሻው ትክክል አይደለም።</translation> <translation id="674375294223700098">ያልታወቀ የአገልጋይ እውቅና ማረጋገጫ ስህተት።</translation> <translation id="6746710319270251222">በርካታ የሚለዩ የይዘት-ርዝመት ያላቸው ራስጌዎች ደርሰዋል። የኤች ቲ ቲ ፒ ምላሽ ሰንጣቂ
diff --git a/components/strings/components_strings_ar.xtb b/components/strings/components_strings_ar.xtb index 117ef7dd..c92c136 100644 --- a/components/strings/components_strings_ar.xtb +++ b/components/strings/components_strings_ar.xtb
@@ -513,6 +513,7 @@ <translation id="6671697161687535275">هل تريد إزالة اقتراح النموذج من Chromium؟</translation> <translation id="6685834062052613830">الخروج وإكمال الإعداد</translation> <translation id="6710213216561001401">السابق</translation> +<translation id="6710594484020273272"><إدخال عبارة البحث></translation> <translation id="6711464428925977395">هناك خطأ ما في الخادم الوكيل، أو العنوان غير صحيح.</translation> <translation id="674375294223700098">حدث خطأ غير معروف في شهادة الخادم.</translation> <translation id="6746710319270251222">تم تلقي عدة رؤوس متنوعة بطول المحتوى. لا يسمح بهذا للحماية من هجمات تقسيم ردود HTTP.</translation>
diff --git a/components/strings/components_strings_ca.xtb b/components/strings/components_strings_ca.xtb index 5841d53b..1d9356e7 100644 --- a/components/strings/components_strings_ca.xtb +++ b/components/strings/components_strings_ca.xtb
@@ -692,7 +692,7 @@ <translation id="8730621377337864115">Fet</translation> <translation id="8738058698779197622">Per establir una connexió segura, el rellotge ha d'estar ben ajustat, perquè els certificats que els llocs web fan servir per identificar-se només són vàlids per a períodes de temps concrets. Com que el rellotge del dispositiu no està ben ajustat, Chromium no pot verificar aquests certificats.</translation> <translation id="8740359287975076522">No s'ha trobat l'<abbr id="dnsDefinition">adreça DNS</abbr> de <ph name="HOST_NAME" />. S'està diagnosticant el problema.</translation> -<translation id="8741995161408053644">És possible que el vostre compte de Google tingui altres formes de l'historial de navegació a l'adreça <ph name="BEGIN_LINK" />history.google.com<ph name="END_LINK" />.</translation> +<translation id="8741995161408053644">És possible que el vostre compte de Google tingui altres formes de l'historial de navegació a <ph name="BEGIN_LINK" />history.google.com<ph name="END_LINK" />.</translation> <translation id="8790007591277257123">&Refés la supressió</translation> <translation id="8798099450830957504">Predeterminat</translation> <translation id="8804164990146287819">Política de privadesa</translation>
diff --git a/components/strings/components_strings_en-GB.xtb b/components/strings/components_strings_en-GB.xtb index e9e13e5d..d2fd3f26 100644 --- a/components/strings/components_strings_en-GB.xtb +++ b/components/strings/components_strings_en-GB.xtb
@@ -513,6 +513,7 @@ <translation id="6671697161687535275">Remove form suggestion from Chromium?</translation> <translation id="6685834062052613830">Sign out and complete setup</translation> <translation id="6710213216561001401">Previous</translation> +<translation id="6710594484020273272"><Type search term></translation> <translation id="6711464428925977395">There is something wrong with the proxy server or the address is incorrect.</translation> <translation id="674375294223700098">Unknown server certificate error.</translation> <translation id="6746710319270251222">Multiple distinct Content-Length headers received. This is disallowed so as
diff --git a/components/strings/components_strings_fr.xtb b/components/strings/components_strings_fr.xtb index 23f966b..09ecebe 100644 --- a/components/strings/components_strings_fr.xtb +++ b/components/strings/components_strings_fr.xtb
@@ -695,7 +695,7 @@ <translation id="8730621377337864115">OK</translation> <translation id="8738058698779197622">Afin d'établir une connexion sécurisée, votre horloge doit être réglée correctement. Les certificats permettant aux sites Web de s'identifier sont en effet valides pendant une période précise. Si l'horloge de votre appareil est incorrecte, Chromium n'est pas en mesure de vérifier la validité des certificats.</translation> <translation id="8740359287975076522">L'<abbr id="dnsDefinition">adresse DNS</abbr> de <ph name="HOST_NAME" /> est introuvable. Identification du problème…</translation> -<translation id="8741995161408053644">Votre compte Google conserve peut- être d'autres formes d'historique de navigation sur la page <ph name="BEGIN_LINK" />history.google.com<ph name="END_LINK" />.</translation> +<translation id="8741995161408053644">Votre compte Google conserve peut-être d'autres formes d'historique de navigation sur la page <ph name="BEGIN_LINK" />history.google.com<ph name="END_LINK" />.</translation> <translation id="8790007591277257123">&Rétablir la suppression</translation> <translation id="8798099450830957504">Par défaut</translation> <translation id="8804164990146287819">Règles de confidentialité</translation>
diff --git a/components/strings/components_strings_hr.xtb b/components/strings/components_strings_hr.xtb index 601445d..8f341573 100644 --- a/components/strings/components_strings_hr.xtb +++ b/components/strings/components_strings_hr.xtb
@@ -286,7 +286,7 @@ <translation id="3788090790273268753">Certifikat za ovu web-lokaciju istječe 2016., a lanac certifikata sadrži certifikat s SHA-1 potpisom.</translation> <translation id="382518646247711829">Ako upotrebljavate proxy poslužitelj...</translation> <translation id="3828924085048779000">Prazne zaporke nisu dopuštene.</translation> -<translation id="3845539888601087042">Prikazuje se povijest s uređaja na kojima se prijavljujete. <ph name="BEGIN_LINK" />Saznajte više<ph name="END_LINK" />.</translation> +<translation id="3845539888601087042">Prikazuje se povijest s uređaja na kojima ste prijavljeni. <ph name="BEGIN_LINK" />Saznajte više<ph name="END_LINK" />.</translation> <translation id="385051799172605136">Natrag</translation> <translation id="3858027520442213535">Ažuriraj datum i vrijeme</translation> <translation id="3884278016824448484">Identifikator uređaja sukobljen je</translation>
diff --git a/components/strings/components_strings_hu.xtb b/components/strings/components_strings_hu.xtb index af1233a..1543db5 100644 --- a/components/strings/components_strings_hu.xtb +++ b/components/strings/components_strings_hu.xtb
@@ -510,6 +510,7 @@ <translation id="6671697161687535275">Eltávolítja az űrlapjavaslatot a Chromiumból?</translation> <translation id="6685834062052613830">Kijelentkezés és a beállítás befejezése</translation> <translation id="6710213216561001401">Előző</translation> +<translation id="6710594484020273272"><Írja be a keresési kifejezést></translation> <translation id="6711464428925977395">Valami gond van a proxyszerverrel, vagy a cím nem megfelelő.</translation> <translation id="674375294223700098">Ismeretlen szervertanúsítvány-hiba.</translation> <translation id="6746710319270251222">Több különböző Content-Length (tartalom-hossz) fejlécet kapott. Ez nem megengedett
diff --git a/components/strings/components_strings_iw.xtb b/components/strings/components_strings_iw.xtb index ec4312d..6d84f7c0 100644 --- a/components/strings/components_strings_iw.xtb +++ b/components/strings/components_strings_iw.xtb
@@ -310,7 +310,7 @@ <translation id="4075732493274867456">הלקוח והשרת אינם תומכים בגרסה נפוצה של פרוטוקול SSL או בחבילת צפנים.</translation> <translation id="4079302484614802869">תצורת ה-Proxy מוגדרת להשתמש בכתובת אתר של סקריפט מסוג .Pac ולא בשרתי Proxy קבועים.</translation> <translation id="4103249731201008433">המספר הסידורי של המכשיר אינו חוקי</translation> -<translation id="4103763322291513355">בקר בכתובת <strong>chrome://policy</strong> כדי לראות רשימה של כתובות אתרים שנמנעה אליהם הגישה, כמו גם תקנונים אחרים שנאכפו על ידי מנהל המערכת שלך.</translation> +<translation id="4103763322291513355">היכנס לכתובת <strong>chrome://policy</strong> כדי לראות רשימה של כתובות אתרים שנמנעה אליהם הגישה, כמו גם תקנונים אחרים שנאכפו על ידי מנהל המערכת שלך.</translation> <translation id="4117700440116928470">היקף המדיניות אינו נתמך.</translation> <translation id="4147376274874979956">לא ניתן לגשת לקובץ.</translation> <translation id="4148925816941278100">American Express</translation> @@ -520,6 +520,7 @@ <translation id="6671697161687535275">האם להסיר מ-Chromium הצעות לטפסים?</translation> <translation id="6685834062052613830">צא והשלם את ההגדרה</translation> <translation id="6710213216561001401">הקודם</translation> +<translation id="6710594484020273272"><הקלד מונח חיפוש></translation> <translation id="6711464428925977395">משהו אינו תקין בשרת ה-proxy, או שהכתובת שגויה.</translation> <translation id="674375294223700098">שגיאת אישור שרת לא ידוע.</translation> <translation id="6746710319270251222">התקבלו מספר כותרות נפרדות של אורך תוכן: הדבר אסור, כהגנה מפני
diff --git a/components/strings/components_strings_ms.xtb b/components/strings/components_strings_ms.xtb index 55fead44..c7192de 100644 --- a/components/strings/components_strings_ms.xtb +++ b/components/strings/components_strings_ms.xtb
@@ -514,6 +514,7 @@ <translation id="6671697161687535275">Alih keluar cadangan borang daripada Chromium?</translation> <translation id="6685834062052613830">Log keluar dan selesaikan persediaan</translation> <translation id="6710213216561001401">Sebelumnya</translation> +<translation id="6710594484020273272"><Taip istilah carian></translation> <translation id="6711464428925977395">Ada sesuatu yang tidak kena dengan pelayan proksi atau alamat tidak betul.</translation> <translation id="674375294223700098">Ralat sijil pelayan tidak diketahui.</translation> <translation id="6746710319270251222">Berbilang pengepala Panjang Kandungan berbeza diterima. Hal ini tidak dibenarkan
diff --git a/components/strings/components_strings_pl.xtb b/components/strings/components_strings_pl.xtb index a48b219..4bdf40d 100644 --- a/components/strings/components_strings_pl.xtb +++ b/components/strings/components_strings_pl.xtb
@@ -286,7 +286,7 @@ <translation id="3788090790273268753">Certyfikat tej witryny wygasa w 2016 roku, a łańcuch certyfikatów zawiera certyfikat podpisany algorytmem SHA-1.</translation> <translation id="382518646247711829">Jeśli używasz serwera proxy...</translation> <translation id="3828924085048779000">Puste hasło jest niedozwolone.</translation> -<translation id="3845539888601087042">Wyświetlam historię z zalogowanych urządzeń. <ph name="BEGIN_LINK" />Więcej informacji<ph name="END_LINK" /></translation> +<translation id="3845539888601087042">Wyświetlam historię z urządzeń, na których jesteś zalogowany. <ph name="BEGIN_LINK" />Więcej informacji<ph name="END_LINK" /></translation> <translation id="385051799172605136">Wstecz</translation> <translation id="3858027520442213535">Zaktualizuj datę i godzinę</translation> <translation id="3884278016824448484">Konflikt identyfikatorów urządzeń</translation>
diff --git a/components/strings/components_strings_pt-BR.xtb b/components/strings/components_strings_pt-BR.xtb index ec45661..8b2dc23f 100644 --- a/components/strings/components_strings_pt-BR.xtb +++ b/components/strings/components_strings_pt-BR.xtb
@@ -513,6 +513,7 @@ <translation id="6671697161687535275">Remover sugestão de formulário do Chromium?</translation> <translation id="6685834062052613830">Saia e conclua a configuração</translation> <translation id="6710213216561001401">Anterior</translation> +<translation id="6710594484020273272"><Digitar termo de pesquisa></translation> <translation id="6711464428925977395">Há algo errado com o servidor proxy, ou o endereço está incorreto.</translation> <translation id="674375294223700098">Erro, certificado de servidor desconhecido.</translation> <translation id="6746710319270251222">Vários cabeçalhos com conteúdos de diferentes tamanhos foram recebidos. Para garantir proteção
diff --git a/components/strings/components_strings_pt-PT.xtb b/components/strings/components_strings_pt-PT.xtb index 4a81d2ab..c560643 100644 --- a/components/strings/components_strings_pt-PT.xtb +++ b/components/strings/components_strings_pt-PT.xtb
@@ -513,6 +513,7 @@ <translation id="6671697161687535275">Pretende remover a sugestão do formulário do Chromium?</translation> <translation id="6685834062052613830">Termine sessão e conclua a configuração</translation> <translation id="6710213216561001401">Anterior</translation> +<translation id="6710594484020273272"><Introduzir termo de pesquisa></translation> <translation id="6711464428925977395">Existe um problema com o servidor proxy ou o endereço está incorreto.</translation> <translation id="674375294223700098">Erro de certificado de servidor desconhecido.</translation> <translation id="6746710319270251222">Foram recebidos vários cabeçalhos de Tamanho de conteúdo distintos. Isto não é permitido
diff --git a/components/strings/components_strings_ru.xtb b/components/strings/components_strings_ru.xtb index d739574b..f0f66c5 100644 --- a/components/strings/components_strings_ru.xtb +++ b/components/strings/components_strings_ru.xtb
@@ -512,6 +512,7 @@ <translation id="6671697161687535275">Удалить подсказку из Chromium?</translation> <translation id="6685834062052613830">Выйдите из аккаунта и завершите настройку</translation> <translation id="6710213216561001401">Назад</translation> +<translation id="6710594484020273272"><Введите поисковый запрос></translation> <translation id="6711464428925977395">На прокси-сервере возникла проблема или адрес указан неверно.</translation> <translation id="674375294223700098">Неизвестная ошибка сертификата сервера.</translation> <translation id="6746710319270251222">Получено несколько раздельных заголовков Content-Length. Это запрещено в целях
diff --git a/components/strings/components_strings_sk.xtb b/components/strings/components_strings_sk.xtb index a4b19f8..9b1a41f 100644 --- a/components/strings/components_strings_sk.xtb +++ b/components/strings/components_strings_sk.xtb
@@ -497,6 +497,7 @@ <translation id="6671697161687535275">Chcete návrh položky formulára odstrániť z prehliadača Chromium?</translation> <translation id="6685834062052613830">Odhláste sa a dokončite nastavenie</translation> <translation id="6710213216561001401">Dozadu</translation> +<translation id="6710594484020273272"><Zadajte hľadaný výraz></translation> <translation id="6711464428925977395">Vyskytol sa problém s proxy serverom alebo je adresa nesprávna.</translation> <translation id="674375294223700098">Neznáma chyba spôsobená certifikátom servera.</translation> <translation id="6746710319270251222">Bolo prijatých viacero rozdielnych hlavičiek typu Content-Length. Je to zakázané z dôvodu ochrany proti útokom rozdeľujúcim odpoveď HTTP.</translation>
diff --git a/components/strings/components_strings_sw.xtb b/components/strings/components_strings_sw.xtb index 0cbd162..6d31f762 100644 --- a/components/strings/components_strings_sw.xtb +++ b/components/strings/components_strings_sw.xtb
@@ -512,6 +512,7 @@ <translation id="6671697161687535275">Je, ungependa kuondoa pendekezo la fomu kwenye Chromium?</translation> <translation id="6685834062052613830">Ondoka na ukamilishe kuweka mipangilio</translation> <translation id="6710213216561001401">Iliyotangulia</translation> +<translation id="6710594484020273272"><Andika neno unalotaka kutafuta></translation> <translation id="6711464428925977395">Kuna hitilafu katika seva mbadala, au anwani siyo sahihi.</translation> <translation id="674375294223700098">Hitilafu isiyojulikana ya cheti cha seva.</translation> <translation id="6746710319270251222">Vijajuu anuwai vya Upana wa pekee wa Maudhui vilivyopokelewa. Hii hairuhusiwi ili
diff --git a/components/strings/components_strings_uk.xtb b/components/strings/components_strings_uk.xtb index bffd9a91..f4832afa 100644 --- a/components/strings/components_strings_uk.xtb +++ b/components/strings/components_strings_uk.xtb
@@ -513,6 +513,7 @@ <translation id="6671697161687535275">Видалити пропозицію автозаповнення форм із Chromium?</translation> <translation id="6685834062052613830">Вийдіть з облікового запису та завершіть процедуру налаштування</translation> <translation id="6710213216561001401">Попереднє</translation> +<translation id="6710594484020273272"><Введіть пошуковий термін></translation> <translation id="6711464428925977395">Помилка проксі-сервера або неправильна адреса.</translation> <translation id="674375294223700098">Помилка "Невідомий сертифікат сервера".</translation> <translation id="6746710319270251222">Отримано кілька окремих заголовків Content-Length. Це заборонено
diff --git a/components/test_runner/event_sender.cc b/components/test_runner/event_sender.cc index 58b8f1c..fca46e1 100644 --- a/components/test_runner/event_sender.cc +++ b/components/test_runner/event_sender.cc
@@ -523,6 +523,7 @@ void TouchMoveCausingScrollIfUncanceled(); void TouchCancel(); void TouchEnd(); + void NotifyStartOfTouchScroll(); void LeapForward(int milliseconds); double LastEventTimestamp(); void BeginDragWithFiles(const std::vector<std::string>& files); @@ -644,10 +645,10 @@ &EventSenderBindings::GestureScrollFirstPoint) .SetMethod("touchStart", &EventSenderBindings::TouchStart) .SetMethod("touchMove", &EventSenderBindings::TouchMove) - .SetMethod("touchMoveCausingScrollIfUncanceled", - &EventSenderBindings::TouchMoveCausingScrollIfUncanceled) .SetMethod("touchCancel", &EventSenderBindings::TouchCancel) .SetMethod("touchEnd", &EventSenderBindings::TouchEnd) + .SetMethod("notifyStartOfTouchScroll", + &EventSenderBindings::NotifyStartOfTouchScroll) .SetMethod("leapForward", &EventSenderBindings::LeapForward) .SetMethod("lastEventTimestamp", &EventSenderBindings::LastEventTimestamp) .SetMethod("beginDragWithFiles", &EventSenderBindings::BeginDragWithFiles) @@ -828,11 +829,6 @@ sender_->TouchMove(); } -void EventSenderBindings::TouchMoveCausingScrollIfUncanceled() { - if (sender_) - sender_->TouchMoveCausingScrollIfUncanceled(); -} - void EventSenderBindings::TouchCancel() { if (sender_) sender_->TouchCancel(); @@ -843,6 +839,11 @@ sender_->TouchEnd(); } +void EventSenderBindings::NotifyStartOfTouchScroll() { + if (sender_) + sender_->NotifyStartOfTouchScroll(); +} + void EventSenderBindings::LeapForward(int milliseconds) { if (sender_) sender_->LeapForward(milliseconds); @@ -1891,10 +1892,6 @@ SendCurrentTouchEvent(WebInputEvent::TouchMove, false); } -void EventSender::TouchMoveCausingScrollIfUncanceled() { - SendCurrentTouchEvent(WebInputEvent::TouchMove, true); -} - void EventSender::TouchCancel() { SendCurrentTouchEvent(WebInputEvent::TouchCancel, false); } @@ -1903,6 +1900,12 @@ SendCurrentTouchEvent(WebInputEvent::TouchEnd, false); } +void EventSender::NotifyStartOfTouchScroll() { + WebTouchEvent event; + event.type = WebInputEvent::TouchScrollStarted; + HandleInputEventOnViewOrPopup(event); +} + void EventSender::LeapForward(int milliseconds) { if (is_drag_mode_ && current_pointer_state_[kMousePointerId].pressed_button_ ==
diff --git a/components/test_runner/event_sender.h b/components/test_runner/event_sender.h index 471406c7..6a17bb7 100644 --- a/components/test_runner/event_sender.h +++ b/components/test_runner/event_sender.h
@@ -137,9 +137,9 @@ void TouchStart(); void TouchMove(); - void TouchMoveCausingScrollIfUncanceled(); void TouchCancel(); void TouchEnd(); + void NotifyStartOfTouchScroll(); void LeapForward(int milliseconds);
diff --git a/components/update_client/BUILD.gn b/components/update_client/BUILD.gn index a6a8931..7783b098 100644 --- a/components/update_client/BUILD.gn +++ b/components/update_client/BUILD.gn
@@ -90,6 +90,27 @@ ] } +bundle_data("unit_tests_bundle_data") { + visibility = [ ":unit_tests" ] + testonly = true + sources = [ + "//components/test/data/update_client/binary_bsdiff_patch.bin", + "//components/test/data/update_client/binary_courgette_patch.bin", + "//components/test/data/update_client/binary_input.bin", + "//components/test/data/update_client/binary_output.bin", + "//components/test/data/update_client/ihfokbkgjpifnbbojhneepfflplebdkc_1.crx", + "//components/test/data/update_client/ihfokbkgjpifnbbojhneepfflplebdkc_1to2.crx", + "//components/test/data/update_client/ihfokbkgjpifnbbojhneepfflplebdkc_2.crx", + "//components/test/data/update_client/jebgalgnebhfojomionfpkfelancnnkf.crx", + "//components/test/data/update_client/updatecheck_reply_1.xml", + "//components/test/data/update_client/updatecheck_reply_4.xml", + ] + outputs = [ + "{{bundle_resources_dir}}/" + + "{{source_root_relative_dir}}/{{source_file_part}}", + ] +} + source_set("unit_tests") { testonly = true sources = [ @@ -107,6 +128,7 @@ deps = [ ":test_support", + ":unit_tests_bundle_data", ":update_client", "//base", "//components/prefs",
diff --git a/components/upload_list/upload_list_unittest.cc b/components/upload_list/upload_list_unittest.cc index 450199c3..657f7db9 100644 --- a/components/upload_list/upload_list_unittest.cc +++ b/components/upload_list/upload_list_unittest.cc
@@ -36,7 +36,8 @@ } void WriteUploadLog(const std::string& log_data) { - ASSERT_GT(base::WriteFile(log_path(), log_data.c_str(), log_data.size()), + ASSERT_GT(base::WriteFile(log_path(), log_data.c_str(), + static_cast<int>(log_data.size())), 0); }
diff --git a/components/url_formatter/elide_url.cc b/components/url_formatter/elide_url.cc index 6e164f9..ad058c22 100644 --- a/components/url_formatter/elide_url.cc +++ b/components/url_formatter/elide_url.cc
@@ -106,50 +106,23 @@ url_subdomain->clear(); } } - #endif // !defined(OS_ANDROID) -base::string16 FormatUrlForSecurityDisplayInternal(const GURL& url, - bool omit_scheme) { - if (!url.is_valid() || url.is_empty() || !url.IsStandard()) - return url_formatter::FormatUrl(url); +bool ShouldShowScheme(const GURL& url, + const url_formatter::SchemeDisplay scheme_display) { + switch (scheme_display) { + case url_formatter::SchemeDisplay::SHOW: + return true; - const base::string16 colon(base::ASCIIToUTF16(":")); - const base::string16 scheme_separator( - base::ASCIIToUTF16(url::kStandardSchemeSeparator)); + case url_formatter::SchemeDisplay::OMIT_HTTP_AND_HTTPS: + return !url.SchemeIs(url::kHttpsScheme) && + !url.SchemeIs(url::kHttpScheme); - if (url.SchemeIsFile()) { - return base::ASCIIToUTF16(url::kFileScheme) + scheme_separator + - base::UTF8ToUTF16(url.path()); + case url_formatter::SchemeDisplay::OMIT_CRYPTOGRAPHIC: + return !url.SchemeIsCryptographic(); } - if (url.SchemeIsFileSystem()) { - const GURL* inner_url = url.inner_url(); - if (inner_url->SchemeIsFile()) { - return base::ASCIIToUTF16(url::kFileSystemScheme) + colon + - FormatUrlForSecurityDisplayInternal(*inner_url, false) + - base::UTF8ToUTF16(url.path()); - } - return base::ASCIIToUTF16(url::kFileSystemScheme) + colon + - FormatUrlForSecurityDisplayInternal(*inner_url, false); - } - - const GURL origin = url.GetOrigin(); - const std::string& scheme = origin.scheme(); - const std::string& host = origin.host(); - - base::string16 result; - if (!omit_scheme || !url.SchemeIsHTTPOrHTTPS()) - result = base::UTF8ToUTF16(scheme) + scheme_separator; - result += base::UTF8ToUTF16(host); - - const int port = origin.IntPort(); - const int default_port = url::DefaultPortForScheme( - scheme.c_str(), static_cast<int>(scheme.length())); - if (port != url::PORT_UNSPECIFIED && port != default_port) - result += colon + base::UTF8ToUTF16(origin.port()); - - return result; + return true; } } // namespace @@ -356,12 +329,47 @@ #endif // !defined(OS_ANDROID) -base::string16 FormatUrlForSecurityDisplay(const GURL& url) { - return FormatUrlForSecurityDisplayInternal(url, false); -} +base::string16 FormatUrlForSecurityDisplay(const GURL& url, + const SchemeDisplay scheme_display) { + if (!url.is_valid() || url.is_empty() || !url.IsStandard()) + return url_formatter::FormatUrl(url); -base::string16 FormatUrlForSecurityDisplayOmitScheme(const GURL& url) { - return FormatUrlForSecurityDisplayInternal(url, true); + const base::string16 colon(base::ASCIIToUTF16(":")); + const base::string16 scheme_separator( + base::ASCIIToUTF16(url::kStandardSchemeSeparator)); + + if (url.SchemeIsFile()) { + return base::ASCIIToUTF16(url::kFileScheme) + scheme_separator + + base::UTF8ToUTF16(url.path()); + } + + if (url.SchemeIsFileSystem()) { + const GURL* inner_url = url.inner_url(); + if (inner_url->SchemeIsFile()) { + return base::ASCIIToUTF16(url::kFileSystemScheme) + colon + + FormatUrlForSecurityDisplay(*inner_url) + + base::UTF8ToUTF16(url.path()); + } + return base::ASCIIToUTF16(url::kFileSystemScheme) + colon + + FormatUrlForSecurityDisplay(*inner_url); + } + + const GURL origin = url.GetOrigin(); + const std::string& scheme = origin.scheme(); + const std::string& host = origin.host(); + + base::string16 result; + if (ShouldShowScheme(url, scheme_display)) + result = base::UTF8ToUTF16(scheme) + scheme_separator; + result += base::UTF8ToUTF16(host); + + const int port = origin.IntPort(); + const int default_port = url::DefaultPortForScheme( + scheme.c_str(), static_cast<int>(scheme.length())); + if (port != url::PORT_UNSPECIFIED && port != default_port) + result += colon + base::UTF8ToUTF16(origin.port()); + + return result; } } // namespace url_formatter
diff --git a/components/url_formatter/elide_url.h b/components/url_formatter/elide_url.h index 60a5131..5f929ca 100644 --- a/components/url_formatter/elide_url.h +++ b/components/url_formatter/elide_url.h
@@ -48,6 +48,13 @@ float available_pixel_width); #endif // !defined(OS_ANDROID) +enum class SchemeDisplay { + SHOW, + OMIT_HTTP_AND_HTTPS, + // Omit cryptographic (i.e. https and wss). + OMIT_CRYPTOGRAPHIC, +}; + // This is a convenience function for formatting a URL in a concise and // human-friendly way, to help users make security-related decisions (or in // other circumstances when people need to distinguish sites, origins, or @@ -62,18 +69,14 @@ // // Do not use this for URLs which will be parsed or sent to other applications. // -// Generally, set prefer this function to -// |FormatUrlForSecurityDisplayOmitScheme| unless there is plenty of indication -// as to whether the origin is secure elsewhere in the UX. For example, in -// Chrome's Origin Info Bubble, there are icons and strings indicating origin -// (non-)security. But in the HTTP Basic Auth prompt (for example), the scheme -// may be the only indicator. -base::string16 FormatUrlForSecurityDisplay(const GURL& origin); - -// Just like |FormatUrlForSecurityDisplay|, but also: -// -// - Omits the scheme if SchemeIsHTTPOrHTTPS(). -base::string16 FormatUrlForSecurityDisplayOmitScheme(const GURL& origin); +// Generally, prefer SchemeDisplay::SHOW to omitting the scheme unless there is +// plenty of indication as to whether the origin is secure elsewhere in the UX. +// For example, in Chrome's Origin Info Bubble, there are icons and strings +// indicating origin (non-)security. But in the HTTP Basic Auth prompt (for +// example), the scheme may be the only indicator. +base::string16 FormatUrlForSecurityDisplay( + const GURL& origin, + const SchemeDisplay scheme_display = SchemeDisplay::SHOW); } // namespace url_formatter
diff --git a/components/url_formatter/elide_url_unittest.cc b/components/url_formatter/elide_url_unittest.cc index 97cafaf..db7f5e63 100644 --- a/components/url_formatter/elide_url_unittest.cc +++ b/components/url_formatter/elide_url_unittest.cc
@@ -235,95 +235,127 @@ const char* const description; const char* const input; const wchar_t* const output; - const wchar_t* const output_omit_scheme; + const wchar_t* const output_omit_web_scheme; + const wchar_t* const output_omit_cryptographic_scheme; }; const OriginTestData tests[] = { - {"Empty URL", "", L"", L""}, + {"Empty URL", "", L"", L"", L""}, {"HTTP URL", "http://www.google.com/", L"http://www.google.com", - L"www.google.com"}, + L"www.google.com", L"http://www.google.com"}, {"HTTPS URL", "https://www.google.com/", L"https://www.google.com", - L"www.google.com"}, + L"www.google.com", L"www.google.com"}, {"Standard HTTP port", "http://www.google.com:80/", - L"http://www.google.com", L"www.google.com"}, + L"http://www.google.com", L"www.google.com", L"http://www.google.com"}, {"Standard HTTPS port", "https://www.google.com:443/", - L"https://www.google.com", L"www.google.com"}, + L"https://www.google.com", L"www.google.com", L"www.google.com"}, {"Standard HTTP port, IDN Chinese", "http://\xe4\xb8\xad\xe5\x9b\xbd.icom.museum:80", - L"http://xn--fiqs8s.icom.museum", L"xn--fiqs8s.icom.museum"}, + L"http://xn--fiqs8s.icom.museum", L"xn--fiqs8s.icom.museum", + L"http://xn--fiqs8s.icom.museum"}, {"HTTP URL, IDN Hebrew (RTL)", "http://" "\xd7\x90\xd7\x99\xd7\xa7\xd7\x95\xd7\xb4\xd7\x9d." "\xd7\x99\xd7\xa9\xd7\xa8\xd7\x90\xd7\x9c.museum/", L"http://xn--4dbklr2c8d.xn--4dbrk0ce.museum", - L"xn--4dbklr2c8d.xn--4dbrk0ce.museum"}, + L"xn--4dbklr2c8d.xn--4dbrk0ce.museum", + L"http://xn--4dbklr2c8d.xn--4dbrk0ce.museum"}, {"HTTP URL with query string, IDN Arabic (RTL)", "http://\xd9\x85\xd8\xb5\xd8\xb1.icom.museum/foo.html?yes=no", - L"http://xn--wgbh1c.icom.museum", L"xn--wgbh1c.icom.museum"}, + L"http://xn--wgbh1c.icom.museum", L"xn--wgbh1c.icom.museum", + L"http://xn--wgbh1c.icom.museum"}, {"Non-standard HTTP port", "http://www.google.com:9000/", - L"http://www.google.com:9000", L"www.google.com:9000"}, + L"http://www.google.com:9000", L"www.google.com:9000", + L"http://www.google.com:9000"}, {"Non-standard HTTPS port", "https://www.google.com:9000/", - L"https://www.google.com:9000", L"www.google.com:9000"}, + L"https://www.google.com:9000", L"www.google.com:9000", + L"www.google.com:9000"}, {"File URI", "file:///usr/example/file.html", - L"file:///usr/example/file.html", L"file:///usr/example/file.html"}, + L"file:///usr/example/file.html", L"file:///usr/example/file.html", + L"file:///usr/example/file.html"}, {"File URI with hostname", "file://localhost/usr/example/file.html", - L"file:///usr/example/file.html", L"file:///usr/example/file.html"}, + L"file:///usr/example/file.html", L"file:///usr/example/file.html", + L"file:///usr/example/file.html"}, {"UNC File URI 1", "file:///CONTOSO/accounting/money.xls", L"file:///CONTOSO/accounting/money.xls", + L"file:///CONTOSO/accounting/money.xls", L"file:///CONTOSO/accounting/money.xls"}, {"UNC File URI 2", "file:///C:/Program%20Files/Music/Web%20Sys/main.html?REQUEST=RADIO", L"file:///C:/Program%20Files/Music/Web%20Sys/main.html", + L"file:///C:/Program%20Files/Music/Web%20Sys/main.html", L"file:///C:/Program%20Files/Music/Web%20Sys/main.html"}, {"HTTP URL with path", "http://www.google.com/test.html", - L"http://www.google.com", L"www.google.com"}, + L"http://www.google.com", L"www.google.com", L"http://www.google.com"}, {"HTTPS URL with path", "https://www.google.com/test.html", - L"https://www.google.com", L"www.google.com"}, + L"https://www.google.com", L"www.google.com", L"www.google.com"}, {"Unusual secure scheme (wss)", "wss://www.google.com/", - L"wss://www.google.com", L"wss://www.google.com"}, + L"wss://www.google.com", L"wss://www.google.com", L"www.google.com"}, {"Unusual non-secure scheme (gopher)", "gopher://www.google.com/", - L"gopher://www.google.com", L"gopher://www.google.com"}, + L"gopher://www.google.com", L"gopher://www.google.com", + L"gopher://www.google.com"}, {"Unlisted scheme (chrome)", "chrome://version", L"chrome://version", - L"chrome://version"}, + L"chrome://version", L"chrome://version"}, {"HTTP IP address", "http://173.194.65.103", L"http://173.194.65.103", - L"173.194.65.103"}, + L"173.194.65.103", L"http://173.194.65.103"}, {"HTTPS IP address", "https://173.194.65.103", L"https://173.194.65.103", - L"173.194.65.103"}, + L"173.194.65.103", L"173.194.65.103"}, {"HTTP IPv6 address", "http://[FE80:0000:0000:0000:0202:B3FF:FE1E:8329]/", - L"http://[fe80::202:b3ff:fe1e:8329]", L"[fe80::202:b3ff:fe1e:8329]"}, - {"HTTPS IPv6 address with port", "https://[2001:db8:0:1]:443/", - L"https://[2001:db8:0:1]", L"https://[2001:db8:0:1]"}, + L"http://[fe80::202:b3ff:fe1e:8329]", L"[fe80::202:b3ff:fe1e:8329]", + L"http://[fe80::202:b3ff:fe1e:8329]"}, + {"HTTPs IPv6 address", + "https://[FE80:0000:0000:0000:0202:B3FF:FE1E:8329]/", + L"https://[fe80::202:b3ff:fe1e:8329]", L"[fe80::202:b3ff:fe1e:8329]", + L"[fe80::202:b3ff:fe1e:8329]"}, + {"HTTP IPv6 address with port", + "http://[FE80:0000:0000:0000:0202:B3FF:FE1E:8329]:80/", + L"http://[fe80::202:b3ff:fe1e:8329]", L"[fe80::202:b3ff:fe1e:8329]", + L"http://[fe80::202:b3ff:fe1e:8329]"}, + {"HTTPs IPv6 address with port", + "https://[FE80:0000:0000:0000:0202:B3FF:FE1E:8329]:443/", + L"https://[fe80::202:b3ff:fe1e:8329]", L"[fe80::202:b3ff:fe1e:8329]", + L"[fe80::202:b3ff:fe1e:8329]"}, + {"Invalid IPv6 address", "https://[2001:db8:0:1]/", + L"https://[2001:db8:0:1]", L"https://[2001:db8:0:1]", + L"https://[2001:db8:0:1]"}, {"HTTPS IP address, non-default port", "https://173.194.65.103:8443", - L"https://173.194.65.103:8443", L"173.194.65.103:8443"}, + L"https://173.194.65.103:8443", L"173.194.65.103:8443", + L"173.194.65.103:8443"}, {"HTTP filesystem: URL with path", "filesystem:http://www.google.com/temporary/test.html", - L"filesystem:http://www.google.com", + L"filesystem:http://www.google.com", L"filesystem:http://www.google.com", L"filesystem:http://www.google.com"}, {"File filesystem: URL with path", "filesystem:file://localhost/temporary/stuff/test.html?z=fun&goat=billy", L"filesystem:file:///temporary/stuff/test.html", + L"filesystem:file:///temporary/stuff/test.html", L"filesystem:file:///temporary/stuff/test.html"}, {"Invalid scheme 1", "twelve://www.cyber.org/wow.php", - L"twelve://www.cyber.org/wow.php", L"twelve://www.cyber.org/wow.php"}, + L"twelve://www.cyber.org/wow.php", L"twelve://www.cyber.org/wow.php", + L"twelve://www.cyber.org/wow.php"}, {"Invalid scheme 2", "://www.cyber.org/wow.php", - L"://www.cyber.org/wow.php", L"://www.cyber.org/wow.php"}, + L"://www.cyber.org/wow.php", L"://www.cyber.org/wow.php", + L"://www.cyber.org/wow.php"}, {"Invalid host 1", "https://www.cyber../wow.php", L"https://www.cyber..", - L"www.cyber.."}, + L"www.cyber..", L"www.cyber.."}, {"Invalid host 2", "https://www...cyber/wow.php", L"https://www...cyber", - L"www...cyber"}, + L"www...cyber", L"www...cyber"}, {"Invalid port 1", "https://173.194.65.103:000", - L"https://173.194.65.103:0", L"173.194.65.103:0"}, + L"https://173.194.65.103:0", L"173.194.65.103:0", L"173.194.65.103:0"}, {"Invalid port 2", "https://173.194.65.103:gruffle", - L"https://173.194.65.103:gruffle", L"https://173.194.65.103:gruffle"}, + L"https://173.194.65.103:gruffle", L"https://173.194.65.103:gruffle", + L"https://173.194.65.103:gruffle"}, {"Invalid port 3", "https://173.194.65.103:/hello.aspx", - L"https://173.194.65.103", L"173.194.65.103"}, + L"https://173.194.65.103", L"173.194.65.103", L"173.194.65.103"}, {"Trailing dot in DNS name", "https://www.example.com./get/goat", - L"https://www.example.com.", L"www.example.com."}, + L"https://www.example.com.", L"www.example.com.", L"www.example.com."}, {"Blob URL", "blob:http://www.html5rocks.com/4d4ff040-6d61-4446-86d3-13ca07ec9ab9", L"blob:http://www.html5rocks.com/" L"4d4ff040-6d61-4446-86d3-13ca07ec9ab9", L"blob:http://www.html5rocks.com/" + L"4d4ff040-6d61-4446-86d3-13ca07ec9ab9", + L"blob:http://www.html5rocks.com/" L"4d4ff040-6d61-4446-86d3-13ca07ec9ab9"}}; for (size_t i = 0; i < arraysize(tests); ++i) { @@ -332,11 +364,20 @@ EXPECT_EQ(base::WideToUTF16(tests[i].output), formatted) << tests[i].description; - base::string16 formatted_omit_scheme = - url_formatter::FormatUrlForSecurityDisplayOmitScheme( - GURL(tests[i].input)); - EXPECT_EQ(base::WideToUTF16(tests[i].output_omit_scheme), - formatted_omit_scheme) + base::string16 formatted_omit_web_scheme = + url_formatter::FormatUrlForSecurityDisplay( + GURL(tests[i].input), + url_formatter::SchemeDisplay::OMIT_HTTP_AND_HTTPS); + EXPECT_EQ(base::WideToUTF16(tests[i].output_omit_web_scheme), + formatted_omit_web_scheme) + << tests[i].description; + + base::string16 formatted_omit_cryptographic_scheme = + url_formatter::FormatUrlForSecurityDisplay( + GURL(tests[i].input), + url_formatter::SchemeDisplay::OMIT_CRYPTOGRAPHIC); + EXPECT_EQ(base::WideToUTF16(tests[i].output_omit_cryptographic_scheme), + formatted_omit_cryptographic_scheme) << tests[i].description; } @@ -346,7 +387,13 @@ << "Explicitly test the 0-argument GURL constructor"; base::string16 formatted_omit_scheme = - url_formatter::FormatUrlForSecurityDisplayOmitScheme(GURL()); + url_formatter::FormatUrlForSecurityDisplay( + GURL(), url_formatter::SchemeDisplay::OMIT_HTTP_AND_HTTPS); + EXPECT_EQ(base::string16(), formatted_omit_scheme) + << "Explicitly test the 0-argument GURL constructor"; + + formatted_omit_scheme = url_formatter::FormatUrlForSecurityDisplay( + GURL(), url_formatter::SchemeDisplay::OMIT_CRYPTOGRAPHIC); EXPECT_EQ(base::string16(), formatted_omit_scheme) << "Explicitly test the 0-argument GURL constructor"; }
diff --git a/components/user_manager/fake_user_manager.cc b/components/user_manager/fake_user_manager.cc index 7efb1d3..b91df2e5 100644 --- a/components/user_manager/fake_user_manager.cc +++ b/components/user_manager/fake_user_manager.cc
@@ -277,11 +277,7 @@ return false; } -bool FakeUserManager::IsKioskApp(const AccountId& account_id) const { - return false; -} - -bool FakeUserManager::IsPublicAccountMarkedForRemoval( +bool FakeUserManager::IsDeviceLocalAccountMarkedForRemoval( const AccountId& account_id) const { return false; }
diff --git a/components/user_manager/fake_user_manager.h b/components/user_manager/fake_user_manager.h index fa36f3e..5682ab04 100644 --- a/components/user_manager/fake_user_manager.h +++ b/components/user_manager/fake_user_manager.h
@@ -127,16 +127,16 @@ const AccountId& account_id, user_manager::User::OAuthTokenStatus status) const override {} bool IsEnterpriseManaged() const override; - void LoadPublicAccounts(std::set<AccountId>* public_sessions_set) override {} + void LoadDeviceLocalAccounts( + std::set<AccountId>* device_local_accounts_set) override {} void PerformPreUserListLoadingActions() override {} void PerformPostUserListLoadingActions() override {} void PerformPostUserLoggedInActions(bool browser_restart) override {} bool IsDemoApp(const AccountId& account_id) const override; - bool IsKioskApp(const AccountId& account_id) const override; - bool IsPublicAccountMarkedForRemoval( + bool IsDeviceLocalAccountMarkedForRemoval( const AccountId& account_id) const override; void DemoAccountLoggedIn() override {} - void KioskAppLoggedIn(const AccountId& kiosk_app_account_id) override {} + void KioskAppLoggedIn(user_manager::User* user) override {} void PublicAccountUserLoggedIn(user_manager::User* user) override {} void SupervisedUserLoggedIn(const AccountId& account_id) override {} void OnUserRemoved(const AccountId& account_id) override {}
diff --git a/components/user_manager/user.cc b/components/user_manager/user.cc index fc7b56c2..26e97d1 100644 --- a/components/user_manager/user.cc +++ b/components/user_manager/user.cc
@@ -79,6 +79,7 @@ ~DeviceLocalAccountUserBase() override; // User: void SetAffiliation(bool) override; + bool IsDeviceLocalAccount() const override; private: DISALLOW_COPY_AND_ASSIGN(DeviceLocalAccountUserBase); @@ -121,6 +122,11 @@ DISALLOW_COPY_AND_ASSIGN(PublicAccountUser); }; +User::User(const AccountId& account_id) + : account_id_(account_id), user_image_(new UserImage) {} + +User::~User() {} + std::string User::GetEmail() const { return display_email(); } @@ -204,6 +210,10 @@ is_affiliated_ = is_affiliated; } +bool User::IsDeviceLocalAccount() const { + return false; +} + User* User::CreateRegularUser(const AccountId& account_id) { return new RegularUser(account_id); } @@ -224,12 +234,6 @@ return new PublicAccountUser(account_id); } -User::User(const AccountId& account_id) : account_id_(account_id), - user_image_(new UserImage) {} - -User::~User() { -} - void User::SetAccountLocale(const std::string& resolved_account_locale) { account_locale_.reset(new std::string(resolved_account_locale)); } @@ -306,6 +310,10 @@ NOTREACHED(); } +bool DeviceLocalAccountUserBase::IsDeviceLocalAccount() const { + return true; +} + KioskAppUser::KioskAppUser(const AccountId& kiosk_app_account_id) : DeviceLocalAccountUserBase(kiosk_app_account_id) { set_display_email(kiosk_app_account_id.GetUserEmail());
diff --git a/components/user_manager/user.h b/components/user_manager/user.h index 20befa1..9a6acbc 100644 --- a/components/user_manager/user.h +++ b/components/user_manager/user.h
@@ -83,6 +83,9 @@ // Returns true if user type has gaia account. static bool TypeHasGaiaAccount(UserType user_type); + explicit User(const AccountId& account_id); + ~User() override; + // UserInfo std::string GetEmail() const override; base::string16 GetDisplayName() const override; @@ -112,6 +115,9 @@ // True if the user is affiliated to the device. virtual bool IsAffiliated() const; + // True if the user is a device local account user. + virtual bool IsDeviceLocalAccount() const; + // The email the user used to log in. // TODO(alemate): rename this to GetUserEmail() (see crbug.com/548923) const std::string& email() const; @@ -194,9 +200,6 @@ static User* CreateSupervisedUser(const AccountId& account_id); static User* CreatePublicAccountUser(const AccountId& account_id); - explicit User(const AccountId& account_id); - ~User() override; - const std::string* GetAccountLocale() const { return account_locale_.get(); } // Setters are private so only UserManager can call them.
diff --git a/components/user_manager/user_manager_base.cc b/components/user_manager/user_manager_base.cc index f6f5cf80..7f178809 100644 --- a/components/user_manager/user_manager_base.cc +++ b/components/user_manager/user_manager_base.cc
@@ -152,8 +152,6 @@ if (IsGuestAccountId(account_id)) { GuestUserLoggedIn(); - } else if (IsKioskApp(account_id)) { - KioskAppLoggedIn(account_id); } else if (IsDemoApp(account_id)) { DemoAccountLoggedIn(); } else { @@ -161,10 +159,13 @@ if (user && user->GetType() == USER_TYPE_PUBLIC_ACCOUNT) { PublicAccountUserLoggedIn(user); + } else if (user && user->GetType() == USER_TYPE_KIOSK_APP) { + KioskAppLoggedIn(user); } else if ((user && user->GetType() == USER_TYPE_SUPERVISED) || (!user && IsSupervisedAccountId(account_id))) { SupervisedUserLoggedIn(account_id); - } else if (browser_restart && IsPublicAccountMarkedForRemoval(account_id)) { + } else if (browser_restart && + IsDeviceLocalAccountMarkedForRemoval(account_id)) { PublicAccountUserLoggedIn(User::CreatePublicAccountUser(account_id)); } else if (account_id != GetOwnerAccountId() && !user && (AreEphemeralUsersEnabled() || browser_restart)) { @@ -595,9 +596,9 @@ return true; // Data belonging to the owner, anyone found on the user list and obsolete - // public accounts whose data has not been removed yet is not ephemeral. + // device local accounts whose data has not been removed yet is not ephemeral. if (account_id == GetOwnerAccountId() || UserExistsInList(account_id) || - IsPublicAccountMarkedForRemoval(account_id)) { + IsDeviceLocalAccountMarkedForRemoval(account_id)) { return false; } @@ -726,15 +727,13 @@ local_state->GetDictionary(kUserType); // Load public sessions first. - std::set<AccountId> public_sessions_set; - LoadPublicAccounts(&public_sessions_set); + std::set<AccountId> device_local_accounts_set; + LoadDeviceLocalAccounts(&device_local_accounts_set); // Load regular users and supervised users. std::vector<AccountId> regular_users; std::set<AccountId> regular_users_set; - ParseUserList(*prefs_regular_users, - public_sessions_set, - ®ular_users, + ParseUserList(*prefs_regular_users, device_local_accounts_set, ®ular_users, ®ular_users_set); for (std::vector<AccountId>::const_iterator it = regular_users.begin(); it != regular_users.end(); ++it) {
diff --git a/components/user_manager/user_manager_base.h b/components/user_manager/user_manager_base.h index 0cc333a..db40c8d0 100644 --- a/components/user_manager/user_manager_base.h +++ b/components/user_manager/user_manager_base.h
@@ -154,12 +154,10 @@ // Returns true if device is enterprise managed. virtual bool IsEnterpriseManaged() const = 0; - // Helper function that copies users from |users_list| to |users_vector| and - // |users_set|. Duplicates and users already present in |existing_users| are - // skipped. - // Loads public accounts from the Local state and fills in - // |public_sessions_set|. - virtual void LoadPublicAccounts(std::set<AccountId>* public_sessions_set) = 0; + // Loads device local accounts from the Local state and fills in + // |device_local_accounts_set|. + virtual void LoadDeviceLocalAccounts( + std::set<AccountId>* device_local_accounts_set) = 0; // Notifies that user has logged in. virtual void NotifyOnLogin(); @@ -207,12 +205,9 @@ // Returns true if |account_id| represents demo app. virtual bool IsDemoApp(const AccountId& account_id) const = 0; - // Returns true if |account_id| represents kiosk app. - virtual bool IsKioskApp(const AccountId& account_id) const = 0; - - // Returns true if |account_id| represents public account that has been marked - // for deletion. - virtual bool IsPublicAccountMarkedForRemoval( + // Returns true if |account_id| represents a device local account that has + // been marked for deletion. + virtual bool IsDeviceLocalAccountMarkedForRemoval( const AccountId& account_id) const = 0; // These methods are called when corresponding user type has signed in. @@ -224,7 +219,7 @@ virtual void GuestUserLoggedIn(); // Indicates that a kiosk app robot just logged in. - virtual void KioskAppLoggedIn(const AccountId& kiosk_app_account_id) = 0; + virtual void KioskAppLoggedIn(User* user) = 0; // Indicates that a user just logged into a public session. virtual void PublicAccountUserLoggedIn(User* user) = 0; @@ -269,8 +264,8 @@ User* primary_user_ = nullptr; // List of all known users. User instances are owned by |this|. Regular users - // are removed by |RemoveUserFromList|, public accounts by - // |UpdateAndCleanUpPublicAccounts|. + // are removed by |RemoveUserFromList|, device local accounts by + // |UpdateAndCleanUpDeviceLocalAccounts|. UserList users_; // List of all users that are logged in current session. These point to User
diff --git a/components/user_prefs/tracked/BUILD.gn b/components/user_prefs/tracked/BUILD.gn index 8a855eebf..3afd2bc 100644 --- a/components/user_prefs/tracked/BUILD.gn +++ b/components/user_prefs/tracked/BUILD.gn
@@ -41,14 +41,10 @@ "tracked_split_preference.h", ] - if (is_win || (is_mac && !is_ios)) { + if (is_win || is_mac) { sources -= [ "device_id_stub.cc" ] } - if (is_ios) { - sources -= [ "device_id_mac.cc" ] - } - # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
diff --git a/components/webdata/common/BUILD.gn b/components/webdata/common/BUILD.gn index 6f99807..4ddd2c90 100644 --- a/components/webdata/common/BUILD.gn +++ b/components/webdata/common/BUILD.gn
@@ -33,6 +33,31 @@ ] } +bundle_data("unit_tests_bundle_data") { + visibility = [ ":unit_tests" ] + testonly = true + sources = [ + "//components/test/data/web_database/version_50.sql", + "//components/test/data/web_database/version_52.sql", + "//components/test/data/web_database/version_53.sql", + "//components/test/data/web_database/version_54.sql", + "//components/test/data/web_database/version_55.sql", + "//components/test/data/web_database/version_56.sql", + "//components/test/data/web_database/version_57.sql", + "//components/test/data/web_database/version_58.sql", + "//components/test/data/web_database/version_59.sql", + "//components/test/data/web_database/version_60.sql", + "//components/test/data/web_database/version_61.sql", + "//components/test/data/web_database/version_62.sql", + "//components/test/data/web_database/version_63.sql", + "//components/test/data/web_database/version_64.sql", + ] + outputs = [ + "{{bundle_resources_dir}}/" + + "{{source_root_relative_dir}}/{{source_file_part}}", + ] +} + source_set("unit_tests") { testonly = true sources = [ @@ -41,6 +66,7 @@ deps = [ ":common", + ":unit_tests_bundle_data", "//base", "//components/autofill/core/browser", "//components/password_manager/core/browser",
diff --git a/components/webp_transcode/BUILD.gn b/components/webp_transcode/BUILD.gn index 930ecc1..acc30d6a 100644 --- a/components/webp_transcode/BUILD.gn +++ b/components/webp_transcode/BUILD.gn
@@ -16,6 +16,23 @@ ] } +bundle_data("unit_tests_bundle_data") { + visibility = [ ":unit_tests" ] + testonly = true + sources = [ + "//components/test/data/webp_transcode/test.jpg", + "//components/test/data/webp_transcode/test.webp", + "//components/test/data/webp_transcode/test_alpha.png", + "//components/test/data/webp_transcode/test_alpha.webp", + "//components/test/data/webp_transcode/test_small.tiff", + "//components/test/data/webp_transcode/test_small.webp", + ] + outputs = [ + "{{bundle_resources_dir}}/" + + "{{source_root_relative_dir}}/{{source_file_part}}", + ] +} + source_set("unit_tests") { testonly = true sources = [ @@ -23,6 +40,7 @@ ] deps = [ + ":unit_tests_bundle_data", ":webp_transcode", "//base", "//net",
diff --git a/content/DEPS b/content/DEPS index f5efa16c..1d6f952 100644 --- a/content/DEPS +++ b/content/DEPS
@@ -81,7 +81,6 @@ "+ui/events", "+ui/gfx", "+ui/gl", - "+ui/latency_info", "+ui/native_theme", "+ui/ozone/public", "+ui/resources/grit/ui_resources.h",
diff --git a/content/app/content_main_runner.cc b/content/app/content_main_runner.cc index 5b4586c3..abe4f130 100644 --- a/content/app/content_main_runner.cc +++ b/content/app/content_main_runner.cc
@@ -79,7 +79,7 @@ #include "base/trace_event/trace_event_etw_export_win.h" #include "base/win/process_startup_helper.h" #include "ui/base/win/atl_module.h" -#include "ui/gfx/win/dpi.h" +#include "ui/display/win/dpi.h" #elif defined(OS_MACOSX) #include "base/mac/scoped_nsautorelease_pool.h" #include "base/power_monitor/power_monitor_device_source.h" @@ -532,7 +532,7 @@ switches::kDeviceScaleFactor); double scale_factor = 0; if (base::StringToDouble(scale_factor_string, &scale_factor)) - gfx::SetDefaultDeviceScaleFactor(scale_factor); + display::win::SetDefaultDeviceScaleFactor(scale_factor); } #endif
diff --git a/content/app/strings/translations/content_strings_ca.xtb b/content/app/strings/translations/content_strings_ca.xtb index e45cd1a..151fd19c 100644 --- a/content/app/strings/translations/content_strings_ca.xtb +++ b/content/app/strings/translations/content_strings_ca.xtb
@@ -20,7 +20,7 @@ <translation id="167575180612809735">indicador d'ocupat</translation> <translation id="1729654308190250600">Introduïu una adreça electrònica.</translation> <translation id="1758486001363313524">Altres...</translation> -<translation id="1806710327868736751">quadre_de_diàleg_alerta</translation> +<translation id="1806710327868736751">alert_dialog</translation> <translation id="1821985195704844674">quadrícula d'arbre</translation> <translation id="1822429046913737220">a. m./p. m.</translation> <translation id="1832974991323546415">reprodueix al dispositiu remot</translation>
diff --git a/content/app/strings/translations/content_strings_sw.xtb b/content/app/strings/translations/content_strings_sw.xtb index 81c57e96..8c0325a7 100644 --- a/content/app/strings/translations/content_strings_sw.xtb +++ b/content/app/strings/translations/content_strings_sw.xtb
@@ -167,7 +167,7 @@ <translation id="8433900881053900389">upau wa vidhibiti</translation> <translation id="8444882422881193423">faili <ph name="NUMBER_OF_FILES" /></translation> <translation id="8451268428117625855">Tafadhali chagua faili.</translation> -<translation id="8461852803063341183">kitufe cha kuteua kimoja</translation> +<translation id="8461852803063341183">kitufe cha mviringo</translation> <translation id="8511325616783751178">kitufe kunjuzi</translation> <translation id="8534579021159131403">Dakika</translation> <translation id="8541249477527128034">udhibiti wa vyombo vya habari</translation>
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn index 5e4b8de..7a02d79 100644 --- a/content/browser/BUILD.gn +++ b/content/browser/BUILD.gn
@@ -62,6 +62,7 @@ "//gpu/command_buffer/client:gles2_implementation", "//ipc/mojo", "//media", + "//media/gpu/ipc/client", "//media/midi", "//mojo/common", "//mojo/common:url_type_converters", @@ -77,6 +78,7 @@ "//services/shell/runner/host:lib", "//services/user:lib", "//services/user/public/cpp", + "//services/user/public/interfaces", "//skia", "//skia/public", "//sql", @@ -90,7 +92,7 @@ "//third_party/WebKit/public:blink_headers", "//third_party/WebKit/public:image_resources", "//third_party/WebKit/public:resources", - "//third_party/angle:commit_id", + "//third_party/angle:angle_common", "//third_party/icu", "//third_party/kasko:kasko_features", "//third_party/leveldatabase", @@ -259,6 +261,7 @@ "//content") deps += [ "//ppapi/host", + "//ppapi/proxy", "//ppapi/proxy:ipc", "//ppapi/shared_impl", ] @@ -515,6 +518,10 @@ "vr/android/cardboard/cardboard_vr_device_provider.h", ] } + + if (use_ozone) { + deps += [ "//ui/ozone" ] + } } # See comment at the top of //content/BUILD.gn for how this works.
diff --git a/content/browser/DEPS b/content/browser/DEPS index a02df3f1..a1aa7ec3 100644 --- a/content/browser/DEPS +++ b/content/browser/DEPS
@@ -69,7 +69,7 @@ "+third_party/WebKit/public/platform/modules/geolocation/geolocation.mojom.h", "+third_party/WebKit/public/platform/modules/indexeddb/WebIDBDatabaseException.h", "+third_party/WebKit/public/platform/modules/indexeddb/WebIDBTypes.h", - "+third_party/WebKit/public/platform/modules/notifications/WebNotificationPermission.h", + "+third_party/WebKit/public/platform/modules/notifications/WebNotificationConstants.h", "+third_party/WebKit/public/platform/modules/permissions/permission.mojom.h", "+third_party/WebKit/public/platform/modules/permissions/permission_status.mojom.h", "+third_party/WebKit/public/platform/modules/push_messaging/WebPushPermissionStatus.h",
diff --git a/content/browser/android/content_view_core_impl.cc b/content/browser/android/content_view_core_impl.cc index 5401267..1a6b5e2 100644 --- a/content/browser/android/content_view_core_impl.cc +++ b/content/browser/android/content_view_core_impl.cc
@@ -20,6 +20,7 @@ #include "cc/layers/solid_color_layer.h" #include "cc/output/begin_frame_args.h" #include "cc/output/viewport_selection_bound.h" +#include "content/browser/accessibility/browser_accessibility_manager_android.h" #include "content/browser/accessibility/browser_accessibility_state_impl.h" #include "content/browser/android/gesture_event_type.h" #include "content/browser/android/interstitial_page_delegate_android.h" @@ -1389,10 +1390,22 @@ BrowserAccessibilityStateImpl* accessibility_state = BrowserAccessibilityStateImpl::GetInstance(); if (enabled) { - // This enables accessibility globally unless it was explicitly disallowed - // by a command-line flag. + // First check if we already have a BrowserAccessibilityManager that + // just needs to be connected to the ContentViewCore. + if (web_contents_) { + BrowserAccessibilityManagerAndroid* manager = + static_cast<BrowserAccessibilityManagerAndroid*>( + web_contents_->GetRootBrowserAccessibilityManager()); + if (manager) { + manager->SetContentViewCore(GetJavaObject()); + return; + } + } + + // Otherwise, enable accessibility globally unless it was + // explicitly disallowed by a command-line flag, then enable it for + // this WebContents if that succeeded. accessibility_state->OnScreenReaderDetected(); - // If it was actually enabled globally, enable it for this RenderWidget now. if (accessibility_state->IsAccessibleBrowser() && web_contents_) web_contents_->AddAccessibilityMode(AccessibilityModeComplete); } else {
diff --git a/content/browser/android/in_process/synchronous_input_event_filter.cc b/content/browser/android/in_process/synchronous_input_event_filter.cc index ff378b2..b4d9f7f 100644 --- a/content/browser/android/in_process/synchronous_input_event_filter.cc +++ b/content/browser/android/in_process/synchronous_input_event_filter.cc
@@ -9,7 +9,7 @@ #include "content/browser/android/in_process/synchronous_compositor_registry_in_proc.h" #include "content/public/browser/browser_thread.h" #include "ui/events/blink/synchronous_input_handler_proxy.h" -#include "ui/latency_info/latency_info.h" +#include "ui/events/latency_info.h" using blink::WebInputEvent;
diff --git a/content/browser/appcache/appcache_internals_ui.cc b/content/browser/appcache/appcache_internals_ui.cc index 1a36ddbc..10f316e 100644 --- a/content/browser/appcache/appcache_internals_ui.cc +++ b/content/browser/appcache/appcache_internals_ui.cc
@@ -270,7 +270,6 @@ preparing_response_ = true; appcache_service_->storage()->LoadResponseInfo( GURL(response_enquiries_.front().manifest_url), - response_enquiries_.front().group_id, response_enquiries_.front().response_id, this); } @@ -292,8 +291,7 @@ base::CheckedNumeric<size_t>(amount_to_read).ValueOrDie())); std::unique_ptr<AppCacheResponseReader> reader( appcache_service_->storage()->CreateResponseReader( - GURL(response_enquiry.manifest_url), response_enquiry.group_id, - response_enquiry.response_id)); + GURL(response_enquiry.manifest_url), response_enquiry.response_id)); reader->ReadData( response_data.get(), amount_to_read,
diff --git a/content/browser/appcache/appcache_request_handler.cc b/content/browser/appcache/appcache_request_handler.cc index 1ea6347..7d87361 100644 --- a/content/browser/appcache/appcache_request_handler.cc +++ b/content/browser/appcache/appcache_request_handler.cc
@@ -118,9 +118,9 @@ // 6.9.6, step 4: If this results in a redirect to another origin, // get the resource of the fallback entry. job = CreateJob(request, network_delegate); - DeliverAppCachedResponse( - found_fallback_entry_, found_cache_id_, found_group_id_, - found_manifest_url_, true, found_namespace_entry_url_); + DeliverAppCachedResponse(found_fallback_entry_, found_cache_id_, + found_manifest_url_, true, + found_namespace_entry_url_); } else if (!found_network_namespace_) { // 6.9.6, step 6: Fail the resource load. job = CreateJob(request, network_delegate); @@ -172,9 +172,9 @@ // or there were network errors, get the resource of the fallback entry. std::unique_ptr<AppCacheURLRequestJob> job = CreateJob(request, network_delegate); - DeliverAppCachedResponse( - found_fallback_entry_, found_cache_id_, found_group_id_, - found_manifest_url_, true, found_namespace_entry_url_); + DeliverAppCachedResponse(found_fallback_entry_, found_cache_id_, + found_manifest_url_, true, + found_namespace_entry_url_); return job.release(); } @@ -230,7 +230,6 @@ void AppCacheRequestHandler::DeliverAppCachedResponse( const AppCacheEntry& entry, int64_t cache_id, - int64_t group_id, const GURL& manifest_url, bool is_fallback, const GURL& namespace_entry_url) { @@ -244,8 +243,7 @@ if (IsResourceTypeFrame(resource_type_) && !namespace_entry_url.is_empty()) host_->NotifyMainResourceIsNamespaceEntry(namespace_entry_url); - job_->DeliverAppCachedResponse(manifest_url, group_id, cache_id, - entry, is_fallback); + job_->DeliverAppCachedResponse(manifest_url, cache_id, entry, is_fallback); } void AppCacheRequestHandler::DeliverErrorResponse() { @@ -385,9 +383,8 @@ if (found_entry_.has_response_id()) { DCHECK(!found_fallback_entry_.has_response_id()); - DeliverAppCachedResponse( - found_entry_, found_cache_id_, found_group_id_, found_manifest_url_, - false, found_namespace_entry_url_); + DeliverAppCachedResponse(found_entry_, found_cache_id_, found_manifest_url_, + false, found_namespace_entry_url_); } else { DeliverNetworkResponse(); } @@ -440,9 +437,8 @@ found_cache_id_ = cache->cache_id(); found_group_id_ = cache->owning_group()->group_id(); found_manifest_url_ = cache->owning_group()->manifest_url(); - DeliverAppCachedResponse( - found_entry_, found_cache_id_, found_group_id_, found_manifest_url_, - false, GURL()); + DeliverAppCachedResponse(found_entry_, found_cache_id_, found_manifest_url_, + false, GURL()); return; }
diff --git a/content/browser/appcache/appcache_request_handler.h b/content/browser/appcache/appcache_request_handler.h index 42d58fc..929e4d2 100644 --- a/content/browser/appcache/appcache_request_handler.h +++ b/content/browser/appcache/appcache_request_handler.h
@@ -85,7 +85,6 @@ // deliver for the request we're handling. void DeliverAppCachedResponse(const AppCacheEntry& entry, int64_t cache_id, - int64_t group_id, const GURL& manifest_url, bool is_fallback, const GURL& namespace_entry_url);
diff --git a/content/browser/appcache/appcache_response.cc b/content/browser/appcache/appcache_response.cc index d4b0b96..5ee9890 100644 --- a/content/browser/appcache/appcache_response.cc +++ b/content/browser/appcache/appcache_response.cc
@@ -94,10 +94,8 @@ AppCacheResponseIO::AppCacheResponseIO( int64_t response_id, - int64_t group_id, const base::WeakPtr<AppCacheDiskCacheInterface>& disk_cache) : response_id_(response_id), - group_id_(group_id), disk_cache_(disk_cache), entry_(NULL), buffer_len_(0), @@ -189,9 +187,8 @@ AppCacheResponseReader::AppCacheResponseReader( int64_t response_id, - int64_t group_id, const base::WeakPtr<AppCacheDiskCacheInterface>& disk_cache) - : AppCacheResponseIO(response_id, group_id, disk_cache), + : AppCacheResponseIO(response_id, disk_cache), range_offset_(0), range_length_(std::numeric_limits<int32_t>::max()), read_position_(0), @@ -314,9 +311,8 @@ AppCacheResponseWriter::AppCacheResponseWriter( int64_t response_id, - int64_t group_id, const base::WeakPtr<AppCacheDiskCacheInterface>& disk_cache) - : AppCacheResponseIO(response_id, group_id, disk_cache), + : AppCacheResponseIO(response_id, disk_cache), info_size_(0), write_position_(0), write_amount_(0), @@ -459,9 +455,8 @@ AppCacheResponseMetadataWriter::AppCacheResponseMetadataWriter( int64_t response_id, - int64_t group_id, const base::WeakPtr<AppCacheDiskCacheInterface>& disk_cache) - : AppCacheResponseIO(response_id, group_id, disk_cache), + : AppCacheResponseIO(response_id, disk_cache), write_amount_(0), weak_factory_(this) {}
diff --git a/content/browser/appcache/appcache_response.h b/content/browser/appcache/appcache_response.h index ffb6441..47f3352 100644 --- a/content/browser/appcache/appcache_response.h +++ b/content/browser/appcache/appcache_response.h
@@ -122,7 +122,6 @@ protected: AppCacheResponseIO( int64_t response_id, - int64_t group_id, const base::WeakPtr<AppCacheDiskCacheInterface>& disk_cache); virtual void OnIOComplete(int result) = 0; @@ -136,7 +135,6 @@ void OpenEntryIfNeeded(); const int64_t response_id_; - const int64_t group_id_; base::WeakPtr<AppCacheDiskCacheInterface> disk_cache_; AppCacheDiskCacheInterface::Entry* entry_; scoped_refptr<HttpResponseInfoIOBuffer> info_buffer_; @@ -199,7 +197,6 @@ // Should only be constructed by the storage class and derivatives. AppCacheResponseReader( int64_t response_id, - int64_t group_id, const base::WeakPtr<AppCacheDiskCacheInterface>& disk_cache); void OnIOComplete(int result) override; @@ -257,7 +254,6 @@ // Should only be constructed by the storage class and derivatives. AppCacheResponseWriter( int64_t response_id, - int64_t group_id, const base::WeakPtr<AppCacheDiskCacheInterface>& disk_cache); private: @@ -317,7 +313,6 @@ // Should only be constructed by the storage class and derivatives. AppCacheResponseMetadataWriter( int64_t response_id, - int64_t group_id, const base::WeakPtr<AppCacheDiskCacheInterface>& disk_cache); private:
diff --git a/content/browser/appcache/appcache_response_unittest.cc b/content/browser/appcache/appcache_response_unittest.cc index c6588cd..6ad9932 100644 --- a/content/browser/appcache/appcache_response_unittest.cc +++ b/content/browser/appcache/appcache_response_unittest.cc
@@ -318,8 +318,8 @@ // 1. Attempt to ReadInfo // 2. Attempt to ReadData - reader_.reset(service_->storage()->CreateResponseReader( - GURL(), 0, kNoSuchResponseId)); + reader_.reset( + service_->storage()->CreateResponseReader(GURL(), kNoSuchResponseId)); // Push tasks in reverse order PushNextTask(base::Bind(&AppCacheResponseTest::ReadNonExistentData, @@ -354,7 +354,7 @@ void LoadResponseInfo_Miss() { PushNextTask(base::Bind(&AppCacheResponseTest::LoadResponseInfo_Miss_Verify, base::Unretained(this))); - service_->storage()->LoadResponseInfo(GURL(), 0, kNoSuchResponseId, + service_->storage()->LoadResponseInfo(GURL(), kNoSuchResponseId, storage_delegate_.get()); } @@ -373,7 +373,7 @@ // 2. Use LoadResponseInfo to read the response headers back out PushNextTask(base::Bind(&AppCacheResponseTest::LoadResponseInfo_Hit_Step2, base::Unretained(this))); - writer_.reset(service_->storage()->CreateResponseWriter(GURL(), 0)); + writer_.reset(service_->storage()->CreateResponseWriter(GURL())); written_response_id_ = writer_->response_id(); WriteBasicResponse(); } @@ -382,7 +382,7 @@ writer_.reset(); PushNextTask(base::Bind(&AppCacheResponseTest::LoadResponseInfo_Hit_Verify, base::Unretained(this))); - service_->storage()->LoadResponseInfo(GURL(), 0, written_response_id_, + service_->storage()->LoadResponseInfo(GURL(), written_response_id_, storage_delegate_.get()); } @@ -431,7 +431,7 @@ base::Unretained(this), "Metadata First")); PushNextTask(base::Bind(&AppCacheResponseTest::Metadata_ResetWriter, base::Unretained(this))); - writer_.reset(service_->storage()->CreateResponseWriter(GURL(), 0)); + writer_.reset(service_->storage()->CreateResponseWriter(GURL())); written_response_id_ = writer_->response_id(); WriteBasicResponse(); } @@ -443,7 +443,7 @@ void Metadata_WriteMetadata(const char* metadata) { metadata_writer_.reset(service_->storage()->CreateResponseMetadataWriter( - 0, written_response_id_)); + written_response_id_)); scoped_refptr<IOBuffer> buffer(new WrappedIOBuffer(metadata)); WriteResponseMetadata(buffer.get(), strlen(metadata)); } @@ -451,7 +451,7 @@ void Metadata_LoadResponseInfo() { metadata_writer_.reset(); storage_delegate_.reset(new MockStorageDelegate(this)); - service_->storage()->LoadResponseInfo(GURL(), 0, written_response_id_, + service_->storage()->LoadResponseInfo(GURL(), written_response_id_, storage_delegate_.get()); } @@ -497,7 +497,7 @@ PushNextTask(base::Bind(&AppCacheResponseTest::WriteResponseHead, base::Unretained(this), head)); - writer_.reset(service_->storage()->CreateResponseWriter(GURL(), 0)); + writer_.reset(service_->storage()->CreateResponseWriter(GURL())); written_response_id_ = writer_->response_id(); ScheduleNextTask(); } @@ -543,7 +543,7 @@ } void WriteOutBlocks() { - writer_.reset(service_->storage()->CreateResponseWriter(GURL(), 0)); + writer_.reset(service_->storage()->CreateResponseWriter(GURL())); written_response_id_ = writer_->response_id(); for (int i = 0; i < kNumBlocks; ++i) { PushNextTask(base::Bind(&AppCacheResponseTest::WriteOneBlock, @@ -562,7 +562,7 @@ void ReadInBlocks() { writer_.reset(); reader_.reset(service_->storage()->CreateResponseReader( - GURL(), 0, written_response_id_)); + GURL(), written_response_id_)); for (int i = 0; i < kNumBlocks; ++i) { PushNextTask(base::Bind(&AppCacheResponseTest::ReadOneBlock, base::Unretained(this), kNumBlocks - i)); @@ -585,7 +585,7 @@ PushNextTask(base::Bind(&AppCacheResponseTest::VerifyAllAtOnce, base::Unretained(this))); reader_.reset(service_->storage()->CreateResponseReader( - GURL(), 0, written_response_id_)); + GURL(), written_response_id_)); int big_size = kNumBlocks * kBlockSize; ReadResponseBody(new IOBuffer(big_size), big_size); } @@ -611,7 +611,7 @@ PushNextTask(base::Bind(&AppCacheResponseTest::VerifyRange, base::Unretained(this))); reader_.reset(service_->storage()->CreateResponseReader( - GURL(), 0, written_response_id_)); + GURL(), written_response_id_)); reader_->SetReadRange(kBlockSize, kBlockSize); ReadResponseBody(new IOBuffer(kBlockSize), kBlockSize); } @@ -625,7 +625,7 @@ PushNextTask(base::Bind(&AppCacheResponseTest::VerifyRangeBeyondEOF, base::Unretained(this))); reader_.reset(service_->storage()->CreateResponseReader( - GURL(), 0, written_response_id_)); + GURL(), written_response_id_)); reader_->SetReadRange(kBlockSize, kNumBlocks * kBlockSize); ReadResponseBody(new IOBuffer(kNumBlocks * kBlockSize), kNumBlocks * kBlockSize); @@ -639,7 +639,7 @@ void ReadRangeFullyBeyondEOF() { reader_.reset(service_->storage()->CreateResponseReader( - GURL(), 0, written_response_id_)); + GURL(), written_response_id_)); reader_->SetReadRange((kNumBlocks * kBlockSize) + 1, kBlockSize); ReadResponseBody(new IOBuffer(kBlockSize), kBlockSize); expected_read_result_ = 0; @@ -664,7 +664,7 @@ } void WriteOutBlocksImmediately() { - writer_.reset(service_->storage()->CreateResponseWriter(GURL(), 0)); + writer_.reset(service_->storage()->CreateResponseWriter(GURL())); written_response_id_ = writer_->response_id(); for (int i = 0; i < kNumBlocks; ++i) { PushNextTaskAsImmediate( @@ -677,7 +677,7 @@ void ReadInBlocksImmediately() { writer_.reset(); reader_.reset(service_->storage()->CreateResponseReader( - GURL(), 0, written_response_id_)); + GURL(), written_response_id_)); for (int i = 0; i < kNumBlocks; ++i) { PushNextTaskAsImmediate( base::Bind(&AppCacheResponseTest::ReadOneBlockImmediately, @@ -737,7 +737,7 @@ void ReadThenDelete() { read_callback_was_called_ = false; reader_.reset(service_->storage()->CreateResponseReader( - GURL(), 0, written_response_id_)); + GURL(), written_response_id_)); ReadResponseBody(new IOBuffer(kBlockSize), kBlockSize); EXPECT_TRUE(reader_->IsReadPending()); reader_.reset();
diff --git a/content/browser/appcache/appcache_service_impl.cc b/content/browser/appcache/appcache_service_impl.cc index eb05b702..8e2dbaee 100644 --- a/content/browser/appcache/appcache_service_impl.cc +++ b/content/browser/appcache/appcache_service_impl.cc
@@ -331,8 +331,8 @@ // Verify that we can read the response info and data. expected_total_size_ = entry->response_size(); - response_reader_.reset(service_->storage()->CreateResponseReader( - manifest_url_, group->group_id(), response_id_)); + response_reader_.reset( + service_->storage()->CreateResponseReader(manifest_url_, response_id_)); info_buffer_ = new HttpResponseInfoIOBuffer(); response_reader_->ReadInfo( info_buffer_.get(),
diff --git a/content/browser/appcache/appcache_service_unittest.cc b/content/browser/appcache/appcache_service_unittest.cc index 6a0fed2..068fbe7e 100644 --- a/content/browser/appcache/appcache_service_unittest.cc +++ b/content/browser/appcache/appcache_service_unittest.cc
@@ -43,7 +43,6 @@ const char* data, int data_size) : AppCacheResponseReader(response_id, - 0, base::WeakPtr<AppCacheDiskCacheInterface>()), info_(info), info_size_(info_size),
diff --git a/content/browser/appcache/appcache_storage.cc b/content/browser/appcache/appcache_storage.cc index 7b94bf4..b710ea2 100644 --- a/content/browser/appcache/appcache_storage.cc +++ b/content/browser/appcache/appcache_storage.cc
@@ -41,12 +41,10 @@ AppCacheStorage::ResponseInfoLoadTask::ResponseInfoLoadTask( const GURL& manifest_url, - int64_t group_id, int64_t response_id, AppCacheStorage* storage) : storage_(storage), manifest_url_(manifest_url), - group_id_(group_id), response_id_(response_id), info_buffer_(new HttpResponseInfoIOBuffer) { storage_->pending_info_loads_.insert( @@ -59,8 +57,7 @@ void AppCacheStorage::ResponseInfoLoadTask::StartIfNeeded() { if (reader_) return; - reader_.reset( - storage_->CreateResponseReader(manifest_url_, group_id_, response_id_)); + reader_.reset(storage_->CreateResponseReader(manifest_url_, response_id_)); reader_->ReadInfo(info_buffer_.get(), base::Bind(&ResponseInfoLoadTask::OnReadComplete, base::Unretained(this))); @@ -80,7 +77,6 @@ } void AppCacheStorage::LoadResponseInfo(const GURL& manifest_url, - int64_t group_id, int64_t id, Delegate* delegate) { AppCacheResponseInfo* info = working_set_.GetResponseInfo(id); @@ -89,9 +85,8 @@ return; } ResponseInfoLoadTask* info_load = - GetOrCreateResponseInfoLoadTask(manifest_url, group_id, id); + GetOrCreateResponseInfoLoadTask(manifest_url, id); DCHECK(manifest_url == info_load->manifest_url()); - DCHECK(group_id == info_load->group_id()); DCHECK(id == info_load->response_id()); info_load->AddDelegate(GetOrCreateDelegateReference(delegate)); info_load->StartIfNeeded();
diff --git a/content/browser/appcache/appcache_storage.h b/content/browser/appcache/appcache_storage.h index 42638b8f..d4e5dfe 100644 --- a/content/browser/appcache/appcache_storage.h +++ b/content/browser/appcache/appcache_storage.h
@@ -114,7 +114,6 @@ // immediately without returning to the message loop. If the load fails, // the delegate will be called back with a NULL pointer. virtual void LoadResponseInfo(const GURL& manifest_url, - int64_t group_id, int64_t response_id, Delegate* delegate); @@ -173,17 +172,15 @@ // Creates a reader to read a response from storage. virtual AppCacheResponseReader* CreateResponseReader(const GURL& manifest_url, - int64_t group_id, int64_t response_id) = 0; // Creates a writer to write a new response to storage. This call // establishes a new response id. - virtual AppCacheResponseWriter* CreateResponseWriter(const GURL& manifest_url, - int64_t group_id) = 0; + virtual AppCacheResponseWriter* CreateResponseWriter( + const GURL& manifest_url) = 0; // Creates a metadata writer to write metadata of response to storage. virtual AppCacheResponseMetadataWriter* CreateResponseMetadataWriter( - int64_t group_id, int64_t response_id) = 0; // Schedules the lazy deletion of responses and saves the ids @@ -254,14 +251,12 @@ class ResponseInfoLoadTask { public: ResponseInfoLoadTask(const GURL& manifest_url, - int64_t group_id, int64_t response_id, AppCacheStorage* storage); ~ResponseInfoLoadTask(); int64_t response_id() const { return response_id_; } const GURL& manifest_url() const { return manifest_url_; } - int64_t group_id() const { return group_id_; } void AddDelegate(DelegateReference* delegate_reference) { delegates_.push_back(delegate_reference); @@ -274,7 +269,6 @@ AppCacheStorage* storage_; GURL manifest_url_; - int64_t group_id_; int64_t response_id_; std::unique_ptr<AppCacheResponseReader> reader_; DelegateReferenceVector delegates_; @@ -300,13 +294,12 @@ ResponseInfoLoadTask* GetOrCreateResponseInfoLoadTask( const GURL& manifest_url, - int64_t group_id, int64_t response_id) { PendingResponseInfoLoads::iterator iter = pending_info_loads_.find(response_id); if (iter != pending_info_loads_.end()) return iter->second; - return new ResponseInfoLoadTask(manifest_url, group_id, response_id, this); + return new ResponseInfoLoadTask(manifest_url, response_id, this); } // Should only be called when creating a new response writer.
diff --git a/content/browser/appcache/appcache_storage_impl.cc b/content/browser/appcache/appcache_storage_impl.cc index a83180b..f6eeab7 100644 --- a/content/browser/appcache/appcache_storage_impl.cc +++ b/content/browser/appcache/appcache_storage_impl.cc
@@ -1734,23 +1734,19 @@ AppCacheResponseReader* AppCacheStorageImpl::CreateResponseReader( const GURL& manifest_url, - int64_t group_id, int64_t response_id) { - return new AppCacheResponseReader(response_id, group_id, - disk_cache()->GetWeakPtr()); + return new AppCacheResponseReader(response_id, disk_cache()->GetWeakPtr()); } AppCacheResponseWriter* AppCacheStorageImpl::CreateResponseWriter( - const GURL& manifest_url, - int64_t group_id) { - return new AppCacheResponseWriter(NewResponseId(), group_id, + const GURL& manifest_url) { + return new AppCacheResponseWriter(NewResponseId(), disk_cache()->GetWeakPtr()); } AppCacheResponseMetadataWriter* -AppCacheStorageImpl::CreateResponseMetadataWriter(int64_t group_id, - int64_t response_id) { - return new AppCacheResponseMetadataWriter(response_id, group_id, +AppCacheStorageImpl::CreateResponseMetadataWriter(int64_t response_id) { + return new AppCacheResponseMetadataWriter(response_id, disk_cache()->GetWeakPtr()); }
diff --git a/content/browser/appcache/appcache_storage_impl.h b/content/browser/appcache/appcache_storage_impl.h index 1135409..1e0963f 100644 --- a/content/browser/appcache/appcache_storage_impl.h +++ b/content/browser/appcache/appcache_storage_impl.h
@@ -64,12 +64,10 @@ int response_code) override; void StoreEvictionTimes(AppCacheGroup* group) override; AppCacheResponseReader* CreateResponseReader(const GURL& manifest_url, - int64_t group_id, int64_t response_id) override; - AppCacheResponseWriter* CreateResponseWriter(const GURL& manifest_url, - int64_t group_id) override; + AppCacheResponseWriter* CreateResponseWriter( + const GURL& manifest_url) override; AppCacheResponseMetadataWriter* CreateResponseMetadataWriter( - int64_t group_id, int64_t response_id) override; void DoomResponses(const GURL& manifest_url, const std::vector<int64_t>& response_ids) override;
diff --git a/content/browser/appcache/appcache_update_job.cc b/content/browser/appcache/appcache_update_job.cc index bc654a88..de3e527 100644 --- a/content/browser/appcache/appcache_update_job.cc +++ b/content/browser/appcache/appcache_update_job.cc
@@ -498,8 +498,7 @@ AppCacheResponseWriter* AppCacheUpdateJob::CreateResponseWriter() { AppCacheResponseWriter* writer = - storage_->CreateResponseWriter(manifest_url_, - group_->group_id()); + storage_->CreateResponseWriter(manifest_url_); stored_response_ids_.push_back(writer->response_id()); return writer; } @@ -564,8 +563,7 @@ group_->newest_complete_cache()->GetEntry(manifest_url_) : NULL; if (entry && !doing_full_update_check_) { // Asynchronously load response info for manifest from newest cache. - storage_->LoadResponseInfo(manifest_url_, group_->group_id(), - entry->response_id(), this); + storage_->LoadResponseInfo(manifest_url_, entry->response_id(), this); return; } manifest_fetcher_->Start(); @@ -1160,7 +1158,6 @@ // Load manifest data from storage to compare against fetched manifest. manifest_response_reader_.reset( storage_->CreateResponseReader(manifest_url_, - group_->group_id(), entry->response_id())); read_manifest_buffer_ = new net::IOBuffer(kBufferSize); manifest_response_reader_->ReadData( @@ -1443,9 +1440,7 @@ // Load HTTP headers for entry from newest cache. loading_responses_.insert( LoadingResponses::value_type(copy_me->response_id(), url)); - storage_->LoadResponseInfo(manifest_url_, group_->group_id(), - copy_me->response_id(), - this); + storage_->LoadResponseInfo(manifest_url_, copy_me->response_id(), this); // Async: wait for OnResponseInfoLoaded to complete. return true; }
diff --git a/content/browser/appcache/appcache_update_job_unittest.cc b/content/browser/appcache/appcache_update_job_unittest.cc index 18ba66f..1040d2ec 100644 --- a/content/browser/appcache/appcache_update_job_unittest.cc +++ b/content/browser/appcache/appcache_update_job_unittest.cc
@@ -1009,8 +1009,7 @@ // Create response writer to get a response id. response_writer_.reset( - service_->storage()->CreateResponseWriter(group_->manifest_url(), - group_->group_id())); + service_->storage()->CreateResponseWriter(group_->manifest_url())); AppCache* cache = MakeCacheForGroup(1, response_writer_->response_id()); MockFrontend* frontend1 = MakeMockFrontend(); @@ -1161,8 +1160,7 @@ // Create a response writer to get a response id. response_writer_.reset( - service_->storage()->CreateResponseWriter(group_->manifest_url(), - group_->group_id())); + service_->storage()->CreateResponseWriter(group_->manifest_url())); AppCache* cache = MakeCacheForGroup(service_->storage()->NewCacheId(), response_writer_->response_id()); @@ -1230,8 +1228,7 @@ // Give the newest cache an entry that is in storage. response_writer_.reset( - service_->storage()->CreateResponseWriter(group_->manifest_url(), - group_->group_id())); + service_->storage()->CreateResponseWriter(group_->manifest_url())); cache->AddEntry(MockHttpServer::GetMockUrl("files/explicit1"), AppCacheEntry(AppCacheEntry::EXPLICIT, response_writer_->response_id())); @@ -1292,8 +1289,7 @@ // Give the newest cache an entry that is in storage. response_writer_.reset( - service_->storage()->CreateResponseWriter(group_->manifest_url(), - group_->group_id())); + service_->storage()->CreateResponseWriter(group_->manifest_url())); cache->AddEntry(MockHttpServer::GetMockUrl("files/explicit1"), AppCacheEntry(AppCacheEntry::EXPLICIT, response_writer_->response_id())); @@ -1352,8 +1348,7 @@ // Give the newest cache an entry that is in storage. response_writer_.reset( - service_->storage()->CreateResponseWriter(group_->manifest_url(), - group_->group_id())); + service_->storage()->CreateResponseWriter(group_->manifest_url())); cache->AddEntry(MockHttpServer::GetMockUrl("files/explicit1"), AppCacheEntry(AppCacheEntry::EXPLICIT, response_writer_->response_id())); @@ -2782,8 +2777,7 @@ // Give the newest cache a manifest enry that is in storage. response_writer_.reset( - service_->storage()->CreateResponseWriter(group_->manifest_url(), - group_->group_id())); + service_->storage()->CreateResponseWriter(group_->manifest_url())); AppCache* cache = MakeCacheForGroup(service_->storage()->NewCacheId(), response_writer_->response_id()); @@ -2846,8 +2840,7 @@ // Give the newest cache a manifest enry that is in storage. response_writer_.reset( - service_->storage()->CreateResponseWriter(group_->manifest_url(), - group_->group_id())); + service_->storage()->CreateResponseWriter(group_->manifest_url())); AppCache* cache = MakeCacheForGroup(service_->storage()->NewCacheId(), response_writer_->response_id());
diff --git a/content/browser/appcache/appcache_url_request_job.cc b/content/browser/appcache/appcache_url_request_job.cc index 35728e66..7f958c6b 100644 --- a/content/browser/appcache/appcache_url_request_job.cc +++ b/content/browser/appcache/appcache_url_request_job.cc
@@ -41,9 +41,11 @@ : net::URLRequestJob(request, network_delegate), host_(host), storage_(storage), - has_been_started_(false), has_been_killed_(false), + has_been_started_(false), + has_been_killed_(false), delivery_type_(AWAITING_DELIVERY_ORDERS), - group_id_(0), cache_id_(kAppCacheNoCacheId), is_fallback_(false), + cache_id_(kAppCacheNoCacheId), + is_fallback_(false), is_main_resource_(is_main_resource), cache_entry_not_found_(false), on_prepare_to_restart_callback_(restart_callback), @@ -57,7 +59,6 @@ } void AppCacheURLRequestJob::DeliverAppCachedResponse(const GURL& manifest_url, - int64_t group_id, int64_t cache_id, const AppCacheEntry& entry, bool is_fallback) { @@ -65,7 +66,6 @@ DCHECK(entry.has_response_id()); delivery_type_ = APPCACHED_DELIVERY; manifest_url_ = manifest_url; - group_id_ = group_id; cache_id_ = cache_id; entry_ = entry; is_fallback_ = is_fallback; @@ -137,8 +137,7 @@ is_fallback_ ? net::NetLog::TYPE_APPCACHE_DELIVERING_FALLBACK_RESPONSE : net::NetLog::TYPE_APPCACHE_DELIVERING_CACHED_RESPONSE); - storage_->LoadResponseInfo( - manifest_url_, group_id_, entry_.response_id(), this); + storage_->LoadResponseInfo(manifest_url_, entry_.response_id(), this); break; default: @@ -201,8 +200,8 @@ const int64_t kLimit = 500 * 1000; handler_source_buffer_ = new net::GrowableIOBuffer(); handler_source_buffer_->SetCapacity(kLimit); - handler_source_reader_.reset(storage_->CreateResponseReader( - manifest_url_, group_id_, entry_.response_id())); + handler_source_reader_.reset( + storage_->CreateResponseReader(manifest_url_, entry_.response_id())); handler_source_reader_->ReadData( handler_source_buffer_.get(), kLimit, @@ -283,8 +282,8 @@ DCHECK(is_delivering_appcache_response()); if (response_info) { info_ = response_info; - reader_.reset(storage_->CreateResponseReader( - manifest_url_, group_id_, entry_.response_id())); + reader_.reset( + storage_->CreateResponseReader(manifest_url_, entry_.response_id())); if (is_range_request()) SetupRangeResponse();
diff --git a/content/browser/appcache/appcache_url_request_job.h b/content/browser/appcache/appcache_url_request_job.h index 23d0f3b..e71e085 100644 --- a/content/browser/appcache/appcache_url_request_job.h +++ b/content/browser/appcache/appcache_url_request_job.h
@@ -52,7 +52,6 @@ // methods should be called, and only once per job. A job will sit idle and // wait indefinitely until one of the deliver methods is called. void DeliverAppCachedResponse(const GURL& manifest_url, - int64_t group_id, int64_t cache_id, const AppCacheEntry& entry, bool is_fallback); @@ -79,7 +78,6 @@ // that this job has been instructed to deliver. These are only // valid to call if is_delivering_appcache_response. const GURL& manifest_url() const { return manifest_url_; } - int64_t group_id() const { return group_id_; } int64_t cache_id() const { return cache_id_; } const AppCacheEntry& entry() const { return entry_; } @@ -173,7 +171,6 @@ bool has_been_killed_; DeliveryType delivery_type_; GURL manifest_url_; - int64_t group_id_; int64_t cache_id_; AppCacheEntry entry_; bool is_fallback_;
diff --git a/content/browser/appcache/appcache_url_request_job_unittest.cc b/content/browser/appcache/appcache_url_request_job_unittest.cc index 2ac7536..f3aa8c0 100644 --- a/content/browser/appcache/appcache_url_request_job_unittest.cc +++ b/content/browser/appcache/appcache_url_request_job_unittest.cc
@@ -502,16 +502,13 @@ base::Bind(&ExpectNotRestarted))); const GURL kManifestUrl("http://blah/"); const int64_t kCacheId(1); - const int64_t kGroupId(1); const AppCacheEntry kEntry(AppCacheEntry::EXPLICIT, 1); - job->DeliverAppCachedResponse(kManifestUrl, kCacheId, kGroupId, - kEntry, false); + job->DeliverAppCachedResponse(kManifestUrl, kCacheId, kEntry, false); EXPECT_FALSE(job->is_waiting()); EXPECT_TRUE(job->is_delivering_appcache_response()); EXPECT_FALSE(job->has_been_started()); EXPECT_EQ(kManifestUrl, job->manifest_url()); EXPECT_EQ(kCacheId, job->cache_id()); - EXPECT_EQ(kGroupId, job->group_id()); EXPECT_EQ(kEntry.types(), job->entry().types()); EXPECT_EQ(kEntry.response_id(), job->entry().response_id()); @@ -609,7 +606,7 @@ base::Bind(&AppCacheURLRequestJobTest::RequestAppCachedResource, base::Unretained(this), false)); - writer_.reset(service_->storage()->CreateResponseWriter(GURL(), 0)); + writer_.reset(service_->storage()->CreateResponseWriter(GURL())); written_response_id_ = writer_->response_id(); WriteBasicResponse(); // Continues async @@ -629,9 +626,8 @@ if (start_after_delivery_orders) { job->DeliverAppCachedResponse( - GURL(), 0, 111, - AppCacheEntry(AppCacheEntry::EXPLICIT, written_response_id_), - false); + GURL(), 111, + AppCacheEntry(AppCacheEntry::EXPLICIT, written_response_id_), false); EXPECT_TRUE(job->is_delivering_appcache_response()); } @@ -646,7 +642,7 @@ if (!start_after_delivery_orders) { weak_job->DeliverAppCachedResponse( - GURL(), 0, 111, + GURL(), 111, AppCacheEntry(AppCacheEntry::EXPLICIT, written_response_id_), false); ASSERT_TRUE(weak_job); EXPECT_TRUE(weak_job->is_delivering_appcache_response()); @@ -683,7 +679,7 @@ &AppCacheURLRequestJobTest::RequestAppCachedResource, base::Unretained(this), true)); - writer_.reset(service_->storage()->CreateResponseWriter(GURL(), 0)); + writer_.reset(service_->storage()->CreateResponseWriter(GURL())); written_response_id_ = writer_->response_id(); WriteLargeResponse(); // Continues async @@ -726,7 +722,7 @@ base::Unretained(this))); PushNextTask(base::Bind( &AppCacheURLRequestJobTest::MakeRangeRequest, base::Unretained(this))); - writer_.reset(service_->storage()->CreateResponseWriter(GURL(), 0)); + writer_.reset(service_->storage()->CreateResponseWriter(GURL())); written_response_id_ = writer_->response_id(); WriteBasicResponse(); // Continues async @@ -748,9 +744,8 @@ new AppCacheURLRequestJob(request_.get(), NULL, storage, NULL, false, base::Bind(&ExpectNotRestarted))); job->DeliverAppCachedResponse( - GURL(), 0, 111, - AppCacheEntry(AppCacheEntry::EXPLICIT, written_response_id_), - false); + GURL(), 111, + AppCacheEntry(AppCacheEntry::EXPLICIT, written_response_id_), false); EXPECT_TRUE(job->is_delivering_appcache_response()); // Start the request. @@ -794,7 +789,7 @@ &AppCacheURLRequestJobTest::RequestAppCachedResource, base::Unretained(this), true)); - writer_.reset(service_->storage()->CreateResponseWriter(GURL(), 0)); + writer_.reset(service_->storage()->CreateResponseWriter(GURL())); written_response_id_ = writer_->response_id(); WriteLargeResponse(); @@ -823,7 +818,7 @@ &AppCacheURLRequestJobTest::RequestAppCachedResource, base::Unretained(this), true)); - writer_.reset(service_->storage()->CreateResponseWriter(GURL(), 0)); + writer_.reset(service_->storage()->CreateResponseWriter(GURL())); written_response_id_ = writer_->response_id(); WriteLargeResponse();
diff --git a/content/browser/appcache/mock_appcache_storage.cc b/content/browser/appcache/mock_appcache_storage.cc index 5d7cd8d..54eaef89 100644 --- a/content/browser/appcache/mock_appcache_storage.cc +++ b/content/browser/appcache/mock_appcache_storage.cc
@@ -165,25 +165,21 @@ AppCacheResponseReader* MockAppCacheStorage::CreateResponseReader( const GURL& manifest_url, - int64_t group_id, int64_t response_id) { if (simulated_reader_) return simulated_reader_.release(); - return new AppCacheResponseReader(response_id, group_id, - disk_cache()->GetWeakPtr()); + return new AppCacheResponseReader(response_id, disk_cache()->GetWeakPtr()); } AppCacheResponseWriter* MockAppCacheStorage::CreateResponseWriter( - const GURL& manifest_url, - int64_t group_id) { - return new AppCacheResponseWriter(NewResponseId(), group_id, + const GURL& manifest_url) { + return new AppCacheResponseWriter(NewResponseId(), disk_cache()->GetWeakPtr()); } AppCacheResponseMetadataWriter* -MockAppCacheStorage::CreateResponseMetadataWriter(int64_t group_id, - int64_t response_id) { - return new AppCacheResponseMetadataWriter(response_id, group_id, +MockAppCacheStorage::CreateResponseMetadataWriter(int64_t response_id) { + return new AppCacheResponseMetadataWriter(response_id, disk_cache()->GetWeakPtr()); }
diff --git a/content/browser/appcache/mock_appcache_storage.h b/content/browser/appcache/mock_appcache_storage.h index 6a27ad3b..b19404b 100644 --- a/content/browser/appcache/mock_appcache_storage.h +++ b/content/browser/appcache/mock_appcache_storage.h
@@ -72,12 +72,10 @@ int response_code) override; void StoreEvictionTimes(AppCacheGroup* group) override; AppCacheResponseReader* CreateResponseReader(const GURL& manifest_url, - int64_t group_id, int64_t response_id) override; - AppCacheResponseWriter* CreateResponseWriter(const GURL& manifest_url, - int64_t group_id) override; + AppCacheResponseWriter* CreateResponseWriter( + const GURL& manifest_url) override; AppCacheResponseMetadataWriter* CreateResponseMetadataWriter( - int64_t group_id, int64_t response_id) override; void DoomResponses(const GURL& manifest_url, const std::vector<int64_t>& response_ids) override;
diff --git a/content/browser/bluetooth/bluetooth_dispatcher_host.cc b/content/browser/bluetooth/bluetooth_dispatcher_host.cc index 78d8c12..2c9a3eb 100644 --- a/content/browser/bluetooth/bluetooth_dispatcher_host.cc +++ b/content/browser/bluetooth/bluetooth_dispatcher_host.cc
@@ -483,6 +483,12 @@ for (device::BluetoothAdapter::Observer* observer : adapter_observers_) { adapter_->AddObserver(observer); } + } else { + // Notify that the adapter has been removed and observers should clean up + // their state. + for (device::BluetoothAdapter::Observer* observer : adapter_observers_) { + observer->AdapterPresentChanged(nullptr, false); + } } }
diff --git a/content/browser/bluetooth/web_bluetooth_service_impl.cc b/content/browser/bluetooth/web_bluetooth_service_impl.cc index 978aa88..7f6228c0 100644 --- a/content/browser/bluetooth/web_bluetooth_service_impl.cc +++ b/content/browser/bluetooth/web_bluetooth_service_impl.cc
@@ -91,7 +91,15 @@ navigation_handle->GetRenderFrameHost() == render_frame_host_ && !navigation_handle->IsSamePage()) { // After navigation we need to clear the frame's state. - characteristic_id_to_notify_session_.clear(); + ClearState(); + } +} + +void WebBluetoothServiceImpl::AdapterPresentChanged( + device::BluetoothAdapter* adapter, + bool present) { + if (!present) { + ClearState(); } } @@ -376,4 +384,8 @@ return render_frame_host_->GetLastCommittedOrigin(); } +void WebBluetoothServiceImpl::ClearState() { + characteristic_id_to_notify_session_.clear(); +} + } // namespace content
diff --git a/content/browser/bluetooth/web_bluetooth_service_impl.h b/content/browser/bluetooth/web_bluetooth_service_impl.h index c8a8d81..e044254 100644 --- a/content/browser/bluetooth/web_bluetooth_service_impl.h +++ b/content/browser/bluetooth/web_bluetooth_service_impl.h
@@ -60,6 +60,8 @@ void DidFinishNavigation(NavigationHandle* navigation_handle) override; // BluetoothAdapter::Observer: + void AdapterPresentChanged(device::BluetoothAdapter* adapter, + bool present) override; void GattCharacteristicValueChanged( device::BluetoothAdapter* adapter, device::BluetoothGattCharacteristic* characteristic, @@ -123,8 +125,8 @@ void CrashRendererAndClosePipe(bad_message::BadMessageReason reason); url::Origin GetOrigin(); - // All state (maps, sets, etc.) should be cleaned after navigations - // that are not in the same page. + // Clears all state (maps, sets, etc). + void ClearState(); // Map to keep track of the characteristics' notify sessions. std::unordered_map<std::string,
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc index e96d2f92..d04fac6b 100644 --- a/content/browser/browser_main_loop.cc +++ b/content/browser/browser_main_loop.cc
@@ -6,7 +6,9 @@ #include <stddef.h> +#include <string> #include <utility> +#include <vector> #include "base/bind.h" #include "base/command_line.h" @@ -75,7 +77,6 @@ #include "content/public/common/result_codes.h" #include "device/battery/battery_status_service.h" #include "ipc/mojo/scoped_ipc_support.h" -#include "media/audio/audio_manager.h" #include "media/base/media.h" #include "media/base/user_input_monitor.h" #include "media/midi/midi_manager.h" @@ -170,9 +171,9 @@ #if defined(USE_X11) #include "ui/base/x/x11_util_internal.h" -#include "ui/gfx/x/x11_connection.h" -#include "ui/gfx/x/x11_switches.h" -#include "ui/gfx/x/x11_types.h" +#include "ui/gfx/x/x11_connection.h" // nogncheck +#include "ui/gfx/x/x11_switches.h" // nogncheck +#include "ui/gfx/x/x11_types.h" // nogncheck #endif #if defined(USE_NSS_CERTS) || !defined(USE_OPENSSL) @@ -908,20 +909,6 @@ } int BrowserMainLoop::PreMainMessageLoopRun() { - if (IsRunningInMojoShell()) { - if (!MojoShellConnectionImpl::CreateUsingFactory()) { - mojo::edk::SetParentPipeHandleFromCommandLine(); - MojoShellConnectionImpl::Create(); - MojoShellConnectionImpl::Get()->BindToRequestFromCommandLine(); - } -#if defined(MOJO_SHELL_CLIENT) && defined(USE_AURA) - if (MojoShellConnection::Get()) { - views::WindowManagerConnection::Create( - MojoShellConnection::Get()->GetConnector()); - } -#endif - } - if (parts_) { TRACE_EVENT0("startup", "BrowserMainLoop::CreateThreads:PreMainMessageLoopRun"); @@ -1172,6 +1159,21 @@ mojo_ipc_support_.reset(new IPC::ScopedIPCSupport( BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::IO) ->task_runner())); + + if (IsRunningInMojoShell()) { + if (!MojoShellConnectionImpl::CreateUsingFactory()) { + mojo::edk::SetParentPipeHandleFromCommandLine(); + MojoShellConnectionImpl::Create(); + MojoShellConnectionImpl::Get()->BindToRequestFromCommandLine(); + } +#if defined(MOJO_SHELL_CLIENT) && defined(USE_AURA) + if (MojoShellConnection::Get()) { + views::WindowManagerConnection::Create( + MojoShellConnection::Get()->GetConnector()); + } +#endif + } + mojo_shell_context_.reset(new MojoShellContext); #if defined(OS_MACOSX) mojo::edk::SetMachPortProvider(MachBroker::GetInstance()); @@ -1226,8 +1228,7 @@ { TRACE_EVENT0("startup", "BrowserThreadsStarted::Subsystem:AudioMan"); - audio_manager_.reset(media::AudioManager::CreateWithHangTimer( - MediaInternals::GetInstance(), io_thread_->task_runner())); + CreateAudioManager(); } { @@ -1455,4 +1456,34 @@ base::Bind(OnStoppedStartupTracing, startup_trace_file_))); } +void BrowserMainLoop::CreateAudioManager() { + DCHECK(!audio_thread_); + DCHECK(!audio_manager_); + // TODO(alokp): Allow content embedders to override the default + // task runners by defining ContentBrowserClient::GetAudioTaskRunner. + scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner; + scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner; + scoped_refptr<base::SingleThreadTaskRunner> monitor_task_runner; + audio_thread_.reset(new base::Thread("AudioThread")); +#if defined(OS_WIN) + audio_thread_->init_com_with_mta(true); +#endif // defined(OS_WIN) + CHECK(audio_thread_->Start()); +#if defined(OS_MACOSX) + // On Mac audio task runner must belong to the main thread. + // See http://crbug.com/158170. + // Since the audio thread is the UI thread, a hang monitor is not + // necessary or recommended. + audio_task_runner = base::ThreadTaskRunnerHandle::Get(); + worker_task_runner = audio_thread_->task_runner(); +#else + audio_task_runner = audio_thread_->task_runner(); + worker_task_runner = audio_thread_->task_runner(); + monitor_task_runner = io_thread_->task_runner(); +#endif // defined(OS_MACOSX) + audio_manager_ = media::AudioManager::Create( + std::move(audio_task_runner), std::move(worker_task_runner), + std::move(monitor_task_runner), MediaInternals::GetInstance()); +} + } // namespace content
diff --git a/content/browser/browser_main_loop.h b/content/browser/browser_main_loop.h index 7052211..4d344458 100644 --- a/content/browser/browser_main_loop.h +++ b/content/browser/browser_main_loop.h
@@ -14,6 +14,7 @@ #include "build/build_config.h" #include "content/browser/browser_process_sub_thread.h" #include "content/public/browser/browser_main_runner.h" +#include "media/audio/audio_manager.h" #if defined(USE_AURA) namespace aura { @@ -39,7 +40,6 @@ } namespace media { -class AudioManager; #if defined(OS_WIN) class SystemMessageWindowWin; #elif defined(OS_LINUX) && defined(USE_UDEV) @@ -169,6 +169,7 @@ void InitStartupTracingForDuration(const base::CommandLine& command_line); void EndStartupTracing(); + void CreateAudioManager(); bool UsingInProcessGpu() const; // Quick reference for initialization order: @@ -260,7 +261,9 @@ // |user_input_monitor_| has to outlive |audio_manager_|, so declared first. std::unique_ptr<media::UserInputMonitor> user_input_monitor_; - std::unique_ptr<media::AudioManager> audio_manager_; + // AudioThread needs to outlive |audio_manager_|. + std::unique_ptr<base::Thread> audio_thread_; + media::ScopedAudioManagerPtr audio_manager_; std::unique_ptr<media::midi::MidiManager> midi_manager_;
diff --git a/content/browser/compositor/gpu_browser_compositor_output_surface.h b/content/browser/compositor/gpu_browser_compositor_output_surface.h index fe2dd8b..f8c2a7d 100644 --- a/content/browser/compositor/gpu_browser_compositor_output_surface.h +++ b/content/browser/compositor/gpu_browser_compositor_output_surface.h
@@ -5,6 +5,8 @@ #ifndef CONTENT_BROWSER_COMPOSITOR_GPU_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_ #define CONTENT_BROWSER_COMPOSITOR_GPU_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_ +#include <memory> + #include "base/cancelable_callback.h" #include "base/macros.h" #include "build/build_config.h"
diff --git a/content/browser/compositor/gpu_process_transport_factory.cc b/content/browser/compositor/gpu_process_transport_factory.cc index 64a991b..abbef9d 100644 --- a/content/browser/compositor/gpu_process_transport_factory.cc +++ b/content/browser/compositor/gpu_process_transport_factory.cc
@@ -81,7 +81,50 @@ using cc::ContextProvider; using gpu::gles2::GLES2Interface; -static const int kNumRetriesBeforeSoftwareFallback = 4; +namespace { + +const int kNumRetriesBeforeSoftwareFallback = 4; + +std::unique_ptr<content::WebGraphicsContext3DCommandBufferImpl> +CreateContextCommon(scoped_refptr<gpu::GpuChannelHost> gpu_channel_host, + gpu::SurfaceHandle surface_handle) { + DCHECK( + content::GpuDataManagerImpl::GetInstance()->CanUseGpuBrowserCompositor()); + DCHECK(gpu_channel_host); + + // This is called from a few places to create different contexts: + // - The shared main thread context (offscreen). + // - The compositor context, which is used by the browser compositor + // (offscreen) for synchronization mostly, and by the display compositor + // (onscreen) for actual GL drawing. + // - The compositor worker context (offscreen) used for GPU raster. + // So ask for capabilities needed by any of these cases (we can optimize by + // branching on |surface_handle| being null if these needs diverge). + // + // The default framebuffer for an offscreen context is not used, so it does + // not need alpha, stencil, depth, antialiasing. The display compositor does + // not use these things either, so we can request nothing here. + gpu::gles2::ContextCreationAttribHelper attributes; + attributes.alpha_size = -1; + attributes.depth_size = 0; + attributes.stencil_size = 0; + attributes.samples = 0; + attributes.sample_buffers = 0; + attributes.bind_generates_resource = false; + attributes.lose_context_when_out_of_memory = true; + + bool share_resources = true; + bool automatic_flushes = false; + + GURL url("chrome://gpu/GpuProcessTransportFactory::CreateContextCommon"); + return base::WrapUnique(new content::WebGraphicsContext3DCommandBufferImpl( + surface_handle, url, gpu_channel_host.get(), attributes, + gfx::PreferIntegratedGpu, share_resources, automatic_flushes, + content::WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits(), + nullptr)); +} + +} // namespace namespace content { @@ -118,15 +161,6 @@ task_graph_runner_->Shutdown(); } -std::unique_ptr<WebGraphicsContext3DCommandBufferImpl> -GpuProcessTransportFactory::CreateOffscreenCommandBufferContext() { - CauseForGpuLaunch cause = - CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE; - scoped_refptr<gpu::GpuChannelHost> gpu_channel_host( - BrowserGpuChannelHostFactory::instance()->EstablishGpuChannelSync(cause)); - return CreateContextCommon(gpu_channel_host, gpu::kNullSurfaceHandle); -} - std::unique_ptr<cc::SoftwareOutputDevice> GpuProcessTransportFactory::CreateSoftwareOutputDevice( ui::Compositor* compositor) { @@ -268,41 +302,52 @@ scoped_refptr<ContextProviderCommandBuffer> context_provider; if (create_gpu_output_surface) { // Try to reuse existing worker context provider. - bool shared_worker_context_provider_lost = false; if (shared_worker_context_provider_) { - // Note: If context is lost, we delete reference after releasing the lock. - base::AutoLock lock(*shared_worker_context_provider_->GetLock()); - if (shared_worker_context_provider_->ContextGL() - ->GetGraphicsResetStatusKHR() != GL_NO_ERROR) { - shared_worker_context_provider_lost = true; + bool lost; + { + // Note: If context is lost, we delete reference after releasing the + // lock. + base::AutoLock lock(*shared_worker_context_provider_->GetLock()); + lost = shared_worker_context_provider_->ContextGL() + ->GetGraphicsResetStatusKHR() != GL_NO_ERROR; } + if (lost) + shared_worker_context_provider_ = nullptr; } - scoped_refptr<gpu::GpuChannelHost> gpu_channel_host = - BrowserGpuChannelHostFactory::instance()->GetGpuChannel(); - if (gpu_channel_host.get()) { + + scoped_refptr<gpu::GpuChannelHost> gpu_channel_host; + if (GpuDataManagerImpl::GetInstance()->CanUseGpuBrowserCompositor()) { + // We attempted to do EstablishGpuChannel already, so we just use + // GetGpuChannel() instead of EstablishGpuChannelSync(). + gpu_channel_host = + BrowserGpuChannelHostFactory::instance()->GetGpuChannel(); + } + + if (!gpu_channel_host) { + shared_worker_context_provider_ = nullptr; + } else { GpuSurfaceTracker* tracker = GpuSurfaceTracker::Get(); gpu::SurfaceHandle surface_handle = data->surface_id ? tracker->GetSurfaceHandle(data->surface_id) : gpu::kNullSurfaceHandle; + // This context is used for both the browser compositor and the display // compositor. - context_provider = ContextProviderCommandBuffer::Create( - GpuProcessTransportFactory::CreateContextCommon(gpu_channel_host, - surface_handle), + context_provider = new ContextProviderCommandBuffer( + CreateContextCommon(gpu_channel_host, surface_handle), DISPLAY_COMPOSITOR_ONSCREEN_CONTEXT); - if (context_provider && !context_provider->BindToCurrentThread()) + if (!context_provider->BindToCurrentThread()) context_provider = nullptr; - if (!shared_worker_context_provider_ || - shared_worker_context_provider_lost) { - shared_worker_context_provider_ = ContextProviderCommandBuffer::Create( - GpuProcessTransportFactory::CreateContextCommon( - gpu_channel_host, gpu::kNullSurfaceHandle), + + if (!shared_worker_context_provider_) { + shared_worker_context_provider_ = new ContextProviderCommandBuffer( + CreateContextCommon(std::move(gpu_channel_host), + gpu::kNullSurfaceHandle), BROWSER_WORKER_CONTEXT); - if (shared_worker_context_provider_ && - !shared_worker_context_provider_->BindToCurrentThread()) - shared_worker_context_provider_ = nullptr; - if (shared_worker_context_provider_) + if (shared_worker_context_provider_->BindToCurrentThread()) shared_worker_context_provider_->SetupLock(); + else + shared_worker_context_provider_ = nullptr; } } @@ -567,25 +612,28 @@ scoped_refptr<cc::ContextProvider> GpuProcessTransportFactory::SharedMainThreadContextProvider() { - if (shared_main_thread_contexts_.get()) + if (shared_main_thread_contexts_) return shared_main_thread_contexts_; - // In threaded compositing mode, we have to create our own context for the - // main thread since the compositor's context will be bound to the - // compositor thread. When not in threaded mode, we still need a separate - // context so that skia and gl_helper don't step on each other. - shared_main_thread_contexts_ = ContextProviderCommandBuffer::Create( - GpuProcessTransportFactory::CreateOffscreenCommandBufferContext(), - BROWSER_OFFSCREEN_MAINTHREAD_CONTEXT); + if (!GpuDataManagerImpl::GetInstance()->CanUseGpuBrowserCompositor()) + return nullptr; + CauseForGpuLaunch cause = + CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE; + scoped_refptr<gpu::GpuChannelHost> gpu_channel_host( + BrowserGpuChannelHostFactory::instance()->EstablishGpuChannelSync(cause)); + if (!gpu_channel_host) + return nullptr; - if (shared_main_thread_contexts_.get()) { - shared_main_thread_contexts_->SetLostContextCallback( - base::Bind(&GpuProcessTransportFactory:: - OnLostMainThreadSharedContextInsideCallback, - callback_factory_.GetWeakPtr())); - if (!shared_main_thread_contexts_->BindToCurrentThread()) - shared_main_thread_contexts_ = NULL; - } + // We need a separate context from the compositor's so that skia and gl_helper + // don't step on each other. + shared_main_thread_contexts_ = new ContextProviderCommandBuffer( + CreateContextCommon(std::move(gpu_channel_host), gpu::kNullSurfaceHandle), + BROWSER_OFFSCREEN_MAINTHREAD_CONTEXT); + shared_main_thread_contexts_->SetLostContextCallback(base::Bind( + &GpuProcessTransportFactory::OnLostMainThreadSharedContextInsideCallback, + callback_factory_.GetWeakPtr())); + if (!shared_main_thread_contexts_->BindToCurrentThread()) + shared_main_thread_contexts_ = nullptr; return shared_main_thread_contexts_; } @@ -609,51 +657,6 @@ return data; } -std::unique_ptr<WebGraphicsContext3DCommandBufferImpl> -GpuProcessTransportFactory::CreateContextCommon( - scoped_refptr<gpu::GpuChannelHost> gpu_channel_host, - gpu::SurfaceHandle surface_handle) { - if (!GpuDataManagerImpl::GetInstance()->CanUseGpuBrowserCompositor()) - return nullptr; - if (!gpu_channel_host) { - LOG(ERROR) << "Failed to establish GPU channel."; - return nullptr; - } - - // This is called from a few places to create different contexts: - // - The shared main thread context (offscreen). - // - The compositor context, which is used by the browser compositor - // (offscreen) for synchronization mostly, and by the display compositor - // (onscreen) for actual GL drawing. - // - The compositor worker context (offscreen) used for GPU raster. - // So ask for capabilities needed by any of these cases (we can optimize by - // branching on |surface_handle| being null if these needs diverge). - // - // The default framebuffer for an offscreen context is not used, so it does - // not need alpha, stencil, depth, antialiasing. The display compositor does - // not use these things either, so we can request nothing here. - gpu::gles2::ContextCreationAttribHelper attributes; - attributes.alpha_size = -1; - attributes.depth_size = 0; - attributes.stencil_size = 0; - attributes.samples = 0; - attributes.sample_buffers = 0; - attributes.bind_generates_resource = false; - attributes.lose_context_when_out_of_memory = true; - - bool share_resources = true; - bool automatic_flushes = false; - - GURL url("chrome://gpu/GpuProcessTransportFactory::CreateContextCommon"); - std::unique_ptr<WebGraphicsContext3DCommandBufferImpl> context( - new WebGraphicsContext3DCommandBufferImpl( - surface_handle, url, gpu_channel_host.get(), attributes, - gfx::PreferIntegratedGpu, share_resources, automatic_flushes, - WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits(), - nullptr)); - return context; -} - void GpuProcessTransportFactory::OnLostMainThreadSharedContextInsideCallback() { base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE,
diff --git a/content/browser/compositor/gpu_process_transport_factory.h b/content/browser/compositor/gpu_process_transport_factory.h index 1996a84..a8836e25 100644 --- a/content/browser/compositor/gpu_process_transport_factory.h +++ b/content/browser/compositor/gpu_process_transport_factory.h
@@ -48,9 +48,6 @@ ~GpuProcessTransportFactory() override; - std::unique_ptr<WebGraphicsContext3DCommandBufferImpl> - CreateOffscreenCommandBufferContext(); - // ui::ContextFactory implementation. void CreateOutputSurface(base::WeakPtr<ui::Compositor> compositor) override; std::unique_ptr<ui::Reflector> CreateReflector(ui::Compositor* source, @@ -94,9 +91,6 @@ void EstablishedGpuChannel(base::WeakPtr<ui::Compositor> compositor, bool create_gpu_output_surface, int num_attempts); - std::unique_ptr<WebGraphicsContext3DCommandBufferImpl> CreateContextCommon( - scoped_refptr<gpu::GpuChannelHost> gpu_channel_host, - gpu::SurfaceHandle surface_handle); void OnLostMainThreadSharedContextInsideCallback(); void OnLostMainThreadSharedContext();
diff --git a/content/browser/compositor/gpu_surfaceless_browser_compositor_output_surface.h b/content/browser/compositor/gpu_surfaceless_browser_compositor_output_surface.h index 7b428a3..46b4a73 100644 --- a/content/browser/compositor/gpu_surfaceless_browser_compositor_output_surface.h +++ b/content/browser/compositor/gpu_surfaceless_browser_compositor_output_surface.h
@@ -5,6 +5,8 @@ #ifndef CONTENT_BROWSER_COMPOSITOR_GPU_SURFACELESS_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_ #define CONTENT_BROWSER_COMPOSITOR_GPU_SURFACELESS_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_ +#include <memory> + #include "content/browser/compositor/gpu_browser_compositor_output_surface.h" namespace gpu {
diff --git a/content/browser/compositor/image_transport_factory.h b/content/browser/compositor/image_transport_factory.h index c334c80..8a398bd 100644 --- a/content/browser/compositor/image_transport_factory.h +++ b/content/browser/compositor/image_transport_factory.h
@@ -12,8 +12,8 @@ #include "build/build_config.h" #include "cc/surfaces/surface_id_allocator.h" #include "content/common/content_export.h" +#include "ui/events/latency_info.h" #include "ui/gfx/native_widget_types.h" -#include "ui/latency_info/latency_info.h" namespace cc { class SurfaceManager;
diff --git a/content/browser/compositor/software_browser_compositor_output_surface.cc b/content/browser/compositor/software_browser_compositor_output_surface.cc index ed5e51ca..acb46de 100644 --- a/content/browser/compositor/software_browser_compositor_output_surface.cc +++ b/content/browser/compositor/software_browser_compositor_output_surface.cc
@@ -16,8 +16,8 @@ #include "cc/output/output_surface_client.h" #include "cc/output/software_output_device.h" #include "content/browser/renderer_host/render_widget_host_impl.h" +#include "ui/events/latency_info.h" #include "ui/gfx/vsync_provider.h" -#include "ui/latency_info/latency_info.h" namespace content {
diff --git a/content/browser/download/mhtml_generation_browsertest.cc b/content/browser/download/mhtml_generation_browsertest.cc index 7a3b00fe..4c30fd9 100644 --- a/content/browser/download/mhtml_generation_browsertest.cc +++ b/content/browser/download/mhtml_generation_browsertest.cc
@@ -114,7 +114,7 @@ MHTMLGenerationTest::SetUpOnMainThread(); host_resolver()->AddRule("*", "127.0.0.1"); - ASSERT_TRUE(embedded_test_server()->Start()); + ASSERT_TRUE(embedded_test_server()->Started()); content::SetupCrossSiteRedirector(embedded_test_server()); } @@ -123,10 +123,7 @@ }; // Test for crbug.com/538766. -// Disabled because the test will fail until the bug is fixed -// (but note that the test only fails with --site-per-process flag). -IN_PROC_BROWSER_TEST_F(MHTMLGenerationSitePerProcessTest, - DISABLED_GenerateMHTML) { +IN_PROC_BROWSER_TEST_F(MHTMLGenerationSitePerProcessTest, GenerateMHTML) { base::FilePath path(temp_dir_.path()); path = path.Append(FILE_PATH_LITERAL("test.mht"));
diff --git a/content/browser/gpu/browser_gpu_memory_buffer_manager.h b/content/browser/gpu/browser_gpu_memory_buffer_manager.h index e41b3e5..da6e335 100644 --- a/content/browser/gpu/browser_gpu_memory_buffer_manager.h +++ b/content/browser/gpu/browser_gpu_memory_buffer_manager.h
@@ -8,6 +8,7 @@ #include <stddef.h> #include <stdint.h> +#include <memory> #include <utility> #include "base/callback.h"
diff --git a/content/browser/gpu/gpu_internals_ui.cc b/content/browser/gpu/gpu_internals_ui.cc index e217e31..a45d21f 100644 --- a/content/browser/gpu/gpu_internals_ui.cc +++ b/content/browser/gpu/gpu_internals_ui.cc
@@ -6,6 +6,7 @@ #include <stddef.h> +#include <memory> #include <string> #include <utility> @@ -48,7 +49,7 @@ #if defined(OS_LINUX) && defined(USE_X11) #include "ui/base/x/x11_util.h" -#include "ui/gfx/x/x11_atom_cache.h" +#include "ui/gfx/x/x11_atom_cache.h" // nogncheck #endif namespace content {
diff --git a/content/browser/gpu/gpu_ipc_browsertests.cc b/content/browser/gpu/gpu_ipc_browsertests.cc index 651a77a..730e6a2 100644 --- a/content/browser/gpu/gpu_ipc_browsertests.cc +++ b/content/browser/gpu/gpu_ipc_browsertests.cc
@@ -41,12 +41,10 @@ attributes.bind_generates_resource = false; bool share_resources = false; bool automatic_flushes = false; - return base::WrapUnique( - WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext( - gpu_channel_host, attributes, gfx::PreferIntegratedGpu, - share_resources, automatic_flushes, GURL(), - WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits(), - nullptr)); + return base::WrapUnique(new WebGraphicsContext3DCommandBufferImpl( + gpu::kNullSurfaceHandle, GURL(), gpu_channel_host, attributes, + gfx::PreferIntegratedGpu, share_resources, automatic_flushes, + WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits(), nullptr)); } class ContextTestBase : public content::ContentBrowserTest { @@ -70,7 +68,7 @@ factory->GetGpuChannel()); CHECK(gpu_channel_host); - provider_ = content::ContextProviderCommandBuffer::Create( + provider_ = new content::ContextProviderCommandBuffer( CreateContext(gpu_channel_host.get()), content::OFFSCREEN_CONTEXT_FOR_TESTING); bool bound = provider_->BindToCurrentThread(); @@ -229,8 +227,8 @@ // Step 2: verify that holding onto the provider's GrContext will // retain the host after provider is destroyed. scoped_refptr<ContextProviderCommandBuffer> provider = - ContextProviderCommandBuffer::Create(CreateContext(GetGpuChannel()), - OFFSCREEN_CONTEXT_FOR_TESTING); + new ContextProviderCommandBuffer(CreateContext(GetGpuChannel()), + OFFSCREEN_CONTEXT_FOR_TESTING); EXPECT_TRUE(provider->BindToCurrentThread()); sk_sp<GrContext> gr_context = sk_ref_sp(provider->GrContext()); @@ -277,8 +275,8 @@ scoped_refptr<gpu::GpuChannelHost> host = GetGpuChannel(); scoped_refptr<ContextProviderCommandBuffer> provider = - ContextProviderCommandBuffer::Create(CreateContext(GetGpuChannel()), - OFFSCREEN_CONTEXT_FOR_TESTING); + new ContextProviderCommandBuffer(CreateContext(GetGpuChannel()), + OFFSCREEN_CONTEXT_FOR_TESTING); base::RunLoop run_loop; int counter = 0; provider->SetLostContextCallback(
diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc index 909e82d..f72aaef 100644 --- a/content/browser/gpu/gpu_process_host.cc +++ b/content/browser/gpu/gpu_process_host.cc
@@ -54,8 +54,8 @@ #include "ipc/message_filter.h" #include "media/base/media_switches.h" #include "ui/base/ui_base_switches.h" +#include "ui/events/latency_info.h" #include "ui/gl/gl_switches.h" -#include "ui/latency_info/latency_info.h" #if defined(OS_ANDROID) #include "base/android/build_info.h" @@ -74,7 +74,7 @@ #endif #if defined(USE_X11) && !defined(OS_CHROMEOS) -#include "ui/gfx/x/x11_switches.h" +#include "ui/gfx/x/x11_switches.h" // nogncheck #endif #if defined(OS_MACOSX)
diff --git a/content/browser/loader/resource_scheduler_unittest.cc b/content/browser/loader/resource_scheduler_unittest.cc index 98003ce7..59b6d00 100644 --- a/content/browser/loader/resource_scheduler_unittest.cc +++ b/content/browser/loader/resource_scheduler_unittest.cc
@@ -30,7 +30,7 @@ #include "net/url_request/url_request.h" #include "net/url_request/url_request_test_util.h" #include "testing/gtest/include/gtest/gtest.h" -#include "ui/latency_info/latency_info.h" +#include "ui/events/latency_info.h" using std::string;
diff --git a/content/browser/media/media_canplaytype_browsertest.cc b/content/browser/media/media_canplaytype_browsertest.cc index 7dba85b..ac278fe8 100644 --- a/content/browser/media/media_canplaytype_browsertest.cc +++ b/content/browser/media/media_canplaytype_browsertest.cc
@@ -78,6 +78,14 @@ const char* kHi10pProbably = kPropMaybe; #endif +#if BUILDFLAG(ENABLE_MP4_VP9_DEMUXING) +const char* kMp4Vp9Probably = kPropProbably; +const char* kMP4Vp9Maybe = kMaybe; +#else +const char* kMp4Vp9Probably = kNot; +const char* kMP4Vp9Maybe = kNot; +#endif + namespace content { class MediaCanPlayTypeTest : public MediaBrowserTest { @@ -220,6 +228,12 @@ EXPECT_EQ(kNot, CanPlay("'" + mime + "; codecs=\"vp8\"'")); EXPECT_EQ(kNot, CanPlay("'" + mime + "; codecs=\"vp9\"'")); + EXPECT_EQ(kNot, CanPlay("'" + mime + "; codecs=\"vp8.0\"'")); + EXPECT_EQ(kNot, CanPlay("'" + mime + "; codecs=\"vp9.0\"'")); + EXPECT_EQ(kNot, CanPlay("'" + mime + "; codecs=\"vp08\"'")); + EXPECT_EQ(kNot, CanPlay("'" + mime + "; codecs=\"vp09\"'")); + EXPECT_EQ(kNot, + CanPlay("'" + mime + "; codecs=\"vp08.00.01.08.02.01.01.00\"'")); EXPECT_EQ(kNot, CanPlay("'" + mime + "; codecs=\"vp8, mp4a.40\"'")); EXPECT_EQ(kNot, CanPlay("'" + mime + "; codecs=\"vp9, mp4a.40\"'")); EXPECT_EQ(kNot, CanPlay("'" + mime + "; codecs=\"vp8, mp4a.40.2\"'")); @@ -332,11 +346,17 @@ EXPECT_EQ(kNot, CanPlay("'" + mime + "; codecs=\"vp8.0\"'")); EXPECT_EQ(kNot, CanPlay("'" + mime + "; codecs=\"vp8, opus\"'")); EXPECT_EQ(kNot, CanPlay("'" + mime + "; codecs=\"vp8, vorbis\"'")); + EXPECT_EQ(kNot, CanPlay("'" + mime + "; codecs=\"vp08\"'")); + EXPECT_EQ(kNot, + CanPlay("'" + mime + "; codecs=\"vp08.00.01.08.02.01.01.00\"'")); EXPECT_EQ(kNot, CanPlay("'" + mime + "; codecs=\"vp9\"'")); EXPECT_EQ(kNot, CanPlay("'" + mime + "; codecs=\"vp9.0\"'")); EXPECT_EQ(kNot, CanPlay("'" + mime + "; codecs=\"vp9, opus\"'")); EXPECT_EQ(kNot, CanPlay("'" + mime + "; codecs=\"vp9, vorbis\"'")); + EXPECT_EQ(kNot, CanPlay("'" + mime + "; codecs=\"vp09\"'")); + EXPECT_EQ(kNot, + CanPlay("'" + mime + "; codecs=\"vp09.00.01.08.02.01.01.00\"'")); EXPECT_EQ(kNot, CanPlay("'" + mime + "; codecs=\"avc1\"'")); EXPECT_EQ(kNot, CanPlay("'" + mime + "; codecs=\"avc3\"'")); @@ -392,6 +412,12 @@ EXPECT_EQ(kNot, CanPlay("'" + mime + "; codecs=\"vp9, 1\"'")); EXPECT_EQ(kNot, CanPlay("'" + mime + "; codecs=\"vp8.0, 1\"'")); EXPECT_EQ(kNot, CanPlay("'" + mime + "; codecs=\"vp9.0, 1\"'")); + EXPECT_EQ(kNot, CanPlay("'" + mime + "; codecs=\"vp08\"'")); + EXPECT_EQ(kNot, CanPlay("'" + mime + "; codecs=\"vp09\"'")); + EXPECT_EQ(kNot, + CanPlay("'" + mime + "; codecs=\"vp08.00.01.08.02.01.01.00\"'")); + EXPECT_EQ(kNot, + CanPlay("'" + mime + "; codecs=\"vp09.00.01.08.02.01.01.00\"'")); EXPECT_EQ(kNot, CanPlay("'" + mime + "; codecs=\"theora\"'")); EXPECT_EQ(kNot, CanPlay("'" + mime + "; codecs=\"theora, vorbis\"'")); @@ -451,6 +477,12 @@ EXPECT_EQ(kNot, CanPlay("'" + mime + "; codecs=\"vp9\"'")); EXPECT_EQ(kNot, CanPlay("'" + mime + "; codecs=\"vp8.0, 1\"'")); EXPECT_EQ(kNot, CanPlay("'" + mime + "; codecs=\"vp9.0, 1\"'")); + EXPECT_EQ(kNot, CanPlay("'" + mime + "; codecs=\"vp08\"'")); + EXPECT_EQ(kNot, CanPlay("'" + mime + "; codecs=\"vp09\"'")); + EXPECT_EQ(kNot, + CanPlay("'" + mime + "; codecs=\"vp08.00.01.08.02.01.01.00\"'")); + EXPECT_EQ(kNot, + CanPlay("'" + mime + "; codecs=\"vp09.00.01.08.02.01.01.00\"'")); EXPECT_EQ(kNot, CanPlay("'" + mime + "; codecs=\"vorbis\"'")); EXPECT_EQ(kNot, CanPlay("'" + mime + "; codecs=\"opus\"'")); @@ -741,6 +773,9 @@ EXPECT_EQ(kHevcSupported, CanPlay("'video/mp4; codecs=\"hvc1.1.6.L93.B0, mp4a.40.5\"'")); + EXPECT_EQ(kMp4Vp9Probably, + CanPlay("'video/mp4; codecs=\"vp09.00.01.08.02.01.01.00\"'")); + TestMPEGUnacceptableCombinations("video/mp4"); // This result is incorrect. See https://crbug.com/592889. EXPECT_EQ(kPropProbably, CanPlay("'video/mp4; codecs=\"mp3\"'")); @@ -798,6 +833,9 @@ EXPECT_EQ(kNot, CanPlay("'video/x-m4v; codecs=\"hvc1.1.6.L93.B0, mp4a.40.5\"'")); + EXPECT_EQ(kNot, + CanPlay("'video/x-m4v; codecs=\"vp09.00.01.08.02.01.01.00\"'")); + EXPECT_EQ(kNot, CanPlay("'video/x-m4v; codecs=\"ac-3\"'")); EXPECT_EQ(kNot, CanPlay("'video/x-m4v; codecs=\"mp4a.a5\"'")); EXPECT_EQ(kNot, CanPlay("'video/x-m4v; codecs=\"mp4a.A5\"'")); @@ -840,6 +878,8 @@ EXPECT_EQ(kNot, CanPlay("'audio/mp4; codecs=\"hev1.1.6.L93.B0,mp4a.40.5\"'")); EXPECT_EQ(kNot, CanPlay("'audio/mp4; codecs=\"hvc1.1.6.L93.B0,mp4a.40.5\"'")); + EXPECT_EQ(kNot, CanPlay("'audio/mp4; codecs=\"vp09.00.01.08.02.01.01.00\"'")); + EXPECT_EQ(kAc3Eac3Probably, CanPlay("'audio/mp4; codecs=\"ac-3\"'")); EXPECT_EQ(kAc3Eac3Probably, CanPlay("'audio/mp4; codecs=\"mp4a.a5\"'")); EXPECT_EQ(kAc3Eac3Probably, CanPlay("'audio/mp4; codecs=\"mp4a.A5\"'")); @@ -881,6 +921,9 @@ EXPECT_EQ(kNot, CanPlay("'audio/x-m4a; codecs=\"hvc1.1.6.L93.B0, mp4a.40.5\"'")); + EXPECT_EQ(kNot, + CanPlay("'audio/x-m4a; codecs=\"vp09.00.01.08.02.01.01.00\"'")); + EXPECT_EQ(kNot, CanPlay("'audio/x-m4a; codecs=\"ac-3\"'")); EXPECT_EQ(kNot, CanPlay("'audio/x-m4a; codecs=\"mp4a.a5\"'")); EXPECT_EQ(kNot, CanPlay("'audio/x-m4a; codecs=\"mp4a.A5\"'")); @@ -1178,6 +1221,37 @@ EXPECT_EQ(kPropMaybe, CanPlay("'video/mp4; codecs=\"avc1.42E052\"'")); } +IN_PROC_BROWSER_TEST_F(MediaCanPlayTypeTest, CodecSupportTest_Mp4Vp9Variants) { + // Malformed codecs string. + EXPECT_EQ(kNot, CanPlay("'video/mp4; codecs=\"vp09.00.-1.08\"'")); + + // Codecs strings with missing fields. + EXPECT_EQ(kNot, CanPlay("'video/mp4; codecs=\"vp09\"'")); + EXPECT_EQ(kNot, CanPlay("'video/mp4; codecs=\"vp09.00.01.08\"'")); + EXPECT_EQ(kNot, CanPlay("'video/mp4; codecs=\"vp09.01.01..02.01.01.00\"'")); + EXPECT_EQ(kNot, CanPlay("'video/mp4; codecs=\"vp09.01.01.08.05.01.01\"'")); + EXPECT_EQ(kNot, CanPlay("'video/mp4; codecs=\"vp09.04\"'")); + + // Unexpected bit depth. + EXPECT_EQ(kNot, CanPlay("'video/mp4; codecs=\"vp09.01.01.09.02.01.01.00\"'")); + // Unexpected chroma subsampling. + EXPECT_EQ(kNot, CanPlay("'video/mp4; codecs=\"vp09.01.01.08.04.04.00.00\"'")); + // Unexpected transfer function. + EXPECT_EQ(kNot, CanPlay("'video/mp4; codecs=\"vp09.01.01.08.04.03.02.00\"'")); + + EXPECT_EQ(kMp4Vp9Probably, + CanPlay("'video/mp4; codecs=\"vp09.00.01.08.02.01.01.00\"'")); + EXPECT_EQ(kMp4Vp9Probably, + CanPlay("'video/mp4; codecs=\"vp09.00.01.08.04.03.00.00\"'")); + EXPECT_EQ(kMP4Vp9Maybe, + CanPlay("'video/mp4; codecs=\"vp09.01.01.08.02.01.01.00\"'")); + EXPECT_EQ(kMP4Vp9Maybe, + CanPlay("'video/mp4; codecs=\"vp09.02.01.08.02.01.01.00\"'")); + EXPECT_EQ(kMP4Vp9Maybe, + CanPlay("'video/mp4; codecs=\"vp09.03.01.08.02.01.01.00\"'")); + EXPECT_EQ(kNot, CanPlay("'video/mp4; codecs=\"vp09.04.01.08.02.01.01.00\"'")); +} + // TODO(servolk): Add extensive tests for various HEVC profiles, levels and // tiers, similar to avc1/avc3 tests above, after proper HEVC codec id parsing // is implemented (crbug.com/482761) @@ -1337,6 +1411,10 @@ EXPECT_EQ(kNot, CanPlay("'application/x-mpegurl; codecs=\"hvc1.1.6.L93.B0,mp4a.40.5\"'")); + EXPECT_EQ( + kNot, + CanPlay("'application/x-mpegurl; codecs=\"vp09.01.01.08.04.03.00.00\"'")); + EXPECT_EQ(kNot, CanPlay("'application/x-mpegurl; codecs=\"ac-3\"'")); EXPECT_EQ(kNot, CanPlay("'application/x-mpegurl; codecs=\"ec-3\"'")); EXPECT_EQ(kNot, CanPlay("'application/x-mpegurl; codecs=\"mp4a.A5\"'")); @@ -1448,6 +1526,9 @@ CanPlay("'application/vnd.apple.mpegurl; " "codecs=\"hvc1.1.6.L93.B0,mp4a.40.5\"'")); + EXPECT_EQ(kNot, CanPlay("'application/vnd.apple.mpegurl; " + "codecs=\"vp09.01.01.08.04.03.00.00\"'")); + EXPECT_EQ(kNot, CanPlay("'application/vnd.apple.mpegurl; codecs=\"ac-3\"'")); EXPECT_EQ(kNot, CanPlay("'application/vnd.apple.mpegurl; codecs=\"ec-3\"'")); EXPECT_EQ(kNot,
diff --git a/content/browser/notifications/notification_database_data_unittest.cc b/content/browser/notifications/notification_database_data_unittest.cc index bf93b35..8c8e7dd 100644 --- a/content/browser/notifications/notification_database_data_unittest.cc +++ b/content/browser/notifications/notification_database_data_unittest.cc
@@ -12,10 +12,10 @@ #include "base/time/time.h" #include "content/browser/notifications/notification_database_data.pb.h" #include "content/browser/notifications/notification_database_data_conversions.h" -#include "content/common/notification_constants.h" #include "content/public/browser/notification_database_data.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" +#include "third_party/WebKit/public/platform/modules/notifications/WebNotificationConstants.h" namespace content { @@ -59,7 +59,7 @@ notification_data.silent = true; notification_data.require_interaction = true; notification_data.data = developer_data; - for (size_t i = 0; i < kPlatformNotificationMaxActions; i++) { + for (size_t i = 0; i < blink::kWebNotificationMaxActions; i++) { PlatformNotificationAction notification_action; notification_action.type = kNotificationActionType; notification_action.action = base::SizeTToString(i);
diff --git a/content/browser/notifications/notification_message_filter.cc b/content/browser/notifications/notification_message_filter.cc index b2fd920..876a89c1 100644 --- a/content/browser/notifications/notification_message_filter.cc +++ b/content/browser/notifications/notification_message_filter.cc
@@ -10,7 +10,6 @@ #include "content/browser/bad_message.h" #include "content/browser/notifications/page_notification_delegate.h" #include "content/browser/notifications/platform_notification_context_impl.h" -#include "content/common/notification_constants.h" #include "content/common/platform_notification_messages.h" #include "content/public/browser/browser_context.h" #include "content/public/browser/browser_thread.h" @@ -20,6 +19,7 @@ #include "content/public/browser/platform_notification_service.h" #include "content/public/browser/render_process_host.h" #include "content/public/common/content_client.h" +#include "third_party/WebKit/public/platform/modules/notifications/WebNotificationConstants.h" namespace content { @@ -39,8 +39,8 @@ } // Ensure there aren't more actions than supported. - if (sanitized_data.actions.size() > kPlatformNotificationMaxActions) - sanitized_data.actions.resize(kPlatformNotificationMaxActions); + if (sanitized_data.actions.size() > blink::kWebNotificationMaxActions) + sanitized_data.actions.resize(blink::kWebNotificationMaxActions); return sanitized_data; } @@ -48,18 +48,18 @@ // Returns true when |resources| looks ok, false otherwise. bool ValidateNotificationResources(const NotificationResources& resources) { if (resources.notification_icon.width() > - kPlatformNotificationMaxIconSizePx || + blink::kWebNotificationMaxIconSizePx || resources.notification_icon.height() > - kPlatformNotificationMaxIconSizePx) { + blink::kWebNotificationMaxIconSizePx) { return false; } - if (resources.badge.width() > kPlatformNotificationMaxBadgeSizePx || - resources.badge.height() > kPlatformNotificationMaxBadgeSizePx) { + if (resources.badge.width() > blink::kWebNotificationMaxBadgeSizePx || + resources.badge.height() > blink::kWebNotificationMaxBadgeSizePx) { return false; } for (const auto& action_icon : resources.action_icons) { - if (action_icon.width() > kPlatformNotificationMaxActionIconSizePx || - action_icon.height() > kPlatformNotificationMaxActionIconSizePx) { + if (action_icon.width() > blink::kWebNotificationMaxActionIconSizePx || + action_icon.height() > blink::kWebNotificationMaxActionIconSizePx) { return false; } } @@ -114,17 +114,19 @@ } void NotificationMessageFilter::OverrideThreadForMessage( - const IPC::Message& message, content::BrowserThread::ID* thread) { + const IPC::Message& message, + content::BrowserThread::ID* thread) { if (message.type() == PlatformNotificationHostMsg_Show::ID || message.type() == PlatformNotificationHostMsg_Close::ID) *thread = BrowserThread::UI; } void NotificationMessageFilter::OnCheckNotificationPermission( - const GURL& origin, blink::WebNotificationPermission* permission) { + const GURL& origin, + blink::mojom::PermissionStatus* permission_status) { DCHECK_CURRENTLY_ON(BrowserThread::IO); - *permission = GetPermissionForOriginOnIO(origin); + *permission_status = GetPermissionForOriginOnIO(origin); } void NotificationMessageFilter::OnShowPlatformNotification( @@ -168,7 +170,7 @@ const NotificationResources& notification_resources) { DCHECK_CURRENTLY_ON(BrowserThread::IO); if (GetPermissionForOriginOnIO(origin) != - blink::WebNotificationPermissionAllowed) { + blink::mojom::PermissionStatus::GRANTED) { bad_message::ReceivedBadMessage(this, bad_message::NMF_NO_PERMISSION_SHOW); return; } @@ -227,7 +229,7 @@ const std::string& filter_tag) { DCHECK_CURRENTLY_ON(BrowserThread::IO); if (GetPermissionForOriginOnIO(origin) != - blink::WebNotificationPermissionAllowed) { + blink::mojom::PermissionStatus::GRANTED) { // No permission has been granted for the given origin. It is harmless to // try to get notifications without permission, so return an empty vector // indicating that no (accessible) notifications exist at this time. @@ -281,7 +283,7 @@ int64_t persistent_notification_id) { DCHECK_CURRENTLY_ON(BrowserThread::IO); if (GetPermissionForOriginOnIO(origin) != - blink::WebNotificationPermissionAllowed) { + blink::mojom::PermissionStatus::GRANTED) { bad_message::ReceivedBadMessage(this, bad_message::NMF_NO_PERMISSION_CLOSE); return; } @@ -312,7 +314,7 @@ // has been closed. } -blink::WebNotificationPermission +blink::mojom::PermissionStatus NotificationMessageFilter::GetPermissionForOriginOnIO( const GURL& origin) const { DCHECK_CURRENTLY_ON(BrowserThread::IO); @@ -320,7 +322,7 @@ PlatformNotificationService* service = GetContentClient()->browser()->GetPlatformNotificationService(); if (!service) - return blink::WebNotificationPermissionDenied; + return blink::mojom::PermissionStatus::DENIED; return service->CheckPermissionOnIOThread(resource_context_, origin, process_id_); @@ -331,10 +333,10 @@ const GURL& origin) { DCHECK_CURRENTLY_ON(BrowserThread::UI); - blink::WebNotificationPermission permission = + blink::mojom::PermissionStatus permission_status = service->CheckPermissionOnUIThread(browser_context_, origin, process_id_); - if (permission == blink::WebNotificationPermissionAllowed) + if (permission_status == blink::mojom::PermissionStatus::GRANTED) return true; bad_message::ReceivedBadMessage(this, bad_message::NMF_NO_PERMISSION_VERIFY);
diff --git a/content/browser/notifications/notification_message_filter.h b/content/browser/notifications/notification_message_filter.h index a9d3e23..c8987b7 100644 --- a/content/browser/notifications/notification_message_filter.h +++ b/content/browser/notifications/notification_message_filter.h
@@ -15,7 +15,7 @@ #include "base/memory/weak_ptr.h" #include "content/public/browser/browser_message_filter.h" #include "content/public/browser/notification_database_data.h" -#include "third_party/WebKit/public/platform/modules/notifications/WebNotificationPermission.h" +#include "third_party/WebKit/public/platform/modules/permissions/permission_status.mojom.h" class GURL; @@ -54,7 +54,8 @@ friend class BrowserThread; void OnCheckNotificationPermission( - const GURL& origin, blink::WebNotificationPermission* permission); + const GURL& origin, + blink::mojom::PermissionStatus* permission_status); void OnShowPlatformNotification( int notification_id, const GURL& origin, @@ -103,7 +104,7 @@ // Returns the permission status for |origin|. Must only be used on the IO // thread. If the PlatformNotificationService is unavailable, permission will // assumed to be denied. - blink::WebNotificationPermission GetPermissionForOriginOnIO( + blink::mojom::PermissionStatus GetPermissionForOriginOnIO( const GURL& origin) const; // Verifies that Web Notification permission has been granted for |origin| in
diff --git a/content/browser/ppapi_plugin_process_host.cc b/content/browser/ppapi_plugin_process_host.cc index efd6d33..b37b643 100644 --- a/content/browser/ppapi_plugin_process_host.cc +++ b/content/browser/ppapi_plugin_process_host.cc
@@ -44,7 +44,7 @@ #include "content/common/sandbox_win.h" #include "sandbox/win/src/process_mitigations.h" #include "sandbox/win/src/sandbox_policy.h" -#include "ui/gfx/win/dpi.h" +#include "ui/display/win/dpi.h" #endif namespace content { @@ -435,8 +435,9 @@ } #if defined(OS_WIN) - cmd_line->AppendSwitchASCII(switches::kDeviceScaleFactor, - base::DoubleToString(gfx::GetDPIScale())); + cmd_line->AppendSwitchASCII( + switches::kDeviceScaleFactor, + base::DoubleToString(display::win::GetDPIScale())); #endif if (!plugin_launcher.empty())
diff --git a/content/browser/presentation/presentation_service_impl.cc b/content/browser/presentation/presentation_service_impl.cc index 53d8dcb1..5bec432 100644 --- a/content/browser/presentation/presentation_service_impl.cc +++ b/content/browser/presentation/presentation_service_impl.cc
@@ -155,8 +155,7 @@ DCHECK(web_contents); // This object will be deleted when the RenderFrameHost is about to be - // deleted (RenderFrameDeleted) or if a connection error occurred - // (OnConnectionError). + // deleted (RenderFrameDeleted). PresentationServiceImpl* impl = new PresentationServiceImpl( render_frame_host, web_contents, @@ -169,10 +168,6 @@ mojo::InterfaceRequest<mojom::PresentationService> request) { binding_.reset( new mojo::Binding<mojom::PresentationService>(this, std::move(request))); - binding_->set_connection_error_handler([this]() { - DVLOG(1) << "Connection error"; - delete this; - }); } void PresentationServiceImpl::SetClient(
diff --git a/content/browser/renderer_host/compositor_impl_android.cc b/content/browser/renderer_host/compositor_impl_android.cc index 499a216..a1da9c5 100644 --- a/content/browser/renderer_host/compositor_impl_android.cc +++ b/content/browser/renderer_host/compositor_impl_android.cc
@@ -550,7 +550,7 @@ // DidInitializeOutputSurface() or DidFailToInitializeOutputSurface(). scoped_refptr<gpu::GpuChannelHost> gpu_channel_host(factory->GetGpuChannel()); scoped_refptr<ContextProviderCommandBuffer> context_provider( - ContextProviderCommandBuffer::Create( + new ContextProviderCommandBuffer( CreateGpuProcessViewContext(gpu_channel_host, attributes, surface_id_), DISPLAY_COMPOSITOR_ONSCREEN_CONTEXT));
diff --git a/content/browser/renderer_host/compositor_impl_android.h b/content/browser/renderer_host/compositor_impl_android.h index 95489d9..a578205 100644 --- a/content/browser/renderer_host/compositor_impl_android.h +++ b/content/browser/renderer_host/compositor_impl_android.h
@@ -104,11 +104,6 @@ void DidCommitAndDrawFrame() override {} void DidCompleteSwapBuffers() override; void DidCompletePageScaleAnimation() override {} - void RecordFrameTimingEvents( - std::unique_ptr<cc::FrameTimingTracker::CompositeTimingSet> - composite_events, - std::unique_ptr<cc::FrameTimingTracker::MainFrameTimingSet> - main_frame_events) override {} // LayerTreeHostSingleThreadClient implementation. void DidPostSwapBuffers() override;
diff --git a/content/browser/renderer_host/delegated_frame_host.cc b/content/browser/renderer_host/delegated_frame_host.cc index 60c1000..6ea4299 100644 --- a/content/browser/renderer_host/delegated_frame_host.cc +++ b/content/browser/renderer_host/delegated_frame_host.cc
@@ -544,7 +544,11 @@ void DelegatedFrameHost::WillDrawSurface(cc::SurfaceId id, const gfx::Rect& damage_rect) { - if (id != surface_id_) + // Frame subscribers are only interested in changes to the target surface, so + // do not attempt capture if |damage_rect| is empty. This prevents the draws + // of parent surfaces from triggering extra frame captures, which can affect + // smoothness. + if (id != surface_id_ || damage_rect.IsEmpty()) return; AttemptFrameSubscriberCapture(damage_rect); }
diff --git a/content/browser/renderer_host/dwrite_font_proxy_message_filter_win.cc b/content/browser/renderer_host/dwrite_font_proxy_message_filter_win.cc index 6d16572..22e189c7 100644 --- a/content/browser/renderer_host/dwrite_font_proxy_message_filter_win.cc +++ b/content/browser/renderer_host/dwrite_font_proxy_message_filter_win.cc
@@ -20,6 +20,7 @@ #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" #include "content/common/dwrite_font_proxy_messages.h" +#include "content/common/dwrite_text_analysis_source_win.h" #include "ipc/ipc_message_macros.h" #include "ui/gfx/win/direct_write.h" @@ -90,6 +91,7 @@ IPC_MESSAGE_HANDLER(DWriteFontProxyMsg_GetFamilyCount, OnGetFamilyCount) IPC_MESSAGE_HANDLER(DWriteFontProxyMsg_GetFamilyNames, OnGetFamilyNames) IPC_MESSAGE_HANDLER(DWriteFontProxyMsg_GetFontFiles, OnGetFontFiles) + IPC_MESSAGE_HANDLER(DWriteFontProxyMsg_MapCharacters, OnMapCharacters) IPC_MESSAGE_UNHANDLED(handled = false) IPC_END_MESSAGE_MAP() return handled; @@ -142,13 +144,13 @@ mswr::ComPtr<IDWriteFontFamily> family; HRESULT hr = collection_->GetFontFamily(family_index, &family); - if (!SUCCEEDED(hr)) { + if (FAILED(hr)) { return; } mswr::ComPtr<IDWriteLocalizedStrings> localized_names; hr = family->GetFamilyNames(&localized_names); - if (!SUCCEEDED(hr)) { + if (FAILED(hr)) { return; } @@ -159,26 +161,26 @@ for (size_t index = 0; index < string_count; ++index) { UINT32 length = 0; hr = localized_names->GetLocaleNameLength(index, &length); - if (!SUCCEEDED(hr)) { + if (FAILED(hr)) { return; } ++length; // Reserve space for the null terminator. locale.resize(length); hr = localized_names->GetLocaleName(index, locale.data(), length); - if (!SUCCEEDED(hr)) { + if (FAILED(hr)) { return; } CHECK_EQ(L'\0', locale[length - 1]); length = 0; hr = localized_names->GetStringLength(index, &length); - if (!SUCCEEDED(hr)) { + if (FAILED(hr)) { return; } ++length; // Reserve space for the null terminator. name.resize(length); hr = localized_names->GetString(index, name.data(), length); - if (!SUCCEEDED(hr)) { + if (FAILED(hr)) { return; } CHECK_EQ(L'\0', name[length - 1]); @@ -200,7 +202,7 @@ mswr::ComPtr<IDWriteFontFamily> family; HRESULT hr = collection_->GetFontFamily(family_index, &family); - if (!SUCCEEDED(hr)) { + if (FAILED(hr)) { return; } @@ -213,7 +215,7 @@ for (UINT32 font_index = 0; font_index < font_count; ++font_index) { mswr::ComPtr<IDWriteFont> font; hr = family->GetFont(font_index, &font); - if (!SUCCEEDED(hr)) { + if (FAILED(hr)) { return; } @@ -223,6 +225,105 @@ file_paths->assign(path_set.begin(), path_set.end()); } +void DWriteFontProxyMessageFilter::OnMapCharacters( + const base::string16& text, + const DWriteFontStyle& font_style, + const base::string16& locale_name, + uint32_t reading_direction, + const base::string16& base_family_name, + MapCharactersResult* result) { + InitializeDirectWrite(); + result->family_index = UINT32_MAX; + result->mapped_length = text.length(); + result->family_name.clear(); + result->scale = 0.0; + result->font_style.font_slant = DWRITE_FONT_STYLE_NORMAL; + result->font_style.font_stretch = DWRITE_FONT_STRETCH_NORMAL; + result->font_style.font_weight = DWRITE_FONT_WEIGHT_NORMAL; + if (factory2_ == nullptr || collection_ == nullptr) + return; + if (font_fallback_ == nullptr) { + if (FAILED(factory2_->GetSystemFontFallback(&font_fallback_))) + return; + } + + UINT32 length; + mswr::ComPtr<IDWriteFont> mapped_font; + + mswr::ComPtr<IDWriteNumberSubstitution> number_substitution; + if (FAILED(factory2_->CreateNumberSubstitution( + DWRITE_NUMBER_SUBSTITUTION_METHOD_NONE, locale_name.c_str(), + TRUE /* ignoreUserOverride */, &number_substitution))) { + DCHECK(false); + return; + } + mswr::ComPtr<IDWriteTextAnalysisSource> analysis_source; + if (FAILED(mswr::MakeAndInitialize<TextAnalysisSource>( + &analysis_source, text, locale_name, number_substitution.Get(), + static_cast<DWRITE_READING_DIRECTION>(reading_direction)))) { + DCHECK(false); + return; + } + + if (FAILED(font_fallback_->MapCharacters( + analysis_source.Get(), 0, text.length(), collection_.Get(), + base_family_name.c_str(), + static_cast<DWRITE_FONT_WEIGHT>(font_style.font_weight), + static_cast<DWRITE_FONT_STYLE>(font_style.font_slant), + static_cast<DWRITE_FONT_STRETCH>(font_style.font_stretch), &length, + &mapped_font, &result->scale))) { + DCHECK(false); + return; + } + + result->mapped_length = length; + if (mapped_font == nullptr) + return; + + mswr::ComPtr<IDWriteFontFamily> mapped_family; + if (FAILED(mapped_font->GetFontFamily(&mapped_family))) { + DCHECK(false); + return; + } + mswr::ComPtr<IDWriteLocalizedStrings> family_names; + if (FAILED(mapped_family->GetFamilyNames(&family_names))) { + DCHECK(false); + return; + } + + result->font_style.font_slant = mapped_font->GetStyle(); + result->font_style.font_stretch = mapped_font->GetStretch(); + result->font_style.font_weight = mapped_font->GetWeight(); + + std::vector<base::char16> name; + size_t name_count = family_names->GetCount(); + for (size_t name_index = 0; name_index < name_count; name_index++) { + UINT32 name_length = 0; + if (FAILED(family_names->GetStringLength(name_index, &name_length))) + continue; // Keep trying other names + + ++name_length; // Reserve space for the null terminator. + name.resize(name_length); + if (FAILED(family_names->GetString(name_index, name.data(), name_length))) + continue; + UINT32 index = UINT32_MAX; + BOOL exists = false; + if (FAILED(collection_->FindFamilyName(name.data(), &index, &exists)) || + !exists) + continue; + + // Found a matching family! + result->family_index = index; + result->family_name = name.data(); + return; + } + // Could not find a matching family + // TODO(kulshin): log UMA that we matched a font, but could not locate the + // family + DCHECK_EQ(result->family_index, UINT32_MAX); + DCHECK_GT(result->mapped_length, 0u); +} + void DWriteFontProxyMessageFilter::InitializeDirectWrite() { DCHECK_CURRENTLY_ON(BrowserThread::FILE); if (direct_write_initialized_) @@ -237,6 +338,10 @@ return; } + // QueryInterface for IDWriteFactory2. It's ok for this to fail if we are + // running an older version of DirectWrite (earlier than Win8.1). + factory.As<IDWriteFactory2>(&factory2_); + HRESULT hr = factory->GetSystemFontCollection(&collection_); DCHECK(SUCCEEDED(hr)); } @@ -247,13 +352,13 @@ mswr::ComPtr<IDWriteFontFace> font_face; HRESULT hr; hr = font->CreateFontFace(&font_face); - if (!SUCCEEDED(hr)) { + if (FAILED(hr)) { return false; } UINT32 file_count; hr = font_face->GetFiles(&file_count, nullptr); - if (!SUCCEEDED(hr)) { + if (FAILED(hr)) { return false; } @@ -261,14 +366,14 @@ font_files.resize(file_count); hr = font_face->GetFiles( &file_count, reinterpret_cast<IDWriteFontFile**>(font_files.data())); - if (!SUCCEEDED(hr)) { + if (FAILED(hr)) { return false; } for (unsigned int file_index = 0; file_index < file_count; ++file_index) { mswr::ComPtr<IDWriteFontFileLoader> loader; hr = font_files[file_index]->GetLoader(&loader); - if (!SUCCEEDED(hr)) { + if (FAILED(hr)) { return false; } @@ -289,7 +394,7 @@ DCHECK(false); return false; - } else if (!SUCCEEDED(hr)) { + } else if (FAILED(hr)) { return false; } @@ -309,13 +414,13 @@ const void* key; UINT32 key_size; hr = font_file->GetReferenceKey(&key, &key_size); - if (!SUCCEEDED(hr)) { + if (FAILED(hr)) { return false; } UINT32 path_length = 0; hr = local_loader->GetFilePathLengthFromKey(key, key_size, &path_length); - if (!SUCCEEDED(hr)) { + if (FAILED(hr)) { return false; } ++path_length; // Reserve space for the null terminator. @@ -323,7 +428,7 @@ file_path_chars.resize(path_length); hr = local_loader->GetFilePathFromKey(key, key_size, file_path_chars.data(), path_length); - if (!SUCCEEDED(hr)) { + if (FAILED(hr)) { return false; }
diff --git a/content/browser/renderer_host/dwrite_font_proxy_message_filter_win.h b/content/browser/renderer_host/dwrite_font_proxy_message_filter_win.h index 25ef9b6..c105f4d0 100644 --- a/content/browser/renderer_host/dwrite_font_proxy_message_filter_win.h +++ b/content/browser/renderer_host/dwrite_font_proxy_message_filter_win.h
@@ -6,6 +6,7 @@ #define CONTENT_BROWSER_RENDERER_HOST_DWRITE_FONT_PROXY_MESSAGE_FILTER_WIN_H_ #include <dwrite.h> +#include <dwrite_2.h> #include <wrl.h> #include <set> #include <utility> @@ -18,6 +19,9 @@ #include "content/public/browser/browser_message_filter.h" #include "content/public/browser/browser_thread.h" +struct DWriteFontStyle; +struct MapCharactersResult; + namespace content { // Implements a message filter that handles the dwrite font proxy messages. @@ -43,6 +47,12 @@ std::vector<std::pair<base::string16, base::string16>>* family_names); void OnGetFontFiles(UINT32 family_index, std::vector<base::string16>* file_paths); + void OnMapCharacters(const base::string16& text, + const DWriteFontStyle& font_style, + const base::string16& locale_name, + uint32_t reading_direction, + const base::string16& base_family_name, + MapCharactersResult* result); void InitializeDirectWrite(); @@ -55,6 +65,8 @@ private: bool direct_write_initialized_ = false; Microsoft::WRL::ComPtr<IDWriteFontCollection> collection_; + Microsoft::WRL::ComPtr<IDWriteFactory2> factory2_; + Microsoft::WRL::ComPtr<IDWriteFontFallback> font_fallback_; base::string16 windows_fonts_path_; DISALLOW_COPY_AND_ASSIGN(DWriteFontProxyMessageFilter);
diff --git a/content/browser/renderer_host/dwrite_font_proxy_message_filter_win_unittest.cc b/content/browser/renderer_host/dwrite_font_proxy_message_filter_win_unittest.cc index b9772c1..6b14a378 100644 --- a/content/browser/renderer_host/dwrite_font_proxy_message_filter_win_unittest.cc +++ b/content/browser/renderer_host/dwrite_font_proxy_message_filter_win_unittest.cc
@@ -5,11 +5,13 @@ #include "content/browser/renderer_host/dwrite_font_proxy_message_filter_win.h" #include <dwrite.h> +#include <dwrite_2.h> #include "base/memory/ref_counted.h" #include "base/run_loop.h" #include "base/test/test_simple_task_runner.h" #include "base/thread_task_runner_handle.h" +#include "base/win/windows_version.h" #include "content/common/dwrite_font_proxy_messages.h" #include "content/public/test/test_browser_thread_bundle.h" #include "ipc/ipc_message_macros.h" @@ -56,6 +58,19 @@ serializer->SerializeOutputParameters(*(filter_->GetReply())); } + bool IsDWrite2Available() { + mswr::ComPtr<IDWriteFactory> factory; + gfx::win::CreateDWriteFactory(&factory); + mswr::ComPtr<IDWriteFactory2> factory2; + factory.As<IDWriteFactory2>(&factory2); + + if (!factory2.Get()) { + // IDWriteFactory2 is expected to not be available before Win8.1 + EXPECT_LT(base::win::GetVersion(), base::win::VERSION_WIN8_1); + } + return factory2.Get(); + } + scoped_refptr<FilterWithFakeSender> filter_; content::TestBrowserThreadBundle thread_bundle_; }; @@ -140,6 +155,71 @@ EXPECT_EQ(0u, files.size()); } +TEST_F(DWriteFontProxyMessageFilterUnitTest, MapCharacter) { + if (!gfx::win::ShouldUseDirectWrite() || !IsDWrite2Available()) + return; + + DWriteFontStyle font_style; + font_style.font_weight = DWRITE_FONT_WEIGHT_NORMAL; + font_style.font_slant = DWRITE_FONT_STYLE_NORMAL; + font_style.font_stretch = DWRITE_FONT_STRETCH_NORMAL; + + MapCharactersResult result; + Send(new DWriteFontProxyMsg_MapCharacters( + L"abc", font_style, L"", DWRITE_READING_DIRECTION_LEFT_TO_RIGHT, L"", + &result)); + + EXPECT_NE(UINT32_MAX, result.family_index); + EXPECT_STRNE(L"", result.family_name.c_str()); + EXPECT_EQ(3u, result.mapped_length); + EXPECT_NE(0.0, result.scale); + EXPECT_NE(0, result.font_style.font_weight); + EXPECT_EQ(DWRITE_FONT_STYLE_NORMAL, result.font_style.font_slant); + EXPECT_NE(0, result.font_style.font_stretch); +} + +TEST_F(DWriteFontProxyMessageFilterUnitTest, MapCharacterInvalidCharacter) { + if (!gfx::win::ShouldUseDirectWrite() || !IsDWrite2Available()) + return; + + DWriteFontStyle font_style; + font_style.font_weight = DWRITE_FONT_WEIGHT_NORMAL; + font_style.font_slant = DWRITE_FONT_STYLE_NORMAL; + font_style.font_stretch = DWRITE_FONT_STRETCH_NORMAL; + + MapCharactersResult result; + Send(new DWriteFontProxyMsg_MapCharacters( + L"\ufffe\uffffabc", font_style, L"en-us", + DWRITE_READING_DIRECTION_LEFT_TO_RIGHT, L"", &result)); + + EXPECT_EQ(UINT32_MAX, result.family_index); + EXPECT_STREQ(L"", result.family_name.c_str()); + EXPECT_EQ(2u, result.mapped_length); +} + +TEST_F(DWriteFontProxyMessageFilterUnitTest, MapCharacterInvalidAfterValid) { + if (!gfx::win::ShouldUseDirectWrite() || !IsDWrite2Available()) + return; + + DWriteFontStyle font_style; + font_style.font_weight = DWRITE_FONT_WEIGHT_NORMAL; + font_style.font_slant = DWRITE_FONT_STYLE_NORMAL; + font_style.font_stretch = DWRITE_FONT_STRETCH_NORMAL; + + MapCharactersResult result; + Send(new DWriteFontProxyMsg_MapCharacters( + L"abc\ufffe\uffff", font_style, L"en-us", + DWRITE_READING_DIRECTION_LEFT_TO_RIGHT, L"", &result)); + + EXPECT_NE(UINT32_MAX, result.family_index); + EXPECT_STRNE(L"", result.family_name.c_str()); + EXPECT_EQ(3u, result.mapped_length); + EXPECT_NE(0.0, result.scale); + EXPECT_NE(0, result.font_style.font_weight); + EXPECT_EQ(DWRITE_FONT_STYLE_NORMAL, result.font_style.font_slant); + EXPECT_NE(0, result.font_style.font_stretch); +} + } // namespace } // namespace content
diff --git a/content/browser/renderer_host/input/input_router_impl.cc b/content/browser/renderer_host/input/input_router_impl.cc index 598e2174..1af52e2 100644 --- a/content/browser/renderer_host/input/input_router_impl.cc +++ b/content/browser/renderer_host/input/input_router_impl.cc
@@ -160,8 +160,11 @@ wheel_event_queue_.OnGestureScrollEvent(gesture_event); - if (gesture_event.event.sourceDevice == blink::WebGestureDeviceTouchscreen) + if (gesture_event.event.sourceDevice == blink::WebGestureDeviceTouchscreen) { + if (gesture_event.event.type == blink::WebInputEvent::GestureScrollBegin) + touch_event_queue_.PrependTouchScrollNotification(); touch_event_queue_.OnGestureScrollEvent(gesture_event); + } gesture_event_queue_.QueueEvent(gesture_event); } @@ -370,20 +373,21 @@ return; // Touch events should always indicate in the event whether they are - // cancelable (respect ACK disposition) or not except touchmove. + // cancelable (respect ACK disposition) or not, except touchmove and + // touchscollstarted. bool should_block = WebInputEventTraits::ShouldBlockEventStream(input_event); + if (WebInputEvent::isTouchEventType(input_event.type) && + input_event.type != WebInputEvent::TouchMove && + input_event.type != WebInputEvent::TouchScrollStarted) { + const WebTouchEvent& touch = static_cast<const WebTouchEvent&>(input_event); + DCHECK_EQ(should_block, touch.cancelable); + } OfferToRenderer(input_event, latency_info, should_block ? InputEventDispatchType::DISPATCH_TYPE_BLOCKING : InputEventDispatchType::DISPATCH_TYPE_NON_BLOCKING); - if (WebInputEvent::isTouchEventType(input_event.type) && - input_event.type != WebInputEvent::TouchMove) { - const WebTouchEvent& touch = static_cast<const WebTouchEvent&>(input_event); - DCHECK_EQ(should_block, touch.cancelable); - } - // Generate a synthetic ack if the event was sent so it doesn't block. if (!should_block) { ProcessInputEventAck(
diff --git a/content/browser/renderer_host/input/input_router_impl_unittest.cc b/content/browser/renderer_host/input/input_router_impl_unittest.cc index e5d16cb..d1e7bb7 100644 --- a/content/browser/renderer_host/input/input_router_impl_unittest.cc +++ b/content/browser/renderer_host/input/input_router_impl_unittest.cc
@@ -1231,7 +1231,6 @@ EXPECT_EQ(1U, GetSentMessageCountAndResetSink()); EXPECT_EQ(1U, ack_handler_->GetAndResetAckCount()); - // GesturePinchBegin ignores its ack. SimulateGestureEvent(WebInputEvent::GesturePinchBegin, blink::WebGestureDeviceTouchscreen);
diff --git a/content/browser/renderer_host/input/non_blocking_event_browsertest.cc b/content/browser/renderer_host/input/non_blocking_event_browsertest.cc index b80c567..8713960 100644 --- a/content/browser/renderer_host/input/non_blocking_event_browsertest.cc +++ b/content/browser/renderer_host/input/non_blocking_event_browsertest.cc
@@ -27,7 +27,7 @@ #include "content/shell/browser/shell.h" #include "third_party/WebKit/public/web/WebInputEvent.h" #include "ui/events/event_switches.h" -#include "ui/latency_info/latency_info.h" +#include "ui/events/latency_info.h" using blink::WebInputEvent;
diff --git a/content/browser/renderer_host/input/render_widget_host_latency_tracker.h b/content/browser/renderer_host/input/render_widget_host_latency_tracker.h index 2afffe8..633e4e87 100644 --- a/content/browser/renderer_host/input/render_widget_host_latency_tracker.h +++ b/content/browser/renderer_host/input/render_widget_host_latency_tracker.h
@@ -12,7 +12,7 @@ #include "base/macros.h" #include "content/browser/renderer_host/event_with_latency_info.h" #include "content/common/content_export.h" -#include "ui/latency_info/latency_info.h" +#include "ui/events/latency_info.h" namespace content {
diff --git a/content/browser/renderer_host/input/synthetic_gesture_target_base.cc b/content/browser/renderer_host/input/synthetic_gesture_target_base.cc index 74abdc6..e1fd3b0 100644 --- a/content/browser/renderer_host/input/synthetic_gesture_target_base.cc +++ b/content/browser/renderer_host/input/synthetic_gesture_target_base.cc
@@ -10,7 +10,7 @@ #include "content/common/input_messages.h" #include "third_party/WebKit/public/web/WebInputEvent.h" #include "ui/events/event.h" -#include "ui/latency_info/latency_info.h" +#include "ui/events/latency_info.h" using blink::WebInputEvent; using blink::WebTouchEvent;
diff --git a/content/browser/renderer_host/input/synthetic_pointer_action.cc b/content/browser/renderer_host/input/synthetic_pointer_action.cc index cb144b1..6353f34 100644 --- a/content/browser/renderer_host/input/synthetic_pointer_action.cc +++ b/content/browser/renderer_host/input/synthetic_pointer_action.cc
@@ -6,7 +6,7 @@ #include "base/logging.h" #include "third_party/WebKit/public/web/WebInputEvent.h" -#include "ui/latency_info/latency_info.h" +#include "ui/events/latency_info.h" namespace content {
diff --git a/content/browser/renderer_host/input/synthetic_tap_gesture.cc b/content/browser/renderer_host/input/synthetic_tap_gesture.cc index 1242d826..46dc23ae 100644 --- a/content/browser/renderer_host/input/synthetic_tap_gesture.cc +++ b/content/browser/renderer_host/input/synthetic_tap_gesture.cc
@@ -6,7 +6,7 @@ #include "base/logging.h" #include "third_party/WebKit/public/web/WebInputEvent.h" -#include "ui/latency_info/latency_info.h" +#include "ui/events/latency_info.h" namespace content {
diff --git a/content/browser/renderer_host/input/synthetic_touchscreen_pinch_gesture.cc b/content/browser/renderer_host/input/synthetic_touchscreen_pinch_gesture.cc index 6fff6819..3a317822b 100644 --- a/content/browser/renderer_host/input/synthetic_touchscreen_pinch_gesture.cc +++ b/content/browser/renderer_host/input/synthetic_touchscreen_pinch_gesture.cc
@@ -9,7 +9,7 @@ #include <cmath> #include "base/logging.h" -#include "ui/latency_info/latency_info.h" +#include "ui/events/latency_info.h" namespace content {
diff --git a/content/browser/renderer_host/input/touch_action_browsertest.cc b/content/browser/renderer_host/input/touch_action_browsertest.cc index 17516af..2c4ab95 100644 --- a/content/browser/renderer_host/input/touch_action_browsertest.cc +++ b/content/browser/renderer_host/input/touch_action_browsertest.cc
@@ -32,7 +32,7 @@ #include "content/shell/browser/shell.h" #include "third_party/WebKit/public/web/WebInputEvent.h" #include "ui/events/event_switches.h" -#include "ui/latency_info/latency_info.h" +#include "ui/events/latency_info.h" using blink::WebInputEvent;
diff --git a/content/browser/renderer_host/input/touch_event_queue.cc b/content/browser/renderer_host/input/touch_event_queue.cc index a36520fd..b92b24aaa 100644 --- a/content/browser/renderer_host/input/touch_event_queue.cc +++ b/content/browser/renderer_host/input/touch_event_queue.cc
@@ -28,8 +28,7 @@ const double kAsyncTouchMoveIntervalSec = .2; // A sanity check on touches received to ensure that touch movement outside -// the platform slop region will cause scrolling, as indicated by the event's -// |causesScrollingIfUncanceled| bit. +// the platform slop region will cause scrolling. const double kMaxConceivablePlatformSlopRegionLengthDipsSquared = 60. * 60.; TouchEventWithLatencyInfo ObtainCancelEventForTouchEvent( @@ -491,6 +490,32 @@ touch_queue_.push_back(new CoalescedWebTouchEvent(event, false)); } +void TouchEventQueue::PrependTouchScrollNotification() { + TRACE_EVENT0("input", "TouchEventQueue::PrependTouchScrollNotification"); + + // The queue should have an in-flight event when this method is called because + // this method is triggered by InputRouterImpl::SendGestureEvent, which is + // triggered by TouchEventQueue::AckTouchEventToClient, which has just + // received an ack for the in-flight event. We leave the head of the queue + // untouched since it is the in-flight event. + // + // However, for the (integration) tests in RenderWidgetHostTest that trigger + // this method indirectly, they push the TouchScrollStarted event into + // TouchEventQueue without any way to dispatch it. Below we added a check for + // non-empty queue to keep those tests as-is w/o exposing internals of this + // class all the way up. + if (!touch_queue_.empty()) { + TouchEventWithLatencyInfo touch; + touch.event.type = WebInputEvent::TouchScrollStarted; + touch.event.uniqueTouchEventId = 0; + touch.event.touchesLength = 0; + + auto it = touch_queue_.begin(); + DCHECK(it != touch_queue_.end()); + touch_queue_.insert(++it, new CoalescedWebTouchEvent(touch, false)); + } +} + void TouchEventQueue::ProcessTouchAck(InputEventAckState ack_result, const LatencyInfo& latency_info, const uint32_t unique_touch_event_id) { @@ -525,8 +550,14 @@ if (touch_queue_.empty()) return; - DCHECK_EQ(touch_queue_.front()->coalesced_event().event.uniqueTouchEventId, - unique_touch_event_id); + // We don't care about the ordering of the acks vs the ordering of the + // dispatched events because we can receive the ack for event B before the ack + // for event A even though A was sent before B. This seems to be happening + // when, for example, A is acked from renderer but B isn't, so the ack for B + // is synthesized "locally" in InputRouter. + // + // TODO(crbug.com/600773): Bring the id checks back when dispatch triggering + // is sane. PopTouchEventToClient(ack_result, latency_info); TryForwardNextEventToRenderer(); @@ -719,38 +750,45 @@ } void TouchEventQueue::PopTouchEventToClient(InputEventAckState ack_result) { - AckTouchEventToClient(ack_result, PopTouchEvent(), nullptr); + AckTouchEventToClient(ack_result, nullptr); } void TouchEventQueue::PopTouchEventToClient( InputEventAckState ack_result, const LatencyInfo& renderer_latency_info) { - AckTouchEventToClient(ack_result, PopTouchEvent(), &renderer_latency_info); + AckTouchEventToClient(ack_result, &renderer_latency_info); } void TouchEventQueue::AckTouchEventToClient( InputEventAckState ack_result, - std::unique_ptr<CoalescedWebTouchEvent> acked_event, const ui::LatencyInfo* optional_latency_info) { - DCHECK(acked_event); DCHECK(!dispatching_touch_ack_); + DCHECK(!touch_queue_.empty()); + std::unique_ptr<CoalescedWebTouchEvent> acked_event(touch_queue_.front()); + DCHECK(acked_event); + UpdateTouchConsumerStates(acked_event->coalesced_event().event, ack_result); // Note that acking the touch-event may result in multiple gestures being sent // to the renderer, or touch-events being queued. base::AutoReset<bool> dispatching_touch_ack(&dispatching_touch_ack_, true); - acked_event->DispatchAckToClient(ack_result, optional_latency_info, client_); -} -std::unique_ptr<CoalescedWebTouchEvent> TouchEventQueue::PopTouchEvent() { - DCHECK(!touch_queue_.empty()); - std::unique_ptr<CoalescedWebTouchEvent> event(touch_queue_.front()); + // Skip ack for TouchScrollStarted since it was synthesized within the queue. + if (acked_event->coalesced_event().event.type != + WebInputEvent::TouchScrollStarted) { + acked_event->DispatchAckToClient(ack_result, optional_latency_info, + client_); + } + touch_queue_.pop_front(); - return event; } void TouchEventQueue::SendTouchEventImmediately( TouchEventWithLatencyInfo* touch) { + // TODO(crbug.com/600773): Hack to avoid cyclic reentry to this method. + if (dispatching_touch_) + return; + // For touchmove events, compare touch points position from current event // to last sent event and update touch points state. if (touch->event.type == WebInputEvent::TouchMove) { @@ -772,10 +810,12 @@ } } - if (last_sent_touchevent_) - *last_sent_touchevent_ = touch->event; - else - last_sent_touchevent_.reset(new WebTouchEvent(touch->event)); + if (touch->event.type != WebInputEvent::TouchScrollStarted) { + if (last_sent_touchevent_) + *last_sent_touchevent_ = touch->event; + else + last_sent_touchevent_.reset(new WebTouchEvent(touch->event)); + } base::AutoReset<bool> dispatching_touch(&dispatching_touch_, true); @@ -805,6 +845,9 @@ TouchEventQueue::PreFilterResult TouchEventQueue::FilterBeforeForwarding(const WebTouchEvent& event) { + if (event.type == WebInputEvent::TouchScrollStarted) + return FORWARD_TO_RENDERER; + if (WebTouchEventTraits::IsTouchSequenceStart(event)) { has_handler_for_current_sequence_ = false; send_touch_events_async_ = false;
diff --git a/content/browser/renderer_host/input/touch_event_queue.h b/content/browser/renderer_host/input/touch_event_queue.h index 64fcf4d..31a69fc 100644 --- a/content/browser/renderer_host/input/touch_event_queue.h +++ b/content/browser/renderer_host/input/touch_event_queue.h
@@ -9,7 +9,7 @@ #include <stdint.h> #include <deque> -#include <map> +#include <list> #include "base/macros.h" #include "base/time/time.h" @@ -70,6 +70,10 @@ // the renderer (e.g. when there are no other queued touch event). void QueueEvent(const TouchEventWithLatencyInfo& event); + // Insert a TouchScrollStarted event in the queue ahead of all not-in-flight + // events. + void PrependTouchScrollNotification(); + // Notifies the queue that a touch-event has been processed by the renderer. // At this point, if the ack is for async touchmove, remove the uncancelable // touchmove from the front of the queue and decide if it should dispatch the @@ -109,8 +113,6 @@ // Whether ack timeout behavior is supported and enabled for the current site. bool IsAckTimeoutEnabled() const; - bool IsForwardingTouches(); - bool empty() const WARN_UNUSED_RESULT { return touch_queue_.empty(); } @@ -155,15 +157,11 @@ void PopTouchEventToClient(InputEventAckState ack_result, const ui::LatencyInfo& renderer_latency_info); - // Ack all coalesced events in |acked_event| to the client with |ack_result|, - // updating the acked events with |optional_latency_info| if it exists. - void AckTouchEventToClient( - InputEventAckState ack_result, - std::unique_ptr<CoalescedWebTouchEvent> acked_event, - const ui::LatencyInfo* optional_latency_info); - - // Safely pop the head of the queue. - std::unique_ptr<CoalescedWebTouchEvent> PopTouchEvent(); + // Ack all coalesced events at the head of the queue to the client with + // |ack_result|, updating the acked events with |optional_latency_info| if it + // exists, and popping the head of the queue. + void AckTouchEventToClient(InputEventAckState ack_result, + const ui::LatencyInfo* optional_latency_info); // Dispatch |touch| to the client. Before dispatching, updates pointer // states in touchmove events for pointers that have not changed position. @@ -185,7 +183,7 @@ // Handles touch event forwarding and ack'ed event dispatch. TouchEventQueueClient* client_; - typedef std::deque<CoalescedWebTouchEvent*> TouchQueue; + typedef std::list<CoalescedWebTouchEvent*> TouchQueue; TouchQueue touch_queue_; // Position of the first touch in the most recent sequence forwarded to the
diff --git a/content/browser/renderer_host/input/touch_event_queue_unittest.cc b/content/browser/renderer_host/input/touch_event_queue_unittest.cc index 26233c1..d8782285 100644 --- a/content/browser/renderer_host/input/touch_event_queue_unittest.cc +++ b/content/browser/renderer_host/input/touch_event_queue_unittest.cc
@@ -236,6 +236,10 @@ SendTouchEvent(); } + void PrependTouchScrollNotification() { + queue_->PrependTouchScrollNotification(); + } + void AdvanceTouchTime(double seconds) { touch_event_.timeStampSeconds += seconds; } @@ -2618,4 +2622,95 @@ EXPECT_EQ(1U, GetAndResetAckedEventCount()); } +// Tests that touch-scroll-notification is not pushed into an empty queue. +TEST_F(TouchEventQueueTest, TouchScrollNotificationOrder_EmptyQueue) { + PrependTouchScrollNotification(); + + EXPECT_EQ(0U, GetAndResetAckedEventCount()); + EXPECT_EQ(0U, queued_event_count()); + EXPECT_EQ(0U, GetAndResetSentEventCount()); +} + +// Tests touch-scroll-notification firing order when the event is placed at the +// end of touch queue because of a pending ack for the head of the queue. +TEST_F(TouchEventQueueTest, TouchScrollNotificationOrder_EndOfQueue) { + PressTouchPoint(1, 1); + + EXPECT_EQ(0U, GetAndResetAckedEventCount()); + EXPECT_EQ(1U, queued_event_count()); + + // Send the touch-scroll-notification when 3 events are in the queue. + PrependTouchScrollNotification(); + + EXPECT_EQ(0U, GetAndResetAckedEventCount()); + EXPECT_EQ(2U, queued_event_count()); + + // Receive an ACK for the touchstart. + SendTouchEventAck(INPUT_EVENT_ACK_STATE_CONSUMED); + + EXPECT_EQ(1U, GetAndResetAckedEventCount()); + EXPECT_EQ(WebInputEvent::TouchStart, acked_event().type); + EXPECT_EQ(1U, queued_event_count()); + + // Receive an ACK for the touch-scroll-notification. + SendTouchEventAck(INPUT_EVENT_ACK_STATE_IGNORED); + + EXPECT_EQ(0U, GetAndResetAckedEventCount()); + EXPECT_EQ(0U, queued_event_count()); + + EXPECT_EQ(WebInputEvent::TouchStart, all_sent_events()[0].type); + EXPECT_EQ(WebInputEvent::TouchScrollStarted, all_sent_events()[1].type); + EXPECT_EQ(2U, GetAndResetSentEventCount()); +} + +// Tests touch-scroll-notification firing order when the event is placed in the +// 2nd position in the touch queue between two events. +TEST_F(TouchEventQueueTest, TouchScrollNotificationOrder_SecondPosition) { + PressTouchPoint(1, 1); + MoveTouchPoint(0, 5, 5); + ReleaseTouchPoint(0); + + EXPECT_EQ(0U, GetAndResetAckedEventCount()); + EXPECT_EQ(3U, queued_event_count()); + + // Send the touch-scroll-notification when 3 events are in the queue. + PrependTouchScrollNotification(); + + EXPECT_EQ(0U, GetAndResetAckedEventCount()); + EXPECT_EQ(4U, queued_event_count()); + + // Receive an ACK for the touchstart. + SendTouchEventAck(INPUT_EVENT_ACK_STATE_CONSUMED); + + EXPECT_EQ(1U, GetAndResetAckedEventCount()); + EXPECT_EQ(WebInputEvent::TouchStart, acked_event().type); + EXPECT_EQ(3U, queued_event_count()); + + // Receive an ACK for the touch-scroll-notification. + SendTouchEventAck(INPUT_EVENT_ACK_STATE_IGNORED); + + EXPECT_EQ(0U, GetAndResetAckedEventCount()); + EXPECT_EQ(2U, queued_event_count()); + + // Receive an ACK for the touchmove. + SendTouchEventAck(INPUT_EVENT_ACK_STATE_CONSUMED); + + EXPECT_EQ(1U, GetAndResetAckedEventCount()); + EXPECT_EQ(WebInputEvent::TouchMove, acked_event().type); + EXPECT_EQ(1U, queued_event_count()); + + // Receive an ACK for the touchend. + SendTouchEventAck(INPUT_EVENT_ACK_STATE_CONSUMED); + + EXPECT_EQ(1U, GetAndResetAckedEventCount()); + EXPECT_EQ(WebInputEvent::TouchEnd, acked_event().type); + EXPECT_EQ(0U, queued_event_count()); + + EXPECT_EQ(WebInputEvent::TouchStart, all_sent_events()[0].type); + EXPECT_EQ(WebInputEvent::TouchScrollStarted, all_sent_events()[1].type); + EXPECT_EQ(WebInputEvent::TouchMove, all_sent_events()[2].type); + EXPECT_EQ(WebInputEvent::TouchEnd, all_sent_events()[3].type); + EXPECT_EQ(4U, GetAndResetSentEventCount()); +} + } // namespace content
diff --git a/content/browser/renderer_host/input/touch_input_browsertest.cc b/content/browser/renderer_host/input/touch_input_browsertest.cc index d374b2c..7ff1dd0 100644 --- a/content/browser/renderer_host/input/touch_input_browsertest.cc +++ b/content/browser/renderer_host/input/touch_input_browsertest.cc
@@ -25,7 +25,7 @@ #include "content/shell/browser/shell.h" #include "third_party/WebKit/public/web/WebInputEvent.h" #include "ui/events/event_switches.h" -#include "ui/latency_info/latency_info.h" +#include "ui/events/latency_info.h" using blink::WebInputEvent;
diff --git a/content/browser/renderer_host/media/audio_input_device_manager_unittest.cc b/content/browser/renderer_host/media/audio_input_device_manager_unittest.cc index dd387bbd..a465a63 100644 --- a/content/browser/renderer_host/media/audio_input_device_manager_unittest.cc +++ b/content/browser/renderer_host/media/audio_input_device_manager_unittest.cc
@@ -13,11 +13,12 @@ #include "base/location.h" #include "base/macros.h" #include "base/memory/ref_counted.h" +#include "base/run_loop.h" #include "base/single_thread_task_runner.h" -#include "base/synchronization/waitable_event.h" +#include "base/thread_task_runner_handle.h" #include "build/build_config.h" -#include "content/browser/browser_thread_impl.h" #include "content/public/common/media_stream_request.h" +#include "content/public/test/test_browser_thread_bundle.h" #include "media/audio/audio_manager_base.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" @@ -62,22 +63,16 @@ protected: void SetUp() override { - // The test must run on Browser::IO. - message_loop_.reset(new base::MessageLoopForIO); - io_thread_.reset(new BrowserThreadImpl(BrowserThread::IO, - message_loop_.get())); - audio_manager_.reset(media::AudioManager::CreateForTesting()); - // Wait for audio thread initialization to complete. Otherwise the - // enumeration type may not have been set yet. - base::WaitableEvent event(false, false); - audio_manager_->GetTaskRunner()->PostTask(FROM_HERE, base::Bind( - &base::WaitableEvent::Signal, base::Unretained(&event))); - event.Wait(); + audio_manager_ = media::AudioManager::CreateForTesting( + base::ThreadTaskRunnerHandle::Get()); + // Flush the message loop to ensure proper initialization of AudioManager. + base::RunLoop().RunUntilIdle(); + manager_ = new AudioInputDeviceManager(audio_manager_.get()); manager_->UseFakeDevice(); audio_input_listener_.reset(new MockAudioInputDeviceManagerListener()); manager_->Register(audio_input_listener_.get(), - message_loop_->task_runner().get()); + audio_manager_->GetTaskRunner()); // Gets the enumerated device list from the AudioInputDeviceManager. manager_->EnumerateDevices(MEDIA_DEVICE_AUDIO_CAPTURE); @@ -87,19 +82,17 @@ .WillOnce(SaveArg<1>(&devices_)); // Wait until we get the list. - message_loop_->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); } void TearDown() override { manager_->Unregister(); - io_thread_.reset(); } - std::unique_ptr<base::MessageLoop> message_loop_; - std::unique_ptr<BrowserThreadImpl> io_thread_; + TestBrowserThreadBundle thread_bundle_; scoped_refptr<AudioInputDeviceManager> manager_; std::unique_ptr<MockAudioInputDeviceManagerListener> audio_input_listener_; - std::unique_ptr<media::AudioManager> audio_manager_; + media::ScopedAudioManagerPtr audio_manager_; StreamDeviceInfoArray devices_; private: @@ -123,7 +116,7 @@ Opened(MEDIA_DEVICE_AUDIO_CAPTURE, session_id)) .Times(1); // Waits for the callback. - message_loop_->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); manager_->Close(session_id); EXPECT_CALL(*audio_input_listener_, @@ -131,7 +124,7 @@ .Times(1); // Waits for the callback. - message_loop_->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); } } @@ -156,7 +149,7 @@ .Times(1); // Waits for the callback. - message_loop_->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); } // Checks if the session_ids are unique. @@ -174,7 +167,7 @@ .Times(1); // Waits for the callback. - message_loop_->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); } } @@ -196,7 +189,7 @@ .Times(1); // Waits for the callback. - message_loop_->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); } // Opens default device twice. @@ -218,7 +211,7 @@ Opened(MEDIA_DEVICE_AUDIO_CAPTURE, second_session_id)) .Times(1); // Waits for the callback. - message_loop_->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); manager_->Close(first_session_id); manager_->Close(second_session_id); @@ -229,7 +222,7 @@ Closed(MEDIA_DEVICE_AUDIO_CAPTURE, second_session_id)) .Times(1); // Waits for the callback. - message_loop_->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); } // Accesses then closes the sessions after opening the devices. @@ -251,7 +244,7 @@ EXPECT_CALL(*audio_input_listener_, Opened(MEDIA_DEVICE_AUDIO_CAPTURE, session_id[index])) .Times(1); - message_loop_->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); const StreamDeviceInfo* info = manager_->GetOpenedDeviceInfoById( session_id[index]); @@ -261,7 +254,7 @@ EXPECT_CALL(*audio_input_listener_, Closed(MEDIA_DEVICE_AUDIO_CAPTURE, session_id[index])) .Times(1); - message_loop_->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); } } @@ -275,7 +268,7 @@ EXPECT_CALL(*audio_input_listener_, Opened(MEDIA_DEVICE_AUDIO_CAPTURE, session_id)) .Times(1); - message_loop_->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); // Access a non-opened device. // This should fail and return an empty StreamDeviceInfo. @@ -288,7 +281,7 @@ EXPECT_CALL(*audio_input_listener_, Closed(MEDIA_DEVICE_AUDIO_CAPTURE, session_id)) .Times(1); - message_loop_->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); } } // namespace content
diff --git a/content/browser/renderer_host/media/audio_output_device_enumerator.cc b/content/browser/renderer_host/media/audio_output_device_enumerator.cc index 24ef8f9e..9c469c60 100644 --- a/content/browser/renderer_host/media/audio_output_device_enumerator.cc +++ b/content/browser/renderer_host/media/audio_output_device_enumerator.cc
@@ -117,7 +117,7 @@ is_enumeration_ongoing_ = true; seq_last_enumeration_ = NewEventSequence(); base::PostTaskAndReplyWithResult( - audio_manager_->GetTaskRunner().get(), FROM_HERE, + audio_manager_->GetTaskRunner(), FROM_HERE, base::Bind(&EnumerateDevicesOnDeviceThread, audio_manager_), base::Bind(&AudioOutputDeviceEnumerator::DevicesEnumerated, weak_factory_.GetWeakPtr()));
diff --git a/content/browser/renderer_host/media/audio_output_device_enumerator_unittest.cc b/content/browser/renderer_host/media/audio_output_device_enumerator_unittest.cc index f84f87e2..c84a684 100644 --- a/content/browser/renderer_host/media/audio_output_device_enumerator_unittest.cc +++ b/content/browser/renderer_host/media/audio_output_device_enumerator_unittest.cc
@@ -12,7 +12,6 @@ #include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/run_loop.h" -#include "base/single_thread_task_runner.h" #include "base/strings/string_number_conversions.h" #include "base/thread_task_runner_handle.h" #include "content/public/test/test_browser_thread_bundle.h" @@ -31,7 +30,10 @@ class MockAudioManager : public media::FakeAudioManager { public: MockAudioManager(size_t num_devices) - : FakeAudioManager(&fake_audio_log_factory_), num_devices_(num_devices) {} + : FakeAudioManager(base::ThreadTaskRunnerHandle::Get(), + base::ThreadTaskRunnerHandle::Get(), + &fake_audio_log_factory_), + num_devices_(num_devices) {} MockAudioManager() : MockAudioManager(0) {} ~MockAudioManager() override {} @@ -81,9 +83,7 @@ class AudioOutputDeviceEnumeratorTest : public ::testing::Test { public: - AudioOutputDeviceEnumeratorTest() - : thread_bundle_(), task_runner_(base::ThreadTaskRunnerHandle::Get()) {} - + AudioOutputDeviceEnumeratorTest() {} ~AudioOutputDeviceEnumeratorTest() override {} MOCK_METHOD1(MockCallback, void(const AudioOutputDeviceEnumeration&)); @@ -110,18 +110,19 @@ const AudioOutputDeviceEnumeration& result) { EXPECT_EQ(actual_devices_expected, result.has_actual_devices); EXPECT_EQ(num_entries_expected, result.devices.size()); - task_runner_->PostTask(FROM_HERE, run_loop_.QuitClosure()); + base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, + run_loop_.QuitClosure()); } void QuitCallback(const AudioOutputDeviceEnumeration& result) { MockCallback(result); - task_runner_->PostTask(FROM_HERE, run_loop_.QuitClosure()); + base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, + run_loop_.QuitClosure()); } protected: - std::unique_ptr<MockAudioManager> audio_manager_; TestBrowserThreadBundle thread_bundle_; - scoped_refptr<base::SingleThreadTaskRunner> task_runner_; + std::unique_ptr<MockAudioManager, media::AudioManagerDeleter> audio_manager_; base::RunLoop run_loop_; private:
diff --git a/content/browser/renderer_host/media/audio_renderer_host.cc b/content/browser/renderer_host/media/audio_renderer_host.cc index ae58022..1d72170 100644 --- a/content/browser/renderer_host/media/audio_renderer_host.cc +++ b/content/browser/renderer_host/media/audio_renderer_host.cc
@@ -484,7 +484,7 @@ !media_stream_manager_->audio_output_device_enumerator() ->IsCacheEnabled()) { base::PostTaskAndReplyWithResult( - audio_manager_->GetTaskRunner().get(), FROM_HERE, + audio_manager_->GetTaskRunner(), FROM_HERE, base::Bind(&GetDefaultDeviceInfoOnDeviceThread, audio_manager_), base::Bind(&AudioRendererHost::OnDeviceIDTranslated, this, stream_id, true));
diff --git a/content/browser/renderer_host/media/audio_renderer_host_unittest.cc b/content/browser/renderer_host/media/audio_renderer_host_unittest.cc index a0cdfdb4..467e2be 100644 --- a/content/browser/renderer_host/media/audio_renderer_host_unittest.cc +++ b/content/browser/renderer_host/media/audio_renderer_host_unittest.cc
@@ -187,7 +187,8 @@ class AudioRendererHostTest : public testing::Test { public: AudioRendererHostTest() { - audio_manager_.reset(media::AudioManager::CreateForTesting()); + audio_manager_ = media::AudioManager::CreateForTesting( + base::ThreadTaskRunnerHandle::Get()); base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kUseFakeDeviceForMediaStream); media_stream_manager_.reset(new MediaStreamManager(audio_manager_.get())); @@ -328,7 +329,7 @@ // TestBrowserThreadBundle. std::unique_ptr<MediaStreamManager> media_stream_manager_; TestBrowserThreadBundle thread_bundle_; - std::unique_ptr<media::AudioManager> audio_manager_; + media::ScopedAudioManagerPtr audio_manager_; MockAudioMirroringManager mirroring_manager_; scoped_refptr<MockAudioRendererHost> host_;
diff --git a/content/browser/renderer_host/media/media_stream_dispatcher_host_unittest.cc b/content/browser/renderer_host/media/media_stream_dispatcher_host_unittest.cc index 0c18286..5560d0e 100644 --- a/content/browser/renderer_host/media/media_stream_dispatcher_host_unittest.cc +++ b/content/browser/renderer_host/media/media_stream_dispatcher_host_unittest.cc
@@ -225,8 +225,8 @@ class MediaStreamDispatcherHostTest : public testing::Test { public: MediaStreamDispatcherHostTest() - : old_browser_client_(NULL), - thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP), + : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP), + old_browser_client_(NULL), origin_("https://test.com") { audio_manager_.reset( new media::MockAudioManager(base::ThreadTaskRunnerHandle::Get())); @@ -422,12 +422,13 @@ } scoped_refptr<MockMediaStreamDispatcherHost> host_; - std::unique_ptr<media::AudioManager> audio_manager_; std::unique_ptr<MediaStreamManager> media_stream_manager_; + content::TestBrowserThreadBundle thread_bundle_; + std::unique_ptr<media::AudioManager, media::AudioManagerDeleter> + audio_manager_; MockMediaStreamUIProxy* stream_ui_; ContentBrowserClient* old_browser_client_; std::unique_ptr<ContentClient> content_client_; - content::TestBrowserThreadBundle thread_bundle_; content::TestBrowserContext browser_context_; media::AudioDeviceNames physical_audio_devices_; media::VideoCaptureDevice::Names physical_video_devices_;
diff --git a/content/browser/renderer_host/media/media_stream_manager.cc b/content/browser/renderer_host/media/media_stream_manager.cc index 6d1f005..7b75f93 100644 --- a/content/browser/renderer_host/media/media_stream_manager.cc +++ b/content/browser/renderer_host/media/media_stream_manager.cc
@@ -151,7 +151,7 @@ chromeos::CrasAudioHandler::Get()->GetAudioDevices(&devices); // Only enable if a hotword device exists. for (const chromeos::AudioDevice& device : devices) { - if (device.type == chromeos::AUDIO_TYPE_AOKR) { + if (device.type == chromeos::AUDIO_TYPE_HOTWORD) { DCHECK(device.is_input); *effects |= media::AudioParameters::HOTWORD; } @@ -1128,7 +1128,7 @@ // its task runner, and MediaStreamManager is deleted on the UI thread, // after the IO thread has been stopped. base::PostTaskAndReplyWithResult( - audio_manager_->GetTaskRunner().get(), FROM_HERE, + audio_manager_->GetTaskRunner(), FROM_HERE, base::Bind(&media::AudioManager::GetDefaultOutputStreamParameters, base::Unretained(audio_manager_)), base::Bind(&MediaStreamManager::PostRequestToUI, base::Unretained(this),
diff --git a/content/browser/renderer_host/media/media_stream_manager_unittest.cc b/content/browser/renderer_host/media/media_stream_manager_unittest.cc index ff2fada..6e7bec31 100644 --- a/content/browser/renderer_host/media/media_stream_manager_unittest.cc +++ b/content/browser/renderer_host/media/media_stream_manager_unittest.cc
@@ -11,7 +11,6 @@ #include "base/location.h" #include "base/macros.h" #include "base/run_loop.h" -#include "base/single_thread_task_runner.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" #include "base/thread_task_runner_handle.h" @@ -72,7 +71,9 @@ class MockAudioManager : public AudioManagerPlatform { public: MockAudioManager() - : AudioManagerPlatform(&fake_audio_log_factory_), + : AudioManagerPlatform(base::ThreadTaskRunnerHandle::Get(), + base::ThreadTaskRunnerHandle::Get(), + &fake_audio_log_factory_), num_output_devices_(2) {} ~MockAudioManager() override {} @@ -176,21 +177,21 @@ class MediaStreamManagerTest : public ::testing::Test { public: MediaStreamManagerTest() - : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP), - task_runner_(base::ThreadTaskRunnerHandle::Get()) { + : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP) { audio_manager_.reset(new MockAudioManager()); media_stream_manager_.reset(new MediaStreamManager(audio_manager_.get())); -} - - virtual ~MediaStreamManagerTest() { + base::RunLoop().RunUntilIdle(); } + ~MediaStreamManagerTest() override {} + MOCK_METHOD1(Response, void(int index)); void ResponseCallback(int index, const MediaStreamDevices& devices, std::unique_ptr<MediaStreamUIProxy> ui_proxy) { Response(index); - task_runner_->PostTask(FROM_HERE, run_loop_.QuitClosure()); + base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, + run_loop_.QuitClosure()); } protected: @@ -208,10 +209,12 @@ security_origin, callback); } - std::unique_ptr<MockAudioManager> audio_manager_; + // media_stream_manager_ needs to outlive thread_bundle_ because it is a + // MessageLoop::DestructionObserver. audio_manager_ needs to outlive + // thread_bundle_ because it uses the underlying message loop. std::unique_ptr<MediaStreamManager> media_stream_manager_; content::TestBrowserThreadBundle thread_bundle_; - scoped_refptr<base::SingleThreadTaskRunner> task_runner_; + std::unique_ptr<MockAudioManager, media::AudioManagerDeleter> audio_manager_; base::RunLoop run_loop_; private: @@ -231,7 +234,6 @@ // No callback is expected. media_stream_manager_->CancelRequest(label); run_loop_.RunUntilIdle(); - media_stream_manager_->WillDestroyCurrentMessageLoop(); } TEST_F(MediaStreamManagerTest, MakeMultipleRequests) {
diff --git a/content/browser/renderer_host/media/video_capture_host_unittest.cc b/content/browser/renderer_host/media/video_capture_host_unittest.cc index 933c58d..a5f56706 100644 --- a/content/browser/renderer_host/media/video_capture_host_unittest.cc +++ b/content/browser/renderer_host/media/video_capture_host_unittest.cc
@@ -274,7 +274,7 @@ #endif // Create our own MediaStreamManager. - audio_manager_.reset(media::AudioManager::CreateForTesting()); + audio_manager_ = media::AudioManager::CreateForTesting(task_runner_); #ifndef TEST_REAL_CAPTURE_DEVICE base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kUseFakeDeviceForMediaStream); @@ -483,10 +483,13 @@ scoped_refptr<MockVideoCaptureHost> host_; private: + // media_stream_manager_ needs to outlive thread_bundle_ because it is a + // MessageLoop::DestructionObserver. audio_manager_ needs to outlive + // thread_bundle_ because it uses the underlying message loop. StrictMock<MockMediaStreamRequester> stream_requester_; - std::unique_ptr<media::AudioManager> audio_manager_; std::unique_ptr<MediaStreamManager> media_stream_manager_; content::TestBrowserThreadBundle thread_bundle_; + media::ScopedAudioManagerPtr audio_manager_; content::TestBrowserContext browser_context_; content::TestContentBrowserClient browser_client_; scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
diff --git a/content/browser/renderer_host/pepper/pepper_print_settings_manager.cc b/content/browser/renderer_host/pepper/pepper_print_settings_manager.cc index a264e5f0..8e2d7fa 100644 --- a/content/browser/renderer_host/pepper/pepper_print_settings_manager.cc +++ b/content/browser/renderer_host/pepper/pepper_print_settings_manager.cc
@@ -8,8 +8,11 @@ #include "content/public/browser/content_browser_client.h" #include "content/public/common/content_client.h" #include "ppapi/c/pp_errors.h" -#include "printing/printing_context.h" -#include "printing/units.h" + +#if defined(ENABLE_PRINT_PREVIEW) +#include "printing/printing_context.h" // nogncheck +#include "printing/units.h" // nogncheck +#endif namespace content {
diff --git a/content/browser/renderer_host/render_message_filter.cc b/content/browser/renderer_host/render_message_filter.cc index 4be8b4b..4c06ff0 100644 --- a/content/browser/renderer_host/render_message_filter.cc +++ b/content/browser/renderer_host/render_message_filter.cc
@@ -247,7 +247,7 @@ #endif // Always query audio device parameters on the audio thread. if (message.type() == ViewHostMsg_GetAudioHardwareConfig::ID) - return audio_manager_->GetTaskRunner().get(); + return audio_manager_->GetTaskRunner(); return NULL; }
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc index 4a8c291..f272f265 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -197,7 +197,7 @@ #include "content/common/font_cache_dispatcher_win.h" #include "content/common/sandbox_win.h" #include "sandbox/win/src/sandbox_policy.h" -#include "ui/gfx/win/dpi.h" +#include "ui/display/win/dpi.h" #endif #if defined(OS_MACOSX) @@ -1368,8 +1368,9 @@ command_line->AppendSwitch(switches::kEnablePinch); #if defined(OS_WIN) - command_line->AppendSwitchASCII(switches::kDeviceScaleFactor, - base::DoubleToString(gfx::GetDPIScale())); + command_line->AppendSwitchASCII( + switches::kDeviceScaleFactor, + base::DoubleToString(display::win::GetDPIScale())); #endif AppendCompositorCommandLineFlags(command_line); @@ -1460,7 +1461,6 @@ switches::kEnableLogging, switches::kEnableMemoryBenchmarking, switches::kEnableNetworkInformation, - switches::kEnableNotificationActionIcons, switches::kEnableOverlayScrollbar, switches::kEnablePinch, switches::kEnablePluginPlaceholderTesting,
diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc index 13b66f4..6896481 100644 --- a/content/browser/renderer_host/render_view_host_impl.cc +++ b/content/browser/renderer_host/render_view_host_impl.cc
@@ -91,8 +91,8 @@ #if defined(OS_WIN) #include "base/win/win_util.h" +#include "ui/display/win/dpi.h" #include "ui/gfx/platform_font_win.h" -#include "ui/gfx/win/dpi.h" #endif using base::TimeDelta; @@ -154,13 +154,13 @@ metrics.lfMessageFont); prefs->vertical_scroll_bar_width_in_dips = - gfx::win::GetSystemMetricsInDIP(SM_CXVSCROLL); + display::win::GetSystemMetricsInDIP(SM_CXVSCROLL); prefs->horizontal_scroll_bar_height_in_dips = - gfx::win::GetSystemMetricsInDIP(SM_CYHSCROLL); + display::win::GetSystemMetricsInDIP(SM_CYHSCROLL); prefs->arrow_bitmap_height_vertical_scroll_bar_in_dips = - gfx::win::GetSystemMetricsInDIP(SM_CYVSCROLL); + display::win::GetSystemMetricsInDIP(SM_CYVSCROLL); prefs->arrow_bitmap_width_horizontal_scroll_bar_in_dips = - gfx::win::GetSystemMetricsInDIP(SM_CXHSCROLL); + display::win::GetSystemMetricsInDIP(SM_CXHSCROLL); } #endif
diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h index 590536e..1a5f782a 100644 --- a/content/browser/renderer_host/render_widget_host_impl.h +++ b/content/browser/renderer_host/render_widget_host_impl.h
@@ -43,8 +43,8 @@ #include "ui/base/ime/text_input_mode.h" #include "ui/base/ime/text_input_type.h" #include "ui/events/gesture_detection/gesture_provider_config_helper.h" +#include "ui/events/latency_info.h" #include "ui/gfx/native_widget_types.h" -#include "ui/latency_info/latency_info.h" struct FrameHostMsg_HittestData_Params; struct ViewHostMsg_SelectionBounds_Params;
diff --git a/content/browser/renderer_host/render_widget_host_unittest.cc b/content/browser/renderer_host/render_widget_host_unittest.cc index 2fd0ea5..3d4df7f4 100644 --- a/content/browser/renderer_host/render_widget_host_unittest.cc +++ b/content/browser/renderer_host/render_widget_host_unittest.cc
@@ -1523,24 +1523,24 @@ EXPECT_TRUE(host_->mock_input_router()->message_received_); } -ui::LatencyInfo GetLatencyInfoFromInputEvent(RenderWidgetHostProcess* process) { - const IPC::Message* message = process->sink().GetUniqueMessageMatching( - InputMsg_HandleInputEvent::ID); - EXPECT_TRUE(message); - InputMsg_HandleInputEvent::Param params; - EXPECT_TRUE(InputMsg_HandleInputEvent::Read(message, ¶ms)); - process->sink().ClearMessages(); - return base::get<1>(params); -} - void CheckLatencyInfoComponentInMessage(RenderWidgetHostProcess* process, int64_t component_id, - WebInputEvent::Type input_type) { - ui::LatencyInfo latency_info = GetLatencyInfoFromInputEvent(process); + WebInputEvent::Type expected_type) { + EXPECT_EQ(process->sink().message_count(), 1U); + + const IPC::Message* message = process->sink().GetMessageAt(0); + EXPECT_EQ(InputMsg_HandleInputEvent::ID, message->type()); + InputMsg_HandleInputEvent::Param params; + EXPECT_TRUE(InputMsg_HandleInputEvent::Read(message, ¶ms)); + + const WebInputEvent* event = base::get<0>(params); + ui::LatencyInfo latency_info = base::get<1>(params); + + EXPECT_TRUE(event->type == expected_type); EXPECT_TRUE(latency_info.FindLatency( - ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, - component_id, - NULL)); + ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, component_id, NULL)); + + process->sink().ClearMessages(); } // Tests that after input event passes through RWHI through ForwardXXXEvent()
diff --git a/content/browser/renderer_host/render_widget_host_view_android.cc b/content/browser/renderer_host/render_widget_host_view_android.cc index ae5b05b1..d8a3a745 100644 --- a/content/browser/renderer_host/render_widget_host_view_android.cc +++ b/content/browser/renderer_host/render_widget_host_view_android.cc
@@ -190,7 +190,7 @@ gpu::kNullSurfaceHandle, // offscreen url, gpu_channel_host.get(), attributes, gfx::PreferIntegratedGpu, share_resources, automatic_flushes, limits, nullptr)); - provider_ = ContextProviderCommandBuffer::Create( + provider_ = new ContextProviderCommandBuffer( std::move(context), BROWSER_OFFSCREEN_MAINTHREAD_CONTEXT); if (!provider_->BindToCurrentThread()) return;
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc index 1661d36..1c653b8 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -1170,6 +1170,10 @@ if (!host) return; + // The TouchScrollStarted event is generated & consumed downstream from the + // TouchEventQueue. So we don't expect an ACK up here. + DCHECK(touch.event.type != blink::WebInputEvent::TouchScrollStarted); + ui::EventResult result = (ack_result == INPUT_EVENT_ACK_STATE_CONSUMED) ? ui::ER_HANDLED : ui::ER_UNHANDLED;
diff --git a/content/browser/renderer_host/render_widget_host_view_base.cc b/content/browser/renderer_host/render_widget_host_view_base.cc index c55aaec..cf28db2d 100644 --- a/content/browser/renderer_host/render_widget_host_view_base.cc +++ b/content/browser/renderer_host/render_widget_host_view_base.cc
@@ -206,7 +206,7 @@ if (GetRenderWidgetHost()) impl = RenderWidgetHostImpl::From(GetRenderWidgetHost()); - if (impl) + if (impl && impl->delegate()) impl->delegate()->SendScreenRects(); if (HasDisplayPropertyChanged(view) && impl)
diff --git a/content/browser/renderer_host/render_widget_host_view_browsertest.cc b/content/browser/renderer_host/render_widget_host_view_browsertest.cc index 476e7da..70f84e1 100644 --- a/content/browser/renderer_host/render_widget_host_view_browsertest.cc +++ b/content/browser/renderer_host/render_widget_host_view_browsertest.cc
@@ -43,7 +43,6 @@ #if defined(OS_WIN) #include "base/win/windows_version.h" -#include "ui/gfx/win/dpi.h" #endif namespace content {
diff --git a/content/browser/service_worker/service_worker_disk_cache.cc b/content/browser/service_worker/service_worker_disk_cache.cc index f398e61b..a094447 100644 --- a/content/browser/service_worker/service_worker_disk_cache.cc +++ b/content/browser/service_worker/service_worker_disk_cache.cc
@@ -12,16 +12,16 @@ ServiceWorkerResponseReader::ServiceWorkerResponseReader( int64_t resource_id, const base::WeakPtr<AppCacheDiskCacheInterface>& disk_cache) - : AppCacheResponseReader(resource_id, 0, disk_cache) {} + : AppCacheResponseReader(resource_id, disk_cache) {} ServiceWorkerResponseWriter::ServiceWorkerResponseWriter( int64_t resource_id, const base::WeakPtr<AppCacheDiskCacheInterface>& disk_cache) - : AppCacheResponseWriter(resource_id, 0, disk_cache) {} + : AppCacheResponseWriter(resource_id, disk_cache) {} ServiceWorkerResponseMetadataWriter::ServiceWorkerResponseMetadataWriter( int64_t resource_id, const base::WeakPtr<AppCacheDiskCacheInterface>& disk_cache) - : AppCacheResponseMetadataWriter(resource_id, 0, disk_cache) {} + : AppCacheResponseMetadataWriter(resource_id, disk_cache) {} } // namespace content
diff --git a/content/browser/service_worker/service_worker_dispatcher_host.cc b/content/browser/service_worker/service_worker_dispatcher_host.cc index e8d7039a..d749e4a 100644 --- a/content/browser/service_worker/service_worker_dispatcher_host.cc +++ b/content/browser/service_worker/service_worker_dispatcher_host.cc
@@ -172,8 +172,6 @@ OnProviderDestroyed) IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_SetVersionId, OnSetHostedVersionId) - IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_DeprecatedPostMessageToWorker, - OnDeprecatedPostMessageToWorker) IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_PostMessageToWorker, OnPostMessageToWorker) IPC_MESSAGE_HANDLER(EmbeddedWorkerHostMsg_WorkerReadyForInspection, @@ -744,26 +742,6 @@ } } -void ServiceWorkerDispatcherHost::OnDeprecatedPostMessageToWorker( - int handle_id, - const base::string16& message, - const std::vector<TransferredMessagePort>& sent_message_ports) { - TRACE_EVENT0("ServiceWorker", - "ServiceWorkerDispatcherHost::OnDeprecatedPostMessageToWorker"); - if (!GetContext()) - return; - - ServiceWorkerHandle* handle = handles_.Lookup(handle_id); - if (!handle) { - bad_message::ReceivedBadMessage(this, bad_message::SWDH_POST_MESSAGE); - return; - } - - handle->version()->DispatchMessageEvent( - message, sent_message_ports, - base::Bind(&ServiceWorkerUtils::NoOpStatusCallback)); -} - void ServiceWorkerDispatcherHost::OnProviderCreated( int provider_id, int route_id,
diff --git a/content/browser/service_worker/service_worker_dispatcher_host.h b/content/browser/service_worker/service_worker_dispatcher_host.h index b7f9ed19..35604ba 100644 --- a/content/browser/service_worker/service_worker_dispatcher_host.h +++ b/content/browser/service_worker/service_worker_dispatcher_host.h
@@ -148,13 +148,6 @@ const url::Origin& source_origin, const std::vector<TransferredMessagePort>& sent_message_ports); - // TODO(nhiroki): Remove this after ExtendableMessageEvent is enabled by - // default (crbug.com/543198). - void OnDeprecatedPostMessageToWorker( - int handle_id, - const base::string16& message, - const std::vector<TransferredMessagePort>& sent_message_ports); - void OnTerminateWorker(int handle_id); void DispatchExtendableMessageEvent(
diff --git a/content/browser/service_worker/service_worker_metrics.cc b/content/browser/service_worker/service_worker_metrics.cc index f8cc4daa..c46eafb 100644 --- a/content/browser/service_worker/service_worker_metrics.cc +++ b/content/browser/service_worker/service_worker_metrics.cc
@@ -327,8 +327,8 @@ UMA_HISTOGRAM_MEDIUM_TIMES("ServiceWorker.PushEvent.Time", time); break; case EventType::MESSAGE: - // TODO(nhiroki): Record event duration for Message event after - // ExtendableMessageEvent is enabled by default (crbug.com/543198). + UMA_HISTOGRAM_MEDIUM_TIMES("ServiceWorker.ExtendableMessageEvent.Time", + time); break; // For now event duration for these events is not recorded.
diff --git a/content/browser/service_worker/service_worker_version.cc b/content/browser/service_worker/service_worker_version.cc index 92f6e10..1b899725 100644 --- a/content/browser/service_worker/service_worker_version.cc +++ b/content/browser/service_worker/service_worker_version.cc
@@ -114,17 +114,6 @@ task.Run(); } -void RunErrorMessageCallback( - const std::vector<TransferredMessagePort>& sent_message_ports, - const ServiceWorkerVersion::StatusCallback& callback, - ServiceWorkerStatusCode status) { - // Transfering the message ports failed, so destroy the ports. - for (const TransferredMessagePort& port : sent_message_ports) { - MessagePortService::GetInstance()->ClosePort(port.id); - } - callback.Run(status); -} - void KillEmbeddedWorkerProcess(int process_id, ResultCode code) { DCHECK_CURRENTLY_ON(BrowserThread::UI); RenderProcessHost* render_process_host = @@ -561,48 +550,6 @@ error_callback, task)); } -void ServiceWorkerVersion::DispatchMessageEvent( - const base::string16& message, - const std::vector<TransferredMessagePort>& sent_message_ports, - const StatusCallback& callback) { - for (const TransferredMessagePort& port : sent_message_ports) { - MessagePortService::GetInstance()->HoldMessages(port.id); - } - - DispatchMessageEventInternal(message, sent_message_ports, callback); -} - -void ServiceWorkerVersion::DispatchMessageEventInternal( - const base::string16& message, - const std::vector<TransferredMessagePort>& sent_message_ports, - const StatusCallback& callback) { - OnBeginEvent(); - if (running_status() != RUNNING) { - // Schedule calling this method after starting the worker. - StartWorker(ServiceWorkerMetrics::EventType::MESSAGE, - base::Bind(&RunTaskAfterStartWorker, weak_factory_.GetWeakPtr(), - base::Bind(&RunErrorMessageCallback, - sent_message_ports, callback), - base::Bind(&self::DispatchMessageEventInternal, - weak_factory_.GetWeakPtr(), message, - sent_message_ports, callback))); - return; - } - - // TODO(kinuko): Cleanup this (and corresponding unit test) when message - // event becomes extendable, round-trip event. (crbug.com/498596) - RestartTick(&idle_time_); - - MessagePortMessageFilter* filter = - embedded_worker_->message_port_message_filter(); - std::vector<int> new_routing_ids; - filter->UpdateMessagePortsWithNewRoutes(sent_message_ports, &new_routing_ids); - ServiceWorkerStatusCode status = - embedded_worker_->SendMessage(ServiceWorkerMsg_MessageToWorker( - message, sent_message_ports, new_routing_ids)); - RunSoon(base::Bind(callback, status)); -} - void ServiceWorkerVersion::AddControllee( ServiceWorkerProviderHost* provider_host) { const std::string& uuid = provider_host->client_uuid();
diff --git a/content/browser/service_worker/service_worker_version.h b/content/browser/service_worker/service_worker_version.h index 925380d..214cd58 100644 --- a/content/browser/service_worker/service_worker_version.h +++ b/content/browser/service_worker/service_worker_version.h
@@ -246,14 +246,6 @@ template <typename ResponseMessage> void DispatchSimpleEvent(int request_id, const IPC::Message& message); - // Sends a message event to the associated embedded worker. - // TODO(nhiroki): Remove this after ExtendableMessageEvent is enabled by - // default (crbug.com/543198). - void DispatchMessageEvent( - const base::string16& message, - const std::vector<TransferredMessagePort>& sent_message_ports, - const StatusCallback& callback); - // Adds and removes |provider_host| as a controllee of this ServiceWorker. // A potential controllee is a host having the version as its .installing // or .waiting version. @@ -495,11 +487,6 @@ void OnStartSentAndScriptEvaluated(ServiceWorkerStatusCode status); - void DispatchMessageEventInternal( - const base::string16& message, - const std::vector<TransferredMessagePort>& sent_message_ports, - const StatusCallback& callback); - // Message handlers. // This corresponds to the spec's get(id) steps.
diff --git a/content/browser/service_worker/service_worker_version_unittest.cc b/content/browser/service_worker/service_worker_version_unittest.cc index 8ffa18ee..000eb26 100644 --- a/content/browser/service_worker/service_worker_version_unittest.cc +++ b/content/browser/service_worker/service_worker_version_unittest.cc
@@ -9,7 +9,6 @@ #include "base/macros.h" #include "base/memory/ptr_util.h" #include "base/run_loop.h" -#include "content/browser/message_port_service.h" #include "content/browser/service_worker/embedded_worker_registry.h" #include "content/browser/service_worker/embedded_worker_test_helper.h" #include "content/browser/service_worker/service_worker_context_core.h" @@ -150,15 +149,6 @@ DISALLOW_COPY_AND_ASSIGN(MessageReceiverFromWorker); }; -void SetUpDummyMessagePort(std::vector<TransferredMessagePort>* ports) { - int port_id = -1; - MessagePortService::GetInstance()->Create(MSG_ROUTING_NONE, nullptr, - &port_id); - TransferredMessagePort dummy_port; - dummy_port.id = port_id; - ports->push_back(dummy_port); -} - base::Time GetYesterday() { return base::Time::Now() - base::TimeDelta::FromDays(1) - base::TimeDelta::FromSeconds(1); @@ -652,20 +642,6 @@ EXPECT_EQ(SERVICE_WORKER_OK, status); EXPECT_LT(idle_time, version_->idle_time_); - - // Dispatching a message event resets the idle time. - std::vector<TransferredMessagePort> ports; - SetUpDummyMessagePort(&ports); - status = SERVICE_WORKER_ERROR_FAILED; - version_->idle_time_ -= kOneSecond; - idle_time = version_->idle_time_; - version_->DispatchMessageEvent(base::string16(), ports, - CreateReceiverOnCurrentThread(&status)); - base::RunLoop().RunUntilIdle(); - MessagePortService::GetInstance()->Destroy(ports[0].id); - - EXPECT_EQ(SERVICE_WORKER_OK, status); - EXPECT_LT(idle_time, version_->idle_time_); } TEST_F(ServiceWorkerVersionTest, SetDevToolsAttached) {
diff --git a/content/browser/speech/speech_recognizer_impl_unittest.cc b/content/browser/speech/speech_recognizer_impl_unittest.cc index 38f66d1..1675e2e6 100644 --- a/content/browser/speech/speech_recognizer_impl_unittest.cc +++ b/content/browser/speech/speech_recognizer_impl_unittest.cc
@@ -8,11 +8,11 @@ #include <vector> #include "base/sys_byteorder.h" -#include "content/browser/browser_thread_impl.h" #include "content/browser/speech/proto/google_streaming_api.pb.h" #include "content/browser/speech/speech_recognition_engine.h" #include "content/browser/speech/speech_recognizer_impl.h" #include "content/public/browser/speech_recognition_event_listener.h" +#include "content/public/test/test_browser_thread_bundle.h" #include "media/audio/audio_manager_base.h" #include "media/audio/fake_audio_input_stream.h" #include "media/audio/fake_audio_output_stream.h" @@ -26,7 +26,6 @@ using media::AudioInputController; using media::AudioInputStream; -using media::AudioManager; using media::AudioOutputStream; using media::AudioParameters; using media::TestAudioInputController; @@ -38,8 +37,7 @@ public testing::Test { public: SpeechRecognizerImplTest() - : io_thread_(BrowserThread::IO, &message_loop_), - recognition_started_(false), + : recognition_started_(false), recognition_ended_(false), result_received_(false), audio_started_(false), @@ -184,10 +182,9 @@ } protected: - base::MessageLoopForIO message_loop_; - BrowserThreadImpl io_thread_; + TestBrowserThreadBundle thread_bundle_; scoped_refptr<SpeechRecognizerImpl> recognizer_; - std::unique_ptr<AudioManager> audio_manager_; + media::ScopedAudioManagerPtr audio_manager_; bool recognition_started_; bool recognition_ended_; bool result_received_;
diff --git a/content/child/blink_platform_impl.cc b/content/child/blink_platform_impl.cc index fb220183a..0fa5112 100644 --- a/content/child/blink_platform_impl.cc +++ b/content/child/blink_platform_impl.cc
@@ -875,7 +875,6 @@ return NotificationManager::ThreadSpecificInstance( thread_safe_sender_.get(), - main_thread_task_runner_.get(), notification_dispatcher_.get()); }
diff --git a/content/child/child_gpu_memory_buffer_manager.cc b/content/child/child_gpu_memory_buffer_manager.cc index c636b508..36235ab 100644 --- a/content/child/child_gpu_memory_buffer_manager.cc +++ b/content/child/child_gpu_memory_buffer_manager.cc
@@ -4,6 +4,7 @@ #include "content/child/child_gpu_memory_buffer_manager.h" +#include <memory> #include <utility> #include "content/common/child_process_messages.h"
diff --git a/content/child/child_gpu_memory_buffer_manager.h b/content/child/child_gpu_memory_buffer_manager.h index 97801f3a..797aedb 100644 --- a/content/child/child_gpu_memory_buffer_manager.h +++ b/content/child/child_gpu_memory_buffer_manager.h
@@ -5,6 +5,8 @@ #ifndef CONTENT_CHILD_CHILD_GPU_MEMORY_BUFFER_MANAGER_H_ #define CONTENT_CHILD_CHILD_GPU_MEMORY_BUFFER_MANAGER_H_ +#include <memory> + #include "base/macros.h" #include "content/child/thread_safe_sender.h" #include "gpu/command_buffer/client/gpu_memory_buffer_manager.h"
diff --git a/content/child/dwrite_font_proxy/dwrite_font_proxy_init_win.cc b/content/child/dwrite_font_proxy/dwrite_font_proxy_init_win.cc index 58d1055..e7a2f2a 100644 --- a/content/child/dwrite_font_proxy/dwrite_font_proxy_init_win.cc +++ b/content/child/dwrite_font_proxy/dwrite_font_proxy_init_win.cc
@@ -12,6 +12,7 @@ #include "base/win/iat_patch_function.h" #include "base/win/windows_version.h" #include "content/child/dwrite_font_proxy/dwrite_font_proxy_win.h" +#include "content/child/dwrite_font_proxy/font_fallback_win.h" #include "content/child/font_warmup_win.h" #include "skia/ext/fontmgr_default_win.h" #include "third_party/WebKit/public/web/win/WebFontRendering.h" @@ -71,8 +72,15 @@ &g_font_collection, factory.Get(), g_sender_override); } - sk_sp<SkFontMgr> skia_font_manager( - SkFontMgr_New_DirectWrite(factory.Get(), g_font_collection.Get())); + mswr::ComPtr<IDWriteFontFallback> font_fallback; + mswr::ComPtr<IDWriteFactory2> factory2; + if (SUCCEEDED(factory.As(&factory2)) && factory2.Get()) { + mswr::MakeAndInitialize<FontFallback>( + &font_fallback, g_font_collection.Get(), g_sender_override); + } + + sk_sp<SkFontMgr> skia_font_manager(SkFontMgr_New_DirectWrite( + factory.Get(), g_font_collection.Get(), font_fallback.Get())); blink::WebFontRendering::setSkiaFontManager(skia_font_manager.get()); // Add an extra ref for SetDefaultSkiaFactory, which keeps a ref but doesn't
diff --git a/content/child/dwrite_font_proxy/dwrite_font_proxy_win.cc b/content/child/dwrite_font_proxy/dwrite_font_proxy_win.cc index e81203c..b2acd70 100644 --- a/content/child/dwrite_font_proxy/dwrite_font_proxy_win.cc +++ b/content/child/dwrite_font_proxy/dwrite_font_proxy_win.cc
@@ -245,6 +245,22 @@ return SUCCEEDED(hr); } +bool DWriteFontCollectionProxy::GetFontFamily(UINT32 family_index, + const base::string16& family_name, + IDWriteFontFamily** font_family) { + DCHECK(font_family); + DCHECK(!family_name.empty()); + if (!CreateFamily(family_index)) + return false; + + mswr::ComPtr<DWriteFontFamilyProxy>& family = families_[family_index]; + if (!family->IsLoaded() || family->GetName().empty()) + family->SetName(family_name); + + family.CopyTo(font_family); + return true; +} + bool DWriteFontCollectionProxy::LoadFamilyNames( UINT32 family_index, IDWriteLocalizedStrings** localized_strings) { @@ -404,6 +420,10 @@ family_name_.assign(family_name); } +const base::string16& DWriteFontFamilyProxy::GetName() { + return family_name_; +} + bool DWriteFontFamilyProxy::IsLoaded() { return family_ != nullptr; }
diff --git a/content/child/dwrite_font_proxy/dwrite_font_proxy_win.h b/content/child/dwrite_font_proxy/dwrite_font_proxy_win.h index 63d1f54..81dab8c 100644 --- a/content/child/dwrite_font_proxy/dwrite_font_proxy_win.h +++ b/content/child/dwrite_font_proxy/dwrite_font_proxy_win.h
@@ -71,6 +71,12 @@ bool LoadFamily(UINT32 family_index, IDWriteFontCollection** containing_collection); + // Gets the family at the specified index with the expected name. This can be + // used to avoid an IPC call when both the index and family name are known. + bool GetFontFamily(UINT32 family_index, + const base::string16& family_name, + IDWriteFontFamily** font_family); + bool LoadFamilyNames(UINT32 family_index, IDWriteLocalizedStrings** strings); bool CreateFamily(UINT32 family_index); @@ -124,6 +130,8 @@ void SetName(const base::string16& family_name); + const base::string16& GetName(); + bool IsLoaded(); protected:
diff --git a/content/child/dwrite_font_proxy/font_fallback_win.cc b/content/child/dwrite_font_proxy/font_fallback_win.cc new file mode 100644 index 0000000..46588c7 --- /dev/null +++ b/content/child/dwrite_font_proxy/font_fallback_win.cc
@@ -0,0 +1,108 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "content/child/dwrite_font_proxy/font_fallback_win.h" + +#include "base/strings/string16.h" + +#include "content/child/dwrite_font_proxy/dwrite_font_proxy_win.h" +#include "content/common/dwrite_font_proxy_messages.h" +#include "content/public/child/child_thread.h" +#include "ipc/ipc_sender.h" + +namespace mswr = Microsoft::WRL; + +namespace content { + +FontFallback::FontFallback() = default; +FontFallback::~FontFallback() = default; + +HRESULT FontFallback::MapCharacters(IDWriteTextAnalysisSource* source, + UINT32 text_position, + UINT32 text_length, + IDWriteFontCollection* base_font_collection, + const wchar_t* base_family_name, + DWRITE_FONT_WEIGHT base_weight, + DWRITE_FONT_STYLE base_style, + DWRITE_FONT_STRETCH base_stretch, + UINT32* mapped_length, + IDWriteFont** mapped_font, + FLOAT* scale) { + *mapped_font = nullptr; + *mapped_length = 1; + *scale = 1.0; + + const WCHAR* text = nullptr; + UINT32 chunk_length = 0; + if (FAILED(source->GetTextAtPosition(text_position, &text, &chunk_length))) { + DCHECK(false); + return E_FAIL; + } + base::string16 text_chunk(text, chunk_length); + + const WCHAR* locale = nullptr; + // |locale_text_length| is actually the length of text with the locale, not + // the length of the locale string itself. + UINT32 locale_text_length = 0; + source->GetLocaleName(text_position /*textPosition*/, &locale_text_length, + &locale); + + if (locale == nullptr) + locale = L""; + + DWriteFontStyle style; + style.font_weight = base_weight; + style.font_slant = base_style; + style.font_stretch = base_stretch; + + MapCharactersResult result; + + IPC::Sender* sender = + sender_override_ ? sender_override_ : ChildThread::Get(); + if (!sender->Send(new DWriteFontProxyMsg_MapCharacters( + text_chunk, style, locale, source->GetParagraphReadingDirection(), + base_family_name ? base_family_name : L"", &result))) + return E_FAIL; + + *mapped_length = result.mapped_length; + *scale = result.scale; + + if (result.family_index == UINT32_MAX) + return S_OK; + + mswr::ComPtr<IDWriteFontFamily> family; + // It would be nice to find a way to determine at runtime if |collection_| is + // a proxy collection, or just a generic IDWriteFontCollection. Unfortunately + // I can't find a way to get QueryInterface to return the actual class when + // using mswr::RuntimeClass. If we could use QI, we can fallback on + // FindFontFamily if the proxy is not available. + if (!collection_->GetFontFamily(result.family_index, result.family_name, + &family)) { + DCHECK(false); + return E_FAIL; + } + + if (FAILED(family->GetFirstMatchingFont( + static_cast<DWRITE_FONT_WEIGHT>(result.font_style.font_weight), + static_cast<DWRITE_FONT_STRETCH>(result.font_style.font_stretch), + static_cast<DWRITE_FONT_STYLE>(result.font_style.font_slant), + mapped_font))) { + DCHECK(false); + return E_FAIL; + } + + DCHECK(*mapped_font); + + return S_OK; +} + +HRESULT STDMETHODCALLTYPE +FontFallback::RuntimeClassInitialize(DWriteFontCollectionProxy* collection, + IPC::Sender* sender_override) { + sender_override_ = sender_override; + collection_ = collection; + return S_OK; +} + +} // namespace content
diff --git a/content/child/dwrite_font_proxy/font_fallback_win.h b/content/child/dwrite_font_proxy/font_fallback_win.h new file mode 100644 index 0000000..925ebb0 --- /dev/null +++ b/content/child/dwrite_font_proxy/font_fallback_win.h
@@ -0,0 +1,56 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CONTENT_CHILD_DWRITE_FONT_PROXY_FONT_FALLBACK_WIN_H_ +#define CONTENT_CHILD_DWRITE_FONT_PROXY_FONT_FALLBACK_WIN_H_ + +#include <dwrite.h> +#include <dwrite_2.h> +#include <wrl.h> + +#include "content/child/dwrite_font_proxy/dwrite_font_proxy_win.h" +#include "content/common/content_export.h" +#include "ipc/ipc_sender.h" + +namespace content { + +// Implements an IDWriteFontFallback that uses IPC to proxy the fallback calls +// to the system fallback in the browser process. +class CONTENT_EXPORT FontFallback + : public Microsoft::WRL::RuntimeClass< + Microsoft::WRL::RuntimeClassFlags<Microsoft::WRL::ClassicCom>, + IDWriteFontFallback> { + public: + FontFallback(); + + HRESULT STDMETHODCALLTYPE + MapCharacters(IDWriteTextAnalysisSource* source, + UINT32 text_position, + UINT32 text_length, + IDWriteFontCollection* base_font_collection, + const wchar_t* base_family_name, + DWRITE_FONT_WEIGHT base_weight, + DWRITE_FONT_STYLE base_style, + DWRITE_FONT_STRETCH base_stretch, + UINT32* mapped_length, + IDWriteFont** mapped_font, + FLOAT* scale) override; + + HRESULT STDMETHODCALLTYPE + RuntimeClassInitialize(DWriteFontCollectionProxy* collection, + IPC::Sender* sender_override); + + protected: + ~FontFallback() override; + + private: + IPC::Sender* sender_override_; + Microsoft::WRL::ComPtr<DWriteFontCollectionProxy> collection_; + + DISALLOW_ASSIGN(FontFallback); +}; + +} // namespace content + +#endif // CONTENT_CHILD_DWRITE_FONT_PROXY_FONT_FALLBACK_WIN_H_
diff --git a/content/child/dwrite_font_proxy/font_fallback_win_unittest.cc b/content/child/dwrite_font_proxy/font_fallback_win_unittest.cc new file mode 100644 index 0000000..4a5cd4b0 --- /dev/null +++ b/content/child/dwrite_font_proxy/font_fallback_win_unittest.cc
@@ -0,0 +1,95 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "content/child/dwrite_font_proxy/font_fallback_win.h" + +#include <dwrite.h> +#include <shlobj.h> +#include <wrl.h> + +#include <vector> + +#include "base/memory/ref_counted.h" +#include "content/child/dwrite_font_proxy/dwrite_font_proxy_win.h" +#include "content/common/dwrite_text_analysis_source_win.h" +#include "content/test/dwrite_font_fake_sender_win.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace mswr = Microsoft::WRL; + +namespace content { + +namespace { + +class FontFallbackUnitTest : public testing::Test { + public: + FontFallbackUnitTest() { + CreateDWriteFactory(&factory_); + + factory_->CreateNumberSubstitution(DWRITE_NUMBER_SUBSTITUTION_METHOD_NONE, + L"en-us", true /* ignoreUserOverride */, + &number_substitution_); + + std::vector<base::char16> font_path; + font_path.resize(MAX_PATH); + SHGetSpecialFolderPath(nullptr /* hwndOwner - reserved */, font_path.data(), + CSIDL_FONTS, FALSE /* fCreate*/); + base::string16 arial_path; + arial_path.append(font_path.data()).append(L"\\arial.ttf"); + + fake_collection_ = new FakeFontCollection(); + fake_collection_->AddFont(L"Arial") + .AddFamilyName(L"en-us", L"Arial") + .AddFilePath(arial_path); + + mswr::MakeAndInitialize<DWriteFontCollectionProxy>( + &collection_, factory_.Get(), fake_collection_->GetSender()); + } + + void CreateDWriteFactory(IUnknown** factory) { + using DWriteCreateFactoryProc = decltype(DWriteCreateFactory)*; + HMODULE dwrite_dll = LoadLibraryW(L"dwrite.dll"); + if (!dwrite_dll) + return; + + DWriteCreateFactoryProc dwrite_create_factory_proc = + reinterpret_cast<DWriteCreateFactoryProc>( + GetProcAddress(dwrite_dll, "DWriteCreateFactory")); + if (!dwrite_create_factory_proc) + return; + + dwrite_create_factory_proc(DWRITE_FACTORY_TYPE_SHARED, + __uuidof(IDWriteFactory), factory); + } + + scoped_refptr<FakeFontCollection> fake_collection_; + mswr::ComPtr<IDWriteFactory> factory_; + mswr::ComPtr<DWriteFontCollectionProxy> collection_; + mswr::ComPtr<IDWriteNumberSubstitution> number_substitution_; +}; + +TEST_F(FontFallbackUnitTest, MapCharacters) { + mswr::ComPtr<FontFallback> fallback; + mswr::MakeAndInitialize<FontFallback>(&fallback, collection_.Get(), + fake_collection_->GetTrackingSender()); + + mswr::ComPtr<IDWriteFont> font; + UINT32 mapped_length = 0; + float scale = 0.0; + + mswr::ComPtr<TextAnalysisSource> text; + mswr::MakeAndInitialize<TextAnalysisSource>( + &text, L"hello", L"en-us", number_substitution_.Get(), + DWRITE_READING_DIRECTION_LEFT_TO_RIGHT); + fallback->MapCharacters(text.Get(), 0, 1, nullptr, nullptr, + DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, + DWRITE_FONT_STRETCH_NORMAL, &mapped_length, &font, + &scale); + + EXPECT_EQ(1u, mapped_length); // The fake sender only maps one character + EXPECT_NE(nullptr, font.Get()); +} + +} // namespace +} // namespace content
diff --git a/content/child/notifications/notification_dispatcher.cc b/content/child/notifications/notification_dispatcher.cc index cb2f1ca..f840b40e 100644 --- a/content/child/notifications/notification_dispatcher.cc +++ b/content/child/notifications/notification_dispatcher.cc
@@ -31,8 +31,7 @@ void NotificationDispatcher::OnFilteredMessageReceived( const IPC::Message& msg) { - NotificationManager::ThreadSpecificInstance(thread_safe_sender(), - main_thread_task_runner(), this) + NotificationManager::ThreadSpecificInstance(thread_safe_sender(), this) ->OnMessageReceived(msg); }
diff --git a/content/child/notifications/notification_image_loader.cc b/content/child/notifications/notification_image_loader.cc deleted file mode 100644 index 4ad37f8..0000000 --- a/content/child/notifications/notification_image_loader.cc +++ /dev/null
@@ -1,121 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "content/child/notifications/notification_image_loader.h" - -#include "base/bind.h" -#include "base/location.h" -#include "base/logging.h" -#include "base/metrics/histogram_macros.h" -#include "base/single_thread_task_runner.h" -#include "content/child/image_decoder.h" -#include "third_party/WebKit/public/platform/Platform.h" -#include "third_party/WebKit/public/platform/WebURL.h" -#include "third_party/WebKit/public/platform/WebURLLoader.h" -#include "third_party/WebKit/public/platform/WebURLRequest.h" -#include "third_party/skia/include/core/SkBitmap.h" - -using blink::WebURL; -using blink::WebURLError; -using blink::WebURLLoader; -using blink::WebURLRequest; - -namespace content { - -NotificationImageLoader::NotificationImageLoader( - const ImageLoadCompletedCallback& callback, - const scoped_refptr<base::SingleThreadTaskRunner>& worker_task_runner, - const scoped_refptr<base::SingleThreadTaskRunner>& main_task_runner) - : callback_(callback), - worker_task_runner_(worker_task_runner), - main_task_runner_(main_task_runner), - completed_(false) {} - -NotificationImageLoader::~NotificationImageLoader() { - DCHECK(main_task_runner_->BelongsToCurrentThread()); -} - -void NotificationImageLoader::StartOnMainThread(const GURL& image_url) { - DCHECK(main_task_runner_->BelongsToCurrentThread()); - DCHECK(!url_loader_); - - start_time_ = base::TimeTicks::Now(); - - WebURL image_web_url(image_url); - WebURLRequest request(image_web_url); - request.setRequestContext(WebURLRequest::RequestContextImage); - - url_loader_.reset(blink::Platform::current()->createURLLoader()); - url_loader_->loadAsynchronously(request, this); -} - -void NotificationImageLoader::didReceiveData(WebURLLoader* loader, - const char* data, - int data_length, - int encoded_data_length) { - DCHECK(!completed_); - DCHECK_GT(data_length, 0); - - buffer_.insert(buffer_.end(), data, data + data_length); -} - -void NotificationImageLoader::didFinishLoading( - WebURLLoader* loader, - double finish_time, - int64_t total_encoded_data_length) { - DCHECK(!completed_); - - UMA_HISTOGRAM_LONG_TIMES("Notifications.Icon.LoadFinishTime", - base::TimeTicks::Now() - start_time_); - - RunCallbackOnWorkerThread(); -} - -void NotificationImageLoader::didFail(WebURLLoader* loader, - const WebURLError& error) { - if (completed_) - return; - - UMA_HISTOGRAM_LONG_TIMES("Notifications.Icon.LoadFailTime", - base::TimeTicks::Now() - start_time_); - - RunCallbackOnWorkerThread(); -} - -void NotificationImageLoader::RunCallbackOnWorkerThread() { - url_loader_.reset(); - - completed_ = true; - SkBitmap icon = GetDecodedImage(); - - if (worker_task_runner_->BelongsToCurrentThread()) { - callback_.Run(icon); - } else { - worker_task_runner_->PostTask(FROM_HERE, base::Bind(callback_, icon)); - } -} - -SkBitmap NotificationImageLoader::GetDecodedImage() const { - DCHECK(completed_); - - UMA_HISTOGRAM_CUSTOM_COUNTS("Notifications.Icon.FileSize", buffer_.size(), 1, - 10000000 /* ~10mb */, 50); - - if (buffer_.empty()) - return SkBitmap(); - - ImageDecoder decoder; - return decoder.Decode(&buffer_[0], buffer_.size()); -} - -void NotificationImageLoader::DeleteOnCorrectThread() const { - if (!main_task_runner_->BelongsToCurrentThread()) { - main_task_runner_->DeleteSoon(FROM_HERE, this); - return; - } - - delete this; -} - -} // namespace content
diff --git a/content/child/notifications/notification_image_loader.h b/content/child/notifications/notification_image_loader.h deleted file mode 100644 index 96405f1..0000000 --- a/content/child/notifications/notification_image_loader.h +++ /dev/null
@@ -1,116 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CONTENT_CHILD_NOTIFICATIONS_NOTIFICATION_IMAGE_LOADER_H_ -#define CONTENT_CHILD_NOTIFICATIONS_NOTIFICATION_IMAGE_LOADER_H_ - -#include <stdint.h> - -#include <memory> -#include <vector> - -#include "base/callback.h" -#include "base/macros.h" -#include "base/memory/ref_counted.h" -#include "base/sequenced_task_runner_helpers.h" -#include "base/time/time.h" -#include "third_party/WebKit/public/platform/WebURLLoaderClient.h" - -class GURL; -class SkBitmap; - -namespace base { -class SingleThreadTaskRunner; -} - -namespace blink { -class WebURL; -struct WebURLError; -class WebURLLoader; -} - -namespace content { - -struct NotificationImageLoaderDeleter; - -// The |image| may be empty if the request failed or the image data could not be -// decoded. -using ImageLoadCompletedCallback = base::Callback<void(const SkBitmap& image)>; - -// Downloads the image associated with a notification and decodes the received -// image. This must be completed before notifications are shown to the user. -// Image downloaders must not be re-used for multiple notifications. -// -// All methods, except for the constructor, are expected to be used on the -// renderer main thread. -class NotificationImageLoader - : public blink::WebURLLoaderClient, - public base::RefCountedThreadSafe<NotificationImageLoader, - NotificationImageLoaderDeleter> { - public: - NotificationImageLoader( - const ImageLoadCompletedCallback& callback, - const scoped_refptr<base::SingleThreadTaskRunner>& worker_task_runner, - const scoped_refptr<base::SingleThreadTaskRunner>& main_task_runner); - - // Asynchronously starts loading |image_url| using a Blink WebURLLoader. Must - // only be called on the main thread. - void StartOnMainThread(const GURL& image_url); - - // blink::WebURLLoaderClient implementation. - void didReceiveData(blink::WebURLLoader* loader, - const char* data, - int data_length, - int encoded_data_length) override; - void didFinishLoading(blink::WebURLLoader* loader, - double finish_time, - int64_t total_encoded_data_length) override; - void didFail(blink::WebURLLoader* loader, - const blink::WebURLError& error) override; - - private: - friend class base::DeleteHelper<NotificationImageLoader>; - friend class base::RefCountedThreadSafe<NotificationImageLoader, - NotificationImageLoaderDeleter>; - friend struct NotificationImageLoaderDeleter; - - ~NotificationImageLoader() override; - - // Invokes the callback on the thread this image loader was started for. When - // the thread id is zero (the main document), it will be executed immediately. - // For all other threads a task will be posted to the appropriate task runner. - void RunCallbackOnWorkerThread(); - - // Returns a Skia bitmap, empty if buffer_ was empty or could not be decoded - // as an image, or a valid bitmap otherwise. - SkBitmap GetDecodedImage() const; - - // Ensures that we delete the image loader on the main thread. - void DeleteOnCorrectThread() const; - - ImageLoadCompletedCallback callback_; - - scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner_; - scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; - - bool completed_; - - std::unique_ptr<blink::WebURLLoader> url_loader_; - - std::vector<uint8_t> buffer_; - - base::TimeTicks start_time_; - - DISALLOW_COPY_AND_ASSIGN(NotificationImageLoader); -}; - -struct NotificationImageLoaderDeleter { - static void Destruct(const NotificationImageLoader* context) { - context->DeleteOnCorrectThread(); - } -}; - -} // namespace content - -#endif // CONTENT_CHILD_NOTIFICATIONS_NOTIFICATION_IMAGE_LOADER_H_
diff --git a/content/child/notifications/notification_manager.cc b/content/child/notifications/notification_manager.cc index 8961f7a..f769e7a 100644 --- a/content/child/notifications/notification_manager.cc +++ b/content/child/notifications/notification_manager.cc
@@ -9,21 +9,17 @@ #include "base/lazy_instance.h" #include "base/metrics/histogram_macros.h" #include "base/strings/utf_string_conversions.h" -#include "base/thread_task_runner_handle.h" #include "base/threading/thread_local.h" #include "content/child/notifications/notification_data_conversions.h" #include "content/child/notifications/notification_dispatcher.h" #include "content/child/service_worker/web_service_worker_registration_impl.h" #include "content/child/thread_safe_sender.h" -#include "content/common/notification_constants.h" #include "content/public/common/notification_resources.h" #include "content/public/common/platform_notification_data.h" #include "third_party/WebKit/public/platform/URLConversion.h" #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" #include "third_party/WebKit/public/platform/modules/notifications/WebNotificationDelegate.h" -using blink::WebNotificationPermission; - namespace content { namespace { @@ -31,18 +27,14 @@ return WorkerThread::GetCurrentId(); } -// Checks whether |notification_data| specifies any non-empty resources that -// need to be fetched. -bool HasResourcesToFetch(const blink::WebNotificationData& notification_data) { - if (!notification_data.icon.isEmpty()) - return true; - if (!notification_data.badge.isEmpty()) - return true; - for (const auto& action : notification_data.actions) { - if (!action.icon.isEmpty()) - return true; - } - return false; +NotificationResources ToNotificationResources( + std::unique_ptr<blink::WebNotificationResources> web_resources) { + NotificationResources resources; + resources.notification_icon = web_resources->icon; + resources.badge = web_resources->badge; + for (const auto& action_icon : web_resources->actionIcons) + resources.action_icons.push_back(action_icon); + return resources; } } // namespace @@ -52,11 +44,9 @@ NotificationManager::NotificationManager( ThreadSafeSender* thread_safe_sender, - base::SingleThreadTaskRunner* main_thread_task_runner, NotificationDispatcher* notification_dispatcher) : thread_safe_sender_(thread_safe_sender), - notification_dispatcher_(notification_dispatcher), - notifications_tracker_(main_thread_task_runner) { + notification_dispatcher_(notification_dispatcher) { g_notification_manager_tls.Pointer()->Set(this); } @@ -66,13 +56,12 @@ NotificationManager* NotificationManager::ThreadSpecificInstance( ThreadSafeSender* thread_safe_sender, - base::SingleThreadTaskRunner* main_thread_task_runner, NotificationDispatcher* notification_dispatcher) { if (g_notification_manager_tls.Pointer()->Get()) return g_notification_manager_tls.Pointer()->Get(); - NotificationManager* manager = new NotificationManager( - thread_safe_sender, main_thread_task_runner, notification_dispatcher); + NotificationManager* manager = + new NotificationManager(thread_safe_sender, notification_dispatcher); if (CurrentWorkerId()) WorkerThread::AddObserver(manager); return manager; @@ -85,28 +74,33 @@ void NotificationManager::show( const blink::WebSecurityOrigin& origin, const blink::WebNotificationData& notification_data, + std::unique_ptr<blink::WebNotificationResources> notification_resources, blink::WebNotificationDelegate* delegate) { DCHECK_EQ(0u, notification_data.actions.size()); + DCHECK_EQ(0u, notification_resources->actionIcons.size()); - if (!HasResourcesToFetch(notification_data)) { - DisplayPageNotification(origin, notification_data, delegate, - NotificationResources()); - return; - } + int notification_id = + notification_dispatcher_->GenerateNotificationId(CurrentWorkerId()); - notifications_tracker_.FetchResources( - notification_data, delegate, - base::Bind(&NotificationManager::DisplayPageNotification, - base::Unretained(this), // this owns |notifications_tracker_| - origin, notification_data, delegate)); + active_page_notifications_[notification_id] = delegate; + // TODO(mkwst): This is potentially doing the wrong thing with unique + // origins. Perhaps also 'file:', 'blob:' and 'filesystem:'. See + // https://crbug.com/490074 for detail. + thread_safe_sender_->Send(new PlatformNotificationHostMsg_Show( + notification_id, blink::WebStringToGURL(origin.toString()), + ToPlatformNotificationData(notification_data), + ToNotificationResources(std::move(notification_resources)))); } void NotificationManager::showPersistent( const blink::WebSecurityOrigin& origin, const blink::WebNotificationData& notification_data, + std::unique_ptr<blink::WebNotificationResources> notification_resources, blink::WebServiceWorkerRegistration* service_worker_registration, blink::WebNotificationShowCallbacks* callbacks) { DCHECK(service_worker_registration); + DCHECK_EQ(notification_data.actions.size(), + notification_resources->actionIcons.size()); int64_t service_worker_registration_id = static_cast<WebServiceWorkerRegistrationImpl*>( @@ -133,28 +127,22 @@ return; } - if (!HasResourcesToFetch(notification_data)) { - NotificationResources notification_resources; + // TODO(peter): GenerateNotificationId is more of a request id. Consider + // renaming the method in the NotificationDispatcher if this makes sense. + int request_id = + notification_dispatcher_->GenerateNotificationId(CurrentWorkerId()); - // Action indices are expected to have a corresponding icon bitmap, which - // may be empty when the developer provided no (or an invalid) icon. - if (!notification_data.actions.isEmpty()) { - notification_resources.action_icons.resize( - notification_data.actions.size()); - } + pending_show_notification_requests_.AddWithID(owned_callbacks.release(), + request_id); - DisplayPersistentNotification( - origin, notification_data, service_worker_registration_id, - std::move(owned_callbacks), notification_resources); - return; - } - - notifications_tracker_.FetchResources( - notification_data, nullptr /* delegate */, - base::Bind(&NotificationManager::DisplayPersistentNotification, - base::Unretained(this), // this owns |notifications_tracker_| - origin, notification_data, service_worker_registration_id, - base::Passed(&owned_callbacks))); + // TODO(mkwst): This is potentially doing the wrong thing with unique + // origins. Perhaps also 'file:', 'blob:' and 'filesystem:'. See + // https://crbug.com/490074 for detail. + thread_safe_sender_->Send(new PlatformNotificationHostMsg_ShowPersistent( + request_id, service_worker_registration_id, + blink::WebStringToGURL(origin.toString()), + ToPlatformNotificationData(notification_data), + ToNotificationResources(std::move(notification_resources)))); } void NotificationManager::getNotifications( @@ -185,9 +173,6 @@ } void NotificationManager::close(blink::WebNotificationDelegate* delegate) { - if (notifications_tracker_.CancelResourceFetches(delegate)) - return; - for (auto& iter : active_page_notifications_) { if (iter.second != delegate) continue; @@ -215,9 +200,6 @@ void NotificationManager::notifyDelegateDestroyed( blink::WebNotificationDelegate* delegate) { - if (notifications_tracker_.CancelResourceFetches(delegate)) - return; - for (auto& iter : active_page_notifications_) { if (iter.second != delegate) continue; @@ -227,21 +209,18 @@ } } -WebNotificationPermission NotificationManager::checkPermission( +blink::mojom::PermissionStatus NotificationManager::checkPermission( const blink::WebSecurityOrigin& origin) { - WebNotificationPermission permission = - blink::WebNotificationPermissionAllowed; + blink::mojom::PermissionStatus permission_status = + blink::mojom::PermissionStatus::DENIED; + // TODO(mkwst): This is potentially doing the wrong thing with unique // origins. Perhaps also 'file:', 'blob:' and 'filesystem:'. See // https://crbug.com/490074 for detail. thread_safe_sender_->Send(new PlatformNotificationHostMsg_CheckPermission( - blink::WebStringToGURL(origin.toString()), &permission)); + blink::WebStringToGURL(origin.toString()), &permission_status)); - return permission; -} - -size_t NotificationManager::maxActions() { - return kPlatformNotificationMaxActions; + return permission_status; } bool NotificationManager::OnMessageReceived(const IPC::Message& message) { @@ -327,50 +306,4 @@ pending_get_notification_requests_.Remove(request_id); } -void NotificationManager::DisplayPageNotification( - const blink::WebSecurityOrigin& origin, - const blink::WebNotificationData& notification_data, - blink::WebNotificationDelegate* delegate, - const NotificationResources& notification_resources) { - DCHECK_EQ(0u, notification_data.actions.size()); - DCHECK_EQ(0u, notification_resources.action_icons.size()); - - int notification_id = - notification_dispatcher_->GenerateNotificationId(CurrentWorkerId()); - - active_page_notifications_[notification_id] = delegate; - // TODO(mkwst): This is potentially doing the wrong thing with unique - // origins. Perhaps also 'file:', 'blob:' and 'filesystem:'. See - // https://crbug.com/490074 for detail. - thread_safe_sender_->Send(new PlatformNotificationHostMsg_Show( - notification_id, blink::WebStringToGURL(origin.toString()), - ToPlatformNotificationData(notification_data), notification_resources)); -} - -void NotificationManager::DisplayPersistentNotification( - const blink::WebSecurityOrigin& origin, - const blink::WebNotificationData& notification_data, - int64_t service_worker_registration_id, - std::unique_ptr<blink::WebNotificationShowCallbacks> callbacks, - const NotificationResources& notification_resources) { - DCHECK_EQ(notification_data.actions.size(), - notification_resources.action_icons.size()); - - // TODO(peter): GenerateNotificationId is more of a request id. Consider - // renaming the method in the NotificationDispatcher if this makes sense. - int request_id = - notification_dispatcher_->GenerateNotificationId(CurrentWorkerId()); - - pending_show_notification_requests_.AddWithID(callbacks.release(), - request_id); - - // TODO(mkwst): This is potentially doing the wrong thing with unique - // origins. Perhaps also 'file:', 'blob:' and 'filesystem:'. See - // https://crbug.com/490074 for detail. - thread_safe_sender_->Send(new PlatformNotificationHostMsg_ShowPersistent( - request_id, service_worker_registration_id, - blink::WebStringToGURL(origin.toString()), - ToPlatformNotificationData(notification_data), notification_resources)); -} - } // namespace content
diff --git a/content/child/notifications/notification_manager.h b/content/child/notifications/notification_manager.h index 0f383fa5..638fa4b 100644 --- a/content/child/notifications/notification_manager.h +++ b/content/child/notifications/notification_manager.h
@@ -9,15 +9,14 @@ #include <stdint.h> #include <map> +#include <memory> #include <set> #include <vector> #include "base/id_map.h" #include "base/macros.h" #include "base/memory/ref_counted.h" -#include "base/single_thread_task_runner.h" #include "content/child/notifications/notification_dispatcher.h" -#include "content/child/notifications/pending_notifications_tracker.h" #include "content/common/platform_notification_messages.h" #include "content/public/child/worker_thread.h" #include "third_party/WebKit/public/platform/modules/notifications/WebNotificationManager.h" @@ -37,19 +36,20 @@ // calling this leads to construction. static NotificationManager* ThreadSpecificInstance( ThreadSafeSender* thread_safe_sender, - base::SingleThreadTaskRunner* main_thread_task_runner, NotificationDispatcher* notification_dispatcher); // WorkerThread::Observer implementation. void WillStopCurrentWorkerThread() override; - // blink::WebNotificationManager implementation. - void show(const blink::WebSecurityOrigin& origin, - const blink::WebNotificationData& notification_data, - blink::WebNotificationDelegate* delegate) override; + void show( + const blink::WebSecurityOrigin& origin, + const blink::WebNotificationData& notification_data, + std::unique_ptr<blink::WebNotificationResources> notification_resources, + blink::WebNotificationDelegate* delegate) override; void showPersistent( const blink::WebSecurityOrigin& origin, const blink::WebNotificationData& notification_data, + std::unique_ptr<blink::WebNotificationResources> notification_resources, blink::WebServiceWorkerRegistration* service_worker_registration, blink::WebNotificationShowCallbacks* callbacks) override; void getNotifications( @@ -61,16 +61,14 @@ int64_t persistent_notification_id) override; void notifyDelegateDestroyed( blink::WebNotificationDelegate* delegate) override; - blink::WebNotificationPermission checkPermission( + blink::mojom::PermissionStatus checkPermission( const blink::WebSecurityOrigin& origin) override; - size_t maxActions() override; // Called by the NotificationDispatcher. bool OnMessageReceived(const IPC::Message& message); private: NotificationManager(ThreadSafeSender* thread_safe_sender, - base::SingleThreadTaskRunner* main_thread_task_runner, NotificationDispatcher* notification_dispatcher); // IPC message handlers. @@ -82,34 +80,9 @@ int request_id, const std::vector<PersistentNotificationInfo>& notification_infos); - // To be called when a page notification is ready to be displayed. Will - // inform the browser process about all available data. The |delegate|, - // owned by Blink, will be used to feed back events associated with the - // notification to the JavaScript object. - void DisplayPageNotification( - const blink::WebSecurityOrigin& origin, - const blink::WebNotificationData& notification_data, - blink::WebNotificationDelegate* delegate, - const NotificationResources& notification_resources); - - // To be called when a persistent notification is ready to be displayed. Will - // inform the browser process about all available data. The |callbacks| will - // be used to inform the Promise pending in Blink that the notification has - // been send to the browser process to be displayed. - void DisplayPersistentNotification( - const blink::WebSecurityOrigin& origin, - const blink::WebNotificationData& notification_data, - int64_t service_worker_registration_id, - std::unique_ptr<blink::WebNotificationShowCallbacks> callbacks, - const NotificationResources& notification_resources); - scoped_refptr<ThreadSafeSender> thread_safe_sender_; scoped_refptr<NotificationDispatcher> notification_dispatcher_; - // Tracker which stores all pending Notifications, both page and persistent - // ones, until all their associated resources have been fetched. - PendingNotificationsTracker notifications_tracker_; - // Tracks pending requests for getting a list of notifications. IDMap<blink::WebNotificationGetCallbacks, IDMapOwnPointer> pending_get_notification_requests_;
diff --git a/content/child/notifications/pending_notification.cc b/content/child/notifications/pending_notification.cc deleted file mode 100644 index c6365f8..0000000 --- a/content/child/notifications/pending_notification.cc +++ /dev/null
@@ -1,123 +0,0 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "content/child/notifications/pending_notification.h" - -#include <algorithm> - -#include "base/barrier_closure.h" -#include "base/bind.h" -#include "base/callback.h" -#include "base/location.h" -#include "base/metrics/histogram_macros.h" -#include "base/thread_task_runner_handle.h" -#include "content/common/notification_constants.h" -#include "content/public/common/notification_resources.h" -#include "skia/ext/image_operations.h" -#include "url/gurl.h" - -namespace content { - -namespace { - -// Scales down |icon| to fit within |max_size_px| if its width or height is -// larger than |max_size_px| and returns the result. Otherwise does nothing and -// returns |icon| unchanged. -SkBitmap ScaleDownIfNeeded(const SkBitmap& icon, int max_size_px) { - if (icon.width() > max_size_px || icon.height() > max_size_px) { - SCOPED_UMA_HISTOGRAM_TIMER("Notifications.Icon.ScaleDownTime"); - return skia::ImageOperations::Resize(icon, - skia::ImageOperations::RESIZE_BEST, - std::min(icon.width(), max_size_px), - std::min(icon.height(), max_size_px)); - } - return icon; -} - -} // namespace - -PendingNotification::PendingNotification( - const scoped_refptr<base::SingleThreadTaskRunner>& main_task_runner) - : main_task_runner_(main_task_runner), weak_factory_(this) {} - -PendingNotification::~PendingNotification() {} - -void PendingNotification::FetchResources( - const blink::WebNotificationData& notification_data, - const base::Closure& fetches_finished_callback) { - // TODO(mvanouwerkerk): Add a timeout mechanism: crbug.com/579137 - - size_t num_actions = notification_data.actions.size(); - action_icons_.resize(num_actions); - - size_t num_closures = 2 /* notification icon and badge */ + num_actions; - fetches_finished_barrier_closure_ = - base::BarrierClosure(num_closures, fetches_finished_callback); - - FetchImageResource(notification_data.icon, - base::Bind(&PendingNotification::DidFetchNotificationIcon, - weak_factory_.GetWeakPtr())); - FetchImageResource(notification_data.badge, - base::Bind(&PendingNotification::DidFetchBadge, - weak_factory_.GetWeakPtr())); - for (size_t i = 0; i < num_actions; i++) { - FetchImageResource(notification_data.actions[i].icon, - base::Bind(&PendingNotification::DidFetchActionIcon, - weak_factory_.GetWeakPtr(), i)); - } -} - -NotificationResources PendingNotification::GetResources() const { - NotificationResources resources; - resources.notification_icon = notification_icon_; - resources.badge = badge_; - resources.action_icons = action_icons_; - return resources; -} - -void PendingNotification::FetchImageResource( - const blink::WebURL& image_web_url, - const ImageLoadCompletedCallback& image_callback) { - if (image_web_url.isEmpty()) { - image_callback.Run(SkBitmap()); - return; - } - - // Explicitly convert the WebURL to a GURL before passing it to a different - // thread. This is important because WebURLs must not be passed between - // threads, and per base::Bind() semantics conversion would otherwise be done - // on the receiving thread. - GURL image_gurl(image_web_url); - - scoped_refptr<NotificationImageLoader> image_loader( - new NotificationImageLoader(image_callback, - base::ThreadTaskRunnerHandle::Get(), - main_task_runner_)); - image_loaders_.push_back(image_loader); - main_task_runner_->PostTask( - FROM_HERE, base::Bind(&NotificationImageLoader::StartOnMainThread, - image_loader, image_gurl)); -} - -void PendingNotification::DidFetchNotificationIcon(const SkBitmap& bitmap) { - notification_icon_ = - ScaleDownIfNeeded(bitmap, kPlatformNotificationMaxIconSizePx); - fetches_finished_barrier_closure_.Run(); -} - -void PendingNotification::DidFetchBadge(const SkBitmap& bitmap) { - badge_ = ScaleDownIfNeeded(bitmap, kPlatformNotificationMaxBadgeSizePx); - fetches_finished_barrier_closure_.Run(); -} - -void PendingNotification::DidFetchActionIcon(size_t action_index, - const SkBitmap& bitmap) { - DCHECK_LT(action_index, action_icons_.size()); - - action_icons_[action_index] = - ScaleDownIfNeeded(bitmap, kPlatformNotificationMaxActionIconSizePx); - fetches_finished_barrier_closure_.Run(); -} - -} // namespace content
diff --git a/content/child/notifications/pending_notification.h b/content/child/notifications/pending_notification.h deleted file mode 100644 index dc7036bf..0000000 --- a/content/child/notifications/pending_notification.h +++ /dev/null
@@ -1,78 +0,0 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CONTENT_CHILD_NOTIFICATIONS_PENDING_NOTIFICATION_H_ -#define CONTENT_CHILD_NOTIFICATIONS_PENDING_NOTIFICATION_H_ - -#include <vector> - -#include "base/callback_forward.h" -#include "base/macros.h" -#include "base/memory/ref_counted.h" -#include "base/memory/weak_ptr.h" -#include "content/child/notifications/notification_image_loader.h" -#include "third_party/WebKit/public/platform/WebURL.h" -#include "third_party/WebKit/public/platform/modules/notifications/WebNotificationData.h" -#include "third_party/skia/include/core/SkBitmap.h" - -namespace base { -class SingleThreadTaskRunner; -} - -namespace content { - -struct NotificationResources; - -// Stores the information associated with a pending notification, and fetches -// resources for it on the main thread. -class PendingNotification { - public: - explicit PendingNotification( - const scoped_refptr<base::SingleThreadTaskRunner>& main_task_runner); - ~PendingNotification(); - - // Fetches all resources asynchronously on the main thread. - void FetchResources(const blink::WebNotificationData& notification_data, - const base::Closure& fetches_finished_callback); - - // Returns a new NotificationResources populated with the resources that have - // been fetched. - NotificationResources GetResources() const; - - private: - // Fetches an image using |image_web_url| asynchronously on the main thread. - // The |image_callback| will be called on the worker thread. - void FetchImageResource(const blink::WebURL& image_web_url, - const ImageLoadCompletedCallback& image_callback); - - // To be called on the worker thread when the notification icon has been - // fetched. - void DidFetchNotificationIcon(const SkBitmap& bitmap); - - // To be called on the worker thread when the badge has been fetched. - void DidFetchBadge(const SkBitmap& bitmap); - - // To be called on the worker thread when an action icon has been fetched. - void DidFetchActionIcon(size_t action_index, const SkBitmap& bitmap); - - scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; - - SkBitmap notification_icon_; - - SkBitmap badge_; - - std::vector<SkBitmap> action_icons_; - - base::Closure fetches_finished_barrier_closure_; - - std::vector<scoped_refptr<NotificationImageLoader>> image_loaders_; - - base::WeakPtrFactory<PendingNotification> weak_factory_; - - DISALLOW_COPY_AND_ASSIGN(PendingNotification); -}; - -} // namespace content - -#endif // CONTENT_CHILD_NOTIFICATIONS_PENDING_NOTIFICATION_H_
diff --git a/content/child/notifications/pending_notifications_tracker.cc b/content/child/notifications/pending_notifications_tracker.cc deleted file mode 100644 index bfe7dd3..0000000 --- a/content/child/notifications/pending_notifications_tracker.cc +++ /dev/null
@@ -1,75 +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 "content/child/notifications/pending_notifications_tracker.h" - -#include <memory> - -#include "base/bind.h" -#include "base/bind_helpers.h" -#include "base/callback.h" -#include "content/child/notifications/pending_notification.h" -#include "content/public/common/notification_resources.h" - -namespace content { - -PendingNotificationsTracker::PendingNotificationsTracker( - const scoped_refptr<base::SingleThreadTaskRunner>& main_task_runner) - : next_notification_id_(0), main_task_runner_(main_task_runner) {} - -PendingNotificationsTracker::~PendingNotificationsTracker() {} - -void PendingNotificationsTracker::FetchResources( - const blink::WebNotificationData& notification_data, - blink::WebNotificationDelegate* delegate, - const ResourcesCallback& resources_callback) { - int32_t notification_id = next_notification_id_++; - - if (delegate) - delegate_to_pending_id_map_[delegate] = notification_id; - - base::Closure fetches_finished_callback = base::Bind( - &PendingNotificationsTracker::FetchesFinished, - base::Unretained(this) /* The pending notifications are owned by this. */, - delegate, notification_id, resources_callback); - - std::unique_ptr<PendingNotification> pending_notification( - new PendingNotification(main_task_runner_)); - pending_notification->FetchResources(notification_data, - fetches_finished_callback); - - pending_notifications_.AddWithID(pending_notification.release(), - notification_id); -} - -bool PendingNotificationsTracker::CancelResourceFetches( - blink::WebNotificationDelegate* delegate) { - DCHECK(delegate); - - auto iter = delegate_to_pending_id_map_.find(delegate); - if (iter == delegate_to_pending_id_map_.end()) - return false; - - pending_notifications_.Remove(iter->second); - delegate_to_pending_id_map_.erase(iter); - - return true; -} - -void PendingNotificationsTracker::FetchesFinished( - blink::WebNotificationDelegate* delegate, - int32_t notification_id, - const ResourcesCallback& resources_callback) { - PendingNotification* pending_notification = - pending_notifications_.Lookup(notification_id); - DCHECK(pending_notification); - - resources_callback.Run(pending_notification->GetResources()); - - if (delegate) - delegate_to_pending_id_map_.erase(delegate); - pending_notifications_.Remove(notification_id); -} - -} // namespace content
diff --git a/content/child/notifications/pending_notifications_tracker.h b/content/child/notifications/pending_notifications_tracker.h deleted file mode 100644 index 91a7e89..0000000 --- a/content/child/notifications/pending_notifications_tracker.h +++ /dev/null
@@ -1,84 +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 CONTENT_CHILD_NOTIFICATIONS_PENDING_NOTIFICATIONS_TRACKER_H_ -#define CONTENT_CHILD_NOTIFICATIONS_PENDING_NOTIFICATIONS_TRACKER_H_ - -#include <map> - -#include "base/callback_forward.h" -#include "base/id_map.h" -#include "base/macros.h" -#include "base/memory/ref_counted.h" -#include "content/common/content_export.h" - -namespace base { -class SingleThreadTaskRunner; -} - -namespace blink { -struct WebNotificationData; -class WebNotificationDelegate; -} - -namespace content { - -class PendingNotification; -class PendingNotificationsTrackerTest; -struct NotificationResources; - -// Tracks all pending Web Notifications as PendingNotification instances. The -// pending notifications (and their associated data) are stored in this class. -// The pending notification tracker is owned by the NotificationManager, and -// lives on the thread that manager has been associated with. -class CONTENT_EXPORT PendingNotificationsTracker { - public: - explicit PendingNotificationsTracker( - const scoped_refptr<base::SingleThreadTaskRunner>& main_task_runner); - ~PendingNotificationsTracker(); - - // Type definition for the callback signature which is to be invoked when the - // resources associated with a notification have been fetched. - using ResourcesCallback = base::Callback<void(const NotificationResources&)>; - - // Adds a pending notification for which to fetch resources. The |delegate| - // may be null, but non-null values can be used to cancel the fetches. - // Resource fetches will be started asynchronously on the main thread. - void FetchResources(const blink::WebNotificationData& notification_data, - blink::WebNotificationDelegate* delegate, - const ResourcesCallback& resources_callback); - - // Cancels all pending and in-flight fetches for the notification identified - // by |delegate|, which may not be null. Returns whether the notification was - // cancelled. - bool CancelResourceFetches(blink::WebNotificationDelegate* delegate); - - private: - friend class PendingNotificationsTrackerTest; - - // To be called on the worker thread when the pending notification - // identified by |notification_id| has finished fetching the resources. The - // |delegate| may be null. - void FetchesFinished(blink::WebNotificationDelegate* delegate, - int notification_id, - const ResourcesCallback& resources_callback); - - // Used to generate ids for tracking pending notifications. - int32_t next_notification_id_; - - scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; - - // The notifications whose resources are still being fetched. - IDMap<PendingNotification, IDMapOwnPointer> pending_notifications_; - - // In order to be able to cancel pending page notifications by delegate, store - // a mapping of the delegate to the pending notification id as well. - std::map<blink::WebNotificationDelegate*, int> delegate_to_pending_id_map_; - - DISALLOW_COPY_AND_ASSIGN(PendingNotificationsTracker); -}; - -} // namespace content - -#endif // CONTENT_CHILD_NOTIFICATIONS_PENDING_NOTIFICATIONS_TRACKER_H_
diff --git a/content/child/notifications/pending_notifications_tracker_unittest.cc b/content/child/notifications/pending_notifications_tracker_unittest.cc deleted file mode 100644 index 35c61a7..0000000 --- a/content/child/notifications/pending_notifications_tracker_unittest.cc +++ /dev/null
@@ -1,299 +0,0 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "content/child/notifications/pending_notifications_tracker.h" - -#include <memory> -#include <vector> - -#include "base/base_paths.h" -#include "base/bind.h" -#include "base/bind_helpers.h" -#include "base/files/file_path.h" -#include "base/files/file_util.h" -#include "base/location.h" -#include "base/macros.h" -#include "base/message_loop/message_loop.h" -#include "base/path_service.h" -#include "base/run_loop.h" -#include "base/thread_task_runner_handle.h" -#include "content/common/notification_constants.h" -#include "content/public/common/notification_resources.h" -#include "testing/gtest/include/gtest/gtest.h" -#include "third_party/WebKit/public/platform/Platform.h" -#include "third_party/WebKit/public/platform/WebString.h" -#include "third_party/WebKit/public/platform/WebURL.h" -#include "third_party/WebKit/public/platform/WebURLError.h" -#include "third_party/WebKit/public/platform/WebURLLoaderMockFactory.h" -#include "third_party/WebKit/public/platform/WebURLResponse.h" -#include "third_party/WebKit/public/platform/modules/notifications/WebNotificationData.h" -#include "third_party/WebKit/public/platform/modules/notifications/WebNotificationDelegate.h" -#include "third_party/skia/include/core/SkBitmap.h" -#include "url/gurl.h" - -namespace content { - -namespace { - -const char kBaseUrl[] = "http://test.com/"; -const char kIcon48x48[] = "48x48.png"; -const char kIcon100x100[] = "100x100.png"; -const char kIcon110x110[] = "110x110.png"; -const char kIcon120x120[] = "120x120.png"; -const char kIcon500x500[] = "500x500.png"; - -class FakeNotificationDelegate : public blink::WebNotificationDelegate { - public: - void dispatchClickEvent() override {} - void dispatchShowEvent() override {} - void dispatchErrorEvent() override {} - void dispatchCloseEvent() override {} -}; - -} // namespace - -class PendingNotificationsTrackerTest : public testing::Test { - public: - PendingNotificationsTrackerTest() - : tracker_(new PendingNotificationsTracker( - base::ThreadTaskRunnerHandle::Get())) {} - - ~PendingNotificationsTrackerTest() override { - GetURLLoaderMockFactory()->unregisterAllURLs(); - } - - void DidFetchResources(size_t index, const NotificationResources& resources) { - if (resources_.size() < index + 1) - resources_.resize(index + 1); - resources_[index] = resources; - } - - protected: - PendingNotificationsTracker* tracker() { return tracker_.get(); } - - size_t CountResources() { return resources_.size(); } - - NotificationResources* GetResources(size_t index) { - DCHECK_LT(index, resources_.size()); - return &resources_[index]; - } - - size_t CountPendingNotifications() { - return tracker_->pending_notifications_.size(); - } - - size_t CountDelegates() { - return tracker_->delegate_to_pending_id_map_.size(); - } - - blink::WebURLLoaderMockFactory* GetURLLoaderMockFactory() { - return blink::Platform::current()->getURLLoaderMockFactory(); - } - - // Registers a mocked url. When fetched, |file_name| will be loaded from the - // test data directory. - blink::WebURL RegisterMockedURL(const std::string& file_name) { - blink::WebURL url(GURL(kBaseUrl + file_name)); - - blink::WebURLResponse response(url); - response.setMIMEType("image/png"); - response.setHTTPStatusCode(200); - - base::FilePath file_path; - base::PathService::Get(base::DIR_SOURCE_ROOT, &file_path); - file_path = file_path.Append(FILE_PATH_LITERAL("content")) - .Append(FILE_PATH_LITERAL("test")) - .Append(FILE_PATH_LITERAL("data")) - .Append(FILE_PATH_LITERAL("notifications")) - .AppendASCII(file_name); - file_path = base::MakeAbsoluteFilePath(file_path); - blink::WebString string_file_path = - blink::WebString::fromUTF8(file_path.MaybeAsASCII()); - - GetURLLoaderMockFactory()->registerURL(url, response, string_file_path); - - return url; - } - - // Registers a mocked url that will fail to be fetched, with a 404 error. - blink::WebURL RegisterMockedErrorURL(const std::string& file_name) { - blink::WebURL url(GURL(kBaseUrl + file_name)); - - blink::WebURLResponse response(url); - response.setMIMEType("image/png"); - response.setHTTPStatusCode(404); - - blink::WebURLError error; - error.reason = 404; - - GetURLLoaderMockFactory()->registerErrorURL(url, response, error); - return url; - } - - private: - base::MessageLoop message_loop_; - std::unique_ptr<PendingNotificationsTracker> tracker_; - std::vector<NotificationResources> resources_; - - DISALLOW_COPY_AND_ASSIGN(PendingNotificationsTrackerTest); -}; - -TEST_F(PendingNotificationsTrackerTest, OneNotificationMultipleResources) { - blink::WebNotificationData notification_data; - notification_data.icon = RegisterMockedURL(kIcon100x100); - notification_data.badge = RegisterMockedURL(kIcon48x48); - notification_data.actions = - blink::WebVector<blink::WebNotificationAction>(static_cast<size_t>(2)); - notification_data.actions[0].icon = RegisterMockedURL(kIcon110x110); - notification_data.actions[1].icon = RegisterMockedURL(kIcon120x120); - - tracker()->FetchResources( - notification_data, nullptr /* delegate */, - base::Bind(&PendingNotificationsTrackerTest::DidFetchResources, - base::Unretained(this), 0 /* index */)); - - ASSERT_EQ(1u, CountPendingNotifications()); - ASSERT_EQ(0u, CountResources()); - - base::RunLoop().RunUntilIdle(); - GetURLLoaderMockFactory()->serveAsynchronousRequests(); - - ASSERT_EQ(0u, CountPendingNotifications()); - ASSERT_EQ(1u, CountResources()); - - NotificationResources* resources = GetResources(0u); - - ASSERT_FALSE(resources->notification_icon.drawsNothing()); - ASSERT_EQ(100, resources->notification_icon.width()); - - ASSERT_FALSE(resources->badge.drawsNothing()); - ASSERT_EQ(48, resources->badge.width()); - - ASSERT_EQ(2u, resources->action_icons.size()); - ASSERT_FALSE(resources->action_icons[0].drawsNothing()); - ASSERT_EQ(110, resources->action_icons[0].width()); - ASSERT_FALSE(resources->action_icons[1].drawsNothing()); - ASSERT_EQ(120, resources->action_icons[1].width()); -} - -TEST_F(PendingNotificationsTrackerTest, LargeIconsAreScaledDown) { - blink::WebNotificationData notification_data; - notification_data.icon = RegisterMockedURL(kIcon500x500); - notification_data.badge = notification_data.icon; - notification_data.actions = - blink::WebVector<blink::WebNotificationAction>(static_cast<size_t>(1)); - notification_data.actions[0].icon = notification_data.icon; - - tracker()->FetchResources( - notification_data, nullptr /* delegate */, - base::Bind(&PendingNotificationsTrackerTest::DidFetchResources, - base::Unretained(this), 0 /* index */)); - - ASSERT_EQ(1u, CountPendingNotifications()); - ASSERT_EQ(0u, CountResources()); - - base::RunLoop().RunUntilIdle(); - GetURLLoaderMockFactory()->serveAsynchronousRequests(); - - ASSERT_EQ(0u, CountPendingNotifications()); - ASSERT_EQ(1u, CountResources()); - - NotificationResources* resources = GetResources(0u); - - ASSERT_FALSE(resources->notification_icon.drawsNothing()); - ASSERT_EQ(kPlatformNotificationMaxIconSizePx, - resources->notification_icon.width()); - ASSERT_EQ(kPlatformNotificationMaxIconSizePx, - resources->notification_icon.height()); - - ASSERT_FALSE(resources->badge.drawsNothing()); - ASSERT_EQ(kPlatformNotificationMaxBadgeSizePx, resources->badge.width()); - ASSERT_EQ(kPlatformNotificationMaxBadgeSizePx, resources->badge.height()); - - ASSERT_EQ(1u, resources->action_icons.size()); - ASSERT_FALSE(resources->action_icons[0].drawsNothing()); - ASSERT_EQ(kPlatformNotificationMaxActionIconSizePx, - resources->action_icons[0].width()); - ASSERT_EQ(kPlatformNotificationMaxActionIconSizePx, - resources->action_icons[0].height()); -} - -TEST_F(PendingNotificationsTrackerTest, TwoNotifications) { - blink::WebNotificationData notification_data; - notification_data.icon = RegisterMockedURL(kIcon100x100); - - blink::WebNotificationData notification_data_2; - notification_data_2.icon = RegisterMockedURL(kIcon110x110); - - tracker()->FetchResources( - notification_data, nullptr /* delegate */, - base::Bind(&PendingNotificationsTrackerTest::DidFetchResources, - base::Unretained(this), 0 /* index */)); - - tracker()->FetchResources( - notification_data_2, nullptr /* delegate */, - base::Bind(&PendingNotificationsTrackerTest::DidFetchResources, - base::Unretained(this), 1 /* index */)); - - ASSERT_EQ(2u, CountPendingNotifications()); - ASSERT_EQ(0u, CountResources()); - - base::RunLoop().RunUntilIdle(); - GetURLLoaderMockFactory()->serveAsynchronousRequests(); - - ASSERT_EQ(0u, CountPendingNotifications()); - ASSERT_EQ(2u, CountResources()); - - ASSERT_FALSE(GetResources(0u)->notification_icon.drawsNothing()); - ASSERT_EQ(100, GetResources(0u)->notification_icon.width()); - - ASSERT_FALSE(GetResources(1u)->notification_icon.drawsNothing()); - ASSERT_EQ(110, GetResources(1u)->notification_icon.width()); -} - -TEST_F(PendingNotificationsTrackerTest, FetchError) { - blink::WebNotificationData notification_data; - notification_data.icon = RegisterMockedErrorURL(kIcon100x100); - - tracker()->FetchResources( - notification_data, nullptr /* delegate */, - base::Bind(&PendingNotificationsTrackerTest::DidFetchResources, - base::Unretained(this), 0 /* index */)); - - ASSERT_EQ(1u, CountPendingNotifications()); - ASSERT_EQ(0u, CountResources()); - - base::RunLoop().RunUntilIdle(); - GetURLLoaderMockFactory()->serveAsynchronousRequests(); - - ASSERT_EQ(0u, CountPendingNotifications()); - ASSERT_EQ(1u, CountResources()); - - ASSERT_TRUE(GetResources(0u)->notification_icon.drawsNothing()); -} - -TEST_F(PendingNotificationsTrackerTest, CancelFetches) { - blink::WebNotificationData notification_data; - notification_data.icon = RegisterMockedURL(kIcon100x100); - - FakeNotificationDelegate delegate; - - tracker()->FetchResources( - notification_data, &delegate, - base::Bind(&PendingNotificationsTrackerTest::DidFetchResources, - base::Unretained(this), 0 /* index */)); - - ASSERT_EQ(1u, CountPendingNotifications()); - ASSERT_EQ(1u, CountDelegates()); - ASSERT_EQ(0u, CountResources()); - - base::RunLoop().RunUntilIdle(); - tracker()->CancelResourceFetches(&delegate); - - ASSERT_EQ(0u, CountPendingNotifications()); - ASSERT_EQ(0u, CountDelegates()); - ASSERT_EQ(0u, CountResources()); -} - -} // namespace content
diff --git a/content/child/resource_dispatcher.cc b/content/child/resource_dispatcher.cc index 17c60d6..9cd70110 100644 --- a/content/child/resource_dispatcher.cc +++ b/content/child/resource_dispatcher.cc
@@ -627,6 +627,8 @@ RemoteToLocalTimeTicks(converter, &load_timing->send_start); RemoteToLocalTimeTicks(converter, &load_timing->send_end); RemoteToLocalTimeTicks(converter, &load_timing->receive_headers_end); + RemoteToLocalTimeTicks(converter, &load_timing->push_start); + RemoteToLocalTimeTicks(converter, &load_timing->push_end); RemoteToLocalTimeTicks(converter, &renderer_info->service_worker_start_time); RemoteToLocalTimeTicks(converter, &renderer_info->service_worker_ready_time);
diff --git a/content/child/runtime_features.cc b/content/child/runtime_features.cc index dc23cc5..ba2787d 100644 --- a/content/child/runtime_features.cc +++ b/content/child/runtime_features.cc
@@ -27,6 +27,8 @@ #if defined(OS_ANDROID) // Android does not have support for PagePopup WebRuntimeFeatures::enablePagePopup(false); + // No plan to support complex UI for date/time INPUT types. + WebRuntimeFeatures::enableInputMultipleFieldsUI(false); // Android does not yet support SharedWorker. crbug.com/154571 WebRuntimeFeatures::enableSharedWorker(false); // Android does not yet support NavigatorContentUtils. @@ -80,9 +82,6 @@ WebRuntimeFeatures::enablePushMessaging(false); } - if (command_line.HasSwitch(switches::kEnableNotificationActionIcons)) - WebRuntimeFeatures::enableNotificationActionIcons(true); - if (command_line.HasSwitch(switches::kDisableSharedWorkers)) WebRuntimeFeatures::enableSharedWorker(false);
diff --git a/content/child/service_worker/web_service_worker_impl.cc b/content/child/service_worker/web_service_worker_impl.cc index 8e85e3bc..06b22e6 100644 --- a/content/child/service_worker/web_service_worker_impl.cc +++ b/content/child/service_worker/web_service_worker_impl.cc
@@ -22,7 +22,6 @@ using blink::WebMessagePortChannel; using blink::WebMessagePortChannelArray; using blink::WebMessagePortChannelClient; -using blink::WebRuntimeFeatures; using blink::WebSecurityOrigin; using blink::WebString; @@ -51,17 +50,9 @@ const base::string16& message, const url::Origin& source_origin, std::unique_ptr<WebMessagePortChannelArray> channels) { - if (WebRuntimeFeatures::isServiceWorkerExtendableMessageEventEnabled()) { - thread_safe_sender->Send(new ServiceWorkerHostMsg_PostMessageToWorker( - handle_id, provider_id, message, source_origin, - WebMessagePortChannelImpl::ExtractMessagePortIDs(std::move(channels)))); - } else { - thread_safe_sender->Send( - new ServiceWorkerHostMsg_DeprecatedPostMessageToWorker( - handle_id, message, - WebMessagePortChannelImpl::ExtractMessagePortIDs( - std::move(channels)))); - } + thread_safe_sender->Send(new ServiceWorkerHostMsg_PostMessageToWorker( + handle_id, provider_id, message, source_origin, + WebMessagePortChannelImpl::ExtractMessagePortIDs(std::move(channels)))); } } // namespace
diff --git a/content/child/web_url_loader_impl.cc b/content/child/web_url_loader_impl.cc index 41daeb0..32fd1f7 100644 --- a/content/child/web_url_loader_impl.cc +++ b/content/child/web_url_loader_impl.cc
@@ -128,6 +128,8 @@ (load_timing.send_end - kNullTicks).InSecondsF()); url_timing->setReceiveHeadersEnd( (load_timing.receive_headers_end - kNullTicks).InSecondsF()); + url_timing->setPushStart((load_timing.push_start - kNullTicks).InSecondsF()); + url_timing->setPushEnd((load_timing.push_end - kNullTicks).InSecondsF()); } net::RequestPriority ConvertWebKitPriorityToNetPriority(
diff --git a/content/common/BUILD.gn b/content/common/BUILD.gn index 9ff78fe..c047d7c74 100644 --- a/content/common/BUILD.gn +++ b/content/common/BUILD.gn
@@ -203,12 +203,12 @@ "//ui/accessibility", "//ui/base", "//ui/base/ime", + "//ui/events/ipc", "//ui/gfx", "//ui/gfx/geometry", "//ui/gfx/ipc", "//ui/gfx/ipc/skia", "//ui/gl", - "//ui/latency_info/ipc", "//ui/shell_dialogs", "//url", "//url/ipc:url_ipc", @@ -530,8 +530,6 @@ import_dirs = [ "//mojo/services" ] - typemaps = [ "//url/mojo/origin.typemap" ] - public_deps = [ "//components/leveldb/public/interfaces", "//components/mus/public/interfaces",
diff --git a/content/common/DEPS b/content/common/DEPS index f12f7de7..b7a79fc 100644 --- a/content/common/DEPS +++ b/content/common/DEPS
@@ -32,7 +32,7 @@ "+third_party/WebKit/public/platform/modules/device_orientation/WebDeviceMotionData.h", "+third_party/WebKit/public/platform/modules/device_orientation/WebDeviceOrientationData.h", "+third_party/WebKit/public/platform/modules/indexeddb/WebIDBTypes.h", - "+third_party/WebKit/public/platform/modules/notifications/WebNotificationPermission.h", + "+third_party/WebKit/public/platform/modules/permissions/permission_status.mojom.h", "+third_party/WebKit/public/platform/modules/push_messaging/WebPushError.h", "+third_party/WebKit/public/platform/modules/push_messaging/WebPushPermissionStatus.h", "+third_party/WebKit/public/platform/modules/screen_orientation/WebLockOrientationError.h",
diff --git a/content/common/OWNERS b/content/common/OWNERS index 1b08541..f7301e1 100644 --- a/content/common/OWNERS +++ b/content/common/OWNERS
@@ -98,7 +98,3 @@ # DirectWrite per-file dwrite_font_platform_win*=scottmg@chromium.org per-file font_warmup_win.cc=scottmg@chromium.org - -# Web Notifications -per-file notification_constants.h=peter@chromium.org -per-file notification_constants.h=mvanouwerkerk@chromium.org
diff --git a/content/common/accelerated_surface_buffers_swapped_params_mac.h b/content/common/accelerated_surface_buffers_swapped_params_mac.h index a25a41a..71fb4ff 100644 --- a/content/common/accelerated_surface_buffers_swapped_params_mac.h +++ b/content/common/accelerated_surface_buffers_swapped_params_mac.h
@@ -6,8 +6,8 @@ #define CONTENT_COMMON_ACCELERATED_SURFACE_BUFFERS_SWAPPED_PARAMS_MAC_H_ #include "ui/base/cocoa/remote_layer_api.h" +#include "ui/events/latency_info.h" #include "ui/gfx/mac/io_surface.h" -#include "ui/latency_info/latency_info.h" namespace content {
diff --git a/content/common/cursors/webcursor.h b/content/common/cursors/webcursor.h index 0c064c0b..c306baf 100644 --- a/content/common/cursors/webcursor.h +++ b/content/common/cursors/webcursor.h
@@ -198,6 +198,7 @@ #if defined(USE_OZONE) gfx::Display::Rotation rotation_; + gfx::Size maximum_cursor_size_; #endif };
diff --git a/content/common/cursors/webcursor_ozone.cc b/content/common/cursors/webcursor_ozone.cc index 0fb17cb..e668460 100644 --- a/content/common/cursors/webcursor_ozone.cc +++ b/content/common/cursors/webcursor_ozone.cc
@@ -10,8 +10,8 @@ #include "ui/ozone/public/cursor_factory_ozone.h" namespace { -const float kMaxCursorWidth = 64.f; -const float kMaxCursorHeight = 64.f; +const int kDefaultMaxCursorWidth = 64; +const int kDefaultMaxCursorHeight = 64; } namespace content { @@ -24,10 +24,13 @@ ImageFromCustomData(&bitmap); gfx::Point hotspot = hotspot_; - // TODO(spang): Consider allowing larger cursors if the hardware supports it. float scale = device_scale_factor_ / custom_scale_; - scale = std::min(scale, kMaxCursorWidth / bitmap.width()); - scale = std::min(scale, kMaxCursorHeight / bitmap.height()); + DCHECK_LT(0, maximum_cursor_size_.width()); + DCHECK_LT(0, maximum_cursor_size_.height()); + scale = std::min( + scale, static_cast<float>(maximum_cursor_size_.width()) / bitmap.width()); + scale = std::min(scale, static_cast<float>(maximum_cursor_size_.height()) / + bitmap.height()); ui::ScaleAndRotateCursorBitmapAndHotpoint(scale, rotation_, &bitmap, &hotspot); @@ -39,11 +42,18 @@ void WebCursor::SetDisplayInfo(const gfx::Display& display) { if (rotation_ == display.rotation() && - device_scale_factor_ == display.device_scale_factor()) + device_scale_factor_ == display.device_scale_factor() && + maximum_cursor_size_ == display.maximum_cursor_size()) return; - device_scale_factor_ = display.device_scale_factor(); rotation_ = display.rotation(); + maximum_cursor_size_ = display.maximum_cursor_size(); + // TODO(oshima): Identify if it's possible to remove this check here and move + // the kDefaultMaxCursor{Width,Height} constants to a single place. + // crbug.com/603512 + if (maximum_cursor_size_.width() == 0 || maximum_cursor_size_.height() == 0) + maximum_cursor_size_ = + gfx::Size(kDefaultMaxCursorWidth, kDefaultMaxCursorHeight); if (platform_cursor_) ui::CursorFactoryOzone::GetInstance()->UnrefImageCursor(platform_cursor_); platform_cursor_ = NULL; @@ -55,6 +65,8 @@ platform_cursor_ = NULL; device_scale_factor_ = 1.f; rotation_ = gfx::Display::ROTATE_0; + maximum_cursor_size_ = + gfx::Size(kDefaultMaxCursorWidth, kDefaultMaxCursorHeight); } bool WebCursor::SerializePlatformData(base::Pickle* pickle) const { @@ -84,6 +96,7 @@ ui::CursorFactoryOzone::GetInstance()->RefImageCursor(platform_cursor_); device_scale_factor_ = other.device_scale_factor_; + maximum_cursor_size_ = other.maximum_cursor_size_; } } // namespace content
diff --git a/content/common/dwrite_font_proxy_messages.h b/content/common/dwrite_font_proxy_messages.h index cc8aced1..288a3cf0 100644 --- a/content/common/dwrite_font_proxy_messages.h +++ b/content/common/dwrite_font_proxy_messages.h
@@ -23,6 +23,20 @@ #endif // CONTENT_COMMON_DWRITE_FONT_PROXY_MESSAGES_H_ +IPC_STRUCT_BEGIN(DWriteFontStyle) + IPC_STRUCT_MEMBER(uint16_t, font_weight) + IPC_STRUCT_MEMBER(uint8_t, font_slant) + IPC_STRUCT_MEMBER(uint8_t, font_stretch) +IPC_STRUCT_END() + +IPC_STRUCT_BEGIN(MapCharactersResult) + IPC_STRUCT_MEMBER(uint32_t, family_index) + IPC_STRUCT_MEMBER(base::string16, family_name) + IPC_STRUCT_MEMBER(uint32_t, mapped_length) + IPC_STRUCT_MEMBER(float, scale) + IPC_STRUCT_MEMBER(DWriteFontStyle, font_style) +IPC_STRUCT_END() + // Locates the index of the specified font family within the system collection. IPC_SYNC_MESSAGE_CONTROL1_1(DWriteFontProxyMsg_FindFamily, base::string16 /* family_name */, @@ -44,3 +58,18 @@ IPC_SYNC_MESSAGE_CONTROL1_1(DWriteFontProxyMsg_GetFontFiles, uint32_t /* family_index */, std::vector<base::string16> /* out file_paths */) + +// Locates a font family that is able to render the specified text using the +// specified style. If successful, the family_index and family_name will +// indicate which family in the system font collection can render the requested +// text and the mapped_length will indicate how many characters can be +// rendered. If no font exists that can render the text, family_index will be +// UINT32_MAX and mapped_length will indicate how many characters cannot be +// rendered by any installed font. +IPC_SYNC_MESSAGE_CONTROL5_1(DWriteFontProxyMsg_MapCharacters, + base::string16 /* text */, + DWriteFontStyle /* font_style */, + base::string16 /* locale_name */, + uint32_t /* reading_direction */, + base::string16 /* base_family_name - optional */, + MapCharactersResult /* out */)
diff --git a/content/common/dwrite_text_analysis_source_win.cc b/content/common/dwrite_text_analysis_source_win.cc new file mode 100644 index 0000000..19c6c54 --- /dev/null +++ b/content/common/dwrite_text_analysis_source_win.cc
@@ -0,0 +1,82 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "content/common/dwrite_text_analysis_source_win.h" + +#include "base/logging.h" + +namespace content { + +TextAnalysisSource::TextAnalysisSource() = default; +TextAnalysisSource::~TextAnalysisSource() = default; + +HRESULT TextAnalysisSource::GetLocaleName(UINT32 text_position, + UINT32* text_length, + const WCHAR** locale_name) { + if (text_position >= text_.length() || !text_length || !locale_name) + return E_INVALIDARG; + *text_length = text_.length() - text_position; + *locale_name = locale_name_.c_str(); + return S_OK; +} + +HRESULT TextAnalysisSource::GetNumberSubstitution( + UINT32 text_position, + UINT32* text_length, + IDWriteNumberSubstitution** number_substitution) { + if (text_position >= text_.length() || !text_length || !number_substitution) + return E_INVALIDARG; + *text_length = text_.length() - text_position; + number_substitution_.CopyTo(number_substitution); + return S_OK; +} + +DWRITE_READING_DIRECTION TextAnalysisSource::GetParagraphReadingDirection() { + return reading_direction_; +} + +HRESULT TextAnalysisSource::GetTextAtPosition(UINT32 text_position, + const WCHAR** text_string, + UINT32* text_length) { + if (!text_length || !text_string) + return E_INVALIDARG; + if (text_position >= text_.length()) { + *text_string = nullptr; + *text_length = 0; + return S_OK; + } + *text_string = text_.c_str() + text_position; + *text_length = text_.length() - text_position; + return S_OK; +} + +HRESULT TextAnalysisSource::GetTextBeforePosition(UINT32 text_position, + const WCHAR** text_string, + UINT32* text_length) { + if (!text_length || !text_string) + return E_INVALIDARG; + if (text_position < 1 || text_position > text_.length()) { + *text_string = nullptr; + *text_length = 0; + return S_OK; + } + *text_string = text_.c_str(); + *text_length = text_position; + return S_OK; +} + +HRESULT TextAnalysisSource::RuntimeClassInitialize( + const base::string16& text, + const base::string16& locale_name, + IDWriteNumberSubstitution* number_substitution, + DWRITE_READING_DIRECTION reading_direction) { + DCHECK(number_substitution); + text_ = text; + locale_name_ = locale_name; + number_substitution_ = number_substitution; + reading_direction_ = reading_direction; + return S_OK; +} + +} // namespace content
diff --git a/content/common/dwrite_text_analysis_source_win.h b/content/common/dwrite_text_analysis_source_win.h new file mode 100644 index 0000000..2999e43 --- /dev/null +++ b/content/common/dwrite_text_analysis_source_win.h
@@ -0,0 +1,64 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CONTENT_COMMON_DWRITE_TEXT_ANALYSIS_SOURCE_WIN_H_ +#define CONTENT_COMMON_DWRITE_TEXT_ANALYSIS_SOURCE_WIN_H_ + +#include <dwrite.h> +#include <wrl.h> + +#include "base/macros.h" +#include "base/strings/string16.h" +#include "content/common/content_export.h" + +namespace content { + +// Implements an IDWriteTextAnalysisSource, describing a single pre-defined +// chunk of text with a uniform locale, reading direction, and number +// substitution. +class CONTENT_EXPORT TextAnalysisSource + : public Microsoft::WRL::RuntimeClass< + Microsoft::WRL::RuntimeClassFlags<Microsoft::WRL::ClassicCom>, + IDWriteTextAnalysisSource> { + public: + TextAnalysisSource(); + + // IDWriteTextAnalysisSource: + HRESULT STDMETHODCALLTYPE GetLocaleName(UINT32 text_position, + UINT32* text_length, + const WCHAR** locale_name) override; + HRESULT STDMETHODCALLTYPE GetNumberSubstitution( + UINT32 text_position, + UINT32* text_length, + IDWriteNumberSubstitution** number_substitution) override; + DWRITE_READING_DIRECTION STDMETHODCALLTYPE + GetParagraphReadingDirection() override; + HRESULT STDMETHODCALLTYPE GetTextAtPosition(UINT32 text_position, + const WCHAR** text_string, + UINT32* text_length) override; + HRESULT STDMETHODCALLTYPE GetTextBeforePosition(UINT32 text_position, + const WCHAR** text_string, + UINT32* text_length) override; + + HRESULT STDMETHODCALLTYPE + RuntimeClassInitialize(const base::string16& text, + const base::string16& locale_name, + IDWriteNumberSubstitution* number_substitution, + DWRITE_READING_DIRECTION reading_direction); + + protected: + ~TextAnalysisSource() override; + + private: + base::string16 text_; + base::string16 locale_name_; + Microsoft::WRL::ComPtr<IDWriteNumberSubstitution> number_substitution_; + DWRITE_READING_DIRECTION reading_direction_; + + DISALLOW_ASSIGN(TextAnalysisSource); +}; + +} // namespace content + +#endif // CONTENT_COMMON_DWRITE_TEXT_ANALYSIS_SOURCE_WIN_H_
diff --git a/content/common/gpu/client/context_provider_command_buffer.cc b/content/common/gpu/client/context_provider_command_buffer.cc index 868a60eb..e1712f5 100644 --- a/content/common/gpu/client/context_provider_command_buffer.cc +++ b/content/common/gpu/client/context_provider_command_buffer.cc
@@ -5,6 +5,8 @@ #include "content/common/gpu/client/context_provider_command_buffer.h" #include <stddef.h> + +#include <memory> #include <set> #include <utility> #include <vector> @@ -36,16 +38,6 @@ ContextProviderCommandBuffer* provider_; }; -scoped_refptr<ContextProviderCommandBuffer> -ContextProviderCommandBuffer::Create( - std::unique_ptr<WebGraphicsContext3DCommandBufferImpl> context3d, - CommandBufferContextType type) { - if (!context3d) - return NULL; - - return new ContextProviderCommandBuffer(std::move(context3d), type); -} - ContextProviderCommandBuffer::ContextProviderCommandBuffer( std::unique_ptr<WebGraphicsContext3DCommandBufferImpl> context3d, CommandBufferContextType type)
diff --git a/content/common/gpu/client/context_provider_command_buffer.h b/content/common/gpu/client/context_provider_command_buffer.h index 433cefa..00efb1f 100644 --- a/content/common/gpu/client/context_provider_command_buffer.h +++ b/content/common/gpu/client/context_provider_command_buffer.h
@@ -29,7 +29,7 @@ class CONTENT_EXPORT ContextProviderCommandBuffer : NON_EXPORTED_BASE(public cc_blink::ContextProviderWebContext) { public: - static scoped_refptr<ContextProviderCommandBuffer> Create( + ContextProviderCommandBuffer( std::unique_ptr<WebGraphicsContext3DCommandBufferImpl> context3d, CommandBufferContextType type); @@ -53,9 +53,6 @@ const LostContextCallback& lost_context_callback) override; protected: - ContextProviderCommandBuffer( - std::unique_ptr<WebGraphicsContext3DCommandBufferImpl> context3d, - CommandBufferContextType type); ~ContextProviderCommandBuffer() override; void OnLostContext();
diff --git a/content/common/gpu/client/gpu_in_process_context_tests.cc b/content/common/gpu/client/gpu_in_process_context_tests.cc index 933466d..31a5e0cf 100644 --- a/content/common/gpu/client/gpu_in_process_context_tests.cc +++ b/content/common/gpu/client/gpu_in_process_context_tests.cc
@@ -3,7 +3,9 @@ // found in the LICENSE file. #include <stdio.h> + #include <cmath> +#include <memory> #include <string> #include <vector>
diff --git a/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc b/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc index 2fdfb98..c9c4cf1 100644 --- a/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc +++ b/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc
@@ -12,6 +12,7 @@ #include <algorithm> #include <map> +#include <memory> #include "base/atomicops.h" #include "base/bind.h" @@ -99,6 +100,7 @@ gpu_preference_(gpu_preference), mem_limits_(limits), weak_ptr_factory_(this) { + DCHECK(host); switch (attributes.context_type) { case gpu::gles2::CONTEXT_TYPE_OPENGLES2: case gpu::gles2::CONTEXT_TYPE_OPENGLES3: @@ -310,23 +312,6 @@ return real_gl_.get(); } -// static -WebGraphicsContext3DCommandBufferImpl* -WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext( - gpu::GpuChannelHost* host, - const gpu::gles2::ContextCreationAttribHelper& attributes, - gfx::GpuPreference gpu_preference, - bool share_resources, - bool automatic_flushes, - const GURL& active_url, - const SharedMemoryLimits& limits, - WebGraphicsContext3DCommandBufferImpl* share_context) { - DCHECK(host); - return new WebGraphicsContext3DCommandBufferImpl( - gpu::kNullSurfaceHandle, active_url, host, attributes, gpu_preference, - share_resources, automatic_flushes, limits, share_context); -} - void WebGraphicsContext3DCommandBufferImpl::OnContextLost() { if (context_lost_callback_) context_lost_callback_->onContextLost();
diff --git a/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h b/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h index 9272cfd..8b6c8b2 100644 --- a/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h +++ b/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h
@@ -108,7 +108,7 @@ DISALLOW_COPY_AND_ASSIGN(ShareGroup); }; - WebGraphicsContext3DCommandBufferImpl( + CONTENT_EXPORT WebGraphicsContext3DCommandBufferImpl( gpu::SurfaceHandle surface_handle, const GURL& active_url, gpu::GpuChannelHost* host, @@ -131,19 +131,6 @@ return real_gl_.get(); } - // Create & initialize a WebGraphicsContext3DCommandBufferImpl. Return NULL - // on any failure. - static CONTENT_EXPORT WebGraphicsContext3DCommandBufferImpl* - CreateOffscreenContext( - gpu::GpuChannelHost* host, - const gpu::gles2::ContextCreationAttribHelper& attributes, - gfx::GpuPreference gpu_preference, - bool share_resources, - bool automatic_flushes, - const GURL& active_url, - const SharedMemoryLimits& limits, - WebGraphicsContext3DCommandBufferImpl* share_context); - size_t GetMappedMemoryLimit() { return mem_limits_.mapped_memory_reclaim_limit; }
diff --git a/content/common/gpu/media/android_copying_backing_strategy.h b/content/common/gpu/media/android_copying_backing_strategy.h index 83b6c4a..59273d96 100644 --- a/content/common/gpu/media/android_copying_backing_strategy.h +++ b/content/common/gpu/media/android_copying_backing_strategy.h
@@ -7,6 +7,8 @@ #include <stdint.h> +#include <memory> + #include "base/compiler_specific.h" #include "content/common/content_export.h" #include "content/common/gpu/media/android_video_decode_accelerator.h"
diff --git a/content/common/gpu/media/android_video_decode_accelerator.cc b/content/common/gpu/media/android_video_decode_accelerator.cc index dd8e368..2c062af 100644 --- a/content/common/gpu/media/android_video_decode_accelerator.cc +++ b/content/common/gpu/media/android_video_decode_accelerator.cc
@@ -6,6 +6,8 @@ #include <stddef.h> +#include <memory> + #include "base/android/build_info.h" #include "base/auto_reset.h" #include "base/bind.h" @@ -327,6 +329,11 @@ return false; } + if (config.output_mode != Config::OutputMode::ALLOCATE) { + NOTREACHED() << "Only ALLOCATE OutputMode is supported by this VDA"; + return false; + } + DCHECK(client); client_ = client; codec_config_ = new CodecConfig();
diff --git a/content/common/gpu/media/android_video_decode_accelerator.h b/content/common/gpu/media/android_video_decode_accelerator.h index 6728270..6bbe4db 100644 --- a/content/common/gpu/media/android_video_decode_accelerator.h +++ b/content/common/gpu/media/android_video_decode_accelerator.h
@@ -9,6 +9,7 @@ #include <list> #include <map> +#include <memory> #include <queue> #include <string> #include <vector>
diff --git a/content/common/gpu/media/android_video_encode_accelerator.cc b/content/common/gpu/media/android_video_encode_accelerator.cc index accaa501..9a636b9 100644 --- a/content/common/gpu/media/android_video_encode_accelerator.cc +++ b/content/common/gpu/media/android_video_encode_accelerator.cc
@@ -4,6 +4,7 @@ #include "content/common/gpu/media/android_video_encode_accelerator.h" +#include <memory> #include <set> #include "base/bind.h"
diff --git a/content/common/gpu/media/android_video_encode_accelerator.h b/content/common/gpu/media/android_video_encode_accelerator.h index a708872..025814a7 100644 --- a/content/common/gpu/media/android_video_encode_accelerator.h +++ b/content/common/gpu/media/android_video_encode_accelerator.h
@@ -9,6 +9,7 @@ #include <stdint.h> #include <list> +#include <memory> #include <queue> #include <vector>
diff --git a/content/common/gpu/media/avda_codec_image.cc b/content/common/gpu/media/avda_codec_image.cc index 667ab31..cd9ec57b 100644 --- a/content/common/gpu/media/avda_codec_image.cc +++ b/content/common/gpu/media/avda_codec_image.cc
@@ -6,6 +6,8 @@ #include <string.h> +#include <memory> + #include "base/metrics/histogram_macros.h" #include "content/common/gpu/media/avda_shared_state.h" #include "gpu/command_buffer/service/context_group.h"
diff --git a/content/common/gpu/media/avda_codec_image.h b/content/common/gpu/media/avda_codec_image.h index 8adb5fb..9c8c7f6 100644 --- a/content/common/gpu/media/avda_codec_image.h +++ b/content/common/gpu/media/avda_codec_image.h
@@ -7,6 +7,8 @@ #include <stdint.h> +#include <memory> + #include "base/macros.h" #include "content/common/gpu/media/avda_shared_state.h" #include "gpu/command_buffer/service/gl_stream_texture_image.h"
diff --git a/content/common/gpu/media/dxva_video_decode_accelerator_win.cc b/content/common/gpu/media/dxva_video_decode_accelerator_win.cc index b4ee8f0..2f27010 100644 --- a/content/common/gpu/media/dxva_video_decode_accelerator_win.cc +++ b/content/common/gpu/media/dxva_video_decode_accelerator_win.cc
@@ -940,6 +940,11 @@ return false; } + if (config.output_mode != Config::OutputMode::ALLOCATE) { + NOTREACHED() << "Only ALLOCATE OutputMode is supported by this VDA"; + return false; + } + client_ = client; main_thread_task_runner_ = base::MessageLoop::current()->task_runner();
diff --git a/content/common/gpu/media/dxva_video_decode_accelerator_win.h b/content/common/gpu/media/dxva_video_decode_accelerator_win.h index 2d936ac..10ad585b 100644 --- a/content/common/gpu/media/dxva_video_decode_accelerator_win.h +++ b/content/common/gpu/media/dxva_video_decode_accelerator_win.h
@@ -9,6 +9,7 @@ #include <d3d9.h> #include <initguid.h> #include <stdint.h> + // Work around bug in this header by disabling the relevant warning for it. // https://connect.microsoft.com/VisualStudio/feedback/details/911260/dxva2api-h-in-win8-sdk-triggers-c4201-with-w4 #pragma warning(push) @@ -19,6 +20,7 @@ #include <list> #include <map> +#include <memory> #include <vector> #include "base/compiler_specific.h"
diff --git a/content/common/gpu/media/fake_video_decode_accelerator.cc b/content/common/gpu/media/fake_video_decode_accelerator.cc index f811162..cb59425 100644 --- a/content/common/gpu/media/fake_video_decode_accelerator.cc +++ b/content/common/gpu/media/fake_video_decode_accelerator.cc
@@ -7,6 +7,8 @@ #include <stddef.h> #include <string.h> +#include <memory> + #include "base/bind.h" #include "base/location.h" #include "base/thread_task_runner_handle.h"
diff --git a/content/common/gpu/media/generic_v4l2_device.cc b/content/common/gpu/media/generic_v4l2_device.cc index e2328bc..df64a4b 100644 --- a/content/common/gpu/media/generic_v4l2_device.cc +++ b/content/common/gpu/media/generic_v4l2_device.cc
@@ -3,6 +3,8 @@ // found in the LICENSE file. // +#include "content/common/gpu/media/generic_v4l2_device.h" + #include <errno.h> #include <fcntl.h> #include <libdrm/drm_fourcc.h> @@ -13,12 +15,13 @@ #include <sys/ioctl.h> #include <sys/mman.h> +#include <memory> + #include "base/files/scoped_file.h" #include "base/macros.h" #include "base/posix/eintr_wrapper.h" #include "base/trace_event/trace_event.h" #include "build/build_config.h" -#include "content/common/gpu/media/generic_v4l2_device.h" #include "ui/gl/egl_util.h" #include "ui/gl/gl_bindings.h" @@ -217,13 +220,14 @@ kEGLImageDrmFmtsSupported + arraysize(kEGLImageDrmFmtsSupported); } -EGLImageKHR GenericV4L2Device::CreateEGLImage(EGLDisplay egl_display, - EGLContext /* egl_context */, - GLuint texture_id, - gfx::Size frame_buffer_size, - unsigned int buffer_index, - uint32_t v4l2_pixfmt, - size_t num_v4l2_planes) { +EGLImageKHR GenericV4L2Device::CreateEGLImage( + EGLDisplay egl_display, + EGLContext /* egl_context */, + GLuint texture_id, + const gfx::Size& size, + unsigned int buffer_index, + uint32_t v4l2_pixfmt, + const std::vector<base::ScopedFD>& dmabuf_fds) { DVLOG(3) << "CreateEGLImage()"; if (!CanCreateEGLImageFrom(v4l2_pixfmt)) { LOG(ERROR) << "Unsupported V4L2 pixel format"; @@ -235,34 +239,18 @@ // just a buffer count. size_t num_planes = media::VideoFrame::NumPlanes(vf_format); DCHECK_LE(num_planes, 3u); - if (num_planes < num_v4l2_planes) { + if (num_planes < dmabuf_fds.size()) { // It's possible for more than one DRM plane to reside in one V4L2 plane, // but not the other way around. We must use all V4L2 planes. LOG(ERROR) << "Invalid plane count"; return EGL_NO_IMAGE_KHR; } - std::unique_ptr<base::ScopedFD[]> dmabuf_fds( - new base::ScopedFD[num_v4l2_planes]); - // Export dmabuf fds so we can create an EGLImage from them. - for (size_t i = 0; i < num_v4l2_planes; ++i) { - struct v4l2_exportbuffer expbuf; - memset(&expbuf, 0, sizeof(expbuf)); - expbuf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; - expbuf.index = buffer_index; - expbuf.plane = i; - expbuf.flags = O_CLOEXEC; - if (Ioctl(VIDIOC_EXPBUF, &expbuf) != 0) { - return EGL_NO_IMAGE_KHR; - } - dmabuf_fds[i].reset(expbuf.fd); - } - std::vector<EGLint> attrs; attrs.push_back(EGL_WIDTH); - attrs.push_back(frame_buffer_size.width()); + attrs.push_back(size.width()); attrs.push_back(EGL_HEIGHT); - attrs.push_back(frame_buffer_size.height()); + attrs.push_back(size.height()); attrs.push_back(EGL_LINUX_DRM_FOURCC_EXT); attrs.push_back(V4L2PixFmtToDrmFormat(v4l2_pixfmt)); @@ -280,14 +268,15 @@ attrs.push_back(EGL_DMA_BUF_PLANE0_OFFSET_EXT + plane * 3); attrs.push_back(plane_offset); attrs.push_back(EGL_DMA_BUF_PLANE0_PITCH_EXT + plane * 3); - attrs.push_back(media::VideoFrame::RowBytes(plane, vf_format, - frame_buffer_size.width())); + attrs.push_back( + media::VideoFrame::RowBytes(plane, vf_format, size.width())); - if (v4l2_plane + 1 < num_v4l2_planes) { + if (v4l2_plane + 1 < dmabuf_fds.size()) { ++v4l2_plane; + plane_offset = 0; } else { - plane_offset += media::VideoFrame::PlaneSize( - vf_format, plane, frame_buffer_size).GetArea(); + plane_offset += + media::VideoFrame::PlaneSize(vf_format, plane, size).GetArea(); } }
diff --git a/content/common/gpu/media/generic_v4l2_device.h b/content/common/gpu/media/generic_v4l2_device.h index fa4f135..a5f787b0 100644 --- a/content/common/gpu/media/generic_v4l2_device.h +++ b/content/common/gpu/media/generic_v4l2_device.h
@@ -40,13 +40,15 @@ enum v4l2_buf_type type) override; bool CanCreateEGLImageFrom(uint32_t v4l2_pixfmt) override; - EGLImageKHR CreateEGLImage(EGLDisplay egl_display, - EGLContext egl_context, - GLuint texture_id, - gfx::Size frame_buffer_size, - unsigned int buffer_index, - uint32_t v4l2_pixfmt, - size_t num_v4l2_planes) override; + EGLImageKHR CreateEGLImage( + EGLDisplay egl_display, + EGLContext egl_context, + GLuint texture_id, + const gfx::Size& size, + unsigned int buffer_index, + uint32_t v4l2_pixfmt, + const std::vector<base::ScopedFD>& dmabuf_fds) override; + EGLBoolean DestroyEGLImage(EGLDisplay egl_display, EGLImageKHR egl_image) override; GLenum GetTextureTarget() override;
diff --git a/content/common/gpu/media/gpu_jpeg_decode_accelerator.cc b/content/common/gpu/media/gpu_jpeg_decode_accelerator.cc index 6bf6ae4..0078317 100644 --- a/content/common/gpu/media/gpu_jpeg_decode_accelerator.cc +++ b/content/common/gpu/media/gpu_jpeg_decode_accelerator.cc
@@ -5,6 +5,8 @@ #include "content/common/gpu/media/gpu_jpeg_decode_accelerator.h" #include <stdint.h> + +#include <memory> #include <utility> #include "base/bind.h"
diff --git a/content/common/gpu/media/gpu_jpeg_decode_accelerator.h b/content/common/gpu/media/gpu_jpeg_decode_accelerator.h index 486fdf4a..a2ac643 100644 --- a/content/common/gpu/media/gpu_jpeg_decode_accelerator.h +++ b/content/common/gpu/media/gpu_jpeg_decode_accelerator.h
@@ -7,6 +7,8 @@ #include <stdint.h> +#include <memory> + #include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h"
diff --git a/content/common/gpu/media/gpu_video_decode_accelerator.cc b/content/common/gpu/media/gpu_video_decode_accelerator.cc index 160d0c3..a7c2189 100644 --- a/content/common/gpu/media/gpu_video_decode_accelerator.cc +++ b/content/common/gpu/media/gpu_video_decode_accelerator.cc
@@ -4,6 +4,7 @@ #include "content/common/gpu/media/gpu_video_decode_accelerator.h" +#include <memory> #include <vector> #include "base/bind.h"
diff --git a/content/common/gpu/media/gpu_video_decode_accelerator.h b/content/common/gpu/media/gpu_video_decode_accelerator.h index 561ca34..2f338d8 100644 --- a/content/common/gpu/media/gpu_video_decode_accelerator.h +++ b/content/common/gpu/media/gpu_video_decode_accelerator.h
@@ -8,6 +8,7 @@ #include <stdint.h> #include <map> +#include <memory> #include <vector> #include "base/compiler_specific.h"
diff --git a/content/common/gpu/media/gpu_video_decode_accelerator_factory_impl.cc b/content/common/gpu/media/gpu_video_decode_accelerator_factory_impl.cc index f6ec448..e4f3a35 100644 --- a/content/common/gpu/media/gpu_video_decode_accelerator_factory_impl.cc +++ b/content/common/gpu/media/gpu_video_decode_accelerator_factory_impl.cc
@@ -31,13 +31,6 @@ namespace content { -namespace { -static base::WeakPtr<gpu::gles2::GLES2Decoder> GetEmptyGLES2Decoder() { - NOTREACHED() << "VDA requests a GLES2Decoder, but client did not provide it"; - return base::WeakPtr<gpu::gles2::GLES2Decoder>(); -} -} - // static std::unique_ptr<GpuVideoDecodeAcceleratorFactoryImpl> GpuVideoDecodeAcceleratorFactoryImpl::Create( @@ -46,7 +39,7 @@ const BindGLImageCallback& bind_image_cb) { return base::WrapUnique(new GpuVideoDecodeAcceleratorFactoryImpl( get_gl_context_cb, make_context_current_cb, bind_image_cb, - base::Bind(&GetEmptyGLES2Decoder))); + GetGLES2DecoderCallback())); } // static @@ -62,6 +55,13 @@ } // static +std::unique_ptr<GpuVideoDecodeAcceleratorFactoryImpl> +GpuVideoDecodeAcceleratorFactoryImpl::CreateWithNoGL() { + return Create(GetGLContextCallback(), MakeGLContextCurrentCallback(), + BindGLImageCallback()); +} + +// static gpu::VideoDecodeAcceleratorCapabilities GpuVideoDecodeAcceleratorFactoryImpl::GetDecoderCapabilities( const gpu::GpuPreferences& gpu_preferences) {
diff --git a/content/common/gpu/media/gpu_video_decode_accelerator_factory_impl.h b/content/common/gpu/media/gpu_video_decode_accelerator_factory_impl.h index ba093263b..ea4c58c 100644 --- a/content/common/gpu/media/gpu_video_decode_accelerator_factory_impl.h +++ b/content/common/gpu/media/gpu_video_decode_accelerator_factory_impl.h
@@ -5,6 +5,8 @@ #ifndef CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_DECODE_ACCELERATOR_FACTORY_IMPL_H_ #define CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_DECODE_ACCELERATOR_FACTORY_IMPL_H_ +#include <memory> + #include "base/callback.h" #include "base/threading/thread_checker.h" #include "content/common/content_export.h" @@ -70,6 +72,8 @@ const BindGLImageCallback& bind_image_cb, const GetGLES2DecoderCallback& get_gles2_decoder_cb); + static std::unique_ptr<GpuVideoDecodeAcceleratorFactoryImpl> CreateWithNoGL(); + static gpu::VideoDecodeAcceleratorCapabilities GetDecoderCapabilities( const gpu::GpuPreferences& gpu_preferences);
diff --git a/content/common/gpu/media/gpu_video_encode_accelerator.cc b/content/common/gpu/media/gpu_video_encode_accelerator.cc index eab2f941..6381658 100644 --- a/content/common/gpu/media/gpu_video_encode_accelerator.cc +++ b/content/common/gpu/media/gpu_video_encode_accelerator.cc
@@ -4,6 +4,8 @@ #include "content/common/gpu/media/gpu_video_encode_accelerator.h" +#include <memory> + #include "base/callback.h" #include "base/command_line.h" #include "base/logging.h"
diff --git a/content/common/gpu/media/jpeg_decode_accelerator_unittest.cc b/content/common/gpu/media/jpeg_decode_accelerator_unittest.cc index 53bc5d1..d872321 100644 --- a/content/common/gpu/media/jpeg_decode_accelerator_unittest.cc +++ b/content/common/gpu/media/jpeg_decode_accelerator_unittest.cc
@@ -10,6 +10,8 @@ #include <stdint.h> #include <string.h> +#include <memory> + #include "base/at_exit.h" #include "base/bind.h" #include "base/command_line.h"
diff --git a/content/common/gpu/media/media_channel.h b/content/common/gpu/media/media_channel.h index 7f0bca8..49c1ee7 100644 --- a/content/common/gpu/media/media_channel.h +++ b/content/common/gpu/media/media_channel.h
@@ -5,6 +5,8 @@ #ifndef CONTENT_COMMON_GPU_MEDIA_MEDIA_CHANNEL_H_ #define CONTENT_COMMON_GPU_MEDIA_MEDIA_CHANNEL_H_ +#include <memory> + #include "content/common/gpu/media/gpu_jpeg_decode_accelerator.h" #include "ipc/ipc_listener.h" #include "ipc/ipc_sender.h"
diff --git a/content/common/gpu/media/media_service.cc b/content/common/gpu/media/media_service.cc index b274589b..1fbd51e 100644 --- a/content/common/gpu/media/media_service.cc +++ b/content/common/gpu/media/media_service.cc
@@ -4,6 +4,7 @@ #include "content/common/gpu/media/media_service.h" +#include <memory> #include <utility> #include "content/common/gpu/media/gpu_video_decode_accelerator.h"
diff --git a/content/common/gpu/media/media_service.h b/content/common/gpu/media/media_service.h index eaa01e3f..0d8d6499 100644 --- a/content/common/gpu/media/media_service.h +++ b/content/common/gpu/media/media_service.h
@@ -7,6 +7,8 @@ #include <stdint.h> +#include <memory> + #include "base/containers/scoped_ptr_hash_map.h" #include "base/macros.h" #include "ipc/ipc_listener.h"
diff --git a/content/common/gpu/media/rendering_helper.cc b/content/common/gpu/media/rendering_helper.cc index 86e4e37..7923880 100644 --- a/content/common/gpu/media/rendering_helper.cc +++ b/content/common/gpu/media/rendering_helper.cc
@@ -7,6 +7,7 @@ #include <string.h> #include <algorithm> +#include <memory> #include <numeric> #include <vector>
diff --git a/content/common/gpu/media/rendering_helper.h b/content/common/gpu/media/rendering_helper.h index 6a43b39..1fc592e 100644 --- a/content/common/gpu/media/rendering_helper.h +++ b/content/common/gpu/media/rendering_helper.h
@@ -9,6 +9,7 @@ #include <stdint.h> #include <map> +#include <memory> #include <queue> #include <vector>
diff --git a/content/common/gpu/media/tegra_v4l2_device.cc b/content/common/gpu/media/tegra_v4l2_device.cc index a2864496..6efe16f 100644 --- a/content/common/gpu/media/tegra_v4l2_device.cc +++ b/content/common/gpu/media/tegra_v4l2_device.cc
@@ -189,13 +189,14 @@ return v4l2_pixfmt == V4L2_PIX_FMT_NV12M; } -EGLImageKHR TegraV4L2Device::CreateEGLImage(EGLDisplay egl_display, - EGLContext egl_context, - GLuint texture_id, - gfx::Size /* frame_buffer_size */, - unsigned int buffer_index, - uint32_t v4l2_pixfmt, - size_t /* num_v4l2_planes */) { +EGLImageKHR TegraV4L2Device::CreateEGLImage( + EGLDisplay egl_display, + EGLContext egl_context, + GLuint texture_id, + const gfx::Size& /* size */, + unsigned int buffer_index, + uint32_t v4l2_pixfmt, + const std::vector<base::ScopedFD>& /* dmabuf_fds */) { DVLOG(3) << "CreateEGLImage()"; if (!CanCreateEGLImageFrom(v4l2_pixfmt)) { LOG(ERROR) << "Unsupported V4L2 pixel format";
diff --git a/content/common/gpu/media/tegra_v4l2_device.h b/content/common/gpu/media/tegra_v4l2_device.h index 96b07a9d..30376db 100644 --- a/content/common/gpu/media/tegra_v4l2_device.h +++ b/content/common/gpu/media/tegra_v4l2_device.h
@@ -40,13 +40,14 @@ size_t num_planes, enum v4l2_buf_type type) override; bool CanCreateEGLImageFrom(uint32_t v4l2_pixfmt) override; - EGLImageKHR CreateEGLImage(EGLDisplay egl_display, - EGLContext egl_context, - GLuint texture_id, - gfx::Size frame_buffer_size, - unsigned int buffer_index, - uint32_t v4l2_pixfmt, - size_t num_v4l2_planes); + EGLImageKHR CreateEGLImage( + EGLDisplay egl_display, + EGLContext egl_context, + GLuint texture_id, + const gfx::Size& size, + unsigned int buffer_index, + uint32_t v4l2_pixfmt, + const std::vector<base::ScopedFD>& dmabuf_fds) override; EGLBoolean DestroyEGLImage(EGLDisplay egl_display, EGLImageKHR egl_image) override; GLenum GetTextureTarget() override;
diff --git a/content/common/gpu/media/v4l2_device.h b/content/common/gpu/media/v4l2_device.h index 0a88d76..10905f6 100644 --- a/content/common/gpu/media/v4l2_device.h +++ b/content/common/gpu/media/v4l2_device.h
@@ -103,18 +103,21 @@ // for the current platform. virtual bool CanCreateEGLImageFrom(uint32_t v4l2_pixfmt) = 0; - // Creates an EGLImageKHR since each V4L2Device may use a different method of - // acquiring one and associating it to the given texture. The texture_id is - // used to bind the texture to the returned EGLImageKHR. buffer_index can be - // used to associate the returned EGLImageKHR by the underlying V4L2Device - // implementation. - virtual EGLImageKHR CreateEGLImage(EGLDisplay egl_display, - EGLContext egl_context, - GLuint texture_id, - gfx::Size frame_buffer_size, - unsigned int buffer_index, - uint32_t v4l2_pixfmt, - size_t num_v4l2_planes) = 0; + // Create an EGLImage from provided |dmabuf_fds| and bind |texture_id| to it. + // Some implementations may also require the V4L2 |buffer_index| of the buffer + // for which |dmabuf_fds| have been exported. + // The caller may choose to close the file descriptors after this method + // returns, and may expect the buffers to remain valid for the lifetime of + // the created EGLImage. + // Return EGL_NO_IMAGE_KHR on failure. + virtual EGLImageKHR CreateEGLImage( + EGLDisplay egl_display, + EGLContext egl_context, + GLuint texture_id, + const gfx::Size& size, + unsigned int buffer_index, + uint32_t v4l2_pixfmt, + const std::vector<base::ScopedFD>& dmabuf_fds) = 0; // Destroys the EGLImageKHR. virtual EGLBoolean DestroyEGLImage(EGLDisplay egl_display,
diff --git a/content/common/gpu/media/v4l2_image_processor.cc b/content/common/gpu/media/v4l2_image_processor.cc index 1ac7029..ca56c8b 100644 --- a/content/common/gpu/media/v4l2_image_processor.cc +++ b/content/common/gpu/media/v4l2_image_processor.cc
@@ -11,6 +11,8 @@ #include <sys/ioctl.h> #include <sys/mman.h> +#include <memory> + #include "base/bind.h" #include "base/bind_helpers.h" #include "base/callback.h" @@ -298,7 +300,7 @@ reqbufs.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE; reqbufs.memory = V4L2_MEMORY_USERPTR; IOCTL_OR_ERROR_RETURN_FALSE(VIDIOC_REQBUFS, &reqbufs); - if (reqbufs.count != num_buffers_) { + if (static_cast<int>(reqbufs.count) != num_buffers_) { LOG(ERROR) << "Failed to allocate input buffers. reqbufs.count=" << reqbufs.count << ", num_buffers=" << num_buffers_; return false; @@ -355,7 +357,7 @@ reqbufs.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; reqbufs.memory = V4L2_MEMORY_MMAP; IOCTL_OR_ERROR_RETURN_FALSE(VIDIOC_REQBUFS, &reqbufs); - if (reqbufs.count != num_buffers_) { + if (static_cast<int>(reqbufs.count) != num_buffers_) { LOG(ERROR) << "Failed to allocate output buffers. reqbufs.count=" << reqbufs.count << ", num_buffers=" << num_buffers_; return false; @@ -599,7 +601,7 @@ bool V4L2ImageProcessor::EnqueueOutputRecord(int index) { DCHECK_GE(index, 0); - DCHECK_LT(index, output_buffer_map_.size()); + DCHECK_LT(static_cast<size_t>(index), output_buffer_map_.size()); // Enqueue an output (VIDEO_CAPTURE) buffer. OutputRecord& output_record = output_buffer_map_[index]; DCHECK(!output_record.at_device);
diff --git a/content/common/gpu/media/v4l2_image_processor.h b/content/common/gpu/media/v4l2_image_processor.h index 3457f38d..2b40f3c 100644 --- a/content/common/gpu/media/v4l2_image_processor.h +++ b/content/common/gpu/media/v4l2_image_processor.h
@@ -8,6 +8,7 @@ #include <stddef.h> #include <stdint.h> +#include <memory> #include <queue> #include <vector>
diff --git a/content/common/gpu/media/v4l2_jpeg_decode_accelerator.cc b/content/common/gpu/media/v4l2_jpeg_decode_accelerator.cc index c563afc..7af27592 100644 --- a/content/common/gpu/media/v4l2_jpeg_decode_accelerator.cc +++ b/content/common/gpu/media/v4l2_jpeg_decode_accelerator.cc
@@ -2,15 +2,18 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "content/common/gpu/media/v4l2_jpeg_decode_accelerator.h" + #include <errno.h> #include <linux/videodev2.h> #include <string.h> #include <sys/mman.h> +#include <memory> + #include "base/big_endian.h" #include "base/bind.h" #include "base/thread_task_runner_handle.h" -#include "content/common/gpu/media/v4l2_jpeg_decode_accelerator.h" #include "media/filters/jpeg_parser.h" #include "third_party/libyuv/include/libyuv.h"
diff --git a/content/common/gpu/media/v4l2_jpeg_decode_accelerator.h b/content/common/gpu/media/v4l2_jpeg_decode_accelerator.h index a7e0f65..da61120 100644 --- a/content/common/gpu/media/v4l2_jpeg_decode_accelerator.h +++ b/content/common/gpu/media/v4l2_jpeg_decode_accelerator.h
@@ -8,6 +8,7 @@ #include <stddef.h> #include <stdint.h> +#include <memory> #include <queue> #include <vector>
diff --git a/content/common/gpu/media/v4l2_slice_video_decode_accelerator.cc b/content/common/gpu/media/v4l2_slice_video_decode_accelerator.cc index 50e6c59..57550a3 100644 --- a/content/common/gpu/media/v4l2_slice_video_decode_accelerator.cc +++ b/content/common/gpu/media/v4l2_slice_video_decode_accelerator.cc
@@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "content/common/gpu/media/v4l2_slice_video_decode_accelerator.h" + #include <errno.h> #include <fcntl.h> #include <linux/videodev2.h> @@ -11,16 +13,18 @@ #include <sys/ioctl.h> #include <sys/mman.h> +#include <memory> + #include "base/bind.h" #include "base/bind_helpers.h" #include "base/callback.h" #include "base/callback_helpers.h" #include "base/command_line.h" #include "base/macros.h" +#include "base/memory/ptr_util.h" #include "base/numerics/safe_conversions.h" #include "base/strings/stringprintf.h" #include "content/common/gpu/media/shared_memory_region.h" -#include "content/common/gpu/media/v4l2_slice_video_decode_accelerator.h" #include "media/base/bind_to_current_loop.h" #include "media/base/media_switches.h" #include "ui/gl/gl_context.h" @@ -162,10 +166,10 @@ : at_device(false), at_client(false), picture_id(-1), + texture_id(0), egl_image(EGL_NO_IMAGE_KHR), egl_sync(EGL_NO_SYNC_KHR), - cleared(false) { -} + cleared(false) {} struct V4L2SliceVideoDecodeAccelerator::BitstreamBufferRef { BitstreamBufferRef( @@ -395,11 +399,11 @@ video_profile_(media::VIDEO_CODEC_PROFILE_UNKNOWN), output_format_fourcc_(0), state_(kUninitialized), + output_mode_(Config::OutputMode::ALLOCATE), decoder_flushing_(false), decoder_resetting_(false), surface_set_change_pending_(false), picture_clearing_count_(0), - pictures_assigned_(false, false), egl_display_(egl_display), get_gl_context_cb_(get_gl_context_cb), make_context_current_cb_(make_context_current_cb), @@ -438,8 +442,10 @@ DCHECK(child_task_runner_->BelongsToCurrentThread()); DCHECK_EQ(state_, kUninitialized); - if (get_gl_context_cb_.is_null() || make_context_current_cb_.is_null()) { - NOTREACHED() << "GL callbacks are required for this VDA"; + if (!device_->SupportsDecodeProfileForV4L2PixelFormats( + config.profile, arraysize(supported_input_fourccs_), + supported_input_fourccs_)) { + DVLOGF(1) << "unsupported profile " << config.profile; return false; } @@ -448,10 +454,9 @@ return false; } - if (!device_->SupportsDecodeProfileForV4L2PixelFormats( - config.profile, arraysize(supported_input_fourccs_), - supported_input_fourccs_)) { - DVLOGF(1) << "unsupported profile " << config.profile; + if (config.output_mode != Config::OutputMode::ALLOCATE && + config.output_mode != Config::OutputMode::IMPORT) { + NOTREACHED() << "Only ALLOCATE and IMPORT OutputModes are supported"; return false; } @@ -492,14 +497,18 @@ } // We need the context to be initialized to query extensions. - if (!make_context_current_cb_.Run()) { - LOG(ERROR) << "Initialize(): could not make context current"; - return false; - } + if (!make_context_current_cb_.is_null()) { + if (!make_context_current_cb_.Run()) { + LOG(ERROR) << "Initialize(): could not make context current"; + return false; + } - if (!gfx::g_driver_egl.ext.b_EGL_KHR_fence_sync) { - LOG(ERROR) << "Initialize(): context does not have EGL_KHR_fence_sync"; - return false; + if (!gfx::g_driver_egl.ext.b_EGL_KHR_fence_sync) { + LOG(ERROR) << "Initialize(): context does not have EGL_KHR_fence_sync"; + return false; + } + } else { + DVLOG(1) << "No GL callbacks provided, initializing without GL support"; } // Capabilities check. @@ -522,6 +531,7 @@ decoder_thread_task_runner_ = decoder_thread_.task_runner(); state_ = kInitialized; + output_mode_ = config.output_mode; // InitializeTask will NOTIFY_ERROR on failure. decoder_thread_task_runner_->PostTask( @@ -554,11 +564,6 @@ FROM_HERE, base::Bind(&V4L2SliceVideoDecodeAccelerator::DestroyTask, base::Unretained(this))); - // Wake up decoder thread in case we are waiting in CreateOutputBuffers - // for client to provide pictures. Since this is Destroy, we won't be - // getting them anymore (AssignPictureBuffers won't be called). - pictures_assigned_.Signal(); - // Wait for tasks to finish/early-exit. decoder_thread_.Stop(); } @@ -760,12 +765,15 @@ client_, num_pictures, 1, coded_size_, device_->GetTextureTarget())); - // Wait for the client to call AssignPictureBuffers() on the Child thread. - // We do this, because if we continue decoding without finishing buffer - // allocation, we may end up Resetting before AssignPictureBuffers arrives, - // resulting in unnecessary complications and subtle bugs. - pictures_assigned_.Wait(); - + // Go into kAwaitingPictureBuffers to prevent us from doing any more decoding + // or event handling while we are waiting for AssignPictureBuffers(). Not + // having Pictures available would not have prevented us from making decoding + // progress entirely e.g. in the case of H.264 where we could further decode + // non-slice NALUs and could even get another resolution change before we were + // done with this one. After we get the buffers, we'll go back into kIdle and + // kick off further event processing, and eventually go back into kDecoding + // once no more events are pending (if any). + state_ = kAwaitingPictureBuffers; return true; } @@ -792,7 +800,7 @@ } void V4L2SliceVideoDecodeAccelerator::DismissPictures( - std::vector<int32_t> picture_buffer_ids, + const std::vector<int32_t>& picture_buffer_ids, base::WaitableEvent* done) { DVLOGF(3); DCHECK(child_task_runner_->BelongsToCurrentThread()); @@ -906,7 +914,7 @@ memset(&dqbuf, 0, sizeof(dqbuf)); memset(&planes, 0, sizeof(planes)); dqbuf.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE; - dqbuf.memory = V4L2_MEMORY_USERPTR; + dqbuf.memory = V4L2_MEMORY_MMAP; dqbuf.m.planes = planes; dqbuf.length = input_planes_count_; if (device_->Ioctl(VIDIOC_DQBUF, &dqbuf) != 0) { @@ -932,7 +940,9 @@ memset(&dqbuf, 0, sizeof(dqbuf)); memset(&planes, 0, sizeof(planes)); dqbuf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; - dqbuf.memory = V4L2_MEMORY_MMAP; + dqbuf.memory = + (output_mode_ == Config::OutputMode::ALLOCATE ? V4L2_MEMORY_MMAP + : V4L2_MEMORY_DMABUF); dqbuf.m.planes = planes; dqbuf.length = output_planes_count_; if (device_->Ioctl(VIDIOC_DQBUF, &dqbuf) != 0) { @@ -968,16 +978,47 @@ ProcessPendingEventsIfNeeded(); } +void V4L2SliceVideoDecodeAccelerator::NewEventPending() { + // Switch to event processing mode if we are decoding. Otherwise we are either + // already in it, or we will potentially switch to it later, after finishing + // other tasks. + if (state_ == kDecoding) + state_ = kIdle; + + ProcessPendingEventsIfNeeded(); +} + +bool V4L2SliceVideoDecodeAccelerator::FinishEventProcessing() { + DCHECK_EQ(state_, kIdle); + + state_ = kDecoding; + ScheduleDecodeBufferTaskIfNeeded(); + + return true; +} + void V4L2SliceVideoDecodeAccelerator::ProcessPendingEventsIfNeeded() { + DCHECK(decoder_thread_task_runner_->BelongsToCurrentThread()); + // Process pending events, if any, in the correct order. // We always first process the surface set change, as it is an internal // event from the decoder and interleaving it with external requests would // put the decoder in an undefined state. - FinishSurfaceSetChangeIfNeeded(); + using ProcessFunc = bool (V4L2SliceVideoDecodeAccelerator::*)(); + const ProcessFunc process_functions[] = { + &V4L2SliceVideoDecodeAccelerator::FinishSurfaceSetChange, + &V4L2SliceVideoDecodeAccelerator::FinishFlush, + &V4L2SliceVideoDecodeAccelerator::FinishReset, + &V4L2SliceVideoDecodeAccelerator::FinishEventProcessing, + }; - // Process external (client) requests. - FinishFlushIfNeeded(); - FinishResetIfNeeded(); + for (const auto& fn : process_functions) { + if (state_ != kIdle) + return; + + if (!(this->*fn)()) + return; + } } void V4L2SliceVideoDecodeAccelerator::ReuseInputBuffer(int index) { @@ -1050,7 +1091,6 @@ OutputRecord& output_record = output_buffer_map_[index]; DCHECK(!output_record.at_device); DCHECK(!output_record.at_client); - DCHECK_NE(output_record.egl_image, EGL_NO_IMAGE_KHR); DCHECK_NE(output_record.picture_id, -1); if (output_record.egl_sync != EGL_NO_SYNC_KHR) { @@ -1076,7 +1116,16 @@ memset(qbuf_planes, 0, sizeof(qbuf_planes)); qbuf.index = index; qbuf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; - qbuf.memory = V4L2_MEMORY_MMAP; + if (output_mode_ == Config::OutputMode::ALLOCATE) { + qbuf.memory = V4L2_MEMORY_MMAP; + } else { + qbuf.memory = V4L2_MEMORY_DMABUF; + DCHECK_EQ(output_planes_count_, output_record.dmabuf_fds.size()); + for (size_t i = 0; i < output_record.dmabuf_fds.size(); ++i) { + DCHECK(output_record.dmabuf_fds[i].is_valid()); + qbuf_planes[i].m.fd = output_record.dmabuf_fds[i].get(); + } + } qbuf.m.planes = qbuf_planes; qbuf.length = output_planes_count_; IOCTL_OR_ERROR_RETURN_FALSE(VIDIOC_QBUF, &qbuf); @@ -1302,22 +1351,22 @@ void V4L2SliceVideoDecodeAccelerator::InitiateSurfaceSetChange() { DVLOGF(2); DCHECK(decoder_thread_task_runner_->BelongsToCurrentThread()); - DCHECK_EQ(state_, kDecoding); - state_ = kIdle; DCHECK(!surface_set_change_pending_); surface_set_change_pending_ = true; - - FinishSurfaceSetChangeIfNeeded(); + NewEventPending(); } -void V4L2SliceVideoDecodeAccelerator::FinishSurfaceSetChangeIfNeeded() { +bool V4L2SliceVideoDecodeAccelerator::FinishSurfaceSetChange() { DVLOGF(2); DCHECK(decoder_thread_task_runner_->BelongsToCurrentThread()); - if (!surface_set_change_pending_ || !surfaces_at_device_.empty()) - return; + if (!surface_set_change_pending_) + return true; + + if (!surfaces_at_device_.empty()) + return false; DCHECK_EQ(state_, kIdle); DCHECK(decoder_display_queue_.empty()); @@ -1330,7 +1379,7 @@ // Keep input queue running while we switch outputs. if (!StopDevicePoll(true)) { NOTIFY_ERROR(PLATFORM_FAILURE); - return; + return false; } // This will return only once all buffers are dismissed and destroyed. @@ -1339,36 +1388,28 @@ // after displaying. if (!DestroyOutputs(true)) { NOTIFY_ERROR(PLATFORM_FAILURE); - return; + return false; } if (!CreateOutputBuffers()) { NOTIFY_ERROR(PLATFORM_FAILURE); - return; + return false; } - if (!StartDevicePoll()) { - NOTIFY_ERROR(PLATFORM_FAILURE); - return; - } - - DVLOGF(3) << "Surface set change finished"; - surface_set_change_pending_ = false; - state_ = kDecoding; - ScheduleDecodeBufferTaskIfNeeded(); + DVLOG(3) << "Surface set change finished"; + return true; } bool V4L2SliceVideoDecodeAccelerator::DestroyOutputs(bool dismiss) { DVLOGF(3); DCHECK(decoder_thread_task_runner_->BelongsToCurrentThread()); - std::vector<EGLImageKHR> egl_images_to_destroy; std::vector<int32_t> picture_buffers_to_dismiss; if (output_buffer_map_.empty()) return true; - for (auto output_record : output_buffer_map_) { + for (const auto& output_record : output_buffer_map_) { DCHECK(!output_record.at_device); if (output_record.egl_sync != EGL_NO_SYNC_KHR) { @@ -1446,6 +1487,18 @@ DVLOGF(3); DCHECK(child_task_runner_->BelongsToCurrentThread()); + decoder_thread_task_runner_->PostTask( + FROM_HERE, + base::Bind(&V4L2SliceVideoDecodeAccelerator::AssignPictureBuffersTask, + base::Unretained(this), buffers)); +} + +void V4L2SliceVideoDecodeAccelerator::AssignPictureBuffersTask( + const std::vector<media::PictureBuffer>& buffers) { + DVLOGF(3); + DCHECK(decoder_thread_task_runner_->BelongsToCurrentThread()); + DCHECK_EQ(state_, kAwaitingPictureBuffers); + const uint32_t req_buffer_count = decoder_->GetRequiredNumOfPictures(); if (buffers.size() < req_buffer_count) { @@ -1456,6 +1509,88 @@ return; } + // Allocate the output buffers. + struct v4l2_requestbuffers reqbufs; + memset(&reqbufs, 0, sizeof(reqbufs)); + reqbufs.count = buffers.size(); + reqbufs.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; + reqbufs.memory = + (output_mode_ == Config::OutputMode::ALLOCATE ? V4L2_MEMORY_MMAP + : V4L2_MEMORY_DMABUF); + IOCTL_OR_ERROR_RETURN(VIDIOC_REQBUFS, &reqbufs); + + if (reqbufs.count != buffers.size()) { + DLOG(ERROR) << "Could not allocate enough output buffers"; + NOTIFY_ERROR(PLATFORM_FAILURE); + return; + } + + DCHECK(free_output_buffers_.empty()); + DCHECK(output_buffer_map_.empty()); + output_buffer_map_.resize(buffers.size()); + for (size_t i = 0; i < output_buffer_map_.size(); ++i) { + DCHECK(buffers[i].size() == coded_size_); + DCHECK_EQ(1u, buffers[i].texture_ids().size()); + + OutputRecord& output_record = output_buffer_map_[i]; + DCHECK(!output_record.at_device); + DCHECK(!output_record.at_client); + DCHECK_EQ(output_record.egl_image, EGL_NO_IMAGE_KHR); + DCHECK_EQ(output_record.egl_sync, EGL_NO_SYNC_KHR); + DCHECK_EQ(output_record.picture_id, -1); + DCHECK(output_record.dmabuf_fds.empty()); + DCHECK_EQ(output_record.cleared, false); + + output_record.picture_id = buffers[i].id(); + output_record.texture_id = buffers[i].texture_ids()[0]; + // This will remain true until ImportBufferForPicture is called, either by + // the client, or by ourselves, if we are allocating. + output_record.at_client = true; + if (output_mode_ == Config::OutputMode::ALLOCATE) { + std::vector<base::ScopedFD> dmabuf_fds = + std::move(device_->GetDmabufsForV4L2Buffer( + i, output_planes_count_, V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE)); + if (dmabuf_fds.empty()) { + NOTIFY_ERROR(PLATFORM_FAILURE); + return; + } + + auto passed_dmabuf_fds(base::WrapUnique( + new std::vector<base::ScopedFD>(std::move(dmabuf_fds)))); + ImportBufferForPictureTask(output_record.picture_id, + std::move(passed_dmabuf_fds)); + } // else we'll get triggered via ImportBufferForPicture() from client. + DVLOGF(3) << "buffer[" << i << "]: picture_id=" << output_record.picture_id; + } + + if (!StartDevicePoll()) { + NOTIFY_ERROR(PLATFORM_FAILURE); + return; + } + + // Put us in kIdle to allow further event processing. + // ProcessPendingEventsIfNeeded() will put us back into kDecoding after all + // other pending events are processed successfully. + state_ = kIdle; + ProcessPendingEventsIfNeeded(); +} + +void V4L2SliceVideoDecodeAccelerator::CreateEGLImageFor( + size_t buffer_index, + int32_t picture_buffer_id, + std::unique_ptr<std::vector<base::ScopedFD>> passed_dmabuf_fds, + GLuint texture_id, + const gfx::Size& size, + uint32_t fourcc) { + DVLOGF(3) << "index=" << buffer_index; + DCHECK(child_task_runner_->BelongsToCurrentThread()); + + if (get_gl_context_cb_.is_null() || make_context_current_cb_.is_null()) { + DLOG(ERROR) << "GL callbacks required for binding to EGLImages"; + NOTIFY_ERROR(INVALID_ARGUMENT); + return; + } + gfx::GLContext* gl_context = get_gl_context_cb_.Run(); if (!gl_context || !make_context_current_cb_.Run()) { DLOG(ERROR) << "No GL context"; @@ -1465,57 +1600,146 @@ gfx::ScopedTextureBinder bind_restore(GL_TEXTURE_EXTERNAL_OES, 0); - // It's safe to manipulate all the buffer state here, because the decoder - // thread is waiting on pictures_assigned_. - - // Allocate the output buffers. - struct v4l2_requestbuffers reqbufs; - memset(&reqbufs, 0, sizeof(reqbufs)); - reqbufs.count = buffers.size(); - reqbufs.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; - reqbufs.memory = V4L2_MEMORY_MMAP; - IOCTL_OR_ERROR_RETURN(VIDIOC_REQBUFS, &reqbufs); - - if (reqbufs.count != buffers.size()) { - DLOG(ERROR) << "Could not allocate enough output buffers"; + EGLImageKHR egl_image = + device_->CreateEGLImage(egl_display_, gl_context->GetHandle(), texture_id, + size, buffer_index, fourcc, *passed_dmabuf_fds); + if (egl_image == EGL_NO_IMAGE_KHR) { + LOGF(ERROR) << "Could not create EGLImageKHR," + << " index=" << buffer_index << " texture_id=" << texture_id; NOTIFY_ERROR(PLATFORM_FAILURE); return; } - output_buffer_map_.resize(buffers.size()); + decoder_thread_task_runner_->PostTask( + FROM_HERE, + base::Bind(&V4L2SliceVideoDecodeAccelerator::AssignEGLImage, + base::Unretained(this), buffer_index, picture_buffer_id, + egl_image, base::Passed(&passed_dmabuf_fds))); +} - DCHECK(free_output_buffers_.empty()); - for (size_t i = 0; i < output_buffer_map_.size(); ++i) { - DCHECK(buffers[i].size() == coded_size_); +void V4L2SliceVideoDecodeAccelerator::AssignEGLImage( + size_t buffer_index, + int32_t picture_buffer_id, + EGLImageKHR egl_image, + std::unique_ptr<std::vector<base::ScopedFD>> passed_dmabuf_fds) { + DVLOGF(3) << "index=" << buffer_index; + DCHECK(decoder_thread_task_runner_->BelongsToCurrentThread()); - OutputRecord& output_record = output_buffer_map_[i]; - DCHECK(!output_record.at_device); - DCHECK(!output_record.at_client); - DCHECK_EQ(output_record.egl_image, EGL_NO_IMAGE_KHR); - DCHECK_EQ(output_record.egl_sync, EGL_NO_SYNC_KHR); - DCHECK_EQ(output_record.picture_id, -1); - DCHECK_EQ(output_record.cleared, false); - - DCHECK_LE(1u, buffers[i].texture_ids().size()); - EGLImageKHR egl_image = device_->CreateEGLImage( - egl_display_, gl_context->GetHandle(), buffers[i].texture_ids()[0], - buffers[i].size(), i, output_format_fourcc_, output_planes_count_); - if (egl_image == EGL_NO_IMAGE_KHR) { - LOGF(ERROR) << "Could not create EGLImageKHR"; - // Ownership of EGLImages allocated in previous iterations of this loop - // has been transferred to output_buffer_map_. After we error-out here - // the destructor will handle their cleanup. - NOTIFY_ERROR(PLATFORM_FAILURE); - return; - } - - output_record.egl_image = egl_image; - output_record.picture_id = buffers[i].id(); - free_output_buffers_.push_back(i); - DVLOGF(3) << "buffer[" << i << "]: picture_id=" << output_record.picture_id; + // It's possible that while waiting for the EGLImages to be allocated and + // assigned, we have already decoded more of the stream and saw another + // resolution change. This is a normal situation, in such a case either there + // is no output record with this index awaiting an EGLImage to be assigned to + // it, or the record is already updated to use a newer PictureBuffer and is + // awaiting an EGLImage associated with a different picture_buffer_id. If so, + // just discard this image, we will get the one we are waiting for later. + if (buffer_index >= output_buffer_map_.size() || + output_buffer_map_[buffer_index].picture_id != picture_buffer_id) { + DVLOGF(3) << "Picture set already changed, dropping EGLImage"; + child_task_runner_->PostTask( + FROM_HERE, base::Bind(base::IgnoreResult(&V4L2Device::DestroyEGLImage), + device_, egl_display_, egl_image)); + return; } - pictures_assigned_.Signal(); + OutputRecord& output_record = output_buffer_map_[buffer_index]; + DCHECK_EQ(output_record.egl_image, EGL_NO_IMAGE_KHR); + DCHECK_EQ(output_record.egl_sync, EGL_NO_SYNC_KHR); + DCHECK(!output_record.at_client); + DCHECK(!output_record.at_device); + + output_record.egl_image = egl_image; + if (output_mode_ == Config::OutputMode::IMPORT) { + DCHECK(output_record.dmabuf_fds.empty()); + output_record.dmabuf_fds = std::move(*passed_dmabuf_fds); + } + + DCHECK_EQ(std::count(free_output_buffers_.begin(), free_output_buffers_.end(), + buffer_index), + 0); + free_output_buffers_.push_back(buffer_index); + ScheduleDecodeBufferTaskIfNeeded(); +} + +void V4L2SliceVideoDecodeAccelerator::ImportBufferForPicture( + int32_t picture_buffer_id, + const std::vector<gfx::GpuMemoryBufferHandle>& gpu_memory_buffer_handles) { + DVLOGF(3) << "picture_buffer_id=" << picture_buffer_id; + DCHECK(child_task_runner_->BelongsToCurrentThread()); + + auto passed_dmabuf_fds(base::WrapUnique(new std::vector<base::ScopedFD>())); + for (const auto& handle : gpu_memory_buffer_handles) { + int fd = -1; +#if defined(USE_OZONE) + fd = handle.native_pixmap_handle.fd.fd; +#endif + DCHECK_NE(fd, -1); + passed_dmabuf_fds->push_back(base::ScopedFD(fd)); + } + + if (output_mode_ != Config::OutputMode::IMPORT) { + LOGF(ERROR) << "Cannot import in non-import mode"; + NOTIFY_ERROR(INVALID_ARGUMENT); + return; + } + + decoder_thread_task_runner_->PostTask( + FROM_HERE, + base::Bind(&V4L2SliceVideoDecodeAccelerator::ImportBufferForPictureTask, + base::Unretained(this), picture_buffer_id, + base::Passed(&passed_dmabuf_fds))); +} + +void V4L2SliceVideoDecodeAccelerator::ImportBufferForPictureTask( + int32_t picture_buffer_id, + std::unique_ptr<std::vector<base::ScopedFD>> passed_dmabuf_fds) { + DVLOGF(3) << "picture_buffer_id=" << picture_buffer_id; + DCHECK(decoder_thread_task_runner_->BelongsToCurrentThread()); + + const auto iter = + std::find_if(output_buffer_map_.begin(), output_buffer_map_.end(), + [picture_buffer_id](const OutputRecord& output_record) { + return output_record.picture_id == picture_buffer_id; + }); + if (iter == output_buffer_map_.end()) { + LOGF(ERROR) << "Invalid picture_buffer_id=" << picture_buffer_id; + NOTIFY_ERROR(INVALID_ARGUMENT); + return; + } + + if (!iter->at_client) { + LOGF(ERROR) << "Cannot import buffer that not owned by client"; + NOTIFY_ERROR(INVALID_ARGUMENT); + return; + } + + size_t index = iter - output_buffer_map_.begin(); + DCHECK_EQ(std::count(free_output_buffers_.begin(), free_output_buffers_.end(), + index), + 0); + + DCHECK(!iter->at_device); + iter->at_client = false; + if (iter->texture_id != 0) { + if (iter->egl_image != EGL_NO_IMAGE_KHR) { + child_task_runner_->PostTask( + FROM_HERE, + base::Bind(base::IgnoreResult(&V4L2Device::DestroyEGLImage), device_, + egl_display_, iter->egl_image)); + } + + child_task_runner_->PostTask( + FROM_HERE, + base::Bind(&V4L2SliceVideoDecodeAccelerator::CreateEGLImageFor, + weak_this_, index, picture_buffer_id, + base::Passed(&passed_dmabuf_fds), iter->texture_id, + coded_size_, output_format_fourcc_)); + } else { + // No need for an EGLImage, start using this buffer now. + DCHECK_EQ(output_planes_count_, passed_dmabuf_fds->size()); + iter->dmabuf_fds.swap(*passed_dmabuf_fds); + free_output_buffers_.push_back(index); + ScheduleDecodeBufferTaskIfNeeded(); + } } void V4L2SliceVideoDecodeAccelerator::ReusePictureBuffer( @@ -1523,22 +1747,26 @@ DCHECK(child_task_runner_->BelongsToCurrentThread()); DVLOGF(4) << "picture_buffer_id=" << picture_buffer_id; - if (!make_context_current_cb_.Run()) { - LOGF(ERROR) << "could not make context current"; - NOTIFY_ERROR(PLATFORM_FAILURE); - return; + std::unique_ptr<EGLSyncKHRRef> egl_sync_ref; + + if (!make_context_current_cb_.is_null()) { + if (!make_context_current_cb_.Run()) { + LOGF(ERROR) << "could not make context current"; + NOTIFY_ERROR(PLATFORM_FAILURE); + return; + } + + EGLSyncKHR egl_sync = + eglCreateSyncKHR(egl_display_, EGL_SYNC_FENCE_KHR, NULL); + if (egl_sync == EGL_NO_SYNC_KHR) { + LOGF(ERROR) << "eglCreateSyncKHR() failed"; + NOTIFY_ERROR(PLATFORM_FAILURE); + return; + } + + egl_sync_ref.reset(new EGLSyncKHRRef(egl_display_, egl_sync)); } - EGLSyncKHR egl_sync = - eglCreateSyncKHR(egl_display_, EGL_SYNC_FENCE_KHR, NULL); - if (egl_sync == EGL_NO_SYNC_KHR) { - LOGF(ERROR) << "eglCreateSyncKHR() failed"; - NOTIFY_ERROR(PLATFORM_FAILURE); - return; - } - - std::unique_ptr<EGLSyncKHRRef> egl_sync_ref( - new EGLSyncKHRRef(egl_display_, egl_sync)); decoder_thread_task_runner_->PostTask( FROM_HERE, base::Bind(&V4L2SliceVideoDecodeAccelerator::ReusePictureBufferTask, @@ -1575,9 +1803,12 @@ DCHECK_EQ(output_record.egl_sync, EGL_NO_SYNC_KHR); DCHECK(!output_record.at_device); output_record.at_client = false; - output_record.egl_sync = egl_sync_ref->egl_sync; - // Take ownership of the EGLSync. - egl_sync_ref->egl_sync = EGL_NO_SYNC_KHR; + if (egl_sync_ref) { + output_record.egl_sync = egl_sync_ref->egl_sync; + // Take ownership of the EGLSync. + egl_sync_ref->egl_sync = EGL_NO_SYNC_KHR; + } + surfaces_at_display_.erase(it); } @@ -1611,10 +1842,6 @@ DVLOGF(3); DCHECK(decoder_thread_task_runner_->BelongsToCurrentThread()); - DCHECK(!decoder_flushing_); - DCHECK_EQ(state_, kDecoding); - state_ = kIdle; - // This will trigger output for all remaining surfaces in the decoder. // However, not all of them may be decoded yet (they would be queued // in hardware then). @@ -1627,20 +1854,20 @@ // Put the decoder in an idle state, ready to resume. decoder_->Reset(); + DCHECK(!decoder_flushing_); decoder_flushing_ = true; - - decoder_thread_task_runner_->PostTask( - FROM_HERE, - base::Bind(&V4L2SliceVideoDecodeAccelerator::FinishFlushIfNeeded, - base::Unretained(this))); + NewEventPending(); } -void V4L2SliceVideoDecodeAccelerator::FinishFlushIfNeeded() { +bool V4L2SliceVideoDecodeAccelerator::FinishFlush() { DVLOGF(3); DCHECK(decoder_thread_task_runner_->BelongsToCurrentThread()); - if (!decoder_flushing_ || !surfaces_at_device_.empty()) - return; + if (!decoder_flushing_) + return true; + + if (!surfaces_at_device_.empty()) + return false; DCHECK_EQ(state_, kIdle); @@ -1658,14 +1885,13 @@ SendPictureReady(); + decoder_flushing_ = false; + DVLOGF(3) << "Flush finished"; + child_task_runner_->PostTask(FROM_HERE, base::Bind(&Client::NotifyFlushDone, client_)); - decoder_flushing_ = false; - - DVLOGF(3) << "Flush finished"; - state_ = kDecoding; - ScheduleDecodeBufferTaskIfNeeded(); + return true; } void V4L2SliceVideoDecodeAccelerator::Reset() { @@ -1688,28 +1914,27 @@ return; } - DCHECK_EQ(state_, kDecoding); - state_ = kIdle; - // Put the decoder in an idle state, ready to resume. decoder_->Reset(); - decoder_resetting_ = true; - // Drop all remaining inputs. decoder_current_bitstream_buffer_.reset(); while (!decoder_input_queue_.empty()) decoder_input_queue_.pop(); - FinishResetIfNeeded(); + decoder_resetting_ = true; + NewEventPending(); } -void V4L2SliceVideoDecodeAccelerator::FinishResetIfNeeded() { +bool V4L2SliceVideoDecodeAccelerator::FinishReset() { DVLOGF(3); DCHECK(decoder_thread_task_runner_->BelongsToCurrentThread()); - if (!decoder_resetting_ || !surfaces_at_device_.empty()) - return; + if (!decoder_resetting_) + return true; + + if (!surfaces_at_device_.empty()) + return false; DCHECK_EQ(state_, kIdle); DCHECK(!decoder_flushing_); @@ -1733,14 +1958,12 @@ } decoder_resetting_ = false; + DVLOGF(3) << "Reset finished"; child_task_runner_->PostTask(FROM_HERE, base::Bind(&Client::NotifyResetDone, client_)); - DVLOGF(3) << "Reset finished"; - - state_ = kDecoding; - ScheduleDecodeBufferTaskIfNeeded(); + return true; } void V4L2SliceVideoDecodeAccelerator::SetErrorState(Error error) { @@ -2460,7 +2683,6 @@ DCHECK(!output_record.at_client); DCHECK(!output_record.at_device); - DCHECK_NE(output_record.egl_image, EGL_NO_IMAGE_KHR); DCHECK_NE(output_record.picture_id, -1); output_record.at_client = true; @@ -2566,6 +2788,11 @@ return true; } +media::VideoPixelFormat V4L2SliceVideoDecodeAccelerator::GetOutputFormat() + const { + return V4L2Device::V4L2PixFmtToVideoPixelFormat(output_format_fourcc_); +} + // static media::VideoDecodeAccelerator::SupportedProfiles V4L2SliceVideoDecodeAccelerator::GetSupportedProfiles() {
diff --git a/content/common/gpu/media/v4l2_slice_video_decode_accelerator.h b/content/common/gpu/media/v4l2_slice_video_decode_accelerator.h index d4b0e2e..f917e1a4 100644 --- a/content/common/gpu/media/v4l2_slice_video_decode_accelerator.h +++ b/content/common/gpu/media/v4l2_slice_video_decode_accelerator.h
@@ -11,6 +11,7 @@ #include <memory> #include <queue> +#include <utility> #include <vector> #include "base/macros.h" @@ -49,6 +50,9 @@ void Decode(const media::BitstreamBuffer& bitstream_buffer) override; void AssignPictureBuffers( const std::vector<media::PictureBuffer>& buffers) override; + void ImportBufferForPicture(int32_t picture_buffer_id, + const std::vector<gfx::GpuMemoryBufferHandle>& + gpu_memory_buffer_handles) override; void ReusePictureBuffer(int32_t picture_buffer_id) override; void Flush() override; void Reset() override; @@ -57,6 +61,7 @@ const base::WeakPtr<Client>& decode_client, const scoped_refptr<base::SingleThreadTaskRunner>& decode_task_runner) override; + media::VideoPixelFormat GetOutputFormat() const override; static media::VideoDecodeAccelerator::SupportedProfiles GetSupportedProfiles(); @@ -81,8 +86,10 @@ bool at_device; bool at_client; int32_t picture_id; + GLuint texture_id; EGLImageKHR egl_image; EGLSyncKHR egl_sync; + std::vector<base::ScopedFD> dmabuf_fds; bool cleared; }; @@ -158,28 +165,31 @@ // Dismiss all |picture_buffer_ids| via Client::DismissPictureBuffer() // and signal |done| after finishing. - void DismissPictures(std::vector<int32_t> picture_buffer_ids, + void DismissPictures(const std::vector<int32_t>& picture_buffer_ids, base::WaitableEvent* done); // Task to finish initialization on decoder_thread_. void InitializeTask(); - // Surface set change (resolution change) flow. - // If we have no surfaces allocated, just allocate them and return. - // Otherwise mark us as pending for surface set change. - void InitiateSurfaceSetChange(); - // If a surface set change is pending and we are ready, stop the device, - // destroy outputs, releasing resources and dismissing pictures as required, - // followed by allocating a new set for the new resolution/DPB size - // as provided by decoder. Finally, try to resume decoding. - void FinishSurfaceSetChangeIfNeeded(); - void NotifyError(Error error); void DestroyTask(); // Sets the state to kError and notifies client if needed. void SetErrorState(Error error); + // Event handling. Events include flush, reset and resolution change and are + // processed while in kIdle state. + + // Surface set change (resolution change) flow. + // If we have no surfaces allocated, start it immediately, otherwise mark + // ourselves as pending for surface set change. + void InitiateSurfaceSetChange(); + // If a surface set change is pending and we are ready, stop the device, + // destroy outputs, releasing resources and dismissing pictures as required, + // followed by starting the flow to allocate a new set for the current + // resolution/DPB size, as provided by decoder. + bool FinishSurfaceSetChange(); + // Flush flow when requested by client. // When Flush() is called, it posts a FlushTask, which checks the input queue. // If nothing is pending for decode on decoder_input_queue_, we call @@ -190,22 +200,78 @@ // Tell the decoder to flush all frames, reset it and mark us as scheduled // for flush, so that we can finish it once all pending decodes are finished. void InitiateFlush(); - // If all pending frames are decoded and we are waiting to flush, perform it. - // This will send all pending pictures to client and notify the client that - // flush is complete and puts us in a state ready to resume. - void FinishFlushIfNeeded(); + // To be called if decoder_flushing_ is true. If not all pending frames are + // decoded, return false, requesting the caller to try again later. + // Otherwise perform flush by sending all pending pictures to the client, + // notify it that flush is finished and return true, informing the caller + // that further progress can be made. + bool FinishFlush(); // Reset flow when requested by client. - // Drop all inputs and reset the decoder and mark us as pending for reset. + // Drop all inputs, reset the decoder and mark us as pending for reset. void ResetTask(); - // If all pending frames are decoded and we are waiting to reset, perform it. - // This drops all pending outputs (client is not interested anymore), - // notifies the client we are done and puts us in a state ready to resume. - void FinishResetIfNeeded(); + // To be called if decoder_resetting_ is true. If not all pending frames are + // decoded, return false, requesting the caller to try again later. + // Otherwise perform reset by dropping all pending outputs (client is not + // interested anymore), notifying it that reset is finished, and return true, + // informing the caller that further progress can be made. + bool FinishReset(); - // Process pending events if any. + // Called when a new event is pended. Transitions us into kIdle state (if not + // already in it), if possible. Also starts processing events. + void NewEventPending(); + + // Called after all events are processed successfully (i.e. all Finish*() + // methods return true) to return to decoding state. + bool FinishEventProcessing(); + + // Process pending events, if any. void ProcessPendingEventsIfNeeded(); + + // Allocate V4L2 buffers and assign them to |buffers| provided by the client + // via AssignPictureBuffers() on decoder thread. + void AssignPictureBuffersTask( + const std::vector<media::PictureBuffer>& buffers); + + // Use buffer backed by dmabuf file descriptors in |passed_dmabuf_fds| for the + // OutputRecord associated with |picture_buffer_id|, taking ownership of the + // file descriptors. + void ImportBufferForPictureTask( + int32_t picture_buffer_id, + // TODO(posciak): (crbug.com/561749) we should normally be able to pass + // the vector by itself via std::move, but it's not possible to do this + // if this method is used as a callback. + std::unique_ptr<std::vector<base::ScopedFD>> passed_dmabuf_fds); + + // Create an EGLImage for the buffer associated with V4L2 |buffer_index| and + // for |picture_buffer_id|, backed by dmabuf file descriptors in + // |passed_dmabuf_fds|, taking ownership of them. + // The buffer should be bound to |texture_id| and is of |size| and format + // described by |fourcc|. + void CreateEGLImageFor( + size_t buffer_index, + int32_t picture_buffer_id, + // TODO(posciak): (crbug.com/561749) we should normally be able to pass + // the vector by itself via std::move, but it's not possible to do this + // if this method is used as a callback. + std::unique_ptr<std::vector<base::ScopedFD>> passed_dmabuf_fds, + GLuint texture_id, + const gfx::Size& size, + uint32_t fourcc); + + // Take the EGLImage |egl_image|, created for |picture_buffer_id|, and use it + // for OutputRecord at |buffer_index|. The buffer is backed by + // |passed_dmabuf_fds|, and the OutputRecord takes ownership of them. + void AssignEGLImage( + size_t buffer_index, + int32_t picture_buffer_id, + EGLImageKHR egl_image, + // TODO(posciak): (crbug.com/561749) we should normally be able to pass + // the vector by itself via std::move, but it's not possible to do this + // if this method is used as a callback. + std::unique_ptr<std::vector<base::ScopedFD>> passed_dmabuf_fds); + // Performed on decoder_thread_ as a consequence of poll() on decoder_thread_ // returning an event. void ServiceDeviceTask(); @@ -232,6 +298,9 @@ // Transitional state when we are not decoding any more stream, but are // performing flush, reset, resolution change or are destroying ourselves. kIdle, + // Requested new PictureBuffers via ProvidePictureBuffers(), awaiting + // AssignPictureBuffers(). + kAwaitingPictureBuffers, // Error state, set when sending NotifyError to client. kError, }; @@ -347,6 +416,8 @@ // Decoder state. State state_; + Config::OutputMode output_mode_; + // If any of these are true, we are waiting for the device to finish decoding // all previously-queued frames, so we can finish the flush/reset/surface // change flows. These can stack. @@ -380,10 +451,6 @@ // The number of pictures that are sent to PictureReady and will be cleared. int picture_clearing_count_; - // Used by the decoder thread to wait for AssignPictureBuffers to arrive - // to avoid races with potential Reset requests. - base::WaitableEvent pictures_assigned_; - // EGL state EGLDisplay egl_display_;
diff --git a/content/common/gpu/media/v4l2_video_decode_accelerator.cc b/content/common/gpu/media/v4l2_video_decode_accelerator.cc index 51104159..a210d3b 100644 --- a/content/common/gpu/media/v4l2_video_decode_accelerator.cc +++ b/content/common/gpu/media/v4l2_video_decode_accelerator.cc
@@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "content/common/gpu/media/v4l2_video_decode_accelerator.h" + #include <dlfcn.h> #include <errno.h> #include <fcntl.h> @@ -12,6 +14,8 @@ #include <sys/ioctl.h> #include <sys/mman.h> +#include <memory> + #include "base/bind.h" #include "base/command_line.h" #include "base/macros.h" @@ -21,7 +25,6 @@ #include "base/trace_event/trace_event.h" #include "build/build_config.h" #include "content/common/gpu/media/shared_memory_region.h" -#include "content/common/gpu/media/v4l2_video_decode_accelerator.h" #include "media/base/media_switches.h" #include "media/filters/h264_parser.h" #include "ui/gfx/geometry/rect.h" @@ -205,8 +208,10 @@ DCHECK(child_task_runner_->BelongsToCurrentThread()); DCHECK_EQ(decoder_state_, kUninitialized); - if (get_gl_context_cb_.is_null() || make_context_current_cb_.is_null()) { - NOTREACHED() << "GL callbacks are required for this VDA"; + if (!device_->SupportsDecodeProfileForV4L2PixelFormats( + config.profile, arraysize(supported_input_fourccs_), + supported_input_fourccs_)) { + DVLOG(1) << "Initialize(): unsupported profile=" << config.profile; return false; } @@ -215,10 +220,13 @@ return false; } - if (!device_->SupportsDecodeProfileForV4L2PixelFormats( - config.profile, arraysize(supported_input_fourccs_), - supported_input_fourccs_)) { - DVLOG(1) << "Initialize(): unsupported profile=" << config.profile; + if (config.output_mode != Config::OutputMode::ALLOCATE) { + NOTREACHED() << "Only ALLOCATE OutputMode is supported by this VDA"; + return false; + } + + if (get_gl_context_cb_.is_null() || make_context_current_cb_.is_null()) { + NOTREACHED() << "GL callbacks are required for this VDA"; return false; } @@ -375,9 +383,21 @@ DCHECK_EQ(output_record.cleared, false); DCHECK_LE(1u, buffers[i].texture_ids().size()); - EGLImageKHR egl_image = device_->CreateEGLImage( - egl_display_, gl_context->GetHandle(), buffers[i].texture_ids()[0], - coded_size_, i, output_format_fourcc_, output_planes_count_); + std::vector<base::ScopedFD> dmabuf_fds; + dmabuf_fds = device_->GetDmabufsForV4L2Buffer( + i, output_planes_count_, V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE); + if (dmabuf_fds.empty()) { + NOTIFY_ERROR(PLATFORM_FAILURE); + return; + } + + EGLImageKHR egl_image = device_->CreateEGLImage(egl_display_, + gl_context->GetHandle(), + buffers[i].texture_ids()[0], + coded_size_, + i, + output_format_fourcc_, + dmabuf_fds); if (egl_image == EGL_NO_IMAGE_KHR) { LOG(ERROR) << "AssignPictureBuffers(): could not create EGLImageKHR"; // Ownership of EGLImages allocated in previous iterations of this loop @@ -471,6 +491,10 @@ return true; } +media::VideoPixelFormat V4L2VideoDecodeAccelerator::GetOutputFormat() const { + return V4L2Device::V4L2PixFmtToVideoPixelFormat(output_format_fourcc_); +} + // static media::VideoDecodeAccelerator::SupportedProfiles V4L2VideoDecodeAccelerator::GetSupportedProfiles() {
diff --git a/content/common/gpu/media/v4l2_video_decode_accelerator.h b/content/common/gpu/media/v4l2_video_decode_accelerator.h index a16af17..ab7cf846 100644 --- a/content/common/gpu/media/v4l2_video_decode_accelerator.h +++ b/content/common/gpu/media/v4l2_video_decode_accelerator.h
@@ -98,6 +98,7 @@ const base::WeakPtr<Client>& decode_client, const scoped_refptr<base::SingleThreadTaskRunner>& decode_task_runner) override; + media::VideoPixelFormat GetOutputFormat() const override; static media::VideoDecodeAccelerator::SupportedProfiles GetSupportedProfiles();
diff --git a/content/common/gpu/media/v4l2_video_encode_accelerator.cc b/content/common/gpu/media/v4l2_video_encode_accelerator.cc index f8b56ab..20cdd358 100644 --- a/content/common/gpu/media/v4l2_video_encode_accelerator.cc +++ b/content/common/gpu/media/v4l2_video_encode_accelerator.cc
@@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "content/common/gpu/media/v4l2_video_encode_accelerator.h" + #include <fcntl.h> #include <linux/videodev2.h> #include <poll.h> @@ -9,6 +11,8 @@ #include <sys/eventfd.h> #include <sys/ioctl.h> #include <sys/mman.h> + +#include <memory> #include <utility> #include "base/callback.h" @@ -18,7 +22,6 @@ #include "base/thread_task_runner_handle.h" #include "base/trace_event/trace_event.h" #include "content/common/gpu/media/shared_memory_region.h" -#include "content/common/gpu/media/v4l2_video_encode_accelerator.h" #include "media/base/bind_to_current_loop.h" #include "media/base/bitstream_buffer.h" @@ -354,7 +357,8 @@ DVLOG(3) << "FrameProcessed(): force_keyframe=" << force_keyframe << ", output_buffer_index=" << output_buffer_index; DCHECK_GE(output_buffer_index, 0); - DCHECK_LT(output_buffer_index, image_processor_output_buffer_map_.size()); + DCHECK_LT(static_cast<size_t>(output_buffer_index), + image_processor_output_buffer_map_.size()); std::vector<base::ScopedFD>& scoped_fds = image_processor_output_buffer_map_[output_buffer_index];
diff --git a/content/common/gpu/media/v4l2_video_encode_accelerator.h b/content/common/gpu/media/v4l2_video_encode_accelerator.h index f1f6a3c3..e49a5ee 100644 --- a/content/common/gpu/media/v4l2_video_encode_accelerator.h +++ b/content/common/gpu/media/v4l2_video_encode_accelerator.h
@@ -8,7 +8,9 @@ #include <linux/videodev2.h> #include <stddef.h> #include <stdint.h> + #include <list> +#include <memory> #include <vector> #include "base/files/scoped_file.h"
diff --git a/content/common/gpu/media/vaapi_jpeg_decode_accelerator.cc b/content/common/gpu/media/vaapi_jpeg_decode_accelerator.cc index 64931f6f..fc25553 100644 --- a/content/common/gpu/media/vaapi_jpeg_decode_accelerator.cc +++ b/content/common/gpu/media/vaapi_jpeg_decode_accelerator.cc
@@ -6,6 +6,8 @@ #include <stddef.h> #include <string.h> + +#include <memory> #include <utility> #include "base/bind.h"
diff --git a/content/common/gpu/media/vaapi_jpeg_decode_accelerator.h b/content/common/gpu/media/vaapi_jpeg_decode_accelerator.h index 6493c42..eaf54e86 100644 --- a/content/common/gpu/media/vaapi_jpeg_decode_accelerator.h +++ b/content/common/gpu/media/vaapi_jpeg_decode_accelerator.h
@@ -7,6 +7,8 @@ #include <stdint.h> +#include <memory> + #include "base/macros.h" #include "base/memory/linked_ptr.h" #include "base/memory/weak_ptr.h"
diff --git a/content/common/gpu/media/vaapi_video_decode_accelerator.cc b/content/common/gpu/media/vaapi_video_decode_accelerator.cc index 4d59c37..f41cf57 100644 --- a/content/common/gpu/media/vaapi_video_decode_accelerator.cc +++ b/content/common/gpu/media/vaapi_video_decode_accelerator.cc
@@ -6,6 +6,8 @@ #include <string.h> +#include <memory> + #include "base/bind.h" #include "base/logging.h" #include "base/macros.h" @@ -330,6 +332,11 @@ return false; } + if (config.output_mode != Config::OutputMode::ALLOCATE) { + NOTREACHED() << "Only ALLOCATE OutputMode is supported by this VDA"; + return false; + } + client_ptr_factory_.reset(new base::WeakPtrFactory<Client>(client)); client_ = client_ptr_factory_->GetWeakPtr();
diff --git a/content/common/gpu/media/vaapi_video_decode_accelerator.h b/content/common/gpu/media/vaapi_video_decode_accelerator.h index 5f95629..9f2b66b 100644 --- a/content/common/gpu/media/vaapi_video_decode_accelerator.h +++ b/content/common/gpu/media/vaapi_video_decode_accelerator.h
@@ -13,6 +13,7 @@ #include <list> #include <map> +#include <memory> #include <queue> #include <utility> #include <vector>
diff --git a/content/common/gpu/media/vaapi_video_encode_accelerator.cc b/content/common/gpu/media/vaapi_video_encode_accelerator.cc index 86e6676..dfa7f9f 100644 --- a/content/common/gpu/media/vaapi_video_encode_accelerator.cc +++ b/content/common/gpu/media/vaapi_video_encode_accelerator.cc
@@ -5,6 +5,8 @@ #include "content/common/gpu/media/vaapi_video_encode_accelerator.h" #include <string.h> + +#include <memory> #include <utility> #include "base/bind.h"
diff --git a/content/common/gpu/media/vaapi_video_encode_accelerator.h b/content/common/gpu/media/vaapi_video_encode_accelerator.h index 8cb709640..8a4c88cc 100644 --- a/content/common/gpu/media/vaapi_video_encode_accelerator.h +++ b/content/common/gpu/media/vaapi_video_encode_accelerator.h
@@ -9,6 +9,7 @@ #include <stdint.h> #include <list> +#include <memory> #include <queue> #include "base/macros.h"
diff --git a/content/common/gpu/media/video_decode_accelerator_unittest.cc b/content/common/gpu/media/video_decode_accelerator_unittest.cc index b62a908..a607071 100644 --- a/content/common/gpu/media/video_decode_accelerator_unittest.cc +++ b/content/common/gpu/media/video_decode_accelerator_unittest.cc
@@ -19,9 +19,11 @@ #include <stdint.h> #include <sys/stat.h> #include <sys/types.h> + #include <algorithm> #include <deque> #include <map> +#include <memory> #include <utility> #include "base/at_exit.h" @@ -74,8 +76,10 @@ #endif // OS_WIN #if defined(USE_OZONE) +#include "ui/ozone/public/native_pixmap.h" #include "ui/ozone/public/ozone_gpu_test_helper.h" #include "ui/ozone/public/ozone_platform.h" +#include "ui/ozone/public/surface_factory_ozone.h" #endif // defined(USE_OZONE) using media::VideoDecodeAccelerator; @@ -125,6 +129,10 @@ // Fake decode int g_fake_decoder = 0; +// Test buffer import into VDA, providing buffers allocated by us, instead of +// requesting the VDA itself to allocate buffers. +bool g_test_import = false; + // Environment to store rendering thread. class VideoDecodeAcceleratorTestEnvironment; VideoDecodeAcceleratorTestEnvironment* g_env; @@ -269,26 +277,106 @@ DISALLOW_COPY_AND_ASSIGN(VideoDecodeAcceleratorTestEnvironment); }; -// A helper class used to manage the lifetime of a Texture. +// A helper class used to manage the lifetime of a Texture. Can be backed by +// either a buffer allocated by the VDA, or by a preallocated pixmap. class TextureRef : public base::RefCounted<TextureRef> { public: - TextureRef(uint32_t texture_id, const base::Closure& no_longer_needed_cb) - : texture_id_(texture_id), no_longer_needed_cb_(no_longer_needed_cb) {} + static scoped_refptr<TextureRef> Create( + uint32_t texture_id, + const base::Closure& no_longer_needed_cb); + + static scoped_refptr<TextureRef> CreatePreallocated( + uint32_t texture_id, + const base::Closure& no_longer_needed_cb, + media::VideoPixelFormat pixel_format, + const gfx::Size& size); + + std::vector<gfx::GpuMemoryBufferHandle> ExportGpuMemoryBufferHandles() const; int32_t texture_id() const { return texture_id_; } private: friend class base::RefCounted<TextureRef>; + + TextureRef(uint32_t texture_id, const base::Closure& no_longer_needed_cb) + : texture_id_(texture_id), no_longer_needed_cb_(no_longer_needed_cb) {} + ~TextureRef(); uint32_t texture_id_; base::Closure no_longer_needed_cb_; +#if defined(USE_OZONE) + scoped_refptr<ui::NativePixmap> pixmap_; +#endif }; TextureRef::~TextureRef() { base::ResetAndReturn(&no_longer_needed_cb_).Run(); } +// static +scoped_refptr<TextureRef> TextureRef::Create( + uint32_t texture_id, + const base::Closure& no_longer_needed_cb) { + return make_scoped_refptr(new TextureRef(texture_id, no_longer_needed_cb)); +} + +#if defined(USE_OZONE) +gfx::BufferFormat VideoPixelFormatToGfxBufferFormat( + media::VideoPixelFormat pixel_format) { + switch (pixel_format) { + case media::VideoPixelFormat::PIXEL_FORMAT_ARGB: + return gfx::BufferFormat::BGRA_8888; + case media::VideoPixelFormat::PIXEL_FORMAT_XRGB: + return gfx::BufferFormat::BGRX_8888; + case media::VideoPixelFormat::PIXEL_FORMAT_NV12: + return gfx::BufferFormat::YUV_420_BIPLANAR; + default: + LOG_ASSERT(false) << "Unknown VideoPixelFormat"; + return gfx::BufferFormat::BGRX_8888; + } +} +#endif + +// static +scoped_refptr<TextureRef> TextureRef::CreatePreallocated( + uint32_t texture_id, + const base::Closure& no_longer_needed_cb, + media::VideoPixelFormat pixel_format, + const gfx::Size& size) { + scoped_refptr<TextureRef> texture_ref; +#if defined(USE_OZONE) + texture_ref = TextureRef::Create(texture_id, no_longer_needed_cb); + LOG_ASSERT(texture_ref); + + ui::OzonePlatform* platform = ui::OzonePlatform::GetInstance(); + ui::SurfaceFactoryOzone* factory = platform->GetSurfaceFactoryOzone(); + gfx::BufferFormat buffer_format = + VideoPixelFormatToGfxBufferFormat(pixel_format); + texture_ref->pixmap_ = + factory->CreateNativePixmap(gfx::kNullAcceleratedWidget, size, + buffer_format, gfx::BufferUsage::SCANOUT); + LOG_ASSERT(texture_ref->pixmap_); +#endif + + return texture_ref; +} + +std::vector<gfx::GpuMemoryBufferHandle> +TextureRef::ExportGpuMemoryBufferHandles() const { + std::vector<gfx::GpuMemoryBufferHandle> handles; +#if defined(USE_OZONE) + CHECK(pixmap_); + int duped_fd = HANDLE_EINTR(dup(pixmap_->GetDmaBufFd())); + LOG_ASSERT(duped_fd != -1) << "Failed duplicating dmabuf fd"; + gfx::GpuMemoryBufferHandle handle; + handle.type = gfx::OZONE_NATIVE_PIXMAP; + handle.native_pixmap_handle.fd = base::FileDescriptor(duped_fd, true); + handles.push_back(handle); +#endif + return handles; +} + // Client that can accept callbacks from a VideoDecodeAccelerator and is used by // the TESTs below. class GLRenderingVDAClient @@ -531,6 +619,10 @@ } VideoDecodeAccelerator::Config config(profile_); + if (g_test_import) { + config.output_mode = + media::VideoDecodeAccelerator::Config::OutputMode::IMPORT; + } gpu::GpuPreferences gpu_preferences; decoder_ = vda_factory_->CreateVDA(this, config, gpu_preferences); } @@ -564,21 +656,46 @@ texture_target_, &texture_id, dimensions, &done); done.Wait(); + scoped_refptr<TextureRef> texture_ref; + base::Closure delete_texture_cb = + base::Bind(&RenderingHelper::DeleteTexture, + base::Unretained(rendering_helper_), texture_id); + + if (g_test_import) { + media::VideoPixelFormat pixel_format = decoder_->GetOutputFormat(); + if (pixel_format == media::PIXEL_FORMAT_UNKNOWN) + pixel_format = media::PIXEL_FORMAT_ARGB; + texture_ref = TextureRef::CreatePreallocated( + texture_id, delete_texture_cb, pixel_format, dimensions); + } else { + texture_ref = TextureRef::Create(texture_id, delete_texture_cb); + } + + LOG_ASSERT(texture_ref); + int32_t picture_buffer_id = next_picture_buffer_id_++; - LOG_ASSERT(active_textures_ - .insert(std::make_pair( - picture_buffer_id, - new TextureRef(texture_id, - base::Bind(&RenderingHelper::DeleteTexture, - base::Unretained(rendering_helper_), - texture_id)))) - .second); + LOG_ASSERT( + active_textures_.insert(std::make_pair(picture_buffer_id, texture_ref)) + .second); media::PictureBuffer::TextureIds ids; ids.push_back(texture_id); buffers.push_back(media::PictureBuffer(picture_buffer_id, dimensions, ids)); } decoder_->AssignPictureBuffers(buffers); + + if (g_test_import) { + for (const auto& buffer : buffers) { + TextureRefMap::iterator texture_it = active_textures_.find(buffer.id()); + ASSERT_NE(active_textures_.end(), texture_it); + + std::vector<gfx::GpuMemoryBufferHandle> handles = + texture_it->second->ExportGpuMemoryBufferHandles(); + LOG_ASSERT(!handles.empty()) << "Failed producing GMB handles"; + + decoder_->ImportBufferForPicture(buffer.id(), handles); + } + } } void GLRenderingVDAClient::DismissPictureBuffer(int32_t picture_buffer_id) { @@ -1557,6 +1674,10 @@ continue; if (it->first == "ozone-platform" || it->first == "ozone-use-surfaceless") continue; + if (it->first == "test_import") { + content::g_test_import = true; + continue; + } LOG(FATAL) << "Unexpected switch: " << it->first << ":" << it->second; }
diff --git a/content/common/gpu/media/video_encode_accelerator_unittest.cc b/content/common/gpu/media/video_encode_accelerator_unittest.cc index df5ad4f8..3f3f9ef 100644 --- a/content/common/gpu/media/video_encode_accelerator_unittest.cc +++ b/content/common/gpu/media/video_encode_accelerator_unittest.cc
@@ -5,7 +5,9 @@ #include <inttypes.h> #include <stddef.h> #include <stdint.h> + #include <algorithm> +#include <memory> #include <queue> #include <string> #include <utility>
diff --git a/content/common/gpu/media/vp9_decoder.cc b/content/common/gpu/media/vp9_decoder.cc index 1cb0dff..cba92fd 100644 --- a/content/common/gpu/media/vp9_decoder.cc +++ b/content/common/gpu/media/vp9_decoder.cc
@@ -2,8 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "base/logging.h" #include "content/common/gpu/media/vp9_decoder.h" + +#include <memory> + +#include "base/logging.h" #include "media/base/limits.h" namespace content {
diff --git a/content/common/gpu/media/vt_video_decode_accelerator_mac.cc b/content/common/gpu/media/vt_video_decode_accelerator_mac.cc index d832870f..1942577 100644 --- a/content/common/gpu/media/vt_video_decode_accelerator_mac.cc +++ b/content/common/gpu/media/vt_video_decode_accelerator_mac.cc
@@ -10,6 +10,7 @@ #include <stddef.h> #include <algorithm> +#include <memory> #include "base/bind.h" #include "base/logging.h" @@ -327,6 +328,11 @@ return false; } + if (config.output_mode != Config::OutputMode::ALLOCATE) { + NOTREACHED() << "Only ALLOCATE OutputMode is supported by this VDA"; + return false; + } + client_ = client; if (!InitializeVideoToolbox())
diff --git a/content/common/gpu/media/vt_video_decode_accelerator_mac.h b/content/common/gpu/media/vt_video_decode_accelerator_mac.h index 932a6523..33440ba 100644 --- a/content/common/gpu/media/vt_video_decode_accelerator_mac.h +++ b/content/common/gpu/media/vt_video_decode_accelerator_mac.h
@@ -8,6 +8,7 @@ #include <stdint.h> #include <map> +#include <memory> #include <queue> #include "base/mac/scoped_cftyperef.h"
diff --git a/content/common/gpu/media/vt_video_encode_accelerator_mac.cc b/content/common/gpu/media/vt_video_encode_accelerator_mac.cc index f22db09..d48b92d 100644 --- a/content/common/gpu/media/vt_video_encode_accelerator_mac.cc +++ b/content/common/gpu/media/vt_video_encode_accelerator_mac.cc
@@ -4,6 +4,8 @@ #include "content/common/gpu/media/vt_video_encode_accelerator_mac.h" +#include <memory> + #include "base/thread_task_runner_handle.h" #include "media/base/mac/coremedia_glue.h" #include "media/base/mac/corevideo_glue.h"
diff --git a/content/common/gpu/media/vt_video_encode_accelerator_mac.h b/content/common/gpu/media/vt_video_encode_accelerator_mac.h index adb2584..dfa180e 100644 --- a/content/common/gpu/media/vt_video_encode_accelerator_mac.h +++ b/content/common/gpu/media/vt_video_encode_accelerator_mac.h
@@ -5,6 +5,8 @@ #ifndef CONTENT_COMMON_GPU_MEDIA_VT_VIDEO_ENCODE_ACCELERATOR_MAC_H_ #define CONTENT_COMMON_GPU_MEDIA_VT_VIDEO_ENCODE_ACCELERATOR_MAC_H_ +#include <memory> + #include "base/mac/scoped_cftyperef.h" #include "content/common/content_export.h" #include "media/base/mac/videotoolbox_glue.h"
diff --git a/content/common/gpu_host_messages.h b/content/common/gpu_host_messages.h index d9c7846..0705be0 100644 --- a/content/common/gpu_host_messages.h +++ b/content/common/gpu_host_messages.h
@@ -20,10 +20,10 @@ #include "ipc/ipc_channel_handle.h" #include "ipc/ipc_message_macros.h" #include "ipc/ipc_message_start.h" +#include "ui/events/ipc/latency_info_param_traits.h" #include "ui/gfx/gpu_memory_buffer.h" #include "ui/gfx/ipc/gfx_param_traits.h" #include "ui/gfx/ipc/skia/gfx_skia_param_traits.h" -#include "ui/latency_info/ipc/latency_info_param_traits.h" #include "url/gurl.h" #include "url/ipc/url_param_traits.h"
diff --git a/content/common/input/event_with_latency_info.h b/content/common/input/event_with_latency_info.h index 55383876..24742a3 100644 --- a/content/common/input/event_with_latency_info.h +++ b/content/common/input/event_with_latency_info.h
@@ -5,7 +5,7 @@ #ifndef CONTENT_COMMON_INPUT_EVENT_WITH_LATENCY_INFO_H_ #define CONTENT_COMMON_INPUT_EVENT_WITH_LATENCY_INFO_H_ -#include "ui/latency_info/latency_info.h" +#include "ui/events/latency_info.h" #include "content/common/input/web_input_event_traits.h"
diff --git a/content/common/input/input_event.h b/content/common/input/input_event.h index 6f3dc1b8..58485e13 100644 --- a/content/common/input/input_event.h +++ b/content/common/input/input_event.h
@@ -10,7 +10,7 @@ #include "base/macros.h" #include "content/common/content_export.h" #include "content/common/input/scoped_web_input_event.h" -#include "ui/latency_info/latency_info.h" +#include "ui/events/latency_info.h" namespace blink { class WebInputEvent;
diff --git a/content/common/input/input_event_ack.h b/content/common/input/input_event_ack.h index f7510d967..565b66f 100644 --- a/content/common/input/input_event_ack.h +++ b/content/common/input/input_event_ack.h
@@ -13,7 +13,7 @@ #include "content/common/input/did_overscroll_params.h" #include "content/common/input/input_event_ack_state.h" #include "third_party/WebKit/public/web/WebInputEvent.h" -#include "ui/latency_info/latency_info.h" +#include "ui/events/latency_info.h" namespace content {
diff --git a/content/common/input/touch_event_stream_validator.cc b/content/common/input/touch_event_stream_validator.cc index 4c75989..23675b9 100644 --- a/content/common/input/touch_event_stream_validator.cc +++ b/content/common/input/touch_event_stream_validator.cc
@@ -48,6 +48,10 @@ DCHECK(error_msg); error_msg->clear(); + // TouchScrollStarted is not part of a regular touch event stream. + if (event.type == WebInputEvent::TouchScrollStarted) + return true; + WebTouchEvent previous_event = previous_event_; previous_event_ = event;
diff --git a/content/common/input/web_input_event_traits.cc b/content/common/input/web_input_event_traits.cc index a25cf8e..d488f8b3 100644 --- a/content/common/input/web_input_event_traits.cc +++ b/content/common/input/web_input_event_traits.cc
@@ -413,6 +413,7 @@ CASE_TYPE(TouchMove); CASE_TYPE(TouchEnd); CASE_TYPE(TouchCancel); + CASE_TYPE(TouchScrollStarted); default: // Must include default to let blink::WebInputEvent add new event types // before they're added here. @@ -482,6 +483,7 @@ case WebInputEvent::GesturePinchBegin: case WebInputEvent::GesturePinchEnd: case WebInputEvent::TouchCancel: + case WebInputEvent::TouchScrollStarted: return false; case WebInputEvent::TouchStart: case WebInputEvent::TouchEnd:
diff --git a/content/common/input/web_touch_event_traits.cc b/content/common/input/web_touch_event_traits.cc index 175bf78..535044c 100644 --- a/content/common/input/web_touch_event_traits.cc +++ b/content/common/input/web_touch_event_traits.cc
@@ -27,7 +27,8 @@ } bool WebTouchEventTraits::IsTouchSequenceStart(const WebTouchEvent& event) { - DCHECK(event.touchesLength); + DCHECK(event.touchesLength || + event.type == WebInputEvent::TouchScrollStarted); if (event.type != WebInputEvent::TouchStart) return false; return AllTouchPointsHaveState(event, blink::WebTouchPoint::StatePressed); @@ -51,6 +52,8 @@ double timestamp_sec, WebTouchEvent* event) { DCHECK(WebInputEvent::isTouchEventType(type)); + DCHECK(type != WebInputEvent::TouchScrollStarted); + event->type = type; event->cancelable = (type != WebInputEvent::TouchCancel); event->timeStampSeconds = timestamp_sec;
diff --git a/content/common/input_messages.h b/content/common/input_messages.h index 2a4b521..e83a77b 100644 --- a/content/common/input_messages.h +++ b/content/common/input_messages.h
@@ -27,13 +27,13 @@ #include "content/common/input/touch_action.h" #include "ipc/ipc_message_macros.h" #include "third_party/WebKit/public/web/WebInputEvent.h" +#include "ui/events/ipc/latency_info_param_traits.h" #include "ui/gfx/geometry/point.h" #include "ui/gfx/geometry/rect.h" #include "ui/gfx/geometry/vector2d_f.h" #include "ui/gfx/ipc/gfx_param_traits.h" #include "ui/gfx/ipc/skia/gfx_skia_param_traits.h" #include "ui/gfx/range/range.h" -#include "ui/latency_info/ipc/latency_info_param_traits.h" #undef IPC_MESSAGE_EXPORT #define IPC_MESSAGE_EXPORT CONTENT_EXPORT
diff --git a/content/common/inter_process_time_ticks_converter.cc b/content/common/inter_process_time_ticks_converter.cc index d963ead..f50aa3e 100644 --- a/content/common/inter_process_time_ticks_converter.cc +++ b/content/common/inter_process_time_ticks_converter.cc
@@ -52,9 +52,16 @@ // If input time is "null", return another "null" time. if (remote_ms.value_ == 0) return LocalTimeTicks(0); - DCHECK_LE(remote_lower_bound_, remote_ms.value_); - DCHECK_GE(remote_upper_bound_, remote_ms.value_); + RemoteTimeDelta remote_delta = remote_ms - remote_lower_bound_; + + DCHECK_LE(remote_ms.value_, remote_upper_bound_); + // For remote times that come before remote time range, apply just time + // offset and ignore scaling, so as to avoid extrapolation error for values + // long in the past. + if (remote_ms.value_ < remote_lower_bound_) + return LocalTimeTicks(local_base_time_ + remote_delta.value_); + return LocalTimeTicks(local_base_time_ + ToLocalTimeDelta(remote_delta).value_); }
diff --git a/content/common/inter_process_time_ticks_converter_unittest.cc b/content/common/inter_process_time_ticks_converter_unittest.cc index e098bda..9d53d79 100644 --- a/content/common/inter_process_time_ticks_converter_unittest.cc +++ b/content/common/inter_process_time_ticks_converter_unittest.cc
@@ -249,6 +249,32 @@ EXPECT_EQ(0, results.result_delta); } +TEST(InterProcessTimeTicksConverterTest, ValuesOutsideOfRange) { + InterProcessTimeTicksConverter converter( + LocalTimeTicks::FromTimeTicks(TimeTicks::FromInternalValue(15)), + LocalTimeTicks::FromTimeTicks(TimeTicks::FromInternalValue(20)), + RemoteTimeTicks::FromTimeTicks(TimeTicks::FromInternalValue(10)), + RemoteTimeTicks::FromTimeTicks(TimeTicks::FromInternalValue(25))); + + RemoteTimeTicks remote_ticks = + RemoteTimeTicks::FromTimeTicks(TimeTicks::FromInternalValue(10)); + int64_t result = + converter.ToLocalTimeTicks(remote_ticks).ToTimeTicks().ToInternalValue(); + EXPECT_EQ(15, result); + + remote_ticks = + RemoteTimeTicks::FromTimeTicks(TimeTicks::FromInternalValue(25)); + result = + converter.ToLocalTimeTicks(remote_ticks).ToTimeTicks().ToInternalValue(); + EXPECT_EQ(20, result); + + remote_ticks = + RemoteTimeTicks::FromTimeTicks(TimeTicks::FromInternalValue(9)); + result = + converter.ToLocalTimeTicks(remote_ticks).ToTimeTicks().ToInternalValue(); + EXPECT_EQ(14, result); +} + } // anonymous namespace } // namespace content
diff --git a/content/common/mojo/service_registry_impl.cc b/content/common/mojo/service_registry_impl.cc index fe41cf7..efc3298 100644 --- a/content/common/mojo/service_registry_impl.cc +++ b/content/common/mojo/service_registry_impl.cc
@@ -10,6 +10,10 @@ namespace content { +ServiceRegistry* ServiceRegistry::Create() { + return new ServiceRegistryImpl; +} + ServiceRegistryImpl::ServiceRegistryImpl() : binding_(this), weak_factory_(this) {}
diff --git a/content/common/mojo/service_registry_impl.h b/content/common/mojo/service_registry_impl.h index c53ba10..6d213e3 100644 --- a/content/common/mojo/service_registry_impl.h +++ b/content/common/mojo/service_registry_impl.h
@@ -16,7 +16,6 @@ #include "content/public/common/service_registry.h" #include "mojo/public/cpp/bindings/binding.h" #include "mojo/public/cpp/system/core.h" -#include "services/shell/public/interfaces/interface_provider.mojom.h" namespace content { @@ -29,17 +28,10 @@ ServiceRegistryImpl(); ~ServiceRegistryImpl() override; - // Binds this ServiceProvider implementation to a message pipe endpoint. - void Bind(shell::mojom::InterfaceProviderRequest request); - - // Binds to a remote ServiceProvider. This will expose added services to the - // remote ServiceProvider with the corresponding handle and enable - // ConnectToRemoteService to provide access to services exposed by the remote - // ServiceProvider. - void BindRemoteServiceProvider( - shell::mojom::InterfaceProviderPtr service_provider); - // ServiceRegistry overrides. + void Bind(shell::mojom::InterfaceProviderRequest request) override; + void BindRemoteServiceProvider( + shell::mojom::InterfaceProviderPtr service_provider) override; void AddService(const std::string& service_name, const ServiceFactory service_factory) override; void RemoveService(const std::string& service_name) override;
diff --git a/content/common/notification_constants.h b/content/common/notification_constants.h deleted file mode 100644 index 2573a6eb..0000000 --- a/content/common/notification_constants.h +++ /dev/null
@@ -1,29 +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 CONTENT_COMMON_NOTIFICATION_CONSTANTS_H_ -#define CONTENT_COMMON_NOTIFICATION_CONSTANTS_H_ - -#include <stddef.h> - -namespace content { - -// Maximum number of actions on a Platform Notification. -static const size_t kPlatformNotificationMaxActions = 2; - -// The maximum reasonable notification icon size, scaled from dip units to -// pixels using the largest supported scaling factor. -static const int kPlatformNotificationMaxIconSizePx = 320; // 80 dip * 4 - -// The maximum reasonable badge size, scaled from dip units to pixels using the -// largest supported scaling factor. -static const int kPlatformNotificationMaxBadgeSizePx = 96; // 24 dip * 4 - -// The maximum reasonable action icon size, scaled from dip units to -// pixels using the largest supported scaling factor. -static const int kPlatformNotificationMaxActionIconSizePx = 128; // 32 dip * 4 - -} // namespace content - -#endif // CONTENT_COMMON_NOTIFICATION_CONSTANTS_H_
diff --git a/content/common/platform_notification_messages.h b/content/common/platform_notification_messages.h index 5e5d8bb..dc79fe4 100644 --- a/content/common/platform_notification_messages.h +++ b/content/common/platform_notification_messages.h
@@ -10,10 +10,11 @@ #include <utility> #include <vector> +#include "content/public/common/common_param_traits_macros.h" #include "content/public/common/notification_resources.h" #include "content/public/common/platform_notification_data.h" #include "ipc/ipc_message_macros.h" -#include "third_party/WebKit/public/platform/modules/notifications/WebNotificationPermission.h" +#include "third_party/WebKit/public/platform/modules/permissions/permission_status.mojom.h" #include "third_party/skia/include/core/SkBitmap.h" // Singly-included section for type definitions. @@ -29,9 +30,6 @@ #define IPC_MESSAGE_START PlatformNotificationMsgStart -IPC_ENUM_TRAITS_MAX_VALUE(blink::WebNotificationPermission, - blink::WebNotificationPermissionLast) - IPC_ENUM_TRAITS_MAX_VALUE( content::PlatformNotificationData::Direction, content::PlatformNotificationData::DIRECTION_LAST) @@ -128,6 +126,7 @@ GURL /* origin */, int64_t /* persistent_notification_id */) -IPC_SYNC_MESSAGE_CONTROL1_1(PlatformNotificationHostMsg_CheckPermission, - GURL /* origin */, - blink::WebNotificationPermission /* result */) +IPC_SYNC_MESSAGE_CONTROL1_1( + PlatformNotificationHostMsg_CheckPermission, + GURL /* origin */, + blink::mojom::PermissionStatus /* permission_status */)
diff --git a/content/common/resource_messages.cc b/content/common/resource_messages.cc index 2c0cbe1..aa248126 100644 --- a/content/common/resource_messages.cc +++ b/content/common/resource_messages.cc
@@ -226,6 +226,8 @@ WriteParam(m, p.send_start); WriteParam(m, p.send_end); WriteParam(m, p.receive_headers_end); + WriteParam(m, p.push_start); + WriteParam(m, p.push_end); } bool ParamTraits<net::LoadTimingInfo>::Read(const base::Pickle* m, @@ -253,7 +255,9 @@ ReadParam(m, iter, &r->connect_timing.ssl_end) && ReadParam(m, iter, &r->send_start) && ReadParam(m, iter, &r->send_end) && - ReadParam(m, iter, &r->receive_headers_end); + ReadParam(m, iter, &r->receive_headers_end) && + ReadParam(m, iter, &r->push_start) && + ReadParam(m, iter, &r->push_end); } void ParamTraits<net::LoadTimingInfo>::Log(const param_type& p, @@ -288,6 +292,10 @@ LogParam(p.send_end, l); l->append(", "); LogParam(p.receive_headers_end, l); + l->append(", "); + LogParam(p.push_start, l); + l->append(", "); + LogParam(p.push_end, l); l->append(")"); }
diff --git a/content/common/sandbox_win.cc b/content/common/sandbox_win.cc index ade3069..66a279e 100644 --- a/content/common/sandbox_win.cc +++ b/content/common/sandbox_win.cc
@@ -77,6 +77,7 @@ L"esspd.dll", // Samsung Smart Security ESCORT. L"googledesktopnetwork3.dll", // Google Desktop Search v5. L"fwhook.dll", // PC Tools Firewall Plus. + L"guard64.dll", // Comodo Internet Security x64. L"hookprocesscreation.dll", // Blumentals Program protector. L"hookterminateapis.dll", // Blumentals and Cyberprinter. L"hookprintapis.dll", // Cyberprinter.
diff --git a/content/common/service_worker/service_worker_messages.h b/content/common/service_worker/service_worker_messages.h index 41698cf..e3efe10a 100644 --- a/content/common/service_worker/service_worker_messages.h +++ b/content/common/service_worker/service_worker_messages.h
@@ -200,15 +200,6 @@ url::Origin /* source_origin */, std::vector<content::TransferredMessagePort> /* sent_message_ports */) -// Sends MessageEvent to a service worker (renderer->browser). -// TODO(nhiroki): Remove this after ExtendableMessageEvent is enabled by -// default (crbug.com/543198). -IPC_MESSAGE_CONTROL3( - ServiceWorkerHostMsg_DeprecatedPostMessageToWorker, - int /* handle_id */, - base::string16 /* message */, - std::vector<content::TransferredMessagePort> /* sent_message_ports */) - // Informs the browser of a new ServiceWorkerProvider in the child process, // |provider_id| is unique within its child process. When this provider is // created for a document, |route_id| is the frame ID of it. When this provider @@ -502,14 +493,6 @@ std::string /* region_id */, blink::WebCircularGeofencingRegion /* region */) -// TODO(nhiroki): Remove this after ExtendableMessageEvent is enabled by -// default (crbug.com/543198). -IPC_MESSAGE_CONTROL3( - ServiceWorkerMsg_MessageToWorker, - base::string16 /* message */, - std::vector<content::TransferredMessagePort> /* sent_message_ports */, - std::vector<int> /* new_routing_ids */) - IPC_MESSAGE_CONTROL1(ServiceWorkerMsg_DidSkipWaiting, int /* request_id */) IPC_MESSAGE_CONTROL1(ServiceWorkerMsg_DidClaimClients,
diff --git a/content/content_browser.gypi b/content/content_browser.gypi index 90b1b684..94c9ae5 100644 --- a/content/content_browser.gypi +++ b/content/content_browser.gypi
@@ -64,7 +64,6 @@ '../ui/events/events.gyp:gesture_detection', '../ui/gfx/gfx.gyp:gfx', '../ui/gfx/gfx.gyp:gfx_geometry', - '../ui/latency_info/latency_info.gyp:latency_info', '../ui/resources/ui_resources.gyp:ui_resources', '../ui/snapshot/snapshot.gyp:snapshot', '../ui/surface/surface.gyp:surface',
diff --git a/content/content_child.gypi b/content/content_child.gypi index f4ac67d..1c31dfc 100644 --- a/content/content_child.gypi +++ b/content/content_child.gypi
@@ -96,6 +96,8 @@ 'child/dwrite_font_proxy/dwrite_font_proxy_win.h', 'child/dwrite_font_proxy/dwrite_localized_strings_win.cc', 'child/dwrite_font_proxy/dwrite_localized_strings_win.h', + 'child/dwrite_font_proxy/font_fallback_win.cc', + 'child/dwrite_font_proxy/font_fallback_win.h', 'child/file_info_util.cc', 'child/file_info_util.h', 'child/fileapi/file_system_dispatcher.cc', @@ -139,14 +141,8 @@ 'child/notifications/notification_data_conversions.h', 'child/notifications/notification_dispatcher.cc', 'child/notifications/notification_dispatcher.h', - 'child/notifications/notification_image_loader.cc', - 'child/notifications/notification_image_loader.h', 'child/notifications/notification_manager.cc', 'child/notifications/notification_manager.h', - 'child/notifications/pending_notification.cc', - 'child/notifications/pending_notification.h', - 'child/notifications/pending_notifications_tracker.cc', - 'child/notifications/pending_notifications_tracker.h', 'child/permissions/permission_dispatcher.cc', 'child/permissions/permission_dispatcher.h', 'child/permissions/permission_dispatcher_thread_proxy.cc',
diff --git a/content/content_common.gypi b/content/content_common.gypi index 36d59656..baa1f64 100644 --- a/content/content_common.gypi +++ b/content/content_common.gypi
@@ -45,7 +45,7 @@ '../ui/accessibility/accessibility.gyp:ax_gen', '../ui/base/ime/ui_base_ime.gyp:ui_base_ime', '../ui/base/ui_base.gyp:ui_base', - '../ui/latency_info/latency_info.gyp:latency_info_ipc', + '../ui/events/events.gyp:events_ipc', '../ui/gfx/gfx.gyp:gfx', '../ui/gfx/gfx.gyp:gfx_geometry', '../ui/gfx/ipc/gfx_ipc.gyp:gfx_ipc', @@ -314,6 +314,8 @@ 'common/drag_messages.h', 'common/drag_traits.h', 'common/dwrite_font_proxy_messages.h', + 'common/dwrite_text_analysis_source_win.cc', + 'common/dwrite_text_analysis_source_win.h', 'common/edit_command.h', 'common/establish_channel_params.cc', 'common/establish_channel_params.h', @@ -473,7 +475,6 @@ 'common/net/url_request_service_worker_data.h', 'common/net/url_request_user_data.cc', 'common/net/url_request_user_data.h', - 'common/notification_constants.h', 'common/one_writer_seqlock.cc', 'common/one_writer_seqlock.h', 'common/origin_trials/trial_token.cc',
diff --git a/content/content_common_mojo_bindings.gyp b/content/content_common_mojo_bindings.gyp index 6e76e05..9807cab 100644 --- a/content/content_common_mojo_bindings.gyp +++ b/content/content_common_mojo_bindings.gyp
@@ -9,10 +9,6 @@ 'target_name': 'content_common_mojo_bindings_mojom', 'type': 'none', 'variables': { - 'mojom_extra_generator_args': [ - '--typemap', '<(DEPTH)/url/mojo/origin.typemap', - '--typemap', '<(DEPTH)/url/mojo/gurl.typemap', - ], 'mojom_files': [ # NOTE: Sources duplicated in //content/common/BUILD.gn:mojo_bindings. 'common/application_setup.mojom', @@ -31,6 +27,10 @@ 'public/common/background_sync.mojom', 'public/common/service_worker_event_status.mojom', ], + 'mojom_typemaps': [ + '../url/mojo/gurl.typemap', + '../url/mojo/origin.typemap', + ], }, 'dependencies': [ '../components/leveldb/leveldb.gyp:leveldb_bindings_mojom',
diff --git a/content/content_renderer.gypi b/content/content_renderer.gypi index d2efa37..7d73b7c 100644 --- a/content/content_renderer.gypi +++ b/content/content_renderer.gypi
@@ -38,6 +38,7 @@ '../third_party/libyuv/libyuv.gyp:libyuv', '../third_party/widevine/cdm/widevine_cdm.gyp:widevine_cdm_version_h', '../ui/accessibility/accessibility.gyp:accessibility', + '../ui/display/display.gyp:display', '../ui/events/blink/events_blink.gyp:events_blink', '../ui/events/events.gyp:dom_keycode_converter', '../ui/gfx/gfx.gyp:gfx',
diff --git a/content/content_tests.gypi b/content/content_tests.gypi index 8d8c03e..bdf7859 100644 --- a/content/content_tests.gypi +++ b/content/content_tests.gypi
@@ -642,6 +642,7 @@ 'child/blob_storage/blob_consolidation_unittest.cc', 'child/blob_storage/blob_transport_controller_unittest.cc', 'child/dwrite_font_proxy/dwrite_font_proxy_win_unittest.cc', + 'child/dwrite_font_proxy/font_fallback_win_unittest.cc', 'child/fileapi/webfilewriter_base_unittest.cc', 'child/font_warmup_win_unittest.cc', 'child/indexed_db/indexed_db_dispatcher_unittest.cc', @@ -649,7 +650,6 @@ 'child/indexed_db/mock_webidbcallbacks.h', 'child/indexed_db/webidbcursor_impl_unittest.cc', 'child/notifications/notification_data_conversions_unittest.cc', - 'child/notifications/pending_notifications_tracker_unittest.cc', 'child/power_monitor_broadcast_source_unittest.cc', 'child/resource_dispatcher_unittest.cc', 'child/service_worker/service_worker_dispatcher_unittest.cc', @@ -864,12 +864,12 @@ '../ui/base/ui_base.gyp:ui_base_test_support', '../ui/base/ui_base.gyp:ui_data_pack', '../ui/compositor/compositor.gyp:compositor_test_support', + '../ui/display/display.gyp:display', '../ui/events/events.gyp:dom_keycode_converter', '../ui/events/events.gyp:events_base', '../ui/events/events.gyp:events_test_support', '../ui/events/events.gyp:gesture_detection', '../ui/gfx/gfx.gyp:gfx_test_support', - '../ui/latency_info/latency_info.gyp:latency_info', '../ui/resources/ui_resources.gyp:ui_resources', '../ui/surface/surface.gyp:surface', '../url/url.gyp:url_lib',
diff --git a/content/gpu/BUILD.gn b/content/gpu/BUILD.gn index 2536b86..0b74bdc 100644 --- a/content/gpu/BUILD.gn +++ b/content/gpu/BUILD.gn
@@ -57,9 +57,9 @@ "//media/mojo/services:application_factory", "//services/shell/public/interfaces", "//skia", + "//ui/events/ipc", "//ui/gfx/ipc", "//ui/gl", - "//ui/latency_info/ipc", ] if (mojo_media_host == "gpu") {
diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc index 3dfba0c..7ffa59e 100644 --- a/content/gpu/gpu_main.cc +++ b/content/gpu/gpu_main.cc
@@ -5,6 +5,7 @@ #include <stddef.h> #include <stdlib.h> +#include <memory> #include <utility> #include "base/lazy_instance.h"
diff --git a/content/ppapi_plugin/ppapi_plugin_main.cc b/content/ppapi_plugin/ppapi_plugin_main.cc index 46db7be..76844a1 100644 --- a/content/ppapi_plugin/ppapi_plugin_main.cc +++ b/content/ppapi_plugin/ppapi_plugin_main.cc
@@ -32,8 +32,8 @@ #include "sandbox/win/src/sandbox.h" #include "third_party/WebKit/public/web/win/WebFontRendering.h" #include "third_party/skia/include/ports/SkTypeface_win.h" +#include "ui/display/win/dpi.h" #include "ui/gfx/win/direct_write.h" -#include "ui/gfx/win/dpi.h" #endif #if defined(OS_CHROMEOS) @@ -156,7 +156,7 @@ } blink::WebFontRendering::setUseDirectWrite(use_direct_write); - blink::WebFontRendering::setDeviceScaleFactor(gfx::GetDPIScale()); + blink::WebFontRendering::setDeviceScaleFactor(display::win::GetDPIScale()); #endif main_message_loop.Run();
diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java index ee6ccc95..554ab09c 100644 --- a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java +++ b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
@@ -35,6 +35,7 @@ import android.view.ViewGroup; import android.view.ViewStructure; import android.view.WindowManager; +import android.view.accessibility.AccessibilityEvent; import android.view.accessibility.AccessibilityManager; import android.view.accessibility.AccessibilityManager.AccessibilityStateChangeListener; import android.view.accessibility.AccessibilityNodeProvider; @@ -545,6 +546,10 @@ // System accessibility service. private final AccessibilityManager mAccessibilityManager; + // If true, the web contents are obscured by another view and we shouldn't + // return an AccessibilityNodeProvider or process touch exploration events. + private boolean mIsObscuredByAnotherView; + // Notifies the ContentViewCore when platform closed caption settings have changed // if they are supported. Otherwise does nothing. private final SystemCaptioningBridge mSystemCaptioningBridge; @@ -1709,7 +1714,7 @@ MotionEvent offset = createOffsetMotionEvent(event); try { - if (mBrowserAccessibilityManager != null) { + if (mBrowserAccessibilityManager != null && !mIsObscuredByAnotherView) { return mBrowserAccessibilityManager.onHoverEvent(offset); } @@ -3004,6 +3009,8 @@ if (mBrowserAccessibilityManager != null && mRenderCoordinates.hasFrameInfo()) { mBrowserAccessibilityManager.notifyFrameInfoInitialized(); } + + if (mBrowserAccessibilityManager == null) mNativeAccessibilityEnabled = false; } /** @@ -3017,13 +3024,15 @@ } /** - * If native accessibility (not script injection) is enabled, and if this is - * running on JellyBean or later, returns an AccessibilityNodeProvider that + * If native accessibility is enabled and no other views are temporarily + * obscuring this one, returns an AccessibilityNodeProvider that * implements native accessibility for this view. Returns null otherwise. * Lazily initializes native accessibility here if it's allowed. * @return The AccessibilityNodeProvider, if available, or null otherwise. */ public AccessibilityNodeProvider getAccessibilityNodeProvider() { + if (mIsObscuredByAnotherView) return null; + if (mBrowserAccessibilityManager != null) { return mBrowserAccessibilityManager.getAccessibilityNodeProvider(); } @@ -3037,6 +3046,19 @@ return null; } + /** + * Set whether or not the web contents are obscured by another view. + * If true, we won't return an accessibility node provider or respond + * to touch exploration events. + */ + public void setObscuredByAnotherView(boolean isObscured) { + if (isObscured != mIsObscuredByAnotherView) { + mIsObscuredByAnotherView = isObscured; + getContainerView().sendAccessibilityEvent( + AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED); + } + } + @TargetApi(Build.VERSION_CODES.M) public void onProvideVirtualStructure(final ViewStructure structure) { // Do not collect accessibility tree in incognito mode
diff --git a/content/public/android/java/src/org/chromium/content/browser/accessibility/BrowserAccessibilityManager.java b/content/public/android/java/src/org/chromium/content/browser/accessibility/BrowserAccessibilityManager.java index d7ff4d15..bc51883 100644 --- a/content/public/android/java/src/org/chromium/content/browser/accessibility/BrowserAccessibilityManager.java +++ b/content/public/android/java/src/org/chromium/content/browser/accessibility/BrowserAccessibilityManager.java
@@ -61,7 +61,6 @@ private int mSelectionStartIndex; private int mSelectionEndIndex; protected int mAccessibilityFocusId; - protected boolean mVisible = true; private Runnable mSendWindowContentChangedRunnable; /** @@ -144,21 +143,6 @@ } /** - * Set whether the web content made accessible by this class is currently visible. - * Set it to false if the web view is still on the screen but it's obscured by a - * dialog or overlay. This will make every virtual view in the web hierarchy report - * that it's not visible, and not accessibility focusable. - * - * @param visible Whether the web content is currently visible and not obscured. - */ - public void setVisible(boolean visible) { - if (visible == mVisible) return; - - mVisible = visible; - sendWindowContentChangedOnView(); - } - - /** * @see AccessibilityNodeProvider#createAccessibilityNodeInfo(int) */ protected AccessibilityNodeInfo createAccessibilityNodeInfo(int virtualViewId) { @@ -633,7 +617,7 @@ } // Populate the minimum required fields. - result.setVisibleToUser(source.isVisibleToUser() && mVisible); + result.setVisibleToUser(source.isVisibleToUser()); result.setEnabled(source.isEnabled()); result.setPackageName(source.getPackageName()); result.setClassName(source.getClassName()); @@ -784,7 +768,7 @@ node.setPassword(password); node.setScrollable(scrollable); node.setSelected(selected); - node.setVisibleToUser(visibleToUser && mVisible); + node.setVisibleToUser(visibleToUser); node.setMovementGranularities( AccessibilityNodeInfo.MOVEMENT_GRANULARITY_CHARACTER @@ -793,7 +777,7 @@ if (mAccessibilityFocusId == virtualViewId) { node.setAccessibilityFocused(true); - } else if (mVisible) { + } else { node.setAccessibilityFocused(false); } } @@ -837,7 +821,7 @@ if (mAccessibilityFocusId == virtualViewId) { node.addAction(AccessibilityNodeInfo.ACTION_CLEAR_ACCESSIBILITY_FOCUS); - } else if (mVisible) { + } else { node.addAction(AccessibilityNodeInfo.ACTION_ACCESSIBILITY_FOCUS); }
diff --git a/content/public/android/java/src/org/chromium/content/browser/accessibility/LollipopBrowserAccessibilityManager.java b/content/public/android/java/src/org/chromium/content/browser/accessibility/LollipopBrowserAccessibilityManager.java index 3ec4a59..833b9f2 100644 --- a/content/public/android/java/src/org/chromium/content/browser/accessibility/LollipopBrowserAccessibilityManager.java +++ b/content/public/android/java/src/org/chromium/content/browser/accessibility/LollipopBrowserAccessibilityManager.java
@@ -146,7 +146,7 @@ if (mAccessibilityFocusId == virtualViewId) { node.addAction(AccessibilityAction.ACTION_CLEAR_ACCESSIBILITY_FOCUS); - } else if (mVisible) { + } else { node.addAction(AccessibilityAction.ACTION_ACCESSIBILITY_FOCUS); }
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java b/content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java index a2aa6292..500fe84a 100644 --- a/content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java +++ b/content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java
@@ -11,7 +11,6 @@ import android.content.res.Configuration; import android.os.Handler; import android.os.Looper; -import android.test.FlakyTest; import android.test.suitebuilder.annotation.MediumTest; import android.test.suitebuilder.annotation.SmallTest; import android.text.TextUtils; @@ -23,6 +22,7 @@ import org.chromium.base.ThreadUtils; import org.chromium.base.test.util.Feature; +import org.chromium.base.test.util.FlakyTest; import org.chromium.base.test.util.UrlUtils; import org.chromium.content.browser.ContentViewCore; import org.chromium.content.browser.test.util.Criteria; @@ -579,6 +579,7 @@ @SmallTest @Feature({"TextInput"}) + @FlakyTest(message = "crbug.com/598482") public void testImeSelectAndUnSelectAll() throws Exception { commitText("hello", 1); waitAndVerifyUpdateSelection(0, 5, 5, -1, -1); @@ -990,6 +991,7 @@ @SmallTest @Feature({"TextInput"}) + @FlakyTest(message = "crbug.com/598482") public void testPastePopupShowAndHide() throws Throwable { commitText("hello", 1); waitAndVerifyUpdateSelection(0, 5, 5, -1, -1);
diff --git a/content/public/browser/android/synchronous_compositor.h b/content/public/browser/android/synchronous_compositor.h index d425af1..7e07884 100644 --- a/content/public/browser/android/synchronous_compositor.h +++ b/content/public/browser/android/synchronous_compositor.h
@@ -7,6 +7,8 @@ #include <stddef.h> +#include <memory> + #include "base/memory/ref_counted.h" #include "content/common/content_export.h" #include "gpu/command_buffer/service/in_process_command_buffer.h"
diff --git a/content/public/browser/platform_notification_service.h b/content/public/browser/platform_notification_service.h index 75e8c12e..ba70b33 100644 --- a/content/public/browser/platform_notification_service.h +++ b/content/public/browser/platform_notification_service.h
@@ -14,7 +14,7 @@ #include "base/callback_forward.h" #include "content/common/content_export.h" -#include "third_party/WebKit/public/platform/modules/notifications/WebNotificationPermission.h" +#include "third_party/WebKit/public/platform/modules/permissions/permission_status.mojom.h" class GURL; @@ -35,7 +35,7 @@ // Checks if |origin| has permission to display Web Notifications. // This method must only be called on the UI thread. - virtual blink::WebNotificationPermission CheckPermissionOnUIThread( + virtual blink::mojom::PermissionStatus CheckPermissionOnUIThread( BrowserContext* browser_context, const GURL& origin, int render_process_id) = 0; @@ -45,7 +45,7 @@ // JavaScript getter, and should not be used for other purposes. See // https://crbug.com/446497 for the plan to deprecate this method. // This method must only be called on the IO thread. - virtual blink::WebNotificationPermission CheckPermissionOnIOThread( + virtual blink::mojom::PermissionStatus CheckPermissionOnIOThread( ResourceContext* resource_context, const GURL& origin, int render_process_id) = 0;
diff --git a/content/public/common/BUILD.gn b/content/public/common/BUILD.gn index 40c08f1..0526128a 100644 --- a/content/public/common/BUILD.gn +++ b/content/public/common/BUILD.gn
@@ -95,6 +95,7 @@ public_deps = [ "//content/common", "//mojo/public/cpp/bindings", + "//services/shell/public/interfaces", "//ui/accessibility", "//url/ipc:url_ipc", ]
diff --git a/content/public/common/common_param_traits_macros.h b/content/public/common/common_param_traits_macros.h index 647624ab..e75889a 100644 --- a/content/public/common/common_param_traits_macros.h +++ b/content/public/common/common_param_traits_macros.h
@@ -22,6 +22,7 @@ #include "third_party/WebKit/public/platform/WebRect.h" #include "third_party/WebKit/public/platform/WebReferrerPolicy.h" #include "third_party/WebKit/public/platform/WebURLRequest.h" +#include "third_party/WebKit/public/platform/modules/permissions/permission_status.mojom.h" #include "third_party/WebKit/public/web/WebWindowFeatures.h" #include "ui/accessibility/ax_node_data.h" #include "ui/accessibility/ax_tree_update.h" @@ -45,6 +46,8 @@ content::SECURITY_STYLE_LAST) IPC_ENUM_TRAITS_MAX_VALUE(blink::WebReferrerPolicy, blink::WebReferrerPolicyLast) +IPC_ENUM_TRAITS_MAX_VALUE(blink::mojom::PermissionStatus, + blink::mojom::PermissionStatus::LAST) IPC_ENUM_TRAITS_MAX_VALUE(content::EditingBehavior, content::EDITING_BEHAVIOR_LAST) IPC_ENUM_TRAITS_MAX_VALUE(WindowOpenDisposition,
diff --git a/content/public/common/content_switches.cc b/content/public/common/content_switches.cc index eae2357b..98cf2e1 100644 --- a/content/public/common/content_switches.cc +++ b/content/public/common/content_switches.cc
@@ -398,10 +398,6 @@ // Enables the network information API. const char kEnableNetworkInformation[] = "enable-network-information"; -// Enables action button icons for the Web Notification API. -const char kEnableNotificationActionIcons[] = - "enable-notification-action-icons"; - // Enables compositor-accelerated touch-screen pinch gestures. const char kEnablePinch[] = "enable-pinch";
diff --git a/content/public/common/content_switches.h b/content/public/common/content_switches.h index 525366f..4488907 100644 --- a/content/public/common/content_switches.h +++ b/content/public/common/content_switches.h
@@ -124,7 +124,6 @@ CONTENT_EXPORT extern const char kEnableLogging[]; extern const char kEnableMemoryBenchmarking[]; CONTENT_EXPORT extern const char kEnableNetworkInformation[]; -CONTENT_EXPORT extern const char kEnableNotificationActionIcons[]; CONTENT_EXPORT extern const char kEnablePinch[]; CONTENT_EXPORT extern const char kEnablePluginPlaceholderTesting[]; CONTENT_EXPORT extern const char kEnablePreciseMemoryInfo[];
diff --git a/content/public/common/service_registry.h b/content/public/common/service_registry.h index 41edc19..ada2f8e 100644 --- a/content/public/common/service_registry.h +++ b/content/public/common/service_registry.h
@@ -15,6 +15,7 @@ #include "mojo/public/cpp/bindings/interface_ptr.h" #include "mojo/public/cpp/bindings/interface_request.h" #include "mojo/public/cpp/system/core.h" +#include "services/shell/public/interfaces/interface_provider.mojom.h" namespace content { @@ -24,8 +25,19 @@ // ConnectToRemoteService. class CONTENT_EXPORT ServiceRegistry { public: + static ServiceRegistry* Create(); virtual ~ServiceRegistry() {} + // Binds this ServiceProvider implementation to a message pipe endpoint. + virtual void Bind(shell::mojom::InterfaceProviderRequest request) = 0; + + // Binds to a remote ServiceProvider. This will expose added services to the + // remote ServiceProvider with the corresponding handle and enable + // ConnectToRemoteService to provide access to services exposed by the remote + // ServiceProvider. + virtual void BindRemoteServiceProvider( + shell::mojom::InterfaceProviderPtr service_provider) = 0; + // Make the service created by |service_factory| available to the remote // ServiceProvider. In response to each request for a service, // |service_factory| will be run with an InterfaceRequest<Interface>
diff --git a/content/public/gpu/gpu_video_decode_accelerator_factory.cc b/content/public/gpu/gpu_video_decode_accelerator_factory.cc index 26cf357..ed8172f4 100644 --- a/content/public/gpu/gpu_video_decode_accelerator_factory.cc +++ b/content/public/gpu/gpu_video_decode_accelerator_factory.cc
@@ -46,6 +46,18 @@ } // static +std::unique_ptr<GpuVideoDecodeAcceleratorFactory> +GpuVideoDecodeAcceleratorFactory::CreateWithNoGL() { + auto gvdafactory_impl = + GpuVideoDecodeAcceleratorFactoryImpl::CreateWithNoGL(); + if (!gvdafactory_impl) + return nullptr; + + return base::WrapUnique( + new GpuVideoDecodeAcceleratorFactory(std::move(gvdafactory_impl))); +} + +// static gpu::VideoDecodeAcceleratorCapabilities GpuVideoDecodeAcceleratorFactory::GetDecoderCapabilities() { const gpu::GpuPreferences gpu_preferences =
diff --git a/content/public/gpu/gpu_video_decode_accelerator_factory.h b/content/public/gpu/gpu_video_decode_accelerator_factory.h index 313306bdd..ea740e24 100644 --- a/content/public/gpu/gpu_video_decode_accelerator_factory.h +++ b/content/public/gpu/gpu_video_decode_accelerator_factory.h
@@ -5,6 +5,8 @@ #ifndef CONTENT_PUBLIC_GPU_GPU_VIDEO_DECODE_ACCELERATOR_FACTORY_H_ #define CONTENT_PUBLIC_GPU_GPU_VIDEO_DECODE_ACCELERATOR_FACTORY_H_ +#include <memory> + #include "base/callback.h" #include "base/memory/weak_ptr.h" #include "content/common/content_export.h" @@ -70,6 +72,13 @@ const BindGLImageCallback& bind_image_cb, const GetGLES2DecoderCallback& get_gles2_decoder_cb); + // Create a factory capable of producing VDA instances for current platform + // with no GL support. + // A factory created with this method will only be able to produce VDAs with + // no ability to call GL functions/access GL state. This also implies no + // ability to decode into textures provided by the client. + static std::unique_ptr<GpuVideoDecodeAcceleratorFactory> CreateWithNoGL(); + // Return decoder capabilities supported on the current platform. static gpu::VideoDecodeAcceleratorCapabilities GetDecoderCapabilities();
diff --git a/content/public/test/browser_test_utils.cc b/content/public/test/browser_test_utils.cc index 6301f85..8adafe5 100644 --- a/content/public/test/browser_test_utils.cc +++ b/content/public/test/browser_test_utils.cc
@@ -58,7 +58,7 @@ #include "ui/events/gesture_detection/gesture_configuration.h" #include "ui/events/keycodes/dom/dom_code.h" #include "ui/events/keycodes/dom/keycode_converter.h" -#include "ui/latency_info/latency_info.h" +#include "ui/events/latency_info.h" #include "ui/resources/grit/webui_resources.h" #if defined(USE_AURA)
diff --git a/content/renderer/BUILD.gn b/content/renderer/BUILD.gn index 318ed29..d18ac5c 100644 --- a/content/renderer/BUILD.gn +++ b/content/renderer/BUILD.gn
@@ -82,6 +82,7 @@ "//ui/accessibility", "//ui/base", "//ui/base/ime", + "//ui/display", "//ui/events:dom_keycode_converter", "//ui/events:events_base", "//ui/events/blink",
diff --git a/content/renderer/android/synchronous_compositor_proxy.cc b/content/renderer/android/synchronous_compositor_proxy.cc index a0d4daf7..4b1eaca 100644 --- a/content/renderer/android/synchronous_compositor_proxy.cc +++ b/content/renderer/android/synchronous_compositor_proxy.cc
@@ -16,8 +16,8 @@ #include "third_party/skia/include/core/SkCanvas.h" #include "third_party/skia/include/core/SkImageInfo.h" #include "third_party/skia/include/core/SkRegion.h" +#include "ui/events/latency_info.h" #include "ui/gfx/skia_util.h" -#include "ui/latency_info/latency_info.h" namespace content {
diff --git a/content/renderer/gpu/render_widget_compositor.cc b/content/renderer/gpu/render_widget_compositor.cc index dbddcd8..1204f2b5 100644 --- a/content/renderer/gpu/render_widget_compositor.cc +++ b/content/renderer/gpu/render_widget_compositor.cc
@@ -1031,15 +1031,6 @@ delegate_->ForwardCompositorProto(serialized); } -void RenderWidgetCompositor::RecordFrameTimingEvents( - std::unique_ptr<cc::FrameTimingTracker::CompositeTimingSet> - composite_events, - std::unique_ptr<cc::FrameTimingTracker::MainFrameTimingSet> - main_frame_events) { - delegate_->RecordFrameTimingEvents(std::move(composite_events), - std::move(main_frame_events)); -} - void RenderWidgetCompositor::SetSurfaceIdNamespace( uint32_t surface_id_namespace) { layer_tree_host_->set_surface_id_namespace(surface_id_namespace);
diff --git a/content/renderer/gpu/render_widget_compositor.h b/content/renderer/gpu/render_widget_compositor.h index a9b0f190..1e15b8d2 100644 --- a/content/renderer/gpu/render_widget_compositor.h +++ b/content/renderer/gpu/render_widget_compositor.h
@@ -172,11 +172,6 @@ void DidCommitAndDrawFrame() override; void DidCompleteSwapBuffers() override; void DidCompletePageScaleAnimation() override; - void RecordFrameTimingEvents( - std::unique_ptr<cc::FrameTimingTracker::CompositeTimingSet> - composite_events, - std::unique_ptr<cc::FrameTimingTracker::MainFrameTimingSet> - main_frame_events) override; // cc::LayerTreeHostSingleThreadClient implementation. void RequestScheduleAnimation() override;
diff --git a/content/renderer/gpu/render_widget_compositor_delegate.h b/content/renderer/gpu/render_widget_compositor_delegate.h index 0755d0c6..d64892b 100644 --- a/content/renderer/gpu/render_widget_compositor_delegate.h +++ b/content/renderer/gpu/render_widget_compositor_delegate.h
@@ -5,8 +5,6 @@ #ifndef CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_DELEGATE_H_ #define CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_DELEGATE_H_ -#include "cc/debug/frame_timing_tracker.h" - namespace blink { class WebWidget; struct WebScreenInfo; @@ -77,13 +75,6 @@ // Called by the compositor in single-threaded mode when a swap is posted. virtual void OnSwapBuffersPosted() = 0; - // Called by the compositor to request the delegate to record frame timing. - virtual void RecordFrameTimingEvents( - std::unique_ptr<cc::FrameTimingTracker::CompositeTimingSet> - composite_events, - std::unique_ptr<cc::FrameTimingTracker::MainFrameTimingSet> - main_frame_events) = 0; - // Requests that the client schedule a composite now, and calculate // appropriate delay for potential future frame. virtual void RequestScheduleAnimation() = 0;
diff --git a/content/renderer/input/main_thread_event_queue.h b/content/renderer/input/main_thread_event_queue.h index 02f7d8d6..0eb2d147 100644 --- a/content/renderer/input/main_thread_event_queue.h +++ b/content/renderer/input/main_thread_event_queue.h
@@ -12,7 +12,7 @@ #include "content/common/input/input_event_dispatch_type.h" #include "content/common/input/web_input_event_queue.h" #include "third_party/WebKit/public/web/WebInputEvent.h" -#include "ui/latency_info/latency_info.h" +#include "ui/events/latency_info.h" namespace content {
diff --git a/content/renderer/input/render_widget_input_handler.cc b/content/renderer/input/render_widget_input_handler.cc index 9c7a2dec..401ce96 100644 --- a/content/renderer/input/render_widget_input_handler.cc +++ b/content/renderer/input/render_widget_input_handler.cc
@@ -26,8 +26,8 @@ #include "content/renderer/render_widget.h" #include "third_party/WebKit/public/platform/WebFloatPoint.h" #include "third_party/WebKit/public/platform/WebFloatSize.h" +#include "ui/events/latency_info.h" #include "ui/gfx/geometry/point_conversions.h" -#include "ui/latency_info/latency_info.h" #if defined(OS_ANDROID) #include <android/keycodes.h> @@ -106,6 +106,7 @@ CASE_TYPE(TouchMove); CASE_TYPE(TouchEnd); CASE_TYPE(TouchCancel); + CASE_TYPE(TouchScrollStarted); default: // Must include default to let blink::WebInputEvent add new event types // before they're added here.
diff --git a/content/renderer/media/peer_connection_identity_store.cc b/content/renderer/media/peer_connection_identity_store.cc index d76a217..89b0579 100644 --- a/content/renderer/media/peer_connection_identity_store.cc +++ b/content/renderer/media/peer_connection_identity_store.cc
@@ -18,6 +18,7 @@ const char kIdentityName[] = "WebRTC"; static unsigned int kRSAChromiumKeyLength = 1024; static unsigned int kRSAChromiumPubExp = 0x10001; +static uint64_t kYearInSeconds = 365 * 24 * 60 * 60; // Bridges identity requests between the main render thread and libjingle's // signaling thread. @@ -116,7 +117,8 @@ } void PeerConnectionIdentityStore::RequestIdentity( - rtc::KeyParams key_params, + const rtc::KeyParams& key_params, + const rtc::Optional<uint64_t>& expires_ms, const rtc::scoped_refptr<webrtc::DtlsIdentityRequestObserver>& observer) { DCHECK(signaling_thread_->BelongsToCurrentThread()); DCHECK(observer); @@ -128,7 +130,8 @@ // header file(s). if (key_params.type() == rtc::KT_RSA && key_params.rsa_params().mod_size == kRSAChromiumKeyLength && - key_params.rsa_params().pub_exp == kRSAChromiumPubExp) { + key_params.rsa_params().pub_exp == kRSAChromiumPubExp && + !expires_ms) { // Use Chromium identity generation code for its hardwired parameters (RSA, // 1024, 0x10001). This generation code is preferred over WebRTC generation // code due to the performance benefits of caching. @@ -141,8 +144,21 @@ } else { // Fall back on WebRTC identity generation code for everything else, e.g. // RSA with any other parameters or ECDSA. These will not be cached. - std::unique_ptr<rtc::SSLIdentity> identity( - rtc::SSLIdentity::Generate(kIdentityName, key_params)); + std::unique_ptr<rtc::SSLIdentity> identity; + if (!expires_ms) { + identity.reset(rtc::SSLIdentity::Generate(kIdentityName, key_params)); + } else { + uint64_t expires_s = *expires_ms / 1000; + // Limit the expiration time to something reasonable (a year). This also + // ensures that the value is not too large for |time_t|. + if (expires_s > kYearInSeconds) + expires_s = kYearInSeconds; + // TODO(hbos,torbjorng): Update |SSLIdentity::GenerateWithExpiration| not + // to use |time_t| and stop using |time_t| here, its type is unspecified + // and shouldn't be used if we have a choice. bugs.webrtc.org/5720. + identity.reset(rtc::SSLIdentity::GenerateWithExpiration( + kIdentityName, key_params, static_cast<time_t>(expires_s))); + } // Invoke |observer| callbacks asynchronously. The callbacks of // DtlsIdentityStoreInterface implementations have to be async.
diff --git a/content/renderer/media/peer_connection_identity_store.h b/content/renderer/media/peer_connection_identity_store.h index 35d99c5..cdd0ec29 100644 --- a/content/renderer/media/peer_connection_identity_store.h +++ b/content/renderer/media/peer_connection_identity_store.h
@@ -9,6 +9,7 @@ #include "base/single_thread_task_runner.h" #include "base/threading/thread_checker.h" #include "third_party/webrtc/api/dtlsidentitystore.h" +#include "third_party/webrtc/base/optional.h" #include "url/gurl.h" namespace content { @@ -27,7 +28,8 @@ // webrtc::DtlsIdentityStoreInterface override; void RequestIdentity( - rtc::KeyParams key_params, + const rtc::KeyParams& key_params, + const rtc::Optional<uint64_t>& expires_ms, const rtc::scoped_refptr<webrtc::DtlsIdentityRequestObserver>& observer) override;
diff --git a/content/renderer/media/renderer_gpu_video_accelerator_factories.h b/content/renderer/media/renderer_gpu_video_accelerator_factories.h index a1f1e39..a2dcb1a5 100644 --- a/content/renderer/media/renderer_gpu_video_accelerator_factories.h +++ b/content/renderer/media/renderer_gpu_video_accelerator_factories.h
@@ -8,6 +8,7 @@ #include <stddef.h> #include <stdint.h> +#include <memory> #include <vector> #include "base/macros.h"
diff --git a/content/renderer/media/rtc_certificate_generator.cc b/content/renderer/media/rtc_certificate_generator.cc index 05661d3..2928fa6b 100644 --- a/content/renderer/media/rtc_certificate_generator.cc +++ b/content/renderer/media/rtc_certificate_generator.cc
@@ -57,6 +57,7 @@ const blink::WebRTCKeyParams& key_params, const GURL& url, const GURL& first_party_for_cookies, + const rtc::Optional<uint64_t>& expires_ms, std::unique_ptr<blink::WebRTCCertificateCallback> observer) { DCHECK(main_thread_->BelongsToCurrentThread()); DCHECK(!observer_) << "Already have a RequestIdentity in progress."; @@ -66,20 +67,22 @@ // Identity request must be performed on the WebRTC signaling thread. signaling_thread_->PostTask(FROM_HERE, base::Bind( &RTCCertificateIdentityObserver::RequestIdentityOnWebRtcSignalingThread, - this, url, first_party_for_cookies)); + this, url, first_party_for_cookies, expires_ms)); } private: void RequestIdentityOnWebRtcSignalingThread( GURL url, - GURL first_party_for_cookies) { + GURL first_party_for_cookies, + rtc::Optional<uint64_t> expires_ms) { DCHECK(signaling_thread_->BelongsToCurrentThread()); rtc::scoped_ptr<PeerConnectionIdentityStore> store( new PeerConnectionIdentityStore(main_thread_, signaling_thread_, url, first_party_for_cookies)); // Request identity with |this| as the observer. OnSuccess/OnFailure will be // called asynchronously. - store->RequestIdentity(WebRTCKeyParamsToKeyParams(key_params_), this); + store->RequestIdentity(WebRTCKeyParamsToKeyParams(key_params_), + expires_ms, this); } // webrtc::DtlsIdentityRequestObserver implementation. @@ -144,6 +147,28 @@ const blink::WebURL& url, const blink::WebURL& first_party_for_cookies, std::unique_ptr<blink::WebRTCCertificateCallback> observer) { + generateCertificateWithOptionalExpiration( + key_params, url, first_party_for_cookies, rtc::Optional<uint64_t>(), + std::move(observer)); +} + +void RTCCertificateGenerator::generateCertificateWithExpiration( + const blink::WebRTCKeyParams& key_params, + const blink::WebURL& url, + const blink::WebURL& first_party_for_cookies, + uint64_t expires_ms, + std::unique_ptr<blink::WebRTCCertificateCallback> observer) { + generateCertificateWithOptionalExpiration( + key_params, url, first_party_for_cookies, + rtc::Optional<uint64_t>(expires_ms), std::move(observer)); +} + +void RTCCertificateGenerator::generateCertificateWithOptionalExpiration( + const blink::WebRTCKeyParams& key_params, + const blink::WebURL& url, + const blink::WebURL& first_party_for_cookies, + const rtc::Optional<uint64_t>& expires_ms, + std::unique_ptr<blink::WebRTCCertificateCallback> observer) { DCHECK(isSupportedKeyParams(key_params)); #if defined(ENABLE_WEBRTC) @@ -161,7 +186,7 @@ main_thread, signaling_thread)); // |identity_observer| lives until request has completed. identity_observer->RequestIdentity(key_params, url, first_party_for_cookies, - std::move(observer)); + expires_ms, std::move(observer)); #else observer->onError(); #endif
diff --git a/content/renderer/media/rtc_certificate_generator.h b/content/renderer/media/rtc_certificate_generator.h index 95734fd..b582af9 100644 --- a/content/renderer/media/rtc_certificate_generator.h +++ b/content/renderer/media/rtc_certificate_generator.h
@@ -9,6 +9,7 @@ #include "third_party/WebKit/public/platform/WebRTCCertificate.h" #include "third_party/WebKit/public/platform/WebRTCCertificateGenerator.h" #include "third_party/WebKit/public/platform/WebRTCKeyParams.h" +#include "third_party/webrtc/base/optional.h" namespace content { @@ -26,9 +27,22 @@ const blink::WebURL& url, const blink::WebURL& first_party_for_cookies, std::unique_ptr<blink::WebRTCCertificateCallback> observer) override; + void generateCertificateWithExpiration( + const blink::WebRTCKeyParams& key_params, + const blink::WebURL& url, + const blink::WebURL& first_party_for_cookies, + uint64_t expires_ms, + std::unique_ptr<blink::WebRTCCertificateCallback> observer) override; bool isSupportedKeyParams(const blink::WebRTCKeyParams& key_params) override; private: + void generateCertificateWithOptionalExpiration( + const blink::WebRTCKeyParams& key_params, + const blink::WebURL& url, + const blink::WebURL& first_party_for_cookies, + const rtc::Optional<uint64_t>& expires_ms, + std::unique_ptr<blink::WebRTCCertificateCallback> observer); + DISALLOW_COPY_AND_ASSIGN(RTCCertificateGenerator); };
diff --git a/content/renderer/media/rtc_video_decoder.cc b/content/renderer/media/rtc_video_decoder.cc index 302d5d5..123a90eb 100644 --- a/content/renderer/media/rtc_video_decoder.cc +++ b/content/renderer/media/rtc_video_decoder.cc
@@ -384,8 +384,12 @@ return; } + media::VideoPixelFormat pixel_format = vda_->GetOutputFormat(); + if (pixel_format == media::PIXEL_FORMAT_UNKNOWN) + pixel_format = media::PIXEL_FORMAT_ARGB; + scoped_refptr<media::VideoFrame> frame = - CreateVideoFrame(picture, pb, timestamp, visible_rect); + CreateVideoFrame(picture, pb, timestamp, visible_rect, pixel_format); if (!frame) { NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); return; @@ -416,19 +420,21 @@ const media::Picture& picture, const media::PictureBuffer& pb, uint32_t timestamp, - const gfx::Rect& visible_rect) { + const gfx::Rect& visible_rect, + media::VideoPixelFormat pixel_format) { DCHECK(decoder_texture_target_); // Convert timestamp from 90KHz to ms. base::TimeDelta timestamp_ms = base::TimeDelta::FromInternalValue( base::checked_cast<uint64_t>(timestamp) * 1000 / 90); - // TODO(mcasas): The incoming data is actually a YUV format, but is labelled - // as ARGB. This prevents the compositor from messing with it, since the - // underlying platform can handle the former format natively. Make sure the + // TODO(mcasas): The incoming data may actually be in a YUV format, but may be + // labelled as ARGB. This may or may not be reported by VDA, depending on + // whether it provides an implementation of VDA::GetOutputFormat(). + // This prevents the compositor from messing with it, since the underlying + // platform can handle the former format natively. Make sure the // correct format is used and everyone down the line understands it. scoped_refptr<media::VideoFrame> frame = media::VideoFrame::WrapNativeTexture( - media::PIXEL_FORMAT_ARGB, - gpu::MailboxHolder(pb.texture_mailbox(0), gpu::SyncToken(), - decoder_texture_target_), + pixel_format, gpu::MailboxHolder(pb.texture_mailbox(0), gpu::SyncToken(), + decoder_texture_target_), media::BindToCurrentLoop(base::Bind( &RTCVideoDecoder::ReleaseMailbox, weak_factory_.GetWeakPtr(), factories_, picture.picture_buffer_id(), pb.texture_ids()[0])),
diff --git a/content/renderer/media/rtc_video_decoder.h b/content/renderer/media/rtc_video_decoder.h index 20c6a33..68d1c4b 100644 --- a/content/renderer/media/rtc_video_decoder.h +++ b/content/renderer/media/rtc_video_decoder.h
@@ -147,7 +147,8 @@ const media::Picture& picture, const media::PictureBuffer& pb, uint32_t timestamp, - const gfx::Rect& visible_rect); + const gfx::Rect& visible_rect, + media::VideoPixelFormat pixel_format); // Resets VDA. void ResetInternal();
diff --git a/content/renderer/mus/BUILD.gn b/content/renderer/mus/BUILD.gn index 326748f..c2d3f93 100644 --- a/content/renderer/mus/BUILD.gn +++ b/content/renderer/mus/BUILD.gn
@@ -33,6 +33,5 @@ "//third_party/WebKit/public:blink", "//ui/events:events", "//ui/events:events_base", - "//ui/latency_info", ] }
diff --git a/content/renderer/mus/compositor_mus_connection.cc b/content/renderer/mus/compositor_mus_connection.cc index 1a92d06..be10408a 100644 --- a/content/renderer/mus/compositor_mus_connection.cc +++ b/content/renderer/mus/compositor_mus_connection.cc
@@ -10,7 +10,7 @@ #include "content/renderer/mus/render_widget_mus_connection.h" #include "mojo/converters/blink/blink_input_events_type_converters.h" #include "mojo/converters/input_events/input_events_type_converters.h" -#include "ui/latency_info/latency_info.h" +#include "ui/events/latency_info.h" using mus::mojom::EventResult;
diff --git a/content/renderer/notification_permission_dispatcher.cc b/content/renderer/notification_permission_dispatcher.cc index 110afc0..bb07048e 100644 --- a/content/renderer/notification_permission_dispatcher.cc +++ b/content/renderer/notification_permission_dispatcher.cc
@@ -11,6 +11,7 @@ #include "content/public/renderer/render_frame.h" #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" #include "third_party/WebKit/public/platform/WebString.h" +#include "third_party/WebKit/public/platform/modules/permissions/permission_status.mojom.h" #include "third_party/WebKit/public/web/modules/notifications/WebNotificationPermissionCallback.h" using blink::WebNotificationPermissionCallback; @@ -47,21 +48,7 @@ blink::mojom::PermissionStatus status) { DCHECK(callback); - blink::WebNotificationPermission permission = - blink::WebNotificationPermissionDefault; - switch (status) { - case blink::mojom::PermissionStatus::GRANTED: - permission = blink::WebNotificationPermissionAllowed; - break; - case blink::mojom::PermissionStatus::DENIED: - permission = blink::WebNotificationPermissionDenied; - break; - case blink::mojom::PermissionStatus::ASK: - permission = blink::WebNotificationPermissionDefault; - break; - } - - callback->permissionRequestComplete(permission); + callback->permissionRequestComplete(status); } } // namespace content
diff --git a/content/renderer/pepper/ppb_graphics_3d_impl.h b/content/renderer/pepper/ppb_graphics_3d_impl.h index 9d5ed054..b356b50 100644 --- a/content/renderer/pepper/ppb_graphics_3d_impl.h +++ b/content/renderer/pepper/ppb_graphics_3d_impl.h
@@ -7,6 +7,8 @@ #include <stdint.h> +#include <memory> + #include "base/macros.h" #include "base/memory/shared_memory.h" #include "base/memory/weak_ptr.h"
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc index 263167cf..5126b34 100644 --- a/content/renderer/render_thread_impl.cc +++ b/content/renderer/render_thread_impl.cc
@@ -446,6 +446,32 @@ } } +std::unique_ptr<WebGraphicsContext3DCommandBufferImpl> CreateOffscreenContext( + scoped_refptr<gpu::GpuChannelHost> gpu_channel_host) { + DCHECK(gpu_channel_host); + // This is used to create a few different offscreen contexts: + // - The shared main thread context (offscreen) used by blink for canvas. + // - The worker context (offscreen) used for GPU raster and video decoding. + // This is for an offscreen context, so the default framebuffer doesn't need + // alpha, depth, stencil, antialiasing. + gpu::gles2::ContextCreationAttribHelper attributes; + attributes.alpha_size = -1; + attributes.depth_size = 0; + attributes.stencil_size = 0; + attributes.samples = 0; + attributes.sample_buffers = 0; + attributes.bind_generates_resource = false; + attributes.lose_context_when_out_of_memory = true; + bool share_resources = true; + bool automatic_flushes = false; + return base::WrapUnique(new WebGraphicsContext3DCommandBufferImpl( + gpu::kNullSurfaceHandle, + GURL("chrome://gpu/RenderThreadImpl::CreateOffscreenContext3d"), + gpu_channel_host.get(), attributes, gfx::PreferIntegratedGpu, + share_resources, automatic_flushes, + WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits(), nullptr)); +} + } // namespace // For measuring memory usage after each task. Behind a command line flag. @@ -1488,47 +1514,26 @@ return nullptr; } -std::unique_ptr<WebGraphicsContext3DCommandBufferImpl> -RenderThreadImpl::CreateOffscreenContext3d() { - // This is used to create a few different offscreen contexts: - // - The shared main thread context (offscreen) used by blink for canvas. - // - The worker context (offscreen) used for GPU raster and video decoding. - // This is for an offscreen context, so the default framebuffer doesn't need - // alpha, depth, stencil, antialiasing. - gpu::gles2::ContextCreationAttribHelper attributes; - attributes.alpha_size = -1; - attributes.depth_size = 0; - attributes.stencil_size = 0; - attributes.samples = 0; - attributes.sample_buffers = 0; - attributes.bind_generates_resource = false; - attributes.lose_context_when_out_of_memory = true; - bool share_resources = true; - bool automatic_flushes = false; - scoped_refptr<gpu::GpuChannelHost> gpu_channel_host(EstablishGpuChannelSync( - CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE)); - if (!gpu_channel_host) - return nullptr; - return base::WrapUnique( - WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext( - gpu_channel_host.get(), attributes, gfx::PreferIntegratedGpu, - share_resources, automatic_flushes, - GURL("chrome://gpu/RenderThreadImpl::CreateOffscreenContext3d"), - WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits(), NULL)); -} - scoped_refptr<cc_blink::ContextProviderWebContext> RenderThreadImpl::SharedMainThreadContextProvider() { DCHECK(IsMainThread()); - if (!shared_main_thread_contexts_.get() || - shared_main_thread_contexts_->ContextGL()->GetGraphicsResetStatusKHR() != - GL_NO_ERROR) { - shared_main_thread_contexts_ = ContextProviderCommandBuffer::Create( - CreateOffscreenContext3d(), RENDERER_MAINTHREAD_CONTEXT); - if (shared_main_thread_contexts_.get() && - !shared_main_thread_contexts_->BindToCurrentThread()) - shared_main_thread_contexts_ = NULL; + if (shared_main_thread_contexts_ && + shared_main_thread_contexts_->ContextGL()->GetGraphicsResetStatusKHR() == + GL_NO_ERROR) + return shared_main_thread_contexts_; + + scoped_refptr<gpu::GpuChannelHost> gpu_channel_host(EstablishGpuChannelSync( + CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE)); + if (!gpu_channel_host) { + shared_main_thread_contexts_ = nullptr; + return nullptr; } + + shared_main_thread_contexts_ = new ContextProviderCommandBuffer( + CreateOffscreenContext(std::move(gpu_channel_host)), + RENDERER_MAINTHREAD_CONTEXT); + if (!shared_main_thread_contexts_->BindToCurrentThread()) + shared_main_thread_contexts_ = nullptr; return shared_main_thread_contexts_; } @@ -2027,25 +2032,29 @@ RenderThreadImpl::SharedWorkerContextProvider() { DCHECK(IsMainThread()); // Try to reuse existing shared worker context provider. - bool shared_worker_context_provider_lost = false; if (shared_worker_context_provider_) { // Note: If context is lost, delete reference after releasing the lock. cc::ContextProvider::ScopedContextLock lock( shared_worker_context_provider_.get()); if (shared_worker_context_provider_->ContextGL() - ->GetGraphicsResetStatusKHR() != GL_NO_ERROR) { - shared_worker_context_provider_lost = true; - } + ->GetGraphicsResetStatusKHR() == GL_NO_ERROR) + return shared_worker_context_provider_; } - if (!shared_worker_context_provider_ || shared_worker_context_provider_lost) { - shared_worker_context_provider_ = ContextProviderCommandBuffer::Create( - CreateOffscreenContext3d(), RENDER_WORKER_CONTEXT); - if (shared_worker_context_provider_ && - !shared_worker_context_provider_->BindToCurrentThread()) - shared_worker_context_provider_ = nullptr; - if (shared_worker_context_provider_) - shared_worker_context_provider_->SetupLock(); + + scoped_refptr<gpu::GpuChannelHost> gpu_channel_host(EstablishGpuChannelSync( + CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE)); + if (!gpu_channel_host) { + shared_worker_context_provider_ = nullptr; + return shared_worker_context_provider_; } + + shared_worker_context_provider_ = new ContextProviderCommandBuffer( + CreateOffscreenContext(std::move(gpu_channel_host)), + RENDER_WORKER_CONTEXT); + if (!shared_worker_context_provider_->BindToCurrentThread()) + shared_worker_context_provider_ = nullptr; + if (shared_worker_context_provider_) + shared_worker_context_provider_->SetupLock(); return shared_worker_context_provider_; }
diff --git a/content/renderer/render_thread_impl.h b/content/renderer/render_thread_impl.h index 2e3304a..08b8b0b3 100644 --- a/content/renderer/render_thread_impl.h +++ b/content/renderer/render_thread_impl.h
@@ -523,9 +523,6 @@ void ReleaseFreeMemory(); - std::unique_ptr<WebGraphicsContext3DCommandBufferImpl> - CreateOffscreenContext3d(); - // These objects live solely on the render thread. std::unique_ptr<AppCacheDispatcher> appcache_dispatcher_; std::unique_ptr<DomStorageDispatcher> dom_storage_dispatcher_;
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc index 2369944..22e3ba46 100644 --- a/content/renderer/render_view_impl.cc +++ b/content/renderer/render_view_impl.cc
@@ -169,12 +169,12 @@ #include "third_party/icu/source/common/unicode/uscript.h" #include "ui/base/clipboard/clipboard.h" #include "ui/base/ui_base_switches_util.h" +#include "ui/events/latency_info.h" #include "ui/gfx/geometry/point.h" #include "ui/gfx/geometry/rect.h" #include "ui/gfx/geometry/rect_conversions.h" #include "ui/gfx/geometry/size_conversions.h" #include "ui/gfx/native_widget_types.h" -#include "ui/latency_info/latency_info.h" #include "url/url_constants.h" #include "v8/include/v8.h"
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc index 3f2eb7c7..896f57c8 100644 --- a/content/renderer/render_widget.cc +++ b/content/renderer/render_widget.cc
@@ -206,6 +206,39 @@ return widget; } +std::unique_ptr<content::WebGraphicsContext3DCommandBufferImpl> +CreateOffscreenContext(scoped_refptr<gpu::GpuChannelHost> gpu_channel_host, + const GURL& url) { + DCHECK(gpu_channel_host); + + // This is for an offscreen context for the compositor. So the default + // framebuffer doesn't need alpha, depth, stencil, antialiasing. + gpu::gles2::ContextCreationAttribHelper attributes; + attributes.alpha_size = -1; + attributes.depth_size = 0; + attributes.stencil_size = 0; + attributes.samples = 0; + attributes.sample_buffers = 0; + attributes.bind_generates_resource = false; + attributes.lose_context_when_out_of_memory = true; + + content::WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits limits; + // The renderer compositor context doesn't do a lot of stuff, so we don't + // expect it to need a lot of space for commands or transfer. Raster and + // uploads happen on the worker context instead. + limits.command_buffer_size = 64 * 1024; + limits.start_transfer_buffer_size = 64 * 1024; + limits.min_transfer_buffer_size = 64 * 1024; + + bool share_resources = true; + bool automatic_flushes = false; + + return base::WrapUnique(new content::WebGraphicsContext3DCommandBufferImpl( + gpu::kNullSurfaceHandle, url, gpu_channel_host.get(), attributes, + gfx::PreferIntegratedGpu, share_resources, automatic_flushes, limits, + nullptr)); +} + } // namespace namespace content { @@ -730,7 +763,7 @@ CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE; gpu_channel_host = RenderThreadImpl::current()->EstablishGpuChannelSync(cause); - if (!gpu_channel_host.get()) { + if (!gpu_channel_host) { // Cause the compositor to wait and try again. return nullptr; } @@ -750,18 +783,17 @@ vulkan_context_provider = cc::VulkanInProcessContextProvider::Create(); if (vulkan_context_provider) { uint32_t output_surface_id = next_output_surface_id_++; - return std::unique_ptr<cc::OutputSurface>( - new DelegatedCompositorOutputSurface( - routing_id(), output_surface_id, context_provider, - worker_context_provider, vulkan_context_provider, - frame_swap_message_queue_)); + return base::WrapUnique(new DelegatedCompositorOutputSurface( + routing_id(), output_surface_id, context_provider, + worker_context_provider, vulkan_context_provider, + frame_swap_message_queue_)); } #endif - context_provider = ContextProviderCommandBuffer::Create( - CreateGraphicsContext3D(gpu_channel_host.get()), + context_provider = new ContextProviderCommandBuffer( + CreateOffscreenContext(std::move(gpu_channel_host), + GetURLForGraphicsContext3D()), RENDER_COMPOSITOR_CONTEXT); - DCHECK(context_provider); worker_context_provider = RenderThreadImpl::current()->SharedWorkerContextProvider(); if (!worker_context_provider) { @@ -795,15 +827,15 @@ !RenderThreadImpl::current()->layout_test_mode()) { DCHECK(compositor_deps_->GetCompositorImplThreadTaskRunner()); return base::WrapUnique(new DelegatedCompositorOutputSurface( - routing_id(), output_surface_id, context_provider, - worker_context_provider, + routing_id(), output_surface_id, std::move(context_provider), + std::move(worker_context_provider), #if defined(ENABLE_VULKAN) vulkan_context_provider, #endif frame_swap_message_queue_)); } - if (!context_provider.get()) { + if (!context_provider) { std::unique_ptr<cc::SoftwareOutputDevice> software_device( new cc::SoftwareOutputDevice()); @@ -816,8 +848,9 @@ } return base::WrapUnique(new MailboxOutputSurface( - routing_id(), output_surface_id, context_provider, - worker_context_provider, frame_swap_message_queue_, cc::RGBA_8888)); + routing_id(), output_surface_id, std::move(context_provider), + std::move(worker_context_provider), frame_swap_message_queue_, + cc::RGBA_8888)); } std::unique_ptr<cc::BeginFrameSource> @@ -897,40 +930,6 @@ TRACE_EVENT0("renderer", "RenderWidget::OnSwapBuffersPosted"); } -void RenderWidget::RecordFrameTimingEvents( - std::unique_ptr<cc::FrameTimingTracker::CompositeTimingSet> - composite_events, - std::unique_ptr<cc::FrameTimingTracker::MainFrameTimingSet> - main_frame_events) { - for (const auto& composite_event : *composite_events) { - int64_t frameId = composite_event.first; - const std::vector<cc::FrameTimingTracker::CompositeTimingEvent>& events = - composite_event.second; - std::vector<blink::WebFrameTimingEvent> webEvents; - for (size_t i = 0; i < events.size(); ++i) { - webEvents.push_back(blink::WebFrameTimingEvent( - events[i].frame_id, - (events[i].timestamp - base::TimeTicks()).InSecondsF())); - } - webwidget_->recordFrameTimingEvent(blink::WebWidget::CompositeEvent, - frameId, webEvents); - } - for (const auto& main_frame_event : *main_frame_events) { - int64_t frameId = main_frame_event.first; - const std::vector<cc::FrameTimingTracker::MainFrameTimingEvent>& events = - main_frame_event.second; - std::vector<blink::WebFrameTimingEvent> webEvents; - for (size_t i = 0; i < events.size(); ++i) { - webEvents.push_back(blink::WebFrameTimingEvent( - events[i].frame_id, - (events[i].timestamp - base::TimeTicks()).InSecondsF(), - (events[i].end_time - base::TimeTicks()).InSecondsF())); - } - webwidget_->recordFrameTimingEvent(blink::WebWidget::RenderEvent, frameId, - webEvents); - } -} - void RenderWidget::RequestScheduleAnimation() { scheduleAnimation(); } @@ -2095,62 +2094,6 @@ #endif } -std::unique_ptr<WebGraphicsContext3DCommandBufferImpl> -RenderWidget::CreateGraphicsContext3D(gpu::GpuChannelHost* gpu_channel_host) { - // This is for an offscreen context for raster in the compositor. So the - // default framebuffer doesn't need alpha, depth, stencil, antialiasing. - gpu::gles2::ContextCreationAttribHelper attributes; - attributes.alpha_size = -1; - attributes.depth_size = 0; - attributes.stencil_size = 0; - attributes.samples = 0; - attributes.sample_buffers = 0; - attributes.bind_generates_resource = false; - attributes.lose_context_when_out_of_memory = true; - - WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits limits; -#if defined(OS_ANDROID) - bool using_synchronous_compositing = - SynchronousCompositorFactory::GetInstance() || - base::CommandLine::ForCurrentProcess()->HasSwitch( - switches::kIPCSyncCompositing); - // If we raster too fast we become upload bound, and pending - // uploads consume memory. For maximum upload throughput, we would - // want to allow for upload_throughput * pipeline_time of pending - // uploads, after which we are just wasting memory. Since we don't - // know our upload throughput yet, this just caps our memory usage. - // Synchronous compositor uses half because synchronous compositor - // pipeline is only one frame deep. But twice of half for low end - // because 16bit texture is not supported. - size_t divider = using_synchronous_compositing ? 2 : 1; - if (base::SysInfo::IsLowEndDevice()) - divider = 6; - // For reference Nexus10 can upload 1MB in about 2.5ms. - const double max_mb_uploaded_per_ms = 2.0 / (5 * divider); - // Deadline to draw a frame to achieve 60 frames per second. - const size_t kMillisecondsPerFrame = 16; - // Assuming a two frame deep pipeline between the CPU and the GPU. - size_t max_transfer_buffer_usage_mb = - static_cast<size_t>(2 * kMillisecondsPerFrame * max_mb_uploaded_per_ms); - static const size_t kBytesPerMegabyte = 1024 * 1024; - // We keep the MappedMemoryReclaimLimit the same as the upload limit - // to avoid unnecessarily stalling the compositor thread. - limits.mapped_memory_reclaim_limit = - max_transfer_buffer_usage_mb * kBytesPerMegabyte; -#endif - limits.command_buffer_size = 64 * 1024; - limits.start_transfer_buffer_size = 64 * 1024; - limits.min_transfer_buffer_size = 64 * 1024; - - bool share_resources = true; - bool automatic_flushes = false; - - return base::WrapUnique(new WebGraphicsContext3DCommandBufferImpl( - gpu::kNullSurfaceHandle, GetURLForGraphicsContext3D(), gpu_channel_host, - attributes, gfx::PreferIntegratedGpu, share_resources, automatic_flushes, - limits, nullptr)); -} - void RenderWidget::RegisterRenderFrameProxy(RenderFrameProxy* proxy) { render_frame_proxies_.AddObserver(proxy); }
diff --git a/content/renderer/render_widget.h b/content/renderer/render_widget.h index 004361f..5e0c81da 100644 --- a/content/renderer/render_widget.h +++ b/content/renderer/render_widget.h
@@ -199,11 +199,6 @@ void OnSwapBuffersAborted() override; void OnSwapBuffersComplete() override; void OnSwapBuffersPosted() override; - void RecordFrameTimingEvents( - std::unique_ptr<cc::FrameTimingTracker::CompositeTimingSet> - composite_events, - std::unique_ptr<cc::FrameTimingTracker::MainFrameTimingSet> - main_frame_events) override; void RequestScheduleAnimation() override; void UpdateVisualState() override; void WillBeginCompositorFrame() override; @@ -561,10 +556,6 @@ // by script, not by user input. void didUpdateTextOfFocusedElementByNonUserInput() override; - // Creates a 3D context associated with this view. - std::unique_ptr<WebGraphicsContext3DCommandBufferImpl> - CreateGraphicsContext3D(gpu::GpuChannelHost* gpu_channel_host); - // Sends an ACK to the browser process during the next compositor frame. void OnWaitNextFrameForTests(int routing_id);
diff --git a/content/renderer/renderer_blink_platform_impl.cc b/content/renderer/renderer_blink_platform_impl.cc index 61541ea2..d214791f 100644 --- a/content/renderer/renderer_blink_platform_impl.cc +++ b/content/renderer/renderer_blink_platform_impl.cc
@@ -1060,15 +1060,14 @@ gfx::GpuPreference gpu_preference = gfx::PreferDiscreteGpu; WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits limits; - std::unique_ptr<WebGraphicsContext3DCommandBufferImpl> context( - WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext( - gpu_channel_host.get(), attributes, gpu_preference, share_resources, - automatic_flushes, GURL(top_document_web_url), limits, - share_context)); - scoped_refptr<ContextProviderCommandBuffer> provider = - ContextProviderCommandBuffer::Create(std::move(context), - RENDERER_MAINTHREAD_CONTEXT); - if (!provider || !provider->BindToCurrentThread()) { + scoped_refptr<ContextProviderCommandBuffer> provider( + new ContextProviderCommandBuffer( + base::WrapUnique(new WebGraphicsContext3DCommandBufferImpl( + gpu::kNullSurfaceHandle, GURL(top_document_web_url), + gpu_channel_host.get(), attributes, gpu_preference, + share_resources, automatic_flushes, limits, share_context)), + RENDERER_MAINTHREAD_CONTEXT)); + if (!provider->BindToCurrentThread()) { // Collect Graphicsinfo if there is a context failure or it is failed // purposefully in case of layout tests. Collect3DContextInformationOnFailure(gl_info, gpu_channel_host.get());
diff --git a/content/renderer/renderer_main_platform_delegate_win.cc b/content/renderer/renderer_main_platform_delegate_win.cc index 0277d3e..a698af44 100644 --- a/content/renderer/renderer_main_platform_delegate_win.cc +++ b/content/renderer/renderer_main_platform_delegate_win.cc
@@ -25,8 +25,8 @@ #include "third_party/WebKit/public/web/win/WebFontRendering.h" #include "third_party/icu/source/i18n/unicode/timezone.h" #include "third_party/skia/include/ports/SkTypeface_win.h" +#include "ui/display/win/dpi.h" #include "ui/gfx/win/direct_write.h" -#include "ui/gfx/win/dpi.h" namespace content { namespace { @@ -75,7 +75,8 @@ } } blink::WebFontRendering::setUseDirectWrite(use_direct_write); - blink::WebFontRendering::setDeviceScaleFactor(gfx::GetDPIScale()); + // TODO(robliao): This should use WebScreenInfo. See http://crbug.com/604555. + blink::WebFontRendering::setDeviceScaleFactor(display::win::GetDPIScale()); } void RendererMainPlatformDelegate::PlatformUninitialize() {
diff --git a/content/renderer/service_worker/service_worker_context_client.cc b/content/renderer/service_worker/service_worker_context_client.cc index f9086d41..52a97a4 100644 --- a/content/renderer/service_worker/service_worker_context_client.cc +++ b/content/renderer/service_worker/service_worker_context_client.cc
@@ -253,7 +253,6 @@ OnNotificationCloseEvent) IPC_MESSAGE_HANDLER(ServiceWorkerMsg_PushEvent, OnPushEvent) IPC_MESSAGE_HANDLER(ServiceWorkerMsg_GeofencingEvent, OnGeofencingEvent) - IPC_MESSAGE_HANDLER(ServiceWorkerMsg_MessageToWorker, OnPostMessage) IPC_MESSAGE_HANDLER(ServiceWorkerMsg_DidGetClient, OnDidGetClient) IPC_MESSAGE_HANDLER(ServiceWorkerMsg_DidGetClients, OnDidGetClients) IPC_MESSAGE_HANDLER(ServiceWorkerMsg_OpenWindowResponse, @@ -837,26 +836,6 @@ GetRoutingID(), request_id, blink::WebServiceWorkerEventResultCompleted)); } -void ServiceWorkerContextClient::OnPostMessage( - const base::string16& message, - const std::vector<TransferredMessagePort>& sent_message_ports, - const std::vector<int>& new_routing_ids) { - TRACE_EVENT0("ServiceWorker", - "ServiceWorkerContextClient::OnPostEvent"); - blink::WebMessagePortChannelArray ports = - WebMessagePortChannelImpl::CreatePorts( - sent_message_ports, new_routing_ids, - main_thread_task_runner_); - - // dispatchMessageEvent is expected to execute onmessage function - // synchronously. - base::TimeTicks before = base::TimeTicks::Now(); - proxy_->dispatchMessageEvent(message, ports); - UMA_HISTOGRAM_MEDIUM_TIMES( - "ServiceWorker.MessageEvent.Time", - base::TimeTicks::Now() - before); -} - void ServiceWorkerContextClient::OnDidGetClient( int request_id, const ServiceWorkerClientInfo& client) {
diff --git a/content/renderer/service_worker/service_worker_context_client.h b/content/renderer/service_worker/service_worker_context_client.h index de431ce..4d1c31a8 100644 --- a/content/renderer/service_worker/service_worker_context_client.h +++ b/content/renderer/service_worker/service_worker_context_client.h
@@ -213,13 +213,6 @@ const std::string& region_id, const blink::WebCircularGeofencingRegion& region); - // TODO(nhiroki): Remove this after ExtendableMessageEvent is enabled by - // default (crbug.com/543198). - void OnPostMessage( - const base::string16& message, - const std::vector<TransferredMessagePort>& sent_message_ports, - const std::vector<int>& new_routing_ids); - void OnDidGetClient(int request_id, const ServiceWorkerClientInfo& client); void OnDidGetClients( int request_id, const std::vector<ServiceWorkerClientInfo>& clients);
diff --git a/content/renderer/usb/web_usb_client_impl.cc b/content/renderer/usb/web_usb_client_impl.cc index 6f4c3af..1c2401d0 100644 --- a/content/renderer/usb/web_usb_client_impl.cc +++ b/content/renderer/usb/web_usb_client_impl.cc
@@ -13,6 +13,7 @@ #include "base/callback.h" #include "base/memory/ptr_util.h" #include "base/move.h" +#include "base/stl_util.h" #include "base/strings/utf_string_conversions.h" #include "content/child/mojo/type_converters.h" #include "content/child/scoped_web_callbacks.h"
diff --git a/content/shell/DEPS b/content/shell/DEPS index e2303711..f6a233f 100644 --- a/content/shell/DEPS +++ b/content/shell/DEPS
@@ -45,9 +45,4 @@ "content_browser_tests_android\.cc": [ "+media/base" ], - # Test hook. - "shell_mojo_test_utils_android\.cc": [ - "+content/browser/mojo", - "+content/common/mojo", - ], }
diff --git a/content/shell/browser/layout_test/layout_test_notification_manager.cc b/content/shell/browser/layout_test/layout_test_notification_manager.cc index 7a5ee2be..c019c60 100644 --- a/content/shell/browser/layout_test/layout_test_notification_manager.cc +++ b/content/shell/browser/layout_test/layout_test_notification_manager.cc
@@ -23,21 +23,6 @@ // Service Worker when a notificationclick event has been dispatched. void OnEventDispatchComplete(PersistentNotificationStatus status) {} -blink::WebNotificationPermission ToWebNotificationPermission( - blink::mojom::PermissionStatus status) { - switch (status) { - case blink::mojom::PermissionStatus::GRANTED: - return blink::WebNotificationPermissionAllowed; - case blink::mojom::PermissionStatus::DENIED: - return blink::WebNotificationPermissionDenied; - case blink::mojom::PermissionStatus::ASK: - return blink::WebNotificationPermissionDefault; - } - - NOTREACHED(); - return blink::WebNotificationPermissionLast; -} - } // namespace LayoutTestNotificationManager::LayoutTestNotificationManager() @@ -152,7 +137,7 @@ base::Bind(&OnEventDispatchComplete)); } -blink::WebNotificationPermission +blink::mojom::PermissionStatus LayoutTestNotificationManager::CheckPermissionOnUIThread( BrowserContext* browser_context, const GURL& origin, @@ -161,7 +146,7 @@ return CheckPermission(origin); } -blink::WebNotificationPermission +blink::mojom::PermissionStatus LayoutTestNotificationManager::CheckPermissionOnIOThread( ResourceContext* resource_context, const GURL& origin, @@ -210,14 +195,14 @@ replacements_[tag] = base::UTF16ToUTF8(notification_data.title); } -blink::WebNotificationPermission +blink::mojom::PermissionStatus LayoutTestNotificationManager::CheckPermission(const GURL& origin) { - return ToWebNotificationPermission(LayoutTestContentBrowserClient::Get() + return LayoutTestContentBrowserClient::Get() ->GetLayoutTestBrowserContext() ->GetLayoutTestPermissionManager() ->GetPermissionStatus(PermissionType::NOTIFICATIONS, origin, - origin)); + origin); } } // namespace content
diff --git a/content/shell/browser/layout_test/layout_test_notification_manager.h b/content/shell/browser/layout_test/layout_test_notification_manager.h index de6362b..8fe89fe 100644 --- a/content/shell/browser/layout_test/layout_test_notification_manager.h +++ b/content/shell/browser/layout_test/layout_test_notification_manager.h
@@ -13,7 +13,7 @@ #include "base/macros.h" #include "base/memory/weak_ptr.h" #include "content/public/browser/platform_notification_service.h" -#include "third_party/WebKit/public/platform/modules/notifications/WebNotificationPermission.h" +#include "third_party/WebKit/public/platform/modules/permissions/permission_status.mojom.h" #include "url/gurl.h" namespace content { @@ -39,11 +39,11 @@ void SimulateClose(const std::string& title, bool by_user); // PlatformNotificationService implementation. - blink::WebNotificationPermission CheckPermissionOnUIThread( + blink::mojom::PermissionStatus CheckPermissionOnUIThread( BrowserContext* browser_context, const GURL& origin, int render_process_id) override; - blink::WebNotificationPermission CheckPermissionOnIOThread( + blink::mojom::PermissionStatus CheckPermissionOnIOThread( ResourceContext* resource_context, const GURL& origin, int render_process_id) override; @@ -86,7 +86,7 @@ // Checks if |origin| has permission to display notifications. May be called // on both the IO and the UI threads. - blink::WebNotificationPermission CheckPermission(const GURL& origin); + blink::mojom::PermissionStatus CheckPermission(const GURL& origin); std::map<std::string, DesktopNotificationDelegate*> page_notifications_; std::map<std::string, PersistentNotification> persistent_notifications_;
diff --git a/content/shell/browser/shell_mojo_test_utils_android.cc b/content/shell/browser/shell_mojo_test_utils_android.cc index ba02290..a98c94a0 100644 --- a/content/shell/browser/shell_mojo_test_utils_android.cc +++ b/content/shell/browser/shell_mojo_test_utils_android.cc
@@ -9,15 +9,15 @@ #include "base/memory/scoped_vector.h" #include "base/message_loop/message_loop.h" #include "base/run_loop.h" -#include "content/common/mojo/service_registry_impl.h" #include "content/public/browser/android/service_registry_android.h" +#include "content/public/common/service_registry.h" #include "jni/ShellMojoTestUtils_jni.h" namespace { struct TestEnvironment { base::MessageLoop message_loop; - ScopedVector<content::ServiceRegistryImpl> registries; + ScopedVector<content::ServiceRegistry> registries; ScopedVector<content::ServiceRegistryAndroid> wrappers; }; @@ -43,9 +43,9 @@ TestEnvironment* test_environment = reinterpret_cast<TestEnvironment*>(native_test_environment); - content::ServiceRegistryImpl* registry_a = new ServiceRegistryImpl(); + content::ServiceRegistry* registry_a = ServiceRegistry::Create(); test_environment->registries.push_back(registry_a); - content::ServiceRegistryImpl* registry_b = new ServiceRegistryImpl(); + content::ServiceRegistry* registry_b = ServiceRegistry::Create(); test_environment->registries.push_back(registry_b); shell::mojom::InterfaceProviderPtr exposed_services_a;
diff --git a/content/shell/common/layout_test/layout_test_messages.h b/content/shell/common/layout_test/layout_test_messages.h index a0fa170..b9712e5 100644 --- a/content/shell/common/layout_test/layout_test_messages.h +++ b/content/shell/common/layout_test/layout_test_messages.h
@@ -6,6 +6,7 @@ #include <string> #include <vector> +#include "content/public/common/common_param_traits_macros.h" #include "ipc/ipc_message_macros.h" #include "ipc/ipc_platform_file.h" #include "third_party/WebKit/public/platform/modules/permissions/permission_status.mojom.h" @@ -14,10 +15,6 @@ #define IPC_MESSAGE_START LayoutTestMsgStart -IPC_ENUM_TRAITS_MIN_MAX_VALUE(blink::mojom::PermissionStatus, - blink::mojom::PermissionStatus::GRANTED, - blink::mojom::PermissionStatus::ASK) - IPC_SYNC_MESSAGE_ROUTED1_1(LayoutTestHostMsg_ReadFileToString, base::FilePath /* local path */, std::string /* contents */)
diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn index 7cdd4d83..ed2db4eb 100644 --- a/content/test/BUILD.gn +++ b/content/test/BUILD.gn
@@ -80,6 +80,7 @@ "//ui/base:ui_data_pack", "//ui/base/ime", "//ui/compositor:test_support", + "//ui/display", "//ui/events:dom_keycode_converter", "//ui/events:events_base", "//ui/events:gesture_detection",
diff --git a/content/test/blink_test_environment.cc b/content/test/blink_test_environment.cc index 77dee1a..1114f7f 100644 --- a/content/test/blink_test_environment.cc +++ b/content/test/blink_test_environment.cc
@@ -23,7 +23,7 @@ #include "url/url_util.h" #if defined(OS_WIN) -#include "ui/gfx/win/dpi.h" +#include "ui/display/win/dpi.h" #endif #if defined(OS_ANDROID) @@ -108,7 +108,7 @@ #endif #if defined(OS_WIN) - gfx::SetDefaultDeviceScaleFactor(1.0f); + display::win::SetDefaultDeviceScaleFactor(1.0f); #endif // Explicitly initialize the GURL library before spawning any threads.
diff --git a/content/test/content_test_suite.cc b/content/test/content_test_suite.cc index 663ffe6..e20a6185 100644 --- a/content/test/content_test_suite.cc +++ b/content/test/content_test_suite.cc
@@ -20,7 +20,7 @@ #include "ui/gl/test/gl_surface_test_support.h" #if defined(OS_WIN) -#include "ui/gfx/win/dpi.h" +#include "ui/display/win/dpi.h" #endif #if defined(OS_MACOSX) @@ -75,7 +75,7 @@ #endif #if defined(OS_WIN) - gfx::SetDefaultDeviceScaleFactor(1.0f); + display::win::SetDefaultDeviceScaleFactor(1.0f); #endif ContentTestSuiteBase::Initialize();
diff --git a/content/test/data/gpu/webgl_extension_test.html b/content/test/data/gpu/webgl_extension_test.html new file mode 100644 index 0000000..d444c3b --- /dev/null +++ b/content/test/data/gpu/webgl_extension_test.html
@@ -0,0 +1,62 @@ +<!DOCTYPE html> +<html> + <script> + function checkExtension(name, context_type) { + var canvas = document.createElement("canvas"); + document.body.appendChild(canvas); + + var gl_context = canvas.getContext(context_type || "webgl"); + + // If we don't have a GL context, give up now + if (!gl_context) { + webglTestHarness.reportResults(name, false, "Unable to initialize " + context_type + " context."); + } else { + var gl_extension = gl_context.getExtension(name); + if (gl_extension) { + webglTestHarness.reportResults(name, true, name + " was available"); + } else { + webglTestHarness.reportResults(name, false, name + " was not available"); + } + } + + webglTestHarness.notifyFinished(name); + } + + function checkSupportedExtensions(expected_extensions, context_type) { + var canvas = document.createElement("canvas"); + document.body.appendChild(canvas); + + var gl_context = canvas.getContext(context_type || "webgl"); + + // If we don't have a GL context, give up now + if (!gl_context) { + webglTestHarness.reportResults(name, false, "Unable to initialize " + context_type + " context."); + } else { + var missing_list = []; + var extension_list = gl_context.getSupportedExtensions(); + for (var i in extension_list) { + var extension = extension_list[i]; + if (extension.indexOf("WEBKIT_") == 0) + continue; // Skip WEBKIT_ prefixed extensions since they all have unprefixed variants at this point. + var expected_index = expected_extensions.indexOf(extension); + if (expected_index == -1) { + missing_list.push(extension); + } + } + + if (missing_list.length == 0) { + webglTestHarness.reportResults(name, true, "All " + context_type + " extensions are being tested."); + } else { + var error_string = "The following " + context_type + " extensions are not being tested and should be added to GetExtensionList() in content/test/gpu/gpu_tests/webgl_conformance.py:"; + for (var i in missing_list) { + error_string += "\n\t" + missing_list[i]; + } + webglTestHarness.reportResults(name, false, error_string); + } + } + + webglTestHarness.notifyFinished(name); + } + </script> + <body></body> +</html>
diff --git a/content/test/dwrite_font_fake_sender_win.cc b/content/test/dwrite_font_fake_sender_win.cc index 201454d..a525ee6 100644 --- a/content/test/dwrite_font_fake_sender_win.cc +++ b/content/test/dwrite_font_fake_sender_win.cc
@@ -4,6 +4,7 @@ #include "content/test/dwrite_font_fake_sender_win.h" +#include <dwrite.h> #include <shlobj.h> #include "content/common/dwrite_font_proxy_messages.h" @@ -79,6 +80,7 @@ IPC_MESSAGE_HANDLER(DWriteFontProxyMsg_GetFamilyCount, OnGetFamilyCount) IPC_MESSAGE_HANDLER(DWriteFontProxyMsg_GetFamilyNames, OnGetFamilyNames) IPC_MESSAGE_HANDLER(DWriteFontProxyMsg_GetFontFiles, OnGetFontFiles) + IPC_MESSAGE_HANDLER(DWriteFontProxyMsg_MapCharacters, OnMapCharacters) IPC_MESSAGE_UNHANDLED(handled = false) IPC_END_MESSAGE_MAP() return reply_; @@ -111,6 +113,17 @@ collection_->OnGetFontFiles(family_index, file_paths); } +void FakeFontCollection::ReplySender::OnMapCharacters( + const base::string16& text, + const DWriteFontStyle& font_style, + const base::string16& locale_name, + uint32_t reading_direction, + const base::string16& base_family_name, + MapCharactersResult* result) { + collection_->OnMapCharacters(text, font_style, locale_name, reading_direction, + base_family_name, result); +} + FakeFontCollection::FakeSender::FakeSender(FakeFontCollection* collection, bool track_messages) : track_messages_(track_messages), collection_(collection) {} @@ -165,6 +178,21 @@ *file_paths = fonts_[family_index].file_paths_; } +void FakeFontCollection::OnMapCharacters(const base::string16& text, + const DWriteFontStyle& font_style, + const base::string16& locale_name, + uint32_t reading_direction, + const base::string16& base_family_name, + MapCharactersResult* result) { + result->family_index = 0; + result->family_name = fonts_[0].font_name(); + result->mapped_length = 1; + result->scale = 1.0; + result->font_style.font_weight = DWRITE_FONT_WEIGHT_NORMAL; + result->font_style.font_slant = DWRITE_FONT_STYLE_NORMAL; + result->font_style.font_stretch = DWRITE_FONT_STRETCH_NORMAL; +} + std::unique_ptr<FakeFontCollection::ReplySender> FakeFontCollection::GetReplySender() { return std::unique_ptr<FakeFontCollection::ReplySender>(
diff --git a/content/test/dwrite_font_fake_sender_win.h b/content/test/dwrite_font_fake_sender_win.h index d2929a23..84363cb 100644 --- a/content/test/dwrite_font_fake_sender_win.h +++ b/content/test/dwrite_font_fake_sender_win.h
@@ -19,6 +19,9 @@ #include "ipc/ipc_message.h" #include "ipc/ipc_sender.h" +struct DWriteFontStyle; +struct MapCharactersResult; + namespace content { class FakeFontCollection; @@ -47,6 +50,8 @@ return *this; } + const base::string16& font_name() { return font_name_; } + private: friend FakeFontCollection; base::string16 font_name_; @@ -114,6 +119,13 @@ void OnGetFontFiles(uint32_t family_index, std::vector<base::string16>* file_paths_); + void OnMapCharacters(const base::string16& text, + const DWriteFontStyle& font_style, + const base::string16& locale_name, + uint32_t reading_direction, + const base::string16& base_family_name, + MapCharactersResult* result); + private: scoped_refptr<FakeFontCollection> collection_; std::unique_ptr<IPC::Message> reply_; @@ -148,6 +160,13 @@ void OnGetFontFiles(uint32_t family_index, std::vector<base::string16>* file_paths); + void OnMapCharacters(const base::string16& text, + const DWriteFontStyle& font_style, + const base::string16& locale_name, + uint32_t reading_direction, + const base::string16& base_family_name, + MapCharactersResult* result); + std::unique_ptr<ReplySender> GetReplySender(); private:
diff --git a/content/test/gpu/gpu_tests/webgl2_conformance_expectations.py b/content/test/gpu/gpu_tests/webgl2_conformance_expectations.py index 7ee1229..57cb4f71 100644 --- a/content/test/gpu/gpu_tests/webgl2_conformance_expectations.py +++ b/content/test/gpu/gpu_tests/webgl2_conformance_expectations.py
@@ -10,6 +10,26 @@ super(WebGL2ConformanceExpectations, self).__init__(conformance_path) def SetExpectations(self): + # =================================== + # Extension availability expectations + # =================================== + # It's expected that not all extensions will be available on all platforms. + # Having a test listed here is not necessarily a problem. + + self.Fail('WebglExtension.EXT_color_buffer_float', + ['win', 'mac', 'linux']) + self.Fail('WebglExtension.WEBGL_compressed_texture_astc', + ['win', 'mac', 'linux']) + self.Fail('WebglExtension.WEBGL_compressed_texture_atc', + ['win', 'mac', 'linux']) + self.Fail('WebglExtension.WEBGL_compressed_texture_etc1', + ['mac', 'linux']) + self.Fail('WebglExtension.WEBGL_compressed_texture_pvrtc', + ['win', 'mac', 'linux']) + + # ======================== + # Conformance expectations + # ======================== # All platforms. self.Skip('deqp/functional/gles3/builtinprecision*.html', bug=483282) self.Skip('deqp/functional/gles3/draw.html', bug=483282)
diff --git a/content/test/gpu/gpu_tests/webgl_conformance.py b/content/test/gpu/gpu_tests/webgl_conformance.py index 5fb6884..b2ec479e 100644 --- a/content/test/gpu/gpu_tests/webgl_conformance.py +++ b/content/test/gpu/gpu_tests/webgl_conformance.py
@@ -12,7 +12,9 @@ from telemetry.page import page_test from telemetry.story.story_set import StorySet - +extensions_path = os.path.join( + path_util.GetChromiumSrcDir(), + 'content', 'test', 'data', 'gpu') conformance_path = os.path.join( path_util.GetChromiumSrcDir(), 'third_party', 'webgl', 'src', 'sdk', 'tests') @@ -126,6 +128,48 @@ '--disable-accelerated-video-decode' ]) +class WebglExtensionPage(gpu_test_base.PageBase): + def __init__(self, story_set, extension, webgl_version, expectations): + super(WebglExtensionPage, self).__init__( + url='file://' + extensions_path + '/webgl_extension_test.html', + page_set=story_set, base_dir=extensions_path, + shared_page_state_class=gpu_test_base.DesktopGpuSharedPageState, + name=('WebglExtension.%s' % extension), + expectations=expectations) + self.extension = extension + self.context_type = "webgl2" if webgl_version == 2 else "webgl" + self.script_to_evaluate_on_commit = conformance_harness_script + + def RunNavigateSteps(self, action_runner): + super(WebglExtensionPage, self).RunNavigateSteps(action_runner) + action_runner.EvaluateJavaScript('checkExtension("%s", "%s")' % + (self.extension, self.context_type)) + action_runner.WaitForJavaScriptCondition( + 'webglTestHarness._finished', timeout_in_seconds=3) + +class WebglExtensionListPage(gpu_test_base.PageBase): + def __init__(self, story_set, extension_list, webgl_version, expectations): + super(WebglExtensionListPage, self).__init__( + url='file://' + extensions_path + '/webgl_extension_test.html', + page_set=story_set, base_dir=extensions_path, + shared_page_state_class=gpu_test_base.DesktopGpuSharedPageState, + name=('WebglExtension.TestCoverage'), + expectations=expectations) + self.extension_list = extension_list + self.context_type = "webgl2" if webgl_version == 2 else "webgl" + self.script_to_evaluate_on_commit = conformance_harness_script + + def RunNavigateSteps(self, action_runner): + super(WebglExtensionListPage, self).RunNavigateSteps(action_runner) + extension_list_string = "[" + for extension in self.extension_list: + extension_list_string = extension_list_string + extension + ", " + extension_list_string = extension_list_string + "]" + action_runner.EvaluateJavaScript('checkSupportedExtensions("%s", "%s")' % + (extension_list_string, self.context_type)) + action_runner.WaitForJavaScriptCondition( + 'webglTestHarness._finished', timeout_in_seconds=3) + class WebglConformancePage(gpu_test_base.PageBase): def __init__(self, story_set, test, expectations): super(WebglConformancePage, self).__init__( @@ -179,6 +223,14 @@ ps = StorySet(serving_dirs=[''], base_dir=conformance_path) expectations = self.GetExpectations() + + extension_tests = self.GetExtensionList() + ps.AddStory(WebglExtensionListPage(ps, extension_tests, self._webgl_version, + expectations)) + for extension in extension_tests: + ps.AddStory(WebglExtensionPage(ps, extension, self._webgl_version, + expectations)) + for test in tests: ps.AddStory(WebglConformancePage(ps, test, expectations)) @@ -193,6 +245,50 @@ return webgl2_conformance_expectations.WebGL2ConformanceExpectations( conformance_path) + def GetExtensionList(self): + if self._webgl_version == 1: + return [ + 'ANGLE_instanced_arrays', + 'EXT_blend_minmax', + 'EXT_disjoint_timer_query', + 'EXT_frag_depth', + 'EXT_shader_texture_lod', + 'EXT_sRGB', + 'EXT_texture_filter_anisotropic', + 'OES_element_index_uint', + 'OES_standard_derivatives', + 'OES_texture_float', + 'OES_texture_float_linear', + 'OES_texture_half_float', + 'OES_texture_half_float_linear', + 'OES_vertex_array_object', + 'WEBGL_compressed_texture_astc', + 'WEBGL_compressed_texture_atc', + 'WEBGL_compressed_texture_etc1', + 'WEBGL_compressed_texture_pvrtc', + 'WEBGL_compressed_texture_s3tc', + 'WEBGL_debug_renderer_info', + 'WEBGL_debug_shaders', + 'WEBGL_depth_texture', + 'WEBGL_draw_buffers', + 'WEBGL_lose_context', + ] + else: + return [ + 'EXT_color_buffer_float', + 'EXT_disjoint_timer_query', + 'EXT_texture_filter_anisotropic', + 'OES_texture_float_linear', + 'WEBGL_compressed_texture_astc', + 'WEBGL_compressed_texture_atc', + 'WEBGL_compressed_texture_etc1', + 'WEBGL_compressed_texture_pvrtc', + 'WEBGL_compressed_texture_s3tc', + 'WEBGL_debug_renderer_info', + 'WEBGL_debug_shaders', + 'WEBGL_lose_context', + ] + @staticmethod def _ParseTests(path, version, webgl2_only, folder_min_version): test_paths = []
diff --git a/content/test/gpu/gpu_tests/webgl_conformance_expectations.py b/content/test/gpu/gpu_tests/webgl_conformance_expectations.py index 3bcb674..d91898e 100644 --- a/content/test/gpu/gpu_tests/webgl_conformance_expectations.py +++ b/content/test/gpu/gpu_tests/webgl_conformance_expectations.py
@@ -22,13 +22,47 @@ def CheckPatternIsValid(self, pattern): # Look for basic wildcards. - if not '*' in pattern: + if not '*' in pattern and not 'WebglExtension.' in pattern: full_path = os.path.normpath(os.path.join(self.conformance_path, pattern)) if not os.path.exists(full_path): raise Exception('The WebGL conformance test path specified in ' + 'expectation does not exist: ' + full_path) def SetExpectations(self): + # =================================== + # Extension availability expectations + # =================================== + # It's expected that not all extensions will be available on all platforms. + # Having a test listed here is not necessarily a problem. + + self.Fail('WebglExtension.EXT_color_buffer_float', + ['win', 'mac']) + self.Fail('WebglExtension.WEBGL_compressed_texture_astc', + ['win', 'mac', 'linux']) + self.Fail('WebglExtension.WEBGL_compressed_texture_atc', + ['win', 'mac', 'linux']) + self.Fail('WebglExtension.WEBGL_compressed_texture_etc1', + ['mac', 'linux']) + self.Fail('WebglExtension.WEBGL_compressed_texture_pvrtc', + ['win', 'mac', 'linux']) + + # Extensions not available under D3D9 + self.Fail('WebglExtension.EXT_disjoint_timer_query', + ['win', 'd3d9']) + self.Fail('WebglExtension.EXT_sRGB', + ['win', 'd3d9']) + self.Fail('WebglExtension.WEBGL_compressed_texture_etc1', + ['win', 'd3d9']) + + self.Fail('WebglExtension.WEBGL_depth_texture', + ['win', 'amd', 'd3d9']) + + self.Fail('WebglExtension.WEBGL_draw_buffers', + ['win', 'd3d9']) + + # ======================== + # Conformance expectations + # ======================== # Fails on all platforms self.Fail('deqp/data/gles2/shaders/functions.html', bug=478572)
diff --git a/courgette/disassembler_elf_32.cc b/courgette/disassembler_elf_32.cc index 346d9a19..d307fc4 100644 --- a/courgette/disassembler_elf_32.cc +++ b/courgette/disassembler_elf_32.cc
@@ -14,18 +14,20 @@ namespace { -// Initializes |section_header_table| by copying |section_header_table_size| -// entries from |section_header_table_raw|, and sorting by |sh_offset|. -void SortSectionHeader(const Elf32_Shdr* section_header_table_raw, - Elf32_Half section_header_table_size, - std::vector<Elf32_Shdr>* section_header_table) { - section_header_table->assign(section_header_table_raw, - section_header_table_raw + section_header_table_size); - auto comp = [](const Elf32_Shdr& header1, const Elf32_Shdr& header2) { - return header1.sh_offset < header2.sh_offset; +// Sorts |section_headers| by file offset and stores the resulting permutation +// of section ids in |order|. +std::vector<Elf32_Half> GetSectionHeaderFileOffsetOrder( + const std::vector<Elf32_Shdr>& section_headers) { + size_t size = section_headers.size(); + std::vector<Elf32_Half> order(size); + for (size_t i = 0; i < size; ++i) + order[i] = static_cast<Elf32_Half>(i); + + auto comp = [&](int idx1, int idx2) { + return section_headers[idx1].sh_offset < section_headers[idx2].sh_offset; }; - std::stable_sort( - section_header_table->begin(), section_header_table->end(), comp); + std::stable_sort(order.begin(), order.end(), comp); + return order; } } // namespace @@ -44,8 +46,8 @@ // executables and so only need to support 32-bit file sizes. uint32_t offset32 = static_cast<uint32_t>(offset); - for (Elf32_Half section_id = 0; section_id < SectionHeaderCount(); - ++section_id) { + // Visit section headers ordered by file offset. + for (Elf32_Half section_id : section_header_file_offset_order_) { const Elf32_Shdr* section_header = SectionHeader(section_id); // These can appear to have a size in the file, but don't. if (section_header->sh_type == SHT_NOBITS) @@ -112,12 +114,16 @@ if (!IsArrayInBounds(header_->e_shoff, header_->e_shnum, sizeof(Elf32_Shdr))) return Bad("Out of bounds section header table"); + // Extract |section_header_table_|, ordered by section id. const Elf32_Shdr* section_header_table_raw = reinterpret_cast<const Elf32_Shdr*>( FileOffsetToPointer(header_->e_shoff)); section_header_table_size_ = header_->e_shnum; - SortSectionHeader(section_header_table_raw, section_header_table_size_, - §ion_header_table_); + section_header_table_.assign(section_header_table_raw, + section_header_table_raw + section_header_table_size_); + + section_header_file_offset_order_ = + GetSectionHeaderFileOffsetOrder(section_header_table_); if (!IsArrayInBounds(header_->e_phoff, header_->e_phnum, sizeof(Elf32_Phdr))) return Bad("Out of bounds program header table"); @@ -264,8 +270,8 @@ std::vector<FileOffset>::iterator end_abs_offset = abs_offsets.end(); ScopedVector<TypedRVA>::iterator end_rel = rel32_locations_.end(); - for (Elf32_Half section_id = 0; section_id < SectionHeaderCount(); - ++section_id) { + // Visit section headers ordered by file offset. + for (Elf32_Half section_id : section_header_file_offset_order_) { const Elf32_Shdr* section_header = SectionHeader(section_id); if (section_header->sh_type == SHT_NOBITS)
diff --git a/courgette/disassembler_elf_32.h b/courgette/disassembler_elf_32.h index ce03ab8d..d8efed50 100644 --- a/courgette/disassembler_elf_32.h +++ b/courgette/disassembler_elf_32.h
@@ -162,13 +162,19 @@ CheckBool ParseRel32RelocsFromSections() WARN_UNUSED_RESULT; const Elf32_Ehdr* header_; - std::vector<Elf32_Shdr> section_header_table_; + Elf32_Half section_header_table_size_; + // Section header table, ordered by section id. + std::vector<Elf32_Shdr> section_header_table_; + + // An ordering of |section_header_table_|, sorted by file offset. + std::vector<Elf32_Half> section_header_file_offset_order_; + const Elf32_Phdr* program_header_table_; Elf32_Half program_header_table_size_; - // Section header for default + // Pointer to section names. const char* default_string_section_; std::vector<RVA> abs32_locations_;
diff --git a/courgette/disassembler_elf_32_x86_unittest.cc b/courgette/disassembler_elf_32_x86_unittest.cc index 59fa3e6..90d17d6 100644 --- a/courgette/disassembler_elf_32_x86_unittest.cc +++ b/courgette/disassembler_elf_32_x86_unittest.cc
@@ -10,6 +10,7 @@ #include <algorithm> #include <memory> #include <string> +#include <vector> #include "courgette/assembly_program.h" #include "courgette/base_test_unittest.h" @@ -19,6 +20,23 @@ namespace { +class TestDisassemblerElf32X86 : public DisassemblerElf32X86 { + public: + TestDisassemblerElf32X86(const void* start, size_t length) + : DisassemblerElf32X86(start, length) { } + ~TestDisassemblerElf32X86() override { } + + void TestSectionHeaderFileOffsetOrder() { + std::vector<FileOffset> file_offsets; + for (Elf32_Half section_id : section_header_file_offset_order_) { + const Elf32_Shdr* section_header = SectionHeader(section_id); + file_offsets.push_back(section_header->sh_offset); + } + EXPECT_EQ(static_cast<size_t>(SectionHeaderCount()), file_offsets.size()); + EXPECT_TRUE(std::is_sorted(file_offsets.begin(), file_offsets.end())); + } +}; + class DisassemblerElf32X86Test : public BaseTest { public: void TestExe(const char* file_name, @@ -32,8 +50,8 @@ using TypedRVA = DisassemblerElf32::TypedRVA; std::string file1 = FileContents(file_name); - std::unique_ptr<DisassemblerElf32X86> disassembler( - new DisassemblerElf32X86(file1.c_str(), file1.length())); + std::unique_ptr<TestDisassemblerElf32X86> disassembler( + new TestDisassemblerElf32X86(file1.c_str(), file1.length())); bool can_parse_header = disassembler->ParseHeader(); EXPECT_TRUE(can_parse_header); @@ -84,12 +102,15 @@ } } EXPECT_FALSE(found_match); + + disassembler->TestSectionHeaderFileOffsetOrder(); } } // namespace TEST_F(DisassemblerElf32X86Test, All) { TestExe("elf-32-1", 200, 3441); + TestExe("elf-32-high-bss", 0, 13); } } // namespace courgette
diff --git a/device/usb/BUILD.gn b/device/usb/BUILD.gn index 0d3795bf..db154526 100644 --- a/device/usb/BUILD.gn +++ b/device/usb/BUILD.gn
@@ -59,6 +59,10 @@ if (is_android) { deps += [ ":jni_headers" ] + sources += [ + "usb_device_handle_usbfs.cc", + "usb_device_handle_usbfs.h", + ] } else { sources += [ "usb_context.cc", @@ -76,6 +80,17 @@ deps += [ "//third_party/libusb" ] } + if (is_linux || is_chromeos) { + sources += [ + "usb_device_handle_usbfs.cc", + "usb_device_handle_usbfs.h", + ] + sources -= [ + "usb_device_handle_impl.cc", + "usb_device_handle_impl.h", + ] + } + if (is_chromeos) { deps += [ "//chromeos",
diff --git a/device/usb/usb.gyp b/device/usb/usb.gyp index ef2cf89..bdac4ff9 100644 --- a/device/usb/usb.gyp +++ b/device/usb/usb.gyp
@@ -103,6 +103,10 @@ 'dependencies!': [ '../../third_party/libusb/libusb.gyp:libusb', ], + 'sources': [ + 'usb_device_handle_usbfs.cc', + 'usb_device_handle_usbfs.h', + ], # These sources are libusb-specific. 'sources!': [ 'usb_context.cc', @@ -122,6 +126,16 @@ '../../chromeos/chromeos.gyp:chromeos', ], }], + ['OS=="linux"', { + 'sources': [ + 'usb_device_handle_usbfs.cc', + 'usb_device_handle_usbfs.h', + ], + 'sources!': [ + 'usb_device_handle_impl.cc', + 'usb_device_handle_impl.h', + ] + }] ] }, {
diff --git a/device/usb/usb_device_android.cc b/device/usb/usb_device_android.cc index 53873a9..ca7192f 100644 --- a/device/usb/usb_device_android.cc +++ b/device/usb/usb_device_android.cc
@@ -35,12 +35,15 @@ uint16_t device_version = 0; if (base::android::BuildInfo::GetInstance()->sdk_int() >= 23) device_version = Java_ChromeUsbDevice_getDeviceVersion(env, wrapper.obj()); - ScopedJavaLocalRef<jstring> manufacturer_string = - Java_ChromeUsbDevice_getManufacturerName(env, wrapper.obj()); - ScopedJavaLocalRef<jstring> product_string = - Java_ChromeUsbDevice_getProductName(env, wrapper.obj()); - ScopedJavaLocalRef<jstring> serial_number = - Java_ChromeUsbDevice_getSerialNumber(env, wrapper.obj()); + base::string16 manufacturer_string, product_string, serial_number; + if (base::android::BuildInfo::GetInstance()->sdk_int() >= 21) { + manufacturer_string = ConvertJavaStringToUTF16( + env, Java_ChromeUsbDevice_getManufacturerName(env, wrapper.obj())); + product_string = ConvertJavaStringToUTF16( + env, Java_ChromeUsbDevice_getProductName(env, wrapper.obj())); + serial_number = ConvertJavaStringToUTF16( + env, Java_ChromeUsbDevice_getSerialNumber(env, wrapper.obj())); + } return make_scoped_refptr(new UsbDeviceAndroid( env, 0x0200, // USB protocol version, not provided by the Android API. @@ -49,9 +52,7 @@ Java_ChromeUsbDevice_getDeviceProtocol(env, wrapper.obj()), Java_ChromeUsbDevice_getVendorId(env, wrapper.obj()), Java_ChromeUsbDevice_getProductId(env, wrapper.obj()), device_version, - ConvertJavaStringToUTF16(env, manufacturer_string), - ConvertJavaStringToUTF16(env, product_string), - ConvertJavaStringToUTF16(env, serial_number), wrapper)); + manufacturer_string, product_string, serial_number, wrapper)); } void UsbDeviceAndroid::Open(const OpenCallback& callback) {
diff --git a/device/usb/usb_device_handle.h b/device/usb/usb_device_handle.h index 7222964..32d25f3 100644 --- a/device/usb/usb_device_handle.h +++ b/device/usb/usb_device_handle.h
@@ -120,7 +120,6 @@ friend class base::RefCountedThreadSafe<UsbDeviceHandle>; UsbDeviceHandle(); - virtual ~UsbDeviceHandle(); private:
diff --git a/device/usb/usb_device_handle_unittest.cc b/device/usb/usb_device_handle_unittest.cc index 410f5ad..deb8b8f 100644 --- a/device/usb/usb_device_handle_unittest.cc +++ b/device/usb/usb_device_handle_unittest.cc
@@ -253,6 +253,36 @@ handle->Close(); } +TEST_F(UsbDeviceHandleTest, ControlTransfer) { + if (!UsbTestGadget::IsTestEnabled()) + return; + + std::unique_ptr<UsbTestGadget> gadget = + UsbTestGadget::Claim(io_thread_->task_runner()); + ASSERT_TRUE(gadget.get()); + + TestOpenCallback open_device; + gadget->GetDevice()->Open(open_device.callback()); + scoped_refptr<UsbDeviceHandle> handle = open_device.WaitForResult(); + ASSERT_TRUE(handle.get()); + + scoped_refptr<net::IOBufferWithSize> buffer(new net::IOBufferWithSize(255)); + TestCompletionCallback completion; + handle->ControlTransfer(USB_DIRECTION_INBOUND, UsbDeviceHandle::STANDARD, + UsbDeviceHandle::DEVICE, 0x06, 0x0301, 0x0409, buffer, + buffer->size(), 0, completion.callback()); + completion.WaitForResult(); + ASSERT_EQ(USB_TRANSFER_COMPLETED, completion.status()); + const char expected_str[] = "\x18\x03G\0o\0o\0g\0l\0e\0 \0I\0n\0c\0.\0"; + EXPECT_EQ(sizeof(expected_str) - 1, completion.transferred()); + for (size_t i = 0; i < completion.transferred(); ++i) { + EXPECT_EQ(expected_str[i], buffer->data()[i]) << "Mismatch at index " << i + << "."; + } + + handle->Close(); +} + TEST_F(UsbDeviceHandleTest, SetInterfaceAlternateSetting) { if (!UsbTestGadget::IsTestEnabled()) { return;
diff --git a/device/usb/usb_device_handle_usbfs.cc b/device/usb/usb_device_handle_usbfs.cc new file mode 100644 index 0000000..693b21e --- /dev/null +++ b/device/usb/usb_device_handle_usbfs.cc
@@ -0,0 +1,800 @@ +// 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 "device/usb/usb_device_handle_usbfs.h" + +#if defined(OS_ANDROID) && __ANDROID_API__ < 21 +#include <linux/usb_ch9.h> +#else +#include <linux/usb/ch9.h> +#endif + +#include <linux/usbdevice_fs.h> +#include <sys/ioctl.h> + +#include <numeric> + +#include "base/bind.h" +#include "base/cancelable_callback.h" +#include "base/logging.h" +#include "base/message_loop/message_loop.h" +#include "base/message_loop/message_pump_libevent.h" +#include "base/posix/eintr_wrapper.h" +#include "base/stl_util.h" +#include "base/thread_task_runner_handle.h" +#include "base/threading/thread_restrictions.h" +#include "components/device_event_log/device_event_log.h" +#include "device/usb/usb_device_impl.h" +#include "net/base/io_buffer.h" + +namespace device { + +namespace { + +uint8_t ConvertEndpointDirection(UsbEndpointDirection direction) { + switch (direction) { + case USB_DIRECTION_INBOUND: + return USB_DIR_IN; + case USB_DIRECTION_OUTBOUND: + return USB_DIR_OUT; + } + NOTREACHED(); + return 0; +} + +uint8_t ConvertRequestType(UsbDeviceHandle::TransferRequestType request_type) { + switch (request_type) { + case UsbDeviceHandle::STANDARD: + return USB_TYPE_STANDARD; + case UsbDeviceHandle::CLASS: + return USB_TYPE_CLASS; + case UsbDeviceHandle::VENDOR: + return USB_TYPE_VENDOR; + case UsbDeviceHandle::RESERVED: + return USB_TYPE_RESERVED; + } + NOTREACHED(); + return 0; +} + +uint8_t ConvertRecipient(UsbDeviceHandle::TransferRecipient recipient) { + switch (recipient) { + case UsbDeviceHandle::DEVICE: + return USB_RECIP_DEVICE; + case UsbDeviceHandle::INTERFACE: + return USB_RECIP_INTERFACE; + case UsbDeviceHandle::ENDPOINT: + return USB_RECIP_ENDPOINT; + case UsbDeviceHandle::OTHER: + return USB_RECIP_OTHER; + } + NOTREACHED(); + return 0; +} + +scoped_refptr<net::IOBuffer> BuildControlTransferBuffer( + UsbEndpointDirection direction, + UsbDeviceHandle::TransferRequestType request_type, + UsbDeviceHandle::TransferRecipient recipient, + uint8_t request, + uint16_t value, + uint16_t index, + scoped_refptr<net::IOBuffer> original_buffer, + size_t length) { + scoped_refptr<net::IOBuffer> new_buffer( + new net::IOBuffer(length + sizeof(usb_ctrlrequest))); + usb_ctrlrequest* setup = + reinterpret_cast<usb_ctrlrequest*>(new_buffer->data()); + setup->bRequestType = ConvertEndpointDirection(direction) | + ConvertRequestType(request_type) | + ConvertRecipient(recipient); + setup->bRequest = request; + setup->wValue = value; + setup->wIndex = index; + setup->wLength = length; + memcpy(new_buffer->data() + sizeof(usb_ctrlrequest), original_buffer->data(), + length); + return new_buffer; +} + +uint8_t ConvertTransferType(UsbTransferType type) { + switch (type) { + case USB_TRANSFER_CONTROL: + return USBDEVFS_URB_TYPE_CONTROL; + case USB_TRANSFER_ISOCHRONOUS: + return USBDEVFS_URB_TYPE_ISO; + case USB_TRANSFER_BULK: + return USBDEVFS_URB_TYPE_BULK; + case USB_TRANSFER_INTERRUPT: + return USBDEVFS_URB_TYPE_INTERRUPT; + } + NOTREACHED(); + return 0; +} + +UsbTransferStatus ConvertTransferResult(int rc) { + switch (rc) { + case 0: + return USB_TRANSFER_COMPLETED; + case EPIPE: + return USB_TRANSFER_STALLED; + case ENODEV: + case ESHUTDOWN: + return USB_TRANSFER_DISCONNECT; + default: + // TODO(reillyg): Add a specific error message whenever one of the cases + // above fails to match. + USB_LOG(ERROR) << "Unknown system error: " + << logging::SystemErrorCodeToString(rc); + return USB_TRANSFER_ERROR; + } +} + +} // namespace + +class UsbDeviceHandleUsbfs::FileThreadHelper + : public base::MessagePumpLibevent::Watcher, + public base::MessageLoop::DestructionObserver { + public: + FileThreadHelper(int fd, + scoped_refptr<UsbDeviceHandleUsbfs> device_handle, + scoped_refptr<base::SequencedTaskRunner> task_runner); + ~FileThreadHelper() override; + + static void Start(scoped_ptr<FileThreadHelper> self); + + // base::MessagePumpLibevent::Watcher overrides. + void OnFileCanReadWithoutBlocking(int fd) override; + void OnFileCanWriteWithoutBlocking(int fd) override; + + // base::MessageLoop::DestructionObserver overrides. + void WillDestroyCurrentMessageLoop() override; + + private: + int fd_; + scoped_refptr<UsbDeviceHandleUsbfs> device_handle_; + scoped_refptr<base::SequencedTaskRunner> task_runner_; + base::MessagePumpLibevent::FileDescriptorWatcher file_watcher_; + base::ThreadChecker thread_checker_; + + DISALLOW_COPY_AND_ASSIGN(FileThreadHelper); +}; + +UsbDeviceHandleUsbfs::FileThreadHelper::FileThreadHelper( + int fd, + scoped_refptr<UsbDeviceHandleUsbfs> device_handle, + scoped_refptr<base::SequencedTaskRunner> task_runner) + : fd_(fd), device_handle_(device_handle), task_runner_(task_runner) {} + +UsbDeviceHandleUsbfs::FileThreadHelper::~FileThreadHelper() { + DCHECK(thread_checker_.CalledOnValidThread()); + base::MessageLoop::current()->RemoveDestructionObserver(this); +} + +// static +void UsbDeviceHandleUsbfs::FileThreadHelper::Start( + scoped_ptr<FileThreadHelper> self) { + base::ThreadRestrictions::AssertIOAllowed(); + self->thread_checker_.DetachFromThread(); + + // Linux indicates that URBs are available to reap by marking the file + // descriptor writable. + if (!base::MessageLoopForIO::current()->WatchFileDescriptor( + self->fd_, true, base::MessageLoopForIO::WATCH_WRITE, + &self->file_watcher_, self.get())) { + USB_LOG(ERROR) << "Failed to start watching device file descriptor."; + } + + // |self| is now owned by the current message loop. + base::MessageLoop::current()->AddDestructionObserver(self.release()); +} + +void UsbDeviceHandleUsbfs::FileThreadHelper::OnFileCanReadWithoutBlocking( + int fd) { + NOTREACHED(); // Only listening for writability. +} + +void UsbDeviceHandleUsbfs::FileThreadHelper::OnFileCanWriteWithoutBlocking( + int fd) { + DCHECK(thread_checker_.CalledOnValidThread()); + DCHECK_EQ(fd_, fd); + + const size_t MAX_URBS_PER_EVENT = 10; + std::vector<usbdevfs_urb*> urbs; + urbs.reserve(MAX_URBS_PER_EVENT); + for (size_t i = 0; i < MAX_URBS_PER_EVENT; ++i) { + usbdevfs_urb* urb; + int rc = HANDLE_EINTR(ioctl(fd_, USBDEVFS_REAPURBNDELAY, &urb)); + if (rc) { + if (errno == EAGAIN) + break; + USB_PLOG(DEBUG) << "Failed to reap urbs"; + } else { + urbs.push_back(urb); + } + } + + task_runner_->PostTask( + FROM_HERE, + base::Bind(&UsbDeviceHandleUsbfs::ReapedUrbs, device_handle_, urbs)); +} + +void UsbDeviceHandleUsbfs::FileThreadHelper::WillDestroyCurrentMessageLoop() { + DCHECK(thread_checker_.CalledOnValidThread()); + delete this; +} + +struct UsbDeviceHandleUsbfs::Transfer { + Transfer() = delete; + Transfer(scoped_refptr<net::IOBuffer> buffer, + const TransferCallback& callback); + Transfer(scoped_refptr<net::IOBuffer> buffer, + const IsochronousTransferCallback& callback); + ~Transfer(); + + void* operator new(std::size_t size, size_t number_of_iso_packets); + + scoped_refptr<net::IOBuffer> control_transfer_buffer; + scoped_refptr<net::IOBuffer> buffer; + TransferCallback callback; + IsochronousTransferCallback isoc_callback; + base::CancelableClosure timeout_closure; + bool timed_out = false; + + // The |urb| field must be the last in the struct so that the extra space + // allocated by the overridden new function above extends the length of its + // |iso_frame_desc| field. + usbdevfs_urb urb; + + private: + DISALLOW_COPY_AND_ASSIGN(Transfer); +}; + +UsbDeviceHandleUsbfs::Transfer::Transfer(scoped_refptr<net::IOBuffer> buffer, + const TransferCallback& callback) + : buffer(buffer), callback(callback) { + memset(&urb, 0, sizeof(urb)); + urb.usercontext = this; + urb.buffer = buffer->data(); +} + +UsbDeviceHandleUsbfs::Transfer::Transfer( + scoped_refptr<net::IOBuffer> buffer, + const IsochronousTransferCallback& callback) + : buffer(buffer), isoc_callback(callback) { + memset(&urb, 0, sizeof(urb) + + sizeof(usbdevfs_iso_packet_desc) * urb.number_of_packets); + urb.usercontext = this; + urb.buffer = buffer->data(); +} + +UsbDeviceHandleUsbfs::Transfer::~Transfer() = default; + +void* UsbDeviceHandleUsbfs::Transfer::operator new( + std::size_t size, + size_t number_of_iso_packets) { + void* p = ::operator new( + size + sizeof(usbdevfs_iso_packet_desc) * number_of_iso_packets); + Transfer* transfer = static_cast<Transfer*>(p); + transfer->urb.number_of_packets = number_of_iso_packets; + return p; +} + +UsbDeviceHandleUsbfs::UsbDeviceHandleUsbfs( + scoped_refptr<UsbDevice> device, + base::ScopedFD fd, + scoped_refptr<base::SequencedTaskRunner> blocking_task_runner) + : device_(device), + fd_(std::move(fd)), + blocking_task_runner_(blocking_task_runner) { + DCHECK(device_); + DCHECK(fd_.is_valid()); + DCHECK(blocking_task_runner_); + + task_runner_ = base::ThreadTaskRunnerHandle::Get(); + + scoped_ptr<FileThreadHelper> helper( + new FileThreadHelper(fd_.get(), this, task_runner_)); + helper_ = helper.get(); + blocking_task_runner_->PostTask( + FROM_HERE, base::Bind(&FileThreadHelper::Start, base::Passed(&helper))); +} + +scoped_refptr<UsbDevice> UsbDeviceHandleUsbfs::GetDevice() const { + return device_; +} + +void UsbDeviceHandleUsbfs::Close() { + // On the |task_runner_| thread check |device_| to see if the handle is + // closed. On the |blocking_task_runner_| thread check |fd_.is_valid()| to + // see if the handle is closed. + DCHECK(device_); +#if !defined(OS_ANDROID) + static_cast<UsbDeviceImpl*>(device_.get())->HandleClosed(this); +#endif + device_ = nullptr; + blocking_task_runner_->PostTask( + FROM_HERE, base::Bind(&UsbDeviceHandleUsbfs::CloseBlocking, this)); +} + +void UsbDeviceHandleUsbfs::SetConfiguration(int configuration_value, + const ResultCallback& callback) { + // USBDEVFS_SETCONFIGURATION synchronously issues a SET_CONFIGURATION request + // to the device so it must be performed on a thread where it is okay to + // block. + blocking_task_runner_->PostTask( + FROM_HERE, base::Bind(&UsbDeviceHandleUsbfs::SetConfigurationBlocking, + this, configuration_value, callback)); +} + +void UsbDeviceHandleUsbfs::ClaimInterface(int interface_number, + const ResultCallback& callback) { + if (!device_) { + task_runner_->PostTask(FROM_HERE, base::Bind(callback, false)); + return; + } + + if (ContainsKey(interfaces_, interface_number)) { + USB_LOG(DEBUG) << "Interface " << interface_number << " already claimed."; + task_runner_->PostTask(FROM_HERE, base::Bind(callback, false)); + return; + } + + // It appears safe to assume that this ioctl will not block. + int rc = HANDLE_EINTR( + ioctl(fd_.get(), USBDEVFS_CLAIMINTERFACE, &interface_number)); + if (rc) { + USB_PLOG(DEBUG) << "Failed to claim interface " << interface_number; + } else { + interfaces_[interface_number].alternate_setting = 0; + RefreshEndpointInfo(); + } + task_runner_->PostTask(FROM_HERE, base::Bind(callback, rc == 0)); +} + +void UsbDeviceHandleUsbfs::ReleaseInterface(int interface_number, + const ResultCallback& callback) { + // USBDEVFS_RELEASEINTERFACE may issue a SET_INTERFACE request to the + // device to restore alternate setting 0 so it must be performed on a thread + // where it is okay to block. + blocking_task_runner_->PostTask( + FROM_HERE, base::Bind(&UsbDeviceHandleUsbfs::ReleaseInterfaceBlocking, + this, interface_number, callback)); +} + +void UsbDeviceHandleUsbfs::SetInterfaceAlternateSetting( + int interface_number, + int alternate_setting, + const ResultCallback& callback) { + // USBDEVFS_SETINTERFACE is synchronous because it issues a SET_INTERFACE + // request to the device so it must be performed on a thread where it is okay + // to block. + blocking_task_runner_->PostTask( + FROM_HERE, base::Bind(&UsbDeviceHandleUsbfs::SetInterfaceBlocking, this, + interface_number, alternate_setting, callback)); +} + +void UsbDeviceHandleUsbfs::ResetDevice(const ResultCallback& callback) { + // USBDEVFS_RESET is synchronous because it waits for the port to be reset + // and the device re-enumerated so it must be performed on a thread where it + // is okay to block. + blocking_task_runner_->PostTask( + FROM_HERE, + base::Bind(&UsbDeviceHandleUsbfs::ResetDeviceBlocking, this, callback)); +} + +void UsbDeviceHandleUsbfs::ClearHalt(uint8_t endpoint_address, + const ResultCallback& callback) { + // USBDEVFS_CLEAR_HALT is synchronous because it issues a CLEAR_FEATURE + // request to the device so it must be performed on a thread where it is okay + // to block. + blocking_task_runner_->PostTask( + FROM_HERE, base::Bind(&UsbDeviceHandleUsbfs::ClearHaltBlocking, this, + endpoint_address, callback)); +} + +void UsbDeviceHandleUsbfs::ControlTransfer(UsbEndpointDirection direction, + TransferRequestType request_type, + TransferRecipient recipient, + uint8_t request, + uint16_t value, + uint16_t index, + scoped_refptr<net::IOBuffer> buffer, + size_t length, + unsigned int timeout, + const TransferCallback& callback) { + if (!device_) { + task_runner_->PostTask( + FROM_HERE, base::Bind(callback, USB_TRANSFER_DISCONNECT, nullptr, 0)); + return; + } + + scoped_ptr<Transfer> transfer(new (0) Transfer(buffer, callback)); + transfer->control_transfer_buffer = + BuildControlTransferBuffer(direction, request_type, recipient, request, + value, index, buffer, length); + transfer->urb.type = USBDEVFS_URB_TYPE_CONTROL; + transfer->urb.endpoint = 0; + transfer->urb.buffer = transfer->control_transfer_buffer->data(); + transfer->urb.buffer_length = 8 + length; + + // USBDEVFS_SUBMITURB appears to be non-blocking as completion is reported + // by USBDEVFS_REAPURBNDELAY. + int rc = HANDLE_EINTR(ioctl(fd_.get(), USBDEVFS_SUBMITURB, &transfer->urb)); + if (rc) { + rc = logging::GetLastSystemErrorCode(); + USB_PLOG(DEBUG) << "Failed to submit control transfer"; + task_runner_->PostTask( + FROM_HERE, base::Bind(callback, ConvertTransferResult(rc), nullptr, 0)); + } else { + SetUpTimeoutCallback(transfer.get(), timeout); + transfers_.push_back(std::move(transfer)); + } +} + +void UsbDeviceHandleUsbfs::IsochronousTransferIn( + uint8_t endpoint_number, + const std::vector<uint32_t>& packet_lengths, + unsigned int timeout, + const IsochronousTransferCallback& callback) { + uint8_t endpoint_address = USB_DIR_IN | endpoint_number; + size_t total_length = + std::accumulate(packet_lengths.begin(), packet_lengths.end(), 0u); + IsochronousTransferInternal(endpoint_address, new net::IOBuffer(total_length), + total_length, packet_lengths, timeout, callback); +} + +void UsbDeviceHandleUsbfs::IsochronousTransferOut( + uint8_t endpoint_number, + scoped_refptr<net::IOBuffer> buffer, + const std::vector<uint32_t>& packet_lengths, + unsigned int timeout, + const IsochronousTransferCallback& callback) { + uint8_t endpoint_address = USB_DIR_OUT | endpoint_number; + size_t total_length = + std::accumulate(packet_lengths.begin(), packet_lengths.end(), 0u); + IsochronousTransferInternal(endpoint_address, buffer, total_length, + packet_lengths, timeout, callback); +} + +void UsbDeviceHandleUsbfs::GenericTransfer(UsbEndpointDirection direction, + uint8_t endpoint_number, + scoped_refptr<net::IOBuffer> buffer, + size_t length, + unsigned int timeout, + const TransferCallback& callback) { + if (!device_) { + task_runner_->PostTask( + FROM_HERE, base::Bind(callback, USB_TRANSFER_DISCONNECT, nullptr, 0)); + return; + } + + uint8_t endpoint_address = + ConvertEndpointDirection(direction) | endpoint_number; + auto it = endpoints_.find(endpoint_address); + if (it == endpoints_.end()) { + USB_LOG(USER) << "Endpoint address " << static_cast<int>(endpoint_address) + << " is not part of a claimed interface."; + task_runner_->PostTask( + FROM_HERE, base::Bind(callback, USB_TRANSFER_ERROR, nullptr, 0)); + return; + } + + scoped_ptr<Transfer> transfer(new (0) Transfer(buffer, callback)); + transfer->urb.endpoint = endpoint_address; + transfer->urb.buffer_length = length; + transfer->urb.type = ConvertTransferType(it->second.type); + + // USBDEVFS_SUBMITURB appears to be non-blocking as completion is reported + // by USBDEVFS_REAPURBNDELAY. This code assumes a recent kernel that can + // accept arbitrarily large transfer requests, hopefully also using a scatter- + // gather list. + int rc = HANDLE_EINTR(ioctl(fd_.get(), USBDEVFS_SUBMITURB, &transfer->urb)); + if (rc) { + rc = logging::GetLastSystemErrorCode(); + USB_PLOG(DEBUG) << "Failed to submit transfer"; + task_runner_->PostTask( + FROM_HERE, base::Bind(callback, ConvertTransferResult(rc), nullptr, 0)); + } else { + SetUpTimeoutCallback(transfer.get(), timeout); + transfers_.push_back(std::move(transfer)); + } +} + +const UsbInterfaceDescriptor* UsbDeviceHandleUsbfs::FindInterfaceByEndpoint( + uint8_t endpoint_address) { + auto it = endpoints_.find(endpoint_address); + if (it != endpoints_.end()) + return it->second.interface; + return nullptr; +} + +UsbDeviceHandleUsbfs::~UsbDeviceHandleUsbfs() { + DCHECK(!device_) << "Handle must be closed before it is destroyed."; +} + +void UsbDeviceHandleUsbfs::CloseBlocking() { + fd_.reset(-1); + delete helper_; +} + +void UsbDeviceHandleUsbfs::SetConfigurationBlocking( + int configuration_value, + const ResultCallback& callback) { + if (!fd_.is_valid()) { + task_runner_->PostTask(FROM_HERE, base::Bind(callback, false)); + return; + } + + int rc = HANDLE_EINTR( + ioctl(fd_.get(), USBDEVFS_SETCONFIGURATION, &configuration_value)); + if (rc) + USB_PLOG(DEBUG) << "Failed to set configuration " << configuration_value; + task_runner_->PostTask( + FROM_HERE, base::Bind(&UsbDeviceHandleUsbfs::SetConfigurationComplete, + this, configuration_value, rc == 0, callback)); +} + +void UsbDeviceHandleUsbfs::SetConfigurationComplete( + int configuration_value, + bool success, + const ResultCallback& callback) { + if (success && device_) { +#if !defined(OS_ANDROID) + static_cast<UsbDeviceImpl*>(device_.get()) + ->ActiveConfigurationChanged(configuration_value); +#endif + // TODO(reillyg): If all interfaces are unclaimed before a new configuration + // is set then this will do nothing. Investigate. + RefreshEndpointInfo(); + } + callback.Run(success); +} + +void UsbDeviceHandleUsbfs::ReleaseInterfaceBlocking( + int interface_number, + const ResultCallback& callback) { + if (!fd_.is_valid()) { + task_runner_->PostTask(FROM_HERE, base::Bind(callback, false)); + return; + } + + int rc = HANDLE_EINTR( + ioctl(fd_.get(), USBDEVFS_RELEASEINTERFACE, &interface_number)); + if (rc) { + USB_PLOG(DEBUG) << "Failed to release interface " << interface_number; + task_runner_->PostTask(FROM_HERE, base::Bind(callback, false)); + } else { + task_runner_->PostTask( + FROM_HERE, base::Bind(&UsbDeviceHandleUsbfs::ReleaseInterfaceComplete, + this, interface_number, callback)); + } +} + +void UsbDeviceHandleUsbfs::ReleaseInterfaceComplete( + int interface_number, + const ResultCallback& callback) { + auto it = interfaces_.find(interface_number); + DCHECK(it != interfaces_.end()); + interfaces_.erase(it); + RefreshEndpointInfo(); + callback.Run(true); +} + +void UsbDeviceHandleUsbfs::SetInterfaceBlocking( + int interface_number, + int alternate_setting, + const ResultCallback& callback) { + if (!fd_.is_valid()) { + task_runner_->PostTask(FROM_HERE, base::Bind(callback, false)); + return; + } + + usbdevfs_setinterface cmd = {0}; + cmd.interface = interface_number; + cmd.altsetting = alternate_setting; + int rc = HANDLE_EINTR(ioctl(fd_.get(), USBDEVFS_SETINTERFACE, &cmd)); + if (rc) { + USB_PLOG(DEBUG) << "Failed to set interface " << interface_number + << " to alternate setting " << alternate_setting; + } + task_runner_->PostTask(FROM_HERE, base::Bind(callback, rc == 0)); +} + +void UsbDeviceHandleUsbfs::ResetDeviceBlocking(const ResultCallback& callback) { + if (!fd_.is_valid()) { + task_runner_->PostTask(FROM_HERE, base::Bind(callback, false)); + return; + } + + // TODO(reillyg): libusb releases interfaces before and then reclaims + // interfaces after a reset. We should probably do this too or document that + // callers have to call ClaimInterface as well. + int rc = HANDLE_EINTR(ioctl(fd_.get(), USBDEVFS_RESET, nullptr)); + if (rc) + USB_PLOG(DEBUG) << "Failed to reset the device"; + task_runner_->PostTask(FROM_HERE, base::Bind(callback, rc == 0)); +} + +void UsbDeviceHandleUsbfs::ClearHaltBlocking(uint8_t endpoint_address, + const ResultCallback& callback) { + if (!fd_.is_valid()) { + task_runner_->PostTask(FROM_HERE, base::Bind(callback, false)); + return; + } + + int tmp_endpoint = endpoint_address; + int rc = HANDLE_EINTR(ioctl(fd_.get(), USBDEVFS_CLEAR_HALT, &tmp_endpoint)); + if (rc) { + USB_PLOG(DEBUG) << "Failed to clear the stall condition on endpoint " + << static_cast<int>(endpoint_address); + } + task_runner_->PostTask(FROM_HERE, base::Bind(callback, rc == 0)); +} + +void UsbDeviceHandleUsbfs::IsochronousTransferInternal( + uint8_t endpoint_address, + scoped_refptr<net::IOBuffer> buffer, + size_t total_length, + const std::vector<uint32_t>& packet_lengths, + unsigned int timeout, + const IsochronousTransferCallback& callback) { + if (!device_) { + ReportIsochronousError(packet_lengths, callback, USB_TRANSFER_DISCONNECT); + return; + } + + auto it = endpoints_.find(endpoint_address); + if (it == endpoints_.end()) { + USB_LOG(USER) << "Endpoint address " << static_cast<int>(endpoint_address) + << " is not part of a claimed interface."; + ReportIsochronousError(packet_lengths, callback, USB_TRANSFER_ERROR); + return; + } + + scoped_ptr<Transfer> transfer(new (packet_lengths.size()) + Transfer(buffer, callback)); + transfer->urb.type = USBDEVFS_URB_TYPE_ISO; + transfer->urb.endpoint = endpoint_address; + transfer->urb.buffer_length = total_length; + + for (size_t i = 0; i < packet_lengths.size(); ++i) + transfer->urb.iso_frame_desc[i].length = packet_lengths[i]; + + // USBDEVFS_SUBMITURB appears to be non-blocking as completion is reported + // by USBDEVFS_REAPURBNDELAY. This code assumes a recent kernel that can + // accept arbitrarily large transfer requests, hopefully also using a scatter- + // gather list. + int rc = HANDLE_EINTR(ioctl(fd_.get(), USBDEVFS_SUBMITURB, &transfer->urb)); + if (rc) { + rc = logging::GetLastSystemErrorCode(); + USB_PLOG(DEBUG) << "Failed to submit transfer"; + ReportIsochronousError(packet_lengths, callback, ConvertTransferResult(rc)); + } else { + SetUpTimeoutCallback(transfer.get(), timeout); + transfers_.push_back(std::move(transfer)); + } +} + +void UsbDeviceHandleUsbfs::ReapedUrbs(const std::vector<usbdevfs_urb*>& urbs) { + for (const auto& urb : urbs) { + Transfer* this_transfer = static_cast<Transfer*>(urb->usercontext); + DCHECK_EQ(urb, &this_transfer->urb); + auto it = std::find_if( + transfers_.begin(), transfers_.end(), + [this_transfer](const scoped_ptr<Transfer>& transfer) -> bool { + return transfer.get() == this_transfer; + }); + DCHECK(it != transfers_.end()); + scoped_ptr<Transfer> transfer = std::move(*it); + transfers_.erase(it); + TransferComplete(std::move(transfer)); + } +} + +void UsbDeviceHandleUsbfs::TransferComplete(scoped_ptr<Transfer> transfer) { + if (transfer->timed_out) + return; + + // The transfer will soon be freed. Cancel the timeout callback so that the + // raw pointer it holds to |transfer| is not used. + transfer->timeout_closure.Cancel(); + + if (transfer->urb.type == USBDEVFS_URB_TYPE_ISO) { + std::vector<IsochronousPacket> packets(transfer->urb.number_of_packets); + for (size_t i = 0; i < packets.size(); ++i) { + packets[i].length = transfer->urb.iso_frame_desc[i].length; + packets[i].transferred_length = + transfer->urb.iso_frame_desc[i].actual_length; + packets[i].status = ConvertTransferResult( + transfer->urb.status == 0 ? transfer->urb.iso_frame_desc[i].status + : transfer->urb.status); + } + + transfer->isoc_callback.Run(transfer->buffer, packets); + } else { + if (transfer->urb.status == 0 && + transfer->urb.type == USBDEVFS_URB_TYPE_CONTROL) { + // Copy the result of the control transfer back into the original buffer. + memcpy(transfer->buffer->data(), + transfer->control_transfer_buffer->data() + 8, + transfer->urb.actual_length); + } + + transfer->callback.Run(ConvertTransferResult(-transfer->urb.status), + transfer->buffer, transfer->urb.actual_length); + } +} + +void UsbDeviceHandleUsbfs::RefreshEndpointInfo() { + endpoints_.clear(); + + const UsbConfigDescriptor* config = device_->GetActiveConfiguration(); + if (!config) + return; + + for (const auto& entry : interfaces_) { + auto interface_it = std::find_if( + config->interfaces.begin(), config->interfaces.end(), + [entry](const UsbInterfaceDescriptor& interface) { + uint8_t interface_number = entry.first; + uint8_t alternate_setting = entry.second.alternate_setting; + return interface.interface_number == interface_number && + interface.alternate_setting == alternate_setting; + }); + DCHECK(interface_it != config->interfaces.end()); + + for (const auto& endpoint : interface_it->endpoints) { + EndpointInfo& info = endpoints_[endpoint.address]; + info.type = endpoint.transfer_type; + info.interface = &*interface_it; + } + } +} + +void UsbDeviceHandleUsbfs::ReportIsochronousError( + const std::vector<uint32_t>& packet_lengths, + const UsbDeviceHandle::IsochronousTransferCallback& callback, + UsbTransferStatus status) { + std::vector<UsbDeviceHandle::IsochronousPacket> packets( + packet_lengths.size()); + for (size_t i = 0; i < packet_lengths.size(); ++i) { + packets[i].length = packet_lengths[i]; + packets[i].transferred_length = 0; + packets[i].status = status; + } + task_runner_->PostTask(FROM_HERE, base::Bind(callback, nullptr, packets)); +} + +void UsbDeviceHandleUsbfs::SetUpTimeoutCallback(Transfer* transfer, + unsigned int timeout) { + if (timeout > 0) { + transfer->timeout_closure.Reset( + base::Bind(&UsbDeviceHandleUsbfs::TransferTimedOut, transfer)); + task_runner_->PostDelayedTask(FROM_HERE, + transfer->timeout_closure.callback(), + base::TimeDelta::FromMilliseconds(timeout)); + } +} + +// static +void UsbDeviceHandleUsbfs::TransferTimedOut(Transfer* transfer) { + // |transfer| must stay in |transfers_| as it is still being processed by the + // kernel and will be reaped later. Just tell the caller that the timeout + // elapsed. + transfer->timed_out = true; + if (transfer->urb.type == USBDEVFS_URB_TYPE_ISO) { + std::vector<IsochronousPacket> packets(transfer->urb.number_of_packets); + for (size_t i = 0; i < packets.size(); ++i) { + packets[i].length = transfer->urb.iso_frame_desc[i].length; + packets[i].transferred_length = 0; + packets[i].status = USB_TRANSFER_TIMEOUT; + } + transfer->isoc_callback.Run(transfer->buffer, packets); + } else { + transfer->callback.Run(USB_TRANSFER_TIMEOUT, transfer->buffer, 0); + } +} + +} // namespace device
diff --git a/device/usb/usb_device_handle_usbfs.h b/device/usb/usb_device_handle_usbfs.h new file mode 100644 index 0000000..c3800c1 --- /dev/null +++ b/device/usb/usb_device_handle_usbfs.h
@@ -0,0 +1,151 @@ +// 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 DEVICE_USB_USB_DEVICE_HANDLE_USBFS_H_ +#define DEVICE_USB_USB_DEVICE_HANDLE_USBFS_H_ + +#include <list> +#include <map> +#include <vector> + +#include "base/files/scoped_file.h" +#include "base/memory/scoped_ptr.h" +#include "device/usb/usb_device_handle.h" + +struct usbdevfs_urb; + +namespace base { +class SequencedTaskRunner; +} + +namespace device { + +// Implementation of a USB device handle on top of the Linux USBFS ioctl +// interface available on Linux, Chrome OS and Android. +class UsbDeviceHandleUsbfs : public UsbDeviceHandle { + public: + // Constructs a new device handle from an existing |device| and open file + // descriptor to that device. |blocking_task_runner| must have a + // MessageLoopForIO. + UsbDeviceHandleUsbfs( + scoped_refptr<UsbDevice> device, + base::ScopedFD fd, + scoped_refptr<base::SequencedTaskRunner> blocking_task_runner); + + // UsbDeviceHandle implementation. + scoped_refptr<UsbDevice> GetDevice() const override; + void Close() override; + void SetConfiguration(int configuration_value, + const ResultCallback& callback) override; + void ClaimInterface(int interface_number, + const ResultCallback& callback) override; + void ReleaseInterface(int interface_number, + const ResultCallback& callback) override; + void SetInterfaceAlternateSetting(int interface_number, + int alternate_setting, + const ResultCallback& callback) override; + void ResetDevice(const ResultCallback& callback) override; + void ClearHalt(uint8_t endpoint, const ResultCallback& callback) override; + void ControlTransfer(UsbEndpointDirection direction, + TransferRequestType request_type, + TransferRecipient recipient, + uint8_t request, + uint16_t value, + uint16_t index, + scoped_refptr<net::IOBuffer> buffer, + size_t length, + unsigned int timeout, + const TransferCallback& callback) override; + void IsochronousTransferIn( + uint8_t endpoint_number, + const std::vector<uint32_t>& packet_lengths, + unsigned int timeout, + const IsochronousTransferCallback& callback) override; + + void IsochronousTransferOut( + uint8_t endpoint_number, + scoped_refptr<net::IOBuffer> buffer, + const std::vector<uint32_t>& packet_lengths, + unsigned int timeout, + const IsochronousTransferCallback& callback) override; + void GenericTransfer(UsbEndpointDirection direction, + uint8_t endpoint_number, + scoped_refptr<net::IOBuffer> buffer, + size_t length, + unsigned int timeout, + const TransferCallback& callback) override; + const UsbInterfaceDescriptor* FindInterfaceByEndpoint( + uint8_t endpoint_address) override; + + private: + class FileThreadHelper; + struct Transfer; + struct InterfaceInfo { + uint8_t alternate_setting; + }; + struct EndpointInfo { + UsbTransferType type; + const UsbInterfaceDescriptor* interface; + }; + + ~UsbDeviceHandleUsbfs() override; + void CloseBlocking(); + void SetConfigurationBlocking(int configuration_value, + const ResultCallback& callback); + void SetConfigurationComplete(int configuration_value, + bool success, + const ResultCallback& callback); + void ReleaseInterfaceBlocking(int interface_number, + const ResultCallback& callback); + void ReleaseInterfaceComplete(int interface_number, + const ResultCallback& callback); + void SetInterfaceBlocking(int interface_number, + int alternate_setting, + const ResultCallback& callback); + void ResetDeviceBlocking(const ResultCallback& callback); + void ClearHaltBlocking(uint8_t endpoint_address, + const ResultCallback& callback); + void IsochronousTransferInternal(uint8_t endpoint_address, + scoped_refptr<net::IOBuffer> buffer, + size_t total_length, + const std::vector<uint32_t>& packet_lengths, + unsigned int timeout, + const IsochronousTransferCallback& callback); + void ReapedUrbs(const std::vector<usbdevfs_urb*>& urbs); + void TransferComplete(scoped_ptr<Transfer> transfer); + void RefreshEndpointInfo(); + void ReportIsochronousError( + const std::vector<uint32_t>& packet_lengths, + const UsbDeviceHandle::IsochronousTransferCallback& callback, + UsbTransferStatus status); + void SetUpTimeoutCallback(Transfer* transfer, unsigned int timeout); + + static void TransferTimedOut(Transfer* transfer); + + scoped_refptr<UsbDevice> device_; + base::ScopedFD fd_; + scoped_refptr<base::SequencedTaskRunner> task_runner_; + scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; + base::ThreadChecker thread_checker_; + + // Maps claimed interfaces by interface number to their current alternate + // setting. + std::map<uint8_t, InterfaceInfo> interfaces_; + + // Maps endpoints (by endpoint address) to the interface they are a part of. + // Only endpoints of currently claimed and selected interface alternates are + // included in the map. + std::map<uint8_t, EndpointInfo> endpoints_; + + // Helper object owned by the blocking task thread. It will be freed if that + // thread's message loop is destroyed but can also be freed by this class on + // destruction. + FileThreadHelper* helper_; + + std::list<scoped_ptr<Transfer>> transfers_; +}; + +} // namespace device + +#endif // DEVICE_USB_USB_DEVICE_HANDLE_USBFS_H_
diff --git a/device/usb/usb_device_impl.cc b/device/usb/usb_device_impl.cc index 4a134bf..4facf1a 100644 --- a/device/usb/usb_device_impl.cc +++ b/device/usb/usb_device_impl.cc
@@ -4,12 +4,14 @@ #include "device/usb/usb_device_impl.h" +#include <fcntl.h> #include <stddef.h> #include <algorithm> #include "base/bind.h" #include "base/location.h" +#include "base/posix/eintr_wrapper.h" #include "base/sequenced_task_runner.h" #include "base/single_thread_task_runner.h" #include "base/stl_util.h" @@ -18,10 +20,15 @@ #include "components/device_event_log/device_event_log.h" #include "device/usb/usb_context.h" #include "device/usb/usb_descriptors.h" -#include "device/usb/usb_device_handle_impl.h" #include "device/usb/usb_error.h" #include "third_party/libusb/src/libusb/libusb.h" +#if defined(OS_ANDROID) || defined(OS_CHROMEOS) || defined(OS_LINUX) +#include "device/usb/usb_device_handle_usbfs.h" +#else +#include "device/usb/usb_device_handle_impl.h" +#endif + #if defined(OS_CHROMEOS) #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/permission_broker_client.h" @@ -201,9 +208,9 @@ #endif // defined(OS_CHROMEOS) } -void UsbDeviceImpl::HandleClosed(scoped_refptr<UsbDeviceHandle> handle) { +void UsbDeviceImpl::HandleClosed(UsbDeviceHandle* handle) { DCHECK(thread_checker_.CalledOnValidThread()); - handles_.remove(handle.get()); + handles_.remove(handle); } const UsbConfigDescriptor* UsbDeviceImpl::GetActiveConfiguration() const { @@ -250,6 +257,15 @@ } } +void UsbDeviceImpl::ActiveConfigurationChanged(int configuration_value) { + for (const auto& config : configurations_) { + if (config.configuration_value == configuration_value) { + active_configuration_ = &config; + return; + } + } +} + void UsbDeviceImpl::RefreshActiveConfiguration() { active_configuration_ = nullptr; libusb_config_descriptor* platform_config; @@ -261,13 +277,7 @@ return; } - for (const auto& config : configurations_) { - if (config.configuration_value == platform_config->bConfigurationValue) { - active_configuration_ = &config; - break; - } - } - + ActiveConfigurationChanged(platform_config->bConfigurationValue); libusb_free_config_descriptor(platform_config); } @@ -291,21 +301,32 @@ void UsbDeviceImpl::OpenOnBlockingThreadWithFd(dbus::FileDescriptor fd, const OpenCallback& callback) { fd.CheckValidity(); - DCHECK(fd.is_valid()); - - PlatformUsbDeviceHandle handle; - const int rv = libusb_open_fd(platform_device_, fd.TakeValue(), &handle); - if (LIBUSB_SUCCESS == rv) { - task_runner_->PostTask( - FROM_HERE, base::Bind(&UsbDeviceImpl::Opened, this, handle, callback)); + if (fd.is_valid()) { + base::ScopedFD scoped_fd(fd.TakeValue()); + task_runner_->PostTask(FROM_HERE, + base::Bind(&UsbDeviceImpl::Opened, this, + base::Passed(&scoped_fd), callback)); } else { - USB_LOG(EVENT) << "Failed to open device: " - << ConvertPlatformUsbErrorToString(rv); + USB_LOG(EVENT) << "Did not get valid device handle from permission broker."; task_runner_->PostTask(FROM_HERE, base::Bind(callback, nullptr)); } } -#endif // defined(OS_CHROMEOS) +#else +#if defined(OS_LINUX) + +void UsbDeviceImpl::OpenOnBlockingThread(const OpenCallback& callback) { + base::ScopedFD fd(HANDLE_EINTR(open(device_path_.c_str(), O_RDWR))); + if (fd.is_valid()) { + task_runner_->PostTask(FROM_HERE, base::Bind(&UsbDeviceImpl::Opened, this, + base::Passed(&fd), callback)); + } else { + USB_PLOG(EVENT) << "Failed to open device"; + task_runner_->PostTask(FROM_HERE, base::Bind(callback, nullptr)); + } +} + +#else void UsbDeviceImpl::OpenOnBlockingThread(const OpenCallback& callback) { PlatformUsbDeviceHandle handle; @@ -320,13 +341,30 @@ } } +#endif // defined(OS_LINUX) +#endif // defined(OS_CHROMEOS) + +#if defined(OS_LINUX) + +void UsbDeviceImpl::Opened(base::ScopedFD fd, const OpenCallback& callback) { + DCHECK(thread_checker_.CalledOnValidThread()); + scoped_refptr<UsbDeviceHandle> device_handle = + new UsbDeviceHandleUsbfs(this, std::move(fd), blocking_task_runner_); + handles_.push_back(device_handle.get()); + callback.Run(device_handle); +} + +#else + void UsbDeviceImpl::Opened(PlatformUsbDeviceHandle platform_handle, const OpenCallback& callback) { DCHECK(thread_checker_.CalledOnValidThread()); - scoped_refptr<UsbDeviceHandleImpl> device_handle = new UsbDeviceHandleImpl( + scoped_refptr<UsbDeviceHandle> device_handle = new UsbDeviceHandleImpl( context_, this, platform_handle, blocking_task_runner_); handles_.push_back(device_handle.get()); callback.Run(device_handle); } +#endif // defined(OS_LINUX) + } // namespace device
diff --git a/device/usb/usb_device_impl.h b/device/usb/usb_device_impl.h index aea9b54..a5f36ba 100644 --- a/device/usb/usb_device_impl.h +++ b/device/usb/usb_device_impl.h
@@ -13,6 +13,7 @@ #include <utility> #include "base/callback.h" +#include "base/files/scoped_file.h" #include "base/macros.h" #include "base/threading/thread_checker.h" #include "build/build_config.h" @@ -74,6 +75,7 @@ protected: friend class UsbServiceImpl; friend class UsbDeviceHandleImpl; + friend class UsbDeviceHandleUsbfs; // Called by UsbServiceImpl only; UsbDeviceImpl(scoped_refptr<UsbContext> context, @@ -90,7 +92,8 @@ void ReadAllConfigurations(); // Called by UsbDeviceHandleImpl. - void HandleClosed(scoped_refptr<UsbDeviceHandle> handle); + void HandleClosed(UsbDeviceHandle* handle); + void ActiveConfigurationChanged(int configuration_value); void RefreshActiveConfiguration(); private: @@ -103,10 +106,15 @@ const std::string& error_message); void OpenOnBlockingThreadWithFd(dbus::FileDescriptor fd, const OpenCallback& callback); -#endif +#else void OpenOnBlockingThread(const OpenCallback& callback); +#endif // defined(OS_CHROMEOS) +#if defined(OS_LINUX) + void Opened(base::ScopedFD fd, const OpenCallback& callback); +#else void Opened(PlatformUsbDeviceHandle platform_handle, const OpenCallback& callback); +#endif // defined(OS_LINUX) base::ThreadChecker thread_checker_; PlatformUsbDevice platform_device_;
diff --git a/docs/chromeos_build_instructions.md b/docs/chromeos_build_instructions.md index 8eac95e..45f936c4 100644 --- a/docs/chromeos_build_instructions.md +++ b/docs/chromeos_build_instructions.md
@@ -1,11 +1,12 @@ # ChromeOS Build Instructions (Chromium OS on Linux) -Chromium on Chromium OS is built on a mix of code sourced from Chromium +Chromium on Chromium OS is built from a mix of code sourced from Chromium on Linux and Chromium on Windows. Much of the user interface code is -shared with Chromium on Windows. As such, if you make a change to -Chromium on Windows you may find your changes affect Chromium on -Chromium OS. Fortunately to test the effect of your changes you don't -have to build all of Chromium OS, you can just build Chromium for +shared with Chromium on Windows. + +If you make changes to Chromium on Windows, they may affect Chromium +on Chromium OS. Fortunately to test the effects of your changes you +don't need to build all of Chromium OS, you can just build Chromium for Chromium OS directly on Linux. First, follow the [normal Linux build @@ -30,15 +31,20 @@ See [GN Build Configuration](https://www.chromium.org/developers/gn-build-configuration) for more information about configuring your build. -Some additional options you may wish to set: -``` +If you have not already done so, be sure to set the following to prevent +'gclient runhooks' from executing 'gyp_chromium': + + export GYP_CHROMIUM_NO_ACTION=1 + +Some additional options you may wish to set by passing in **--args** to +**gn gen** or running **gn args out/Default**: + is_component_build = true use_goma = true is_debug = false # Release build dcheck_always_on = true # Enable DCHECK (with is_debug = false) is_official_build = true is_chrome_branded = true -``` ## Notes @@ -76,7 +82,7 @@ Signing in as a specific user is useful for debugging features like sync that require a logged in user. -## Compile Testing Chromium with the Chromium OS SDK (quick version) +## Compile Chromium for a Chromium OS device using the Chromium OS SDK See [Building Chromium for a Chromium OS device](https://www.chromium.org/chromium-os/how-tos-and-troubleshooting/building-chromium-browser) -for information about building & testing chromium for Chromium OS. +for information about building and testing chromium for Chromium OS.
diff --git a/docs/optional.md b/docs/optional.md new file mode 100644 index 0000000..a2220316 --- /dev/null +++ b/docs/optional.md
@@ -0,0 +1,108 @@ +# base::Optional + +`base::Optional<T>` is a container that might contain an instance of `T`. + +[TOC] + +## History + +[base::Optional<T>](https://code.google.com/p/chromium/codesearch#chromium/src/base/optional.h) +is an implementation of [std::optional<T>](http://en.cppreference.com/w/cpp/utility/optional), +initially a C++ experimental feature and now part of the C++17 standard. The +Chromium's implementation is as close as possible to the specification. The +differences are listed at the beginning of the header. The most important +difference is that all the objects and types are part of the `base::` namespace +instead of `std::`. Also, following Chromium coding style, the class is named +`Optional` instead of `optional`. + +## API description + +For a deep API description, please have a look at [std::optional<T>](http://en.cppreference.com/w/cpp/utility/optional) +or the [Chromium implementation](https://code.google.com/p/chromium/codesearch#chromium/src/base/optional.h). + +When initialized without a value, `base::Optional<T>` will be empty. When empty, +the `operator bool` will return `false` and `value()` should not be called. An +empty `base::Optional<T>` is equal to `base::nullopt_t`. + +```C++ +base::Optional<int> opt; +opt == true; // false +opt.value(); // illegal, will DCHECK +opt == base::nullopt_t; // true +``` + +To avoid calling `value()` when an `base::Optional<T>` is empty, instead of +doing checks, it is possible to use `value_or()` and pass a default value: + +```C++ +base::Optional<int> opt; +opt.value_or(42); // will return 42 +``` + +It is possible to initialize a `base::Optional<T>` from its constructor and +`operator=` using `T` or another `base::Optional<T>`: + +```C++ +base::Optional<int> opt_1 = 1; // .value() == 1 +base::Optional<int> opt_2 = base::Optional<int>(2); // .value() == 2 +``` + +All basic operators should be available on `base::Optional<T>`: it is possible +to compare a `base::Optional<T>` with another or with a `T` or +`base::nullopt_t`. + +```C++ +base::Optional<int> opt_1; +base::Optional<int> opt_2 = 2; + +opt_1 == opt_2; // false +opt_1 = 1; + +opt_1 <= opt_2; // true +opt_1 == 1; // true +opt_1 == base::nullopt_t; // false +``` + +`base::Optional<T>` has a helper function `make_optional<T&&>`: + +```C++ +base::Optional<int> opt = make_optional<int>(GetMagicNumber()); +``` + +Finally, `base::Optional<T>` is integrated with `std::hash`, using +`std::hash<T>` if it is not empty, a default value otherwise. `.emplace()` and +`.swap()` can be used as members functions and `std::swap()` will work with two +`base::Optional<T>` objects. + +## How is it implemented? + +`base::Optional<T>` is implemented using `base::AlignedMemory`. The object +doesn't behave like a pointer and doesn't do dynamic memory allocation. In +other words, it is guaranteed to have an object allocated when it is not empty. + +## When to use? + +A very common use case is for classes and structures that have an object not +always available, because it is early initialized or because the underlying data +structure doesn't require it. + +It is common to implement such patterns with dynamically allocated pointers, +`nullptr` representing the absence of value. Other approaches involve +`std::pair<T, bool>` where bool represents whether the object is actually +present. + +It can also be used for simple types, for example when a structure wants to +represent whether the user or the underlying data structure has some value +unspecified, a `base::Optional<int>` would be easier to understand than a +special value representing the lack of it. For example, using -1 as the +undefined value when the expected value can't be negative. + +## When not to use? + +It is recommended to not use `base::Optional<T>` as a function parameter as it +will force the callers to use `base::Optional<T>`. Instead, it is recommended to +keep using `T*` for arguments that can be ommited, with `nullptr` representing +no value. + +Furthermore, depending on `T`, MSVC might fail to compile code using +`base::Optional<T>` as a parameter because of memory alignment issues.
diff --git a/extensions/browser/api/system_display/display_info_provider.cc b/extensions/browser/api/system_display/display_info_provider.cc index 54c247af..c53c606 100644 --- a/extensions/browser/api/system_display/display_info_provider.cc +++ b/extensions/browser/api/system_display/display_info_provider.cc
@@ -75,11 +75,11 @@ void DisplayInfoProvider::EnableUnifiedDesktop(bool enable) {} -DisplayInfo DisplayInfoProvider::GetAllDisplaysInfo() { +DisplayUnitInfoList DisplayInfoProvider::GetAllDisplaysInfo() { gfx::Screen* screen = gfx::Screen::GetScreen(); int64_t primary_id = screen->GetPrimaryDisplay().id(); std::vector<gfx::Display> displays = screen->GetAllDisplays(); - DisplayInfo all_displays; + DisplayUnitInfoList all_displays; for (const gfx::Display& display : displays) { api::system_display::DisplayUnitInfo unit = CreateDisplayUnitInfo(display, primary_id);
diff --git a/extensions/browser/api/system_display/display_info_provider.h b/extensions/browser/api/system_display/display_info_provider.h index 48e3d9e..474bd39 100644 --- a/extensions/browser/api/system_display/display_info_provider.h +++ b/extensions/browser/api/system_display/display_info_provider.h
@@ -25,7 +25,7 @@ } } -typedef std::vector<api::system_display::DisplayUnitInfo> DisplayInfo; +typedef std::vector<api::system_display::DisplayUnitInfo> DisplayUnitInfoList; class DisplayInfoProvider { public: @@ -50,7 +50,7 @@ virtual void EnableUnifiedDesktop(bool enable); // Get display information. - virtual DisplayInfo GetAllDisplaysInfo(); + virtual DisplayUnitInfoList GetAllDisplaysInfo(); protected: DisplayInfoProvider();
diff --git a/extensions/browser/api/system_display/system_display_api.cc b/extensions/browser/api/system_display/system_display_api.cc index a06aa10..c0f10bf 100644 --- a/extensions/browser/api/system_display/system_display_api.cc +++ b/extensions/browser/api/system_display/system_display_api.cc
@@ -23,7 +23,7 @@ namespace SetDisplayProperties = api::system_display::SetDisplayProperties; bool SystemDisplayGetInfoFunction::RunSync() { - DisplayInfo all_displays_info = + DisplayUnitInfoList all_displays_info = DisplayInfoProvider::Get()->GetAllDisplaysInfo(); results_ = api::system_display::GetInfo::Results::Create(all_displays_info); return true;
diff --git a/extensions/browser/event_router.h b/extensions/browser/event_router.h index c90a335..e93110d3 100644 --- a/extensions/browser/event_router.h +++ b/extensions/browser/event_router.h
@@ -164,8 +164,8 @@ bool HasEventListener(const std::string& event_name); // Returns true if the extension is listening to the given event. - bool ExtensionHasEventListener(const std::string& extension_id, - const std::string& event_name); + virtual bool ExtensionHasEventListener(const std::string& extension_id, + const std::string& event_name); // Return or set the list of events for which the given extension has // registered.
diff --git a/extensions/browser/extension_prefs.h b/extensions/browser/extension_prefs.h index 80b5e371..940e30a 100644 --- a/extensions/browser/extension_prefs.h +++ b/extensions/browser/extension_prefs.h
@@ -72,6 +72,7 @@ DELAY_REASON_GC = 1, DELAY_REASON_WAIT_FOR_IDLE = 2, DELAY_REASON_WAIT_FOR_IMPORTS = 3, + DELAY_REASON_WAIT_FOR_OS_UPDATE = 4, }; // Creates base::Time classes. The default implementation is just to return
diff --git a/extensions/browser/updater/extension_downloader.cc b/extensions/browser/updater/extension_downloader.cc index 116ef7a..6d94e86 100644 --- a/extensions/browser/updater/extension_downloader.cc +++ b/extensions/browser/updater/extension_downloader.cc
@@ -27,6 +27,7 @@ #include "extensions/browser/extensions_browser_client.h" #include "extensions/browser/notification_types.h" #include "extensions/browser/updater/extension_cache.h" +#include "extensions/browser/updater/extension_downloader_test_delegate.h" #include "extensions/browser/updater/request_queue_impl.h" #include "extensions/browser/updater/safe_manifest_parser.h" #include "extensions/common/extension_urls.h" @@ -90,6 +91,8 @@ const char kWebstoreOAuth2Scope[] = "https://www.googleapis.com/auth/chromewebstore.readonly"; +ExtensionDownloaderTestDelegate* g_test_delegate = nullptr; + #define RETRY_HISTOGRAM(name, retry_count, url) \ if ((url).DomainIs(kGoogleDotCom)) { \ UMA_HISTOGRAM_CUSTOM_COUNTS("Extensions." name "RetryCountGoogleUrl", \ @@ -278,6 +281,12 @@ identity_provider_.swap(identity_provider); } +// static +void ExtensionDownloader::set_test_delegate( + ExtensionDownloaderTestDelegate* delegate) { + g_test_delegate = delegate; +} + bool ExtensionDownloader::AddExtensionData(const std::string& id, const Version& version, Manifest::Type extension_type, @@ -405,6 +414,11 @@ void ExtensionDownloader::StartUpdateCheck( scoped_ptr<ManifestFetchData> fetch_data) { + if (g_test_delegate) { + g_test_delegate->StartUpdateCheck(this, delegate_, std::move(fetch_data)); + return; + } + const std::set<std::string>& id_set(fetch_data->extension_ids()); if (!ExtensionsBrowserClient::Get()->IsBackgroundUpdateAllowed()) {
diff --git a/extensions/browser/updater/extension_downloader.h b/extensions/browser/updater/extension_downloader.h index 81b9134..3de9b13 100644 --- a/extensions/browser/updater/extension_downloader.h +++ b/extensions/browser/updater/extension_downloader.h
@@ -46,6 +46,7 @@ }; class ExtensionCache; +class ExtensionDownloaderTestDelegate; class ExtensionUpdaterTest; // A class that checks for updates of a given list of extensions, and downloads @@ -114,6 +115,10 @@ enable_extra_update_metrics_ = enable; } + // Sets a test delegate to use by any instances of this class. The |delegate| + // should outlive all instances. + static void set_test_delegate(ExtensionDownloaderTestDelegate* delegate); + // These are needed for unit testing, to help identify the correct mock // URLFetcher objects. static const int kManifestFetcherId = 1;
diff --git a/extensions/browser/updater/extension_downloader_test_delegate.h b/extensions/browser/updater/extension_downloader_test_delegate.h new file mode 100644 index 0000000..64714d6f --- /dev/null +++ b/extensions/browser/updater/extension_downloader_test_delegate.h
@@ -0,0 +1,32 @@ +// 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 EXTENSIONS_BROWSER_UPDATER_EXTENSION_DOWNLOADER_TEST_DELEGATE_H_ +#define EXTENSIONS_BROWSER_UPDATER_EXTENSION_DOWNLOADER_TEST_DELEGATE_H_ + +#include <memory> + +namespace extensions { + +class ExtensionDownloader; +class ExtensionDownloaderDelegate; +class ManifestFetchData; + +// A class for intercepting the work of checking for / downloading extension +// updates. +class ExtensionDownloaderTestDelegate { + public: + // This method gets called when an update check is being started for an + // extension. Normally implementors should eventually call either + // OnExtensionDownloadFailed or OnExtensionDownloadFinished on + // |delegate|. + virtual void StartUpdateCheck( + ExtensionDownloader* downloader, + ExtensionDownloaderDelegate* delegate, + std::unique_ptr<ManifestFetchData> fetch_data) = 0; +}; + +} // namespace extensions + +#endif // EXTENSIONS_BROWSER_UPDATER_EXTENSION_DOWNLOADER_TEST_DELEGATE_H_
diff --git a/extensions/common/api/system_display.idl b/extensions/common/api/system_display.idl index f7ad3a9b..ccb4a71 100644 --- a/extensions/common/api/system_display.idl +++ b/extensions/common/api/system_display.idl
@@ -33,6 +33,32 @@ long bottom; }; + dictionary DisplayMode { + // The display mode width in device independent (user visible) pixels. + long width; + + // The display mode height in device independent (user visible) pixels. + long height; + + // The display mode width in native pixels. + long widthInNativePixels; + + // The display mode height in native pixels. + long heightInNativePixels; + + // The display mode UI scale factor. + double uiScale; + + // The display mode device scale factor. + double deviceScaleFactor; + + // True if the mode is the display's native mode. + boolean isNative; + + // True if the display mode is currently selected. + boolean isSelected; + }; + dictionary DisplayUnitInfo { // The unique identifier of the display. DOMString id; @@ -77,6 +103,11 @@ // area excludes areas of the display reserved for OS, for example taskbar // and launcher. Bounds workArea; + + // The list of available display modes. The current mode will have + // isSelected=true. Only available on Chrome OS. Will be set to an empty + // array on other platforms. + DisplayMode[] modes; }; dictionary DisplayProperties { @@ -115,6 +146,9 @@ // If set, updates the display's logical bounds origin along y-axis. // See documentation for <code>boundsOriginX</code> parameter. long? boundsOriginY; + + // If set, updates the display mode to the mode matching this value. + DisplayMode? displayMode; }; callback DisplayInfoCallback = void (DisplayUnitInfo[] displayInfo); @@ -127,6 +161,7 @@ // Updates the properties for the display specified by |id|, according to // the information provided in |info|. On failure, $(ref:runtime.lastError) // will be set. + // NOTE: This is only available to Chrome OS Kiosk apps and Web UI. // |id|: The display's unique identifier. // |info|: The information about display properties that should be changed. // A property will be changed only if a new value for it is specified in @@ -142,6 +177,8 @@ // Enables/disables the unified desktop feature. Note that this simply // enables the feature, but will not change the actual desktop mode. // (That is, if the desktop is in mirror mode, it will stay in mirror mode) + // NOTE: This is only available to Chrome OS Kiosk apps and Web UI. + // |enabled|: True if unified desktop should be enabled. static void enableUnifiedDesktop(boolean enabled); };
diff --git a/extensions/extensions.gypi b/extensions/extensions.gypi index c7b0a08..d9b258a 100644 --- a/extensions/extensions.gypi +++ b/extensions/extensions.gypi
@@ -761,6 +761,7 @@ 'browser/updater/extension_downloader.h', 'browser/updater/extension_downloader_delegate.cc', 'browser/updater/extension_downloader_delegate.h', + 'browser/updater/extension_downloader_test_delegate.h', 'browser/updater/manifest_fetch_data.cc', 'browser/updater/manifest_fetch_data.h', 'browser/updater/null_extension_cache.cc',
diff --git a/extensions/renderer/module_system_test.cc b/extensions/renderer/module_system_test.cc index b987ee7..e51cc63 100644 --- a/extensions/renderer/module_system_test.cc +++ b/extensions/renderer/module_system_test.cc
@@ -11,6 +11,7 @@ #include <utility> #include "base/callback.h" +#include "base/command_line.h" #include "base/files/file_path.h" #include "base/files/file_util.h" #include "base/lazy_instance.h" @@ -224,6 +225,7 @@ void ModuleSystemTest::SetUp() { env_ = CreateEnvironment(); + base::CommandLine::ForCurrentProcess()->AppendSwitch("test-type"); } void ModuleSystemTest::TearDown() {
diff --git a/extensions/renderer/resources/binding.js b/extensions/renderer/resources/binding.js index 60d85a9..13ac7f9 100644 --- a/extensions/renderer/resources/binding.js +++ b/extensions/renderer/resources/binding.js
@@ -4,6 +4,8 @@ var Event = require('event_bindings').Event; var forEach = require('utils').forEach; +// Note: Beware sneaky getters/setters when using GetAvailbility(). Use safe/raw +// variables as arguments. var GetAvailability = requireNative('v8_context').GetAvailability; var exceptionHandler = require('uncaught_exception_handler'); var lastError = require('lastError'); @@ -179,7 +181,6 @@ function Binding(apiName) { this.apiName_ = apiName; this.apiFunctions_ = new APIFunctions(apiName); - this.customEvent_ = null; this.customHooks_ = []; }; @@ -188,6 +189,17 @@ }; Binding.prototype = { + // Sneaky workaround for Object.prototype getters/setters - our prototype + // isn't Object.prototype. SafeBuiltins (e.g. $Object.hasOwnProperty()) + // should still work. + __proto__: null, + + // Forward-declare properties. + apiName_: undefined, + apiFunctions_: undefined, + customEvent_: undefined, + customHooks_: undefined, + // The API through which the ${api_name}_custom_bindings.js files customize // their API bindings beyond what can be generated. // @@ -236,7 +248,7 @@ // Binding.generate. // Additionally, since the schema is an object returned from a native // handler, its properties don't have the custom getters/setters that a page - // may have put on Object.prototype. + // may have put on Object.prototype, and the object is frozen by v8. var schema = schemaRegistry.GetSchema(this.apiName_); function shouldCheckUnprivileged() { @@ -366,9 +378,10 @@ var apiFunction = {}; apiFunction.definition = functionDef; - apiFunction.name = schema.namespace + '.' + functionDef.name; + var apiFunctionName = schema.namespace + '.' + functionDef.name; + apiFunction.name = apiFunctionName; - if (!GetAvailability(apiFunction.name).is_available || + if (!GetAvailability(apiFunctionName).is_available || (checkUnprivileged && !isSchemaAccessAllowed(functionDef))) { this.apiFunctions_.registerUnavailable(functionDef.name); return;
diff --git a/extensions/renderer/script_context.cc b/extensions/renderer/script_context.cc index 6a5b631..a1d8996a 100644 --- a/extensions/renderer/script_context.cc +++ b/extensions/renderer/script_context.cc
@@ -210,7 +210,7 @@ Feature::Availability ScriptContext::GetAvailability( const std::string& api_name) { DCHECK(thread_checker_.CalledOnValidThread()); - if (api_name == "test") { + if (base::StartsWith(api_name, "test", base::CompareCase::SENSITIVE)) { bool allowed = base::CommandLine::ForCurrentProcess()-> HasSwitch(::switches::kTestType); Feature::AvailabilityResult result =
diff --git a/extensions/renderer/v8_schema_registry.cc b/extensions/renderer/v8_schema_registry.cc index 5c49be3..851b011 100644 --- a/extensions/renderer/v8_schema_registry.cc +++ b/extensions/renderer/v8_schema_registry.cc
@@ -104,6 +104,7 @@ CHECK(!value.IsEmpty()); v8::Local<v8::Object> v8_schema(v8::Local<v8::Object>::Cast(value)); + v8_schema->SetIntegrityLevel(context, v8::IntegrityLevel::kFrozen); schema_cache_->Set(api, v8_schema); return handle_scope.Escape(v8_schema);
diff --git a/gpu/BUILD.gn b/gpu/BUILD.gn index da3bb21..4b94468 100644 --- a/gpu/BUILD.gn +++ b/gpu/BUILD.gn
@@ -117,7 +117,7 @@ libs += [ "android" ] deps += [ "//ui/android:ui_java" ] } - if (!is_component_build) { + if (is_linux && !is_component_build) { configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ] } }
diff --git a/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_schedule_ca_layer.txt b/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_schedule_ca_layer.txt index 0475c66..5d1caae 100644 --- a/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_schedule_ca_layer.txt +++ b/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_schedule_ca_layer.txt
@@ -8,7 +8,7 @@ Version - Last Modified Date: December 16, 2015 + Last Modified Date: April 12, 2016 Dependencies @@ -47,7 +47,8 @@ const GLfloat* bounds_rect, GLboolean is_clipped, const GLfloat* clip_rect, - const GLfloat* transform); + const GLfloat* transform, + GLuint filter); Set the CALayer parameters to be presented at the time of the next call to swap buffers. The order of the calls schedule CALayers determines their @@ -69,6 +70,8 @@ the rectangle to clip the layer to, if it is to be clipped. <transform> contains sixteen values indicating the row major order 4x4 transformation matrix to apply to the CALayer. + <filter> will be used for both minification and magnification filtering. The + only valid values are GL_LINEAR and GL_NEAREST. Errors @@ -80,6 +83,8 @@ Revision History + 4/12/2016 Add a parameter to support minification and magnification + filtering. 12/16/2015 Add clipping and edge anti-aliasing. 11/7/2015 Initial checkin
diff --git a/gpu/GLES2/gl2extchromium.h b/gpu/GLES2/gl2extchromium.h index a5c979c3..dc98ba8c 100644 --- a/gpu/GLES2/gl2extchromium.h +++ b/gpu/GLES2/gl2extchromium.h
@@ -811,7 +811,8 @@ GLboolean is_clipped, const GLfloat* clip_rect, GLint sorting_context_id, - const GLfloat* transform); + const GLfloat* transform, + GLuint filter); #endif typedef void(GL_APIENTRYP PFNGLSCHEDULECALAYERCHROMIUMPROC)( GLuint contents_texture_id, @@ -823,7 +824,8 @@ GLboolean is_clipped, const GLfloat* clip_rect, GLint sorting_context_id, - const GLfloat* transform); + const GLfloat* transform, + GLuint filter); #endif /* GL_CHROMIUM_schedule_ca_layer */ /* GL_CHROMIUM_sync_query */
diff --git a/gpu/blink/webgraphicscontext3d_impl.h b/gpu/blink/webgraphicscontext3d_impl.h index bd2c45f8..ee8ff72 100644 --- a/gpu/blink/webgraphicscontext3d_impl.h +++ b/gpu/blink/webgraphicscontext3d_impl.h
@@ -7,11 +7,11 @@ #include <stdint.h> +#include <memory> #include <string> #include <vector> #include "base/callback.h" -#include "base/memory/scoped_ptr.h" #include "gpu/blink/gpu_blink_export.h" #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" #include "third_party/WebKit/public/platform/WebString.h"
diff --git a/gpu/command_buffer/build_gles2_cmd_buffer.py b/gpu/command_buffer/build_gles2_cmd_buffer.py index d207979..ca5d138 100755 --- a/gpu/command_buffer/build_gles2_cmd_buffer.py +++ b/gpu/command_buffer/build_gles2_cmd_buffer.py
@@ -4460,7 +4460,7 @@ 'cmd_args': 'GLuint contents_texture_id, GLfloat opacity, ' 'GLuint background_color, GLuint edge_aa_mask, ' 'GLboolean is_clipped, GLint sorting_context_id, ' - 'GLuint shm_id, GLuint shm_offset', + 'GLuint filter, GLuint shm_id, GLuint shm_offset', 'extension': 'CHROMIUM_schedule_ca_layer', 'chromium': True, }, @@ -6161,7 +6161,7 @@ return error::kInvalidArguments; } } - scoped_ptr<GLuint[]> service_ids(new GLuint[n]); + std::unique_ptr<GLuint[]> service_ids(new GLuint[n]); gl%(func_name)s(n, service_ids.get()); for (GLsizei ii = 0; ii < n; ++ii) { group_->Add%(resource_name)sId(%(last_arg_name)s[ii], service_ids[ii]); @@ -10936,6 +10936,8 @@ comment = ("// This file is included by gles2_interface.h to declare the\n" "// GL api functions.\n") code = """ +#include <memory> + #include "gpu/command_buffer/client/gles2_interface.h" #include "mojo/public/c/gles2/gles2.h"
diff --git a/gpu/command_buffer/client/buffer_tracker_unittest.cc b/gpu/command_buffer/client/buffer_tracker_unittest.cc index c44d384..b8d2a7d 100644 --- a/gpu/command_buffer/client/buffer_tracker_unittest.cc +++ b/gpu/command_buffer/client/buffer_tracker_unittest.cc
@@ -10,7 +10,9 @@ #include <GLES2/gl2ext.h> #include <stddef.h> #include <stdint.h> -#include "base/memory/scoped_ptr.h" + +#include <memory> + #include "gpu/command_buffer/client/client_test_helper.h" #include "gpu/command_buffer/client/gles2_cmd_helper.h" #include "gpu/command_buffer/client/mapped_memory.h" @@ -67,10 +69,10 @@ command_buffer_.reset(); } - scoped_ptr<MockClientCommandBufferImpl> command_buffer_; - scoped_ptr<GLES2CmdHelper> helper_; - scoped_ptr<MappedMemoryManager> mapped_memory_; - scoped_ptr<BufferTracker> buffer_tracker_; + std::unique_ptr<MockClientCommandBufferImpl> command_buffer_; + std::unique_ptr<GLES2CmdHelper> helper_; + std::unique_ptr<MappedMemoryManager> mapped_memory_; + std::unique_ptr<BufferTracker> buffer_tracker_; }; TEST_F(BufferTrackerTest, Basic) {
diff --git a/gpu/command_buffer/client/client_test_helper.cc b/gpu/command_buffer/client/client_test_helper.cc index 3e8c43c8..d442a88 100644 --- a/gpu/command_buffer/client/client_test_helper.cc +++ b/gpu/command_buffer/client/client_test_helper.cc
@@ -9,6 +9,8 @@ #include <stddef.h> #include <stdint.h> +#include <memory> + #include "gpu/command_buffer/client/cmd_buffer_helper.h" #include "gpu/command_buffer/common/command_buffer.h" #include "testing/gmock/include/gmock/gmock.h" @@ -72,7 +74,7 @@ *id = GetNextFreeTransferBufferId(); if (*id >= 0) { int32_t ndx = *id - kTransferBufferBaseId; - scoped_ptr<base::SharedMemory> shared_memory(new base::SharedMemory()); + std::unique_ptr<base::SharedMemory> shared_memory(new base::SharedMemory()); shared_memory->CreateAndMapAnonymous(size); transfer_buffer_buffers_[ndx] = MakeBufferFromSharedMemory(std::move(shared_memory), size);
diff --git a/gpu/command_buffer/client/client_test_helper.h b/gpu/command_buffer/client/client_test_helper.h index 95582d55..b3809af 100644 --- a/gpu/command_buffer/client/client_test_helper.h +++ b/gpu/command_buffer/client/client_test_helper.h
@@ -10,9 +10,10 @@ #include <stddef.h> #include <stdint.h> +#include <memory> + #include "base/compiler_specific.h" #include "base/macros.h" -#include "base/memory/scoped_ptr.h" #include "gpu/command_buffer/client/gpu_control.h" #include "gpu/command_buffer/common/cmd_buffer_common.h" #include "gpu/command_buffer/common/gpu_memory_allocation.h"
diff --git a/gpu/command_buffer/client/cmd_buffer_helper_test.cc b/gpu/command_buffer/client/cmd_buffer_helper_test.cc index 2fea6ba..b569990 100644 --- a/gpu/command_buffer/client/cmd_buffer_helper_test.cc +++ b/gpu/command_buffer/client/cmd_buffer_helper_test.cc
@@ -8,6 +8,7 @@ #include <stdint.h> #include <list> +#include <memory> #include "base/bind.h" #include "base/bind_helpers.h" @@ -258,11 +259,11 @@ CommandBufferOffset get_helper_put() { return helper_->put_; } - scoped_ptr<AsyncAPIMock> api_mock_; + std::unique_ptr<AsyncAPIMock> api_mock_; scoped_refptr<TransferBufferManagerInterface> transfer_buffer_manager_; - scoped_ptr<CommandBufferServiceLocked> command_buffer_; - scoped_ptr<CommandExecutor> executor_; - scoped_ptr<CommandBufferHelper> helper_; + std::unique_ptr<CommandBufferServiceLocked> command_buffer_; + std::unique_ptr<CommandExecutor> executor_; + std::unique_ptr<CommandBufferHelper> helper_; std::list<linked_ptr<std::vector<CommandBufferEntry> > > test_command_args_; unsigned int test_command_next_id_; Sequence sequence_;
diff --git a/gpu/command_buffer/client/fenced_allocator_test.cc b/gpu/command_buffer/client/fenced_allocator_test.cc index 6abe1ba..7b3a6ec 100644 --- a/gpu/command_buffer/client/fenced_allocator_test.cc +++ b/gpu/command_buffer/client/fenced_allocator_test.cc
@@ -6,6 +6,8 @@ #include <stdint.h> +#include <memory> + #include "base/bind.h" #include "base/bind_helpers.h" #include "base/memory/aligned_memory.h" @@ -69,11 +71,11 @@ int32_t GetToken() { return command_buffer_->GetLastState().token; } - scoped_ptr<AsyncAPIMock> api_mock_; + std::unique_ptr<AsyncAPIMock> api_mock_; scoped_refptr<TransferBufferManagerInterface> transfer_buffer_manager_; - scoped_ptr<CommandBufferService> command_buffer_; - scoped_ptr<CommandExecutor> executor_; - scoped_ptr<CommandBufferHelper> helper_; + std::unique_ptr<CommandBufferService> command_buffer_; + std::unique_ptr<CommandExecutor> executor_; + std::unique_ptr<CommandBufferHelper> helper_; base::MessageLoop message_loop_; }; @@ -101,7 +103,7 @@ BaseFencedAllocatorTest::TearDown(); } - scoped_ptr<FencedAllocator> allocator_; + std::unique_ptr<FencedAllocator> allocator_; }; // Checks basic alloc and free. @@ -413,8 +415,8 @@ BaseFencedAllocatorTest::TearDown(); } - scoped_ptr<FencedAllocatorWrapper> allocator_; - scoped_ptr<char, base::AlignedFreeDeleter> buffer_; + std::unique_ptr<FencedAllocatorWrapper> allocator_; + std::unique_ptr<char, base::AlignedFreeDeleter> buffer_; }; // Checks basic alloc and free.
diff --git a/gpu/command_buffer/client/gl_in_process_context.cc b/gpu/command_buffer/client/gl_in_process_context.cc index 6f2fb0d..74a7d59 100644 --- a/gpu/command_buffer/client/gl_in_process_context.cc +++ b/gpu/command_buffer/client/gl_in_process_context.cc
@@ -7,6 +7,7 @@ #include <stddef.h> #include <stdint.h> +#include <memory> #include <set> #include <utility> #include <vector> @@ -23,7 +24,6 @@ #include "base/lazy_instance.h" #include "base/logging.h" #include "base/macros.h" -#include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/message_loop/message_loop.h" #include "gpu/command_buffer/client/gles2_cmd_helper.h" @@ -75,10 +75,10 @@ void Destroy(); void OnSignalSyncPoint(const base::Closure& callback); - scoped_ptr<gles2::GLES2CmdHelper> gles2_helper_; - scoped_ptr<TransferBuffer> transfer_buffer_; - scoped_ptr<gles2::GLES2Implementation> gles2_implementation_; - scoped_ptr<InProcessCommandBuffer> command_buffer_; + std::unique_ptr<gles2::GLES2CmdHelper> gles2_helper_; + std::unique_ptr<TransferBuffer> transfer_buffer_; + std::unique_ptr<gles2::GLES2Implementation> gles2_implementation_; + std::unique_ptr<InProcessCommandBuffer> command_buffer_; const GLInProcessContextSharedMemoryLimits mem_limits_; @@ -230,7 +230,7 @@ DCHECK_EQ(gfx::kNullAcceleratedWidget, window); } - scoped_ptr<GLInProcessContextImpl> context( + std::unique_ptr<GLInProcessContextImpl> context( new GLInProcessContextImpl(memory_limits)); if (!context->Initialize(surface, is_offscreen,
diff --git a/gpu/command_buffer/client/gles2_c_lib_autogen.h b/gpu/command_buffer/client/gles2_c_lib_autogen.h index 67f1e055..29aa9466 100644 --- a/gpu/command_buffer/client/gles2_c_lib_autogen.h +++ b/gpu/command_buffer/client/gles2_c_lib_autogen.h
@@ -1508,11 +1508,12 @@ GLboolean is_clipped, const GLfloat* clip_rect, GLint sorting_context_id, - const GLfloat* transform) { + const GLfloat* transform, + GLuint filter) { gles2::GetGLContext()->ScheduleCALayerCHROMIUM( contents_texture_id, contents_rect, opacity, background_color, edge_aa_mask, bounds_rect, is_clipped, clip_rect, sorting_context_id, - transform); + transform, filter); } void GL_APIENTRY GLES2CommitOverlayPlanesCHROMIUM() { gles2::GetGLContext()->CommitOverlayPlanesCHROMIUM();
diff --git a/gpu/command_buffer/client/gles2_cmd_helper_autogen.h b/gpu/command_buffer/client/gles2_cmd_helper_autogen.h index f8b3dcb..5f1d639b 100644 --- a/gpu/command_buffer/client/gles2_cmd_helper_autogen.h +++ b/gpu/command_buffer/client/gles2_cmd_helper_autogen.h
@@ -2830,13 +2830,14 @@ GLuint edge_aa_mask, GLboolean is_clipped, GLint sorting_context_id, + GLuint filter, GLuint shm_id, GLuint shm_offset) { gles2::cmds::ScheduleCALayerCHROMIUM* c = GetCmdSpace<gles2::cmds::ScheduleCALayerCHROMIUM>(); if (c) { c->Init(contents_texture_id, opacity, background_color, edge_aa_mask, - is_clipped, sorting_context_id, shm_id, shm_offset); + is_clipped, sorting_context_id, filter, shm_id, shm_offset); } }
diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc index 22032b01..d19a44bd 100644 --- a/gpu/command_buffer/client/gles2_implementation.cc +++ b/gpu/command_buffer/client/gles2_implementation.cc
@@ -4768,7 +4768,8 @@ GLboolean is_clipped, const GLfloat* clip_rect, GLint sorting_context_id, - const GLfloat* transform) { + const GLfloat* transform, + GLuint filter) { size_t shm_size = 28 * sizeof(GLfloat); ScopedTransferBufferPtr buffer(shm_size, helper_, transfer_buffer_); if (!buffer.valid() || buffer.size() < shm_size) { @@ -4783,7 +4784,7 @@ memcpy(mem + 12, transform, 16 * sizeof(GLfloat)); helper_->ScheduleCALayerCHROMIUM(contents_texture_id, opacity, background_color, edge_aa_mask, is_clipped, - sorting_context_id, buffer.shm_id(), + sorting_context_id, filter, buffer.shm_id(), buffer.offset()); }
diff --git a/gpu/command_buffer/client/gles2_implementation.h b/gpu/command_buffer/client/gles2_implementation.h index 41ec693..059e87d4f 100644 --- a/gpu/command_buffer/client/gles2_implementation.h +++ b/gpu/command_buffer/client/gles2_implementation.h
@@ -10,6 +10,7 @@ #include <list> #include <map> +#include <memory> #include <queue> #include <set> #include <string> @@ -18,7 +19,6 @@ #include "base/compiler_specific.h" #include "base/macros.h" -#include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/trace_event/memory_dump_provider.h" #include "gpu/command_buffer/client/buffer_tracker.h" @@ -747,7 +747,7 @@ // unpack skip images as last set by glPixelStorei GLint unpack_skip_images_; - scoped_ptr<TextureUnit[]> texture_units_; + std::unique_ptr<TextureUnit[]> texture_units_; // 0 to gl_state_.max_combined_texture_image_units. GLuint active_texture_unit_; @@ -774,7 +774,7 @@ // Client side management for vertex array objects. Needed to correctly // track client side arrays. - scoped_ptr<VertexArrayObjectManager> vertex_array_object_manager_; + std::unique_ptr<VertexArrayObjectManager> vertex_array_object_manager_; GLuint reserved_ids_[2]; @@ -816,15 +816,15 @@ typedef std::map<const void*, MappedTexture> MappedTextureMap; MappedTextureMap mapped_textures_; - scoped_ptr<MappedMemoryManager> mapped_memory_; + std::unique_ptr<MappedMemoryManager> mapped_memory_; scoped_refptr<ShareGroup> share_group_; ShareGroupContextData share_group_context_data_; - scoped_ptr<QueryTracker> query_tracker_; - scoped_ptr<IdAllocator> query_id_allocator_; + std::unique_ptr<QueryTracker> query_tracker_; + std::unique_ptr<IdAllocator> query_id_allocator_; - scoped_ptr<BufferTracker> buffer_tracker_; + std::unique_ptr<BufferTracker> buffer_tracker_; base::Callback<void(const char*, int32_t)> error_message_callback_; base::Closure lost_context_callback_;
diff --git a/gpu/command_buffer/client/gles2_implementation_autogen.h b/gpu/command_buffer/client/gles2_implementation_autogen.h index bee578d7..aa64466 100644 --- a/gpu/command_buffer/client/gles2_implementation_autogen.h +++ b/gpu/command_buffer/client/gles2_implementation_autogen.h
@@ -1048,7 +1048,8 @@ GLboolean is_clipped, const GLfloat* clip_rect, GLint sorting_context_id, - const GLfloat* transform) override; + const GLfloat* transform, + GLuint filter) override; void CommitOverlayPlanesCHROMIUM() override;
diff --git a/gpu/command_buffer/client/gles2_implementation_unittest.cc b/gpu/command_buffer/client/gles2_implementation_unittest.cc index 7eb2b0c..9f6a376a 100644 --- a/gpu/command_buffer/client/gles2_implementation_unittest.cc +++ b/gpu/command_buffer/client/gles2_implementation_unittest.cc
@@ -10,8 +10,12 @@ #include <GLES2/gl2ext.h> #include <GLES2/gl2extchromium.h> #include <GLES3/gl3.h> + #include <stddef.h> #include <stdint.h> + +#include <memory> + #include "base/compiler_specific.h" #include "gpu/command_buffer/client/client_test_helper.h" #include "gpu/command_buffer/client/gles2_cmd_helper.h" @@ -535,11 +539,11 @@ memset(ring_buffer->memory(), kInitialValue, ring_buffer->size()); } - scoped_ptr<MockClientCommandBuffer> command_buffer_; - scoped_ptr<MockClientGpuControl> gpu_control_; - scoped_ptr<GLES2CmdHelper> helper_; - scoped_ptr<MockTransferBuffer> transfer_buffer_; - scoped_ptr<GLES2Implementation> gl_; + std::unique_ptr<MockClientCommandBuffer> command_buffer_; + std::unique_ptr<MockClientGpuControl> gpu_control_; + std::unique_ptr<GLES2CmdHelper> helper_; + std::unique_ptr<MockTransferBuffer> transfer_buffer_; + std::unique_ptr<GLES2Implementation> gl_; CommandBufferEntry* commands_; int token_; }; @@ -863,7 +867,7 @@ const uint32_t kBucketId = GLES2Implementation::kResultBucketId; const uint32_t kTestSize = MaxTransferBufferSize() + 32; - scoped_ptr<uint8_t[]> buf(new uint8_t[kTestSize]); + std::unique_ptr<uint8_t[]> buf(new uint8_t[kTestSize]); uint8_t* expected_data = buf.get(); for (uint32_t ii = 0; ii < kTestSize; ++ii) { expected_data[ii] = ii * 3; @@ -1730,7 +1734,8 @@ 0, kHeight / 2, kWidth, kHeight / 2, kFormat, kType, mem2.id, mem2.offset, result2.id, result2.offset, false); expected.set_token2.Init(GetNextToken()); - scoped_ptr<int8_t[]> buffer(new int8_t[kWidth * kHeight * kBytesPerPixel]); + std::unique_ptr<int8_t[]> buffer( + new int8_t[kWidth * kHeight * kBytesPerPixel]); EXPECT_CALL(*command_buffer(), OnFlush()) .WillOnce(SetMemory(result1.ptr, static_cast<uint32_t>(1))) @@ -1762,7 +1767,8 @@ 0, 0, kWidth, kHeight, kFormat, kType, mem1.id, mem1.offset, result1.id, result1.offset, false); expected.set_token.Init(GetNextToken()); - scoped_ptr<int8_t[]> buffer(new int8_t[kWidth * kHeight * kBytesPerPixel]); + std::unique_ptr<int8_t[]> buffer( + new int8_t[kWidth * kHeight * kBytesPerPixel]); EXPECT_CALL(*command_buffer(), OnFlush()) .Times(1) @@ -2432,7 +2438,7 @@ kWidth, kHeight, 1, kFormat, kType, kPixelStoreUnpackAlignment, &size, &unpadded_row_size, &padded_row_size)); - scoped_ptr<uint8_t[]> pixels(new uint8_t[size]); + std::unique_ptr<uint8_t[]> pixels(new uint8_t[size]); for (uint32_t ii = 0; ii < size; ++ii) { pixels[ii] = static_cast<uint8_t>(ii); } @@ -2488,7 +2494,7 @@ kWidth, kHeight / 2, 1, kFormat, kType, kPixelStoreUnpackAlignment, &half_size, NULL, NULL)); - scoped_ptr<uint8_t[]> pixels(new uint8_t[size]); + std::unique_ptr<uint8_t[]> pixels(new uint8_t[size]); for (uint32_t ii = 0; ii < size; ++ii) { pixels[ii] = static_cast<uint8_t>(ii); } @@ -2569,7 +2575,7 @@ ASSERT_TRUE(GLES2Util::ComputeImageDataSizesES3( kSrcWidth, kSrcSubImageY1, 1, kFormat, kType, pixel_params, &pixel_size, nullptr, nullptr, nullptr, nullptr)); - scoped_ptr<uint8_t[]> src_pixels; + std::unique_ptr<uint8_t[]> src_pixels; src_pixels.reset(new uint8_t[pixel_size]); for (size_t i = 0; i < pixel_size; ++i) { src_pixels[i] = static_cast<uint8_t>(i % 255); @@ -2710,7 +2716,7 @@ ASSERT_TRUE(GLES2Util::ComputeImageDataSizesES3( kSrcWidth, kSrcSubImageY1, kSrcSubImageZ1, kFormat, kType, pixel_params, &pixel_size, nullptr, nullptr, nullptr, nullptr)); - scoped_ptr<uint8_t[]> src_pixels; + std::unique_ptr<uint8_t[]> src_pixels; src_pixels.reset(new uint8_t[pixel_size]); for (size_t i = 0; i < pixel_size; ++i) { src_pixels[i] = static_cast<uint8_t>(i % 255); @@ -2925,7 +2931,7 @@ kWidth, kHeight, kDepth, kFormat, kType, kPixelStoreUnpackAlignment, &size, NULL, NULL)); - scoped_ptr<uint8_t[]> pixels(new uint8_t[size]); + std::unique_ptr<uint8_t[]> pixels(new uint8_t[size]); for (uint32_t ii = 0; ii < size; ++ii) { pixels[ii] = static_cast<uint8_t>(ii); } @@ -2978,7 +2984,7 @@ kWidth, kHeight, kDepth, kFormat, kType, kPixelStoreUnpackAlignment, &size, NULL, NULL)); - scoped_ptr<uint8_t[]> pixels(new uint8_t[size]); + std::unique_ptr<uint8_t[]> pixels(new uint8_t[size]); for (uint32_t ii = 0; ii < size; ++ii) { pixels[ii] = static_cast<uint8_t>(ii); } @@ -3035,7 +3041,7 @@ EXPECT_EQ(size, first_size + second_size); ExpectedMemoryInfo mem1 = GetExpectedMemory(first_size); ExpectedMemoryInfo mem2 = GetExpectedMemory(second_size); - scoped_ptr<uint8_t[]> pixels(new uint8_t[size]); + std::unique_ptr<uint8_t[]> pixels(new uint8_t[size]); for (uint32_t ii = 0; ii < size; ++ii) { pixels[ii] = static_cast<uint8_t>(ii); } @@ -3095,7 +3101,7 @@ uint32_t fourth_size = second_size - (padded_row_size - unpadded_row_size); EXPECT_EQ(size, first_size + second_size + third_size + fourth_size); - scoped_ptr<uint8_t[]> pixels(new uint8_t[size]); + std::unique_ptr<uint8_t[]> pixels(new uint8_t[size]); for (uint32_t ii = 0; ii < size; ++ii) { pixels[ii] = static_cast<uint8_t>(ii); }
diff --git a/gpu/command_buffer/client/gles2_interface_autogen.h b/gpu/command_buffer/client/gles2_interface_autogen.h index 4ab4116c..1cbd5bd 100644 --- a/gpu/command_buffer/client/gles2_interface_autogen.h +++ b/gpu/command_buffer/client/gles2_interface_autogen.h
@@ -777,7 +777,8 @@ GLboolean is_clipped, const GLfloat* clip_rect, GLint sorting_context_id, - const GLfloat* transform) = 0; + const GLfloat* transform, + GLuint filter) = 0; virtual void CommitOverlayPlanesCHROMIUM() = 0; virtual void SwapInterval(GLint interval) = 0; virtual void FlushDriverCachesCHROMIUM() = 0;
diff --git a/gpu/command_buffer/client/gles2_interface_stub_autogen.h b/gpu/command_buffer/client/gles2_interface_stub_autogen.h index 734e02d..451aeb3 100644 --- a/gpu/command_buffer/client/gles2_interface_stub_autogen.h +++ b/gpu/command_buffer/client/gles2_interface_stub_autogen.h
@@ -754,7 +754,8 @@ GLboolean is_clipped, const GLfloat* clip_rect, GLint sorting_context_id, - const GLfloat* transform) override; + const GLfloat* transform, + GLuint filter) override; void CommitOverlayPlanesCHROMIUM() override; void SwapInterval(GLint interval) override; void FlushDriverCachesCHROMIUM() override;
diff --git a/gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h b/gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h index eeeafb3..212ab2a1 100644 --- a/gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h +++ b/gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h
@@ -1033,7 +1033,8 @@ GLboolean /* is_clipped */, const GLfloat* /* clip_rect */, GLint /* sorting_context_id */, - const GLfloat* /* transform */) {} + const GLfloat* /* transform */, + GLuint /* filter */) {} void GLES2InterfaceStub::CommitOverlayPlanesCHROMIUM() {} void GLES2InterfaceStub::SwapInterval(GLint /* interval */) {} void GLES2InterfaceStub::FlushDriverCachesCHROMIUM() {}
diff --git a/gpu/command_buffer/client/gles2_trace_implementation_autogen.h b/gpu/command_buffer/client/gles2_trace_implementation_autogen.h index d967962..f800963 100644 --- a/gpu/command_buffer/client/gles2_trace_implementation_autogen.h +++ b/gpu/command_buffer/client/gles2_trace_implementation_autogen.h
@@ -754,7 +754,8 @@ GLboolean is_clipped, const GLfloat* clip_rect, GLint sorting_context_id, - const GLfloat* transform) override; + const GLfloat* transform, + GLuint filter) override; void CommitOverlayPlanesCHROMIUM() override; void SwapInterval(GLint interval) override; void FlushDriverCachesCHROMIUM() override;
diff --git a/gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h b/gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h index eb42f3c..093d6d5 100644 --- a/gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h +++ b/gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h
@@ -2201,12 +2201,13 @@ GLboolean is_clipped, const GLfloat* clip_rect, GLint sorting_context_id, - const GLfloat* transform) { + const GLfloat* transform, + GLuint filter) { TRACE_EVENT_BINARY_EFFICIENT0("gpu", "GLES2Trace::ScheduleCALayerCHROMIUM"); gl_->ScheduleCALayerCHROMIUM(contents_texture_id, contents_rect, opacity, background_color, edge_aa_mask, bounds_rect, is_clipped, clip_rect, sorting_context_id, - transform); + transform, filter); } void GLES2TraceImplementation::CommitOverlayPlanesCHROMIUM() {
diff --git a/gpu/command_buffer/client/gpu_memory_buffer_manager.h b/gpu/command_buffer/client/gpu_memory_buffer_manager.h index a3385325..ba170ca 100644 --- a/gpu/command_buffer/client/gpu_memory_buffer_manager.h +++ b/gpu/command_buffer/client/gpu_memory_buffer_manager.h
@@ -5,7 +5,8 @@ #ifndef GPU_COMMAND_BUFFER_CLIENT_GPU_MEMORY_BUFFER_MANAGER_H_ #define GPU_COMMAND_BUFFER_CLIENT_GPU_MEMORY_BUFFER_MANAGER_H_ -#include "base/memory/scoped_ptr.h" +#include <memory> + #include "gpu/gpu_export.h" #include "ui/gfx/geometry/size.h" #include "ui/gfx/gpu_memory_buffer.h" @@ -19,14 +20,14 @@ GpuMemoryBufferManager(); // Allocates a GpuMemoryBuffer that can be shared with another process. - virtual scoped_ptr<gfx::GpuMemoryBuffer> AllocateGpuMemoryBuffer( + virtual std::unique_ptr<gfx::GpuMemoryBuffer> AllocateGpuMemoryBuffer( const gfx::Size& size, gfx::BufferFormat format, gfx::BufferUsage usage, int32_t surface_id) = 0; // Creates a GpuMemoryBuffer from existing handle. - virtual scoped_ptr<gfx::GpuMemoryBuffer> CreateGpuMemoryBufferFromHandle( + virtual std::unique_ptr<gfx::GpuMemoryBuffer> CreateGpuMemoryBufferFromHandle( const gfx::GpuMemoryBufferHandle& handle, const gfx::Size& size, gfx::BufferFormat format) = 0;
diff --git a/gpu/command_buffer/client/mapped_memory.cc b/gpu/command_buffer/client/mapped_memory.cc index c40278e..cd1ff41f 100644 --- a/gpu/command_buffer/client/mapped_memory.cc +++ b/gpu/command_buffer/client/mapped_memory.cc
@@ -12,6 +12,7 @@ #include "base/atomic_sequence_num.h" #include "base/logging.h" +#include "base/memory/ptr_util.h" #include "base/strings/stringprintf.h" #include "base/thread_task_runner_handle.h" #include "base/trace_event/memory_dump_manager.h" @@ -120,7 +121,7 @@ DCHECK(shm.get()); MemoryChunk* mc = new MemoryChunk(id, shm, helper_); allocated_memory_ += mc->GetSize(); - chunks_.push_back(make_scoped_ptr(mc)); + chunks_.push_back(base::WrapUnique(mc)); void* mem = mc->Alloc(size); DCHECK(mem); *shm_id = mc->shm_id();
diff --git a/gpu/command_buffer/client/mapped_memory.h b/gpu/command_buffer/client/mapped_memory.h index 70831599..0af38b5 100644 --- a/gpu/command_buffer/client/mapped_memory.h +++ b/gpu/command_buffer/client/mapped_memory.h
@@ -8,9 +8,10 @@ #include <stddef.h> #include <stdint.h> +#include <memory> + #include "base/bind.h" #include "base/macros.h" -#include "base/memory/scoped_ptr.h" #include "base/trace_event/memory_dump_provider.h" #include "gpu/command_buffer/client/fenced_allocator.h" #include "gpu/command_buffer/common/buffer.h" @@ -201,7 +202,7 @@ } private: - typedef std::vector<scoped_ptr<MemoryChunk>> MemoryChunkVector; + typedef std::vector<std::unique_ptr<MemoryChunk>> MemoryChunkVector; // size a chunk is rounded up to. unsigned int chunk_size_multiple_;
diff --git a/gpu/command_buffer/client/mapped_memory_unittest.cc b/gpu/command_buffer/client/mapped_memory_unittest.cc index 9846a84d..8db9914 100644 --- a/gpu/command_buffer/client/mapped_memory_unittest.cc +++ b/gpu/command_buffer/client/mapped_memory_unittest.cc
@@ -8,8 +8,9 @@ #include <stdint.h> #include <list> +#include <memory> + #include "base/bind.h" -#include "base/memory/scoped_ptr.h" #include "base/message_loop/message_loop.h" #include "gpu/command_buffer/client/cmd_buffer_helper.h" #include "gpu/command_buffer/service/command_buffer_service.h" @@ -68,11 +69,11 @@ int32_t GetToken() { return command_buffer_->GetLastState().token; } - scoped_ptr<AsyncAPIMock> api_mock_; + std::unique_ptr<AsyncAPIMock> api_mock_; scoped_refptr<TransferBufferManagerInterface> transfer_buffer_manager_; - scoped_ptr<CommandBufferService> command_buffer_; - scoped_ptr<CommandExecutor> executor_; - scoped_ptr<CommandBufferHelper> helper_; + std::unique_ptr<CommandBufferService> command_buffer_; + std::unique_ptr<CommandExecutor> executor_; + std::unique_ptr<CommandBufferHelper> helper_; base::MessageLoop message_loop_; }; @@ -89,7 +90,7 @@ static const int32_t kShmId = 123; void SetUp() override { MappedMemoryTestBase::SetUp(); - scoped_ptr<base::SharedMemory> shared_memory(new base::SharedMemory()); + std::unique_ptr<base::SharedMemory> shared_memory(new base::SharedMemory()); shared_memory->CreateAndMapAnonymous(kBufferSize); buffer_ = MakeBufferFromSharedMemory(std::move(shared_memory), kBufferSize); chunk_.reset(new MemoryChunk(kShmId, buffer_, helper_.get())); @@ -104,7 +105,7 @@ uint8_t* buffer_memory() { return static_cast<uint8_t*>(buffer_->memory()); } - scoped_ptr<MemoryChunk> chunk_; + std::unique_ptr<MemoryChunk> chunk_; scoped_refptr<gpu::Buffer> buffer_; }; @@ -162,7 +163,7 @@ MappedMemoryTestBase::TearDown(); } - scoped_ptr<MappedMemoryManager> manager_; + std::unique_ptr<MappedMemoryManager> manager_; }; TEST_F(MappedMemoryManagerTest, Basic) {
diff --git a/gpu/command_buffer/client/program_info_manager_unittest.cc b/gpu/command_buffer/client/program_info_manager_unittest.cc index 64d896c..19aa12e 100644 --- a/gpu/command_buffer/client/program_info_manager_unittest.cc +++ b/gpu/command_buffer/client/program_info_manager_unittest.cc
@@ -5,6 +5,8 @@ #include <stddef.h> #include <stdint.h> +#include <memory> + #include "gpu/command_buffer/client/program_info_manager.h" #include "testing/gtest/include/gtest/gtest.h" @@ -165,7 +167,7 @@ memcpy(data->name1, kName[1], arraysize(data->name1)); } - scoped_ptr<ProgramInfoManager> program_info_manager_; + std::unique_ptr<ProgramInfoManager> program_info_manager_; Program* program_; };
diff --git a/gpu/command_buffer/client/query_tracker_unittest.cc b/gpu/command_buffer/client/query_tracker_unittest.cc index a110087..78ab936d1 100644 --- a/gpu/command_buffer/client/query_tracker_unittest.cc +++ b/gpu/command_buffer/client/query_tracker_unittest.cc
@@ -10,9 +10,9 @@ #include <stddef.h> #include <stdint.h> +#include <memory> #include <vector> -#include "base/memory/scoped_ptr.h" #include "gpu/command_buffer/client/client_test_helper.h" #include "gpu/command_buffer/client/gles2_cmd_helper.h" #include "gpu/command_buffer/client/mapped_memory.h" @@ -45,10 +45,10 @@ command_buffer_.reset(); } - scoped_ptr<CommandBuffer> command_buffer_; - scoped_ptr<GLES2CmdHelper> helper_; - scoped_ptr<MappedMemoryManager> mapped_memory_; - scoped_ptr<QuerySyncManager> sync_manager_; + std::unique_ptr<CommandBuffer> command_buffer_; + std::unique_ptr<GLES2CmdHelper> helper_; + std::unique_ptr<MappedMemoryManager> mapped_memory_; + std::unique_ptr<QuerySyncManager> sync_manager_; }; TEST_F(QuerySyncManagerTest, Basic) { @@ -113,10 +113,10 @@ uint32_t GetFlushGeneration() { return helper_->flush_generation(); } - scoped_ptr<CommandBuffer> command_buffer_; - scoped_ptr<GLES2CmdHelper> helper_; - scoped_ptr<MappedMemoryManager> mapped_memory_; - scoped_ptr<QueryTracker> query_tracker_; + std::unique_ptr<CommandBuffer> command_buffer_; + std::unique_ptr<GLES2CmdHelper> helper_; + std::unique_ptr<MappedMemoryManager> mapped_memory_; + std::unique_ptr<QueryTracker> query_tracker_; }; TEST_F(QueryTrackerTest, Basic) {
diff --git a/gpu/command_buffer/client/ring_buffer_test.cc b/gpu/command_buffer/client/ring_buffer_test.cc index cf3418f..3e1b2667 100644 --- a/gpu/command_buffer/client/ring_buffer_test.cc +++ b/gpu/command_buffer/client/ring_buffer_test.cc
@@ -8,6 +8,8 @@ #include <stdint.h> +#include <memory> + #include "base/bind.h" #include "base/bind_helpers.h" #include "gpu/command_buffer/client/cmd_buffer_helper.h" @@ -91,15 +93,15 @@ int32_t GetToken() { return command_buffer_->GetLastState().token; } - scoped_ptr<AsyncAPIMock> api_mock_; + std::unique_ptr<AsyncAPIMock> api_mock_; scoped_refptr<TransferBufferManagerInterface> transfer_buffer_manager_; - scoped_ptr<CommandBufferService> command_buffer_; - scoped_ptr<CommandExecutor> executor_; - scoped_ptr<CommandBufferHelper> helper_; + std::unique_ptr<CommandBufferService> command_buffer_; + std::unique_ptr<CommandExecutor> executor_; + std::unique_ptr<CommandBufferHelper> helper_; std::vector<const void*> set_token_arguments_; bool delay_set_token_; - scoped_ptr<int8_t[]> buffer_; + std::unique_ptr<int8_t[]> buffer_; int8_t* buffer_start_; base::MessageLoop message_loop_; }; @@ -131,7 +133,7 @@ BaseRingBufferTest::TearDown(); } - scoped_ptr<RingBuffer> allocator_; + std::unique_ptr<RingBuffer> allocator_; }; // Checks basic alloc and free.
diff --git a/gpu/command_buffer/client/share_group.h b/gpu/command_buffer/client/share_group.h index 25427e3..066c6e6 100644 --- a/gpu/command_buffer/client/share_group.h +++ b/gpu/command_buffer/client/share_group.h
@@ -7,8 +7,10 @@ #include <GLES2/gl2.h> #include <stdint.h> + +#include <memory> + #include "base/macros.h" -#include "base/memory/scoped_ptr.h" #include "gles2_impl_export.h" #include "gpu/command_buffer/client/ref_counted.h" #include "gpu/command_buffer/common/gles2_cmd_format.h" @@ -152,10 +154,11 @@ // Install a new program info manager. Used for testing only; void set_program_info_manager(ProgramInfoManager* manager); - scoped_ptr<IdHandlerInterface> id_handlers_[id_namespaces::kNumIdNamespaces]; - scoped_ptr<RangeIdHandlerInterface> + std::unique_ptr<IdHandlerInterface> + id_handlers_[id_namespaces::kNumIdNamespaces]; + std::unique_ptr<RangeIdHandlerInterface> range_id_handlers_[id_namespaces::kNumRangeIdNamespaces]; - scoped_ptr<ProgramInfoManager> program_info_manager_; + std::unique_ptr<ProgramInfoManager> program_info_manager_; bool bind_generates_resource_; uint64_t tracing_guid_;
diff --git a/gpu/command_buffer/client/transfer_buffer.h b/gpu/command_buffer/client/transfer_buffer.h index 43fea94..5f6623e 100644 --- a/gpu/command_buffer/client/transfer_buffer.h +++ b/gpu/command_buffer/client/transfer_buffer.h
@@ -8,9 +8,10 @@ #include <stddef.h> #include <stdint.h> +#include <memory> + #include "base/compiler_specific.h" #include "base/macros.h" -#include "base/memory/scoped_ptr.h" #include "gpu/command_buffer/client/ring_buffer.h" #include "gpu/command_buffer/common/buffer.h" #include "gpu/command_buffer/common/gles2_cmd_utils.h" @@ -97,7 +98,7 @@ void AllocateRingBuffer(unsigned int size); CommandBufferHelper* helper_; - scoped_ptr<RingBuffer> ring_buffer_; + std::unique_ptr<RingBuffer> ring_buffer_; // size reserved for results unsigned int result_size_;
diff --git a/gpu/command_buffer/client/transfer_buffer_unittest.cc b/gpu/command_buffer/client/transfer_buffer_unittest.cc index 7a98b804..336b992 100644 --- a/gpu/command_buffer/client/transfer_buffer_unittest.cc +++ b/gpu/command_buffer/client/transfer_buffer_unittest.cc
@@ -9,6 +9,8 @@ #include <stddef.h> #include <stdint.h> +#include <memory> + #include "base/compiler_specific.h" #include "gpu/command_buffer/client/client_test_helper.h" #include "gpu/command_buffer/client/cmd_buffer_helper.h" @@ -56,9 +58,9 @@ return command_buffer_.get(); } - scoped_ptr<MockClientCommandBufferMockFlush> command_buffer_; - scoped_ptr<CommandBufferHelper> helper_; - scoped_ptr<TransferBuffer> transfer_buffer_; + std::unique_ptr<MockClientCommandBufferMockFlush> command_buffer_; + std::unique_ptr<CommandBufferHelper> helper_; + std::unique_ptr<TransferBuffer> transfer_buffer_; int32_t transfer_buffer_id_; }; @@ -260,9 +262,9 @@ return command_buffer_.get(); } - scoped_ptr<MockClientCommandBufferCanFail> command_buffer_; - scoped_ptr<CommandBufferHelper> helper_; - scoped_ptr<TransferBuffer> transfer_buffer_; + std::unique_ptr<MockClientCommandBufferCanFail> command_buffer_; + std::unique_ptr<CommandBufferHelper> helper_; + std::unique_ptr<TransferBuffer> transfer_buffer_; int32_t transfer_buffer_id_; };
diff --git a/gpu/command_buffer/client/vertex_array_object_manager.h b/gpu/command_buffer/client/vertex_array_object_manager.h index 6897c929..42ec269 100644 --- a/gpu/command_buffer/client/vertex_array_object_manager.h +++ b/gpu/command_buffer/client/vertex_array_object_manager.h
@@ -8,9 +8,10 @@ #include <GLES2/gl2.h> #include <stdint.h> +#include <memory> + #include "base/containers/hash_tables.h" #include "base/macros.h" -#include "base/memory/scoped_ptr.h" #include "gles2_impl_export.h" namespace gpu { @@ -113,7 +114,7 @@ GLuint element_array_buffer_id_; GLsizei element_array_buffer_size_; GLsizei collection_buffer_size_; - scoped_ptr<int8_t[]> collection_buffer_; + std::unique_ptr<int8_t[]> collection_buffer_; VertexArrayObject* default_vertex_array_object_; VertexArrayObject* bound_vertex_array_object_;
diff --git a/gpu/command_buffer/client/vertex_array_object_manager_unittest.cc b/gpu/command_buffer/client/vertex_array_object_manager_unittest.cc index b39aab8..77b6b4c 100644 --- a/gpu/command_buffer/client/vertex_array_object_manager_unittest.cc +++ b/gpu/command_buffer/client/vertex_array_object_manager_unittest.cc
@@ -6,8 +6,12 @@ #include <GLES2/gl2ext.h> #include <GLES3/gl3.h> + #include <stddef.h> #include <stdint.h> + +#include <memory> + #include "testing/gtest/include/gtest/gtest.h" namespace gpu { @@ -29,7 +33,7 @@ } void TearDown() override {} - scoped_ptr<VertexArrayObjectManager> manager_; + std::unique_ptr<VertexArrayObjectManager> manager_; }; // GCC requires these declarations, but MSVC requires they not be present
diff --git a/gpu/command_buffer/cmd_buffer_functions.txt b/gpu/command_buffer/cmd_buffer_functions.txt index 3f036613..aa428aa 100644 --- a/gpu/command_buffer/cmd_buffer_functions.txt +++ b/gpu/command_buffer/cmd_buffer_functions.txt
@@ -312,7 +312,7 @@ GL_APICALL void GL_APIENTRY glDrawBuffersEXT (GLsizei count, const GLenum* bufs); GL_APICALL void GL_APIENTRY glDiscardBackbufferCHROMIUM (void); GL_APICALL void GL_APIENTRY glScheduleOverlayPlaneCHROMIUM (GLint plane_z_order, GLenum plane_transform, GLuint overlay_texture_id, GLint bounds_x, GLint bounds_y, GLint bounds_width, GLint bounds_height, GLfloat uv_x, GLfloat uv_y, GLfloat uv_width, GLfloat uv_height); -GL_APICALL void GL_APIENTRY glScheduleCALayerCHROMIUM (GLuint contents_texture_id, const GLfloat* contents_rect, GLfloat opacity, GLuint background_color, GLuint edge_aa_mask, const GLfloat* bounds_rect, GLboolean is_clipped, const GLfloat* clip_rect, GLint sorting_context_id, const GLfloat* transform); +GL_APICALL void GL_APIENTRY glScheduleCALayerCHROMIUM (GLuint contents_texture_id, const GLfloat* contents_rect, GLfloat opacity, GLuint background_color, GLuint edge_aa_mask, const GLfloat* bounds_rect, GLboolean is_clipped, const GLfloat* clip_rect, GLint sorting_context_id, const GLfloat* transform, GLuint filter); GL_APICALL void GL_APIENTRY glCommitOverlayPlanesCHROMIUM (void); GL_APICALL void GL_APIENTRY glSwapInterval (GLint interval); GL_APICALL void GL_APIENTRY glFlushDriverCachesCHROMIUM (void);
diff --git a/gpu/command_buffer/common/BUILD.gn b/gpu/command_buffer/common/BUILD.gn index 445ca06..55304d48 100644 --- a/gpu/command_buffer/common/BUILD.gn +++ b/gpu/command_buffer/common/BUILD.gn
@@ -96,7 +96,4 @@ "sync_token.mojom", "value_state.mojom", ] - - typemaps = [ "mojo.typemap" ] - typemap_deps = [ "//gpu/ipc/common:command_buffer_traits" ] }
diff --git a/gpu/command_buffer/common/buffer.cc b/gpu/command_buffer/common/buffer.cc index 02c77778..1bb9523 100644 --- a/gpu/command_buffer/common/buffer.cc +++ b/gpu/command_buffer/common/buffer.cc
@@ -14,7 +14,7 @@ namespace gpu { SharedMemoryBufferBacking::SharedMemoryBufferBacking( - scoped_ptr<base::SharedMemory> shared_memory, + std::unique_ptr<base::SharedMemory> shared_memory, size_t size) : shared_memory_(std::move(shared_memory)), size_(size) {} @@ -26,7 +26,7 @@ size_t SharedMemoryBufferBacking::GetSize() const { return size_; } -Buffer::Buffer(scoped_ptr<BufferBacking> backing) +Buffer::Buffer(std::unique_ptr<BufferBacking> backing) : backing_(std::move(backing)), memory_(backing_->GetMemory()), size_(backing_->GetSize()) {
diff --git a/gpu/command_buffer/common/buffer.h b/gpu/command_buffer/common/buffer.h index 1e427f2..0aea591 100644 --- a/gpu/command_buffer/common/buffer.h +++ b/gpu/command_buffer/common/buffer.h
@@ -8,9 +8,10 @@ #include <stddef.h> #include <stdint.h> +#include <memory> + #include "base/macros.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "base/memory/shared_memory.h" #include "base/trace_event/memory_allocator_dump.h" #include "gpu/gpu_export.h" @@ -30,7 +31,7 @@ class GPU_EXPORT SharedMemoryBufferBacking : public BufferBacking { public: - SharedMemoryBufferBacking(scoped_ptr<base::SharedMemory> shared_memory, + SharedMemoryBufferBacking(std::unique_ptr<base::SharedMemory> shared_memory, size_t size); ~SharedMemoryBufferBacking() override; void* GetMemory() const override; @@ -38,7 +39,7 @@ base::SharedMemory* shared_memory() { return shared_memory_.get(); } private: - scoped_ptr<base::SharedMemory> shared_memory_; + std::unique_ptr<base::SharedMemory> shared_memory_; size_t size_; DISALLOW_COPY_AND_ASSIGN(SharedMemoryBufferBacking); }; @@ -46,7 +47,7 @@ // Buffer owns a piece of shared-memory of a certain size. class GPU_EXPORT Buffer : public base::RefCountedThreadSafe<Buffer> { public: - explicit Buffer(scoped_ptr<BufferBacking> backing); + explicit Buffer(std::unique_ptr<BufferBacking> backing); BufferBacking* backing() const { return backing_.get(); } void* memory() const { return memory_; } @@ -59,22 +60,22 @@ friend class base::RefCountedThreadSafe<Buffer>; ~Buffer(); - scoped_ptr<BufferBacking> backing_; + std::unique_ptr<BufferBacking> backing_; void* memory_; size_t size_; DISALLOW_COPY_AND_ASSIGN(Buffer); }; -static inline scoped_ptr<BufferBacking> MakeBackingFromSharedMemory( - scoped_ptr<base::SharedMemory> shared_memory, +static inline std::unique_ptr<BufferBacking> MakeBackingFromSharedMemory( + std::unique_ptr<base::SharedMemory> shared_memory, size_t size) { - return scoped_ptr<BufferBacking>( + return std::unique_ptr<BufferBacking>( new SharedMemoryBufferBacking(std::move(shared_memory), size)); } static inline scoped_refptr<Buffer> MakeBufferFromSharedMemory( - scoped_ptr<base::SharedMemory> shared_memory, + std::unique_ptr<base::SharedMemory> shared_memory, size_t size) { return new Buffer( MakeBackingFromSharedMemory(std::move(shared_memory), size));
diff --git a/gpu/command_buffer/common/capabilities.typemap b/gpu/command_buffer/common/capabilities.typemap new file mode 100644 index 0000000..5b574e0b --- /dev/null +++ b/gpu/command_buffer/common/capabilities.typemap
@@ -0,0 +1,12 @@ +# 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. + +mojom = "//gpu/command_buffer/common/capabilities.mojom" +public_headers = [ "//gpu/command_buffer/common/capabilities.h" ] +traits_headers = [ "//gpu/ipc/common/gpu_command_buffer_traits.h" ] +deps = [ + "//gpu/ipc/common:command_buffer_traits", +] + +type_mappings = [ "gpu.mojom.Capabilities=gpu::Capabilities" ]
diff --git a/gpu/command_buffer/common/command_buffer.typemap b/gpu/command_buffer/common/command_buffer.typemap new file mode 100644 index 0000000..78ddbbd --- /dev/null +++ b/gpu/command_buffer/common/command_buffer.typemap
@@ -0,0 +1,12 @@ +# 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. + +mojom = "//gpu/command_buffer/common/command_buffer.mojom" +public_headers = [ "//gpu/command_buffer/common/command_buffer.h" ] +traits_headers = [ "//gpu/ipc/common/gpu_command_buffer_traits.h" ] +deps = [ + "//gpu/ipc/common:command_buffer_traits", +] + +type_mappings = [ "gpu.mojom.CommandBufferState=gpu::CommandBuffer::State" ]
diff --git a/gpu/command_buffer/common/command_buffer_shared_test.cc b/gpu/command_buffer/common/command_buffer_shared_test.cc index dc4bbed..4ae6040 100644 --- a/gpu/command_buffer/common/command_buffer_shared_test.cc +++ b/gpu/command_buffer/common/command_buffer_shared_test.cc
@@ -8,9 +8,10 @@ #include <stdint.h> +#include <memory> + #include "base/bind.h" #include "base/location.h" -#include "base/memory/scoped_ptr.h" #include "base/single_thread_task_runner.h" #include "base/threading/thread.h" #include "testing/gtest/include/gtest/gtest.h" @@ -24,7 +25,7 @@ shared_state_->Initialize(); } - scoped_ptr<CommandBufferSharedState> shared_state_; + std::unique_ptr<CommandBufferSharedState> shared_state_; }; TEST_F(CommandBufferSharedTest, TestBasic) { @@ -57,7 +58,7 @@ } TEST_F(CommandBufferSharedTest, TestConsistency) { - scoped_ptr<int32_t[]> buffer; + std::unique_ptr<int32_t[]> buffer; buffer.reset(new int32_t[kSize]); base::Thread consumer("Reader Thread");
diff --git a/gpu/command_buffer/common/gles2_cmd_format_autogen.h b/gpu/command_buffer/common/gles2_cmd_format_autogen.h index 3f3fe78..8d871798 100644 --- a/gpu/command_buffer/common/gles2_cmd_format_autogen.h +++ b/gpu/command_buffer/common/gles2_cmd_format_autogen.h
@@ -13894,6 +13894,7 @@ GLuint _edge_aa_mask, GLboolean _is_clipped, GLint _sorting_context_id, + GLuint _filter, GLuint _shm_id, GLuint _shm_offset) { SetHeader(); @@ -13903,6 +13904,7 @@ edge_aa_mask = _edge_aa_mask; is_clipped = _is_clipped; sorting_context_id = _sorting_context_id; + filter = _filter; shm_id = _shm_id; shm_offset = _shm_offset; } @@ -13914,11 +13916,12 @@ GLuint _edge_aa_mask, GLboolean _is_clipped, GLint _sorting_context_id, + GLuint _filter, GLuint _shm_id, GLuint _shm_offset) { static_cast<ValueType*>(cmd)->Init( _contents_texture_id, _opacity, _background_color, _edge_aa_mask, - _is_clipped, _sorting_context_id, _shm_id, _shm_offset); + _is_clipped, _sorting_context_id, _filter, _shm_id, _shm_offset); return NextCmdAddress<ValueType>(cmd); } @@ -13929,12 +13932,13 @@ uint32_t edge_aa_mask; uint32_t is_clipped; int32_t sorting_context_id; + uint32_t filter; uint32_t shm_id; uint32_t shm_offset; }; -static_assert(sizeof(ScheduleCALayerCHROMIUM) == 36, - "size of ScheduleCALayerCHROMIUM should be 36"); +static_assert(sizeof(ScheduleCALayerCHROMIUM) == 40, + "size of ScheduleCALayerCHROMIUM should be 40"); static_assert(offsetof(ScheduleCALayerCHROMIUM, header) == 0, "offset of ScheduleCALayerCHROMIUM header should be 0"); static_assert( @@ -13952,10 +13956,12 @@ static_assert( offsetof(ScheduleCALayerCHROMIUM, sorting_context_id) == 24, "offset of ScheduleCALayerCHROMIUM sorting_context_id should be 24"); -static_assert(offsetof(ScheduleCALayerCHROMIUM, shm_id) == 28, - "offset of ScheduleCALayerCHROMIUM shm_id should be 28"); -static_assert(offsetof(ScheduleCALayerCHROMIUM, shm_offset) == 32, - "offset of ScheduleCALayerCHROMIUM shm_offset should be 32"); +static_assert(offsetof(ScheduleCALayerCHROMIUM, filter) == 28, + "offset of ScheduleCALayerCHROMIUM filter should be 28"); +static_assert(offsetof(ScheduleCALayerCHROMIUM, shm_id) == 32, + "offset of ScheduleCALayerCHROMIUM shm_id should be 32"); +static_assert(offsetof(ScheduleCALayerCHROMIUM, shm_offset) == 36, + "offset of ScheduleCALayerCHROMIUM shm_offset should be 36"); struct CommitOverlayPlanesCHROMIUM { typedef CommitOverlayPlanesCHROMIUM ValueType;
diff --git a/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h b/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h index cee91671..c1f5dfd1 100644 --- a/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h +++ b/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h
@@ -4783,11 +4783,11 @@ TEST_F(GLES2FormatTest, ScheduleCALayerCHROMIUM) { cmds::ScheduleCALayerCHROMIUM& cmd = *GetBufferAs<cmds::ScheduleCALayerCHROMIUM>(); - void* next_cmd = - cmd.Set(&cmd, static_cast<GLuint>(11), static_cast<GLfloat>(12), - static_cast<GLuint>(13), static_cast<GLuint>(14), - static_cast<GLboolean>(15), static_cast<GLint>(16), - static_cast<GLuint>(17), static_cast<GLuint>(18)); + void* next_cmd = cmd.Set(&cmd, static_cast<GLuint>(11), + static_cast<GLfloat>(12), static_cast<GLuint>(13), + static_cast<GLuint>(14), static_cast<GLboolean>(15), + static_cast<GLint>(16), static_cast<GLuint>(17), + static_cast<GLuint>(18), static_cast<GLuint>(19)); EXPECT_EQ(static_cast<uint32_t>(cmds::ScheduleCALayerCHROMIUM::kCmdId), cmd.header.command); EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u); @@ -4797,8 +4797,9 @@ EXPECT_EQ(static_cast<GLuint>(14), cmd.edge_aa_mask); EXPECT_EQ(static_cast<GLboolean>(15), cmd.is_clipped); EXPECT_EQ(static_cast<GLint>(16), cmd.sorting_context_id); - EXPECT_EQ(static_cast<GLuint>(17), cmd.shm_id); - EXPECT_EQ(static_cast<GLuint>(18), cmd.shm_offset); + EXPECT_EQ(static_cast<GLuint>(17), cmd.filter); + EXPECT_EQ(static_cast<GLuint>(18), cmd.shm_id); + EXPECT_EQ(static_cast<GLuint>(19), cmd.shm_offset); CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd)); }
diff --git a/gpu/command_buffer/common/mailbox.typemap b/gpu/command_buffer/common/mailbox.typemap new file mode 100644 index 0000000..8c6bff4 --- /dev/null +++ b/gpu/command_buffer/common/mailbox.typemap
@@ -0,0 +1,12 @@ +# 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. + +mojom = "//gpu/command_buffer/common/mailbox.mojom" +public_headers = [ "//gpu/command_buffer/common/mailbox.h" ] +traits_headers = [ "//gpu/ipc/common/gpu_command_buffer_traits.h" ] +deps = [ + "//gpu/ipc/common:command_buffer_traits", +] + +type_mappings = [ "gpu.mojom.Mailbox=gpu::Mailbox" ]
diff --git a/gpu/command_buffer/common/mailbox_holder.typemap b/gpu/command_buffer/common/mailbox_holder.typemap new file mode 100644 index 0000000..1430e4e --- /dev/null +++ b/gpu/command_buffer/common/mailbox_holder.typemap
@@ -0,0 +1,12 @@ +# 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. + +mojom = "//gpu/command_buffer/common/mailbox_holder.mojom" +public_headers = [ "//gpu/command_buffer/common/mailbox_holder.h" ] +traits_headers = [ "//gpu/ipc/common/gpu_command_buffer_traits.h" ] +deps = [ + "//gpu/ipc/common:command_buffer_traits", +] + +type_mappings = [ "gpu.mojom.MailboxHolder=gpu::MailboxHolder" ]
diff --git a/gpu/command_buffer/common/mojo.typemap b/gpu/command_buffer/common/mojo.typemap deleted file mode 100644 index d412acd..0000000 --- a/gpu/command_buffer/common/mojo.typemap +++ /dev/null
@@ -1,62 +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. - -{ - "c++": { - "gpu.mojom.Capabilities": { - "typename": "gpu::Capabilities", - "public_headers": [ - "gpu/command_buffer/common/capabilities.h" - ], - "traits_headers": [ - "gpu/ipc/common/gpu_command_buffer_traits.h" - ] - }, - "gpu.mojom.CommandBufferState": { - "typename": "gpu::CommandBuffer::State", - "public_headers": [ - "gpu/command_buffer/common/command_buffer.h" - ], - "traits_headers": [ - "gpu/ipc/common/gpu_command_buffer_traits.h" - ] - }, - "gpu.mojom.Mailbox": { - "typename": "gpu::Mailbox", - "public_headers": [ - "gpu/command_buffer/common/mailbox.h" - ], - "traits_headers": [ - "gpu/ipc/common/gpu_command_buffer_traits.h" - ] - }, - "gpu.mojom.MailboxHolder": { - "typename": "gpu::MailboxHolder", - "public_headers": [ - "gpu/command_buffer/common/mailbox_holder.h" - ], - "traits_headers": [ - "gpu/ipc/common/gpu_command_buffer_traits.h" - ] - }, - "gpu.mojom.SyncToken": { - "typename": "gpu::SyncToken", - "public_headers": [ - "gpu/command_buffer/common/sync_token.h" - ], - "traits_headers": [ - "gpu/ipc/common/gpu_command_buffer_traits.h" - ] - }, - "gpu.mojom.ValueState": { - "typename": "gpu::ValueState", - "public_headers": [ - "gpu/command_buffer/common/value_state.h" - ], - "traits_headers": [ - "gpu/ipc/common/gpu_command_buffer_traits.h" - ] - } - } -}
diff --git a/gpu/command_buffer/common/sync_token.typemap b/gpu/command_buffer/common/sync_token.typemap new file mode 100644 index 0000000..9100ff9 --- /dev/null +++ b/gpu/command_buffer/common/sync_token.typemap
@@ -0,0 +1,12 @@ +# 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. + +mojom = "//gpu/command_buffer/common/sync_token.mojom" +public_headers = [ "//gpu/command_buffer/common/sync_token.h" ] +traits_headers = [ "//gpu/ipc/common/gpu_command_buffer_traits.h" ] +deps = [ + "//gpu/ipc/common:command_buffer_traits", +] + +type_mappings = [ "gpu.mojom.SyncToken=gpu::SyncToken" ]
diff --git a/gpu/command_buffer/common/typemaps.gni b/gpu/command_buffer/common/typemaps.gni new file mode 100644 index 0000000..960a2d6 --- /dev/null +++ b/gpu/command_buffer/common/typemaps.gni
@@ -0,0 +1,12 @@ +# 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. + +typemaps = [ + "//gpu/command_buffer/common/capabilities.typemap", + "//gpu/command_buffer/common/command_buffer.typemap", + "//gpu/command_buffer/common/mailbox.typemap", + "//gpu/command_buffer/common/mailbox_holder.typemap", + "//gpu/command_buffer/common/sync_token.typemap", + "//gpu/command_buffer/common/value_state.typemap", +]
diff --git a/gpu/command_buffer/common/value_state.typemap b/gpu/command_buffer/common/value_state.typemap new file mode 100644 index 0000000..a219952a --- /dev/null +++ b/gpu/command_buffer/common/value_state.typemap
@@ -0,0 +1,12 @@ +# 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. + +mojom = "//gpu/command_buffer/common/value_state.mojom" +public_headers = [ "//gpu/command_buffer/common/value_state.h" ] +traits_headers = [ "//gpu/ipc/common/gpu_command_buffer_traits.h" ] +deps = [ + "//gpu/ipc/common:command_buffer_traits", +] + +type_mappings = [ "gpu.mojom.ValueState=gpu::ValueState" ]
diff --git a/gpu/command_buffer/service/buffer_manager.h b/gpu/command_buffer/service/buffer_manager.h index 8ababfa..59547229 100644 --- a/gpu/command_buffer/service/buffer_manager.h +++ b/gpu/command_buffer/service/buffer_manager.h
@@ -9,13 +9,13 @@ #include <stdint.h> #include <map> +#include <memory> #include <vector> #include "base/containers/hash_tables.h" #include "base/logging.h" #include "base/macros.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "gpu/command_buffer/common/buffer.h" #include "gpu/command_buffer/service/gl_utils.h" #include "gpu/command_buffer/service/memory_tracking.h" @@ -205,7 +205,7 @@ GLenum usage_; // Data cached from last glMapBufferRange call. - scoped_ptr<MappedRange> mapped_range_; + std::unique_ptr<MappedRange> mapped_range_; // A map of ranges to the highest value in that range of a certain type. typedef std::map<Range, GLuint, Range::Less> RangeToMaxValueMap; @@ -328,7 +328,7 @@ GLenum usage, bool use_shadow); - scoped_ptr<MemoryTypeTracker> memory_type_tracker_; + std::unique_ptr<MemoryTypeTracker> memory_type_tracker_; MemoryTracker* memory_tracker_; scoped_refptr<FeatureInfo> feature_info_;
diff --git a/gpu/command_buffer/service/buffer_manager_unittest.cc b/gpu/command_buffer/service/buffer_manager_unittest.cc index 45e08c8..c838a12 100644 --- a/gpu/command_buffer/service/buffer_manager_unittest.cc +++ b/gpu/command_buffer/service/buffer_manager_unittest.cc
@@ -5,6 +5,8 @@ #include <stddef.h> #include <stdint.h> +#include <memory> + #include "gpu/command_buffer/service/buffer_manager.h" #include "gpu/command_buffer/service/error_state_mock.h" #include "gpu/command_buffer/service/feature_info.h" @@ -226,8 +228,8 @@ 40, 1, GL_UNSIGNED_INT, enable_primitive_restart, &max_value)); } - scoped_ptr<BufferManager> manager_; - scoped_ptr<MockErrorState> error_state_; + std::unique_ptr<BufferManager> manager_; + std::unique_ptr<MockErrorState> error_state_; }; class BufferManagerTest : public BufferManagerTestBase { @@ -248,9 +250,9 @@ class BufferManagerClientSideArraysTest : public BufferManagerTestBase { protected: void SetUp() override { - feature_info_ = new FeatureInfo(); - feature_info_->workarounds_.use_client_side_arrays_for_stream_buffers = - true; + GpuDriverBugWorkarounds gpu_driver_bug_workarounds; + gpu_driver_bug_workarounds.use_client_side_arrays_for_stream_buffers = true; + feature_info_ = new FeatureInfo(gpu_driver_bug_workarounds); SetUpBase(NULL, feature_info_.get(), ""); } @@ -363,7 +365,7 @@ EXPECT_FALSE(DoBufferSubData(buffer, kTarget, 0, -1, data)); DoBufferData(buffer, kTarget, 1, GL_STATIC_DRAW, NULL, GL_NO_ERROR); const int size = 0x20000; - scoped_ptr<uint8_t[]> temp(new uint8_t[size]); + std::unique_ptr<uint8_t[]> temp(new uint8_t[size]); EXPECT_FALSE(DoBufferSubData(buffer, kTarget, 0 - size, size, temp.get())); EXPECT_FALSE(DoBufferSubData(buffer, kTarget, 1, size / 2, temp.get())); }
diff --git a/gpu/command_buffer/service/cmd_parser_test.cc b/gpu/command_buffer/service/cmd_parser_test.cc index 7df519d7..b1ed3a27 100644 --- a/gpu/command_buffer/service/cmd_parser_test.cc +++ b/gpu/command_buffer/service/cmd_parser_test.cc
@@ -6,8 +6,9 @@ #include <stddef.h> +#include <memory> + #include "base/logging.h" -#include "base/memory/scoped_ptr.h" #include "gpu/command_buffer/service/cmd_parser.h" #include "gpu/command_buffer/service/mocks.h" #include "testing/gtest/include/gtest/gtest.h" @@ -61,14 +62,14 @@ CommandBufferEntry *buffer() { return buffer_.get(); } private: unsigned int buffer_entry_count_; - scoped_ptr<AsyncAPIMock> api_mock_; - scoped_ptr<CommandBufferEntry[]> buffer_; + std::unique_ptr<AsyncAPIMock> api_mock_; + std::unique_ptr<CommandBufferEntry[]> buffer_; Sequence sequence_; }; // Tests initialization conditions. TEST_F(CommandParserTest, TestInit) { - scoped_ptr<CommandParser> parser(MakeParser(10)); + std::unique_ptr<CommandParser> parser(MakeParser(10)); EXPECT_EQ(0, parser->get()); EXPECT_EQ(0, parser->put()); EXPECT_TRUE(parser->IsEmpty()); @@ -76,7 +77,7 @@ // Tests simple commands. TEST_F(CommandParserTest, TestSimple) { - scoped_ptr<CommandParser> parser(MakeParser(10)); + std::unique_ptr<CommandParser> parser(MakeParser(10)); CommandBufferOffset put = parser->put(); CommandHeader header; @@ -109,7 +110,7 @@ // Tests having multiple commands in the buffer. TEST_F(CommandParserTest, TestMultipleCommands) { - scoped_ptr<CommandParser> parser(MakeParser(10)); + std::unique_ptr<CommandParser> parser(MakeParser(10)); CommandBufferOffset put = parser->put(); CommandHeader header; @@ -161,7 +162,7 @@ // Tests that the parser will wrap correctly at the end of the buffer. TEST_F(CommandParserTest, TestWrap) { - scoped_ptr<CommandParser> parser(MakeParser(5)); + std::unique_ptr<CommandParser> parser(MakeParser(5)); CommandBufferOffset put = parser->put(); CommandHeader header; @@ -213,7 +214,7 @@ // Tests error conditions. TEST_F(CommandParserTest, TestError) { const unsigned int kNumEntries = 5; - scoped_ptr<CommandParser> parser(MakeParser(kNumEntries)); + std::unique_ptr<CommandParser> parser(MakeParser(kNumEntries)); CommandBufferOffset put = parser->put(); CommandHeader header; @@ -285,7 +286,7 @@ } TEST_F(CommandParserTest, SetBuffer) { - scoped_ptr<CommandParser> parser(MakeParser(3)); + std::unique_ptr<CommandParser> parser(MakeParser(3)); CommandBufferOffset put = parser->put(); CommandHeader header; @@ -303,7 +304,7 @@ EXPECT_EQ(2, parser->get()); Mock::VerifyAndClearExpectations(api_mock()); - scoped_ptr<CommandBufferEntry[]> buffer2(new CommandBufferEntry[2]); + std::unique_ptr<CommandBufferEntry[]> buffer2(new CommandBufferEntry[2]); parser->SetBuffer( buffer2.get(), sizeof(CommandBufferEntry) * 2, 0, sizeof(CommandBufferEntry) * 2);
diff --git a/gpu/command_buffer/service/command_buffer_service.cc b/gpu/command_buffer/service/command_buffer_service.cc index 368bc1c..9c3d9b0 100644 --- a/gpu/command_buffer/service/command_buffer_service.cc +++ b/gpu/command_buffer/service/command_buffer_service.cc
@@ -8,6 +8,7 @@ #include <stdint.h> #include <limits> +#include <memory> #include "base/logging.h" #include "base/trace_event/trace_event.h" @@ -105,7 +106,7 @@ } void CommandBufferService::SetSharedStateBuffer( - scoped_ptr<BufferBacking> shared_state_buffer) { + std::unique_ptr<BufferBacking> shared_state_buffer) { shared_state_buffer_ = std::move(shared_state_buffer); DCHECK(shared_state_buffer_->GetSize() >= sizeof(*shared_state_)); @@ -124,7 +125,7 @@ int32_t* id) { *id = -1; - scoped_ptr<SharedMemory> shared_memory(new SharedMemory()); + std::unique_ptr<SharedMemory> shared_memory(new SharedMemory()); if (!shared_memory->CreateAndMapAnonymous(size)) { if (error_ == error::kNoError) error_ = gpu::error::kOutOfBounds; @@ -162,7 +163,7 @@ bool CommandBufferService::RegisterTransferBuffer( int32_t id, - scoped_ptr<BufferBacking> buffer) { + std::unique_ptr<BufferBacking> buffer) { return transfer_buffer_manager_->RegisterTransferBuffer(id, std::move(buffer)); }
diff --git a/gpu/command_buffer/service/command_buffer_service.h b/gpu/command_buffer/service/command_buffer_service.h index 560bf163..df058767 100644 --- a/gpu/command_buffer/service/command_buffer_service.h +++ b/gpu/command_buffer/service/command_buffer_service.h
@@ -8,6 +8,8 @@ #include <stddef.h> #include <stdint.h> +#include <memory> + #include "base/callback.h" #include "base/macros.h" #include "gpu/command_buffer/common/command_buffer.h" @@ -85,19 +87,20 @@ virtual void SetParseErrorCallback(const base::Closure& callback); // Setup the shared memory that shared state should be copied into. - void SetSharedStateBuffer(scoped_ptr<BufferBacking> shared_state_buffer); + void SetSharedStateBuffer(std::unique_ptr<BufferBacking> shared_state_buffer); // Copy the current state into the shared state transfer buffer. void UpdateState(); // Registers an existing shared memory object and get an ID that can be used // to identify it in the command buffer. - bool RegisterTransferBuffer(int32_t id, scoped_ptr<BufferBacking> buffer); + bool RegisterTransferBuffer(int32_t id, + std::unique_ptr<BufferBacking> buffer); private: int32_t ring_buffer_id_; scoped_refptr<Buffer> ring_buffer_; - scoped_ptr<BufferBacking> shared_state_buffer_; + std::unique_ptr<BufferBacking> shared_state_buffer_; CommandBufferSharedState* shared_state_; int32_t num_entries_; int32_t get_offset_;
diff --git a/gpu/command_buffer/service/command_buffer_service_unittest.cc b/gpu/command_buffer/service/command_buffer_service_unittest.cc index 5b39a96..2ee87b8 100644 --- a/gpu/command_buffer/service/command_buffer_service_unittest.cc +++ b/gpu/command_buffer/service/command_buffer_service_unittest.cc
@@ -5,6 +5,8 @@ #include <stddef.h> #include <stdint.h> +#include <memory> + #include "base/bind.h" #include "base/bind_helpers.h" #include "base/threading/thread.h" @@ -53,7 +55,7 @@ } scoped_refptr<TransferBufferManagerInterface> transfer_buffer_manager_; - scoped_ptr<CommandBufferService> command_buffer_; + std::unique_ptr<CommandBufferService> command_buffer_; }; TEST_F(CommandBufferServiceTest, InitializesCommandBuffer) { @@ -84,7 +86,7 @@ TEST_F(CommandBufferServiceTest, CanSyncGetAndPutOffset) { Initialize(1024); - scoped_ptr<StrictMock<MockCallbackTest> > change_callback( + std::unique_ptr<StrictMock<MockCallbackTest>> change_callback( new StrictMock<MockCallbackTest>); command_buffer_->SetPutOffsetChangeCallback( base::Bind( @@ -117,7 +119,7 @@ command_buffer_->CreateTransferBuffer(1024, &ring_buffer_id); EXPECT_GT(ring_buffer_id, 0); - scoped_ptr<StrictMock<MockCallbackTest> > change_callback( + std::unique_ptr<StrictMock<MockCallbackTest>> change_callback( new StrictMock<MockCallbackTest>); command_buffer_->SetGetBufferChangeCallback( base::Bind(
diff --git a/gpu/command_buffer/service/command_executor.h b/gpu/command_buffer/service/command_executor.h index d437325..bd90d6f 100644 --- a/gpu/command_buffer/service/command_executor.h +++ b/gpu/command_buffer/service/command_executor.h
@@ -7,6 +7,7 @@ #include <stdint.h> +#include <memory> #include <queue> #include "base/atomic_ref_count.h" @@ -15,7 +16,6 @@ #include "base/macros.h" #include "base/memory/linked_ptr.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "base/memory/shared_memory.h" #include "base/memory/weak_ptr.h" #include "gpu/command_buffer/service/cmd_buffer_engine.h" @@ -114,7 +114,7 @@ // TODO(apatrick): The CommandExecutor currently creates and owns the parser. // This should be an argument to the constructor. - scoped_ptr<CommandParser> parser_; + std::unique_ptr<CommandParser> parser_; // Whether the scheduler is currently able to process more commands. bool scheduled_;
diff --git a/gpu/command_buffer/service/command_executor_unittest.cc b/gpu/command_buffer/service/command_executor_unittest.cc index 0002fd9..bcee267 100644 --- a/gpu/command_buffer/service/command_executor_unittest.cc +++ b/gpu/command_buffer/service/command_executor_unittest.cc
@@ -7,6 +7,8 @@ #include <stddef.h> #include <stdint.h> +#include <memory> + #include "gpu/command_buffer/common/command_buffer_mock.h" #include "gpu/command_buffer/service/gles2_cmd_decoder.h" #include "gpu/command_buffer/service/gles2_cmd_decoder_mock.h" @@ -31,7 +33,7 @@ static const int32_t kTransferBufferId = 123; void SetUp() override { - scoped_ptr<base::SharedMemory> shared_memory(new ::base::SharedMemory); + std::unique_ptr<base::SharedMemory> shared_memory(new ::base::SharedMemory); shared_memory->CreateAndMapAnonymous(kRingBufferSize); buffer_ = static_cast<int32_t*>(shared_memory->memory()); shared_memory_buffer_ = @@ -68,11 +70,11 @@ error::Error GetError() { return command_buffer_->GetLastState().error; } - scoped_ptr<MockCommandBuffer> command_buffer_; + std::unique_ptr<MockCommandBuffer> command_buffer_; scoped_refptr<Buffer> shared_memory_buffer_; int32_t* buffer_; - scoped_ptr<gles2::MockGLES2Decoder> decoder_; - scoped_ptr<CommandExecutor> executor_; + std::unique_ptr<gles2::MockGLES2Decoder> decoder_; + std::unique_ptr<CommandExecutor> executor_; base::MessageLoop message_loop_; };
diff --git a/gpu/command_buffer/service/common_decoder.h b/gpu/command_buffer/service/common_decoder.h index 147b776..a8b5d75 100644 --- a/gpu/command_buffer/service/common_decoder.h +++ b/gpu/command_buffer/service/common_decoder.h
@@ -9,11 +9,12 @@ #include <stdint.h> #include <map> +#include <memory> #include <stack> #include <string> + #include "base/macros.h" #include "base/memory/linked_ptr.h" -#include "base/memory/scoped_ptr.h" #include "gpu/command_buffer/common/buffer.h" #include "gpu/command_buffer/service/cmd_parser.h" #include "gpu/gpu_export.h" @@ -104,7 +105,7 @@ } size_t size_; - ::scoped_ptr<int8_t[]> data_; + ::std::unique_ptr<int8_t[]> data_; DISALLOW_COPY_AND_ASSIGN(Bucket); };
diff --git a/gpu/command_buffer/service/common_decoder_unittest.cc b/gpu/command_buffer/service/common_decoder_unittest.cc index ac4ba1c..c647e562 100644 --- a/gpu/command_buffer/service/common_decoder_unittest.cc +++ b/gpu/command_buffer/service/common_decoder_unittest.cc
@@ -5,6 +5,8 @@ #include <stddef.h> #include <stdint.h> +#include <memory> + #include "gpu/command_buffer/service/cmd_buffer_engine.h" #include "gpu/command_buffer/service/common_decoder.h" #include "testing/gtest/include/gtest/gtest.h" @@ -83,7 +85,7 @@ : CommandBufferEngine(), token_(), get_offset_(0) { - scoped_ptr<base::SharedMemory> shared_memory(new base::SharedMemory()); + std::unique_ptr<base::SharedMemory> shared_memory(new base::SharedMemory()); shared_memory->CreateAndMapAnonymous(kBufferSize); buffer_ = MakeBufferFromSharedMemory(std::move(shared_memory), kBufferSize); }
diff --git a/gpu/command_buffer/service/context_group.cc b/gpu/command_buffer/service/context_group.cc index 56f70303..001b43c 100644 --- a/gpu/command_buffer/service/context_group.cc +++ b/gpu/command_buffer/service/context_group.cc
@@ -104,14 +104,13 @@ program_cache_(NULL), feature_info_(feature_info) { { + DCHECK(feature_info_); if (!mailbox_manager_.get()) mailbox_manager_ = new MailboxManagerImpl; if (!subscription_ref_set_.get()) subscription_ref_set_ = new SubscriptionRefSet(); if (!pending_valuebuffer_state_.get()) pending_valuebuffer_state_ = new ValueStateMap(); - if (!feature_info.get()) - feature_info_ = new FeatureInfo; transfer_buffer_manager_ = new TransferBufferManager(memory_tracker_.get()); } }
diff --git a/gpu/command_buffer/service/context_group.h b/gpu/command_buffer/service/context_group.h index b4d861a..26f1e3a 100644 --- a/gpu/command_buffer/service/context_group.h +++ b/gpu/command_buffer/service/context_group.h
@@ -7,11 +7,12 @@ #include <stdint.h> +#include <memory> #include <vector> + #include "base/containers/hash_tables.h" #include "base/macros.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "gpu/command_buffer/common/constants.h" #include "gpu/command_buffer/common/gles2_cmd_format.h" @@ -281,23 +282,23 @@ ProgramCache* program_cache_; - scoped_ptr<BufferManager> buffer_manager_; + std::unique_ptr<BufferManager> buffer_manager_; - scoped_ptr<FramebufferManager> framebuffer_manager_; + std::unique_ptr<FramebufferManager> framebuffer_manager_; - scoped_ptr<RenderbufferManager> renderbuffer_manager_; + std::unique_ptr<RenderbufferManager> renderbuffer_manager_; - scoped_ptr<TextureManager> texture_manager_; + std::unique_ptr<TextureManager> texture_manager_; - scoped_ptr<PathManager> path_manager_; + std::unique_ptr<PathManager> path_manager_; - scoped_ptr<ProgramManager> program_manager_; + std::unique_ptr<ProgramManager> program_manager_; - scoped_ptr<ShaderManager> shader_manager_; + std::unique_ptr<ShaderManager> shader_manager_; - scoped_ptr<SamplerManager> sampler_manager_; + std::unique_ptr<SamplerManager> sampler_manager_; - scoped_ptr<ValuebufferManager> valuebuffer_manager_; + std::unique_ptr<ValuebufferManager> valuebuffer_manager_; scoped_refptr<FeatureInfo> feature_info_;
diff --git a/gpu/command_buffer/service/context_group_unittest.cc b/gpu/command_buffer/service/context_group_unittest.cc index f343e5e2..4bfedc9 100644 --- a/gpu/command_buffer/service/context_group_unittest.cc +++ b/gpu/command_buffer/service/context_group_unittest.cc
@@ -6,7 +6,8 @@ #include <stdint.h> -#include "base/memory/scoped_ptr.h" +#include <memory> + #include "gpu/command_buffer/common/value_state.h" #include "gpu/command_buffer/service/gles2_cmd_decoder_mock.h" #include "gpu/command_buffer/service/gpu_service_test.h" @@ -42,13 +43,14 @@ void SetUp() override { GpuServiceTest::SetUp(); decoder_.reset(new MockGLES2Decoder()); - group_ = scoped_refptr<ContextGroup>(new ContextGroup( - gpu_preferences_, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - kBindGeneratesResource)); + scoped_refptr<FeatureInfo> feature_info = new FeatureInfo; + group_ = scoped_refptr<ContextGroup>( + new ContextGroup(gpu_preferences_, NULL, NULL, NULL, NULL, feature_info, + NULL, NULL, kBindGeneratesResource)); } GpuPreferences gpu_preferences_; - scoped_ptr<MockGLES2Decoder> decoder_; + std::unique_ptr<MockGLES2Decoder> decoder_; scoped_refptr<ContextGroup> group_; }; @@ -105,7 +107,7 @@ } TEST_F(ContextGroupTest, MultipleContexts) { - scoped_ptr<MockGLES2Decoder> decoder2_(new MockGLES2Decoder()); + std::unique_ptr<MockGLES2Decoder> decoder2_(new MockGLES2Decoder()); TestHelper::SetupContextGroupInitExpectations( gl_.get(), DisallowedFeatures(), "", "", kBindGeneratesResource); EXPECT_TRUE(group_->Initialize(decoder_.get(), CONTEXT_TYPE_OPENGLES2,
diff --git a/gpu/command_buffer/service/context_state.h b/gpu/command_buffer/service/context_state.h index 7f3211c..b8b76036 100644 --- a/gpu/command_buffer/service/context_state.h +++ b/gpu/command_buffer/service/context_state.h
@@ -7,15 +7,16 @@ #ifndef GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_H_ #define GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_H_ +#include <memory> #include <vector> + #include "base/logging.h" -#include "base/memory/scoped_ptr.h" #include "gpu/command_buffer/service/gl_utils.h" #include "gpu/command_buffer/service/sampler_manager.h" #include "gpu/command_buffer/service/texture_manager.h" #include "gpu/command_buffer/service/valuebuffer_manager.h" -#include "gpu/command_buffer/service/vertex_attrib_manager.h" #include "gpu/command_buffer/service/vertex_array_manager.h" +#include "gpu/command_buffer/service/vertex_attrib_manager.h" #include "gpu/gpu_export.h" namespace gpu { @@ -308,7 +309,7 @@ void InitStateManual(const ContextState* prev_state) const; FeatureInfo* feature_info_; - scoped_ptr<ErrorState> error_state_; + std::unique_ptr<ErrorState> error_state_; }; } // namespace gles2
diff --git a/gpu/command_buffer/service/feature_info.cc b/gpu/command_buffer/service/feature_info.cc index acf8c7b9..97514fd 100644 --- a/gpu/command_buffer/service/feature_info.cc +++ b/gpu/command_buffer/service/feature_info.cc
@@ -80,50 +80,6 @@ std::set<std::string> string_set_; }; -// Process a string of wordaround type IDs (seperated by ',') and set up -// the corresponding Workaround flags. -void StringToWorkarounds( - const std::string& types, FeatureInfo::Workarounds* workarounds) { - DCHECK(workarounds); - for (const base::StringPiece& piece : - base::SplitStringPiece( - types, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL)) { - int number = 0; - bool succeed = base::StringToInt(piece, &number); - DCHECK(succeed); - switch (number) { -#define GPU_OP(type, name) \ - case gpu::type: \ - workarounds->name = true; \ - break; - GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) -#undef GPU_OP - default: - NOTIMPLEMENTED(); - } - } - if (workarounds->max_texture_size_limit_4096) - workarounds->max_texture_size = 4096; - if (workarounds->max_cube_map_texture_size_limit_4096) - workarounds->max_cube_map_texture_size = 4096; - if (workarounds->max_cube_map_texture_size_limit_1024) - workarounds->max_cube_map_texture_size = 1024; - if (workarounds->max_cube_map_texture_size_limit_512) - workarounds->max_cube_map_texture_size = 512; - - if (workarounds->max_fragment_uniform_vectors_32) - workarounds->max_fragment_uniform_vectors = 32; - if (workarounds->max_varying_vectors_16) - workarounds->max_varying_vectors = 16; - if (workarounds->max_vertex_uniform_vectors_256) - workarounds->max_vertex_uniform_vectors = 256; - - if (workarounds->max_copy_texture_chromium_size_1048576) - workarounds->max_copy_texture_chromium_size = 1048576; - if (workarounds->max_copy_texture_chromium_size_262144) - workarounds->max_copy_texture_chromium_size = 262144; -} - } // anonymous namespace. FeatureInfo::FeatureFlags::FeatureFlags() @@ -181,25 +137,24 @@ ext_blend_func_extended(false), ext_read_format_bgra(false) {} -FeatureInfo::Workarounds::Workarounds() : -#define GPU_OP(type, name) name(false), - GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) -#undef GPU_OP - max_texture_size(0), - max_cube_map_texture_size(0), - max_fragment_uniform_vectors(0), - max_varying_vectors(0), - max_vertex_uniform_vectors(0), - max_copy_texture_chromium_size(0) { -} - FeatureInfo::FeatureInfo() { InitializeBasicState(base::CommandLine::InitializedForCurrentProcess() ? base::CommandLine::ForCurrentProcess() : nullptr); } -FeatureInfo::FeatureInfo(const base::CommandLine& command_line) { +FeatureInfo::FeatureInfo( + const GpuDriverBugWorkarounds& gpu_driver_bug_workarounds) + : workarounds_(gpu_driver_bug_workarounds) { + InitializeBasicState(base::CommandLine::InitializedForCurrentProcess() + ? base::CommandLine::ForCurrentProcess() + : nullptr); +} + +FeatureInfo::FeatureInfo( + const base::CommandLine& command_line, + const GpuDriverBugWorkarounds& gpu_driver_bug_workarounds) + : workarounds_(gpu_driver_bug_workarounds) { InitializeBasicState(&command_line); } @@ -207,11 +162,6 @@ if (!command_line) return; - if (command_line->HasSwitch(switches::kGpuDriverBugWorkarounds)) { - std::string types = command_line->GetSwitchValueASCII( - switches::kGpuDriverBugWorkarounds); - StringToWorkarounds(types, &workarounds_); - } feature_flags_.enable_shader_name_hashing = !command_line->HasSwitch(switches::kDisableShaderNameHashing);
diff --git a/gpu/command_buffer/service/feature_info.h b/gpu/command_buffer/service/feature_info.h index e343dd9..99cd9e03 100644 --- a/gpu/command_buffer/service/feature_info.h +++ b/gpu/command_buffer/service/feature_info.h
@@ -5,13 +5,14 @@ #ifndef GPU_COMMAND_BUFFER_SERVICE_FEATURE_INFO_H_ #define GPU_COMMAND_BUFFER_SERVICE_FEATURE_INFO_H_ +#include <memory> #include <string> + #include "base/macros.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "gpu/command_buffer/service/gles2_cmd_decoder.h" #include "gpu/command_buffer/service/gles2_cmd_validation.h" -#include "gpu/config/gpu_driver_bug_workaround_type.h" +#include "gpu/config/gpu_driver_bug_workarounds.h" #include "gpu/gpu_export.h" namespace base { @@ -90,27 +91,15 @@ bool ext_read_format_bgra; }; - struct Workarounds { - Workarounds(); - -#define GPU_OP(type, name) bool name; - GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) -#undef GPU_OP - - // Note: 0 here means use driver limit. - GLint max_texture_size; - GLint max_cube_map_texture_size; - GLint max_fragment_uniform_vectors; - GLint max_varying_vectors; - GLint max_vertex_uniform_vectors; - GLint max_copy_texture_chromium_size; - }; - - // Constructor with workarounds taken from the current process's CommandLine FeatureInfo(); + // Constructor with workarounds taken from the current process's CommandLine + explicit FeatureInfo( + const GpuDriverBugWorkarounds& gpu_driver_bug_workarounds); + // Constructor with workarounds taken from |command_line| - FeatureInfo(const base::CommandLine& command_line); + FeatureInfo(const base::CommandLine& command_line, + const GpuDriverBugWorkarounds& gpu_driver_bug_workarounds); // Initializes the feature information. Needs a current GL context. bool Initialize(ContextType context_type, @@ -135,9 +124,7 @@ return feature_flags_; } - const Workarounds& workarounds() const { - return workarounds_; - } + const GpuDriverBugWorkarounds& workarounds() const { return workarounds_; } const DisallowedFeatures& disallowed_features() const { return disallowed_features_; @@ -188,7 +175,7 @@ FeatureFlags feature_flags_; // Flags for Workarounds. - Workarounds workarounds_; + const GpuDriverBugWorkarounds workarounds_; // Whether the command line switch kEnableUnsafeES3APIs is passed in. bool enable_unsafe_es3_apis_switch_; @@ -202,7 +189,7 @@ bool oes_texture_half_float_linear_available_; bool disable_shader_translator_; - scoped_ptr<gfx::GLVersionInfo> gl_version_info_; + std::unique_ptr<gfx::GLVersionInfo> gl_version_info_; DISALLOW_COPY_AND_ASSIGN(FeatureInfo); };
diff --git a/gpu/command_buffer/service/feature_info_unittest.cc b/gpu/command_buffer/service/feature_info_unittest.cc index 62c3a2e0..fbcd9120 100644 --- a/gpu/command_buffer/service/feature_info_unittest.cc +++ b/gpu/command_buffer/service/feature_info_unittest.cc
@@ -6,8 +6,9 @@ #include <stddef.h> +#include <memory> + #include "base/command_line.h" -#include "base/memory/scoped_ptr.h" #include "base/strings/string_number_conversions.h" #include "gpu/command_buffer/service/gpu_service_test.h" #include "gpu/command_buffer/service/gpu_switches.h" @@ -101,13 +102,15 @@ GpuServiceTest::SetUpWithGLVersion(version, extensions); TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion( gl_.get(), extensions, renderer, version); - info_ = new FeatureInfo(command_line); + GpuDriverBugWorkarounds gpu_driver_bug_workaround(&command_line); + info_ = new FeatureInfo(command_line, gpu_driver_bug_workaround); info_->InitializeForTesting(); } void SetupWithCommandLine(const base::CommandLine& command_line) { GpuServiceTest::SetUp(); - info_ = new FeatureInfo(command_line); + GpuDriverBugWorkarounds gpu_driver_bug_workaround(&command_line); + info_ = new FeatureInfo(command_line, gpu_driver_bug_workaround); } void SetupInitExpectationsWithCommandLine( @@ -116,7 +119,8 @@ GpuServiceTest::SetUpWithGLVersion("2.0", extensions); TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion( gl_.get(), extensions, "", ""); - info_ = new FeatureInfo(command_line); + GpuDriverBugWorkarounds gpu_driver_bug_workaround(&command_line); + info_ = new FeatureInfo(command_line, gpu_driver_bug_workaround); info_->InitializeForTesting(); }
diff --git a/gpu/command_buffer/service/framebuffer_manager.cc b/gpu/command_buffer/service/framebuffer_manager.cc index 3c4fad31..d649635 100644 --- a/gpu/command_buffer/service/framebuffer_manager.cc +++ b/gpu/command_buffer/service/framebuffer_manager.cc
@@ -444,7 +444,7 @@ } bool Framebuffer::PrepareDrawBuffersForClear() const { - scoped_ptr<GLenum[]> buffers(new GLenum[manager_->max_draw_buffers_]); + std::unique_ptr<GLenum[]> buffers(new GLenum[manager_->max_draw_buffers_]); for (uint32_t i = 0; i < manager_->max_draw_buffers_; ++i) buffers[i] = GL_NONE; for (AttachmentMap::const_iterator it = attachments_.begin();
diff --git a/gpu/command_buffer/service/framebuffer_manager.h b/gpu/command_buffer/service/framebuffer_manager.h index b6a2af30..bb0de013 100644 --- a/gpu/command_buffer/service/framebuffer_manager.h +++ b/gpu/command_buffer/service/framebuffer_manager.h
@@ -8,12 +8,12 @@ #include <stddef.h> #include <stdint.h> +#include <memory> #include <vector> #include "base/containers/hash_tables.h" #include "base/macros.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "gpu/command_buffer/service/context_group.h" #include "gpu/command_buffer/service/gl_utils.h" #include "gpu/gpu_export.h" @@ -225,7 +225,7 @@ typedef base::hash_map<GLenum, scoped_refptr<Attachment> > AttachmentMap; AttachmentMap attachments_; - scoped_ptr<GLenum[]> draw_buffers_; + std::unique_ptr<GLenum[]> draw_buffers_; GLenum read_buffer_;
diff --git a/gpu/command_buffer/service/framebuffer_manager_unittest.cc b/gpu/command_buffer/service/framebuffer_manager_unittest.cc index c3538c59..0d7f898e 100644 --- a/gpu/command_buffer/service/framebuffer_manager_unittest.cc +++ b/gpu/command_buffer/service/framebuffer_manager_unittest.cc
@@ -61,8 +61,8 @@ protected: FramebufferManager manager_; scoped_refptr<FeatureInfo> feature_info_; - scoped_ptr<TextureManager> texture_manager_; - scoped_ptr<RenderbufferManager> renderbuffer_manager_; + std::unique_ptr<TextureManager> texture_manager_; + std::unique_ptr<RenderbufferManager> renderbuffer_manager_; }; TEST_F(FramebufferManagerTest, Basic) { @@ -158,10 +158,10 @@ FramebufferManager manager_; Framebuffer* framebuffer_; scoped_refptr<FeatureInfo> feature_info_; - scoped_ptr<TextureManager> texture_manager_; - scoped_ptr<RenderbufferManager> renderbuffer_manager_; - scoped_ptr<MockErrorState> error_state_; - scoped_ptr<MockGLES2Decoder> decoder_; + std::unique_ptr<TextureManager> texture_manager_; + std::unique_ptr<RenderbufferManager> renderbuffer_manager_; + std::unique_ptr<MockErrorState> error_state_; + std::unique_ptr<MockGLES2Decoder> decoder_; }; class FramebufferInfoTest : public FramebufferInfoTestBase {
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc index 27114203..901d6ab 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -13,13 +13,13 @@ #include <cmath> #include <list> #include <map> +#include <memory> #include <queue> #include "base/callback.h" #include "base/callback_helpers.h" #include "base/logging.h" #include "base/memory/linked_ptr.h" -#include "base/memory/scoped_ptr.h" #include "base/metrics/histogram_macros.h" #include "base/numerics/safe_math.h" #include "base/strings/string_number_conversions.h" @@ -401,7 +401,7 @@ private: GLuint temp_texture_id_ = 0; GLuint temp_fbo_id_ = 0; - scoped_ptr<ScopedFrameBufferBinder> fbo_binder_; + std::unique_ptr<ScopedFrameBufferBinder> fbo_binder_; DISALLOW_COPY_AND_ASSIGN(ScopedFrameBufferReadPixelHelper); }; @@ -527,7 +527,7 @@ DCHECK(fence); } std::vector<base::Closure> callbacks; - scoped_ptr<gfx::GLFence> fence; + std::unique_ptr<gfx::GLFence> fence; }; // } // anonymous namespace. @@ -1881,7 +1881,7 @@ return feature_info_->feature_flags(); } - const FeatureInfo::Workarounds& workarounds() const { + const GpuDriverBugWorkarounds& workarounds() const { return feature_info_->workarounds(); } @@ -2016,11 +2016,11 @@ // depth and stencil buffers are separate. With regular GL there is a single // packed depth stencil buffer in offscreen_target_depth_render_buffer_. // offscreen_target_stencil_render_buffer_ is unused. - scoped_ptr<BackFramebuffer> offscreen_target_frame_buffer_; - scoped_ptr<BackTexture> offscreen_target_color_texture_; - scoped_ptr<BackRenderbuffer> offscreen_target_color_render_buffer_; - scoped_ptr<BackRenderbuffer> offscreen_target_depth_render_buffer_; - scoped_ptr<BackRenderbuffer> offscreen_target_stencil_render_buffer_; + std::unique_ptr<BackFramebuffer> offscreen_target_frame_buffer_; + std::unique_ptr<BackTexture> offscreen_target_color_texture_; + std::unique_ptr<BackRenderbuffer> offscreen_target_color_render_buffer_; + std::unique_ptr<BackRenderbuffer> offscreen_target_depth_render_buffer_; + std::unique_ptr<BackRenderbuffer> offscreen_target_stencil_render_buffer_; GLenum offscreen_target_color_format_; GLenum offscreen_target_depth_format_; GLenum offscreen_target_stencil_format_; @@ -2028,21 +2028,21 @@ GLboolean offscreen_target_buffer_preserved_; // The copy that is saved when SwapBuffers is called. - scoped_ptr<BackFramebuffer> offscreen_saved_frame_buffer_; - scoped_ptr<BackTexture> offscreen_saved_color_texture_; + std::unique_ptr<BackFramebuffer> offscreen_saved_frame_buffer_; + std::unique_ptr<BackTexture> offscreen_saved_color_texture_; scoped_refptr<TextureRef> offscreen_saved_color_texture_info_; // The copy that is used as the destination for multi-sample resolves. - scoped_ptr<BackFramebuffer> offscreen_resolved_frame_buffer_; - scoped_ptr<BackTexture> offscreen_resolved_color_texture_; + std::unique_ptr<BackFramebuffer> offscreen_resolved_frame_buffer_; + std::unique_ptr<BackTexture> offscreen_resolved_color_texture_; GLenum offscreen_saved_color_format_; - scoped_ptr<QueryManager> query_manager_; + std::unique_ptr<QueryManager> query_manager_; - scoped_ptr<VertexArrayManager> vertex_array_manager_; + std::unique_ptr<VertexArrayManager> vertex_array_manager_; - scoped_ptr<ImageManager> image_manager_; + std::unique_ptr<ImageManager> image_manager_; FenceSyncReleaseCallback fence_sync_release_callback_; WaitFenceSyncCallback wait_fence_sync_callback_; @@ -2118,8 +2118,8 @@ TextureToIOSurfaceMap texture_to_io_surface_map_; #endif - scoped_ptr<CopyTextureCHROMIUMResourceManager> copy_texture_CHROMIUM_; - scoped_ptr<ClearFramebufferResourceManager> clear_framebuffer_blit_; + std::unique_ptr<CopyTextureCHROMIUMResourceManager> copy_texture_CHROMIUM_; + std::unique_ptr<ClearFramebufferResourceManager> clear_framebuffer_blit_; // Cached values of the currently assigned viewport dimensions. GLsizei viewport_max_width_; @@ -2132,8 +2132,8 @@ DecoderTextureState texture_state_; DecoderFramebufferState framebuffer_state_; - scoped_ptr<GPUTracer> gpu_tracer_; - scoped_ptr<GPUStateTracer> gpu_state_tracer_; + std::unique_ptr<GPUTracer> gpu_tracer_; + std::unique_ptr<GPUStateTracer> gpu_state_tracer_; const unsigned char* gpu_decoder_category_; int gpu_trace_level_; bool gpu_trace_commands_; @@ -2422,7 +2422,7 @@ return false; } - scoped_ptr<char[]> zero_data; + std::unique_ptr<char[]> zero_data; if (zero) { zero_data.reset(new char[image_size]); memset(zero_data.get(), 0, image_size); @@ -3447,7 +3447,7 @@ return false; } } - scoped_ptr<GLuint[]> service_ids(new GLuint[n]); + std::unique_ptr<GLuint[]> service_ids(new GLuint[n]); glGenBuffersARB(n, service_ids.get()); for (GLsizei ii = 0; ii < n; ++ii) { CreateBuffer(client_ids[ii], service_ids[ii]); @@ -3462,7 +3462,7 @@ return false; } } - scoped_ptr<GLuint[]> service_ids(new GLuint[n]); + std::unique_ptr<GLuint[]> service_ids(new GLuint[n]); glGenFramebuffersEXT(n, service_ids.get()); for (GLsizei ii = 0; ii < n; ++ii) { CreateFramebuffer(client_ids[ii], service_ids[ii]); @@ -3477,7 +3477,7 @@ return false; } } - scoped_ptr<GLuint[]> service_ids(new GLuint[n]); + std::unique_ptr<GLuint[]> service_ids(new GLuint[n]); glGenRenderbuffersEXT(n, service_ids.get()); for (GLsizei ii = 0; ii < n; ++ii) { CreateRenderbuffer(client_ids[ii], service_ids[ii]); @@ -3504,7 +3504,7 @@ return false; } } - scoped_ptr<GLuint[]> service_ids(new GLuint[n]); + std::unique_ptr<GLuint[]> service_ids(new GLuint[n]); glGenTextures(n, service_ids.get()); for (GLsizei ii = 0; ii < n; ++ii) { CreateTexture(client_ids[ii], service_ids[ii]); @@ -3518,7 +3518,7 @@ return false; } } - scoped_ptr<GLuint[]> service_ids(new GLuint[n]); + std::unique_ptr<GLuint[]> service_ids(new GLuint[n]); glGenSamplers(n, service_ids.get()); for (GLsizei ii = 0; ii < n; ++ii) { CreateSampler(client_ids[ii], service_ids[ii]); @@ -5111,7 +5111,7 @@ // If the default framebuffer is bound but we are still rendering to an // FBO, translate attachment names that refer to default framebuffer // channels to corresponding framebuffer attachments. - scoped_ptr<GLenum[]> translated_attachments(new GLenum[count]); + std::unique_ptr<GLenum[]> translated_attachments(new GLenum[count]); for (GLsizei i = 0; i < count; ++i) { GLenum attachment = attachments[i]; if (!framebuffer && GetBackbufferServiceId()) { @@ -5795,7 +5795,7 @@ DCHECK(params); GLsizei num_written = 0; if (GetNumValuesReturnedForGLGet(pname, &num_written)) { - scoped_ptr<GLint[]> values(new GLint[num_written]); + std::unique_ptr<GLint[]> values(new GLint[num_written]); if (!state_.GetStateAsGLint(pname, values.get(), &num_written)) { GetHelper(pname, values.get(), &num_written); } @@ -5813,7 +5813,7 @@ GLsizei num_written = 0; if (!state_.GetStateAsGLfloat(pname, params, &num_written)) { if (GetHelper(pname, NULL, &num_written)) { - scoped_ptr<GLint[]> values(new GLint[num_written]); + std::unique_ptr<GLint[]> values(new GLint[num_written]); GetHelper(pname, values.get(), &num_written); for (GLsizei ii = 0; ii < num_written; ++ii) { params[ii] = static_cast<GLfloat>(values[ii]); @@ -7477,7 +7477,7 @@ return; } if (type == GL_BOOL) { - scoped_ptr<GLint[]> temp(new GLint[count]); + std::unique_ptr<GLint[]> temp(new GLint[count]); for (GLsizei ii = 0; ii < count; ++ii) { temp[ii] = static_cast<GLint>(value[ii] != 0.0f); } @@ -7501,7 +7501,7 @@ } if (type == GL_BOOL_VEC2) { GLsizei num_values = count * 2; - scoped_ptr<GLint[]> temp(new GLint[num_values]); + std::unique_ptr<GLint[]> temp(new GLint[num_values]); for (GLsizei ii = 0; ii < num_values; ++ii) { temp[ii] = static_cast<GLint>(value[ii] != 0.0f); } @@ -7525,7 +7525,7 @@ } if (type == GL_BOOL_VEC3) { GLsizei num_values = count * 3; - scoped_ptr<GLint[]> temp(new GLint[num_values]); + std::unique_ptr<GLint[]> temp(new GLint[num_values]); for (GLsizei ii = 0; ii < num_values; ++ii) { temp[ii] = static_cast<GLint>(value[ii] != 0.0f); } @@ -7549,7 +7549,7 @@ } if (type == GL_BOOL_VEC4) { GLsizei num_values = count * 4; - scoped_ptr<GLint[]> temp(new GLint[num_values]); + std::unique_ptr<GLint[]> temp(new GLint[num_values]); for (GLsizei ii = 0; ii < num_values; ++ii) { temp[ii] = static_cast<GLint>(value[ii] != 0.0f); } @@ -8278,7 +8278,7 @@ int num_elements = attrib->size() * num_vertices; const int src_size = num_elements * sizeof(int32_t); const int dst_size = num_elements * sizeof(float); - scoped_ptr<float[]> data(new float[num_elements]); + std::unique_ptr<float[]> data(new float[num_elements]); const int32_t* src = reinterpret_cast<const int32_t*>( attrib->buffer()->GetRange(attrib->offset(), src_size)); const int32_t* end = src + num_elements; @@ -9681,7 +9681,7 @@ LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER("glReadPixels"); ScopedResolvedFrameBufferBinder binder(this, false, true); - scoped_ptr<ScopedFrameBufferReadPixelHelper> helper; + std::unique_ptr<ScopedFrameBufferReadPixelHelper> helper; if (NeedsIOSurfaceReadbackWorkaround()) helper.reset(new ScopedFrameBufferReadPixelHelper(&state_, this)); @@ -9960,9 +9960,17 @@ const void* cmd_data) { const gles2::cmds::ScheduleCALayerCHROMIUM& c = *static_cast<const gles2::cmds::ScheduleCALayerCHROMIUM*>(cmd_data); + GLuint filter = c.filter; + if (filter != GL_NEAREST && filter != GL_LINEAR) { + LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "glScheduleCALayerCHROMIUM", + "invalid filter"); + return error::kNoError; + } + gl::GLImage* image = nullptr; - if (c.contents_texture_id) { - TextureRef* ref = texture_manager()->GetTexture(c.contents_texture_id); + GLuint contents_texture_id = c.contents_texture_id; + if (contents_texture_id) { + TextureRef* ref = texture_manager()->GetTexture(contents_texture_id); if (!ref) { LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "glScheduleCALayerCHROMIUM", "unknown texture"); @@ -9990,10 +9998,10 @@ mem[13], mem[17], mem[21], mem[25], mem[14], mem[18], mem[22], mem[26], mem[15], mem[19], mem[23], mem[27]); - if (!surface_->ScheduleCALayer(image, contents_rect, c.opacity, - c.background_color, c.edge_aa_mask, - bounds_rect, c.is_clipped ? true : false, - clip_rect, transform, c.sorting_context_id)) { + if (!surface_->ScheduleCALayer( + image, contents_rect, c.opacity, c.background_color, c.edge_aa_mask, + bounds_rect, c.is_clipped ? true : false, clip_rect, transform, + c.sorting_context_id, filter)) { LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "glScheduleCALayerCHROMIUM", "failed to schedule CALayer"); } @@ -10480,7 +10488,7 @@ } // Assumes the size has already been checked. - scoped_ptr<char[]> zero(new char[size]); + std::unique_ptr<char[]> zero(new char[size]); memset(zero.get(), 0, size); glBindTexture(texture->target(), texture->service_id()); @@ -10592,7 +10600,7 @@ // Include padding as some drivers incorrectly requires padding for the // last row. buffer_size += padding; - scoped_ptr<char[]> zero(new char[buffer_size]); + std::unique_ptr<char[]> zero(new char[buffer_size]); memset(zero.get(), 0, buffer_size); // TODO(zmo): Consider glMapBufferRange instead. glBufferData( @@ -11102,7 +11110,7 @@ framebuffer_state_.clear_state_dirty = true; } - scoped_ptr<int8_t[]> zero; + std::unique_ptr<int8_t[]> zero; if (!data) { zero.reset(new int8_t[image_size]); memset(zero.get(), 0, image_size); @@ -11297,7 +11305,7 @@ framebuffer_state_.clear_state_dirty = true; } - scoped_ptr<int8_t[]> zero; + std::unique_ptr<int8_t[]> zero; if (!data) { zero.reset(new int8_t[image_size]); memset(zero.get(), 0, image_size); @@ -11863,7 +11871,7 @@ copyWidth != width || copyHeight != height) { // some part was clipped so clear the rect. - scoped_ptr<char[]> zero(new char[pixels_size]); + std::unique_ptr<char[]> zero(new char[pixels_size]); memset(zero.get(), 0, pixels_size); glTexImage2D(target, level, texture_manager()->AdjustTexInternalFormat(internal_format), @@ -12385,7 +12393,7 @@ if (result_type == GL_BOOL || result_type == GL_BOOL_VEC2 || result_type == GL_BOOL_VEC3 || result_type == GL_BOOL_VEC4) { GLsizei num_values = result_size / sizeof(GLfloat); - scoped_ptr<GLint[]> temp(new GLint[num_values]); + std::unique_ptr<GLint[]> temp(new GLint[num_values]); glGetUniformiv(service_id, real_location, temp.get()); GLfloat* dst = result->GetData(); for (GLsizei ii = 0; ii < num_values; ++ii) { @@ -12746,7 +12754,7 @@ if (shaders == NULL || binary == NULL) { return error::kOutOfBounds; } - scoped_ptr<GLuint[]> service_ids(new GLuint[n]); + std::unique_ptr<GLuint[]> service_ids(new GLuint[n]); for (GLsizei ii = 0; ii < n; ++ii) { Shader* shader = GetShader(shaders[ii]); if (!shader) { @@ -12971,7 +12979,7 @@ *static_cast<const gles2::cmds::GetRequestableExtensionsCHROMIUM*>( cmd_data); Bucket* bucket = CreateBucket(c.bucket_id); - scoped_refptr<FeatureInfo> info(new FeatureInfo()); + scoped_refptr<FeatureInfo> info(new FeatureInfo(workarounds())); DisallowedFeatures disallowed_features = feature_info_->disallowed_features(); disallowed_features.AllowExtensions(); info->Initialize(feature_info_->context_type(), disallowed_features); @@ -13585,7 +13593,7 @@ CreateVertexAttribManager(client_ids[ii], 0, true); } } else { - scoped_ptr<GLuint[]> service_ids(new GLuint[n]); + std::unique_ptr<GLuint[]> service_ids(new GLuint[n]); glGenVertexArraysOES(n, service_ids.get()); for (GLsizei ii = 0; ii < n; ++ii) { @@ -15489,7 +15497,7 @@ bool GetPathNameData(const Cmd& cmd, GLuint num_paths, GLenum path_name_type, - scoped_ptr<GLuint[]>* out_buffer) { + std::unique_ptr<GLuint[]>* out_buffer) { DCHECK(validators_->path_name_type.IsValid(path_name_type)); GLuint path_base = static_cast<GLuint>(cmd.pathBase); uint32_t shm_id = static_cast<uint32_t>(cmd.paths_shm_id); @@ -15576,7 +15584,7 @@ GLuint path_base, uint32_t shm_id, uint32_t shm_offset, - scoped_ptr<GLuint[]>* out_buffer) { + std::unique_ptr<GLuint[]>* out_buffer) { uint32_t paths_size = 0; if (!SafeMultiplyUint32(num_paths, sizeof(T), &paths_size)) { error_ = error::kOutOfBounds; @@ -15587,7 +15595,7 @@ error_ = error::kOutOfBounds; return false; } - scoped_ptr<GLuint[]> result_paths(new GLuint[num_paths]); + std::unique_ptr<GLuint[]> result_paths(new GLuint[num_paths]); bool has_paths = false; for (GLuint i = 0; i < num_paths; ++i) { GLuint service_id = 0; @@ -15702,7 +15710,7 @@ return error::kNoError; } - scoped_ptr<GLubyte[]> commands; + std::unique_ptr<GLubyte[]> commands; base::CheckedNumeric<GLsizei> num_coords_expected = 0; if (num_commands > 0) { @@ -16040,7 +16048,7 @@ if (num_paths == 0) return error::kNoError; - scoped_ptr<GLuint[]> paths; + std::unique_ptr<GLuint[]> paths; if (!v.GetPathNameData(c, num_paths, path_name_type, &paths)) return v.error(); @@ -16074,7 +16082,7 @@ if (num_paths == 0) return error::kNoError; - scoped_ptr<GLuint[]> paths; + std::unique_ptr<GLuint[]> paths; if (!v.GetPathNameData(c, num_paths, path_name_type, &paths)) return v.error(); @@ -16112,7 +16120,7 @@ if (num_paths == 0) return error::kNoError; - scoped_ptr<GLuint[]> paths; + std::unique_ptr<GLuint[]> paths; if (!v.GetPathNameData(c, num_paths, path_name_type, &paths)) return v.error(); @@ -16148,7 +16156,7 @@ if (num_paths == 0) return error::kNoError; - scoped_ptr<GLuint[]> paths; + std::unique_ptr<GLuint[]> paths; if (!v.GetPathNameData(c, num_paths, path_name_type, &paths)) return v.error(); @@ -16188,7 +16196,7 @@ if (num_paths == 0) return error::kNoError; - scoped_ptr<GLuint[]> paths; + std::unique_ptr<GLuint[]> paths; if (!v.GetPathNameData(c, num_paths, path_name_type, &paths)) return v.error(); @@ -16227,7 +16235,7 @@ if (num_paths == 0) return error::kNoError; - scoped_ptr<GLuint[]> paths; + std::unique_ptr<GLuint[]> paths; if (!v.GetPathNameData(c, num_paths, path_name_type, &paths)) return v.error();
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h b/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h index 54b8dcf..601f5d8 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h +++ b/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h
@@ -1310,7 +1310,7 @@ return error::kInvalidArguments; } } - scoped_ptr<GLuint[]> service_ids(new GLuint[n]); + std::unique_ptr<GLuint[]> service_ids(new GLuint[n]); glGenTransformFeedbacks(n, service_ids.get()); for (GLsizei ii = 0; ii < n; ++ii) { group_->AddTransformFeedbackId(ids[ii], service_ids[ii]);
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc index cbe3112b..12010b1 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
@@ -8,6 +8,7 @@ #include <stdint.h> #include <algorithm> +#include <memory> #include <string> #include <vector> @@ -188,15 +189,17 @@ SetupMockGLBehaviors(); - scoped_refptr<FeatureInfo> feature_info; - if (command_line) - feature_info = new FeatureInfo(*command_line); - group_ = scoped_refptr<ContextGroup>( - new ContextGroup(gpu_preferences_, NULL, memory_tracker_, - new ShaderTranslatorCache(gpu_preferences_), - new FramebufferCompletenessCache, feature_info.get(), - new SubscriptionRefSet, new ValueStateMap, - normalized_init.bind_generates_resource)); + scoped_refptr<FeatureInfo> feature_info = new FeatureInfo; + if (command_line) { + GpuDriverBugWorkarounds gpu_driver_bug_workaround(command_line); + feature_info = new FeatureInfo(*command_line, gpu_driver_bug_workaround); + } + + group_ = scoped_refptr<ContextGroup>(new ContextGroup( + gpu_preferences_, NULL, memory_tracker_, + new ShaderTranslatorCache(gpu_preferences_), + new FramebufferCompletenessCache, feature_info, new SubscriptionRefSet, + new ValueStateMap, normalized_init.bind_generates_resource)); bool use_default_textures = normalized_init.bind_generates_resource; InSequence sequence; @@ -645,7 +648,7 @@ char str_end) { uint32_t header_size = sizeof(GLint) * (count + 1); uint32_t total_size = header_size; - scoped_ptr<GLint[]> header(new GLint[count + 1]); + std::unique_ptr<GLint[]> header(new GLint[count + 1]); header[0] = static_cast<GLint>(count_in_header); for (GLsizei ii = 0; ii < count; ++ii) { header[ii + 1] = str && str[ii] ? strlen(str[ii]) : 0; @@ -1987,8 +1990,7 @@ GLES2DecoderWithShaderTestBase::MockCommandBufferEngine:: MockCommandBufferEngine() { - - scoped_ptr<base::SharedMemory> shm(new base::SharedMemory()); + std::unique_ptr<base::SharedMemory> shm(new base::SharedMemory()); shm->CreateAndMapAnonymous(kSharedBufferSize); valid_buffer_ = MakeBufferFromSharedMemory(std::move(shm), kSharedBufferSize);
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h index 3756eac..a80e70d5 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h +++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h
@@ -8,6 +8,8 @@ #include <stddef.h> #include <stdint.h> +#include <memory> + #include "base/message_loop/message_loop.h" #include "gpu/command_buffer/common/gles2_cmd_format.h" #include "gpu/command_buffer/common/gles2_cmd_utils.h" @@ -631,11 +633,11 @@ static const char* kOutputVariable1NameESSL3; // Use StrictMock to make 100% sure we know how GL will be called. - scoped_ptr< ::testing::StrictMock< ::gfx::MockGLInterface> > gl_; + std::unique_ptr<::testing::StrictMock<::gfx::MockGLInterface>> gl_; scoped_refptr<gfx::GLSurfaceStub> surface_; scoped_refptr<GLContextMock> context_; - scoped_ptr<MockGLES2Decoder> mock_decoder_; - scoped_ptr<GLES2Decoder> decoder_; + std::unique_ptr<MockGLES2Decoder> mock_decoder_; + std::unique_ptr<GLES2Decoder> decoder_; MemoryTracker* memory_tracker_; GLuint client_buffer_id_; @@ -758,7 +760,7 @@ void SetupInitStateManualExpectations(bool es3_capable); - scoped_ptr< ::testing::StrictMock<MockCommandBufferEngine> > engine_; + std::unique_ptr<::testing::StrictMock<MockCommandBufferEngine>> engine_; GpuPreferences gpu_preferences_; scoped_refptr<ContextGroup> group_; MockGLStates gl_states_;
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_framebuffers.cc b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_framebuffers.cc index f021289..258d63d4 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_framebuffers.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_framebuffers.cc
@@ -8,6 +8,8 @@ #include <stddef.h> #include <stdint.h> +#include <memory> + #include "base/command_line.h" #include "base/strings/string_number_conversions.h" #include "gpu/command_buffer/common/gles2_cmd_format.h" @@ -572,8 +574,8 @@ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); GLint unpadded_row_size = emu.ComputeImageDataSize(in_read_width, 1); - scoped_ptr<int8_t[]> zero(new int8_t[unpadded_row_size]); - scoped_ptr<int8_t[]> pack(new int8_t[kPackAlignment]); + std::unique_ptr<int8_t[]> zero(new int8_t[unpadded_row_size]); + std::unique_ptr<int8_t[]> pack(new int8_t[kPackAlignment]); memset(zero.get(), kInitialMemoryValue, unpadded_row_size); memset(pack.get(), kInitialMemoryValue, kPackAlignment); for (GLint yy = 0; yy < in_read_height; ++yy) {
diff --git a/gpu/command_buffer/service/gpu_service_test.h b/gpu/command_buffer/service/gpu_service_test.h index e547ff1..701eeb22 100644 --- a/gpu/command_buffer/service/gpu_service_test.h +++ b/gpu/command_buffer/service/gpu_service_test.h
@@ -5,8 +5,9 @@ #ifndef GPU_COMMAND_BUFFER_SERVICE_GPU_SERVICE_TEST_H_ #define GPU_COMMAND_BUFFER_SERVICE_GPU_SERVICE_TEST_H_ +#include <memory> + #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "base/message_loop/message_loop.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" @@ -31,7 +32,7 @@ void TearDown() override; gfx::GLContext* GetGLContext(); - scoped_ptr< ::testing::StrictMock< ::gfx::MockGLInterface> > gl_; + std::unique_ptr<::testing::StrictMock<::gfx::MockGLInterface>> gl_; private: bool ran_setup_;
diff --git a/gpu/command_buffer/service/gpu_state_tracer.cc b/gpu/command_buffer/service/gpu_state_tracer.cc index add3bf3..f26d3df 100644 --- a/gpu/command_buffer/service/gpu_state_tracer.cc +++ b/gpu/command_buffer/service/gpu_state_tracer.cc
@@ -6,6 +6,7 @@ #include "base/base64.h" #include "base/macros.h" +#include "base/memory/ptr_util.h" #include "base/trace_event/trace_event.h" #include "context_state.h" #include "ui/gfx/codec/png_codec.h" @@ -19,7 +20,7 @@ class Snapshot : public base::trace_event::ConvertableToTraceFormat { public: - static scoped_ptr<Snapshot> Create(const ContextState* state); + static std::unique_ptr<Snapshot> Create(const ContextState* state); ~Snapshot() override {} @@ -44,8 +45,8 @@ Snapshot::Snapshot(const ContextState* state) : state_(state) {} -scoped_ptr<Snapshot> Snapshot::Create(const ContextState* state) { - return make_scoped_ptr(new Snapshot(state)); +std::unique_ptr<Snapshot> Snapshot::Create(const ContextState* state) { + return base::WrapUnique(new Snapshot(state)); } bool Snapshot::SaveScreenshot(const gfx::Size& size) { @@ -99,8 +100,9 @@ *out += "}"; } -scoped_ptr<GPUStateTracer> GPUStateTracer::Create(const ContextState* state) { - return scoped_ptr<GPUStateTracer>(new GPUStateTracer(state)); +std::unique_ptr<GPUStateTracer> GPUStateTracer::Create( + const ContextState* state) { + return std::unique_ptr<GPUStateTracer>(new GPUStateTracer(state)); } GPUStateTracer::GPUStateTracer(const ContextState* state) : state_(state) { @@ -117,7 +119,7 @@ TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("gpu.debug"), "GPUStateTracer::TakeSnapshotWithCurrentFramebuffer"); - scoped_ptr<Snapshot> snapshot(Snapshot::Create(state_)); + std::unique_ptr<Snapshot> snapshot(Snapshot::Create(state_)); // Only save a screenshot for now. if (!snapshot->SaveScreenshot(size))
diff --git a/gpu/command_buffer/service/gpu_state_tracer.h b/gpu/command_buffer/service/gpu_state_tracer.h index 1cb7fe92..09a873bd 100644 --- a/gpu/command_buffer/service/gpu_state_tracer.h +++ b/gpu/command_buffer/service/gpu_state_tracer.h
@@ -5,8 +5,9 @@ #ifndef GPU_COMMAND_BUFFER_SERVICE_GPU_STATE_TRACER_H_ #define GPU_COMMAND_BUFFER_SERVICE_GPU_STATE_TRACER_H_ +#include <memory> + #include "base/macros.h" -#include "base/memory/scoped_ptr.h" namespace gfx { class Size; @@ -20,7 +21,7 @@ // Saves GPU state such as framebuffer contents while tracing. class GPUStateTracer { public: - static scoped_ptr<GPUStateTracer> Create(const ContextState* state); + static std::unique_ptr<GPUStateTracer> Create(const ContextState* state); ~GPUStateTracer(); // Take a state snapshot with a screenshot of the currently bound framebuffer.
diff --git a/gpu/command_buffer/service/gpu_tracer.h b/gpu/command_buffer/service/gpu_tracer.h index 41fd291..438c9cbb 100644 --- a/gpu/command_buffer/service/gpu_tracer.h +++ b/gpu/command_buffer/service/gpu_tracer.h
@@ -9,12 +9,12 @@ #include <stdint.h> #include <deque> +#include <memory> #include <stack> #include <string> #include <vector> #include "base/macros.h" -#include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/threading/thread.h" #include "gpu/command_buffer/service/gles2_cmd_decoder.h" @@ -193,7 +193,7 @@ const std::string category_; const std::string name_; scoped_refptr<Outputter> outputter_; - scoped_ptr<gfx::GPUTimer> gpu_timer_; + std::unique_ptr<gfx::GPUTimer> gpu_timer_; const bool service_enabled_ = false; const bool device_enabled_ = false;
diff --git a/gpu/command_buffer/service/gpu_tracer_unittest.cc b/gpu/command_buffer/service/gpu_tracer_unittest.cc index 760818d1..16150742 100644 --- a/gpu/command_buffer/service/gpu_tracer_unittest.cc +++ b/gpu/command_buffer/service/gpu_tracer_unittest.cc
@@ -747,8 +747,8 @@ decoder_ = nullptr; GpuServiceTest::TearDown(); } - scoped_ptr<MockGLES2Decoder> decoder_; - scoped_ptr<GPUTracerTester> tracer_tester_; + std::unique_ptr<MockGLES2Decoder> decoder_; + std::unique_ptr<GPUTracerTester> tracer_tester_; }; TEST_F(GPUTracerTest, IsTracingTest) {
diff --git a/gpu/command_buffer/service/in_process_command_buffer.cc b/gpu/command_buffer/service/in_process_command_buffer.cc index c1d4620..11a8b121 100644 --- a/gpu/command_buffer/service/in_process_command_buffer.cc +++ b/gpu/command_buffer/service/in_process_command_buffer.cc
@@ -85,7 +85,7 @@ GpuInProcessThreadHolder() : sync_point_manager(new SyncPointManager(false)), gpu_thread(new GpuInProcessThread(sync_point_manager.get())) {} - scoped_ptr<SyncPointManager> sync_point_manager; + std::unique_ptr<SyncPointManager> sync_point_manager; scoped_refptr<InProcessCommandBuffer::Service> gpu_thread; }; @@ -147,10 +147,12 @@ } // anonyous namespace -InProcessCommandBuffer::Service::Service() {} +InProcessCommandBuffer::Service::Service() + : gpu_driver_bug_workarounds_(base::CommandLine::ForCurrentProcess()) {} InProcessCommandBuffer::Service::Service(const GpuPreferences& gpu_preferences) - : gpu_preferences_(gpu_preferences) {} + : gpu_preferences_(gpu_preferences), + gpu_driver_bug_workarounds_(base::CommandLine::ForCurrentProcess()) {} InProcessCommandBuffer::Service::~Service() {} @@ -159,6 +161,11 @@ return gpu_preferences_; } +const gpu::GpuDriverBugWorkarounds& +InProcessCommandBuffer::Service::gpu_driver_bug_workarounds() { + return gpu_driver_bug_workarounds_; +} + scoped_refptr<gfx::GLShareGroup> InProcessCommandBuffer::Service::share_group() { if (!share_group_.get()) @@ -320,7 +327,7 @@ transfer_buffer_manager_ = manager; manager->Initialize(); - scoped_ptr<CommandBufferService> command_buffer( + std::unique_ptr<CommandBufferService> command_buffer( new CommandBufferService(transfer_buffer_manager_.get())); command_buffer->SetPutOffsetChangeCallback(base::Bind( &InProcessCommandBuffer::PumpCommandsOnGpuThread, gpu_thread_weak_ptr_)); @@ -338,16 +345,18 @@ : service_->share_group(); bool bind_generates_resource = false; + scoped_refptr<gles2::FeatureInfo> feature_info = + new gles2::FeatureInfo(service_->gpu_driver_bug_workarounds()); decoder_.reset(gles2::GLES2Decoder::Create( params.context_group ? params.context_group->decoder_->GetContextGroup() - : new gles2::ContextGroup(service_->gpu_preferences(), - service_->mailbox_manager(), NULL, - service_->shader_translator_cache(), - service_->framebuffer_completeness_cache(), - NULL, service_->subscription_ref_set(), - service_->pending_valuebuffer_state(), - bind_generates_resource))); + : new gles2::ContextGroup( + service_->gpu_preferences(), service_->mailbox_manager(), NULL, + service_->shader_translator_cache(), + service_->framebuffer_completeness_cache(), feature_info, + service_->subscription_ref_set(), + service_->pending_valuebuffer_state(), + bind_generates_resource))); executor_.reset(new CommandExecutor(command_buffer.get(), decoder_.get(), decoder_.get())); @@ -830,7 +839,7 @@ CheckSequencedThread(); DCHECK(gpu_memory_buffer_manager_); - scoped_ptr<gfx::GpuMemoryBuffer> buffer( + std::unique_ptr<gfx::GpuMemoryBuffer> buffer( gpu_memory_buffer_manager_->AllocateGpuMemoryBuffer( gfx::Size(width, height), gpu::DefaultBufferFormatForImageFormat(internalformat), @@ -1005,7 +1014,7 @@ } } -void RunOnTargetThread(scoped_ptr<base::Closure> callback) { +void RunOnTargetThread(std::unique_ptr<base::Closure> callback) { DCHECK(callback.get()); callback->Run(); } @@ -1016,7 +1025,7 @@ const base::Closure& callback) { // Make sure the callback gets deleted on the target thread by passing // ownership. - scoped_ptr<base::Closure> scoped_callback(new base::Closure(callback)); + std::unique_ptr<base::Closure> scoped_callback(new base::Closure(callback)); base::Closure callback_on_client_thread = base::Bind(&RunOnTargetThread, base::Passed(&scoped_callback)); base::Closure wrapped_callback =
diff --git a/gpu/command_buffer/service/in_process_command_buffer.h b/gpu/command_buffer/service/in_process_command_buffer.h index e8ccb33..a022db25 100644 --- a/gpu/command_buffer/service/in_process_command_buffer.h +++ b/gpu/command_buffer/service/in_process_command_buffer.h
@@ -9,6 +9,7 @@ #include <stdint.h> #include <map> +#include <memory> #include <vector> #include "base/atomic_sequence_num.h" @@ -17,7 +18,6 @@ #include "base/containers/scoped_ptr_hash_map.h" #include "base/macros.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/single_thread_task_runner.h" #include "base/synchronization/lock.h" @@ -26,6 +26,7 @@ #include "gpu/command_buffer/client/gpu_control.h" #include "gpu/command_buffer/common/command_buffer.h" #include "gpu/command_buffer/service/gpu_preferences.h" +#include "gpu/config/gpu_driver_bug_workarounds.h" #include "gpu/gpu_export.h" #include "ui/gfx/gpu_memory_buffer.h" #include "ui/gfx/native_widget_types.h" @@ -134,7 +135,7 @@ class Service { public: Service(); - explicit Service(const gpu::GpuPreferences& gpu_preferences); + Service(const gpu::GpuPreferences& gpu_preferences); virtual ~Service(); virtual void AddRef() const = 0; @@ -154,6 +155,7 @@ framebuffer_completeness_cache() = 0; virtual SyncPointManager* sync_point_manager() = 0; const GpuPreferences& gpu_preferences(); + const GpuDriverBugWorkarounds& gpu_driver_bug_workarounds(); scoped_refptr<gfx::GLShareGroup> share_group(); scoped_refptr<gles2::MailboxManager> mailbox_manager(); scoped_refptr<gles2::SubscriptionRefSet> subscription_ref_set(); @@ -162,11 +164,12 @@ private: const GpuPreferences gpu_preferences_; + const GpuDriverBugWorkarounds gpu_driver_bug_workarounds_; scoped_refptr<gfx::GLShareGroup> share_group_; scoped_refptr<gles2::MailboxManager> mailbox_manager_; scoped_refptr<gles2::SubscriptionRefSet> subscription_ref_set_; scoped_refptr<gpu::ValueStateMap> pending_valuebuffer_state_; - scoped_ptr<gpu::gles2::ProgramCache> program_cache_; + std::unique_ptr<gpu::gles2::ProgramCache> program_cache_; }; private: @@ -239,12 +242,12 @@ // creation): scoped_refptr<base::SingleThreadTaskRunner> origin_task_runner_; scoped_refptr<TransferBufferManagerInterface> transfer_buffer_manager_; - scoped_ptr<CommandExecutor> executor_; - scoped_ptr<gles2::GLES2Decoder> decoder_; + std::unique_ptr<CommandExecutor> executor_; + std::unique_ptr<gles2::GLES2Decoder> decoder_; scoped_refptr<gfx::GLContext> context_; scoped_refptr<gfx::GLSurface> surface_; scoped_refptr<SyncPointOrderData> sync_point_order_data_; - scoped_ptr<SyncPointClient> sync_point_client_; + std::unique_ptr<SyncPointClient> sync_point_client_; base::Closure context_lost_callback_; // Used to throttle PerformDelayedWorkOnGpuThread. bool delayed_work_pending_; @@ -264,7 +267,7 @@ uint64_t flushed_fence_sync_release_; // Accessed on both threads: - scoped_ptr<CommandBufferServiceBase> command_buffer_; + std::unique_ptr<CommandBufferServiceBase> command_buffer_; base::Lock command_buffer_lock_; base::WaitableEvent flush_event_; scoped_refptr<Service> service_; @@ -275,7 +278,7 @@ // Only used with explicit scheduling and the gpu thread is the same as // the client thread. - scoped_ptr<base::SequenceChecker> sequence_checker_; + std::unique_ptr<base::SequenceChecker> sequence_checker_; base::WeakPtr<InProcessCommandBuffer> client_thread_weak_ptr_; base::WeakPtr<InProcessCommandBuffer> gpu_thread_weak_ptr_;
diff --git a/gpu/command_buffer/service/memory_program_cache.cc b/gpu/command_buffer/service/memory_program_cache.cc index ced200d5..4cd3fd2e 100644 --- a/gpu/command_buffer/service/memory_program_cache.cc +++ b/gpu/command_buffer/service/memory_program_cache.cc
@@ -214,7 +214,7 @@ shader_b->set_output_variable_list(value->output_variable_list_1()); if (!shader_callback.is_null() && !disable_gpu_shader_disk_cache_) { - scoped_ptr<GpuProgramProto> proto( + std::unique_ptr<GpuProgramProto> proto( GpuProgramProto::default_instance().New()); proto->set_sha(sha, kHashLength); proto->set_format(value->format()); @@ -242,7 +242,7 @@ if (length == 0 || static_cast<unsigned int>(length) > max_size_bytes_) { return; } - scoped_ptr<char[]> binary(new char[length]); + std::unique_ptr<char[]> binary(new char[length]); glGetProgramBinary(program, length, NULL, @@ -283,7 +283,7 @@ } if (!shader_callback.is_null() && !disable_gpu_shader_disk_cache_) { - scoped_ptr<GpuProgramProto> proto( + std::unique_ptr<GpuProgramProto> proto( GpuProgramProto::default_instance().New()); proto->set_sha(sha, kHashLength); proto->set_format(format); @@ -308,7 +308,8 @@ } void MemoryProgramCache::LoadProgram(const std::string& program) { - scoped_ptr<GpuProgramProto> proto(GpuProgramProto::default_instance().New()); + std::unique_ptr<GpuProgramProto> proto( + GpuProgramProto::default_instance().New()); if (proto->ParseFromString(program)) { AttributeMap vertex_attribs; UniformMap vertex_uniforms; @@ -353,7 +354,7 @@ &fragment_output_variables); } - scoped_ptr<char[]> binary(new char[proto->program().length()]); + std::unique_ptr<char[]> binary(new char[proto->program().length()]); memcpy(binary.get(), proto->program().c_str(), proto->program().length()); store_.Put(
diff --git a/gpu/command_buffer/service/memory_program_cache.h b/gpu/command_buffer/service/memory_program_cache.h index 14d3ac0..6710c1c 100644 --- a/gpu/command_buffer/service/memory_program_cache.h +++ b/gpu/command_buffer/service/memory_program_cache.h
@@ -8,13 +8,13 @@ #include <stddef.h> #include <map> +#include <memory> #include <string> #include "base/containers/hash_tables.h" #include "base/containers/mru_cache.h" #include "base/macros.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "gpu/command_buffer/service/gles2_cmd_decoder.h" #include "gpu/command_buffer/service/program_cache.h" @@ -130,7 +130,7 @@ const GLsizei length_; const GLenum format_; - const scoped_ptr<const char[]> data_; + const std::unique_ptr<const char[]> data_; const std::string program_hash_; const std::string shader_0_hash_; const AttributeMap attrib_map_0_;
diff --git a/gpu/command_buffer/service/memory_program_cache_unittest.cc b/gpu/command_buffer/service/memory_program_cache_unittest.cc index 7662942..a4a78c62 100644 --- a/gpu/command_buffer/service/memory_program_cache_unittest.cc +++ b/gpu/command_buffer/service/memory_program_cache_unittest.cc
@@ -7,6 +7,8 @@ #include <stddef.h> #include <stdint.h> +#include <memory> + #include "base/bind.h" #include "gpu/command_buffer/common/gles2_cmd_format.h" #include "gpu/command_buffer/service/gl_utils.h" @@ -182,7 +184,7 @@ .WillOnce(SetArgPointee<2>(GL_FALSE)); } - scoped_ptr<MemoryProgramCache> cache_; + std::unique_ptr<MemoryProgramCache> cache_; ShaderManager shader_manager_; Shader* vertex_shader_; Shader* fragment_shader_; @@ -560,8 +562,8 @@ fragment_shader_->set_source("al sdfkjdk"); TestHelper::SetShaderStates(gl_.get(), fragment_shader_, true); - scoped_ptr<char[]> bigTestBinary = - scoped_ptr<char[]>(new char[kEvictingBinaryLength]); + std::unique_ptr<char[]> bigTestBinary = + std::unique_ptr<char[]>(new char[kEvictingBinaryLength]); for (size_t i = 0; i < kEvictingBinaryLength; ++i) { bigTestBinary[i] = i % 250; }
diff --git a/gpu/command_buffer/service/path_manager_unittest.cc b/gpu/command_buffer/service/path_manager_unittest.cc index 8a20db5b..236a74d7 100644 --- a/gpu/command_buffer/service/path_manager_unittest.cc +++ b/gpu/command_buffer/service/path_manager_unittest.cc
@@ -4,7 +4,8 @@ #include "gpu/command_buffer/service/path_manager.h" -#include "base/memory/scoped_ptr.h" +#include <memory> + #include "gpu/command_buffer/service/gpu_service_test.h" #include "gpu/command_buffer/service/mocks.h" #include "testing/gtest/include/gtest/gtest.h" @@ -29,7 +30,7 @@ GpuServiceTest::TearDown(); } - scoped_ptr<PathManager> manager_; + std::unique_ptr<PathManager> manager_; }; TEST_F(PathManagerTest, Basic) {
diff --git a/gpu/command_buffer/service/program_cache.cc b/gpu/command_buffer/service/program_cache.cc index 56c84b86..b542f18 100644 --- a/gpu/command_buffer/service/program_cache.cc +++ b/gpu/command_buffer/service/program_cache.cc
@@ -6,8 +6,9 @@ #include <stddef.h> +#include <memory> #include <string> -#include "base/memory/scoped_ptr.h" + #include "gpu/command_buffer/service/shader_manager.h" #include "third_party/angle/src/common/version.h" @@ -123,7 +124,7 @@ const size_t total_size = shader0_size + shader1_size + angle_commit_size + map_size + var_size + sizeof(transform_feedback_buffer_mode); - scoped_ptr<unsigned char[]> buffer(new unsigned char[total_size]); + std::unique_ptr<unsigned char[]> buffer(new unsigned char[total_size]); memcpy(buffer.get(), hashed_shader_0, shader0_size); memcpy(&buffer[shader0_size], hashed_shader_1, shader1_size); size_t current_pos = shader0_size + shader1_size;
diff --git a/gpu/command_buffer/service/program_cache_unittest.cc b/gpu/command_buffer/service/program_cache_unittest.cc index f4949ce..6cb32bc9 100644 --- a/gpu/command_buffer/service/program_cache_unittest.cc +++ b/gpu/command_buffer/service/program_cache_unittest.cc
@@ -4,7 +4,8 @@ #include "gpu/command_buffer/service/program_cache.h" -#include "base/memory/scoped_ptr.h" +#include <memory> + #include "gpu/command_buffer/service/mocks.h" #include "testing/gtest/include/gtest/gtest.h" @@ -91,7 +92,7 @@ cache_(new NoBackendProgramCache()) { } protected: - scoped_ptr<NoBackendProgramCache> cache_; + std::unique_ptr<NoBackendProgramCache> cache_; std::vector<std::string> varyings_; };
diff --git a/gpu/command_buffer/service/program_manager.cc b/gpu/command_buffer/service/program_manager.cc index 91d4991..2ff07c5 100644 --- a/gpu/command_buffer/service/program_manager.cc +++ b/gpu/command_buffer/service/program_manager.cc
@@ -8,6 +8,7 @@ #include <stdint.h> #include <algorithm> +#include <memory> #include <set> #include <utility> #include <vector> @@ -15,7 +16,6 @@ #include "base/command_line.h" #include "base/containers/hash_tables.h" #include "base/logging.h" -#include "base/memory/scoped_ptr.h" #include "base/metrics/histogram.h" #include "base/numerics/safe_math.h" #include "base/strings/string_number_conversions.h" @@ -320,7 +320,7 @@ set_log_info(NULL); return; } - scoped_ptr<char[]> temp(new char[max_len]); + std::unique_ptr<char[]> temp(new char[max_len]); GLint len = 0; glGetProgramInfoLog(service_id_, max_len, &len, temp.get()); DCHECK(max_len == 0 || len < max_len); @@ -464,7 +464,7 @@ glGetProgramiv(service_id_, GL_ACTIVE_ATTRIBUTES, &num_attribs); glGetProgramiv(service_id_, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &max_len); // TODO(gman): Should we check for error? - scoped_ptr<char[]> name_buffer(new char[max_len]); + std::unique_ptr<char[]> name_buffer(new char[max_len]); for (GLint ii = 0; ii < num_attribs; ++ii) { GLsizei length = 0; GLsizei size = 0; @@ -552,7 +552,7 @@ glGetProgramiv(service_id_, GL_ACTIVE_UNIFORM_MAX_LENGTH, &name_buffer_length); DCHECK(name_buffer_length > 0); - scoped_ptr<char[]> name_buffer(new char[name_buffer_length]); + std::unique_ptr<char[]> name_buffer(new char[name_buffer_length]); size_t unused_client_location_cursor = 0; @@ -726,7 +726,7 @@ &max_len); DCHECK(max_len > 0); - scoped_ptr<char[]> name_buffer(new char[max_len]); + std::unique_ptr<char[]> name_buffer(new char[max_len]); Shader* fragment_shader = attached_shaders_[ShaderTypeToIndex(GL_FRAGMENT_SHADER)].get(); @@ -1787,7 +1787,7 @@ if (combined_map.size() == 0) return true; - scoped_ptr<ShVariableInfo[]> variables( + std::unique_ptr<ShVariableInfo[]> variables( new ShVariableInfo[combined_map.size()]); size_t index = 0; for (const auto& key_value : combined_map) {
diff --git a/gpu/command_buffer/service/program_manager.h b/gpu/command_buffer/service/program_manager.h index 1d0c991..05072de 100644 --- a/gpu/command_buffer/service/program_manager.h +++ b/gpu/command_buffer/service/program_manager.h
@@ -9,8 +9,10 @@ #include <stdint.h> #include <map> +#include <memory> #include <string> #include <vector> + #include "base/logging.h" #include "base/macros.h" #include "base/memory/ref_counted.h" @@ -506,7 +508,7 @@ bool uniforms_cleared_; // Log info - scoped_ptr<std::string> log_info_; + std::unique_ptr<std::string> log_info_; // attribute-location binding map from glBindAttribLocation() calls. LocationMap bind_attrib_location_map_;
diff --git a/gpu/command_buffer/service/program_manager_unittest.cc b/gpu/command_buffer/service/program_manager_unittest.cc index 088342b..5fcb3dcb 100644 --- a/gpu/command_buffer/service/program_manager_unittest.cc +++ b/gpu/command_buffer/service/program_manager_unittest.cc
@@ -8,9 +8,9 @@ #include <stdint.h> #include <algorithm> +#include <memory> #include "base/command_line.h" -#include "base/memory/scoped_ptr.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" #include "gpu/command_buffer/common/gles2_cmd_format.h" @@ -86,7 +86,7 @@ GpuServiceTest::TearDown(); } - scoped_ptr<ProgramManager> manager_; + std::unique_ptr<ProgramManager> manager_; GpuPreferences gpu_preferences_; scoped_refptr<FeatureInfo> feature_info_; }; @@ -2118,7 +2118,7 @@ .Times(1); } - scoped_ptr<MockProgramCache> cache_; + std::unique_ptr<MockProgramCache> cache_; Shader* vertex_shader_; Shader* fragment_shader_;
diff --git a/gpu/command_buffer/service/query_manager.cc b/gpu/command_buffer/service/query_manager.cc index c2cd4ec..5d86dcf 100644 --- a/gpu/command_buffer/service/query_manager.cc +++ b/gpu/command_buffer/service/query_manager.cc
@@ -479,7 +479,7 @@ ~CommandsCompletedQuery() override; private: - scoped_ptr<gfx::GLFence> fence_; + std::unique_ptr<gfx::GLFence> fence_; base::TimeTicks begin_time_; }; @@ -559,7 +559,7 @@ ~TimeElapsedQuery() override; private: - scoped_ptr<gfx::GPUTimer> gpu_timer_; + std::unique_ptr<gfx::GPUTimer> gpu_timer_; }; TimeElapsedQuery::TimeElapsedQuery(QueryManager* manager, @@ -636,7 +636,7 @@ ~TimeStampQuery() override; private: - scoped_ptr<gfx::GPUTimer> gpu_timer_; + std::unique_ptr<gfx::GPUTimer> gpu_timer_; }; TimeStampQuery::TimeStampQuery(QueryManager* manager, @@ -809,7 +809,7 @@ return query.get(); } -scoped_ptr<gfx::GPUTimer> QueryManager::CreateGPUTimer(bool elapsed_time) { +std::unique_ptr<gfx::GPUTimer> QueryManager::CreateGPUTimer(bool elapsed_time) { return gpu_timing_client_->CreateGPUTimer(elapsed_time); }
diff --git a/gpu/command_buffer/service/query_manager.h b/gpu/command_buffer/service/query_manager.h index f9f6816a..f09339b 100644 --- a/gpu/command_buffer/service/query_manager.h +++ b/gpu/command_buffer/service/query_manager.h
@@ -8,13 +8,14 @@ #include <stdint.h> #include <deque> +#include <memory> #include <vector> + #include "base/atomicops.h" #include "base/containers/hash_tables.h" #include "base/logging.h" #include "base/macros.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "gpu/command_buffer/service/feature_info.h" #include "gpu/gpu_export.h" @@ -261,7 +262,7 @@ return decoder_; } - scoped_ptr<gfx::GPUTimer> CreateGPUTimer(bool elapsed_time); + std::unique_ptr<gfx::GPUTimer> CreateGPUTimer(bool elapsed_time); bool GPUTimingAvailable(); void GenQueries(GLsizei n, const GLuint* queries);
diff --git a/gpu/command_buffer/service/query_manager_unittest.cc b/gpu/command_buffer/service/query_manager_unittest.cc index 8f61ff2..351f9b0 100644 --- a/gpu/command_buffer/service/query_manager_unittest.cc +++ b/gpu/command_buffer/service/query_manager_unittest.cc
@@ -5,6 +5,8 @@ #include <stddef.h> #include <stdint.h> +#include <memory> + #include "gpu/command_buffer/common/gles2_cmd_format.h" #include "gpu/command_buffer/service/cmd_buffer_engine.h" #include "gpu/command_buffer/service/error_state_mock.h" @@ -97,19 +99,21 @@ EXPECT_TRUE(manager_->EndQuery(query, submit_count)); } - scoped_ptr<MockGLES2Decoder> decoder_; - scoped_ptr<QueryManager> manager_; + std::unique_ptr<MockGLES2Decoder> decoder_; + std::unique_ptr<QueryManager> manager_; private: class MockCommandBufferEngine : public CommandBufferEngine { public: MockCommandBufferEngine() { - scoped_ptr<base::SharedMemory> shared_memory(new base::SharedMemory()); + std::unique_ptr<base::SharedMemory> shared_memory( + new base::SharedMemory()); shared_memory->CreateAndMapAnonymous(kSharedBufferSize); valid_buffer_ = MakeBufferFromSharedMemory(std::move(shared_memory), kSharedBufferSize); - scoped_ptr<base::SharedMemory> shared_memory2(new base::SharedMemory()); + std::unique_ptr<base::SharedMemory> shared_memory2( + new base::SharedMemory()); shared_memory2->CreateAndMapAnonymous(kSharedBufferSize); valid_buffer2_ = MakeBufferFromSharedMemory(std::move(shared_memory2), kSharedBufferSize); @@ -157,7 +161,7 @@ scoped_refptr<gpu::Buffer> invalid_buffer_; }; - scoped_ptr<MockCommandBufferEngine> engine_; + std::unique_ptr<MockCommandBufferEngine> engine_; }; class QueryManagerManualSetupTest : public QueryManagerTest { @@ -510,7 +514,7 @@ "GL_ARB_occlusion_query2"); scoped_refptr<FeatureInfo> feature_info(new FeatureInfo()); feature_info->InitializeForTesting(); - scoped_ptr<QueryManager> manager( + std::unique_ptr<QueryManager> manager( new QueryManager(decoder_.get(), feature_info.get())); EXPECT_CALL(*gl_, GenQueries(1, _)) @@ -544,7 +548,7 @@ "GL_ARB_occlusion_query"); scoped_refptr<FeatureInfo> feature_info(new FeatureInfo()); feature_info->InitializeForTesting(); - scoped_ptr<QueryManager> manager( + std::unique_ptr<QueryManager> manager( new QueryManager(decoder_.get(), feature_info.get())); EXPECT_CALL(*gl_, GenQueries(1, _)) @@ -577,7 +581,7 @@ "GL_ARB_occlusion_query"); scoped_refptr<FeatureInfo> feature_info(new FeatureInfo()); feature_info->InitializeForTesting(); - scoped_ptr<QueryManager> manager( + std::unique_ptr<QueryManager> manager( new QueryManager(decoder_.get(), feature_info.get())); EXPECT_CALL(*gl_, GenQueries(1, _)) @@ -920,7 +924,7 @@ TestHelper::SetupFeatureInfoInitExpectations(gl_.get(), ""); scoped_refptr<FeatureInfo> feature_info(new FeatureInfo()); feature_info->InitializeForTesting(); - scoped_ptr<QueryManager> manager( + std::unique_ptr<QueryManager> manager( new QueryManager(decoder_.get(), feature_info.get())); QueryManager::Query* query = manager->CreateQuery(
diff --git a/gpu/command_buffer/service/renderbuffer_manager.h b/gpu/command_buffer/service/renderbuffer_manager.h index d44b576..f808e96 100644 --- a/gpu/command_buffer/service/renderbuffer_manager.h +++ b/gpu/command_buffer/service/renderbuffer_manager.h
@@ -8,11 +8,12 @@ #include <stddef.h> #include <stdint.h> +#include <memory> #include <string> + #include "base/containers/hash_tables.h" #include "base/macros.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "gpu/command_buffer/service/gl_utils.h" #include "gpu/command_buffer/service/memory_tracking.h" #include "gpu/gpu_export.h" @@ -187,7 +188,7 @@ void StartTracking(Renderbuffer* renderbuffer); void StopTracking(Renderbuffer* renderbuffer); - scoped_ptr<MemoryTypeTracker> memory_type_tracker_; + std::unique_ptr<MemoryTypeTracker> memory_type_tracker_; MemoryTracker* memory_tracker_; GLint max_renderbuffer_size_;
diff --git a/gpu/command_buffer/service/renderbuffer_manager_unittest.cc b/gpu/command_buffer/service/renderbuffer_manager_unittest.cc index 815d8ee..a027183 100644 --- a/gpu/command_buffer/service/renderbuffer_manager_unittest.cc +++ b/gpu/command_buffer/service/renderbuffer_manager_unittest.cc
@@ -49,7 +49,7 @@ } scoped_refptr<FeatureInfo> feature_info_; - scoped_ptr<RenderbufferManager> manager_; + std::unique_ptr<RenderbufferManager> manager_; }; class RenderbufferManagerTest : public RenderbufferManagerTestBase {
diff --git a/gpu/command_buffer/service/sampler_manager.h b/gpu/command_buffer/service/sampler_manager.h index 6dc470a..8d85343 100644 --- a/gpu/command_buffer/service/sampler_manager.h +++ b/gpu/command_buffer/service/sampler_manager.h
@@ -6,11 +6,11 @@ #define GPU_COMMAND_BUFFER_SERVICE_SAMPLER_MANAGER_H_ #include <vector> + #include "base/containers/hash_tables.h" #include "base/logging.h" #include "base/macros.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "gpu/command_buffer/service/feature_info.h" #include "gpu/command_buffer/service/gl_utils.h" #include "gpu/gpu_export.h"
diff --git a/gpu/command_buffer/service/shader_manager.h b/gpu/command_buffer/service/shader_manager.h index 31a86e8..69e0cd6 100644 --- a/gpu/command_buffer/service/shader_manager.h +++ b/gpu/command_buffer/service/shader_manager.h
@@ -6,11 +6,11 @@ #define GPU_COMMAND_BUFFER_SERVICE_SHADER_MANAGER_H_ #include <string> + #include "base/containers/hash_tables.h" #include "base/logging.h" #include "base/macros.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "gpu/command_buffer/service/gl_utils.h" #include "gpu/command_buffer/service/shader_translator.h" #include "gpu/gpu_export.h"
diff --git a/gpu/command_buffer/service/shader_manager_unittest.cc b/gpu/command_buffer/service/shader_manager_unittest.cc index 93471ec10..1aef056 100644 --- a/gpu/command_buffer/service/shader_manager_unittest.cc +++ b/gpu/command_buffer/service/shader_manager_unittest.cc
@@ -4,7 +4,6 @@ #include "gpu/command_buffer/service/shader_manager.h" -#include "base/memory/scoped_ptr.h" #include "gpu/command_buffer/service/gpu_service_test.h" #include "gpu/command_buffer/service/mocks.h" #include "gpu/command_buffer/service/test_helper.h"
diff --git a/gpu/command_buffer/service/shader_translator.h b/gpu/command_buffer/service/shader_translator.h index 04b1206..ac8d6f8 100644 --- a/gpu/command_buffer/service/shader_translator.h +++ b/gpu/command_buffer/service/shader_translator.h
@@ -10,7 +10,6 @@ #include "base/containers/hash_tables.h" #include "base/macros.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "base/observer_list.h" #include "gpu/gpu_export.h" #include "third_party/angle/include/GLSLANG/ShaderLang.h"
diff --git a/gpu/command_buffer/service/sync_point_manager.cc b/gpu/command_buffer/service/sync_point_manager.cc index 2adf5df..9669bb6 100644 --- a/gpu/command_buffer/service/sync_point_manager.cc +++ b/gpu/command_buffer/service/sync_point_manager.cc
@@ -14,6 +14,7 @@ #include "base/containers/hash_tables.h" #include "base/location.h" #include "base/logging.h" +#include "base/memory/ptr_util.h" #include "base/rand_util.h" #include "base/sequence_checker.h" #include "base/single_thread_task_runner.h" @@ -370,7 +371,7 @@ } } -scoped_ptr<SyncPointClient> SyncPointManager::CreateSyncPointClient( +std::unique_ptr<SyncPointClient> SyncPointManager::CreateSyncPointClient( scoped_refptr<SyncPointOrderData> order_data, CommandBufferNamespace namespace_id, CommandBufferId client_id) { @@ -384,11 +385,12 @@ namespace_id, client_id))); DCHECK(result.second); - return make_scoped_ptr(result.first->second); + return base::WrapUnique(result.first->second); } -scoped_ptr<SyncPointClient> SyncPointManager::CreateSyncPointClientWaiter() { - return make_scoped_ptr(new SyncPointClient); +std::unique_ptr<SyncPointClient> +SyncPointManager::CreateSyncPointClientWaiter() { + return base::WrapUnique(new SyncPointClient); } scoped_refptr<SyncPointClientState> SyncPointManager::GetSyncPointClientState(
diff --git a/gpu/command_buffer/service/sync_point_manager.h b/gpu/command_buffer/service/sync_point_manager.h index 49769fb..a004a37 100644 --- a/gpu/command_buffer/service/sync_point_manager.h +++ b/gpu/command_buffer/service/sync_point_manager.h
@@ -8,6 +8,7 @@ #include <stdint.h> #include <functional> +#include <memory> #include <queue> #include <unordered_map> #include <vector> @@ -17,7 +18,6 @@ #include "base/logging.h" #include "base/macros.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "base/synchronization/condition_variable.h" #include "base/synchronization/lock.h" #include "base/threading/thread_checker.h" @@ -291,14 +291,14 @@ ~SyncPointManager(); // Creates/Destroy a sync point client which message processors should hold. - scoped_ptr<SyncPointClient> CreateSyncPointClient( + std::unique_ptr<SyncPointClient> CreateSyncPointClient( scoped_refptr<SyncPointOrderData> order_data, CommandBufferNamespace namespace_id, CommandBufferId client_id); // Creates a sync point client which cannot process order numbers but can only // Wait out of order. - scoped_ptr<SyncPointClient> CreateSyncPointClientWaiter(); + std::unique_ptr<SyncPointClient> CreateSyncPointClientWaiter(); // Finds the state of an already created sync point client. scoped_refptr<SyncPointClientState> GetSyncPointClientState(
diff --git a/gpu/command_buffer/service/sync_point_manager_unittest.cc b/gpu/command_buffer/service/sync_point_manager_unittest.cc index e6cdeeaa..52371a5 100644 --- a/gpu/command_buffer/service/sync_point_manager_unittest.cc +++ b/gpu/command_buffer/service/sync_point_manager_unittest.cc
@@ -4,6 +4,7 @@ #include <stdint.h> +#include <memory> #include <queue> #include "base/bind.h" @@ -37,12 +38,12 @@ *client_id_ptr = client_id; } - scoped_ptr<SyncPointManager> sync_point_manager_; + std::unique_ptr<SyncPointManager> sync_point_manager_; }; struct SyncPointStream { scoped_refptr<SyncPointOrderData> order_data; - scoped_ptr<SyncPointClient> client; + std::unique_ptr<SyncPointClient> client; std::queue<uint32_t> order_numbers; SyncPointStream(SyncPointManager* sync_point_manager, @@ -120,7 +121,7 @@ scoped_refptr<SyncPointOrderData> order_data = SyncPointOrderData::Create(); - scoped_ptr<SyncPointClient> client = + std::unique_ptr<SyncPointClient> client = sync_point_manager_->CreateSyncPointClient(order_data, kNamespaceId, kBufferId); @@ -136,7 +137,7 @@ const CommandBufferId kBufferId = CommandBufferId::FromUnsafeValue(0x123); scoped_refptr<SyncPointOrderData> order_data = SyncPointOrderData::Create(); - scoped_ptr<SyncPointClient> client = + std::unique_ptr<SyncPointClient> client = sync_point_manager_->CreateSyncPointClient(order_data, kNamespaceId, kBufferId); scoped_refptr<SyncPointClientState> client_state = client->client_state(); @@ -161,10 +162,10 @@ const CommandBufferId kBufferId2 = CommandBufferId::FromUnsafeValue(0x234); scoped_refptr<SyncPointOrderData> order_data = SyncPointOrderData::Create(); - scoped_ptr<SyncPointClient> client1 = + std::unique_ptr<SyncPointClient> client1 = sync_point_manager_->CreateSyncPointClient(order_data, kNamespaceId, kBufferId1); - scoped_ptr<SyncPointClient> client2 = + std::unique_ptr<SyncPointClient> client2 = sync_point_manager_->CreateSyncPointClient(order_data, kNamespaceId, kBufferId2);
diff --git a/gpu/command_buffer/service/texture_definition.cc b/gpu/command_buffer/service/texture_definition.cc index f8346c033..44bf4ed 100644 --- a/gpu/command_buffer/service/texture_definition.cc +++ b/gpu/command_buffer/service/texture_definition.cc
@@ -10,7 +10,6 @@ #include "base/lazy_instance.h" #include "base/memory/linked_ptr.h" -#include "base/memory/scoped_ptr.h" #include "base/synchronization/lock.h" #include "base/threading/thread_local.h" // gl_stream_texture_image.h is included to work around crbug.com/595189, a
diff --git a/gpu/command_buffer/service/texture_manager.cc b/gpu/command_buffer/service/texture_manager.cc index 97f3843..b904fc9 100644 --- a/gpu/command_buffer/service/texture_manager.cc +++ b/gpu/command_buffer/service/texture_manager.cc
@@ -2359,7 +2359,7 @@ return; } DoTexImageArguments new_args = args; - scoped_ptr<char[]> zero(new char[args.pixels_size]); + std::unique_ptr<char[]> zero(new char[args.pixels_size]); memset(zero.get(), 0, args.pixels_size); for (GLenum face : undefined_faces) { new_args.target = face;
diff --git a/gpu/command_buffer/service/texture_manager.h b/gpu/command_buffer/service/texture_manager.h index 7a470ffa..e56549b 100644 --- a/gpu/command_buffer/service/texture_manager.h +++ b/gpu/command_buffer/service/texture_manager.h
@@ -10,9 +10,11 @@ #include <algorithm> #include <list> +#include <memory> #include <set> #include <string> #include <vector> + #include "base/containers/hash_tables.h" #include "base/macros.h" #include "base/memory/ref_counted.h" @@ -649,7 +651,7 @@ struct DecoderTextureState { // total_texture_upload_time automatically initialized to 0 in default // constructor. - explicit DecoderTextureState(const FeatureInfo::Workarounds& workarounds) + explicit DecoderTextureState(const GpuDriverBugWorkarounds& workarounds) : tex_image_failed(false), texture_upload_count(0), texsubimage_faster_than_teximage( @@ -1094,7 +1096,7 @@ TextureRef* ref); MemoryTypeTracker* GetMemTracker(); - scoped_ptr<MemoryTypeTracker> memory_type_tracker_; + std::unique_ptr<MemoryTypeTracker> memory_type_tracker_; MemoryTracker* memory_tracker_; scoped_refptr<FeatureInfo> feature_info_;
diff --git a/gpu/command_buffer/service/texture_manager_unittest.cc b/gpu/command_buffer/service/texture_manager_unittest.cc index 60e8755..f430ce0 100644 --- a/gpu/command_buffer/service/texture_manager_unittest.cc +++ b/gpu/command_buffer/service/texture_manager_unittest.cc
@@ -7,11 +7,11 @@ #include <stddef.h> #include <stdint.h> +#include <memory> #include <utility> #include "base/command_line.h" #include "base/macros.h" -#include "base/memory/scoped_ptr.h" #include "gpu/command_buffer/service/error_state_mock.h" #include "gpu/command_buffer/service/feature_info.h" #include "gpu/command_buffer/service/framebuffer_manager.h" @@ -71,7 +71,8 @@ // enabled without FeatureInfo::EnableES3Validators(). base::CommandLine command_line(0, nullptr); command_line.AppendSwitch(switches::kEnableUnsafeES3APIs); - feature_info_ = new FeatureInfo(command_line); + GpuDriverBugWorkarounds gpu_driver_bug_workaround(&command_line); + feature_info_ = new FeatureInfo(command_line, gpu_driver_bug_workaround); } ~TextureManagerTest() override {} @@ -123,8 +124,8 @@ } scoped_refptr<FeatureInfo> feature_info_; - scoped_ptr<TextureManager> manager_; - scoped_ptr<MockErrorState> error_state_; + std::unique_ptr<TextureManager> manager_; + std::unique_ptr<MockErrorState> error_state_; }; // GCC requires these declarations, but MSVC requires they not be present @@ -761,10 +762,10 @@ texture_ref, pname, value, error); } - scoped_ptr<MockGLES2Decoder> decoder_; - scoped_ptr<MockErrorState> error_state_; + std::unique_ptr<MockGLES2Decoder> decoder_; + std::unique_ptr<MockErrorState> error_state_; scoped_refptr<FeatureInfo> feature_info_; - scoped_ptr<TextureManager> manager_; + std::unique_ptr<TextureManager> manager_; scoped_refptr<TextureRef> texture_ref_; }; @@ -2195,9 +2196,9 @@ protected: scoped_refptr<FeatureInfo> feature_info_; scoped_refptr<CountingMemoryTracker> memory_tracker1_; - scoped_ptr<TextureManager> texture_manager1_; + std::unique_ptr<TextureManager> texture_manager1_; scoped_refptr<CountingMemoryTracker> memory_tracker2_; - scoped_ptr<TextureManager> texture_manager2_; + std::unique_ptr<TextureManager> texture_manager2_; }; TEST_F(SharedTextureTest, DeleteTextures) {
diff --git a/gpu/command_buffer/service/transfer_buffer_manager.cc b/gpu/command_buffer/service/transfer_buffer_manager.cc index f9db75e..2e1e8b3 100644 --- a/gpu/command_buffer/service/transfer_buffer_manager.cc +++ b/gpu/command_buffer/service/transfer_buffer_manager.cc
@@ -7,9 +7,9 @@ #include <stdint.h> #include <limits> +#include <memory> #include "base/logging.h" -#include "base/memory/scoped_ptr.h" #include "base/process/process_handle.h" #include "base/strings/stringprintf.h" #include "base/thread_task_runner_handle.h" @@ -58,7 +58,7 @@ bool TransferBufferManager::RegisterTransferBuffer( int32_t id, - scoped_ptr<BufferBacking> buffer_backing) { + std::unique_ptr<BufferBacking> buffer_backing) { if (id <= 0) { DVLOG(0) << "Cannot register transfer buffer with non-positive ID."; return false;
diff --git a/gpu/command_buffer/service/transfer_buffer_manager.h b/gpu/command_buffer/service/transfer_buffer_manager.h index 8843160..31489785 100644 --- a/gpu/command_buffer/service/transfer_buffer_manager.h +++ b/gpu/command_buffer/service/transfer_buffer_manager.h
@@ -8,6 +8,7 @@ #include <stddef.h> #include <stdint.h> +#include <memory> #include <set> #include <vector> @@ -26,8 +27,9 @@ class GPU_EXPORT TransferBufferManagerInterface : public base::RefCounted<TransferBufferManagerInterface> { public: - virtual bool RegisterTransferBuffer(int32_t id, - scoped_ptr<BufferBacking> buffer) = 0; + virtual bool RegisterTransferBuffer( + int32_t id, + std::unique_ptr<BufferBacking> buffer) = 0; virtual void DestroyTransferBuffer(int32_t id) = 0; virtual scoped_refptr<Buffer> GetTransferBuffer(int32_t id) = 0; @@ -50,7 +52,7 @@ bool Initialize(); bool RegisterTransferBuffer( int32_t id, - scoped_ptr<BufferBacking> buffer_backing) override; + std::unique_ptr<BufferBacking> buffer_backing) override; void DestroyTransferBuffer(int32_t id) override; scoped_refptr<Buffer> GetTransferBuffer(int32_t id) override;
diff --git a/gpu/command_buffer/service/transfer_buffer_manager_unittest.cc b/gpu/command_buffer/service/transfer_buffer_manager_unittest.cc index 56edaed..1e12ae68 100644 --- a/gpu/command_buffer/service/transfer_buffer_manager_unittest.cc +++ b/gpu/command_buffer/service/transfer_buffer_manager_unittest.cc
@@ -6,7 +6,8 @@ #include <stddef.h> -#include "base/memory/scoped_ptr.h" +#include <memory> + #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" @@ -40,10 +41,10 @@ } TEST_F(TransferBufferManagerTest, CanRegisterTransferBuffer) { - scoped_ptr<base::SharedMemory> shm(new base::SharedMemory()); + std::unique_ptr<base::SharedMemory> shm(new base::SharedMemory()); shm->CreateAndMapAnonymous(kBufferSize); base::SharedMemory* shm_raw_pointer = shm.get(); - scoped_ptr<SharedMemoryBufferBacking> backing( + std::unique_ptr<SharedMemoryBufferBacking> backing( new SharedMemoryBufferBacking(std::move(shm), kBufferSize)); SharedMemoryBufferBacking* backing_raw_ptr = backing.get(); @@ -63,14 +64,14 @@ return reinterpret_cast<void*>(0xBADF00D0); } size_t GetSize() const override { return 42; } - static scoped_ptr<BufferBacking> Make() { - return scoped_ptr<BufferBacking>(new FakeBufferBacking); + static std::unique_ptr<BufferBacking> Make() { + return std::unique_ptr<BufferBacking>(new FakeBufferBacking); } }; TEST_F(TransferBufferManagerTest, CanDestroyTransferBuffer) { EXPECT_TRUE(transfer_buffer_manager_->RegisterTransferBuffer( - 1, scoped_ptr<BufferBacking>(new FakeBufferBacking))); + 1, std::unique_ptr<BufferBacking>(new FakeBufferBacking))); transfer_buffer_manager_->DestroyTransferBuffer(1); scoped_refptr<Buffer> registered = transfer_buffer_manager_->GetTransferBuffer(1); @@ -106,7 +107,7 @@ } TEST_F(TransferBufferManagerTest, CannotRegisterNegativeTransferBufferId) { - scoped_ptr<base::SharedMemory> shm(new base::SharedMemory()); + std::unique_ptr<base::SharedMemory> shm(new base::SharedMemory()); shm->CreateAndMapAnonymous(kBufferSize); EXPECT_FALSE(transfer_buffer_manager_->RegisterTransferBuffer( -1, FakeBufferBacking::Make()));
diff --git a/gpu/command_buffer/service/valuebuffer_manager.h b/gpu/command_buffer/service/valuebuffer_manager.h index 0d6782d..04a3304 100644 --- a/gpu/command_buffer/service/valuebuffer_manager.h +++ b/gpu/command_buffer/service/valuebuffer_manager.h
@@ -10,7 +10,6 @@ #include "base/containers/hash_tables.h" #include "base/macros.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "base/observer_list.h" #include "gpu/command_buffer/common/value_state.h" #include "gpu/gpu_export.h"
diff --git a/gpu/command_buffer/service/valuebuffer_manager_unittest.cc b/gpu/command_buffer/service/valuebuffer_manager_unittest.cc index c5d0c6c..a4d9601 100644 --- a/gpu/command_buffer/service/valuebuffer_manager_unittest.cc +++ b/gpu/command_buffer/service/valuebuffer_manager_unittest.cc
@@ -4,7 +4,8 @@ #include "gpu/command_buffer/service/valuebuffer_manager.h" -#include "base/memory/scoped_ptr.h" +#include <memory> + #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" #include "gpu/command_buffer/common/gles2_cmd_format.h" @@ -54,7 +55,7 @@ scoped_refptr<SubscriptionRefSet> subscription_ref_set_; scoped_refptr<ValueStateMap> pending_state_map_; - scoped_ptr<ValuebufferManager> manager_; + std::unique_ptr<ValuebufferManager> manager_; }; TEST_F(ValuebufferManagerTest, Basic) {
diff --git a/gpu/command_buffer/service/vertex_array_manager.h b/gpu/command_buffer/service/vertex_array_manager.h index 2c526881..8221f30 100644 --- a/gpu/command_buffer/service/vertex_array_manager.h +++ b/gpu/command_buffer/service/vertex_array_manager.h
@@ -11,7 +11,6 @@ #include "base/logging.h" #include "base/macros.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "gpu/command_buffer/service/gl_utils.h" #include "gpu/gpu_export.h"
diff --git a/gpu/command_buffer/service/vertex_array_manager_unittest.cc b/gpu/command_buffer/service/vertex_array_manager_unittest.cc index 73f9bc7..a679cb5b 100644 --- a/gpu/command_buffer/service/vertex_array_manager_unittest.cc +++ b/gpu/command_buffer/service/vertex_array_manager_unittest.cc
@@ -4,10 +4,11 @@ #include <stdint.h> +#include <memory> + #include "gpu/command_buffer/service/vertex_array_manager.h" #include "gpu/command_buffer/service/vertex_attrib_manager.h" -#include "base/memory/scoped_ptr.h" #include "gpu/command_buffer/service/feature_info.h" #include "gpu/command_buffer/service/gpu_service_test.h" #include "gpu/command_buffer/service/test_helper.h" @@ -40,7 +41,7 @@ GpuServiceTest::TearDown(); } - scoped_ptr<VertexArrayManager> manager_; + std::unique_ptr<VertexArrayManager> manager_; }; // GCC requires these declarations, but MSVC requires they not be present
diff --git a/gpu/command_buffer/service/vertex_attrib_manager.cc b/gpu/command_buffer/service/vertex_attrib_manager.cc index 7ec12e8..76883dc 100644 --- a/gpu/command_buffer/service/vertex_attrib_manager.cc +++ b/gpu/command_buffer/service/vertex_attrib_manager.cc
@@ -9,7 +9,6 @@ #include <list> #include "base/logging.h" -#include "base/memory/scoped_ptr.h" #include "base/strings/string_number_conversions.h" #include "build/build_config.h" #include "gpu/command_buffer/common/gles2_cmd_format.h"
diff --git a/gpu/command_buffer/service/vertex_attrib_manager_unittest.cc b/gpu/command_buffer/service/vertex_attrib_manager_unittest.cc index 2e31c16..be76444 100644 --- a/gpu/command_buffer/service/vertex_attrib_manager_unittest.cc +++ b/gpu/command_buffer/service/vertex_attrib_manager_unittest.cc
@@ -6,7 +6,6 @@ #include <stdint.h> -#include "base/memory/scoped_ptr.h" #include "gpu/command_buffer/service/buffer_manager.h" #include "gpu/command_buffer/service/error_state_mock.h" #include "gpu/command_buffer/service/feature_info.h"
diff --git a/gpu/command_buffer/tests/es3_misc_functions_unittest.cc b/gpu/command_buffer/tests/es3_misc_functions_unittest.cc index 634bf1d..7cd3a4f 100644 --- a/gpu/command_buffer/tests/es3_misc_functions_unittest.cc +++ b/gpu/command_buffer/tests/es3_misc_functions_unittest.cc
@@ -26,7 +26,7 @@ command_line.AppendSwitch(switches::kEnableUnsafeES3APIs); GLManager::Options options; options.context_type = gles2::CONTEXT_TYPE_OPENGLES3; - gl_.InitializeWithCommandLine(options, &command_line); + gl_.InitializeWithCommandLine(options, command_line); } void TearDown() override { gl_.Destroy(); } bool IsApplicable() const { return gl_.IsInitialized(); }
diff --git a/gpu/command_buffer/tests/gl_chromium_framebuffer_mixed_samples_unittest.cc b/gpu/command_buffer/tests/gl_chromium_framebuffer_mixed_samples_unittest.cc index 7c5d8e2..4a84ab9f 100644 --- a/gpu/command_buffer/tests/gl_chromium_framebuffer_mixed_samples_unittest.cc +++ b/gpu/command_buffer/tests/gl_chromium_framebuffer_mixed_samples_unittest.cc
@@ -8,6 +8,8 @@ #include <stdint.h> #include <string.h> +#include <memory> + #include "base/command_line.h" #include "gpu/command_buffer/service/gpu_switches.h" #include "gpu/command_buffer/tests/gl_manager.h" @@ -173,7 +175,7 @@ } static const float kBlue[] = {0.0f, 0.0f, 1.0f, 1.0f}; static const float kGreen[] = {0.0f, 1.0f, 0.0f, 1.0f}; - scoped_ptr<uint8_t[]> results[3]; + std::unique_ptr<uint8_t[]> results[3]; const GLint kResultSize = kWidth * kHeight * 4; for (int pass = 0; pass < 3; ++pass) { @@ -213,7 +215,7 @@ static const float kBlue[] = {0.0f, 0.0f, 1.0f, 1.0f}; static const float kGreen[] = {0.0f, 1.0f, 0.0f, 1.0f}; - scoped_ptr<uint8_t[]> results[3]; + std::unique_ptr<uint8_t[]> results[3]; const GLint kResultSize = kWidth * kHeight * 4; for (int pass = 0; pass < 3; ++pass) {
diff --git a/gpu/command_buffer/tests/gl_clear_framebuffer_unittest.cc b/gpu/command_buffer/tests/gl_clear_framebuffer_unittest.cc index 496b3ef..b440409 100644 --- a/gpu/command_buffer/tests/gl_clear_framebuffer_unittest.cc +++ b/gpu/command_buffer/tests/gl_clear_framebuffer_unittest.cc
@@ -35,7 +35,7 @@ base::CommandLine command_line(base::CommandLine::NO_PROGRAM); command_line.AppendSwitchASCII(switches::kGpuDriverBugWorkarounds, base::IntToString(gpu::GL_CLEAR_BROKEN)); - gl_.InitializeWithCommandLine(GLManager::Options(), &command_line); + gl_.InitializeWithCommandLine(GLManager::Options(), command_line); DCHECK(gl_.workarounds().gl_clear_broken); } else { gl_.Initialize(GLManager::Options());
diff --git a/gpu/command_buffer/tests/gl_compressed_copy_texture_CHROMIUM_unittest.cc b/gpu/command_buffer/tests/gl_compressed_copy_texture_CHROMIUM_unittest.cc index 0543058..1ac777b1 100644 --- a/gpu/command_buffer/tests/gl_compressed_copy_texture_CHROMIUM_unittest.cc +++ b/gpu/command_buffer/tests/gl_compressed_copy_texture_CHROMIUM_unittest.cc
@@ -11,6 +11,9 @@ #include <GLES2/gl2extchromium.h> #include <stdint.h> +#include <memory> + +#include "base/memory/ptr_util.h" #include "gpu/command_buffer/tests/gl_manager.h" #include "gpu/command_buffer/tests/gl_test_utils.h" #include "testing/gmock/include/gmock/gmock.h" @@ -161,37 +164,30 @@ Image(const GLint format, const uint8_t* data, const GLsizei data_size) : format(format), data(data), data_size(data_size) {} }; - std::vector<scoped_ptr<Image>> supported_formats; + std::vector<std::unique_ptr<Image>> supported_formats; if (GLTestHelper::HasExtension("GL_AMD_compressed_ATC_texture") || GLTestHelper::HasExtension("GL_ATI_texture_compression_atitc")) { - supported_formats.push_back(make_scoped_ptr(new Image( - GL_ATC_RGB_AMD, - kCompressedImageATC, - sizeof(kCompressedImageATC)))); - supported_formats.push_back(make_scoped_ptr(new Image( - GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD, - kCompressedImageATCIA, - sizeof(kCompressedImageATCIA)))); + supported_formats.push_back(base::WrapUnique(new Image( + GL_ATC_RGB_AMD, kCompressedImageATC, sizeof(kCompressedImageATC)))); + supported_formats.push_back(base::WrapUnique( + new Image(GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD, kCompressedImageATCIA, + sizeof(kCompressedImageATCIA)))); } if (GLTestHelper::HasExtension("GL_EXT_texture_compression_dxt1")) { - supported_formats.push_back(make_scoped_ptr(new Image( - GL_COMPRESSED_RGB_S3TC_DXT1_EXT, - kCompressedImageDXT1, - sizeof(kCompressedImageDXT1)))); + supported_formats.push_back(base::WrapUnique( + new Image(GL_COMPRESSED_RGB_S3TC_DXT1_EXT, kCompressedImageDXT1, + sizeof(kCompressedImageDXT1)))); } if (GLTestHelper::HasExtension("GL_ANGLE_texture_compression_dxt5") || GLTestHelper::HasExtension("GL_EXT_texture_compression_s3tc")) { - supported_formats.push_back(make_scoped_ptr(new Image( - GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, - kCompressedImageDXT5, - sizeof(kCompressedImageDXT5)))); + supported_formats.push_back(base::WrapUnique( + new Image(GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, kCompressedImageDXT5, + sizeof(kCompressedImageDXT5)))); } if (GLTestHelper::HasExtension("GL_OES_compressed_ETC1_RGB8_texture")) { - supported_formats.push_back(make_scoped_ptr(new Image( - GL_ETC1_RGB8_OES, - kCompressedImageETC1, - sizeof(kCompressedImageETC1)))); + supported_formats.push_back(base::WrapUnique(new Image( + GL_ETC1_RGB8_OES, kCompressedImageETC1, sizeof(kCompressedImageETC1)))); } for (const auto& image : supported_formats) {
diff --git a/gpu/command_buffer/tests/gl_copy_tex_image_2d_workaround_unittest.cc b/gpu/command_buffer/tests/gl_copy_tex_image_2d_workaround_unittest.cc index e426794d..fc78349a 100644 --- a/gpu/command_buffer/tests/gl_copy_tex_image_2d_workaround_unittest.cc +++ b/gpu/command_buffer/tests/gl_copy_tex_image_2d_workaround_unittest.cc
@@ -33,7 +33,7 @@ command_line.AppendSwitchASCII( switches::kGpuDriverBugWorkarounds, base::IntToString(gpu::USE_INTERMEDIARY_FOR_COPY_TEXTURE_IMAGE)); - gl_.InitializeWithCommandLine(GLManager::Options(), &command_line); + gl_.InitializeWithCommandLine(GLManager::Options(), command_line); gl_.set_use_iosurface_memory_buffers(true); DCHECK(gl_.workarounds().use_intermediary_for_copy_texture_image); }
diff --git a/gpu/command_buffer/tests/gl_cube_map_texture_unittest.cc b/gpu/command_buffer/tests/gl_cube_map_texture_unittest.cc index b2fb931..96d0e463 100644 --- a/gpu/command_buffer/tests/gl_cube_map_texture_unittest.cc +++ b/gpu/command_buffer/tests/gl_cube_map_texture_unittest.cc
@@ -5,6 +5,8 @@ #include <GLES2/gl2.h> #include <stdint.h> +#include <memory> + #include "base/command_line.h" #include "base/strings/string_number_conversions.h" #include "gpu/command_buffer/tests/gl_manager.h" @@ -31,7 +33,7 @@ // workaround. command_line.AppendSwitchASCII(switches::kGpuDriverBugWorkarounds, base::IntToString(gpu::FORCE_CUBE_COMPLETE)); - gl_.InitializeWithCommandLine(GLManager::Options(), &command_line); + gl_.InitializeWithCommandLine(GLManager::Options(), command_line); DCHECK(gl_.workarounds().force_cube_complete); for (int i = 0; i < 256; i++) { pixels_[i * 4] = 255u; @@ -135,7 +137,7 @@ EXPECT_EQ(static_cast<GLenum>(GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT), glCheckFramebufferStatus(GL_FRAMEBUFFER)); GLsizei size = width_ * width_ * 4; - scoped_ptr<uint8_t[]> pixels(new uint8_t[size]); + std::unique_ptr<uint8_t[]> pixels(new uint8_t[size]); glReadPixels(0, 0, width_, width_, GL_RGBA, GL_UNSIGNED_BYTE, pixels.get()); EXPECT_EQ(static_cast<GLenum>(GL_INVALID_FRAMEBUFFER_OPERATION), glGetError());
diff --git a/gpu/command_buffer/tests/gl_ext_blend_func_extended_unittest.cc b/gpu/command_buffer/tests/gl_ext_blend_func_extended_unittest.cc index 545fdc3..b157e79 100644 --- a/gpu/command_buffer/tests/gl_ext_blend_func_extended_unittest.cc +++ b/gpu/command_buffer/tests/gl_ext_blend_func_extended_unittest.cc
@@ -99,8 +99,7 @@ GLManager::Options options; options.size = gfx::Size(kWidth, kHeight); options.force_shader_name_hashing = GetParam(); - base::CommandLine command_line(*base::CommandLine::ForCurrentProcess()); - gl_.InitializeWithCommandLine(options, &command_line); + gl_.Initialize(options); } bool IsApplicable() const { @@ -247,7 +246,7 @@ options.force_shader_name_hashing = GetParam(); base::CommandLine command_line(*base::CommandLine::ForCurrentProcess()); command_line.AppendSwitch(switches::kEnableUnsafeES3APIs); - gl_.InitializeWithCommandLine(options, &command_line); + gl_.InitializeWithCommandLine(options, command_line); } bool IsApplicable() const { return gl_.IsInitialized() && EXTBlendFuncExtendedDrawTest::IsApplicable();
diff --git a/gpu/command_buffer/tests/gl_ext_multisample_compatibility_unittest.cc b/gpu/command_buffer/tests/gl_ext_multisample_compatibility_unittest.cc index d3d51a6..df65efe2 100644 --- a/gpu/command_buffer/tests/gl_ext_multisample_compatibility_unittest.cc +++ b/gpu/command_buffer/tests/gl_ext_multisample_compatibility_unittest.cc
@@ -7,6 +7,8 @@ #include <GLES2/gl2extchromium.h> #include <stdint.h> +#include <memory> + #include "gpu/command_buffer/tests/gl_manager.h" #include "gpu/command_buffer/tests/gl_test_utils.h" #include "gpu/config/gpu_test_config.h" @@ -154,7 +156,7 @@ // values. These might be due to different MSAA sample counts causing // different samples to hit. Other option is driver bugs. Just test that // disabling multisample causes a difference. - scoped_ptr<uint8_t[]> results[3]; + std::unique_ptr<uint8_t[]> results[3]; const GLint kResultSize = kWidth * kHeight * 4; for (int pass = 0; pass < 3; pass++) { PrepareForDraw(); @@ -206,7 +208,7 @@ // even approximate sample values is not that easy. Thus, just test // representative positions which have fractional pixels, inspecting that // normal rendering is different to SAMPLE_ALPHA_TO_ONE rendering. - scoped_ptr<uint8_t[]> results[3]; + std::unique_ptr<uint8_t[]> results[3]; const GLint kResultSize = kWidth * kHeight * 4; for (int pass = 0; pass < 3; ++pass) {
diff --git a/gpu/command_buffer/tests/gl_fence_sync_unittest.cc b/gpu/command_buffer/tests/gl_fence_sync_unittest.cc index 50de9c1..5b37194e 100644 --- a/gpu/command_buffer/tests/gl_fence_sync_unittest.cc +++ b/gpu/command_buffer/tests/gl_fence_sync_unittest.cc
@@ -6,7 +6,8 @@ #include <GLES2/gl2ext.h> #include <GLES2/gl2extchromium.h> -#include "base/memory/scoped_ptr.h" +#include <memory> + #include "gpu/command_buffer/common/sync_token.h" #include "gpu/command_buffer/service/sync_point_manager.h" #include "gpu/command_buffer/tests/gl_manager.h" @@ -36,7 +37,7 @@ sync_point_manager_.reset(); } - scoped_ptr<SyncPointManager> sync_point_manager_; + std::unique_ptr<SyncPointManager> sync_point_manager_; GLManager gl1_; GLManager gl2_; };
diff --git a/gpu/command_buffer/tests/gl_gpu_memory_buffer_unittest.cc b/gpu/command_buffer/tests/gl_gpu_memory_buffer_unittest.cc index 5f1e1e0..38565cb6 100644 --- a/gpu/command_buffer/tests/gl_gpu_memory_buffer_unittest.cc +++ b/gpu/command_buffer/tests/gl_gpu_memory_buffer_unittest.cc
@@ -8,6 +8,8 @@ #include <GLES2/gl2extchromium.h> #include <stdint.h> +#include <memory> + #include "base/bind.h" #include "base/memory/ref_counted.h" #include "base/process/process_handle.h" @@ -172,7 +174,7 @@ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); // Create the gpu memory buffer. - scoped_ptr<gfx::GpuMemoryBuffer> buffer(gl_.CreateGpuMemoryBuffer( + std::unique_ptr<gfx::GpuMemoryBuffer> buffer(gl_.CreateGpuMemoryBuffer( gfx::Size(kImageWidth, kImageHeight), GetParam())); // Map buffer for writing.
diff --git a/gpu/command_buffer/tests/gl_iosurface_readback_workaround_unittest.cc b/gpu/command_buffer/tests/gl_iosurface_readback_workaround_unittest.cc index e8e7bc52..d4ddb95 100644 --- a/gpu/command_buffer/tests/gl_iosurface_readback_workaround_unittest.cc +++ b/gpu/command_buffer/tests/gl_iosurface_readback_workaround_unittest.cc
@@ -33,7 +33,7 @@ command_line.AppendSwitchASCII( switches::kGpuDriverBugWorkarounds, base::IntToString(gpu::IOSURFACE_READBACK_WORKAROUND)); - gl_.InitializeWithCommandLine(GLManager::Options(), &command_line); + gl_.InitializeWithCommandLine(GLManager::Options(), command_line); gl_.set_use_iosurface_memory_buffers(true); DCHECK(gl_.workarounds().iosurface_readback_workaround); }
diff --git a/gpu/command_buffer/tests/gl_manager.cc b/gpu/command_buffer/tests/gl_manager.cc index ce9fd3c..006903c 100644 --- a/gpu/command_buffer/tests/gl_manager.cc +++ b/gpu/command_buffer/tests/gl_manager.cc
@@ -14,6 +14,8 @@ #include "base/at_exit.h" #include "base/bind.h" +#include "base/command_line.h" +#include "base/memory/ptr_util.h" #include "base/memory/ref_counted_memory.h" #include "build/build_config.h" #include "gpu/command_buffer/client/gles2_cmd_helper.h" @@ -214,27 +216,28 @@ } } -scoped_ptr<gfx::GpuMemoryBuffer> GLManager::CreateGpuMemoryBuffer( +std::unique_ptr<gfx::GpuMemoryBuffer> GLManager::CreateGpuMemoryBuffer( const gfx::Size& size, gfx::BufferFormat format) { #if defined(OS_MACOSX) if (use_iosurface_memory_buffers_) { - return make_scoped_ptr<gfx::GpuMemoryBuffer>( + return base::WrapUnique<gfx::GpuMemoryBuffer>( new IOSurfaceGpuMemoryBuffer(size, format)); } #endif // defined(OS_MACOSX) std::vector<uint8_t> data(gfx::BufferSizeForBufferFormat(size, format), 0); scoped_refptr<base::RefCountedBytes> bytes(new base::RefCountedBytes(data)); - return make_scoped_ptr<gfx::GpuMemoryBuffer>( + return base::WrapUnique<gfx::GpuMemoryBuffer>( new GpuMemoryBufferImpl(bytes.get(), size, format)); } void GLManager::Initialize(const GLManager::Options& options) { - InitializeWithCommandLine(options, nullptr); + InitializeWithCommandLine(options, *base::CommandLine::ForCurrentProcess()); } -void GLManager::InitializeWithCommandLine(const GLManager::Options& options, - base::CommandLine* command_line) { +void GLManager::InitializeWithCommandLine( + const GLManager::Options& options, + const base::CommandLine& command_line) { const int32_t kCommandBufferSize = 1024 * 1024; const size_t kStartTransferBufferSize = 4 * 1024 * 1024; const size_t kMinTransferBufferSize = 1 * 256 * 1024; @@ -287,11 +290,10 @@ attrib_helper.Serialize(&attribs); - DCHECK(!command_line || !context_group); if (!context_group) { - scoped_refptr<gles2::FeatureInfo> feature_info; - if (command_line) - feature_info = new gles2::FeatureInfo(*command_line); + GpuDriverBugWorkarounds gpu_driver_bug_workaround(&command_line); + scoped_refptr<gles2::FeatureInfo> feature_info = + new gles2::FeatureInfo(command_line, gpu_driver_bug_workaround); context_group = new gles2::ContextGroup( gpu_preferences_, mailbox_manager_.get(), NULL, new gpu::gles2::ShaderTranslatorCache(gpu_preferences_), @@ -463,7 +465,7 @@ } } -const gpu::gles2::FeatureInfo::Workarounds& GLManager::workarounds() const { +const GpuDriverBugWorkarounds& GLManager::workarounds() const { return decoder_->GetContextGroup()->feature_info()->workarounds(); } @@ -566,7 +568,7 @@ unsigned internalformat, unsigned usage) { DCHECK_EQ(usage, static_cast<unsigned>(GL_READ_WRITE_CHROMIUM)); - scoped_ptr<gfx::GpuMemoryBuffer> buffer = CreateGpuMemoryBuffer( + std::unique_ptr<gfx::GpuMemoryBuffer> buffer = CreateGpuMemoryBuffer( gfx::Size(width, height), gfx::BufferFormat::RGBA_8888); return CreateImage(buffer->AsClientBuffer(), width, height, internalformat); }
diff --git a/gpu/command_buffer/tests/gl_manager.h b/gpu/command_buffer/tests/gl_manager.h index b6acf4d..993472ba 100644 --- a/gpu/command_buffer/tests/gl_manager.h +++ b/gpu/command_buffer/tests/gl_manager.h
@@ -8,9 +8,10 @@ #include <stddef.h> #include <stdint.h> +#include <memory> + #include "base/containers/scoped_ptr_hash_map.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "gpu/command_buffer/client/gpu_control.h" #include "gpu/command_buffer/common/gles2_cmd_utils.h" #include "gpu/command_buffer/service/feature_info.h" @@ -78,13 +79,13 @@ GLManager(); ~GLManager() override; - scoped_ptr<gfx::GpuMemoryBuffer> CreateGpuMemoryBuffer( + std::unique_ptr<gfx::GpuMemoryBuffer> CreateGpuMemoryBuffer( const gfx::Size& size, gfx::BufferFormat format); void Initialize(const Options& options); void InitializeWithCommandLine(const Options& options, - base::CommandLine* command_line); + const base::CommandLine& command_line); void Destroy(); bool IsInitialized() const { return gles2_implementation() != nullptr; } @@ -119,7 +120,7 @@ return context_.get(); } - const gpu::gles2::FeatureInfo::Workarounds& workarounds() const; + const GpuDriverBugWorkarounds& workarounds() const; // GpuControl implementation. void SetGpuControlClient(GpuControlClient*) override; @@ -162,17 +163,17 @@ SyncPointManager* sync_point_manager_; // Non-owning. scoped_refptr<SyncPointOrderData> sync_point_order_data_; - scoped_ptr<SyncPointClient> sync_point_client_; + std::unique_ptr<SyncPointClient> sync_point_client_; scoped_refptr<gles2::MailboxManager> mailbox_manager_; scoped_refptr<gfx::GLShareGroup> share_group_; - scoped_ptr<CommandBufferService> command_buffer_; - scoped_ptr<gles2::GLES2Decoder> decoder_; - scoped_ptr<CommandExecutor> executor_; + std::unique_ptr<CommandBufferService> command_buffer_; + std::unique_ptr<gles2::GLES2Decoder> decoder_; + std::unique_ptr<CommandExecutor> executor_; scoped_refptr<gfx::GLSurface> surface_; scoped_refptr<gfx::GLContext> context_; - scoped_ptr<gles2::GLES2CmdHelper> gles2_helper_; - scoped_ptr<TransferBuffer> transfer_buffer_; - scoped_ptr<gles2::GLES2Implementation> gles2_implementation_; + std::unique_ptr<gles2::GLES2CmdHelper> gles2_helper_; + std::unique_ptr<TransferBuffer> transfer_buffer_; + std::unique_ptr<gles2::GLES2Implementation> gles2_implementation_; bool context_lost_allowed_; bool pause_commands_; uint32_t paused_order_num_;
diff --git a/gpu/command_buffer/tests/gl_readback_unittest.cc b/gpu/command_buffer/tests/gl_readback_unittest.cc index eaaa1bb59..c9038dc 100644 --- a/gpu/command_buffer/tests/gl_readback_unittest.cc +++ b/gpu/command_buffer/tests/gl_readback_unittest.cc
@@ -9,6 +9,7 @@ #include <stdint.h> #include <cmath> +#include <memory> #include "base/bind.h" #include "base/bit_cast.h" @@ -274,7 +275,7 @@ switch (read_type) { case GL_HALF_FLOAT_OES: { - scoped_ptr<GLushort[]> buf( + std::unique_ptr<GLushort[]> buf( new GLushort[kTextureSize * kTextureSize * read_comp_count]); glReadPixels( 0, 0, kTextureSize, kTextureSize, read_format, read_type, @@ -291,7 +292,7 @@ break; } case GL_FLOAT: { - scoped_ptr<GLfloat[]> buf( + std::unique_ptr<GLfloat[]> buf( new GLfloat[kTextureSize * kTextureSize * read_comp_count]); glReadPixels( 0, 0, kTextureSize, kTextureSize, read_format, read_type,
diff --git a/gpu/command_buffer/tests/gl_request_extension_unittest.cc b/gpu/command_buffer/tests/gl_request_extension_unittest.cc index c0a581f..6d440d2 100644 --- a/gpu/command_buffer/tests/gl_request_extension_unittest.cc +++ b/gpu/command_buffer/tests/gl_request_extension_unittest.cc
@@ -26,7 +26,7 @@ command_line.AppendSwitch(switches::kEnableUnsafeES3APIs); GLManager::Options options; options.context_type = GetParam(); - gl_.InitializeWithCommandLine(options, &command_line); + gl_.InitializeWithCommandLine(options, command_line); } void TearDown() override { gl_.Destroy(); } bool IsApplicable() const { return gl_.IsInitialized(); }
diff --git a/gpu/command_buffer/tests/gl_test_utils.cc b/gpu/command_buffer/tests/gl_test_utils.cc index d9a30ce9..b68320f 100644 --- a/gpu/command_buffer/tests/gl_test_utils.cc +++ b/gpu/command_buffer/tests/gl_test_utils.cc
@@ -8,9 +8,9 @@ #include <stdint.h> #include <stdio.h> +#include <memory> #include <string> -#include "base/memory/scoped_ptr.h" #include "base/strings/stringize_macros.h" #include "base/strings/stringprintf.h" #include "testing/gtest/include/gtest/gtest.h" @@ -201,7 +201,7 @@ GLint tolerance, const uint8_t* color) { GLsizei size = width * height * 4; - scoped_ptr<uint8_t[]> pixels(new uint8_t[size]); + std::unique_ptr<uint8_t[]> pixels(new uint8_t[size]); memset(pixels.get(), kCheckClearValue, size); glReadPixels(x, y, width, height, GL_RGBA, GL_UNSIGNED_BYTE, pixels.get()); int bad_count = 0; @@ -273,7 +273,7 @@ glPixelStorei(GL_PACK_ALIGNMENT, 1); int num_pixels = width * height; int size = num_pixels * 4; - scoped_ptr<uint8_t[]> data(new uint8_t[size]); + std::unique_ptr<uint8_t[]> data(new uint8_t[size]); uint8_t* pixels = data.get(); glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
diff --git a/gpu/command_buffer/tests/gl_unittest.cc b/gpu/command_buffer/tests/gl_unittest.cc index b7fcad69..8a713fcc 100644 --- a/gpu/command_buffer/tests/gl_unittest.cc +++ b/gpu/command_buffer/tests/gl_unittest.cc
@@ -6,6 +6,8 @@ #include <GLES2/gl2ext.h> #include <stdint.h> +#include <memory> + #include "gpu/command_buffer/service/feature_info.h" #include "gpu/command_buffer/tests/gl_manager.h" #include "gpu/command_buffer/tests/gl_test_utils.h" @@ -40,7 +42,7 @@ GLuint fbo = 0; glGenFramebuffers(1, &fbo); glBindTexture(GL_TEXTURE_2D, tex); - scoped_ptr<uint8_t[]> pixels(new uint8_t[16 * 16 * 4]); + std::unique_ptr<uint8_t[]> pixels(new uint8_t[16 * 16 * 4]); memset(pixels.get(), 0, 16*16*4); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 16, 16, 0, GL_RGBA, GL_UNSIGNED_BYTE, pixels.get()); @@ -99,7 +101,8 @@ } TEST_F(GLTest, FeatureFlagsMatchCapabilities) { - scoped_refptr<gles2::FeatureInfo> features = new gles2::FeatureInfo; + scoped_refptr<gles2::FeatureInfo> features = + new gles2::FeatureInfo(gl_.workarounds()); EXPECT_TRUE(features->InitializeForTesting()); const auto& caps = gl_.GetCapabilities(); const auto& flags = features->feature_flags();
diff --git a/gpu/config/BUILD.gn b/gpu/config/BUILD.gn index 57db87b..195f6e6 100644 --- a/gpu/config/BUILD.gn +++ b/gpu/config/BUILD.gn
@@ -41,6 +41,8 @@ "gpu_driver_bug_list.h", "gpu_driver_bug_list_json.cc", "gpu_driver_bug_workaround_type.h", + "gpu_driver_bug_workarounds.cc", + "gpu_driver_bug_workarounds.h", "gpu_dx_diagnostics_win.cc", "gpu_feature_type.h", "gpu_info.cc",
diff --git a/gpu/config/gpu_blacklist_unittest.cc b/gpu/config/gpu_blacklist_unittest.cc index 1c7211e..b5e27e7 100644 --- a/gpu/config/gpu_blacklist_unittest.cc +++ b/gpu/config/gpu_blacklist_unittest.cc
@@ -2,8 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "base/memory/scoped_ptr.h" #include "gpu/config/gpu_blacklist.h" + +#include <memory> + #include "gpu/config/gpu_control_list_jsons.h" #include "gpu/config/gpu_feature_type.h" #include "gpu/config/gpu_info.h" @@ -46,7 +48,7 @@ " ]\n" "}"; - scoped_ptr<GpuBlacklist> blacklist(GpuBlacklist::Create()); + std::unique_ptr<GpuBlacklist> blacklist(GpuBlacklist::Create()); EXPECT_TRUE(blacklist->LoadList(json, GpuBlacklist::kAllOs)); std::set<int> type = blacklist->MakeDecision( GpuBlacklist::kOsMacosx, kOsVersion, gpu_info()); @@ -74,7 +76,7 @@ }; TEST_F(GpuBlacklistTest, CurrentBlacklistValidation) { - scoped_ptr<GpuBlacklist> blacklist(GpuBlacklist::Create()); + std::unique_ptr<GpuBlacklist> blacklist(GpuBlacklist::Create()); EXPECT_TRUE(blacklist->LoadList( kSoftwareRenderingListJson, GpuBlacklist::kAllOs)); }
diff --git a/gpu/config/gpu_control_list.cc b/gpu/config/gpu_control_list.cc index 09f6d1e6..9ff8a4d2 100644 --- a/gpu/config/gpu_control_list.cc +++ b/gpu/config/gpu_control_list.cc
@@ -1363,7 +1363,7 @@ bool GpuControlList::LoadList( const std::string& json_context, GpuControlList::OsFilter os_filter) { - scoped_ptr<base::Value> root = base::JSONReader::Read(json_context); + std::unique_ptr<base::Value> root = base::JSONReader::Read(json_context); if (root.get() == NULL || !root->IsType(base::Value::TYPE_DICTIONARY)) return false;
diff --git a/gpu/config/gpu_control_list.h b/gpu/config/gpu_control_list.h index 47282381..5d297761 100644 --- a/gpu/config/gpu_control_list.h +++ b/gpu/config/gpu_control_list.h
@@ -8,13 +8,13 @@ #include <stddef.h> #include <stdint.h> +#include <memory> #include <set> #include <string> #include <vector> #include "base/containers/hash_tables.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "base/values.h" #include "build/build_config.h" #include "gpu/gpu_export.h" @@ -193,7 +193,7 @@ private: OsType type_; - scoped_ptr<VersionInfo> version_info_; + std::unique_ptr<VersionInfo> version_info_; }; class GPU_EXPORT FloatInfo { @@ -436,29 +436,29 @@ std::vector<int> cr_bugs_; std::vector<int> webkit_bugs_; std::vector<std::string> disabled_extensions_; - scoped_ptr<OsInfo> os_info_; + std::unique_ptr<OsInfo> os_info_; uint32_t vendor_id_; std::vector<uint32_t> device_id_list_; MultiGpuStyle multi_gpu_style_; MultiGpuCategory multi_gpu_category_; GLType gl_type_; std::string driver_vendor_info_; - scoped_ptr<VersionInfo> driver_version_info_; - scoped_ptr<VersionInfo> driver_date_info_; - scoped_ptr<VersionInfo> gl_version_info_; + std::unique_ptr<VersionInfo> driver_version_info_; + std::unique_ptr<VersionInfo> driver_date_info_; + std::unique_ptr<VersionInfo> gl_version_info_; std::string gl_vendor_info_; std::string gl_renderer_info_; std::string gl_extensions_info_; - scoped_ptr<IntInfo> gl_reset_notification_strategy_info_; + std::unique_ptr<IntInfo> gl_reset_notification_strategy_info_; std::string cpu_brand_; - scoped_ptr<FloatInfo> perf_graphics_info_; - scoped_ptr<FloatInfo> perf_gaming_info_; - scoped_ptr<FloatInfo> perf_overall_info_; + std::unique_ptr<FloatInfo> perf_graphics_info_; + std::unique_ptr<FloatInfo> perf_gaming_info_; + std::unique_ptr<FloatInfo> perf_overall_info_; std::vector<std::string> machine_model_name_list_; - scoped_ptr<VersionInfo> machine_model_version_info_; - scoped_ptr<IntInfo> gpu_count_info_; - scoped_ptr<BoolInfo> direct_rendering_info_; - scoped_ptr<BoolInfo> in_process_gpu_info_; + std::unique_ptr<VersionInfo> machine_model_version_info_; + std::unique_ptr<IntInfo> gpu_count_info_; + std::unique_ptr<BoolInfo> direct_rendering_info_; + std::unique_ptr<BoolInfo> in_process_gpu_info_; std::set<int> features_; std::vector<ScopedGpuControlListEntry> exceptions_; };
diff --git a/gpu/config/gpu_control_list_entry_unittest.cc b/gpu/config/gpu_control_list_entry_unittest.cc index 91504c1..f26e3ac 100644 --- a/gpu/config/gpu_control_list_entry_unittest.cc +++ b/gpu/config/gpu_control_list_entry_unittest.cc
@@ -4,6 +4,8 @@ #include <stddef.h> +#include <memory> + #include "base/json/json_reader.h" #include "gpu/config/gpu_control_list.h" #include "gpu/config/gpu_info.h" @@ -32,7 +34,7 @@ static ScopedEntry GetEntryFromString( const std::string& json, bool supports_feature_type_all) { - scoped_ptr<base::Value> root = base::JSONReader::Read(json); + std::unique_ptr<base::Value> root = base::JSONReader::Read(json); base::DictionaryValue* value = NULL; if (!root || !root->GetAsDictionary(&value)) return NULL;
diff --git a/gpu/config/gpu_control_list_unittest.cc b/gpu/config/gpu_control_list_unittest.cc index ee8597b3..f3a3c09 100644 --- a/gpu/config/gpu_control_list_unittest.cc +++ b/gpu/config/gpu_control_list_unittest.cc
@@ -4,9 +4,9 @@ #include <stdint.h> +#include <memory> #include <vector> -#include "base/memory/scoped_ptr.h" #include "gpu/config/gpu_control_list.h" #include "gpu/config/gpu_info.h" #include "testing/gtest/include/gtest/gtest.h" @@ -68,7 +68,7 @@ }; TEST_F(GpuControlListTest, DefaultControlListSettings) { - scoped_ptr<GpuControlList> control_list(Create()); + std::unique_ptr<GpuControlList> control_list(Create()); // Default control list settings: all feature are allowed. std::set<int> features = control_list->MakeDecision( GpuControlList::kOsMacosx, kOsVersion, gpu_info()); @@ -85,7 +85,7 @@ ] } ); - scoped_ptr<GpuControlList> control_list(Create()); + std::unique_ptr<GpuControlList> control_list(Create()); EXPECT_TRUE(control_list->LoadList(empty_list_json, GpuControlList::kAllOs)); @@ -124,7 +124,7 @@ ] } ); - scoped_ptr<GpuControlList> control_list(Create()); + std::unique_ptr<GpuControlList> control_list(Create()); EXPECT_TRUE(control_list->LoadList(exact_list_json, GpuControlList::kAllOs)); std::set<int> features = control_list->MakeDecision( @@ -162,7 +162,7 @@ ] } ); - scoped_ptr<GpuControlList> control_list(Create()); + std::unique_ptr<GpuControlList> control_list(Create()); // ControlList entries won't be filtered to the current OS only upon loading. EXPECT_TRUE(control_list->LoadList(vendor_json, GpuControlList::kAllOs)); @@ -214,7 +214,7 @@ ] } ); - scoped_ptr<GpuControlList> control_list(Create()); + std::unique_ptr<GpuControlList> control_list(Create()); EXPECT_FALSE(control_list->LoadList( unknown_field_json, GpuControlList::kAllOs)); @@ -253,7 +253,7 @@ ] } ); - scoped_ptr<GpuControlList> control_list(Create()); + std::unique_ptr<GpuControlList> control_list(Create()); EXPECT_FALSE(control_list->LoadList( unknown_exception_field_json, GpuControlList::kAllOs)); @@ -275,7 +275,7 @@ ] } ); - scoped_ptr<GpuControlList> control_list(Create()); + std::unique_ptr<GpuControlList> control_list(Create()); EXPECT_TRUE(control_list->LoadList(disabled_json, GpuControlList::kAllOs)); std::set<int> features = control_list->MakeDecision( GpuControlList::kOsWin, kOsVersion, gpu_info()); @@ -313,7 +313,7 @@ GPUInfo gpu_info; gpu_info.gpu.vendor_id = kNvidiaVendorId; - scoped_ptr<GpuControlList> control_list(Create()); + std::unique_ptr<GpuControlList> control_list(Create()); EXPECT_TRUE(control_list->LoadList(json, GpuControlList::kAllOs)); std::set<int> features = control_list->MakeDecision( @@ -360,7 +360,7 @@ GPUInfo gpu_info; gpu_info.gpu.vendor_id = kIntelVendorId; - scoped_ptr<GpuControlList> control_list(Create()); + std::unique_ptr<GpuControlList> control_list(Create()); EXPECT_TRUE(control_list->LoadList(json, GpuControlList::kAllOs)); // The case this entry does not apply. @@ -430,7 +430,7 @@ GPUInfo gpu_info; gpu_info.gpu.vendor_id = kIntelVendorId; - scoped_ptr<GpuControlList> control_list(Create()); + std::unique_ptr<GpuControlList> control_list(Create()); EXPECT_TRUE(control_list->LoadList(json, GpuControlList::kAllOs)); std::set<int> features = control_list->MakeDecision( GpuControlList::kOsLinux, kOsVersion, gpu_info); @@ -478,7 +478,7 @@ gpu_info.gpu.device_id = 0x2a02; gpu_info.driver_version = "9.1"; - scoped_ptr<GpuControlList> control_list(Create()); + std::unique_ptr<GpuControlList> control_list(Create()); EXPECT_TRUE(control_list->LoadList(json, GpuControlList::kAllOs)); std::set<int> features = control_list->MakeDecision( @@ -521,7 +521,7 @@ } ); - scoped_ptr<GpuControlList> control_list(Create()); + std::unique_ptr<GpuControlList> control_list(Create()); EXPECT_TRUE(control_list->LoadList(json, GpuControlList::kAllOs)); // Integrated GPU is active @@ -559,7 +559,7 @@ } ); - scoped_ptr<GpuControlList> control_list(Create()); + std::unique_ptr<GpuControlList> control_list(Create()); EXPECT_TRUE(control_list->LoadList(json, GpuControlList::kAllOs)); // Discrete GPU is active @@ -614,7 +614,7 @@ ] } ); - scoped_ptr<GpuControlList> control_list(Create()); + std::unique_ptr<GpuControlList> control_list(Create()); EXPECT_TRUE(control_list->LoadList(exact_list_json, GpuControlList::kAllOs)); GPUInfo gpu_info; @@ -648,7 +648,7 @@ ] } ); - scoped_ptr<GpuControlList> control_list(Create()); + std::unique_ptr<GpuControlList> control_list(Create()); EXPECT_TRUE(control_list->LoadList(exact_list_json, GpuControlList::kAllOs)); GPUInfo gpu_info; @@ -688,7 +688,7 @@ // Real case on Intel GMA* on Windows gpu_info.secondary_gpus.push_back(gpu_info.gpu); - scoped_ptr<GpuControlList> control_list(Create()); + std::unique_ptr<GpuControlList> control_list(Create()); EXPECT_TRUE(control_list->LoadList(json, GpuControlList::kAllOs)); std::set<int> features = control_list->MakeDecision( GpuControlList::kOsWin, kOsVersion, gpu_info);
diff --git a/gpu/config/gpu_driver_bug_list_unittest.cc b/gpu/config/gpu_driver_bug_list_unittest.cc index e7eaaa5..09612d2 100644 --- a/gpu/config/gpu_driver_bug_list_unittest.cc +++ b/gpu/config/gpu_driver_bug_list_unittest.cc
@@ -4,9 +4,10 @@ #include <stdint.h> +#include <memory> + #include "base/command_line.h" #include "base/logging.h" -#include "base/memory/scoped_ptr.h" #include "gpu/config/gpu_control_list_jsons.h" #include "gpu/config/gpu_driver_bug_list.h" #include "gpu/config/gpu_driver_bug_workaround_type.h" @@ -47,13 +48,13 @@ }; TEST_F(GpuDriverBugListTest, CurrentDriverBugListValidation) { - scoped_ptr<GpuDriverBugList> list(GpuDriverBugList::Create()); + std::unique_ptr<GpuDriverBugList> list(GpuDriverBugList::Create()); std::string json; EXPECT_TRUE(list->LoadList(kGpuDriverBugListJson, GpuControlList::kAllOs)); } TEST_F(GpuDriverBugListTest, CurrentListForARM) { - scoped_ptr<GpuDriverBugList> list(GpuDriverBugList::Create()); + std::unique_ptr<GpuDriverBugList> list(GpuDriverBugList::Create()); EXPECT_TRUE(list->LoadList(kGpuDriverBugListJson, GpuControlList::kAllOs)); GPUInfo gpu_info; @@ -65,7 +66,7 @@ } TEST_F(GpuDriverBugListTest, CurrentListForImagination) { - scoped_ptr<GpuDriverBugList> list(GpuDriverBugList::Create()); + std::unique_ptr<GpuDriverBugList> list(GpuDriverBugList::Create()); EXPECT_TRUE(list->LoadList(kGpuDriverBugListJson, GpuControlList::kAllOs)); GPUInfo gpu_info; @@ -103,7 +104,7 @@ ] } ); - scoped_ptr<GpuDriverBugList> driver_bug_list(GpuDriverBugList::Create()); + std::unique_ptr<GpuDriverBugList> driver_bug_list(GpuDriverBugList::Create()); EXPECT_TRUE(driver_bug_list->LoadList(json, GpuControlList::kAllOs)); std::set<int> switching = driver_bug_list->MakeDecision( GpuControlList::kOsMacosx, "10.8", gpu_info()); @@ -179,7 +180,7 @@ } ); - scoped_ptr<GpuDriverBugList> list(GpuDriverBugList::Create()); + std::unique_ptr<GpuDriverBugList> list(GpuDriverBugList::Create()); EXPECT_TRUE(list->LoadList(json, GpuControlList::kAllOs)); GPUInfo gpu_info;
diff --git a/gpu/config/gpu_driver_bug_workarounds.cc b/gpu/config/gpu_driver_bug_workarounds.cc new file mode 100644 index 0000000..f9bf4c3 --- /dev/null +++ b/gpu/config/gpu_driver_bug_workarounds.cc
@@ -0,0 +1,98 @@ +// 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 "gpu/config/gpu_driver_bug_workarounds.h" + +#include "base/command_line.h" +#include "base/strings/string_number_conversions.h" +#include "base/strings/string_split.h" +#include "gpu/config/gpu_switches.h" + +namespace { +// Process a string of wordaround type IDs (seperated by ',') and set up +// the corresponding Workaround flags. +void StringToWorkarounds(const std::string& types, + gpu::GpuDriverBugWorkarounds* workarounds) { + DCHECK(workarounds); + for (const base::StringPiece& piece : base::SplitStringPiece( + types, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL)) { + int number = 0; + bool succeed = base::StringToInt(piece, &number); + DCHECK(succeed); + switch (number) { +#define GPU_OP(type, name) \ + case gpu::type: \ + workarounds->name = true; \ + break; + GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) +#undef GPU_OP + default: + NOTIMPLEMENTED(); + } + } + if (workarounds->max_texture_size_limit_4096) + workarounds->max_texture_size = 4096; + if (workarounds->max_cube_map_texture_size_limit_4096) + workarounds->max_cube_map_texture_size = 4096; + if (workarounds->max_cube_map_texture_size_limit_1024) + workarounds->max_cube_map_texture_size = 1024; + if (workarounds->max_cube_map_texture_size_limit_512) + workarounds->max_cube_map_texture_size = 512; + + if (workarounds->max_fragment_uniform_vectors_32) + workarounds->max_fragment_uniform_vectors = 32; + if (workarounds->max_varying_vectors_16) + workarounds->max_varying_vectors = 16; + if (workarounds->max_vertex_uniform_vectors_256) + workarounds->max_vertex_uniform_vectors = 256; + + if (workarounds->max_copy_texture_chromium_size_1048576) + workarounds->max_copy_texture_chromium_size = 1048576; + if (workarounds->max_copy_texture_chromium_size_262144) + workarounds->max_copy_texture_chromium_size = 262144; +} + +} // anonymous namespace + +namespace gpu { + +GpuDriverBugWorkarounds::GpuDriverBugWorkarounds() + : +#define GPU_OP(type, name) name(false), + GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) +#undef GPU_OP + max_texture_size(0), + max_cube_map_texture_size(0), + max_fragment_uniform_vectors(0), + max_varying_vectors(0), + max_vertex_uniform_vectors(0), + max_copy_texture_chromium_size(0) { +} + +GpuDriverBugWorkarounds::GpuDriverBugWorkarounds( + const base::CommandLine* command_line) + : +#define GPU_OP(type, name) name(false), + GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) +#undef GPU_OP + max_texture_size(0), + max_cube_map_texture_size(0), + max_fragment_uniform_vectors(0), + max_varying_vectors(0), + max_vertex_uniform_vectors(0), + max_copy_texture_chromium_size(0) { + if (!command_line) + return; + + std::string types = + command_line->GetSwitchValueASCII(switches::kGpuDriverBugWorkarounds); + StringToWorkarounds(types, this); +} + +GpuDriverBugWorkarounds::GpuDriverBugWorkarounds( + const GpuDriverBugWorkarounds& other) = default; + +GpuDriverBugWorkarounds::~GpuDriverBugWorkarounds() {} + +} // namespace gpu
diff --git a/gpu/config/gpu_driver_bug_workarounds.h b/gpu/config/gpu_driver_bug_workarounds.h new file mode 100644 index 0000000..6c90d1b3 --- /dev/null +++ b/gpu/config/gpu_driver_bug_workarounds.h
@@ -0,0 +1,46 @@ +// 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 GPU_CONFIG_GPU_DRIVER_BUG_WORKAROUNDS_H_ +#define GPU_CONFIG_GPU_DRIVER_BUG_WORKAROUNDS_H_ + +#include "base/macros.h" +#include "build/build_config.h" +#include "gpu/config/gpu_driver_bug_workaround_type.h" +#include "gpu/gpu_export.h" + +// Forwardly declare a few GL types to avoid including GL header files. +typedef int GLint; + +namespace base { +class CommandLine; +} + +namespace gpu { + +class GPU_EXPORT GpuDriverBugWorkarounds { + public: + GpuDriverBugWorkarounds(); + explicit GpuDriverBugWorkarounds(const base::CommandLine* command_line); + + GpuDriverBugWorkarounds(const GpuDriverBugWorkarounds& other); + + ~GpuDriverBugWorkarounds(); + +#define GPU_OP(type, name) bool name; + GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) +#undef GPU_OP + + // Note: 0 here means use driver limit. + GLint max_texture_size; + GLint max_cube_map_texture_size; + GLint max_fragment_uniform_vectors; + GLint max_varying_vectors; + GLint max_vertex_uniform_vectors; + GLint max_copy_texture_chromium_size; +}; + +} // namespace gpu + +#endif // GPU_CONFIG_GPU_DRIVER_BUG_WORKAROUNDS_H_
diff --git a/gpu/config/gpu_info_collector.cc b/gpu/config/gpu_info_collector.cc index 44df9f1..499d0fb 100644 --- a/gpu/config/gpu_info_collector.cc +++ b/gpu/config/gpu_info_collector.cc
@@ -11,7 +11,6 @@ #include <vector> #include "base/logging.h" -#include "base/memory/scoped_ptr.h" #include "base/metrics/sparse_histogram.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_piece.h"
diff --git a/gpu/config/gpu_info_collector_linux.cc b/gpu/config/gpu_info_collector_linux.cc index 7fce931..74bc169 100644 --- a/gpu/config/gpu_info_collector_linux.cc +++ b/gpu/config/gpu_info_collector_linux.cc
@@ -12,7 +12,6 @@ #include "base/command_line.h" #include "base/files/file_util.h" #include "base/logging.h" -#include "base/memory/scoped_ptr.h" #include "base/message_loop/message_loop.h" #include "base/strings/string_piece.h" #include "base/strings/string_split.h"
diff --git a/gpu/config/gpu_info_collector_mac.mm b/gpu/config/gpu_info_collector_mac.mm index f6d81fd..0e7e010 100644 --- a/gpu/config/gpu_info_collector_mac.mm +++ b/gpu/config/gpu_info_collector_mac.mm
@@ -10,7 +10,6 @@ #include "base/mac/mac_util.h" #include "base/mac/scoped_cftyperef.h" #include "base/mac/scoped_ioobject.h" -#include "base/memory/scoped_ptr.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_piece.h" #include "base/strings/string_util.h"
diff --git a/gpu/config/gpu_info_collector_unittest.cc b/gpu/config/gpu_info_collector_unittest.cc index 3e35d00d..3e698d4 100644 --- a/gpu/config/gpu_info_collector_unittest.cc +++ b/gpu/config/gpu_info_collector_unittest.cc
@@ -5,7 +5,8 @@ #include <stddef.h> #include <stdint.h> -#include "base/memory/scoped_ptr.h" +#include <memory> + #include "base/strings/string_split.h" #include "gpu/config/gpu_info.h" #include "gpu/config/gpu_info_collector.h" @@ -173,7 +174,7 @@ public: // Use StrictMock to make 100% sure we know how GL will be called. - scoped_ptr< ::testing::StrictMock< ::gfx::MockGLInterface> > gl_; + std::unique_ptr<::testing::StrictMock<::gfx::MockGLInterface>> gl_; GPUInfo test_values_; const char* gl_shading_language_version_ = nullptr;
diff --git a/gpu/config/gpu_util.cc b/gpu/config/gpu_util.cc index 34fac587..525d3087 100644 --- a/gpu/config/gpu_util.cc +++ b/gpu/config/gpu_util.cc
@@ -4,6 +4,7 @@ #include "gpu/config/gpu_util.h" +#include <memory> #include <vector> #include "base/command_line.h" @@ -56,7 +57,7 @@ void ApplyGpuDriverBugWorkarounds(const GPUInfo& gpu_info, base::CommandLine* command_line) { - scoped_ptr<GpuDriverBugList> list(GpuDriverBugList::Create()); + std::unique_ptr<GpuDriverBugList> list(GpuDriverBugList::Create()); list->LoadList(kGpuDriverBugListJson, GpuControlList::kCurrentOsOnly); std::set<int> workarounds = list->MakeDecision(
diff --git a/gpu/config/gpu_util_unittest.cc b/gpu/config/gpu_util_unittest.cc index fb7fd2be..4a7701e 100644 --- a/gpu/config/gpu_util_unittest.cc +++ b/gpu/config/gpu_util_unittest.cc
@@ -3,7 +3,9 @@ // found in the LICENSE file. #include "gpu/config/gpu_util.h" -#include "base/memory/scoped_ptr.h" + +#include <memory> + #include "base/strings/string_split.h" #include "gpu/config/gpu_control_list_jsons.h" #include "gpu/config/gpu_driver_bug_list.h" @@ -79,7 +81,7 @@ ApplyGpuDriverBugWorkarounds_DisabledExtensions) { GPUInfo gpu_info; CollectBasicGraphicsInfo(&gpu_info); - scoped_ptr<GpuDriverBugList> list(GpuDriverBugList::Create()); + std::unique_ptr<GpuDriverBugList> list(GpuDriverBugList::Create()); list->LoadList(kGpuDriverBugListJson, GpuControlList::kCurrentOsOnly); list->MakeDecision(GpuControlList::kOsAny, std::string(), gpu_info); std::vector<std::string> expected_disabled_extensions =
diff --git a/gpu/gles2_conform_support/egl/display.cc b/gpu/gles2_conform_support/egl/display.cc index a19718b..f1ce3a23 100644 --- a/gpu/gles2_conform_support/egl/display.cc +++ b/gpu/gles2_conform_support/egl/display.cc
@@ -11,6 +11,7 @@ #include "base/at_exit.h" #include "base/bind.h" #include "base/bind_helpers.h" +#include "base/command_line.h" #include "base/lazy_instance.h" #include "gpu/command_buffer/client/gles2_implementation.h" #include "gpu/command_buffer/client/gles2_lib.h" @@ -69,6 +70,7 @@ Display::Display(EGLNativeDisplayType display_id) : display_id_(display_id), + gpu_driver_bug_workarounds_(base::CommandLine::ForCurrentProcess()), is_initialized_(false), create_offscreen_(false), create_offscreen_width_(0), @@ -160,15 +162,18 @@ transfer_buffer_manager_ = manager; manager->Initialize(); } - scoped_ptr<gpu::CommandBufferService> command_buffer( + std::unique_ptr<gpu::CommandBufferService> command_buffer( new gpu::CommandBufferService(transfer_buffer_manager_.get())); if (!command_buffer->Initialize()) return NULL; + scoped_refptr<gpu::gles2::FeatureInfo> feature_info( + new gpu::gles2::FeatureInfo(gpu_driver_bug_workarounds_)); scoped_refptr<gpu::gles2::ContextGroup> group(new gpu::gles2::ContextGroup( gpu_preferences_, NULL, NULL, new gpu::gles2::ShaderTranslatorCache(gpu_preferences_), - new gpu::gles2::FramebufferCompletenessCache, NULL, NULL, NULL, true)); + new gpu::gles2::FramebufferCompletenessCache, feature_info, NULL, NULL, + true)); decoder_.reset(gpu::gles2::GLES2Decoder::Create(group.get())); if (!decoder_.get()) @@ -228,13 +233,13 @@ command_buffer->SetGetBufferChangeCallback(base::Bind( &gpu::CommandExecutor::SetGetBuffer, base::Unretained(executor_.get()))); - scoped_ptr<gpu::gles2::GLES2CmdHelper> cmd_helper( + std::unique_ptr<gpu::gles2::GLES2CmdHelper> cmd_helper( new gpu::gles2::GLES2CmdHelper(command_buffer.get())); if (!cmd_helper->Initialize(kCommandBufferSize)) return NULL; - scoped_ptr<gpu::TransferBuffer> transfer_buffer(new gpu::TransferBuffer( - cmd_helper.get())); + std::unique_ptr<gpu::TransferBuffer> transfer_buffer( + new gpu::TransferBuffer(cmd_helper.get())); command_buffer_.reset(command_buffer.release()); transfer_buffer_.reset(transfer_buffer.release());
diff --git a/gpu/gles2_conform_support/egl/display.h b/gpu/gles2_conform_support/egl/display.h index 52252323..7e724fc 100644 --- a/gpu/gles2_conform_support/egl/display.h +++ b/gpu/gles2_conform_support/egl/display.h
@@ -9,14 +9,16 @@ #include <stddef.h> #include <stdint.h> +#include <memory> + #include "base/macros.h" -#include "base/memory/scoped_ptr.h" #include "gpu/command_buffer/client/gles2_cmd_helper.h" #include "gpu/command_buffer/client/gpu_control.h" #include "gpu/command_buffer/service/command_buffer_service.h" #include "gpu/command_buffer/service/command_executor.h" #include "gpu/command_buffer/service/gles2_cmd_decoder.h" #include "gpu/command_buffer/service/gpu_preferences.h" +#include "gpu/config/gpu_driver_bug_workarounds.h" #include "ui/gfx/native_widget_types.h" #include "ui/gl/gl_context.h" #include "ui/gl/gl_surface.h" @@ -108,6 +110,7 @@ EGLNativeDisplayType display_id_; gpu::GpuPreferences gpu_preferences_; + const gpu::GpuDriverBugWorkarounds gpu_driver_bug_workarounds_; bool is_initialized_; bool create_offscreen_; @@ -116,18 +119,18 @@ uint64_t next_fence_sync_release_; scoped_refptr<gpu::TransferBufferManagerInterface> transfer_buffer_manager_; - scoped_ptr<gpu::CommandBufferService> command_buffer_; - scoped_ptr<gpu::CommandExecutor> executor_; - scoped_ptr<gpu::gles2::GLES2Decoder> decoder_; + std::unique_ptr<gpu::CommandBufferService> command_buffer_; + std::unique_ptr<gpu::CommandExecutor> executor_; + std::unique_ptr<gpu::gles2::GLES2Decoder> decoder_; scoped_refptr<gfx::GLContext> gl_context_; scoped_refptr<gfx::GLSurface> gl_surface_; - scoped_ptr<gpu::gles2::GLES2CmdHelper> gles2_cmd_helper_; - scoped_ptr<gpu::TransferBuffer> transfer_buffer_; + std::unique_ptr<gpu::gles2::GLES2CmdHelper> gles2_cmd_helper_; + std::unique_ptr<gpu::TransferBuffer> transfer_buffer_; // TODO(alokp): Support more than one config, surface, and context. - scoped_ptr<Config> config_; - scoped_ptr<Surface> surface_; - scoped_ptr<gpu::gles2::GLES2Implementation> context_; + std::unique_ptr<Config> config_; + std::unique_ptr<Surface> surface_; + std::unique_ptr<gpu::gles2::GLES2Implementation> context_; DISALLOW_COPY_AND_ASSIGN(Display); };
diff --git a/gpu/gles2_conform_support/egl/egl.cc b/gpu/gles2_conform_support/egl/egl.cc index 5a81954b..0435067 100644 --- a/gpu/gles2_conform_support/egl/egl.cc +++ b/gpu/gles2_conform_support/egl/egl.cc
@@ -5,6 +5,8 @@ #include <EGL/egl.h> #include <stdint.h> +#include <memory> + #include "base/command_line.h" #include "base/environment.h" #include "base/strings/string_split.h" @@ -116,7 +118,7 @@ // being called multiple times. if (gfx::GetGLImplementation() == gfx::kGLImplementationNone) { base::CommandLine::StringVector argv; - scoped_ptr<base::Environment> env(base::Environment::Create()); + std::unique_ptr<base::Environment> env(base::Environment::Create()); std::string env_string; env->GetVar("CHROME_COMMAND_BUFFER_GLES2_ARGS", &env_string); #if defined(OS_WIN)
diff --git a/gpu/gles2_conform_support/native/main.cc b/gpu/gles2_conform_support/native/main.cc index be1fa72..672b212 100644 --- a/gpu/gles2_conform_support/native/main.cc +++ b/gpu/gles2_conform_support/native/main.cc
@@ -4,9 +4,10 @@ #include <stddef.h> +#include <memory> + #include "base/at_exit.h" #include "base/command_line.h" -#include "base/memory/scoped_ptr.h" #include "base/message_loop/message_loop.h" #if defined(OS_MACOSX) #include "base/mac/scoped_nsautorelease_pool.h" @@ -36,7 +37,7 @@ base::mac::ScopedNSAutoreleasePool pool; #endif - scoped_ptr<const char*[]> argsArray(new const char*[args.size()+1]); + std::unique_ptr<const char* []> argsArray(new const char*[args.size() + 1]); argsArray[0] = argv[0]; #if defined(OS_WIN)
diff --git a/gpu/gpu_config.gypi b/gpu/gpu_config.gypi index 6869199..df9b3599 100644 --- a/gpu/gpu_config.gypi +++ b/gpu/gpu_config.gypi
@@ -23,6 +23,8 @@ 'config/gpu_driver_bug_list.h', 'config/gpu_driver_bug_list_json.cc', 'config/gpu_driver_bug_workaround_type.h', + 'config/gpu_driver_bug_workarounds.cc', + 'config/gpu_driver_bug_workarounds.h', 'config/gpu_dx_diagnostics_win.cc', 'config/gpu_feature_type.h', 'config/gpu_info.cc',
diff --git a/gpu/gpu_ipc_client.gypi b/gpu/gpu_ipc_client.gypi index 0aa89005..6ca3c0e0 100644 --- a/gpu/gpu_ipc_client.gypi +++ b/gpu/gpu_ipc_client.gypi
@@ -8,11 +8,11 @@ '../ipc/ipc.gyp:ipc', '../third_party/khronos/khronos.gyp:khronos_headers', '../ui/base/ui_base.gyp:ui_base', + '../ui/events/events.gyp:events_base', + '../ui/events/events.gyp:events_ipc', '../ui/gfx/gfx.gyp:gfx_geometry', '../ui/gfx/ipc/gfx_ipc.gyp:gfx_ipc', '../ui/gl/gl.gyp:gl', - '../ui/latency_info/latency_info.gyp:latency_info', - '../ui/latency_info/latency_info.gyp:latency_info_ipc', '../url/url.gyp:url_lib', '../url/ipc/url_ipc.gyp:url_ipc', ],
diff --git a/gpu/gpu_ipc_common.gypi b/gpu/gpu_ipc_common.gypi index 05e7c44b..9e9ea60 100644 --- a/gpu/gpu_ipc_common.gypi +++ b/gpu/gpu_ipc_common.gypi
@@ -8,10 +8,11 @@ '../ipc/ipc.gyp:ipc', '../third_party/khronos/khronos.gyp:khronos_headers', '../ui/base/ui_base.gyp:ui_base', + '../ui/events/events.gyp:events_base', + '../ui/events/events.gyp:events_ipc', '../ui/gfx/gfx.gyp:gfx_geometry', '../ui/gfx/ipc/gfx_ipc.gyp:gfx_ipc', '../ui/gl/gl.gyp:gl', - '../ui/latency_info/latency_info.gyp:latency_info_ipc', '../url/url.gyp:url_lib', '../url/ipc/url_ipc.gyp:url_ipc', ],
diff --git a/gpu/gpu_ipc_service.gypi b/gpu/gpu_ipc_service.gypi index 8a8b63618..8865814 100644 --- a/gpu/gpu_ipc_service.gypi +++ b/gpu/gpu_ipc_service.gypi
@@ -6,10 +6,11 @@ 'dependencies': [ '../base/base.gyp:base', '../ipc/ipc.gyp:ipc', + '../ui/events/events.gyp:events_base', + '../ui/events/events.gyp:events_ipc', '../ui/gfx/gfx.gyp:gfx', '../ui/gfx/gfx.gyp:gfx_geometry', '../ui/gl/gl.gyp:gl', - '../ui/latency_info/latency_info.gyp:latency_info_ipc', '../url/url.gyp:url_lib', ], 'include_dirs': [
diff --git a/gpu/ipc/client/BUILD.gn b/gpu/ipc/client/BUILD.gn index 2c0f88d..f77d1fe 100644 --- a/gpu/ipc/client/BUILD.gn +++ b/gpu/ipc/client/BUILD.gn
@@ -57,9 +57,9 @@ "//gpu/config:config_sources", "//gpu/ipc/common:ipc_common_sources", "//ipc", + "//ui/events/ipc", "//ui/gfx/ipc", "//ui/gl", - "//ui/latency_info/ipc", "//url/ipc:url_ipc", ] if (use_ozone) {
diff --git a/gpu/ipc/client/DEPS b/gpu/ipc/client/DEPS index e90ac2e..45e1d3de 100644 --- a/gpu/ipc/client/DEPS +++ b/gpu/ipc/client/DEPS
@@ -1,5 +1,6 @@ include_rules = [ "+base", "+ipc", - "+ui/latency_info", + "+ui/events", + "+ui/base", ]
diff --git a/gpu/ipc/client/command_buffer_proxy_impl.cc b/gpu/ipc/client/command_buffer_proxy_impl.cc index eaa2ff1..7587212 100644 --- a/gpu/ipc/client/command_buffer_proxy_impl.cc +++ b/gpu/ipc/client/command_buffer_proxy_impl.cc
@@ -69,7 +69,7 @@ } bool CommandBufferProxyImpl::OnMessageReceived(const IPC::Message& message) { - scoped_ptr<base::AutoLock> lock; + std::unique_ptr<base::AutoLock> lock; if (lock_) lock.reset(new base::AutoLock(*lock_)); bool handled = true; @@ -92,7 +92,7 @@ } void CommandBufferProxyImpl::OnChannelError() { - scoped_ptr<base::AutoLock> lock; + std::unique_ptr<base::AutoLock> lock; if (lock_) lock.reset(new base::AutoLock(*lock_)); @@ -135,7 +135,7 @@ } void CommandBufferProxyImpl::AddDeletionObserver(DeletionObserver* observer) { - scoped_ptr<base::AutoLock> lock; + std::unique_ptr<base::AutoLock> lock; if (lock_) lock.reset(new base::AutoLock(*lock_)); deletion_observers_.AddObserver(observer); @@ -143,7 +143,7 @@ void CommandBufferProxyImpl::RemoveDeletionObserver( DeletionObserver* observer) { - scoped_ptr<base::AutoLock> lock; + std::unique_ptr<base::AutoLock> lock; if (lock_) lock.reset(new base::AutoLock(*lock_)); deletion_observers_.RemoveObserver(observer); @@ -346,7 +346,7 @@ int32_t new_id = channel_->ReserveTransferBufferId(); - scoped_ptr<base::SharedMemory> shared_memory( + std::unique_ptr<base::SharedMemory> shared_memory( channel_->factory()->AllocateSharedMemory(size)); if (!shared_memory) { if (last_state_.error == gpu::error::kNoError) @@ -475,7 +475,7 @@ unsigned internal_format, unsigned usage) { CheckLock(); - scoped_ptr<gfx::GpuMemoryBuffer> buffer( + std::unique_ptr<gfx::GpuMemoryBuffer> buffer( channel_->gpu_memory_buffer_manager()->AllocateGpuMemoryBuffer( gfx::Size(width, height), gpu::DefaultBufferFormatForImageFormat(internal_format), @@ -719,7 +719,7 @@ } void CommandBufferProxyImpl::InvalidGpuReplyOnClientThread() { - scoped_ptr<base::AutoLock> lock; + std::unique_ptr<base::AutoLock> lock; if (lock_) lock.reset(new base::AutoLock(*lock_)); OnDestroyed(gpu::error::kInvalidGpuMessage, gpu::error::kLostContext);
diff --git a/gpu/ipc/client/command_buffer_proxy_impl.h b/gpu/ipc/client/command_buffer_proxy_impl.h index 7a200de..453d7b79 100644 --- a/gpu/ipc/client/command_buffer_proxy_impl.h +++ b/gpu/ipc/client/command_buffer_proxy_impl.h
@@ -9,6 +9,7 @@ #include <stdint.h> #include <map> +#include <memory> #include <queue> #include <string> @@ -27,8 +28,8 @@ #include "gpu/command_buffer/common/gpu_memory_allocation.h" #include "gpu/gpu_export.h" #include "ipc/ipc_listener.h" +#include "ui/events/latency_info.h" #include "ui/gfx/swap_result.h" -#include "ui/latency_info/latency_info.h" struct GPUCommandBufferConsoleMessage; @@ -207,7 +208,7 @@ State last_state_; // The shared memory area used to update state. - scoped_ptr<base::SharedMemory> shared_state_shm_; + std::unique_ptr<base::SharedMemory> shared_state_shm_; // |*this| is owned by |*channel_| and so is always outlived by it, so using a // raw pointer is ok.
diff --git a/gpu/ipc/client/gpu_channel_host.cc b/gpu/ipc/client/gpu_channel_host.cc index 54ad6a93..68ed8cc 100644 --- a/gpu/ipc/client/gpu_channel_host.cc +++ b/gpu/ipc/client/gpu_channel_host.cc
@@ -10,6 +10,7 @@ #include "base/atomic_sequence_num.h" #include "base/bind.h" #include "base/location.h" +#include "base/memory/ptr_util.h" #include "base/posix/eintr_wrapper.h" #include "base/profiler/scoped_tracker.h" #include "base/single_thread_task_runner.h" @@ -100,7 +101,7 @@ bool GpuChannelHost::Send(IPC::Message* msg) { // Callee takes ownership of message, regardless of whether Send is // successful. See IPC::Sender. - scoped_ptr<IPC::Message> message(msg); + std::unique_ptr<IPC::Message> message(msg); // The GPU process never sends synchronous IPCs so clear the unblock flag to // preserve order. message->set_unblock(false); @@ -188,7 +189,7 @@ flush_info->flushed_stream_flush_id = flush_info->flush_id; } -scoped_ptr<CommandBufferProxyImpl> GpuChannelHost::CreateCommandBuffer( +std::unique_ptr<CommandBufferProxyImpl> GpuChannelHost::CreateCommandBuffer( gpu::SurfaceHandle surface_handle, const gfx::Size& size, CommandBufferProxyImpl* share_group, @@ -234,8 +235,8 @@ return nullptr; } - scoped_ptr<CommandBufferProxyImpl> command_buffer = - make_scoped_ptr(new CommandBufferProxyImpl(this, route_id, stream_id)); + std::unique_ptr<CommandBufferProxyImpl> command_buffer = + base::WrapUnique(new CommandBufferProxyImpl(this, route_id, stream_id)); AddRoute(route_id, command_buffer->AsWeakPtr()); return command_buffer;
diff --git a/gpu/ipc/client/gpu_channel_host.h b/gpu/ipc/client/gpu_channel_host.h index f2c27e1..94407d1 100644 --- a/gpu/ipc/client/gpu_channel_host.h +++ b/gpu/ipc/client/gpu_channel_host.h
@@ -8,6 +8,7 @@ #include <stddef.h> #include <stdint.h> +#include <memory> #include <string> #include <vector> @@ -15,7 +16,6 @@ #include "base/containers/scoped_ptr_hash_map.h" #include "base/macros.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/process/process.h" #include "base/synchronization/lock.h" @@ -27,10 +27,10 @@ #include "ipc/ipc_sync_channel.h" #include "ipc/message_filter.h" #include "ipc/message_router.h" +#include "ui/events/latency_info.h" #include "ui/gfx/geometry/size.h" #include "ui/gfx/gpu_memory_buffer.h" #include "ui/gl/gpu_preference.h" -#include "ui/latency_info/latency_info.h" class GURL; @@ -57,7 +57,8 @@ virtual bool IsMainThread() = 0; virtual scoped_refptr<base::SingleThreadTaskRunner> GetIOThreadTaskRunner() = 0; - virtual scoped_ptr<base::SharedMemory> AllocateSharedMemory(size_t size) = 0; + virtual std::unique_ptr<base::SharedMemory> AllocateSharedMemory( + size_t size) = 0; }; // Encapsulates an IPC channel between the client and one GPU process. @@ -108,7 +109,7 @@ void FlushPendingStream(int32_t stream_id); // Create and connect to a command buffer in the GPU process. - scoped_ptr<CommandBufferProxyImpl> CreateCommandBuffer( + std::unique_ptr<CommandBufferProxyImpl> CreateCommandBuffer( gpu::SurfaceHandle surface_handle, const gfx::Size& size, CommandBufferProxyImpl* share_group, @@ -289,7 +290,7 @@ // Protects channel_ and stream_flush_info_. mutable base::Lock context_lock_; - scoped_ptr<IPC::SyncChannel> channel_; + std::unique_ptr<IPC::SyncChannel> channel_; base::hash_map<int32_t, StreamFlushInfo> stream_flush_info_; DISALLOW_COPY_AND_ASSIGN(GpuChannelHost);
diff --git a/gpu/ipc/client/gpu_memory_buffer_impl.cc b/gpu/ipc/client/gpu_memory_buffer_impl.cc index a1867d67..e2ac46e 100644 --- a/gpu/ipc/client/gpu_memory_buffer_impl.cc +++ b/gpu/ipc/client/gpu_memory_buffer_impl.cc
@@ -38,7 +38,7 @@ } // static -scoped_ptr<GpuMemoryBufferImpl> GpuMemoryBufferImpl::CreateFromHandle( +std::unique_ptr<GpuMemoryBufferImpl> GpuMemoryBufferImpl::CreateFromHandle( const gfx::GpuMemoryBufferHandle& handle, const gfx::Size& size, gfx::BufferFormat format,
diff --git a/gpu/ipc/client/gpu_memory_buffer_impl.h b/gpu/ipc/client/gpu_memory_buffer_impl.h index f8b8fc0..8439d0f4 100644 --- a/gpu/ipc/client/gpu_memory_buffer_impl.h +++ b/gpu/ipc/client/gpu_memory_buffer_impl.h
@@ -5,9 +5,10 @@ #ifndef GPU_IPC_CLIENT_GPU_MEMORY_BUFFER_IMPL_H_ #define GPU_IPC_CLIENT_GPU_MEMORY_BUFFER_IMPL_H_ +#include <memory> + #include "base/callback.h" #include "base/macros.h" -#include "base/memory/scoped_ptr.h" #include "gpu/command_buffer/common/sync_token.h" #include "gpu/gpu_export.h" #include "ui/gfx/geometry/size.h" @@ -26,7 +27,7 @@ // should match what was used to allocate the |handle|. |callback| is // called when instance is deleted, which is not necessarily on the same // thread as this function was called on and instance was created on. - static scoped_ptr<GpuMemoryBufferImpl> CreateFromHandle( + static std::unique_ptr<GpuMemoryBufferImpl> CreateFromHandle( const gfx::GpuMemoryBufferHandle& handle, const gfx::Size& size, gfx::BufferFormat format,
diff --git a/gpu/ipc/client/gpu_memory_buffer_impl_io_surface.cc b/gpu/ipc/client/gpu_memory_buffer_impl_io_surface.cc index 7c2bb9f..b6d5c369 100644 --- a/gpu/ipc/client/gpu_memory_buffer_impl_io_surface.cc +++ b/gpu/ipc/client/gpu_memory_buffer_impl_io_surface.cc
@@ -5,6 +5,7 @@ #include "gpu/ipc/client/gpu_memory_buffer_impl_io_surface.h" #include "base/logging.h" +#include "base/memory/ptr_util.h" #include "gpu/ipc/common/gpu_memory_buffer_support.h" #include "ui/gfx/buffer_format_util.h" #include "ui/gfx/mac/io_surface.h" @@ -43,7 +44,7 @@ GpuMemoryBufferImplIOSurface::~GpuMemoryBufferImplIOSurface() {} // static -scoped_ptr<GpuMemoryBufferImplIOSurface> +std::unique_ptr<GpuMemoryBufferImplIOSurface> GpuMemoryBufferImplIOSurface::CreateFromHandle( const gfx::GpuMemoryBufferHandle& handle, const gfx::Size& size, @@ -55,7 +56,7 @@ if (!io_surface) return nullptr; - return make_scoped_ptr( + return base::WrapUnique( new GpuMemoryBufferImplIOSurface(handle.id, size, format, callback, io_surface.release(), LockFlags(usage))); }
diff --git a/gpu/ipc/client/gpu_memory_buffer_impl_io_surface.h b/gpu/ipc/client/gpu_memory_buffer_impl_io_surface.h index 1102274eaf..3a5a343 100644 --- a/gpu/ipc/client/gpu_memory_buffer_impl_io_surface.h +++ b/gpu/ipc/client/gpu_memory_buffer_impl_io_surface.h
@@ -9,6 +9,8 @@ #include <stddef.h> #include <stdint.h> +#include <memory> + #include "base/mac/scoped_cftyperef.h" #include "base/macros.h" #include "gpu/gpu_export.h" @@ -21,7 +23,7 @@ public: ~GpuMemoryBufferImplIOSurface() override; - static scoped_ptr<GpuMemoryBufferImplIOSurface> CreateFromHandle( + static std::unique_ptr<GpuMemoryBufferImplIOSurface> CreateFromHandle( const gfx::GpuMemoryBufferHandle& handle, const gfx::Size& size, gfx::BufferFormat format,
diff --git a/gpu/ipc/client/gpu_memory_buffer_impl_ozone_native_pixmap.cc b/gpu/ipc/client/gpu_memory_buffer_impl_ozone_native_pixmap.cc index 7554f3e..f050ef3 100644 --- a/gpu/ipc/client/gpu_memory_buffer_impl_ozone_native_pixmap.cc +++ b/gpu/ipc/client/gpu_memory_buffer_impl_ozone_native_pixmap.cc
@@ -6,6 +6,7 @@ #include <utility> +#include "base/memory/ptr_util.h" #include "gpu/ipc/common/gpu_memory_buffer_support.h" #include "ui/gfx/buffer_format_util.h" #include "ui/ozone/public/client_native_pixmap_factory.h" @@ -28,7 +29,7 @@ const gfx::Size& size, gfx::BufferFormat format, const DestructionCallback& callback, - scoped_ptr<ui::ClientNativePixmap> pixmap) + std::unique_ptr<ui::ClientNativePixmap> pixmap) : GpuMemoryBufferImpl(id, size, format, callback), pixmap_(std::move(pixmap)), data_(nullptr) {} @@ -36,18 +37,18 @@ GpuMemoryBufferImplOzoneNativePixmap::~GpuMemoryBufferImplOzoneNativePixmap() {} // static -scoped_ptr<GpuMemoryBufferImplOzoneNativePixmap> +std::unique_ptr<GpuMemoryBufferImplOzoneNativePixmap> GpuMemoryBufferImplOzoneNativePixmap::CreateFromHandle( const gfx::GpuMemoryBufferHandle& handle, const gfx::Size& size, gfx::BufferFormat format, gfx::BufferUsage usage, const DestructionCallback& callback) { - scoped_ptr<ui::ClientNativePixmap> native_pixmap = + std::unique_ptr<ui::ClientNativePixmap> native_pixmap = ui::ClientNativePixmapFactory::GetInstance()->ImportFromHandle( handle.native_pixmap_handle, size, usage); DCHECK(native_pixmap); - return make_scoped_ptr(new GpuMemoryBufferImplOzoneNativePixmap( + return base::WrapUnique(new GpuMemoryBufferImplOzoneNativePixmap( handle.id, size, format, callback, std::move(native_pixmap))); }
diff --git a/gpu/ipc/client/gpu_memory_buffer_impl_ozone_native_pixmap.h b/gpu/ipc/client/gpu_memory_buffer_impl_ozone_native_pixmap.h index 3ec59e9..44b53df 100644 --- a/gpu/ipc/client/gpu_memory_buffer_impl_ozone_native_pixmap.h +++ b/gpu/ipc/client/gpu_memory_buffer_impl_ozone_native_pixmap.h
@@ -7,6 +7,8 @@ #include <stddef.h> +#include <memory> + #include "base/macros.h" #include "gpu/gpu_export.h" #include "gpu/ipc/client/gpu_memory_buffer_impl.h" @@ -23,7 +25,7 @@ public: ~GpuMemoryBufferImplOzoneNativePixmap() override; - static scoped_ptr<GpuMemoryBufferImplOzoneNativePixmap> CreateFromHandle( + static std::unique_ptr<GpuMemoryBufferImplOzoneNativePixmap> CreateFromHandle( const gfx::GpuMemoryBufferHandle& handle, const gfx::Size& size, gfx::BufferFormat format, @@ -51,9 +53,9 @@ const gfx::Size& size, gfx::BufferFormat format, const DestructionCallback& callback, - scoped_ptr<ui::ClientNativePixmap> native_pixmap); + std::unique_ptr<ui::ClientNativePixmap> native_pixmap); - scoped_ptr<ui::ClientNativePixmap> pixmap_; + std::unique_ptr<ui::ClientNativePixmap> pixmap_; void* data_; DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferImplOzoneNativePixmap);
diff --git a/gpu/ipc/client/gpu_memory_buffer_impl_shared_memory.cc b/gpu/ipc/client/gpu_memory_buffer_impl_shared_memory.cc index ef817243..40345fb 100644 --- a/gpu/ipc/client/gpu_memory_buffer_impl_shared_memory.cc +++ b/gpu/ipc/client/gpu_memory_buffer_impl_shared_memory.cc
@@ -8,6 +8,7 @@ #include <utility> #include "base/bind.h" +#include "base/memory/ptr_util.h" #include "base/numerics/safe_math.h" #include "base/process/memory.h" #include "ui/gfx/buffer_format_util.h" @@ -25,7 +26,7 @@ const gfx::Size& size, gfx::BufferFormat format, const DestructionCallback& callback, - scoped_ptr<base::SharedMemory> shared_memory, + std::unique_ptr<base::SharedMemory> shared_memory, size_t offset, int stride) : GpuMemoryBufferImpl(id, size, format, callback), @@ -38,7 +39,7 @@ GpuMemoryBufferImplSharedMemory::~GpuMemoryBufferImplSharedMemory() {} // static -scoped_ptr<GpuMemoryBufferImplSharedMemory> +std::unique_ptr<GpuMemoryBufferImplSharedMemory> GpuMemoryBufferImplSharedMemory::Create(gfx::GpuMemoryBufferId id, const gfx::Size& size, gfx::BufferFormat format, @@ -47,11 +48,11 @@ if (!gfx::BufferSizeForBufferFormatChecked(size, format, &buffer_size)) return nullptr; - scoped_ptr<base::SharedMemory> shared_memory(new base::SharedMemory()); + std::unique_ptr<base::SharedMemory> shared_memory(new base::SharedMemory()); if (!shared_memory->CreateAndMapAnonymous(buffer_size)) return nullptr; - return make_scoped_ptr(new GpuMemoryBufferImplSharedMemory( + return base::WrapUnique(new GpuMemoryBufferImplSharedMemory( id, size, format, callback, std::move(shared_memory), 0, gfx::RowSizeForBufferFormat(size.width(), format, 0))); } @@ -82,7 +83,7 @@ } // static -scoped_ptr<GpuMemoryBufferImplSharedMemory> +std::unique_ptr<GpuMemoryBufferImplSharedMemory> GpuMemoryBufferImplSharedMemory::CreateFromHandle( const gfx::GpuMemoryBufferHandle& handle, const gfx::Size& size, @@ -91,9 +92,9 @@ const DestructionCallback& callback) { DCHECK(base::SharedMemory::IsHandleValid(handle.handle)); - return make_scoped_ptr(new GpuMemoryBufferImplSharedMemory( + return base::WrapUnique(new GpuMemoryBufferImplSharedMemory( handle.id, size, format, callback, - make_scoped_ptr(new base::SharedMemory(handle.handle, false)), + base::WrapUnique(new base::SharedMemory(handle.handle, false)), handle.offset, handle.stride)); }
diff --git a/gpu/ipc/client/gpu_memory_buffer_impl_shared_memory.h b/gpu/ipc/client/gpu_memory_buffer_impl_shared_memory.h index 3271c1a6..0ad9e3f 100644 --- a/gpu/ipc/client/gpu_memory_buffer_impl_shared_memory.h +++ b/gpu/ipc/client/gpu_memory_buffer_impl_shared_memory.h
@@ -7,6 +7,8 @@ #include <stddef.h> +#include <memory> + #include "base/macros.h" #include "gpu/gpu_export.h" #include "gpu/ipc/client/gpu_memory_buffer_impl.h" @@ -18,7 +20,7 @@ public: ~GpuMemoryBufferImplSharedMemory() override; - static scoped_ptr<GpuMemoryBufferImplSharedMemory> Create( + static std::unique_ptr<GpuMemoryBufferImplSharedMemory> Create( gfx::GpuMemoryBufferId id, const gfx::Size& size, gfx::BufferFormat format, @@ -30,7 +32,7 @@ gfx::BufferFormat format, base::ProcessHandle child_process); - static scoped_ptr<GpuMemoryBufferImplSharedMemory> CreateFromHandle( + static std::unique_ptr<GpuMemoryBufferImplSharedMemory> CreateFromHandle( const gfx::GpuMemoryBufferHandle& handle, const gfx::Size& size, gfx::BufferFormat format, @@ -56,15 +58,16 @@ gfx::GpuMemoryBufferHandle GetHandle() const override; private: - GpuMemoryBufferImplSharedMemory(gfx::GpuMemoryBufferId id, - const gfx::Size& size, - gfx::BufferFormat format, - const DestructionCallback& callback, - scoped_ptr<base::SharedMemory> shared_memory, - size_t offset, - int stride); + GpuMemoryBufferImplSharedMemory( + gfx::GpuMemoryBufferId id, + const gfx::Size& size, + gfx::BufferFormat format, + const DestructionCallback& callback, + std::unique_ptr<base::SharedMemory> shared_memory, + size_t offset, + int stride); - scoped_ptr<base::SharedMemory> shared_memory_; + std::unique_ptr<base::SharedMemory> shared_memory_; size_t offset_; int stride_;
diff --git a/gpu/ipc/client/gpu_memory_buffer_impl_shared_memory_unittest.cc b/gpu/ipc/client/gpu_memory_buffer_impl_shared_memory_unittest.cc index 3f9d898..257b64e 100644 --- a/gpu/ipc/client/gpu_memory_buffer_impl_shared_memory_unittest.cc +++ b/gpu/ipc/client/gpu_memory_buffer_impl_shared_memory_unittest.cc
@@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <memory> + #include "gpu/ipc/client/gpu_memory_buffer_impl_shared_memory.h" #include "gpu/ipc/client/gpu_memory_buffer_impl_test_template.h" @@ -23,7 +25,7 @@ for (auto format : gfx::GetBufferFormatsForTesting()) { bool destroyed = false; - scoped_ptr<GpuMemoryBufferImplSharedMemory> buffer( + std::unique_ptr<GpuMemoryBufferImplSharedMemory> buffer( GpuMemoryBufferImplSharedMemory::Create( kBufferId, buffer_size, format, base::Bind(&BufferDestroyed, base::Unretained(&destroyed))));
diff --git a/gpu/ipc/client/gpu_memory_buffer_impl_surface_texture.cc b/gpu/ipc/client/gpu_memory_buffer_impl_surface_texture.cc index 5ff527e..c91f28a 100644 --- a/gpu/ipc/client/gpu_memory_buffer_impl_surface_texture.cc +++ b/gpu/ipc/client/gpu_memory_buffer_impl_surface_texture.cc
@@ -5,6 +5,7 @@ #include "gpu/ipc/client/gpu_memory_buffer_impl_surface_texture.h" #include "base/logging.h" +#include "base/memory/ptr_util.h" #include "base/trace_event/trace_event.h" #include "gpu/ipc/common/android/surface_texture_manager.h" #include "gpu/ipc/common/gpu_memory_buffer_support.h" @@ -62,7 +63,7 @@ } // static -scoped_ptr<GpuMemoryBufferImplSurfaceTexture> +std::unique_ptr<GpuMemoryBufferImplSurfaceTexture> GpuMemoryBufferImplSurfaceTexture::CreateFromHandle( const gfx::GpuMemoryBufferHandle& handle, const gfx::Size& size, @@ -78,7 +79,7 @@ ANativeWindow_setBuffersGeometry(native_window, size.width(), size.height(), WindowFormat(format)); - return make_scoped_ptr(new GpuMemoryBufferImplSurfaceTexture( + return base::WrapUnique(new GpuMemoryBufferImplSurfaceTexture( handle.id, size, format, callback, native_window)); }
diff --git a/gpu/ipc/client/gpu_memory_buffer_impl_surface_texture.h b/gpu/ipc/client/gpu_memory_buffer_impl_surface_texture.h index e93b614..3e4f862 100644 --- a/gpu/ipc/client/gpu_memory_buffer_impl_surface_texture.h +++ b/gpu/ipc/client/gpu_memory_buffer_impl_surface_texture.h
@@ -8,6 +8,8 @@ #include <android/native_window.h> #include <stddef.h> +#include <memory> + #include "base/macros.h" #include "gpu/gpu_export.h" #include "gpu/ipc/client/gpu_memory_buffer_impl.h" @@ -20,7 +22,7 @@ public: ~GpuMemoryBufferImplSurfaceTexture() override; - static scoped_ptr<GpuMemoryBufferImplSurfaceTexture> CreateFromHandle( + static std::unique_ptr<GpuMemoryBufferImplSurfaceTexture> CreateFromHandle( const gfx::GpuMemoryBufferHandle& handle, const gfx::Size& size, gfx::BufferFormat format,
diff --git a/gpu/ipc/client/gpu_memory_buffer_impl_test_template.h b/gpu/ipc/client/gpu_memory_buffer_impl_test_template.h index fa9b1dbc..e093698 100644 --- a/gpu/ipc/client/gpu_memory_buffer_impl_test_template.h +++ b/gpu/ipc/client/gpu_memory_buffer_impl_test_template.h
@@ -11,6 +11,8 @@ #include <stddef.h> #include <string.h> +#include <memory> + #include "testing/gtest/include/gtest/gtest.h" #include "ui/gfx/buffer_format_util.h" @@ -61,7 +63,7 @@ GpuMemoryBufferImpl::DestructionCallback destroy_callback = TestFixture::AllocateGpuMemoryBuffer(kBufferSize, format, usage, &handle, &destroyed); - scoped_ptr<TypeParam> buffer(TypeParam::CreateFromHandle( + std::unique_ptr<TypeParam> buffer(TypeParam::CreateFromHandle( handle, kBufferSize, format, usage, destroy_callback)); ASSERT_TRUE(buffer); EXPECT_EQ(buffer->GetFormat(), format); @@ -88,7 +90,7 @@ TestFixture::AllocateGpuMemoryBuffer( kBufferSize, format, gfx::BufferUsage::GPU_READ_CPU_READ_WRITE, &handle, nullptr); - scoped_ptr<TypeParam> buffer(TypeParam::CreateFromHandle( + std::unique_ptr<TypeParam> buffer(TypeParam::CreateFromHandle( handle, kBufferSize, format, gfx::BufferUsage::GPU_READ_CPU_READ_WRITE, destroy_callback)); ASSERT_TRUE(buffer); @@ -104,7 +106,7 @@ gfx::RowSizeForBufferFormat(kBufferSize.width(), format, plane); EXPECT_GT(row_size_in_bytes, 0u); - scoped_ptr<char[]> data(new char[row_size_in_bytes]); + std::unique_ptr<char[]> data(new char[row_size_in_bytes]); memset(data.get(), 0x2a + plane, row_size_in_bytes); size_t height = kBufferSize.height() / @@ -139,7 +141,7 @@ kBufferSize, format, gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT, &handle, nullptr); - scoped_ptr<TypeParam> buffer(TypeParam::CreateFromHandle( + std::unique_ptr<TypeParam> buffer(TypeParam::CreateFromHandle( handle, kBufferSize, format, gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT, destroy_callback)); @@ -155,7 +157,7 @@ gfx::RowSizeForBufferFormat(kBufferSize.width(), format, plane); EXPECT_GT(row_size_in_bytes, 0u); - scoped_ptr<char[]> data(new char[row_size_in_bytes]); + std::unique_ptr<char[]> data(new char[row_size_in_bytes]); memset(data.get(), 0x2a + plane, row_size_in_bytes); size_t height = kBufferSize.height() / @@ -179,7 +181,7 @@ const size_t row_size_in_bytes = gfx::RowSizeForBufferFormat(kBufferSize.width(), format, plane); - scoped_ptr<char[]> data(new char[row_size_in_bytes]); + std::unique_ptr<char[]> data(new char[row_size_in_bytes]); memset(data.get(), 0x2a + plane, row_size_in_bytes); size_t height = kBufferSize.height() /
diff --git a/gpu/ipc/common/BUILD.gn b/gpu/ipc/common/BUILD.gn index 2c31f72..eef612e 100644 --- a/gpu/ipc/common/BUILD.gn +++ b/gpu/ipc/common/BUILD.gn
@@ -46,11 +46,14 @@ "//third_party/khronos:khronos_headers", ] - deps = [ - "//base", + public_deps = [ "//gpu/command_buffer/common:common_sources", "//ipc", ] + + deps = [ + "//base", + ] } source_set("ipc_common_sources") { @@ -80,15 +83,18 @@ "//third_party/khronos:khronos_headers", ] - deps = [ + public_deps = [ ":command_buffer_traits_sources", + ] + + deps = [ "//base", "//gpu/command_buffer/common:common_sources", "//gpu/config:config_sources", "//ipc", + "//ui/events/ipc", "//ui/gfx/ipc", "//ui/gl", - "//ui/latency_info/ipc", "//url/ipc:url_ipc", ]
diff --git a/gpu/ipc/common/DEPS b/gpu/ipc/common/DEPS index 04878b14..45e1d3de 100644 --- a/gpu/ipc/common/DEPS +++ b/gpu/ipc/common/DEPS
@@ -1,6 +1,6 @@ include_rules = [ "+base", "+ipc", + "+ui/events", "+ui/base", - "+ui/latency_info", ]
diff --git a/gpu/ipc/common/gpu_messages.h b/gpu/ipc/common/gpu_messages.h index 0e5ed72..449d151 100644 --- a/gpu/ipc/common/gpu_messages.h +++ b/gpu/ipc/common/gpu_messages.h
@@ -26,13 +26,13 @@ #include "gpu/ipc/common/surface_handle.h" #include "ipc/ipc_channel_handle.h" #include "ipc/ipc_message_macros.h" +#include "ui/events/ipc/latency_info_param_traits.h" +#include "ui/events/latency_info.h" #include "ui/gfx/geometry/size.h" #include "ui/gfx/gpu_memory_buffer.h" #include "ui/gfx/ipc/gfx_param_traits.h" #include "ui/gfx/native_widget_types.h" #include "ui/gfx/swap_result.h" -#include "ui/latency_info/ipc/latency_info_param_traits.h" -#include "ui/latency_info/latency_info.h" #include "url/ipc/url_param_traits.h" #if defined(OS_ANDROID)
diff --git a/gpu/ipc/service/BUILD.gn b/gpu/ipc/service/BUILD.gn index 85e0e36a..3a50fbf 100644 --- a/gpu/ipc/service/BUILD.gn +++ b/gpu/ipc/service/BUILD.gn
@@ -46,15 +46,16 @@ public_deps = [ "//base", "//ipc", + "//ui/events:events_base", "//ui/gfx", "//ui/gfx/geometry", "//ui/gl", - "//ui/latency_info/ipc", "//url", ] deps = [ "//gpu/command_buffer/common:common_sources", "//gpu/command_buffer/service:service_sources", + "//gpu/config:config_sources", "//gpu/ipc/common:ipc_common_sources", ] libs = []
diff --git a/gpu/ipc/service/DEPS b/gpu/ipc/service/DEPS index facf83e..0461b20 100644 --- a/gpu/ipc/service/DEPS +++ b/gpu/ipc/service/DEPS
@@ -2,6 +2,6 @@ "+third_party/skia", "+ui/accelerated_widget_mac", "+ui/base", - "+ui/latency_info", + "+ui/events", "+ui/ozone", ]
diff --git a/gpu/ipc/service/ca_layer_partial_damage_tree_mac.h b/gpu/ipc/service/ca_layer_partial_damage_tree_mac.h index 3d36bf7..eed42d2 100644 --- a/gpu/ipc/service/ca_layer_partial_damage_tree_mac.h +++ b/gpu/ipc/service/ca_layer_partial_damage_tree_mac.h
@@ -7,10 +7,11 @@ #include <IOSurface/IOSurface.h> #include <QuartzCore/QuartzCore.h> + #include <deque> +#include <memory> #include "base/mac/scoped_cftyperef.h" -#include "base/memory/scoped_ptr.h" #include "ui/gfx/geometry/rect.h" #include "ui/gfx/geometry/rect_f.h" @@ -25,7 +26,7 @@ base::ScopedCFTypeRef<IOSurfaceRef> RootLayerIOSurface(); void CommitCALayers(CALayer* superlayer, - scoped_ptr<CALayerPartialDamageTree> old_tree, + std::unique_ptr<CALayerPartialDamageTree> old_tree, float scale_factor, const gfx::Rect& pixel_damage_rect); @@ -41,14 +42,14 @@ const gfx::Rect& pixel_damage_rect); void UpdateRootAndPartialDamagePlanes( - scoped_ptr<CALayerPartialDamageTree> old_tree, + std::unique_ptr<CALayerPartialDamageTree> old_tree, const gfx::Rect& pixel_damage_rect); void UpdateCALayers(CALayer* superlayer, float scale_factor); const bool allow_partial_swap_; - scoped_ptr<OverlayPlane> root_plane_; - std::deque<scoped_ptr<OverlayPlane>> partial_damage_planes_; + std::unique_ptr<OverlayPlane> root_plane_; + std::deque<std::unique_ptr<OverlayPlane>> partial_damage_planes_; }; } // content
diff --git a/gpu/ipc/service/ca_layer_partial_damage_tree_mac.mm b/gpu/ipc/service/ca_layer_partial_damage_tree_mac.mm index 25cd39d..65427b2 100644 --- a/gpu/ipc/service/ca_layer_partial_damage_tree_mac.mm +++ b/gpu/ipc/service/ca_layer_partial_damage_tree_mac.mm
@@ -125,7 +125,7 @@ // Find the last partial damage plane to re-use the CALayer from. Grow the // new rect for this layer to include this damage, and all nearby partial // damage layers. - scoped_ptr<OverlayPlane> plane_for_swap; + std::unique_ptr<OverlayPlane> plane_for_swap; { auto plane_to_reuse_iter = old_tree->partial_damage_planes_.end(); gfx::Rect plane_to_reuse_enlarged_pixel_damage_rect; @@ -207,7 +207,7 @@ } void CALayerPartialDamageTree::UpdateRootAndPartialDamagePlanes( - scoped_ptr<CALayerPartialDamageTree> old_tree, + std::unique_ptr<CALayerPartialDamageTree> old_tree, const gfx::Rect& pixel_damage_rect) { // First update the partial damage tree. UpdatePartialDamagePlanes(old_tree.get(), pixel_damage_rect); @@ -276,7 +276,7 @@ void CALayerPartialDamageTree::CommitCALayers( CALayer* superlayer, - scoped_ptr<CALayerPartialDamageTree> old_tree, + std::unique_ptr<CALayerPartialDamageTree> old_tree, float scale_factor, const gfx::Rect& pixel_damage_rect) { TRACE_EVENT0("gpu", "CALayerPartialDamageTree::CommitCALayers");
diff --git a/gpu/ipc/service/ca_layer_tree_mac.h b/gpu/ipc/service/ca_layer_tree_mac.h index 36aad0d..1e45fd1 100644 --- a/gpu/ipc/service/ca_layer_tree_mac.h +++ b/gpu/ipc/service/ca_layer_tree_mac.h
@@ -7,12 +7,13 @@ #include <IOSurface/IOSurface.h> #include <QuartzCore/QuartzCore.h> + #include <deque> +#include <memory> #include <vector> #include "base/mac/scoped_cftyperef.h" #include "base/mac/scoped_nsobject.h" -#include "base/memory/scoped_ptr.h" #include "gpu/gpu_export.h" #include "ui/gfx/geometry/rect.h" #include "ui/gfx/geometry/rect_f.h" @@ -53,7 +54,7 @@ // be destroyed at the end of the function, and any CALayers in it which were // not re-used by |this| will be removed from the CALayer hierarchy. void CommitScheduledCALayers(CALayer* superlayer, - scoped_ptr<CALayerTree> old_tree, + std::unique_ptr<CALayerTree> old_tree, float scale_factor); private:
diff --git a/gpu/ipc/service/ca_layer_tree_mac.mm b/gpu/ipc/service/ca_layer_tree_mac.mm index ea0efd1..8acf01d 100644 --- a/gpu/ipc/service/ca_layer_tree_mac.mm +++ b/gpu/ipc/service/ca_layer_tree_mac.mm
@@ -143,7 +143,7 @@ } void CALayerTree::CommitScheduledCALayers(CALayer* superlayer, - scoped_ptr<CALayerTree> old_tree, + std::unique_ptr<CALayerTree> old_tree, float scale_factor) { TRACE_EVENT0("gpu", "CALayerTree::CommitScheduledCALayers"); RootLayer* old_root_layer = nullptr;
diff --git a/gpu/ipc/service/ca_layer_tree_unittest_mac.mm b/gpu/ipc/service/ca_layer_tree_unittest_mac.mm index 1805983..e9dca68 100644 --- a/gpu/ipc/service/ca_layer_tree_unittest_mac.mm +++ b/gpu/ipc/service/ca_layer_tree_unittest_mac.mm
@@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <memory> + #include "base/mac/sdk_forward_declarations.h" #include "gpu/GLES2/gl2extchromium.h" #include "gpu/ipc/service/ca_layer_tree_mac.h" @@ -38,7 +40,7 @@ float scale_factor = 1.0f; bool result = false; - scoped_ptr<CALayerTree> ca_layer_tree; + std::unique_ptr<CALayerTree> ca_layer_tree; CALayer* root_layer = nil; CALayer* clip_and_sorting_layer = nil; CALayer* transform_layer = nil; @@ -46,7 +48,7 @@ // Validate the initial values. { - scoped_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree); + std::unique_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree); result = new_ca_layer_tree->ScheduleCALayer( is_clipped, clip_rect, @@ -104,7 +106,7 @@ // Update just the clip rect and re-commit. { clip_rect = gfx::Rect(4, 8, 16, 32); - scoped_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree); + std::unique_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree); result = new_ca_layer_tree->ScheduleCALayer( is_clipped, clip_rect, @@ -145,7 +147,7 @@ // Disable clipping and re-commit. { is_clipped = false; - scoped_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree); + std::unique_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree); result = new_ca_layer_tree->ScheduleCALayer( is_clipped, clip_rect, @@ -183,7 +185,7 @@ // Change the transform and re-commit. { transform.Translate(5, 5); - scoped_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree); + std::unique_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree); result = new_ca_layer_tree->ScheduleCALayer( is_clipped, clip_rect, @@ -219,7 +221,7 @@ // Change the edge antialiasing mask and commit. { edge_aa_mask = GL_CA_LAYER_EDGE_TOP_CHROMIUM; - scoped_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree); + std::unique_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree); result = new_ca_layer_tree->ScheduleCALayer( is_clipped, clip_rect, @@ -253,7 +255,7 @@ // Change the contents and commit. { - scoped_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree); + std::unique_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree); result = new_ca_layer_tree->ScheduleCALayer( is_clipped, clip_rect, @@ -289,7 +291,7 @@ // Change the rect size. { rect = gfx::Rect(rect.origin(), gfx::Size(32, 16)); - scoped_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree); + std::unique_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree); result = new_ca_layer_tree->ScheduleCALayer( is_clipped, clip_rect, @@ -325,7 +327,7 @@ // Change the rect position. { rect = gfx::Rect(gfx::Point(16, 4), rect.size()); - scoped_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree); + std::unique_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree); result = new_ca_layer_tree->ScheduleCALayer( is_clipped, clip_rect, @@ -361,7 +363,7 @@ // Change the opacity. { opacity = 1.0f; - scoped_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree); + std::unique_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree); result = new_ca_layer_tree->ScheduleCALayer( is_clipped, clip_rect, @@ -396,7 +398,7 @@ // Add the clipping and IOSurface contents back. { is_clipped = true; - scoped_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree); + std::unique_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree); result = new_ca_layer_tree->ScheduleCALayer( is_clipped, clip_rect, @@ -432,7 +434,7 @@ // Change the scale factor. This should result in a new tree being created. { scale_factor = 2.0f; - scoped_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree); + std::unique_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree); result = new_ca_layer_tree->ScheduleCALayer( is_clipped, clip_rect, @@ -526,7 +528,7 @@ transforms[4].Translate(10, 10); // Schedule and commit the layers. - scoped_ptr<CALayerTree> ca_layer_tree(new CALayerTree); + std::unique_ptr<CALayerTree> ca_layer_tree(new CALayerTree); for (size_t i = 0; i < 5; ++i) { bool result = ca_layer_tree->ScheduleCALayer( is_clipped, @@ -611,7 +613,7 @@ } // Schedule and commit the layers. - scoped_ptr<CALayerTree> ca_layer_tree(new CALayerTree); + std::unique_ptr<CALayerTree> ca_layer_tree(new CALayerTree); for (size_t i = 0; i < 3; ++i) { bool result = ca_layer_tree->ScheduleCALayer( is_clipped, @@ -681,7 +683,7 @@ gfx::Rect(0, 0, 16, 16) }; - scoped_ptr<CALayerTree> ca_layer_tree(new CALayerTree); + std::unique_ptr<CALayerTree> ca_layer_tree(new CALayerTree); // First send the various clip parameters to sorting context zero. This is // legitimate. for (size_t i = 0; i < 3; ++i) { @@ -753,7 +755,7 @@ float scale_factor = 1.0f; bool result = false; - scoped_ptr<CALayerTree> ca_layer_tree; + std::unique_ptr<CALayerTree> ca_layer_tree; CALayer* root_layer = nil; CALayer* clip_and_sorting_layer = nil; CALayer* transform_layer = nil; @@ -763,7 +765,7 @@ // Validate the initial values. { - scoped_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree); + std::unique_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree); result = new_ca_layer_tree->ScheduleCALayer( is_clipped, clip_rect, sorting_context_id, transform, io_surface, contents_rect, rect, background_color, edge_aa_mask, opacity); @@ -792,7 +794,7 @@ // Pass another frame. { - scoped_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree); + std::unique_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree); result = new_ca_layer_tree->ScheduleCALayer( is_clipped, clip_rect, sorting_context_id, transform, io_surface, contents_rect, rect, background_color, edge_aa_mask, opacity); @@ -823,7 +825,7 @@ // Pass a frame that is clipped. contents_rect = gfx::RectF(0, 0, 1, 0.9); { - scoped_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree); + std::unique_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree); result = new_ca_layer_tree->ScheduleCALayer( is_clipped, clip_rect, sorting_context_id, transform, io_surface, contents_rect, rect, background_color, edge_aa_mask, opacity);
diff --git a/gpu/ipc/service/child_window_surface_win.cc b/gpu/ipc/service/child_window_surface_win.cc index 535451e..874b878e 100644 --- a/gpu/ipc/service/child_window_surface_win.cc +++ b/gpu/ipc/service/child_window_surface_win.cc
@@ -4,6 +4,8 @@ #include "gpu/ipc/service/child_window_surface_win.h" +#include <memory> + #include "base/compiler_specific.h" #include "base/win/scoped_hdc.h" #include "base/win/wrapped_window_proc.h" @@ -160,7 +162,7 @@ alpha_ = has_alpha; config_ = nullptr; - scoped_ptr<ui::ScopedMakeCurrent> scoped_make_current; + std::unique_ptr<ui::ScopedMakeCurrent> scoped_make_current; gfx::GLContext* current_context = gfx::GLContext::GetCurrent(); bool was_current = current_context && current_context->IsCurrent(this); if (was_current) {
diff --git a/gpu/ipc/service/gpu_channel.cc b/gpu/ipc/service/gpu_channel.cc index 672c800..7a56a62 100644 --- a/gpu/ipc/service/gpu_channel.cc +++ b/gpu/ipc/service/gpu_channel.cc
@@ -194,7 +194,7 @@ uint32_t order_num = sync_point_order_data_->GenerateUnprocessedOrderNumber( sync_point_manager_); - scoped_ptr<GpuChannelMessage> msg( + std::unique_ptr<GpuChannelMessage> msg( new GpuChannelMessage(message, order_num, base::TimeTicks::Now())); if (channel_messages_.empty()) { @@ -958,7 +958,7 @@ return; } - scoped_ptr<GpuCommandBufferStub> stub(new GpuCommandBufferStub( + std::unique_ptr<GpuCommandBufferStub> stub(new GpuCommandBufferStub( this, sync_point_manager_, task_runner_.get(), share_group, surface_handle, mailbox_manager_.get(), preempted_flag_.get(), subscription_ref_set_.get(), pending_valuebuffer_state_.get(), size, @@ -983,7 +983,7 @@ TRACE_EVENT1("gpu", "GpuChannel::OnDestroyCommandBuffer", "route_id", route_id); - scoped_ptr<GpuCommandBufferStub> stub = stubs_.take_and_erase(route_id); + std::unique_ptr<GpuCommandBufferStub> stub = stubs_.take_and_erase(route_id); // In case the renderer is currently blocked waiting for a sync reply from the // stub, we need to make sure to reschedule the correct stream here. if (stub && !stub->IsScheduled()) { @@ -996,16 +996,9 @@ void GpuChannel::OnGetDriverBugWorkArounds( std::vector<std::string>* gpu_driver_bug_workarounds) { - // TODO(j.isorce): http://crbug.com/599964 Do the extraction of workarounds in - // the GpuChannelManager constructor. Currently it is done in the FeatureInfo - // constructor. There is no need to extract them from the command-line every - // time a new FeatureInfo is created (i.e. per ContextGroup) since parsing - // result is a constant. - scoped_refptr<gpu::gles2::FeatureInfo> feature_info = - new gpu::gles2::FeatureInfo; gpu_driver_bug_workarounds->clear(); -#define GPU_OP(type, name) \ - if (feature_info->workarounds().name) \ +#define GPU_OP(type, name) \ + if (gpu_channel_manager_->gpu_driver_bug_workarounds().name) \ gpu_driver_bug_workarounds->push_back(#name); GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) #undef GPU_OP
diff --git a/gpu/ipc/service/gpu_channel.h b/gpu/ipc/service/gpu_channel.h index 8090b40b8..cf4ff00 100644 --- a/gpu/ipc/service/gpu_channel.h +++ b/gpu/ipc/service/gpu_channel.h
@@ -8,13 +8,13 @@ #include <stddef.h> #include <stdint.h> +#include <memory> #include <string> #include "base/containers/hash_tables.h" #include "base/containers/scoped_ptr_hash_map.h" #include "base/macros.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/process/process.h" #include "base/threading/thread_checker.h" @@ -181,7 +181,7 @@ scoped_refptr<GpuChannelMessageFilter> filter_; // Map of routing id to command buffer stub. - base::ScopedPtrHashMap<int32_t, scoped_ptr<GpuCommandBufferStub>> stubs_; + base::ScopedPtrHashMap<int32_t, std::unique_ptr<GpuCommandBufferStub>> stubs_; private: bool OnControlMessageReceived(const IPC::Message& msg); @@ -226,7 +226,7 @@ // message loop. SyncPointManager* const sync_point_manager_; - scoped_ptr<IPC::SyncChannel> channel_; + std::unique_ptr<IPC::SyncChannel> channel_; IPC::Listener* unhandled_message_listener_; @@ -453,7 +453,7 @@ bool enabled_; bool scheduled_; GpuChannel* const channel_; - std::deque<scoped_ptr<GpuChannelMessage>> channel_messages_; + std::deque<std::unique_ptr<GpuChannelMessage>> channel_messages_; mutable base::Lock channel_lock_; // The following are accessed on the IO thread only. @@ -464,7 +464,7 @@ // It is reset when we transition to IDLE. base::TimeDelta max_preemption_time_; // This timer is used and runs tasks on the IO thread. - scoped_ptr<base::OneShotTimer> timer_; + std::unique_ptr<base::OneShotTimer> timer_; base::ThreadChecker io_thread_checker_; // Keeps track of sync point related state such as message order numbers.
diff --git a/gpu/ipc/service/gpu_channel_manager.cc b/gpu/ipc/service/gpu_channel_manager.cc index 8a1f8a4d..a64dfca 100644 --- a/gpu/ipc/service/gpu_channel_manager.cc +++ b/gpu/ipc/service/gpu_channel_manager.cc
@@ -8,7 +8,9 @@ #include <utility> #include "base/bind.h" +#include "base/command_line.h" #include "base/location.h" +#include "base/memory/ptr_util.h" #include "base/single_thread_task_runner.h" #include "base/thread_task_runner_handle.h" #include "build/build_config.h" @@ -52,6 +54,7 @@ : task_runner_(task_runner), io_task_runner_(io_task_runner), gpu_preferences_(gpu_preferences), + gpu_driver_bug_workarounds_(base::CommandLine::ForCurrentProcess()), delegate_(delegate), watchdog_(watchdog), shutdown_event_(shutdown_event), @@ -142,13 +145,13 @@ return it != gpu_channels_.end() ? it->second : nullptr; } -scoped_ptr<GpuChannel> GpuChannelManager::CreateGpuChannel( +std::unique_ptr<GpuChannel> GpuChannelManager::CreateGpuChannel( int client_id, uint64_t client_tracing_id, bool preempts, bool allow_view_command_buffers, bool allow_real_time_streams) { - return make_scoped_ptr( + return base::WrapUnique( new GpuChannel(this, sync_point_manager(), watchdog_, share_group(), mailbox_manager(), preempts ? preemption_flag() : nullptr, preempts ? nullptr : preemption_flag(), task_runner_.get(), @@ -162,7 +165,7 @@ bool preempts, bool allow_view_command_buffers, bool allow_real_time_streams) { - scoped_ptr<GpuChannel> channel( + std::unique_ptr<GpuChannel> channel( CreateGpuChannel(client_id, client_tracing_id, preempts, allow_view_command_buffers, allow_real_time_streams)); IPC::ChannelHandle channel_handle = channel->Init(shutdown_event_);
diff --git a/gpu/ipc/service/gpu_channel_manager.h b/gpu/ipc/service/gpu_channel_manager.h index 9b39cda..6ebd6ae 100644 --- a/gpu/ipc/service/gpu_channel_manager.h +++ b/gpu/ipc/service/gpu_channel_manager.h
@@ -8,16 +8,17 @@ #include <stdint.h> #include <deque> +#include <memory> #include <string> #include <vector> #include "base/containers/scoped_ptr_hash_map.h" #include "base/macros.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "build/build_config.h" #include "gpu/command_buffer/common/constants.h" +#include "gpu/config/gpu_driver_bug_workarounds.h" #include "gpu/gpu_export.h" #include "gpu/ipc/service/gpu_memory_manager.h" #include "ui/gfx/gpu_memory_buffer.h" @@ -121,6 +122,9 @@ const GpuPreferences& gpu_preferences() const { return gpu_preferences_; } + const GpuDriverBugWorkarounds& gpu_driver_bug_workarounds() const { + return gpu_driver_bug_workarounds_; + } gles2::ProgramCache* program_cache(); gles2::ShaderTranslatorCache* shader_translator_cache(); gles2::FramebufferCompletenessCache* framebuffer_completeness_cache(); @@ -152,7 +156,7 @@ } protected: - virtual scoped_ptr<GpuChannel> CreateGpuChannel( + virtual std::unique_ptr<GpuChannel> CreateGpuChannel( int client_id, uint64_t client_tracing_id, bool preempts, @@ -177,7 +181,7 @@ // These objects manage channels to individual renderer processes there is // one channel for each renderer process that has connected to this GPU // process. - base::ScopedPtrHashMap<int32_t, scoped_ptr<GpuChannel>> gpu_channels_; + base::ScopedPtrHashMap<int32_t, std::unique_ptr<GpuChannel>> gpu_channels_; private: void InternalDestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, int client_id); @@ -189,6 +193,7 @@ #endif const GpuPreferences& gpu_preferences_; + GpuDriverBugWorkarounds gpu_driver_bug_workarounds_; GpuChannelManagerDelegate* const delegate_; #if defined(OS_MACOSX) @@ -206,8 +211,8 @@ GpuMemoryManager gpu_memory_manager_; // SyncPointManager guaranteed to outlive running MessageLoop. SyncPointManager* sync_point_manager_; - scoped_ptr<SyncPointClient> sync_point_client_waiter_; - scoped_ptr<gles2::ProgramCache> program_cache_; + std::unique_ptr<SyncPointClient> sync_point_client_waiter_; + std::unique_ptr<gles2::ProgramCache> program_cache_; scoped_refptr<gles2::ShaderTranslatorCache> shader_translator_cache_; scoped_refptr<gles2::FramebufferCompletenessCache> framebuffer_completeness_cache_;
diff --git a/gpu/ipc/service/gpu_channel_manager_delegate.h b/gpu/ipc/service/gpu_channel_manager_delegate.h index 803e011..83f2dc11 100644 --- a/gpu/ipc/service/gpu_channel_manager_delegate.h +++ b/gpu/ipc/service/gpu_channel_manager_delegate.h
@@ -10,8 +10,8 @@ #if defined(OS_MACOSX) #include "ui/base/cocoa/remote_layer_api.h" +#include "ui/events/latency_info.h" #include "ui/gfx/mac/io_surface.h" -#include "ui/latency_info/latency_info.h" #endif class GURL;
diff --git a/gpu/ipc/service/gpu_channel_test_common.cc b/gpu/ipc/service/gpu_channel_test_common.cc index ae202124..dcc2a9f 100644 --- a/gpu/ipc/service/gpu_channel_test_common.cc +++ b/gpu/ipc/service/gpu_channel_test_common.cc
@@ -4,6 +4,7 @@ #include "gpu/ipc/service/gpu_channel_test_common.h" +#include "base/memory/ptr_util.h" #include "base/test/test_simple_task_runner.h" #include "base/thread_task_runner_handle.h" #include "gpu/command_buffer/service/sync_point_manager.h" @@ -84,13 +85,13 @@ gpu_channels_.clear(); } -scoped_ptr<GpuChannel> TestGpuChannelManager::CreateGpuChannel( +std::unique_ptr<GpuChannel> TestGpuChannelManager::CreateGpuChannel( int client_id, uint64_t client_tracing_id, bool preempts, bool allow_view_command_buffers, bool allow_real_time_streams) { - return make_scoped_ptr(new TestGpuChannel( + return base::WrapUnique(new TestGpuChannel( this, sync_point_manager(), share_group(), mailbox_manager(), preempts ? preemption_flag() : nullptr, preempts ? nullptr : preemption_flag(), task_runner_.get(),
diff --git a/gpu/ipc/service/gpu_channel_test_common.h b/gpu/ipc/service/gpu_channel_test_common.h index 70918b8..a92045e 100644 --- a/gpu/ipc/service/gpu_channel_test_common.h +++ b/gpu/ipc/service/gpu_channel_test_common.h
@@ -4,7 +4,8 @@ #include <stdint.h> -#include "base/memory/scoped_ptr.h" +#include <memory> + #include "gpu/command_buffer/service/gpu_preferences.h" #include "gpu/ipc/service/gpu_channel.h" #include "gpu/ipc/service/gpu_channel_manager.h" @@ -75,7 +76,7 @@ ~TestGpuChannelManager() override; protected: - scoped_ptr<GpuChannel> CreateGpuChannel( + std::unique_ptr<GpuChannel> CreateGpuChannel( int client_id, uint64_t client_tracing_id, bool preempts, @@ -127,9 +128,9 @@ GpuPreferences gpu_preferences_; scoped_refptr<base::TestSimpleTaskRunner> task_runner_; scoped_refptr<base::TestSimpleTaskRunner> io_task_runner_; - scoped_ptr<SyncPointManager> sync_point_manager_; - scoped_ptr<TestGpuChannelManagerDelegate> channel_manager_delegate_; - scoped_ptr<GpuChannelManager> channel_manager_; + std::unique_ptr<SyncPointManager> sync_point_manager_; + std::unique_ptr<TestGpuChannelManagerDelegate> channel_manager_delegate_; + std::unique_ptr<GpuChannelManager> channel_manager_; }; } // namespace gpu
diff --git a/gpu/ipc/service/gpu_command_buffer_stub.cc b/gpu/ipc/service/gpu_command_buffer_stub.cc index ac3ddca..2f134e2 100644 --- a/gpu/ipc/service/gpu_command_buffer_stub.cc +++ b/gpu/ipc/service/gpu_command_buffer_stub.cc
@@ -11,6 +11,7 @@ #include "base/hash.h" #include "base/json/json_writer.h" #include "base/macros.h" +#include "base/memory/ptr_util.h" #include "base/memory/shared_memory.h" #include "base/time/time.h" #include "base/trace_event/trace_event.h" @@ -56,7 +57,7 @@ int32_t start; int32_t end; - scoped_ptr<IPC::Message> reply; + std::unique_ptr<IPC::Message> reply; }; namespace { @@ -93,7 +94,7 @@ private: ~GpuCommandBufferMemoryTracker() override {} - scoped_ptr<GpuMemoryTrackingGroup> tracking_group_; + std::unique_ptr<GpuMemoryTrackingGroup> tracking_group_; const uint64_t client_tracing_id_; const int client_id_; const uint64_t share_group_tracing_guid_; @@ -130,7 +131,7 @@ class DevToolsChannelData : public base::trace_event::ConvertableToTraceFormat { public: - static scoped_ptr<base::trace_event::ConvertableToTraceFormat> + static std::unique_ptr<base::trace_event::ConvertableToTraceFormat> CreateForChannel(GpuChannel* channel); ~DevToolsChannelData() override {} @@ -142,16 +143,16 @@ private: explicit DevToolsChannelData(base::Value* value) : value_(value) {} - scoped_ptr<base::Value> value_; + std::unique_ptr<base::Value> value_; DISALLOW_COPY_AND_ASSIGN(DevToolsChannelData); }; -scoped_ptr<base::trace_event::ConvertableToTraceFormat> +std::unique_ptr<base::trace_event::ConvertableToTraceFormat> DevToolsChannelData::CreateForChannel(GpuChannel* channel) { - scoped_ptr<base::DictionaryValue> res(new base::DictionaryValue); + std::unique_ptr<base::DictionaryValue> res(new base::DictionaryValue); res->SetInteger("renderer_pid", channel->GetClientPID()); res->SetDouble("used_bytes", channel->GetMemoryUsage()); - return make_scoped_ptr(new DevToolsChannelData(res.release())); + return base::WrapUnique(new DevToolsChannelData(res.release())); } CommandBufferId GetCommandBufferID(int channel_id, int32_t route_id) { @@ -210,13 +211,15 @@ DCHECK(context_group_->bind_generates_resource() == attrib_parser.bind_generates_resource); } else { + scoped_refptr<gles2::FeatureInfo> feature_info = new gles2::FeatureInfo( + channel_->gpu_channel_manager()->gpu_driver_bug_workarounds()); context_group_ = new gles2::ContextGroup( channel_->gpu_channel_manager()->gpu_preferences(), mailbox_manager, new GpuCommandBufferMemoryTracker(channel, command_buffer_id_.GetUnsafeValue()), channel_->gpu_channel_manager()->shader_translator_cache(), - channel_->gpu_channel_manager()->framebuffer_completeness_cache(), NULL, - subscription_ref_set, pending_valuebuffer_state, + channel_->gpu_channel_manager()->framebuffer_completeness_cache(), + feature_info, subscription_ref_set, pending_valuebuffer_state, attrib_parser.bind_generates_resource); } @@ -527,7 +530,7 @@ TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnInitialize"); DCHECK(!command_buffer_.get()); - scoped_ptr<base::SharedMemory> shared_state_shm( + std::unique_ptr<base::SharedMemory> shared_state_shm( new base::SharedMemory(shared_state_handle, false)); command_buffer_.reset(new CommandBufferService( @@ -747,7 +750,7 @@ if (wait_for_token_) LOG(ERROR) << "Got WaitForToken command while currently waiting for token."; wait_for_token_ = - make_scoped_ptr(new WaitForCommandState(start, end, reply_message)); + base::WrapUnique(new WaitForCommandState(start, end, reply_message)); CheckCompleteWaits(); } @@ -763,7 +766,7 @@ << "Got WaitForGetOffset command while currently waiting for offset."; } wait_for_get_offset_ = - make_scoped_ptr(new WaitForCommandState(start, end, reply_message)); + base::WrapUnique(new WaitForCommandState(start, end, reply_message)); CheckCompleteWaits(); } @@ -836,7 +839,7 @@ // Take ownership of the memory and map it into this process. // This validates the size. - scoped_ptr<base::SharedMemory> shared_memory( + std::unique_ptr<base::SharedMemory> shared_memory( new base::SharedMemory(transfer_buffer, false)); if (!shared_memory->Map(size)) { DVLOG(0) << "Failed to map shared memory.";
diff --git a/gpu/ipc/service/gpu_command_buffer_stub.h b/gpu/ipc/service/gpu_command_buffer_stub.h index 3b4992b..63fb4c7 100644 --- a/gpu/ipc/service/gpu_command_buffer_stub.h +++ b/gpu/ipc/service/gpu_command_buffer_stub.h
@@ -9,6 +9,7 @@ #include <stdint.h> #include <deque> +#include <memory> #include <string> #include <vector> @@ -27,12 +28,12 @@ #include "gpu/ipc/service/gpu_memory_manager.h" #include "ipc/ipc_listener.h" #include "ipc/ipc_sender.h" +#include "ui/events/latency_info.h" #include "ui/gfx/geometry/size.h" #include "ui/gfx/gpu_memory_buffer.h" #include "ui/gfx/swap_result.h" #include "ui/gl/gl_surface.h" #include "ui/gl/gpu_preference.h" -#include "ui/latency_info/latency_info.h" #include "url/gurl.h" namespace gpu { @@ -250,10 +251,10 @@ const int32_t route_id_; uint32_t last_flush_count_; - scoped_ptr<CommandBufferService> command_buffer_; - scoped_ptr<gles2::GLES2Decoder> decoder_; - scoped_ptr<CommandExecutor> executor_; - scoped_ptr<SyncPointClient> sync_point_client_; + std::unique_ptr<CommandBufferService> command_buffer_; + std::unique_ptr<gles2::GLES2Decoder> decoder_; + std::unique_ptr<CommandExecutor> executor_; + std::unique_ptr<SyncPointClient> sync_point_client_; scoped_refptr<gfx::GLSurface> surface_; gfx::GLSurface::Format surface_format_; @@ -274,8 +275,8 @@ GURL active_url_; size_t active_url_hash_; - scoped_ptr<WaitForCommandState> wait_for_token_; - scoped_ptr<WaitForCommandState> wait_for_get_offset_; + std::unique_ptr<WaitForCommandState> wait_for_token_; + std::unique_ptr<WaitForCommandState> wait_for_get_offset_; DISALLOW_COPY_AND_ASSIGN(GpuCommandBufferStub); };
diff --git a/gpu/ipc/service/gpu_memory_buffer_factory.cc b/gpu/ipc/service/gpu_memory_buffer_factory.cc index 01c62be..bd8a79f 100644 --- a/gpu/ipc/service/gpu_memory_buffer_factory.cc +++ b/gpu/ipc/service/gpu_memory_buffer_factory.cc
@@ -5,6 +5,7 @@ #include "gpu/ipc/service/gpu_memory_buffer_factory.h" #include "base/logging.h" +#include "base/memory/ptr_util.h" #include "build/build_config.h" #if defined(OS_MACOSX) @@ -22,15 +23,16 @@ namespace gpu { // static -scoped_ptr<GpuMemoryBufferFactory> GpuMemoryBufferFactory::CreateNativeType() { +std::unique_ptr<GpuMemoryBufferFactory> +GpuMemoryBufferFactory::CreateNativeType() { #if defined(OS_MACOSX) - return make_scoped_ptr(new GpuMemoryBufferFactoryIOSurface); + return base::WrapUnique(new GpuMemoryBufferFactoryIOSurface); #endif #if defined(OS_ANDROID) - return make_scoped_ptr(new GpuMemoryBufferFactorySurfaceTexture); + return base::WrapUnique(new GpuMemoryBufferFactorySurfaceTexture); #endif #if defined(USE_OZONE) - return make_scoped_ptr(new GpuMemoryBufferFactoryOzoneNativePixmap); + return base::WrapUnique(new GpuMemoryBufferFactoryOzoneNativePixmap); #endif NOTREACHED(); return nullptr;
diff --git a/gpu/ipc/service/gpu_memory_buffer_factory.h b/gpu/ipc/service/gpu_memory_buffer_factory.h index beb278cb..0b2ba875e 100644 --- a/gpu/ipc/service/gpu_memory_buffer_factory.h +++ b/gpu/ipc/service/gpu_memory_buffer_factory.h
@@ -5,11 +5,11 @@ #ifndef GPU_IPC_SERVICE_GPU_MEMORY_BUFFER_FACTORY_H_ #define GPU_IPC_SERVICE_GPU_MEMORY_BUFFER_FACTORY_H_ +#include <memory> #include <vector> #include "base/macros.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "gpu/gpu_export.h" #include "gpu/ipc/common/surface_handle.h" #include "ui/gfx/geometry/size.h" @@ -24,7 +24,7 @@ virtual ~GpuMemoryBufferFactory() {} // Creates a new factory instance for native GPU memory buffers. - static scoped_ptr<GpuMemoryBufferFactory> CreateNativeType(); + static std::unique_ptr<GpuMemoryBufferFactory> CreateNativeType(); // Creates a new GPU memory buffer instance. A valid handle is returned on // success. It can be called on any thread.
diff --git a/gpu/ipc/service/image_transport_surface_overlay_mac.h b/gpu/ipc/service/image_transport_surface_overlay_mac.h index a8c4600..84f0f9d 100644 --- a/gpu/ipc/service/image_transport_surface_overlay_mac.h +++ b/gpu/ipc/service/image_transport_surface_overlay_mac.h
@@ -6,6 +6,7 @@ #define GPU_IPC_SERVICE_IMAGE_TRANSPORT_SURFACE_OVERLAY_MAC_H_ #include <list> +#include <memory> #include <vector> #import "base/mac/scoped_nsobject.h" @@ -13,9 +14,9 @@ #include "gpu/ipc/service/gpu_command_buffer_stub.h" #include "gpu/ipc/service/image_transport_surface.h" #include "ui/base/cocoa/remote_layer_api.h" +#include "ui/events/latency_info.h" #include "ui/gl/gl_surface.h" #include "ui/gl/gpu_switching_observer.h" -#include "ui/latency_info/latency_info.h" @class CAContext; @class CALayer; @@ -59,7 +60,8 @@ bool is_clipped, const gfx::RectF& clip_rect, const gfx::Transform& transform, - int sorting_context_id) override; + int sorting_context_id, + unsigned filter) override; bool IsSurfaceless() const override; // ui::GpuSwitchingObserver implementation. @@ -99,12 +101,12 @@ // Planes that have been scheduled, but have not had a subsequent SwapBuffers // call made yet. - scoped_ptr<CALayerPartialDamageTree> pending_partial_damage_tree_; - scoped_ptr<CALayerTree> pending_ca_layer_tree_; + std::unique_ptr<CALayerPartialDamageTree> pending_partial_damage_tree_; + std::unique_ptr<CALayerTree> pending_ca_layer_tree_; // The planes that are currently being displayed on the screen. - scoped_ptr<CALayerPartialDamageTree> current_partial_damage_tree_; - scoped_ptr<CALayerTree> current_ca_layer_tree_; + std::unique_ptr<CALayerPartialDamageTree> current_partial_damage_tree_; + std::unique_ptr<CALayerTree> current_ca_layer_tree_; // The vsync information provided by the browser. bool vsync_parameters_valid_;
diff --git a/gpu/ipc/service/image_transport_surface_overlay_mac.mm b/gpu/ipc/service/image_transport_surface_overlay_mac.mm index 876b23ed..8632fc6 100644 --- a/gpu/ipc/service/image_transport_surface_overlay_mac.mm +++ b/gpu/ipc/service/image_transport_surface_overlay_mac.mm
@@ -298,7 +298,8 @@ bool is_clipped, const gfx::RectF& clip_rect, const gfx::Transform& transform, - int sorting_context_id) { + int sorting_context_id, + unsigned filter) { base::ScopedCFTypeRef<IOSurfaceRef> io_surface; if (contents_image) { io_surface =
diff --git a/gpu/ipc/service/image_transport_surface_win.cc b/gpu/ipc/service/image_transport_surface_win.cc index 818e7c81..7cc4454 100644 --- a/gpu/ipc/service/image_transport_surface_win.cc +++ b/gpu/ipc/service/image_transport_surface_win.cc
@@ -4,6 +4,8 @@ #include "gpu/ipc/service/image_transport_surface.h" +#include <memory> + #include "gpu/ipc/service/child_window_surface_win.h" #include "gpu/ipc/service/pass_through_image_transport_surface.h" #include "ui/gfx/native_widget_types.h" @@ -30,7 +32,7 @@ surface = egl_surface; // TODO(jbauman): Get frame statistics from DirectComposition - scoped_ptr<gfx::VSyncProvider> vsync_provider( + std::unique_ptr<gfx::VSyncProvider> vsync_provider( new gfx::VSyncProviderWin(surface_handle)); if (!egl_surface->Initialize(std::move(vsync_provider))) return nullptr;
diff --git a/gpu/ipc/service/pass_through_image_transport_surface.cc b/gpu/ipc/service/pass_through_image_transport_surface.cc index 2fdfb6c..4ff2739 100644 --- a/gpu/ipc/service/pass_through_image_transport_surface.cc +++ b/gpu/ipc/service/pass_through_image_transport_surface.cc
@@ -40,7 +40,8 @@ } gfx::SwapResult PassThroughImageTransportSurface::SwapBuffers() { - scoped_ptr<std::vector<ui::LatencyInfo>> latency_info = StartSwapBuffers(); + std::unique_ptr<std::vector<ui::LatencyInfo>> latency_info = + StartSwapBuffers(); gfx::SwapResult result = gfx::GLSurfaceAdapter::SwapBuffers(); FinishSwapBuffers(std::move(latency_info), result); return result; @@ -48,7 +49,8 @@ void PassThroughImageTransportSurface::SwapBuffersAsync( const GLSurface::SwapCompletionCallback& callback) { - scoped_ptr<std::vector<ui::LatencyInfo>> latency_info = StartSwapBuffers(); + std::unique_ptr<std::vector<ui::LatencyInfo>> latency_info = + StartSwapBuffers(); // We use WeakPtr here to avoid manual management of life time of an instance // of this class. Callback will not be called once the instance of this class @@ -63,7 +65,8 @@ int y, int width, int height) { - scoped_ptr<std::vector<ui::LatencyInfo>> latency_info = StartSwapBuffers(); + std::unique_ptr<std::vector<ui::LatencyInfo>> latency_info = + StartSwapBuffers(); gfx::SwapResult result = gfx::GLSurfaceAdapter::PostSubBuffer(x, y, width, height); FinishSwapBuffers(std::move(latency_info), result); @@ -76,7 +79,8 @@ int width, int height, const GLSurface::SwapCompletionCallback& callback) { - scoped_ptr<std::vector<ui::LatencyInfo>> latency_info = StartSwapBuffers(); + std::unique_ptr<std::vector<ui::LatencyInfo>> latency_info = + StartSwapBuffers(); gfx::GLSurfaceAdapter::PostSubBufferAsync( x, y, width, height, base::Bind(&PassThroughImageTransportSurface::FinishSwapBuffersAsync, @@ -85,7 +89,8 @@ } gfx::SwapResult PassThroughImageTransportSurface::CommitOverlayPlanes() { - scoped_ptr<std::vector<ui::LatencyInfo>> latency_info = StartSwapBuffers(); + std::unique_ptr<std::vector<ui::LatencyInfo>> latency_info = + StartSwapBuffers(); gfx::SwapResult result = gfx::GLSurfaceAdapter::CommitOverlayPlanes(); FinishSwapBuffers(std::move(latency_info), result); return result; @@ -93,7 +98,8 @@ void PassThroughImageTransportSurface::CommitOverlayPlanesAsync( const GLSurface::SwapCompletionCallback& callback) { - scoped_ptr<std::vector<ui::LatencyInfo>> latency_info = StartSwapBuffers(); + std::unique_ptr<std::vector<ui::LatencyInfo>> latency_info = + StartSwapBuffers(); gfx::GLSurfaceAdapter::CommitOverlayPlanesAsync(base::Bind( &PassThroughImageTransportSurface::FinishSwapBuffersAsync, weak_ptr_factory_.GetWeakPtr(), base::Passed(&latency_info), callback)); @@ -132,7 +138,7 @@ } } -scoped_ptr<std::vector<ui::LatencyInfo>> +std::unique_ptr<std::vector<ui::LatencyInfo>> PassThroughImageTransportSurface::StartSwapBuffers() { // GetVsyncValues before SwapBuffers to work around Mali driver bug: // crbug.com/223558. @@ -144,7 +150,7 @@ ui::INPUT_EVENT_GPU_SWAP_BUFFER_COMPONENT, 0, 0, swap_time, 1); } - scoped_ptr<std::vector<ui::LatencyInfo>> latency_info( + std::unique_ptr<std::vector<ui::LatencyInfo>> latency_info( new std::vector<ui::LatencyInfo>()); latency_info->swap(latency_info_); @@ -152,7 +158,7 @@ } void PassThroughImageTransportSurface::FinishSwapBuffers( - scoped_ptr<std::vector<ui::LatencyInfo>> latency_info, + std::unique_ptr<std::vector<ui::LatencyInfo>> latency_info, gfx::SwapResult result) { base::TimeTicks swap_ack_time = base::TimeTicks::Now(); for (auto& latency : *latency_info) { @@ -165,7 +171,7 @@ } void PassThroughImageTransportSurface::FinishSwapBuffersAsync( - scoped_ptr<std::vector<ui::LatencyInfo>> latency_info, + std::unique_ptr<std::vector<ui::LatencyInfo>> latency_info, GLSurface::SwapCompletionCallback callback, gfx::SwapResult result) { FinishSwapBuffers(std::move(latency_info), result);
diff --git a/gpu/ipc/service/pass_through_image_transport_surface.h b/gpu/ipc/service/pass_through_image_transport_surface.h index 4c8f927..084b07c 100644 --- a/gpu/ipc/service/pass_through_image_transport_surface.h +++ b/gpu/ipc/service/pass_through_image_transport_surface.h
@@ -7,14 +7,14 @@ #include <stdint.h> +#include <memory> #include <vector> #include "base/macros.h" -#include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "gpu/ipc/service/image_transport_surface.h" +#include "ui/events/latency_info.h" #include "ui/gl/gl_surface.h" -#include "ui/latency_info/latency_info.h" namespace gpu { class GpuChannelManager; @@ -52,11 +52,12 @@ void SendVSyncUpdateIfAvailable(); void SetLatencyInfo(const std::vector<ui::LatencyInfo>& latency_info); - scoped_ptr<std::vector<ui::LatencyInfo>> StartSwapBuffers(); - void FinishSwapBuffers(scoped_ptr<std::vector<ui::LatencyInfo>> latency_info, - gfx::SwapResult result); + std::unique_ptr<std::vector<ui::LatencyInfo>> StartSwapBuffers(); + void FinishSwapBuffers( + std::unique_ptr<std::vector<ui::LatencyInfo>> latency_info, + gfx::SwapResult result); void FinishSwapBuffersAsync( - scoped_ptr<std::vector<ui::LatencyInfo>> latency_info, + std::unique_ptr<std::vector<ui::LatencyInfo>> latency_info, GLSurface::SwapCompletionCallback callback, gfx::SwapResult result);
diff --git a/gpu/ipc/service/stream_texture_android.cc b/gpu/ipc/service/stream_texture_android.cc index fd4be17..49ad894 100644 --- a/gpu/ipc/service/stream_texture_android.cc +++ b/gpu/ipc/service/stream_texture_android.cc
@@ -100,7 +100,8 @@ owner_stub_->channel()->RemoveRoute(route_id_); if (framebuffer_) { - scoped_ptr<ui::ScopedMakeCurrent> scoped_make_current(MakeStubCurrent()); + std::unique_ptr<ui::ScopedMakeCurrent> scoped_make_current( + MakeStubCurrent()); glDeleteProgram(program_); glDeleteShader(vertex_shader_); @@ -126,8 +127,8 @@ NOTREACHED(); } -scoped_ptr<ui::ScopedMakeCurrent> StreamTexture::MakeStubCurrent() { - scoped_ptr<ui::ScopedMakeCurrent> scoped_make_current; +std::unique_ptr<ui::ScopedMakeCurrent> StreamTexture::MakeStubCurrent() { + std::unique_ptr<ui::ScopedMakeCurrent> scoped_make_current; bool needs_make_current = !owner_stub_->decoder()->GetGLContext()->IsCurrent(NULL); if (needs_make_current) { @@ -143,7 +144,7 @@ if (!has_pending_frame_) return; - scoped_ptr<ui::ScopedMakeCurrent> scoped_make_current(MakeStubCurrent()); + std::unique_ptr<ui::ScopedMakeCurrent> scoped_make_current(MakeStubCurrent()); surface_texture_->UpdateTexImage();
diff --git a/gpu/ipc/service/stream_texture_android.h b/gpu/ipc/service/stream_texture_android.h index 5cf9d14..9f17ba7 100644 --- a/gpu/ipc/service/stream_texture_android.h +++ b/gpu/ipc/service/stream_texture_android.h
@@ -7,6 +7,8 @@ #include <stdint.h> +#include <memory> + #include "base/macros.h" #include "base/memory/weak_ptr.h" #include "gpu/command_buffer/service/gl_stream_texture_image.h" @@ -64,7 +66,7 @@ // GpuCommandBufferStub::DestructionObserver implementation. void OnWillDestroyStub() override; - scoped_ptr<ui::ScopedMakeCurrent> MakeStubCurrent(); + std::unique_ptr<ui::ScopedMakeCurrent> MakeStubCurrent(); void UpdateTexImage();
diff --git a/gpu/perftests/measurements.h b/gpu/perftests/measurements.h index e0d9de3..f92e7ad6 100644 --- a/gpu/perftests/measurements.h +++ b/gpu/perftests/measurements.h
@@ -5,9 +5,9 @@ #ifndef GPU_PERFTESTS_MEASUREMENTS_H_ #define GPU_PERFTESTS_MEASUREMENTS_H_ +#include <memory> #include <string> -#include "base/memory/scoped_ptr.h" #include "base/time/time.h" namespace gfx { @@ -49,7 +49,7 @@ private: base::TimeTicks wall_time_start_; base::ThreadTicks cpu_time_start_; - scoped_ptr<gfx::GPUTimer> gpu_timer_; + std::unique_ptr<gfx::GPUTimer> gpu_timer_; base::TimeDelta wall_time_; base::TimeDelta cpu_time_;
diff --git a/gpu/perftests/texture_upload_perftest.cc b/gpu/perftests/texture_upload_perftest.cc index c3f3dfb..3cbcd07 100644 --- a/gpu/perftests/texture_upload_perftest.cc +++ b/gpu/perftests/texture_upload_perftest.cc
@@ -6,12 +6,12 @@ #include <stdint.h> #include <algorithm> +#include <memory> #include <vector> #include "base/containers/small_map.h" #include "base/logging.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "base/strings/stringprintf.h" #include "gpu/perftests/measurements.h" #include "testing/gmock/include/gmock/gmock.h" @@ -84,7 +84,7 @@ GLint len = 0; glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &len); if (len > 1) { - scoped_ptr<char[]> error_log(new char[len]); + std::unique_ptr<char[]> error_log(new char[len]); glGetShaderInfoLog(shader, len, NULL, error_log.get()); LOG(ERROR) << "Error compiling shader: " << error_log.get(); }
diff --git a/gpu/tools/compositor_model_bench/compositor_model_bench.cc b/gpu/tools/compositor_model_bench/compositor_model_bench.cc index 3d3d57f..9a60adb2 100644 --- a/gpu/tools/compositor_model_bench/compositor_model_bench.cc +++ b/gpu/tools/compositor_model_bench/compositor_model_bench.cc
@@ -28,7 +28,6 @@ #include "base/files/file_path.h" #include "base/files/file_util.h" #include "base/location.h" -#include "base/memory/scoped_ptr.h" #include "base/message_loop/message_loop.h" #include "base/single_thread_task_runner.h" #include "base/thread_task_runner_handle.h"
diff --git a/gpu/tools/compositor_model_bench/forward_render_model.h b/gpu/tools/compositor_model_bench/forward_render_model.h index ec34948f5..cceddd9 100644 --- a/gpu/tools/compositor_model_bench/forward_render_model.h +++ b/gpu/tools/compositor_model_bench/forward_render_model.h
@@ -7,8 +7,9 @@ #ifndef GPU_TOOLS_COMPOSITOR_MODEL_BENCH_FORWARD_RENDER_MODEL_H_ #define GPU_TOOLS_COMPOSITOR_MODEL_BENCH_FORWARD_RENDER_MODEL_H_ +#include <memory> + #include "base/macros.h" -#include "base/memory/scoped_ptr.h" #include "gpu/tools/compositor_model_bench/render_model_utils.h" #include "gpu/tools/compositor_model_bench/render_models.h" @@ -24,8 +25,8 @@ void Resize(int width, int height) override; private: - scoped_ptr<ForwardRenderNodeVisitor> visitor_; - scoped_ptr<TextureGenerator> textures_; + std::unique_ptr<ForwardRenderNodeVisitor> visitor_; + std::unique_ptr<TextureGenerator> textures_; DISALLOW_IMPLICIT_CONSTRUCTORS(ForwardRenderSimulator); };
diff --git a/gpu/tools/compositor_model_bench/render_model_utils.h b/gpu/tools/compositor_model_bench/render_model_utils.h index 9162768..4c59f90 100644 --- a/gpu/tools/compositor_model_bench/render_model_utils.h +++ b/gpu/tools/compositor_model_bench/render_model_utils.h
@@ -10,11 +10,11 @@ #include <stdint.h> #include <map> +#include <memory> #include <set> #include <vector> #include "base/compiler_specific.h" -#include "base/memory/scoped_ptr.h" #include "gpu/tools/compositor_model_bench/render_tree.h" // This is a visitor that runs over the tree structure that was built from the @@ -23,7 +23,7 @@ // texture ID's in the tree, replacing them with the matching new textures. class TextureGenerator : public RenderNodeVisitor { public: - typedef scoped_ptr<uint8_t[]> ImagePtr; + typedef std::unique_ptr<uint8_t[]> ImagePtr; typedef std::vector<Tile>::iterator tile_iter; explicit TextureGenerator(RenderNode* root); @@ -53,9 +53,9 @@ TextureGenStage stage_; std::set<int> discovered_ids_; - scoped_ptr<GLuint[]> tex_ids_; + std::unique_ptr<GLuint[]> tex_ids_; std::map<int, int> remapped_ids_; - scoped_ptr<ImagePtr[]> image_data_; + std::unique_ptr<ImagePtr[]> image_data_; int images_generated_; std::set<int> ids_for_completed_textures_; };
diff --git a/gpu/tools/compositor_model_bench/render_models.h b/gpu/tools/compositor_model_bench/render_models.h index 5d04a3f2..cc17dcb 100644 --- a/gpu/tools/compositor_model_bench/render_models.h +++ b/gpu/tools/compositor_model_bench/render_models.h
@@ -8,10 +8,10 @@ #ifndef GPU_TOOLS_COMPOSITOR_MODEL_BENCH_RENDER_MODELS_H_ #define GPU_TOOLS_COMPOSITOR_MODEL_BENCH_RENDER_MODELS_H_ -#include "gpu/tools/compositor_model_bench/render_tree.h" +#include <memory> #include "base/macros.h" -#include "base/memory/scoped_ptr.h" +#include "gpu/tools/compositor_model_bench/render_tree.h" enum RenderModel { ForwardRenderModel @@ -27,7 +27,7 @@ protected: explicit RenderModelSimulator(RenderNode* root); - scoped_ptr<RenderNode> root_; + std::unique_ptr<RenderNode> root_; private: DISALLOW_IMPLICIT_CONSTRUCTORS(RenderModelSimulator);
diff --git a/gpu/tools/compositor_model_bench/render_tree.cc b/gpu/tools/compositor_model_bench/render_tree.cc index 143a1e30..7c495e27 100644 --- a/gpu/tools/compositor_model_bench/render_tree.cc +++ b/gpu/tools/compositor_model_bench/render_tree.cc
@@ -4,6 +4,7 @@ #include "gpu/tools/compositor_model_bench/render_tree.h" +#include <memory> #include <sstream> #include <vector> @@ -12,9 +13,7 @@ #include "base/json/json_reader.h" #include "base/json/json_writer.h" #include "base/logging.h" -#include "base/memory/scoped_ptr.h" #include "base/values.h" - #include "gpu/tools/compositor_model_bench/shaders.h" using base::JSONReader; @@ -459,7 +458,7 @@ int error_code = 0; string error_message; - scoped_ptr<base::Value> root = JSONReader::ReadAndReturnError( + std::unique_ptr<base::Value> root = JSONReader::ReadAndReturnError( contents, base::JSON_ALLOW_TRAILING_COMMAS, &error_code, &error_message); if (!root) { LOG(ERROR) << "Failed to parse JSON file " << path.LossyDisplayName() <<
diff --git a/gpu/tools/compositor_model_bench/render_tree.h b/gpu/tools/compositor_model_bench/render_tree.h index 5910474..01f50ac 100644 --- a/gpu/tools/compositor_model_bench/render_tree.h +++ b/gpu/tools/compositor_model_bench/render_tree.h
@@ -10,11 +10,12 @@ #include <stddef.h> +#include <memory> #include <string> #include <vector> #include "base/compiler_specific.h" -#include "base/memory/scoped_ptr.h" +#include "base/memory/ptr_util.h" #include "gpu/tools/compositor_model_bench/shaders.h" #include "ui/gl/gl_bindings.h" #include "ui/gl/gl_implementation.h" @@ -146,11 +147,11 @@ } void add_child(RenderNode* child) { - children_.push_back(make_scoped_ptr(child)); + children_.push_back(base::WrapUnique(child)); } private: - std::vector<scoped_ptr<RenderNode>> children_; + std::vector<std::unique_ptr<RenderNode>> children_; bool skipsDraw_; };
diff --git a/gpu/tools/compositor_model_bench/shaders.cc b/gpu/tools/compositor_model_bench/shaders.cc index 0ea6275e..864f1e2 100644 --- a/gpu/tools/compositor_model_bench/shaders.cc +++ b/gpu/tools/compositor_model_bench/shaders.cc
@@ -7,6 +7,7 @@ #include <stdint.h> #include <algorithm> +#include <memory> #include "gpu/tools/compositor_model_bench/render_model_utils.h" #include "gpu/tools/compositor_model_bench/render_tree.h" @@ -237,7 +238,7 @@ // Get the length of the log string GLsizei length; glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &length); - scoped_ptr<GLchar[]> log(new GLchar[length+1]); + std::unique_ptr<GLchar[]> log(new GLchar[length + 1]); glGetShaderInfoLog(shader, length, NULL, log.get()); LOG(ERROR) << log.get() << " in shader " << ShaderNameFromID(id); }
diff --git a/gpu/vulkan/tests/vulkan_test.cc b/gpu/vulkan/tests/vulkan_test.cc index ec471a7..96c445a 100644 --- a/gpu/vulkan/tests/vulkan_test.cc +++ b/gpu/vulkan/tests/vulkan_test.cc
@@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <memory> + #include "gpu/vulkan/tests/native_window.h" #include "gpu/vulkan/vulkan_command_buffer.h" #include "gpu/vulkan/vulkan_device_queue.h" @@ -40,7 +42,7 @@ }; TEST_F(BasicVulkanTest, BasicVulkanSurface) { - scoped_ptr<VulkanSurface> surface = + std::unique_ptr<VulkanSurface> surface = VulkanSurface::CreateViewSurface(window()); EXPECT_TRUE(surface); EXPECT_TRUE(surface->Initialize(GetDeviceQueue(), @@ -49,7 +51,7 @@ } TEST_F(BasicVulkanTest, EmptyVulkanSwaps) { - scoped_ptr<VulkanSurface> surface = + std::unique_ptr<VulkanSurface> surface = VulkanSurface::CreateViewSurface(window()); ASSERT_TRUE(surface); ASSERT_TRUE(surface->Initialize(GetDeviceQueue(), @@ -67,7 +69,7 @@ } TEST_F(BasicVulkanTest, BasicRenderPass) { - scoped_ptr<VulkanSurface> surface = + std::unique_ptr<VulkanSurface> surface = VulkanSurface::CreateViewSurface(window()); ASSERT_TRUE(surface); ASSERT_TRUE(surface->Initialize(GetDeviceQueue(),
diff --git a/gpu/vulkan/vulkan_command_buffer.h b/gpu/vulkan/vulkan_command_buffer.h index 787488c1..b55b02c 100644 --- a/gpu/vulkan/vulkan_command_buffer.h +++ b/gpu/vulkan/vulkan_command_buffer.h
@@ -9,7 +9,6 @@ #include "base/logging.h" #include "base/macros.h" -#include "base/memory/scoped_ptr.h" #include "gpu/vulkan/vulkan_export.h" namespace gpu {
diff --git a/gpu/vulkan/vulkan_command_pool.cc b/gpu/vulkan/vulkan_command_pool.cc index da78103..9f741f3c 100644 --- a/gpu/vulkan/vulkan_command_pool.cc +++ b/gpu/vulkan/vulkan_command_pool.cc
@@ -46,9 +46,9 @@ } } -scoped_ptr<VulkanCommandBuffer> +std::unique_ptr<VulkanCommandBuffer> VulkanCommandPool::CreatePrimaryCommandBuffer() { - scoped_ptr<VulkanCommandBuffer> command_buffer( + std::unique_ptr<VulkanCommandBuffer> command_buffer( new VulkanCommandBuffer(device_queue_, this, true)); if (!command_buffer->Initialize()) return nullptr; @@ -56,9 +56,9 @@ return command_buffer; } -scoped_ptr<VulkanCommandBuffer> +std::unique_ptr<VulkanCommandBuffer> VulkanCommandPool::CreateSecondaryCommandBuffer() { - scoped_ptr<VulkanCommandBuffer> command_buffer( + std::unique_ptr<VulkanCommandBuffer> command_buffer( new VulkanCommandBuffer(device_queue_, this, false)); if (!command_buffer->Initialize()) return nullptr;
diff --git a/gpu/vulkan/vulkan_command_pool.h b/gpu/vulkan/vulkan_command_pool.h index 5b763ef..b54d5917 100644 --- a/gpu/vulkan/vulkan_command_pool.h +++ b/gpu/vulkan/vulkan_command_pool.h
@@ -7,8 +7,9 @@ #include <vulkan/vulkan.h> +#include <memory> + #include "base/macros.h" -#include "base/memory/scoped_ptr.h" namespace gpu { @@ -23,8 +24,8 @@ bool Initialize(); void Destroy(); - scoped_ptr<VulkanCommandBuffer> CreatePrimaryCommandBuffer(); - scoped_ptr<VulkanCommandBuffer> CreateSecondaryCommandBuffer(); + std::unique_ptr<VulkanCommandBuffer> CreatePrimaryCommandBuffer(); + std::unique_ptr<VulkanCommandBuffer> CreateSecondaryCommandBuffer(); VkCommandPool handle() { return handle_; }
diff --git a/gpu/vulkan/vulkan_device_queue.cc b/gpu/vulkan/vulkan_device_queue.cc index 17fc1a3..aa6f987 100644 --- a/gpu/vulkan/vulkan_device_queue.cc +++ b/gpu/vulkan/vulkan_device_queue.cc
@@ -166,8 +166,8 @@ vk_physical_device_ = VK_NULL_HANDLE; } -scoped_ptr<VulkanCommandPool> VulkanDeviceQueue::CreateCommandPool() { - scoped_ptr<VulkanCommandPool> command_pool(new VulkanCommandPool(this)); +std::unique_ptr<VulkanCommandPool> VulkanDeviceQueue::CreateCommandPool() { + std::unique_ptr<VulkanCommandPool> command_pool(new VulkanCommandPool(this)); if (!command_pool->Initialize()) return nullptr;
diff --git a/gpu/vulkan/vulkan_device_queue.h b/gpu/vulkan/vulkan_device_queue.h index 59d3e96..ecb1724 100644 --- a/gpu/vulkan/vulkan_device_queue.h +++ b/gpu/vulkan/vulkan_device_queue.h
@@ -7,9 +7,10 @@ #include <vulkan/vulkan.h> +#include <memory> + #include "base/logging.h" #include "base/macros.h" -#include "base/memory/scoped_ptr.h" #include "gpu/vulkan/vulkan_export.h" namespace gpu { @@ -47,7 +48,7 @@ uint32_t GetVulkanQueueIndex() const { return vk_queue_index_; } - scoped_ptr<gpu::VulkanCommandPool> CreateCommandPool(); + std::unique_ptr<gpu::VulkanCommandPool> CreateCommandPool(); private: VkPhysicalDevice vk_physical_device_ = VK_NULL_HANDLE;
diff --git a/gpu/vulkan/vulkan_implementation.h b/gpu/vulkan/vulkan_implementation.h index fa8639d..83d0eb83 100644 --- a/gpu/vulkan/vulkan_implementation.h +++ b/gpu/vulkan/vulkan_implementation.h
@@ -7,8 +7,6 @@ #include <vulkan/vulkan.h> -#include "base/memory/scoped_ptr.h" - namespace gpu { class VulkanCommandPool;
diff --git a/gpu/vulkan/vulkan_surface.cc b/gpu/vulkan/vulkan_surface.cc index 8d1bbab9..c08b5e9 100644 --- a/gpu/vulkan/vulkan_surface.cc +++ b/gpu/vulkan/vulkan_surface.cc
@@ -158,9 +158,9 @@ VulkanSurface::~VulkanSurface() {} // static -scoped_ptr<VulkanSurface> VulkanSurface::CreateViewSurface( +std::unique_ptr<VulkanSurface> VulkanSurface::CreateViewSurface( gfx::AcceleratedWidget window) { - return scoped_ptr<VulkanSurface>(new VulkanWSISurface(window)); + return std::unique_ptr<VulkanSurface>(new VulkanWSISurface(window)); } VulkanSurface::VulkanSurface() {}
diff --git a/gpu/vulkan/vulkan_surface.h b/gpu/vulkan/vulkan_surface.h index c1cd166..ab873c7 100644 --- a/gpu/vulkan/vulkan_surface.h +++ b/gpu/vulkan/vulkan_surface.h
@@ -5,7 +5,8 @@ #ifndef GPU_VULKAN_VULKAN_SURFACE_H_ #define GPU_VULKAN_VULKAN_SURFACE_H_ -#include "base/memory/scoped_ptr.h" +#include <memory> + #include "gpu/vulkan/vulkan_export.h" #include "ui/gfx/geometry/size.h" #include "ui/gfx/native_widget_types.h" @@ -42,7 +43,7 @@ virtual void Finish() = 0; // Create a surface that render directlys into a surface. - static scoped_ptr<VulkanSurface> CreateViewSurface( + static std::unique_ptr<VulkanSurface> CreateViewSurface( gfx::AcceleratedWidget window); protected:
diff --git a/gpu/vulkan/vulkan_swap_chain.cc b/gpu/vulkan/vulkan_swap_chain.cc index c4e62295..7d11e82b 100644 --- a/gpu/vulkan/vulkan_swap_chain.cc +++ b/gpu/vulkan/vulkan_swap_chain.cc
@@ -41,7 +41,7 @@ VkDevice device = device_queue_->GetVulkanDevice(); VkQueue queue = device_queue_->GetVulkanQueue(); - scoped_ptr<ImageData>& current_image_data = images_[current_image_]; + std::unique_ptr<ImageData>& current_image_data = images_[current_image_]; // Default image subresource range. VkImageSubresourceRange image_subresource_range = {}; @@ -190,7 +190,7 @@ images_.resize(image_count); for (uint32_t i = 0; i < image_count; ++i) { images_[i].reset(new ImageData); - scoped_ptr<ImageData>& image_data = images_[i]; + std::unique_ptr<ImageData>& image_data = images_[i]; image_data->image = images[i]; // Setup semaphores. @@ -258,7 +258,7 @@ next_present_semaphore_ = VK_NULL_HANDLE; } - for (const scoped_ptr<ImageData>& image_data : images_) { + for (const std::unique_ptr<ImageData>& image_data : images_) { if (image_data->command_buffer) { // Make sure command buffer is done processing. image_data->command_buffer->Wait(UINT64_MAX);
diff --git a/gpu/vulkan/vulkan_swap_chain.h b/gpu/vulkan/vulkan_swap_chain.h index e084716..08f3902 100644 --- a/gpu/vulkan/vulkan_swap_chain.h +++ b/gpu/vulkan/vulkan_swap_chain.h
@@ -5,10 +5,10 @@ #ifndef GPU_VULKAN_VULKAN_SWAP_CHAIN_H_ #define GPU_VULKAN_VULKAN_SWAP_CHAIN_H_ +#include <memory> #include <vector> #include <vulkan/vulkan.h> -#include "base/memory/scoped_ptr.h" #include "gpu/vulkan/vulkan_export.h" #include "ui/gfx/geometry/size.h" #include "ui/gfx/swap_result.h" @@ -64,7 +64,7 @@ VulkanDeviceQueue* device_queue_; VkSwapchainKHR swap_chain_ = VK_NULL_HANDLE; - scoped_ptr<VulkanCommandPool> command_pool_; + std::unique_ptr<VulkanCommandPool> command_pool_; gfx::Size size_; @@ -73,13 +73,13 @@ ~ImageData(); VkImage image = VK_NULL_HANDLE; - scoped_ptr<VulkanImageView> image_view; - scoped_ptr<VulkanCommandBuffer> command_buffer; + std::unique_ptr<VulkanImageView> image_view; + std::unique_ptr<VulkanCommandBuffer> command_buffer; VkSemaphore render_semaphore = VK_NULL_HANDLE; VkSemaphore present_semaphore = VK_NULL_HANDLE; }; - std::vector<scoped_ptr<ImageData>> images_; + std::vector<std::unique_ptr<ImageData>> images_; uint32_t current_image_ = 0; VkSemaphore next_present_semaphore_ = VK_NULL_HANDLE;
diff --git a/ios/chrome/browser/ui/autofill/autofill_client_ios.h b/ios/chrome/browser/ui/autofill/autofill_client_ios.h index 646c154..bd9919e 100644 --- a/ios/chrome/browser/ui/autofill/autofill_client_ios.h +++ b/ios/chrome/browser/ui/autofill/autofill_client_ios.h
@@ -58,6 +58,7 @@ void HideRequestAutocompleteDialog() override; void ShowAutofillSettings() override; void ShowUnmaskPrompt(const CreditCard& card, + UnmaskCardReason reason, base::WeakPtr<CardUnmaskDelegate> delegate) override; void OnUnmaskVerificationResult(PaymentsRpcResult result) override; void ConfirmSaveCreditCardLocally(const CreditCard& card,
diff --git a/ios/chrome/browser/ui/autofill/autofill_client_ios.mm b/ios/chrome/browser/ui/autofill/autofill_client_ios.mm index 279f96f..5c6d0a4d 100644 --- a/ios/chrome/browser/ui/autofill/autofill_client_ios.mm +++ b/ios/chrome/browser/ui/autofill/autofill_client_ios.mm
@@ -76,10 +76,11 @@ void AutofillClientIOS::ShowUnmaskPrompt( const CreditCard& card, + UnmaskCardReason reason, base::WeakPtr<CardUnmaskDelegate> delegate) { ios::ChromeBrowserProvider* provider = ios::GetChromeBrowserProvider(); unmask_controller_.ShowPrompt( - provider->CreateCardUnmaskPromptView(&unmask_controller_), card, + provider->CreateCardUnmaskPromptView(&unmask_controller_), card, reason, delegate); }
diff --git a/ios/chrome/common/material_timing.h b/ios/chrome/common/material_timing.h new file mode 100644 index 0000000..035128a --- /dev/null +++ b/ios/chrome/common/material_timing.h
@@ -0,0 +1,66 @@ +// 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_COMMON_MATERIAL_TIMING_H_ +#define IOS_CHROME_COMMON_MATERIAL_TIMING_H_ + +#import <CoreGraphics/CoreGraphics.h> +#import <QuartzCore/QuartzCore.h> +#import <UIKit/UIKit.h> + +namespace ios { +namespace material { + +extern const CGFloat kDuration0; +extern const CGFloat kDuration1; +extern const CGFloat kDuration2; +extern const CGFloat kDuration3; +extern const CGFloat kDuration4; +extern const CGFloat kDuration5; +extern const CGFloat kDuration6; +extern const CGFloat kDuration7; +extern const CGFloat kDuration8; + +// Type of material timing curve. +typedef NS_ENUM(NSUInteger, Curve) { + CurveEaseInOut, + CurveEaseOut, + CurveEaseIn, + CurveLinear, +}; + +// Per material spec, a motion curve with "follow through". +CAMediaTimingFunction* TransformCurve2(); + +// Returns a timing funtion related to the given |curve|. +CAMediaTimingFunction* TimingFunction(Curve curve); + +// Performs a standard UIView animation using a material timing |curve|. +// Note: any curve option specified in |options| will be ignored in favor of the +// specified curve value. +// See also: +[UIView animateWithDuration:delay:animations:completion]. +void Animate(NSTimeInterval duration, + NSTimeInterval delay, + Curve curve, + UIViewAnimationOptions options, + void (^animations)(void), + void (^completion)(BOOL)); + +// Performs a standard UIView transition animation using a material timing +// |curve|. +// Note: any curve option specified in |options| will be ignored in favor of the +// specified curve value. +// See also: +// +[UIView transitionWithView:duration:options:animations:completion]. +void Transition(UIView* view, + NSTimeInterval duration, + Curve curve, + UIViewAnimationOptions options, + void (^animations)(void), + void (^completion)(BOOL)); + +} // material +} // ios + +#endif // IOS_CHROME_COMMON_MATERIAL_TIMING_H_
diff --git a/ios/chrome/common/material_timing.mm b/ios/chrome/common/material_timing.mm new file mode 100644 index 0000000..4f81b49 --- /dev/null +++ b/ios/chrome/common/material_timing.mm
@@ -0,0 +1,103 @@ +// 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/common/material_timing.h" + +namespace { + +UIViewAnimationOptions AnimationOptionsForceLinearTiming( + UIViewAnimationOptions options) { + // Remove any non-linear timing options from |options|. They should be + // ignored. + options &= + ~(UIViewAnimationOptionCurveEaseInOut | UIViewAnimationOptionCurveEaseIn | + UIViewAnimationOptionCurveEaseOut); + // Since default is EaseInOut, ensure linear is specified instead so the outer + // timing function works as expected. + options |= UIViewAnimationOptionCurveLinear; + return options; +} + +} // namespace + +namespace ios { +namespace material { + +// Helper utility for making all animations slower, since 'toggle slow +// animations' in the simulator doesn't apply to CAAnimations. +const NSTimeInterval kSlowAnimationModifier = 1; + +const CGFloat kDuration0 = 0 * kSlowAnimationModifier; +const CGFloat kDuration1 = 0.25 * kSlowAnimationModifier; +const CGFloat kDuration2 = 0.1 * kSlowAnimationModifier; +const CGFloat kDuration3 = 0.35 * kSlowAnimationModifier; +const CGFloat kDuration4 = 0.05 * kSlowAnimationModifier; +const CGFloat kDuration5 = 0.5 * kSlowAnimationModifier; +const CGFloat kDuration6 = 0.15 * kSlowAnimationModifier; +const CGFloat kDuration7 = 0.4 * kSlowAnimationModifier; +const CGFloat kDuration8 = 0.07 * kSlowAnimationModifier; + +CAMediaTimingFunction* TransformCurve2() { + return [[[CAMediaTimingFunction alloc] + initWithControlPoints:0.0f :0.84f :0.13f :0.99f] autorelease]; +} + +CAMediaTimingFunction* TimingFunction(Curve curve) { + switch (curve) { + case CurveEaseInOut: + // This curve is slow both at the begining and end. + // Visualization of curve http://cubic-bezier.com/#.4,0,.2,1 + return [[[CAMediaTimingFunction alloc] + initWithControlPoints:0.4f :0.0f :0.2f :1.0f] autorelease]; + case CurveEaseOut: + // This curve is slow at the end. + // Visualization of curve http://cubic-bezier.com/#0,0,.2,1 + return [[[CAMediaTimingFunction alloc] + initWithControlPoints:0.0f :0.0f :0.2f :1.0f] autorelease]; + case CurveEaseIn: + // This curve is slow at the begining. + // Visualization of curve http://cubic-bezier.com/#.4,0,1,1 + return [[[CAMediaTimingFunction alloc] + initWithControlPoints:0.4f :0.0f :1.0f :1.0f] autorelease]; + case CurveLinear: + // This curve is linear. + return + [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]; + } +} + +void Animate(NSTimeInterval duration, + NSTimeInterval delay, + Curve curve, + UIViewAnimationOptions options, + void (^animations)(void), + void (^completion)(BOOL)) { + [CATransaction begin]; + [CATransaction setAnimationTimingFunction:TimingFunction(curve)]; + [UIView animateWithDuration:duration + delay:delay + options:AnimationOptionsForceLinearTiming(options) + animations:animations + completion:completion]; + [CATransaction commit]; +} + +void Transition(UIView* view, + NSTimeInterval duration, + Curve curve, + UIViewAnimationOptions options, + void (^animations)(void), + void (^completion)(BOOL)) { + [CATransaction begin]; + [CATransaction setAnimationTimingFunction:TimingFunction(curve)]; + [UIView transitionWithView:view + duration:duration + options:AnimationOptionsForceLinearTiming(options) + animations:animations + completion:completion]; + [CATransaction commit]; +} + +} // material +} // ios
diff --git a/ios/chrome/ios_chrome.gyp b/ios/chrome/ios_chrome.gyp index cbc432ed..8f0e823 100644 --- a/ios/chrome/ios_chrome.gyp +++ b/ios/chrome/ios_chrome.gyp
@@ -752,11 +752,15 @@ 'libraries': [ '$(SDKROOT)/System/Library/Frameworks/CoreGraphics.framework', '$(SDKROOT)/System/Library/Frameworks/Foundation.framework', + '$(SDKROOT)/System/Library/Frameworks/QuartzCore.framework', + '$(SDKROOT)/System/Library/Frameworks/UIKit.framework', ], }, 'sources': [ 'common/channel_info.h', 'common/channel_info.mm', + 'common/material_timing.h', + 'common/material_timing.mm', 'common/string_util.h', 'common/string_util.mm', ],
diff --git a/ios/chrome/today_extension/strings/resources/ios_today_extension_strings_nl.xtb b/ios/chrome/today_extension/strings/resources/ios_today_extension_strings_nl.xtb index c825ae9..0772c070 100644 --- a/ios/chrome/today_extension/strings/resources/ios_today_extension_strings_nl.xtb +++ b/ios/chrome/today_extension/strings/resources/ios_today_extension_strings_nl.xtb
@@ -10,7 +10,7 @@ <translation id="4394049700291259645">Uitschakelen</translation> <translation id="5301954838959518834">OK</translation> <translation id="5508399372551154686">BEGIN_LINKFysieke webEND_LINK is uitgeschakeld.</translation> -<translation id="5815960189179094695">Scannen naar BEGIN_LINKFysieke webEND_LINK-objecten…</translation> +<translation id="5815960189179094695">Zoeken naar BEGIN_LINKfysieke webEND_LINK-objecten…</translation> <translation id="6196207969502475924">Gesproken zoekopdrachten</translation> <translation id="6722203589267124394">Met Bluetooth kun je nabije BEGIN_LINKFysieke webEND_LINK-objecten zien.</translation> <translation id="7554791636758816595">Nieuw tabblad</translation>
diff --git a/ios/web/BUILD.gn b/ios/web/BUILD.gn index 7676026f..0230b760 100644 --- a/ios/web/BUILD.gn +++ b/ios/web/BUILD.gn
@@ -174,8 +174,6 @@ "web_state/global_web_state_event_tracker.mm", "web_state/global_web_state_observer.cc", "web_state/js/credential_util.mm", - "web_state/js/crw_js_early_script_manager.h", - "web_state/js/crw_js_early_script_manager.mm", "web_state/js/crw_js_injection_manager.mm", "web_state/js/crw_js_injection_receiver.mm", "web_state/js/crw_js_invoke_parameter_queue.h", @@ -399,7 +397,6 @@ "web_state/js/common_js_unittest.mm", "web_state/js/core_js_unittest.mm", "web_state/js/credential_util_unittest.mm", - "web_state/js/crw_js_early_script_manager_unittest.mm", "web_state/js/crw_js_injection_manager_unittest.mm", "web_state/js/crw_js_invoke_parameter_queue_unittest.mm", "web_state/js/crw_js_post_request_loader_unittest.mm",
diff --git a/ios/web/ios_web.gyp b/ios/web/ios_web.gyp index 6e03650..66fe474 100644 --- a/ios/web/ios_web.gyp +++ b/ios/web/ios_web.gyp
@@ -210,8 +210,6 @@ 'web_state/global_web_state_event_tracker.mm', 'web_state/global_web_state_observer.cc', 'web_state/js/credential_util.mm', - 'web_state/js/crw_js_early_script_manager.h', - 'web_state/js/crw_js_early_script_manager.mm', 'web_state/js/crw_js_injection_manager.mm', 'web_state/js/crw_js_injection_receiver.mm', 'web_state/js/crw_js_invoke_parameter_queue.h',
diff --git a/ios/web/ios_web_unittests.gyp b/ios/web/ios_web_unittests.gyp index 3a91ebd..c73f44006e 100644 --- a/ios/web/ios_web_unittests.gyp +++ b/ios/web/ios_web_unittests.gyp
@@ -54,7 +54,6 @@ 'web_state/js/common_js_unittest.mm', 'web_state/js/core_js_unittest.mm', 'web_state/js/credential_util_unittest.mm', - 'web_state/js/crw_js_early_script_manager_unittest.mm', 'web_state/js/crw_js_injection_manager_unittest.mm', 'web_state/js/crw_js_invoke_parameter_queue_unittest.mm', 'web_state/js/crw_js_post_request_loader_unittest.mm',
diff --git a/ios/web/public/block_types.h b/ios/web/public/block_types.h index 8074dc0..cc28dc8c 100644 --- a/ios/web/public/block_types.h +++ b/ios/web/public/block_types.h
@@ -11,8 +11,13 @@ // The type of the completion handler block that is called to inform about // JavaScript evaluation completion. +// TODO(crbug.com/595761): Remove this completion handler. typedef void (^JavaScriptCompletion)(NSString*, NSError*); +// The type of the completion handler block that is called to inform about +// JavaScript evaluation completion. +typedef void (^JavaScriptResultBlock)(id, NSError*); + } // namespace #endif // IOS_WEB_PUBLIC_BLOCK_TYPES_H_
diff --git a/ios/web/public/test/crw_test_js_injection_receiver.mm b/ios/web/public/test/crw_test_js_injection_receiver.mm index efa02bf..cbcdc55 100644 --- a/ios/web/public/test/crw_test_js_injection_receiver.mm +++ b/ios/web/public/test/crw_test_js_injection_receiver.mm
@@ -35,6 +35,11 @@ web::EvaluateJavaScript(_webView, script, handler); } +- (void)executeJavaScript:(NSString*)script + completionHandler:(web::JavaScriptResultBlock)completionHandler { + web::ExecuteJavaScript(_webView, script, completionHandler); +} + - (BOOL)scriptHasBeenInjectedForClass:(Class)JSInjectionManagerClass presenceBeacon:(NSString*)beacon { return [_injectedScriptManagers containsObject:JSInjectionManagerClass];
diff --git a/ios/web/public/test/test_web_client.h b/ios/web/public/test/test_web_client.h index 13a28f2..320df56f 100644 --- a/ios/web/public/test/test_web_client.h +++ b/ios/web/public/test/test_web_client.h
@@ -10,6 +10,8 @@ #include "base/compiler_specific.h" #include "base/mac/scoped_nsobject.h" #include "ios/web/public/web_client.h" +#include "net/ssl/ssl_info.h" +#include "url/gurl.h" namespace web { @@ -21,12 +23,33 @@ // WebClient implementation. NSString* GetEarlyPageScript() const override; + void AllowCertificateError(WebState*, + int cert_error, + const net::SSLInfo&, + const GURL&, + bool overridable, + const base::Callback<void(bool)>&) override; // Changes Early Page Script for testing purposes. void SetEarlyPageScript(NSString* page_script); + // Accessors for last arguments passed to AllowCertificateError. + int last_cert_error_code() const { return last_cert_error_code_; }; + const net::SSLInfo& last_cert_error_ssl_info() const { + return last_cert_error_ssl_info_; + } + const GURL& last_cert_error_request_url() const { + return last_cert_error_request_url_; + } + bool last_cert_error_overridable() { return last_cert_error_overridable_; } + private: base::scoped_nsobject<NSString> early_page_script_; + // Last arguments passed to AllowCertificateError. + int last_cert_error_code_; + net::SSLInfo last_cert_error_ssl_info_; + GURL last_cert_error_request_url_; + bool last_cert_error_overridable_; }; } // namespace web
diff --git a/ios/web/public/test/test_web_client.mm b/ios/web/public/test/test_web_client.mm index a4ff0cff6..d3d4f3b 100644 --- a/ios/web/public/test/test_web_client.mm +++ b/ios/web/public/test/test_web_client.mm
@@ -8,7 +8,8 @@ namespace web { -TestWebClient::TestWebClient() {} +TestWebClient::TestWebClient() + : last_cert_error_code_(0), last_cert_error_overridable_(true) {} TestWebClient::~TestWebClient() {} @@ -20,4 +21,19 @@ early_page_script_.reset([page_script copy]); } +void TestWebClient::AllowCertificateError( + WebState* web_state, + int cert_error, + const net::SSLInfo& ssl_info, + const GURL& request_url, + bool overridable, + const base::Callback<void(bool)>& callback) { + last_cert_error_code_ = cert_error; + last_cert_error_ssl_info_ = ssl_info; + last_cert_error_request_url_ = request_url; + last_cert_error_overridable_ = overridable; + + callback.Run(false); +} + } // namespace web
diff --git a/ios/web/public/test/test_web_state.h b/ios/web/public/test/test_web_state.h index 2d7e41d..ccefebc 100644 --- a/ios/web/public/test/test_web_state.h +++ b/ios/web/public/test/test_web_state.h
@@ -23,13 +23,18 @@ ~TestWebState() override; // WebState implementation. - UIView* GetView() override; WebStateDelegate* GetDelegate() override; void SetDelegate(WebStateDelegate* delegate) override; + bool IsWebUsageEnabled() const override; + void SetWebUsageEnabled(bool enabled) override; + UIView* GetView() override; BrowserState* GetBrowserState() const override; void OpenURL(const OpenURLParams& params) override {} NavigationManager* GetNavigationManager() override; CRWJSInjectionReceiver* GetJSInjectionReceiver() const override; + void ExecuteJavaScript(const base::string16& javascript) override; + void ExecuteJavaScript(const base::string16& javascript, + const JavaScriptResultCallback& callback) override; const std::string& GetContentsMimeType() const override; const std::string& GetContentLanguageHeader() const override; bool ContentIsHTML() const override; @@ -65,6 +70,7 @@ void SetTrustLevel(URLVerificationTrustLevel trust_level); private: + bool web_usage_enabled_; GURL url_; base::string16 title_; URLVerificationTrustLevel trust_level_;
diff --git a/ios/web/public/test/test_web_state.mm b/ios/web/public/test/test_web_state.mm index a659af8..296cb88 100644 --- a/ios/web/public/test/test_web_state.mm +++ b/ios/web/public/test/test_web_state.mm
@@ -2,21 +2,21 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "ios/web/public/test/test_web_state.h" + #include <stdint.h> -#include "ios/web/public/test/test_web_state.h" +#include "base/callback.h" namespace web { TestWebState::TestWebState() - : trust_level_(kAbsolute), content_is_html_(true) {} + : web_usage_enabled_(false), + trust_level_(kAbsolute), + content_is_html_(true) {} TestWebState::~TestWebState() = default; -UIView* TestWebState::GetView() { - return nullptr; -} - WebStateDelegate* TestWebState::GetDelegate() { return nil; } @@ -27,6 +27,18 @@ return nullptr; } +bool TestWebState::IsWebUsageEnabled() const { + return web_usage_enabled_; +} + +void TestWebState::SetWebUsageEnabled(bool enabled) { + web_usage_enabled_ = enabled; +} + +UIView* TestWebState::GetView() { + return nullptr; +} + NavigationManager* TestWebState::GetNavigationManager() { return nullptr; } @@ -35,6 +47,13 @@ return nullptr; } +void TestWebState::ExecuteJavaScript(const base::string16& javascript) {} + +void TestWebState::ExecuteJavaScript(const base::string16& javascript, + const JavaScriptResultCallback& callback) { + callback.Run(nullptr); +} + const std::string& TestWebState::GetContentsMimeType() const { return mime_type_; }
diff --git a/ios/web/public/web_client.h b/ios/web/public/web_client.h index 70b9cbb3..4b7104b 100644 --- a/ios/web/public/web_client.h +++ b/ios/web/public/web_client.h
@@ -8,6 +8,7 @@ #include <string> #include <vector> +#include "base/callback.h" #include "base/strings/string16.h" #include "base/strings/string_piece.h" #include "ui/base/layout.h" @@ -22,12 +23,17 @@ @class UIWebView; @class NSString; +namespace net { +class SSLInfo; +} + namespace web { class BrowserState; class BrowserURLRewriter; class WebClient; class WebMainParts; +class WebState; // Setter and getter for the client. The client should be set early, before any // web code is called. @@ -114,6 +120,18 @@ // Gives the embedder a chance to provide the JavaScript to be injected into // the web view as early as possible. Result must not be nil. virtual NSString* GetEarlyPageScript() const; + + // Informs the embedder that a certificate error has occurred. If + // |overridable| is true, the user can ignore the error and continue. The + // embedder can call the |callback| asynchronously (an argument of true means + // that |cert_error| should be ignored and web// should load the page). + virtual void AllowCertificateError( + WebState* web_state, + int cert_error, + const net::SSLInfo& ssl_info, + const GURL& request_url, + bool overridable, + const base::Callback<void(bool)>& callback); }; } // namespace web
diff --git a/ios/web/public/web_client.mm b/ios/web/public/web_client.mm index 905c17c..07a425e9 100644 --- a/ios/web/public/web_client.mm +++ b/ios/web/public/web_client.mm
@@ -75,4 +75,14 @@ return @""; } +void WebClient::AllowCertificateError( + WebState* web_state, + int cert_error, + const net::SSLInfo& ssl_info, + const GURL& request_url, + bool overridable, + const base::Callback<void(bool)>& callback) { + callback.Run(false); +} + } // namespace web
diff --git a/ios/web/public/web_state/js/crw_js_injection_evaluator.h b/ios/web/public/web_state/js/crw_js_injection_evaluator.h index fa9bcf3..2286e16 100644 --- a/ios/web/public/web_state/js/crw_js_injection_evaluator.h +++ b/ios/web/public/web_state/js/crw_js_injection_evaluator.h
@@ -7,12 +7,7 @@ #import <Foundation/Foundation.h> - -// The type of the completion handler block that is called from -// |evaluateJavaScript:completionHandler| -namespace web { -typedef void (^JavaScriptCompletion)(NSString*, NSError*); -} +#import "ios/web/public/block_types.h" @protocol CRWJSInjectionEvaluator @@ -24,6 +19,13 @@ - (void)evaluateJavaScript:(NSString*)script stringResultHandler:(web::JavaScriptCompletion)handler; +// Executes the supplied JavaScript in the WebView. Calls |completionHandler| +// with results of the execution (which may be nil if the implementing object +// has no way to run the execution or the execution returns a nil value) +// or an NSError if there is an error. The |completionHandler| can be nil. +- (void)executeJavaScript:(NSString*)script + completionHandler:(web::JavaScriptResultBlock)completionHandler; + // Checks to see if the script for a class has been injected into the // current page already, given the class and the script's presence // beacon (a JS object that should exist iff the script has been injected).
diff --git a/ios/web/public/web_state/ui/crw_web_delegate.h b/ios/web/public/web_state/ui/crw_web_delegate.h index fdb40c91..51a1dd3 100644 --- a/ios/web/public/web_state/ui/crw_web_delegate.h +++ b/ios/web/public/web_state/ui/crw_web_delegate.h
@@ -65,15 +65,6 @@ // |URL| is launched in an external app. - (BOOL)openExternalURL:(const GURL&)URL linkClicked:(BOOL)linkClicked; -// This method is called when a network request has an issue with the SSL -// connection to present it to the user. The user will decide if the request -// should continue or not and the callback should be invoked to let the backend -// know. -// The callback is safe to call until CRWWebController is closed. -- (void)presentSSLError:(const net::SSLInfo&)info - forSSLStatus:(const web::SSLStatus&)status - recoverable:(BOOL)recoverable - callback:(SSLErrorCallback)shouldContinue; // Asked the delegate to present an error to the user because the // CRWWebController cannot verify the URL of the current page. - (void)presentSpoofingError; @@ -155,6 +146,16 @@ @optional +// This method is called when a network request has an issue with the SSL +// connection to present it to the user. The user will decide if the request +// should continue or not and the callback should be invoked to let the backend +// know. +// The callback is safe to call until CRWWebController is closed. +- (void)presentSSLError:(const net::SSLInfo&)info + forSSLStatus:(const web::SSLStatus&)status + recoverable:(BOOL)recoverable + callback:(SSLErrorCallback)shouldContinue; + // Called to ask CRWWebDelegate if |CRWWebController| should open the given URL. // CRWWebDelegate can intercept the request by returning NO and processing URL // in own way.
diff --git a/ios/web/public/web_state/web_state.h b/ios/web/public/web_state/web_state.h index 292e778..d9dfe65 100644 --- a/ios/web/public/web_state/web_state.h +++ b/ios/web/public/web_state/web_state.h
@@ -32,6 +32,7 @@ namespace base { class DictionaryValue; +class Value; } namespace web { @@ -89,6 +90,11 @@ virtual WebStateDelegate* GetDelegate() = 0; virtual void SetDelegate(WebStateDelegate* delegate) = 0; + // Whether or not a web view is allowed to exist in this WebState. Defaults + // to false; this should be enabled before attempting to access the view. + virtual bool IsWebUsageEnabled() const = 0; + virtual void SetWebUsageEnabled(bool enabled) = 0; + // The view containing the contents of the current web page. If the view has // been purged due to low memory, this will recreate it. It is up to the // caller to size the view. @@ -108,6 +114,16 @@ // Gets the CRWJSInjectionReceiver associated with this WebState. virtual CRWJSInjectionReceiver* GetJSInjectionReceiver() const = 0; + // Runs JavaScript in the main frame's context. If a callback is provided, it + // will be used to return the result, when the result is available or script + // execution has failed due to an error. + // NOTE: Integer values will be returned as TYPE_DOUBLE because of underlying + // library limitation. + typedef base::Callback<void(const base::Value*)> JavaScriptResultCallback; + virtual void ExecuteJavaScript(const base::string16& javascript) = 0; + virtual void ExecuteJavaScript(const base::string16& javascript, + const JavaScriptResultCallback& callback) = 0; + // Gets the contents MIME type. virtual const std::string& GetContentsMimeType() const = 0;
diff --git a/ios/web/shell/DEPS b/ios/web/shell/DEPS index d0addc7..e2764979 100644 --- a/ios/web/shell/DEPS +++ b/ios/web/shell/DEPS
@@ -6,7 +6,6 @@ # TODO(crbug.com/597997): Remove these exceptions. Web shell must not use # any private APIs from web. - "+ios/web/web_state/ui/crw_web_controller.h", "+ios/web/web_state/web_state_impl.h", ]
diff --git a/ios/web/shell/shell_web_client.h b/ios/web/shell/shell_web_client.h index 0f26919..3da1f65 100644 --- a/ios/web/shell/shell_web_client.h +++ b/ios/web/shell/shell_web_client.h
@@ -24,6 +24,13 @@ WebMainParts* CreateWebMainParts() override; std::string GetProduct() const override; std::string GetUserAgent(bool desktop_user_agent) const override; + void AllowCertificateError( + WebState* web_state, + int cert_error, + const net::SSLInfo& ssl_info, + const GURL& request_url, + bool overridable, + const base::Callback<void(bool)>& callback) override; ShellBrowserState* browser_state() const;
diff --git a/ios/web/shell/shell_web_client.mm b/ios/web/shell/shell_web_client.mm index 405aeca8..3e90c05 100644 --- a/ios/web/shell/shell_web_client.mm +++ b/ios/web/shell/shell_web_client.mm
@@ -4,6 +4,8 @@ #include "ios/web/shell/shell_web_client.h" +#import <UIKit/UIKit.h> + #include "ios/web/public/user_agent.h" #include "ios/web/shell/shell_web_main_parts.h" @@ -33,4 +35,35 @@ return web::BuildUserAgentFromProduct(product); } +void ShellWebClient::AllowCertificateError( + WebState*, + int /*cert_error*/, + const net::SSLInfo&, + const GURL&, + bool overridable, + const base::Callback<void(bool)>& callback) { + base::Callback<void(bool)> block_callback(callback); + UIAlertController* alert = [UIAlertController + alertControllerWithTitle:@"Your connection is not private" + message:nil + preferredStyle:UIAlertControllerStyleActionSheet]; + [alert addAction:[UIAlertAction actionWithTitle:@"Go Back" + style:UIAlertActionStyleCancel + handler:^(UIAlertAction*) { + block_callback.Run(false); + }]]; + + if (overridable) { + [alert addAction:[UIAlertAction actionWithTitle:@"Continue" + style:UIAlertActionStyleDefault + handler:^(UIAlertAction*) { + block_callback.Run(true); + }]]; + } + [[UIApplication sharedApplication].keyWindow.rootViewController + presentViewController:alert + animated:YES + completion:nil]; +} + } // namespace web
diff --git a/ios/web/shell/view_controller.h b/ios/web/shell/view_controller.h index 40596f8d..5e69325 100644 --- a/ios/web/shell/view_controller.h +++ b/ios/web/shell/view_controller.h
@@ -7,8 +7,6 @@ #import <UIKit/UIKit.h> -#include "ios/web/public/web_state/ui/crw_web_delegate.h" - namespace web { class BrowserState; } @@ -21,8 +19,7 @@ extern NSString* const kWebShellAddressFieldAccessibilityLabel; // Implements the main UI for ios_web_shell, including a toolbar and web view. -@interface ViewController - : UIViewController<CRWWebDelegate, UITextFieldDelegate> +@interface ViewController : UIViewController @property(nonatomic, retain) IBOutlet UIView* containerView; @property(nonatomic, retain) IBOutlet UIToolbar* toolbarView;
diff --git a/ios/web/shell/view_controller.mm b/ios/web/shell/view_controller.mm index bca82a93..1d54106 100644 --- a/ios/web/shell/view_controller.mm +++ b/ios/web/shell/view_controller.mm
@@ -20,7 +20,6 @@ #import "ios/web/public/web_state/web_state_delegate_bridge.h" #import "ios/web/public/web_state/web_state_observer_bridge.h" #include "ios/web/shell/shell_browser_state.h" -#include "ios/web/web_state/ui/crw_web_controller.h" #include "ios/web/web_state/web_state_impl.h" #include "ui/base/page_transition_types.h" @@ -30,7 +29,9 @@ using web::NavigationManager; -@interface ViewController ()<CRWWebStateDelegate, CRWWebStateObserver> { +@interface ViewController ()<CRWWebStateDelegate, + CRWWebStateObserver, + UITextFieldDelegate> { web::BrowserState* _browserState; std::unique_ptr<web::WebStateImpl> _webState; std::unique_ptr<web::WebStateObserverBridge> _webStateObserver; @@ -112,8 +113,7 @@ _webState.reset(new web::WebStateImpl(_browserState)); _webState->GetNavigationManagerImpl().InitializeSession(nil, nil, NO, 0); - [_webState->GetWebController() setDelegate:self]; - [_webState->GetWebController() setWebUsageEnabled:YES]; + _webState->SetWebUsageEnabled(true); _webStateObserver.reset( new web::WebStateObserverBridge(_webState.get(), self)); @@ -258,97 +258,4 @@ [self updateToolbar]; } -// ----------------------------------------------------------------------- -// WebDelegate implementation. - -- (void)webWillAddPendingURL:(const GURL&)url - transition:(ui::PageTransition)transition { -} -- (void)webDidAddPendingURL { -} -- (void)webCancelStartLoadingRequest { -} -- (void)webDidStartLoadingURL:(const GURL&)currentUrl - shouldUpdateHistory:(BOOL)updateHistory { -} -- (void)webDidFinishWithURL:(const GURL&)url loadSuccess:(BOOL)loadSuccess { -} - -- (CRWWebController*)webPageOrderedOpen:(const GURL&)url - referrer:(const web::Referrer&)referrer - windowName:(NSString*)windowName - inBackground:(BOOL)inBackground { - return nil; -} - -- (CRWWebController*)webPageOrderedOpen { - return nil; -} - -- (void)webPageOrderedClose { -} -- (void)goDelta:(int)delta { -} -- (void)openURLWithParams:(const web::WebState::OpenURLParams&)params { -} -- (BOOL)openExternalURL:(const GURL&)URL linkClicked:(BOOL)linkClicked { - return NO; -} - -- (void)presentSSLError:(const net::SSLInfo&)info - forSSLStatus:(const web::SSLStatus&)status - recoverable:(BOOL)recoverable - callback:(SSLErrorCallback)shouldContinue { - UIAlertController* alert = [UIAlertController - alertControllerWithTitle:@"Your connection is not private" - message:nil - preferredStyle:UIAlertControllerStyleActionSheet]; - [alert addAction:[UIAlertAction actionWithTitle:@"Go Back" - style:UIAlertActionStyleCancel - handler:^(UIAlertAction*) { - shouldContinue(NO); - }]]; - - if (recoverable) { - [alert addAction:[UIAlertAction actionWithTitle:@"Continue" - style:UIAlertActionStyleDefault - handler:^(UIAlertAction*) { - shouldContinue(YES); - }]]; - } - [self presentViewController:alert animated:YES completion:nil]; -} - -- (void)presentSpoofingError { -} -- (void)webLoadCancelled:(const GURL&)url { -} -- (void)webDidUpdateHistoryStateWithPageURL:(const GURL&)pageUrl { -} -- (void)webController:(CRWWebController*)webController - retrievePlaceholderOverlayImage:(void (^)(UIImage*))block { -} -- (void)webController:(CRWWebController*)webController - onFormResubmissionForRequest:(NSURLRequest*)request - continueBlock:(ProceduralBlock)continueBlock - cancelBlock:(ProceduralBlock)cancelBlock { -} -- (void)webWillReload { -} -- (void)webWillInitiateLoadWithParams: - (NavigationManager::WebLoadParams&)params { -} -- (void)webDidUpdateSessionForLoadWithParams: - (const NavigationManager::WebLoadParams&)params - wasInitialNavigation:(BOOL)initialNavigation { -} -- (void)webWillFinishHistoryNavigationFromEntry:(CRWSessionEntry*)fromEntry { -} -- (int)downloadImageAtUrl:(const GURL&)url - maxBitmapSize:(uint32_t)maxBitmapSize - callback: - (const web::WebState::ImageDownloadCallback&)callback { - return -1; -} - @end
diff --git a/ios/web/test/web_test.h b/ios/web/test/web_test.h index a9ea554c..4b9a1ff7 100644 --- a/ios/web/test/web_test.h +++ b/ios/web/test/web_test.h
@@ -76,7 +76,10 @@ // background tasks have completed and |condition| evaluates to true. void WaitForCondition(ConditionBlock condition); // Evaluates JavaScript and returns result as a string. + // DEPRECATED. TODO(crbug.com/595761): Remove this API. NSString* EvaluateJavaScriptAsString(NSString* script); + // Synchronously executes JavaScript and returns result as id. + id ExecuteJavaScript(NSString* script); // TaskObserver methods (used when waiting for background tasks). void WillProcessTask(const base::PendingTask& pending_task) override; void DidProcessTask(const base::PendingTask& pending_task) override;
diff --git a/ios/web/test/web_test.mm b/ios/web/test/web_test.mm index 7624abe..5a500f5 100644 --- a/ios/web/test/web_test.mm +++ b/ios/web/test/web_test.mm
@@ -71,9 +71,9 @@ web_state_impl_.reset(new WebStateImpl(GetBrowserState())); web_state_impl_->GetNavigationManagerImpl().InitializeSession(nil, nil, NO, 0); + web_state_impl_->SetWebUsageEnabled(true); webController_.reset(web_state_impl_->GetWebController()); - [webController_ setWebUsageEnabled:YES]; // Force generation of child views; necessary for some tests. [webController_ triggerPendingLoad]; s_html_load_count = 0; @@ -175,6 +175,20 @@ return [[evaluationResult retain] autorelease]; } +id WebTestWithWebController::ExecuteJavaScript(NSString* script) { + __block base::scoped_nsprotocol<id> executionResult; + __block bool executionCompleted = false; + [webController_ executeJavaScript:script + completionHandler:^(id result, NSError*) { + executionResult.reset([result copy]); + executionCompleted = true; + }]; + base::test::ios::WaitUntilCondition(^{ + return executionCompleted; + }); + return [[executionResult retain] autorelease]; +} + void WebTestWithWebController::WillProcessTask( const base::PendingTask& pending_task) { // Nothing to do. @@ -190,8 +204,8 @@ NSString* inner_html = EvaluateJavaScriptAsString( @"(document && document.body && document.body.innerHTML) || 'undefined'"); if ([inner_html rangeOfString:load_check].location == NSNotFound) { - [webController_ setWebUsageEnabled:NO]; - [webController_ setWebUsageEnabled:YES]; + web_state_impl_->SetWebUsageEnabled(false); + web_state_impl_->SetWebUsageEnabled(true); [webController_ triggerPendingLoad]; return true; }
diff --git a/ios/web/web_state/js/crw_js_early_script_manager.h b/ios/web/web_state/js/crw_js_early_script_manager.h deleted file mode 100644 index 3371aff..0000000 --- a/ios/web/web_state/js/crw_js_early_script_manager.h +++ /dev/null
@@ -1,16 +0,0 @@ -// Copyright 2014 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_WEB_WEB_STATE_JS_CRW_JS_EARLY_SCRIPT_MANAGER_H_ -#define IOS_WEB_WEB_STATE_JS_CRW_JS_EARLY_SCRIPT_MANAGER_H_ - -#import "ios/web/public/web_state/js/crw_js_injection_manager.h" - -// Manager to handle all the scripts that need to be injected before the page -// scripts take effect. Includes the base scripts and any feature scripts -// that might need to perform global actions such as overriding HTML methods. -@interface CRWJSEarlyScriptManager : CRWJSInjectionManager -@end - -#endif // IOS_WEB_WEB_STATE_JS_CRW_JS_EARLY_SCRIPT_MANAGER_H_
diff --git a/ios/web/web_state/js/crw_js_early_script_manager.mm b/ios/web/web_state/js/crw_js_early_script_manager.mm deleted file mode 100644 index 00eb142..0000000 --- a/ios/web/web_state/js/crw_js_early_script_manager.mm +++ /dev/null
@@ -1,20 +0,0 @@ -// Copyright 2014 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/web/web_state/js/crw_js_early_script_manager.h" - -#import "ios/web/public/web_state/js/crw_js_injection_receiver.h" -#import "ios/web/web_state/js/page_script_util.h" - -@implementation CRWJSEarlyScriptManager - -- (NSString*)staticInjectionContent { - return web::GetEarlyPageScript(); -} - -- (NSString*)presenceBeacon { - return @"__gCrWeb"; -} - -@end
diff --git a/ios/web/web_state/js/crw_js_early_script_manager_unittest.mm b/ios/web/web_state/js/crw_js_early_script_manager_unittest.mm deleted file mode 100644 index ef5f5a6fa..0000000 --- a/ios/web/web_state/js/crw_js_early_script_manager_unittest.mm +++ /dev/null
@@ -1,54 +0,0 @@ -// Copyright 2014 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/web/web_state/js/crw_js_early_script_manager.h" - -#include "base/mac/scoped_nsobject.h" -#include "base/memory/ptr_util.h" -#import "ios/web/public/test/crw_test_js_injection_receiver.h" -#include "ios/web/public/test/scoped_testing_web_client.h" -#include "ios/web/public/web_client.h" -#import "ios/web/web_state/js/page_script_util.h" -#import "testing/gtest_mac.h" -#include "testing/platform_test.h" - -namespace web { -namespace { - -class CRWJSEarlyScriptManagerTest : public PlatformTest { - public: - CRWJSEarlyScriptManagerTest() - : web_client_(base::WrapUnique(new WebClient)) {} - - protected: - void SetUp() override { - PlatformTest::SetUp(); - receiver_.reset([[CRWTestJSInjectionReceiver alloc] init]); - earlyScriptManager_.reset(static_cast<CRWJSEarlyScriptManager*>( - [[receiver_ instanceOfClass:[CRWJSEarlyScriptManager class]] retain])); - } - - // Required for CRWJSEarlyScriptManager creation. - base::scoped_nsobject<CRWTestJSInjectionReceiver> receiver_; - // Testable CRWJSEarlyScriptManager. - base::scoped_nsobject<CRWJSEarlyScriptManager> earlyScriptManager_; - // WebClient required for getting early page script. - ScopedTestingWebClient web_client_; -}; - -// Tests that CRWJSEarlyScriptManager's content is the same as returned by -// web::GetEarlyPageScript. -TEST_F(CRWJSEarlyScriptManagerTest, Content) { - NSString* injectionContent = [earlyScriptManager_ staticInjectionContent]; - NSString* earlyScript = GetEarlyPageScript(); - // |earlyScript| is a substring of |injectionContent|. The latter wraps the - // former with "if (typeof __gCrWeb !== 'object')" check to avoid multiple - // injections. - EXPECT_NE(NSNotFound, - static_cast<NSInteger>( - [injectionContent rangeOfString:earlyScript].location)); -} - -} // namespace -} // namespace web
diff --git a/ios/web/web_state/js/crw_js_injection_receiver.mm b/ios/web/web_state/js/crw_js_injection_receiver.mm index 745fab8..3094f9ad 100644 --- a/ios/web/web_state/js/crw_js_injection_receiver.mm +++ b/ios/web/web_state/js/crw_js_injection_receiver.mm
@@ -41,6 +41,11 @@ [_evaluator evaluateJavaScript:script stringResultHandler:handler]; } +- (void)executeJavaScript:(NSString*)script + completionHandler:(web::JavaScriptResultBlock)completionHandler { + [_evaluator executeJavaScript:script completionHandler:completionHandler]; +} + - (BOOL)scriptHasBeenInjectedForClass:(Class)jsInjectionManagerClass presenceBeacon:(NSString*)beacon { return [_evaluator scriptHasBeenInjectedForClass:jsInjectionManagerClass
diff --git a/ios/web/web_state/ui/crw_web_controller+protected.h b/ios/web/web_state/ui/crw_web_controller+protected.h index 9ac7546..8f00f89 100644 --- a/ios/web/web_state/ui/crw_web_controller+protected.h +++ b/ios/web/web_state/ui/crw_web_controller+protected.h
@@ -27,19 +27,6 @@ class NavigationItem; } // namespace web -namespace web { -// Values of the UMA |Web.URLVerificationFailure| histogram. -enum WebViewDocumentType { - // Generic contents (e.g. PDF documents). - WEB_VIEW_DOCUMENT_TYPE_GENERIC = 0, - // HTML contents. - WEB_VIEW_DOCUMENT_TYPE_HTML, - // Unknown contents. - WEB_VIEW_DOCUMENT_TYPE_UNKNOWN, - WEB_VIEW_DOCUMENT_TYPE_COUNT, -}; -} // namespace web - using web::NavigationManager; namespace { // Constants for storing the source of NSErrors received by WKWebViews: @@ -92,21 +79,8 @@ // Downloader for PassKit files. Lazy initialized. @property(nonatomic, readonly) CRWPassKitDownloader* passKitDownloader; -// Returns the type of document object loaded in the web view. -- (web::WebViewDocumentType)webViewDocumentType; - - (void)loadRequest:(NSMutableURLRequest*)request; -// Called before loading current URL in WebView. -- (void)willLoadCurrentURLInWebView; - -// Called when web view process has been terminated. -- (void)webViewWebProcessDidCrash; - -// Sets zoom scale value for webview scroll view from |zoomState|. -- (void)applyWebViewScrollZoomScaleFromZoomState: - (const web::PageZoomState&)zoomState; - // Called when web controller receives a new message from the web page. - (void)didReceiveScriptMessage:(WKScriptMessage*)message; @@ -143,12 +117,6 @@ // Returns a NSMutableURLRequest that represents the current NavigationItem. - (NSMutableURLRequest*)requestForCurrentNavigationItem; -// Compares the two URLs being navigated between during a history navigation to -// determine if a # needs to be appended to the URL of |toItem| to trigger a -// hashchange event. If so, also saves the modified URL into |toItem|. -- (GURL)URLForHistoryNavigationFromItem:(web::NavigationItem*)fromItem - toItem:(web::NavigationItem*)toItem; - // Updates the internal state and informs the delegate that any outstanding load // operations are cancelled. - (void)loadCancelled; @@ -196,6 +164,10 @@ // Returns whether the user is interacting with the page. @property(nonatomic, readonly) BOOL userIsInteracting; +// YES if a user interaction has been registered at any time since the page has +// loaded. +@property(nonatomic, readwrite) BOOL userInteractionRegistered; + // YES if the web process backing _wkWebView is believed to currently be dead. @property(nonatomic, assign) BOOL webProcessIsDead; @@ -262,10 +234,6 @@ // changes; the two need to be separated and handled differently. - (void)webPageChanged; -// Injects all scripts registered for early injection, as well as the window ID, -// if necssary. If they are already injected, this is a no-op. -- (void)injectEarlyInjectionScripts; - // Resets the set of script managers whose scripts have been injected into the // current page to an empty list. - (void)clearInjectedScriptManagers; @@ -381,12 +349,6 @@ // Resets pending navigation info. - (void)resetPendingNavigationInfo; -// Converts MIME type string to WebViewDocumentType. -- (web::WebViewDocumentType)documentTypeFromMIMEType:(NSString*)MIMEType; - -// Extracts Referer value from WKNavigationAction request header. -- (NSString*)refererFromNavigationAction:(WKNavigationAction*)action; - // Loads POST request with body in |_wkWebView| by constructing an HTML page // that executes the request through JavaScript and replaces document with the // result.
diff --git a/ios/web/web_state/ui/crw_web_controller.mm b/ios/web/web_state/ui/crw_web_controller.mm index 66173f2..8d5a247 100644 --- a/ios/web/web_state/ui/crw_web_controller.mm +++ b/ios/web/web_state/ui/crw_web_controller.mm
@@ -19,6 +19,7 @@ #include "base/json/json_writer.h" #include "base/json/string_escape.h" #include "base/logging.h" +#include "base/mac/bind_objc_block.h" #include "base/mac/bundle_locations.h" #include "base/mac/foundation_util.h" #include "base/mac/objc_property_releaser.h" @@ -76,7 +77,6 @@ #import "ios/web/web_state/crw_web_view_proxy_impl.h" #import "ios/web/web_state/error_translation_util.h" #include "ios/web/web_state/frame_info.h" -#import "ios/web/web_state/js/crw_js_early_script_manager.h" #import "ios/web/web_state/js/crw_js_plugin_placeholder_manager.h" #import "ios/web/web_state/js/crw_js_post_request_loader.h" #import "ios/web/web_state/js/crw_js_window_id_manager.h" @@ -150,6 +150,17 @@ CFAbsoluteTime time; }; +// Values of the UMA |Web.URLVerificationFailure| histogram. +enum WebViewDocumentType { + // Generic contents (e.g. PDF documents). + WEB_VIEW_DOCUMENT_TYPE_GENERIC = 0, + // HTML contents. + WEB_VIEW_DOCUMENT_TYPE_HTML, + // Unknown contents. + WEB_VIEW_DOCUMENT_TYPE_UNKNOWN, + WEB_VIEW_DOCUMENT_TYPE_COUNT, +}; + } // namespace web namespace { @@ -359,9 +370,6 @@ // from the web view can be identified as resulting from these events. base::scoped_nsobject<NSMutableSet> _openedApplicationURL; - // Object that manages all early script injection into the web view. - base::scoped_nsobject<CRWJSEarlyScriptManager> _earlyScriptManager; - // A set of script managers whose scripts have been injected into the current // page. // TODO(stuartmorgan): Revisit this approach; it's intended only as a stopgap @@ -470,9 +478,17 @@ - (void)setWebView:(WKWebView*)webView; // Destroys the web view by setting webView property to nil. - (void)resetWebView; +// Called when web view process has been terminated. +- (void)webViewWebProcessDidCrash; // Returns the WKWebViewConfigurationProvider associated with the web // controller's BrowserState. - (web::WKWebViewConfigurationProvider&)webViewConfigurationProvider; +// Returns the type of document object loaded in the web view. +- (web::WebViewDocumentType)webViewDocumentType; +// Converts MIME type string to WebViewDocumentType. +- (web::WebViewDocumentType)documentTypeFromMIMEType:(NSString*)MIMEType; +// Extracts Referer value from WKNavigationAction request header. +- (NSString*)refererFromNavigationAction:(WKNavigationAction*)action; // Returns the current URL of the web view, and sets |trustLevel| accordingly // based on the confidence in the verification. @@ -523,6 +539,8 @@ // the URL don't incorrectly trigger |-pageChanged| calls. - (void)setPushedOrReplacedURL:(const GURL&)URL stateObject:(NSString*)stateObject; +// Called before loading current URL in WebView. +- (void)willLoadCurrentURLInWebView; - (BOOL)isLoaded; // Extracts the current page's viewport tag information and calls |completion|. // If the page has changed before the viewport tag is successfully extracted, @@ -544,6 +562,9 @@ // Calls the zoom-completion UIScrollViewDelegate callbacks on the web view. // This is called after |-applyWebViewScrollZoomScaleFromScrollState:|. - (void)finishApplyingWebViewScrollZoomScale; +// Sets zoom scale value for webview scroll view from |zoomState|. +- (void)applyWebViewScrollZoomScaleFromZoomState: + (const web::PageZoomState&)zoomState; // Sets scroll offset value for webview scroll view from |scrollState|. - (void)applyWebViewScrollOffsetFromScrollState: (const web::PageScrollState&)scrollState; @@ -597,6 +618,11 @@ // Returns YES if the given WKBackForwardListItem is valid to use for // navigation. - (BOOL)isBackForwardListItemValid:(WKBackForwardListItem*)item; +// Compares the two URLs being navigated between during a history navigation to +// determine if a # needs to be appended to the URL of |toItem| to trigger a +// hashchange event. If so, also saves the modified URL into |toItem|. +- (GURL)URLForHistoryNavigationFromItem:(web::NavigationItem*)fromItem + toItem:(web::NavigationItem*)toItem; // Finds all the scrollviews in the view hierarchy and makes sure they do not // interfere with scroll to top when tapping the statusbar. @@ -826,8 +852,6 @@ _defaultURL = GURL(url::kAboutBlankURL); _jsInjectionReceiver.reset( [[CRWJSInjectionReceiver alloc] initWithEvaluator:self]); - _earlyScriptManager.reset([(CRWJSEarlyScriptManager*)[_jsInjectionReceiver - instanceOfClass:[CRWJSEarlyScriptManager class]] retain]); _windowIDJSManager.reset([(CRWJSWindowIdManager*)[_jsInjectionReceiver instanceOfClass:[CRWJSWindowIdManager class]] retain]); _lastSeenWindowID.reset(); @@ -1423,15 +1447,39 @@ [list.backList indexOfObject:item] != NSNotFound; } -- (void)injectEarlyInjectionScripts { - DCHECK(self.webView); - if (![_earlyScriptManager hasBeenInjected]) { - [_earlyScriptManager inject]; - // If this assertion fires there has been an error parsing the core.js - // object. - DCHECK([_earlyScriptManager hasBeenInjected]); +- (GURL)URLForHistoryNavigationFromItem:(web::NavigationItem*)fromItem + toItem:(web::NavigationItem*)toItem { + // If navigating with native API, i.e. using a back forward list item, + // hashchange events will be triggered automatically, so no URL tampering is + // required. + web::WKBackForwardListItemHolder* holder = + web::WKBackForwardListItemHolder::FromNavigationItem(toItem); + if (holder->back_forward_list_item()) { + return toItem->GetURL(); } - [self injectWindowID]; + + const GURL& startURL = fromItem->GetURL(); + const GURL& endURL = toItem->GetURL(); + + // Check the state of the fragments on both URLs (aka, is there a '#' in the + // url or not). + if (!startURL.has_ref() || endURL.has_ref()) { + return endURL; + } + + // startURL contains a fragment and endURL doesn't. Remove the fragment from + // startURL and compare the resulting string to endURL. If they are equal, add + // # to endURL to cause a hashchange event. + GURL hashless = web::GURLByRemovingRefFromGURL(startURL); + + if (hashless != endURL) + return endURL; + + url::StringPieceReplacements<std::string> emptyRef; + emptyRef.SetRefStr(""); + GURL newEndURL = endURL.ReplaceComponents(emptyRef); + toItem->SetURL(newEndURL); + return newEndURL; } - (void)clearInjectedScriptManagers { @@ -1699,6 +1747,11 @@ }]; } +- (void)willLoadCurrentURLInWebView { + // TODO(stuartmorgan): Get a WKWebView version of the request ID verification + // code working for debug builds. +} + // Load the current URL in a web view, first ensuring the web view is visible. - (void)loadCurrentURLInWebView { [self willLoadCurrentURLInWebView]; @@ -2137,7 +2190,7 @@ // on by the CRWWebController, so the history stack and state of the // CRWWebController is 100% up to date before the stack navigation starts. if (self.webView) { - [self injectEarlyInjectionScripts]; + [self injectWindowID]; [self checkForUnexpectedURLChange]; } @@ -2281,32 +2334,6 @@ } } -- (GURL)URLForHistoryNavigationFromItem:(web::NavigationItem*)fromItem - toItem:(web::NavigationItem*)toItem { - const GURL& startURL = fromItem->GetURL(); - const GURL& endURL = toItem->GetURL(); - - // Check the state of the fragments on both URLs (aka, is there a '#' in the - // url or not). - if (!startURL.has_ref() || endURL.has_ref()) { - return endURL; - } - - // startURL contains a fragment and endURL doesn't. Remove the fragment from - // startURL and compare the resulting string to endURL. If they are equal, add - // # to endURL to cause a hashchange event. - GURL hashless = web::GURLByRemovingRefFromGURL(startURL); - - if (hashless != endURL) - return endURL; - - url::StringPieceReplacements<std::string> emptyRef; - emptyRef.SetRefStr(""); - GURL newEndURL = endURL.ReplaceComponents(emptyRef); - toItem->SetURL(newEndURL); - return newEndURL; -} - - (void)evaluateJavaScript:(NSString*)script JSONResultHandler: (void (^)(std::unique_ptr<base::Value>, NSError*))handler { @@ -2447,6 +2474,12 @@ web::EvaluateJavaScript(self.webView, safeScript, handler); } +- (void)executeJavaScript:(NSString*)script + completionHandler:(web::JavaScriptResultBlock)completionHandler { + NSString* safeScript = [self scriptByAddingWindowIDCheckForScript:script]; + web::ExecuteJavaScript(self.webView, safeScript, completionHandler); +} + - (BOOL)scriptHasBeenInjectedForClass:(Class)JSInjectionManagerClass presenceBeacon:(NSString*)beacon { return [_injectedScriptManagers containsObject:JSInjectionManagerClass]; @@ -2456,18 +2489,10 @@ // Skip evaluation if there's no content (e.g., if what's being injected is // an umbrella manager). if ([script length]) { - // Make sure that CRWJSEarlyScriptManager has been injected. - BOOL ealyScriptInjected = [self - scriptHasBeenInjectedForClass:[CRWJSEarlyScriptManager class] - presenceBeacon:[_earlyScriptManager presenceBeacon]]; - if (!ealyScriptInjected && - JSInjectionManagerClass != [CRWJSEarlyScriptManager class]) { - [_earlyScriptManager inject]; - } // Every injection except windowID requires windowID check. if (JSInjectionManagerClass != [CRWJSWindowIdManager class]) script = [self scriptByAddingWindowIDCheckForScript:script]; - web::EvaluateJavaScript(self.webView, script, nil); + web::ExecuteJavaScript(self.webView, script, nil); } [_injectedScriptManagers addObject:JSInjectionManagerClass]; } @@ -2476,7 +2501,7 @@ - (void)evaluateUserJavaScript:(NSString*)script { [self setUserInteractionRegistered:YES]; - web::EvaluateJavaScript(self.webView, script, nil); + web::ExecuteJavaScript(self.webView, script, nil); } - (void)didFinishNavigation { @@ -3574,22 +3599,8 @@ onUrl:(const GURL&)url recoverable:(BOOL)recoverable callback:(SSLErrorCallback)shouldContinue { - DCHECK(_delegate); - DCHECK_EQ(url, [self currentNavigationURL]); - [_delegate presentSSLError:info - forSSLStatus:status - recoverable:recoverable - callback:^(BOOL proceed) { - if (proceed) { - // The interstitial will be removed during reload. - [self loadCurrentURL]; - } - if (shouldContinue) { - shouldContinue(proceed); - } - }]; - DCHECK([self currentNavItem]); - [self currentNavItem]->SetUnsafe(true); + // This is a UIWebView callback, which is no longer called. + NOTREACHED(); } - (void)updatedProgress:(float)progress { @@ -3955,6 +3966,28 @@ _applyingPageState = NO; } } + +#pragma mark - +#pragma mark CRWWebViewScrollViewProxyObserver + +// Under WKWebView, JavaScript can execute asynchronously. User can start +// scrolling and calls to window.scrollTo executed during scrolling will be +// treated as "during user interaction" and can cause app to go fullscreen. +// This is a workaround to use this webViewScrollViewIsDragging flag to ignore +// window.scrollTo while user is scrolling. See crbug.com/554257 +- (void)webViewScrollViewWillBeginDragging: + (CRWWebViewScrollViewProxy*)webViewScrollViewProxy { + [self evaluateJavaScript:@"__gCrWeb.setWebViewScrollViewIsDragging(true)" + stringResultHandler:nil]; +} + +- (void)webViewScrollViewDidEndDragging: + (CRWWebViewScrollViewProxy*)webViewScrollViewProxy + willDecelerate:(BOOL)decelerate { + [self evaluateJavaScript:@"__gCrWeb.setWebViewScrollViewIsDragging(false)" + stringResultHandler:nil]; +} + #pragma mark - #pragma mark Page State @@ -4133,8 +4166,18 @@ - (void)applyWebViewScrollZoomScaleFromZoomState: (const web::PageZoomState&)zoomState { - // Subclasses must implement this method. - NOTREACHED(); + // After rendering a web page, WKWebView keeps the |minimumZoomScale| and + // |maximumZoomScale| properties of its scroll view constant while adjusting + // the |zoomScale| property accordingly. The maximum-scale or minimum-scale + // meta tags of a page may have changed since the state was recorded, so clamp + // the zoom scale to the current range if necessary. + DCHECK(zoomState.IsValid()); + CGFloat zoomScale = zoomState.zoom_scale(); + if (zoomScale < self.webScrollView.minimumZoomScale) + zoomScale = self.webScrollView.minimumZoomScale; + if (zoomScale > self.webScrollView.maximumZoomScale) + zoomScale = self.webScrollView.maximumZoomScale; + self.webScrollView.zoomScale = zoomScale; } - (void)applyWebViewScrollOffsetFromScrollState: @@ -4438,6 +4481,8 @@ net::SSLInfo info; web::GetSSLInfoFromWKWebViewSSLCertError(error, &info); + // TODO(crbug.com/602298): Remove |status| variable, once |presentSSLError:| + // callback is dropped. web::SSLStatus status; status.security_style = web::SECURITY_STYLE_AUTHENTICATION_BROKEN; status.cert_status = info.cert_status; @@ -4453,7 +4498,8 @@ // cert, because the cert chain in |didReceiveAuthenticationChallenge:| is // the OS constructed chain, while |chain| is the chain from the server. NSArray* chain = error.userInfo[web::kNSErrorPeerCertificateChainKey]; - NSString* host = [error.userInfo[web::kNSErrorFailingURLKey] host]; + NSURL* requestURL = error.userInfo[web::kNSErrorFailingURLKey]; + NSString* host = [requestURL host]; scoped_refptr<net::X509Certificate> leafCert; BOOL recoverable = NO; if (chain.count && host.length) { @@ -4476,19 +4522,36 @@ } // Present SSL interstitial and inform everyone that the load is cancelled. - [self.delegate presentSSLError:info - forSSLStatus:status - recoverable:recoverable - callback:^(BOOL proceed) { - if (proceed) { - // The interstitial will be removed during reload. - [_certVerificationController - allowCert:leafCert - forHost:host - status:status.cert_status]; - [self loadCurrentURL]; - } - }]; + void (^proceedBlock)() = ^{ + DCHECK(recoverable); + // The interstitial will be removed during reload. + [_certVerificationController allowCert:leafCert + forHost:host + status:status.cert_status]; + [self loadCurrentURL]; + }; + // TODO(crbug.com/602298): Remove SSL error API from CRWWebDelegate. + if ([self.delegate respondsToSelector:@selector(presentSSLError: + forSSLStatus: + recoverable: + callback:)]) { + [self.delegate presentSSLError:info + forSSLStatus:status + recoverable:recoverable + callback:^(BOOL proceed) { + if (proceed) + proceedBlock(); + }]; + } else { + web::GetWebClient()->AllowCertificateError( + self.webState, net::MapCertStatusToNetError(info.cert_status), info, + net::GURLWithNSURL(requestURL), recoverable, + base::BindBlock(^(bool proceed) { + if (proceed) + proceedBlock(); + })); + } + [self loadCancelled]; } @@ -4560,6 +4623,18 @@ [self setWebView:nil]; } +- (void)webViewWebProcessDidCrash { + [self setWebProcessIsDead:YES]; + + SEL cancelDialogsSelector = @selector(cancelDialogsForWebController:); + if ([self.UIDelegate respondsToSelector:cancelDialogsSelector]) + [self.UIDelegate cancelDialogsForWebController:self]; + + SEL rendererCrashSelector = @selector(webControllerWebProcessDidCrash:); + if ([self.delegate respondsToSelector:rendererCrashSelector]) + [self.delegate webControllerWebProcessDidCrash:self]; +} + - (void)loadPOSTRequest:(NSMutableURLRequest*)request { if (!_POSTRequestLoader) { _POSTRequestLoader.reset([[CRWJSPOSTRequestLoader alloc] init]); @@ -4584,6 +4659,16 @@ return web::WKWebViewConfigurationProvider::FromBrowserState(browserState); } +- (web::WebViewDocumentType)webViewDocumentType { + // This happens during tests. + if (!self.webView) { + return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC; + } + + std::string MIMEType = self.webState->GetContentsMimeType(); + return [self documentTypeFromMIMEType:base::SysUTF8ToNSString(MIMEType)]; +} + - (void)loadHTML:(NSString*)HTML forURL:(const GURL&)URL { // Remove the transient content view. [self clearTransientContentView]; @@ -4842,9 +4927,15 @@ // TODO(crbug.com/546347): Extract necessary tasks for app specific URL // navigation rather than restarting the load. if (web::GetWebClient()->IsAppSpecificURL(webViewURL)) { - [self abortWebLoad]; - NavigationManager::WebLoadParams params(webViewURL); - [self loadWithParams:params]; + // Renderer-initiated loads of WebUI can be done only from other WebUI + // pages. WebUI pages may have increased power and using the same web + // process (which may potentially be controller by an attacker) is + // dangerous. + if (web::GetWebClient()->IsAppSpecificURL(_documentURL)) { + [self abortWebLoad]; + NavigationManager::WebLoadParams params(webViewURL); + [self loadWithParams:params]; + } return; } else { [self registerLoadRequest:webViewURL]; @@ -4955,7 +5046,7 @@ // TODO(crbug.com/546350): Investigate using // WKUserScriptInjectionTimeAtDocumentEnd to inject this material at the // appropriate time rather than invoking here. - web::EvaluateJavaScript(webView, @"__gCrWeb.didFinishNavigation()", nil); + web::ExecuteJavaScript(webView, @"__gCrWeb.didFinishNavigation()", nil); [self didFinishNavigation]; }
diff --git a/ios/web/web_state/ui/crw_web_controller_unittest.mm b/ios/web/web_state/ui/crw_web_controller_unittest.mm index e636198..8156718 100644 --- a/ios/web/web_state/ui/crw_web_controller_unittest.mm +++ b/ios/web/web_state/ui/crw_web_controller_unittest.mm
@@ -447,7 +447,8 @@ // Tests that presentSSLError:forSSLStatus:recoverable:callback: is called with // correct arguments if WKWebView fails to load a page with bad SSL cert. -TEST_F(CRWWebControllerTest, SslCertError) { +// TODO(crbug.com/602298): Remove this test. +TEST_F(CRWWebControllerTest, SslCertErrorDeprecatedApi) { ASSERT_FALSE([mockDelegate_ SSLInfo].is_valid()); scoped_refptr<net::X509Certificate> cert = @@ -480,6 +481,50 @@ EXPECT_TRUE([mockDelegate_ shouldContinueCallback]); } +// Tests that AllowCertificateError is called with correct arguments if +// WKWebView fails to load a page with bad SSL cert. +TEST_F(CRWWebControllerTest, SslCertError) { + // TODO(crbug.com/602298): Remove this call. + [webController_ setDelegate:nil]; + + // Last arguments passed to AllowCertificateError must be in default state. + ASSERT_FALSE(GetWebClient()->last_cert_error_code()); + ASSERT_FALSE(GetWebClient()->last_cert_error_ssl_info().is_valid()); + ASSERT_FALSE(GetWebClient()->last_cert_error_ssl_info().cert_status); + ASSERT_FALSE(GetWebClient()->last_cert_error_request_url().is_valid()); + ASSERT_TRUE(GetWebClient()->last_cert_error_overridable()); + + scoped_refptr<net::X509Certificate> cert = + net::ImportCertFromFile(net::GetTestCertsDirectory(), "ok_cert.pem"); + + NSArray* chain = @[ static_cast<id>(cert->os_cert_handle()) ]; + GURL url("https://chromium.test"); + NSError* error = + [NSError errorWithDomain:NSURLErrorDomain + code:NSURLErrorServerCertificateHasUnknownRoot + userInfo:@{ + web::kNSErrorPeerCertificateChainKey : chain, + web::kNSErrorFailingURLKey : net::NSURLWithGURL(url), + }]; + WKWebView* webView = static_cast<WKWebView*>([webController_ webView]); + base::scoped_nsobject<NSObject> navigation([[NSObject alloc] init]); + [static_cast<id<WKNavigationDelegate>>(webController_.get()) + webView:webView + didStartProvisionalNavigation:static_cast<WKNavigation*>(navigation)]; + [static_cast<id<WKNavigationDelegate>>(webController_.get()) + webView:webView + didFailProvisionalNavigation:static_cast<WKNavigation*>(navigation) + withError:error]; + + // Verify correctness of AllowCertificateError method call. + EXPECT_EQ(net::ERR_CERT_INVALID, GetWebClient()->last_cert_error_code()); + EXPECT_TRUE(GetWebClient()->last_cert_error_ssl_info().is_valid()); + EXPECT_EQ(net::CERT_STATUS_INVALID, + GetWebClient()->last_cert_error_ssl_info().cert_status); + EXPECT_EQ(url, GetWebClient()->last_cert_error_request_url()); + EXPECT_FALSE(GetWebClient()->last_cert_error_overridable()); +} + // Test fixture to test |setPageDialogOpenPolicy:|. class CRWWebControllerPageDialogOpenPolicyTest : public web::WebTestWithWebController { @@ -756,18 +801,25 @@ ASSERT_FALSE(web_controller.atTop); }; -// Real WKWebView is required for JSEvaluationTest. -typedef web::WebTestWithWebController CRWWebControllerJSEvaluationTest; +// Real WKWebView is required for CRWWebControllerJSExecutionTest. +typedef web::WebTestWithWebController CRWWebControllerJSExecutionTest; // Tests that a script correctly evaluates to string. -TEST_F(CRWWebControllerJSEvaluationTest, Evaluation) { +TEST_F(CRWWebControllerJSExecutionTest, LegacyAPIExecution) { LoadHtml(@"<p></p>"); EXPECT_NSEQ(@"true", EvaluateJavaScriptAsString(@"true")); EXPECT_NSEQ(@"false", EvaluateJavaScriptAsString(@"false")); } +// Tests that a script correctly evaluates to boolean. +TEST_F(CRWWebControllerJSExecutionTest, Execution) { + LoadHtml(@"<p></p>"); + EXPECT_NSEQ(@YES, ExecuteJavaScript(@"true")); + EXPECT_NSEQ(@NO, ExecuteJavaScript(@"false")); +} + // Tests that a script is not evaluated on windowID mismatch. -TEST_F(CRWWebControllerJSEvaluationTest, WindowIdMissmatch) { +TEST_F(CRWWebControllerJSExecutionTest, LegacyAPIWindowIdMissmatch) { LoadHtml(@"<p></p>"); // Script is evaluated since windowID is matched. EvaluateJavaScriptAsString(@"window.test1 = '1';"); @@ -781,6 +833,21 @@ EXPECT_NSEQ(@"", EvaluateJavaScriptAsString(@"window.test2")); } +// Tests that a script is not executed on windowID mismatch. +TEST_F(CRWWebControllerJSExecutionTest, WindowIdMissmatch) { + LoadHtml(@"<p></p>"); + // Script is evaluated since windowID is matched. + ExecuteJavaScript(@"window.test1 = '1';"); + EXPECT_NSEQ(@"1", ExecuteJavaScript(@"window.test1")); + + // Change windowID. + ExecuteJavaScript(@"__gCrWeb['windowId'] = '';"); + + // Script is not evaluated because of windowID mismatch. + ExecuteJavaScript(@"window.test2 = '2';"); + EXPECT_FALSE(ExecuteJavaScript(@"window.test2")); +} + TEST_F(CRWWebControllerTest, WebUrlWithTrustLevel) { [[[mockWebView_ stub] andReturn:[NSURL URLWithString:kTestURLString]] URL]; [[[mockWebView_ stub] andReturnBool:NO] hasOnlySecureContent]; @@ -852,7 +919,7 @@ // Configure child web state. child_web_state_.reset(new web::WebStateImpl(GetBrowserState())); - [child_web_state_->GetWebController() setWebUsageEnabled:YES]; + child_web_state_->SetWebUsageEnabled(true); [delegate_ setChildWebController:child_web_state_->GetWebController()]; // Configure child web controller's session controller mock.
diff --git a/ios/web/web_state/ui/crw_wk_web_view_web_controller.mm b/ios/web/web_state/ui/crw_wk_web_view_web_controller.mm index c02be66..f31951c 100644 --- a/ios/web/web_state/ui/crw_wk_web_view_web_controller.mm +++ b/ios/web/web_state/ui/crw_wk_web_view_web_controller.mm
@@ -44,92 +44,4 @@ @implementation CRWWKWebViewWebController -#pragma mark Protected method implementations - -// The core.js cannot pass messages back to obj-c if it is injected -// to |WEB_VIEW_DOCUMENT| because it does not support iframe creation used -// by core.js to communicate back. That functionality is only supported -// by |WEB_VIEW_HTML_DOCUMENT|. |WEB_VIEW_DOCUMENT| is used when displaying -// non-HTML contents (e.g. PDF documents). -- (web::WebViewDocumentType)webViewDocumentType { - // This happens during tests. - if (!self.webView) { - return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC; - } - - std::string MIMEType = self.webState->GetContentsMimeType(); - return [self documentTypeFromMIMEType:base::SysUTF8ToNSString(MIMEType)]; -} - -- (void)willLoadCurrentURLInWebView { - // TODO(stuartmorgan): Get a WKWebView version of the request ID verification - // code working for debug builds. -} - -// Overrides the hashchange workaround in the super class that manually -// triggers Javascript hashchange events. If navigating with native API, -// i.e. using a back forward list item, hashchange events will be triggered -// automatically, so no URL tampering is required. -- (GURL)URLForHistoryNavigationFromItem:(web::NavigationItem*)fromItem - toItem:(web::NavigationItem*)toItem { - web::WKBackForwardListItemHolder* holder = - web::WKBackForwardListItemHolder::FromNavigationItem(toItem); - - if (holder->back_forward_list_item()) { - return toItem->GetURL(); - } - return [super URLForHistoryNavigationFromItem:fromItem toItem:toItem]; -} - -- (void)applyWebViewScrollZoomScaleFromZoomState: - (const web::PageZoomState&)zoomState { - // After rendering a web page, WKWebView keeps the |minimumZoomScale| and - // |maximumZoomScale| properties of its scroll view constant while adjusting - // the |zoomScale| property accordingly. The maximum-scale or minimum-scale - // meta tags of a page may have changed since the state was recorded, so clamp - // the zoom scale to the current range if necessary. - DCHECK(zoomState.IsValid()); - CGFloat zoomScale = zoomState.zoom_scale(); - if (zoomScale < self.webScrollView.minimumZoomScale) - zoomScale = self.webScrollView.minimumZoomScale; - if (zoomScale > self.webScrollView.maximumZoomScale) - zoomScale = self.webScrollView.maximumZoomScale; - self.webScrollView.zoomScale = zoomScale; -} - -#pragma mark Private methods - -- (void)webViewWebProcessDidCrash { - [self setWebProcessIsDead:YES]; - - SEL cancelDialogsSelector = @selector(cancelDialogsForWebController:); - if ([self.UIDelegate respondsToSelector:cancelDialogsSelector]) - [self.UIDelegate cancelDialogsForWebController:self]; - - SEL rendererCrashSelector = @selector(webControllerWebProcessDidCrash:); - if ([self.delegate respondsToSelector:rendererCrashSelector]) - [self.delegate webControllerWebProcessDidCrash:self]; -} - -#pragma mark - -#pragma mark CRWWebViewScrollViewProxyObserver - -// Under WKWebView, JavaScript can execute asynchronously. User can start -// scrolling and calls to window.scrollTo executed during scrolling will be -// treated as "during user interaction" and can cause app to go fullscreen. -// This is a workaround to use this webViewScrollViewIsDragging flag to ignore -// window.scrollTo while user is scrolling. See crbug.com/554257 -- (void)webViewScrollViewWillBeginDragging: - (CRWWebViewScrollViewProxy*)webViewScrollViewProxy { - [self evaluateJavaScript:@"__gCrWeb.setWebViewScrollViewIsDragging(true)" - stringResultHandler:nil]; -} - -- (void)webViewScrollViewDidEndDragging: - (CRWWebViewScrollViewProxy*)webViewScrollViewProxy - willDecelerate:(BOOL)decelerate { - [self evaluateJavaScript:@"__gCrWeb.setWebViewScrollViewIsDragging(false)" - stringResultHandler:nil]; -} - @end
diff --git a/ios/web/web_state/ui/web_view_js_utils.h b/ios/web/web_state/ui/web_view_js_utils.h index e1dec69..35d1365 100644 --- a/ios/web/web_state/ui/web_view_js_utils.h +++ b/ios/web/web_state/ui/web_view_js_utils.h
@@ -6,11 +6,16 @@ #define IOS_WEB_WEB_STATE_UI_WEB_VIEW_JS_UTILS_H_ #import <Foundation/Foundation.h> +#include <memory> #include "ios/web/public/block_types.h" @class WKWebView; +namespace base { +class Value; +} // namespace base + namespace web { // The domain for JS evaluation NSErrors in web. @@ -22,6 +27,9 @@ JS_EVALUATION_ERROR_CODE_NO_WEB_VIEW = 1, }; +// Converts result of WKWebView script evaluation to base::Value. +std::unique_ptr<base::Value> ValueResultFromWKResult(id result); + // Evaluates JavaScript on WKWebView. Provides evaluation result as a string. // If the web view cannot evaluate JS at the moment, |completion_handler| is // called with an NSError. @@ -29,6 +37,12 @@ NSString* script, JavaScriptCompletion completion_handler); +// Executes JavaScript on WKWebView. If the web view cannot execute JS at the +// moment, |completion_handler| is called with an NSError. +void ExecuteJavaScript(WKWebView* web_view, + NSString* script, + JavaScriptResultBlock completion_handler); + } // namespace web #endif // IOS_WEB_WEB_STATE_UI_WEB_VIEW_JS_UTILS_H_
diff --git a/ios/web/web_state/ui/web_view_js_utils.mm b/ios/web/web_state/ui/web_view_js_utils.mm index 4d08d73..48d65aa 100644 --- a/ios/web/web_state/ui/web_view_js_utils.mm +++ b/ios/web/web_state/ui/web_view_js_utils.mm
@@ -9,6 +9,8 @@ #include "base/logging.h" #include "base/mac/scoped_nsobject.h" +#include "base/strings/sys_string_conversions.h" +#include "base/values.h" namespace { @@ -41,9 +43,51 @@ NSString* const kJSEvaluationErrorDomain = @"JSEvaluationError"; +std::unique_ptr<base::Value> ValueResultFromWKResult(id wk_result) { + if (!wk_result) + return nullptr; + + std::unique_ptr<base::Value> result; + CFTypeID result_type = CFGetTypeID(wk_result); + if (result_type == CFStringGetTypeID()) { + result.reset(new base::StringValue(base::SysNSStringToUTF16(wk_result))); + DCHECK(result->IsType(base::Value::TYPE_STRING)); + } else if (result_type == CFNumberGetTypeID()) { + result.reset(new base::FundamentalValue([wk_result doubleValue])); + DCHECK(result->IsType(base::Value::TYPE_DOUBLE)); + } else if (result_type == CFBooleanGetTypeID()) { + result.reset( + new base::FundamentalValue(static_cast<bool>([wk_result boolValue]))); + DCHECK(result->IsType(base::Value::TYPE_BOOLEAN)); + } else if (result_type == CFNullGetTypeID()) { + result = base::Value::CreateNullValue(); + DCHECK(result->IsType(base::Value::TYPE_NULL)); + } else { + NOTREACHED(); // Convert other types as needed. + } + return result; +} + void EvaluateJavaScript(WKWebView* web_view, NSString* script, JavaScriptCompletion completion_handler) { + void (^web_view_completion_handler)(id, NSError*) = nil; + // Do not create a web_view_completion_handler if no |completion_handler| is + // passed to this function. WKWebView guarantees to call all completion + // handlers before deallocation. Passing nil as completion handler (when + // appropriate) may speed up web view deallocation, because there will be no + // need to call those completion handlers. + if (completion_handler) { + web_view_completion_handler = ^(id result, NSError* error) { + completion_handler(StringResultFromWKResult(result), error); + }; + } + ExecuteJavaScript(web_view, script, web_view_completion_handler); +} + +void ExecuteJavaScript(WKWebView* web_view, + NSString* script, + JavaScriptResultBlock completion_handler) { DCHECK([script length]); if (!web_view && completion_handler) { dispatch_async(dispatch_get_main_queue(), ^{ @@ -58,19 +102,7 @@ return; } - void (^web_view_completion_handler)(id, NSError*) = nil; - // Do not create a web_view_completion_handler if no |completion_handler| is - // passed to this function. WKWebView guarantees to call all completion - // handlers before deallocation. Passing nil as completion handler (when - // appropriate) may speed up web view deallocation, because there will be no - // need to call those completion handlers. - if (completion_handler) { - web_view_completion_handler = ^(id result, NSError* error) { - completion_handler(StringResultFromWKResult(result), error); - }; - } - [web_view evaluateJavaScript:script - completionHandler:web_view_completion_handler]; + [web_view evaluateJavaScript:script completionHandler:completion_handler]; } } // namespace web
diff --git a/ios/web/web_state/ui/web_view_js_utils_unittest.mm b/ios/web/web_state/ui/web_view_js_utils_unittest.mm index 8a0bde32..ed33e726 100644 --- a/ios/web/web_state/ui/web_view_js_utils_unittest.mm +++ b/ios/web/web_state/ui/web_view_js_utils_unittest.mm
@@ -7,6 +7,7 @@ #include "base/logging.h" #import "base/mac/scoped_nsobject.h" #include "base/test/ios/wait_util.h" +#include "base/values.h" #include "ios/web/public/test/test_browser_state.h" #import "ios/web/public/test/test_web_client.h" #import "ios/web/public/web_view_creation_util.h" @@ -44,6 +45,61 @@ base::scoped_nsobject<WKWebView> web_view_; }; +// Tests that ValueResultFromWKResult converts nil value to nullptr. +TEST_F(WebViewJsUtilsTest, ValueResultFromUndefinedWKResult) { + EXPECT_FALSE(ValueResultFromWKResult(nil)); +} + +// Tests that ValueResultFromWKResult converts string to Value::TYPE_STRING. +TEST_F(WebViewJsUtilsTest, ValueResultFromStringWKResult) { + std::unique_ptr<base::Value> value(web::ValueResultFromWKResult(@"test")); + EXPECT_TRUE(value); + EXPECT_EQ(base::Value::TYPE_STRING, value->GetType()); + std::string converted_result; + value->GetAsString(&converted_result); + EXPECT_EQ("test", converted_result); +} + +// Tests that ValueResultFromWKResult converts inetger to Value::TYPE_DOUBLE. +// NOTE: WKWebView API returns all numbers as kCFNumberFloat64Type, so there is +// no way to tell if the result is integer or double. +TEST_F(WebViewJsUtilsTest, ValueResultFromIntegerWKResult) { + std::unique_ptr<base::Value> value(web::ValueResultFromWKResult(@1)); + EXPECT_TRUE(value); + EXPECT_EQ(base::Value::TYPE_DOUBLE, value->GetType()); + double converted_result = 0; + value->GetAsDouble(&converted_result); + EXPECT_EQ(1, converted_result); +} + +// Tests that ValueResultFromWKResult converts double to Value::TYPE_DOUBLE. +TEST_F(WebViewJsUtilsTest, ValueResultFromDoubleWKResult) { + std::unique_ptr<base::Value> value(web::ValueResultFromWKResult(@3.14)); + EXPECT_TRUE(value); + EXPECT_EQ(base::Value::TYPE_DOUBLE, value->GetType()); + double converted_result = 0; + value->GetAsDouble(&converted_result); + EXPECT_EQ(3.14, converted_result); +} + +// Tests that ValueResultFromWKResult converts bool to Value::TYPE_BOOLEAN. +TEST_F(WebViewJsUtilsTest, ValueResultFromBoolWKResult) { + std::unique_ptr<base::Value> value(web::ValueResultFromWKResult(@YES)); + EXPECT_TRUE(value); + EXPECT_EQ(base::Value::TYPE_BOOLEAN, value->GetType()); + bool converted_result = false; + value->GetAsBoolean(&converted_result); + EXPECT_TRUE(converted_result); +} + +// Tests that ValueResultFromWKResult converts null to Value::TYPE_NULL. +TEST_F(WebViewJsUtilsTest, ValueResultFromNullWKResult) { + std::unique_ptr<base::Value> value( + web::ValueResultFromWKResult([NSNull null])); + EXPECT_TRUE(value); + EXPECT_EQ(base::Value::TYPE_NULL, value->GetType()); +} + // Tests that a script with undefined result correctly evaluates to string. TEST_F(WebViewJsUtilsTest, UndefinedEvaluation) { EXPECT_NSEQ(@"", EvaluateJavaScript(@"{}"));
diff --git a/ios/web/web_state/web_state_impl.h b/ios/web/web_state/web_state_impl.h index 7b8e186..bb9cd5a1 100644 --- a/ios/web/web_state/web_state_impl.h +++ b/ios/web/web_state/web_state_impl.h
@@ -218,11 +218,16 @@ // WebState: WebStateDelegate* GetDelegate() override; void SetDelegate(WebStateDelegate* delegate) override; + bool IsWebUsageEnabled() const override; + void SetWebUsageEnabled(bool enabled) override; UIView* GetView() override; BrowserState* GetBrowserState() const override; void OpenURL(const WebState::OpenURLParams& params) override; NavigationManager* GetNavigationManager() override; CRWJSInjectionReceiver* GetJSInjectionReceiver() const override; + void ExecuteJavaScript(const base::string16& javascript) override; + void ExecuteJavaScript(const base::string16& javascript, + const JavaScriptResultCallback& callback) override; const std::string& GetContentLanguageHeader() const override; const std::string& GetContentsMimeType() const override; bool ContentIsHTML() const override;
diff --git a/ios/web/web_state/web_state_impl.mm b/ios/web/web_state/web_state_impl.mm index 281be04..09ca232 100644 --- a/ios/web/web_state/web_state_impl.mm +++ b/ios/web/web_state/web_state_impl.mm
@@ -498,6 +498,14 @@ #pragma mark - WebState implementation +bool WebStateImpl::IsWebUsageEnabled() const { + return [web_controller_ webUsageEnabled]; +} + +void WebStateImpl::SetWebUsageEnabled(bool enabled) { + [web_controller_ setWebUsageEnabled:enabled]; +} + UIView* WebStateImpl::GetView() { return [web_controller_ view]; } @@ -520,6 +528,26 @@ return [web_controller_ jsInjectionReceiver]; } +void WebStateImpl::ExecuteJavaScript(const base::string16& javascript) { + [web_controller_ executeJavaScript:base::SysUTF16ToNSString(javascript) + completionHandler:nil]; +} + +void WebStateImpl::ExecuteJavaScript(const base::string16& javascript, + const JavaScriptResultCallback& callback) { + JavaScriptResultCallback stackCallback = callback; + [web_controller_ executeJavaScript:base::SysUTF16ToNSString(javascript) + completionHandler:^(id value, NSError* error) { + if (error) { + DLOG(WARNING) + << "Script execution has failed: " + << base::SysNSStringToUTF16( + error.userInfo[NSLocalizedDescriptionKey]); + } + stackCallback.Run(ValueResultFromWKResult(value).get()); + }]; +} + const std::string& WebStateImpl::GetContentLanguageHeader() const { return content_language_header_; }
diff --git a/ios/web/web_state/web_state_impl_unittest.mm b/ios/web/web_state/web_state_impl_unittest.mm index a47a626..9745c65 100644 --- a/ios/web/web_state/web_state_impl_unittest.mm +++ b/ios/web/web_state/web_state_impl_unittest.mm
@@ -8,8 +8,12 @@ #include <memory> +#include "base/base64.h" #include "base/bind.h" #include "base/logging.h" +#include "base/mac/bind_objc_block.h" +#include "base/strings/utf_string_conversions.h" +#include "base/test/ios/wait_util.h" #include "base/values.h" #include "ios/web/public/load_committed_details.h" #include "ios/web/public/test/test_browser_state.h" @@ -252,10 +256,45 @@ web_state_.reset(new WebStateImpl(&browser_state_)); } + // Loads specified html page into WebState. + void LoadHtml(std::string html) { + web_state_->GetNavigationManagerImpl().InitializeSession(nil, nil, NO, 0); + + // Use data: url for loading html page. + std::string encoded_html; + base::Base64Encode(html, &encoded_html); + GURL url("data:text/html;charset=utf8;base64," + encoded_html); + web::NavigationManager::WebLoadParams params(url); + web_state_->GetNavigationManager()->LoadURLWithParams(params); + + // Trigger the load. + web_state_->GetWebController().webUsageEnabled = YES; + web_state_->GetView(); + + // Wait until load is completed. + EXPECT_TRUE(web_state_->IsLoading()); + base::test::ios::WaitUntilCondition(^bool() { + return !web_state_->IsLoading(); + }); + } + web::TestBrowserState browser_state_; std::unique_ptr<WebStateImpl> web_state_; }; +TEST_F(WebStateTest, WebUsageEnabled) { + // Default is false. + ASSERT_FALSE(web_state_->IsWebUsageEnabled()); + + web_state_->SetWebUsageEnabled(true); + EXPECT_TRUE(web_state_->IsWebUsageEnabled()); + EXPECT_TRUE(web_state_->GetWebController().webUsageEnabled); + + web_state_->SetWebUsageEnabled(false); + EXPECT_FALSE(web_state_->IsWebUsageEnabled()); + EXPECT_FALSE(web_state_->GetWebController().webUsageEnabled); +} + TEST_F(WebStateTest, ResponseHeaders) { GURL real_url("http://foo.com/bar"); GURL frame_url("http://frames-r-us.com/"); @@ -532,5 +571,28 @@ web_state_->RemoveScriptCommandCallback(kPrefix2); } +// Tests script execution with and without callback. +TEST_F(WebStateTest, ScriptExecution) { + LoadHtml("<html></html>"); + + // Execute script without callback. + web_state_->ExecuteJavaScript(base::UTF8ToUTF16("window.foo = 'bar'")); + + // Execute script with callback. + __block std::unique_ptr<base::Value> execution_result; + web_state_->ExecuteJavaScript(base::UTF8ToUTF16("window.foo"), + base::BindBlock(^(const base::Value* value) { + ASSERT_TRUE(value); + execution_result = value->CreateDeepCopy(); + })); + base::test::ios::WaitUntilCondition(^bool() { + return execution_result.get(); + }); + + std::string string_result; + execution_result->GetAsString(&string_result); + EXPECT_EQ("bar", string_result); +} + } // namespace } // namespace web
diff --git a/ipc/BUILD.gn b/ipc/BUILD.gn index 180151e..520af76 100644 --- a/ipc/BUILD.gn +++ b/ipc/BUILD.gn
@@ -5,6 +5,8 @@ import("//build/config/nacl/config.gni") import("//testing/test.gni") +assert(!is_ios) + component("ipc") { sources = [ "attachment_broker.cc",
diff --git a/jingle/BUILD.gn b/jingle/BUILD.gn index 15f45e1..c6aa42ad 100644 --- a/jingle/BUILD.gn +++ b/jingle/BUILD.gn
@@ -149,7 +149,7 @@ "notifier/listener/xmpp_push_client_unittest.cc", ] - if (is_android) { + if (is_android || is_ios) { sources -= [ # TODO(jrg): # EXPECT_DEBUG_DEATH() uses features not enabled.
diff --git a/mash/quick_launch/quick_launch_application.cc b/mash/quick_launch/quick_launch_application.cc index 5c3d164..c44a504 100644 --- a/mash/quick_launch/quick_launch_application.cc +++ b/mash/quick_launch/quick_launch_application.cc
@@ -11,7 +11,7 @@ #include "base/strings/utf_string_conversions.h" #include "mash/public/interfaces/launchable.mojom.h" #include "mojo/public/c/system/main.h" -#include "services/catalog/public/interfaces/resolver.mojom.h" +#include "services/catalog/public/interfaces/catalog.mojom.h" #include "services/shell/public/cpp/application_runner.h" #include "services/shell/public/cpp/connector.h" #include "services/shell/public/cpp/shell_client.h" @@ -36,11 +36,11 @@ public: QuickLaunchUI(QuickLaunchApplication* quick_launch, shell::Connector* connector, - catalog::mojom::ResolverPtr resolver) + catalog::mojom::CatalogPtr catalog) : quick_launch_(quick_launch), connector_(connector), prompt_(new views::Textfield), - resolver_(std::move(resolver)) { + catalog_(std::move(catalog)) { set_background(views::Background::CreateStandardPanelBackground()); prompt_->set_controller(this); AddChildView(prompt_); @@ -105,7 +105,8 @@ base::string16 suffix = name; base::ReplaceSubstringsAfterOffset(&suffix, 0, new_contents, base::string16()); - gfx::Range range(new_contents.size(), name.size()); + gfx::Range range(static_cast<uint32_t>(new_contents.size()), + static_cast<uint32_t>(name.size())); prompt_->SetText(name); prompt_->SelectRange(range); break; @@ -123,9 +124,10 @@ } void UpdateEntries() { - resolver_->ResolveClass("launchable", - base::Bind(&QuickLaunchUI::OnGotCatalogEntries, - base::Unretained(this))); + catalog_->GetEntriesProvidingClass( + "launchable", + base::Bind(&QuickLaunchUI::OnGotCatalogEntries, + base::Unretained(this))); } void OnGotCatalogEntries(mojo::Array<catalog::mojom::EntryPtr> entries) { @@ -147,7 +149,7 @@ shell::Connector* connector_; views::Textfield* prompt_; std::vector<std::unique_ptr<shell::Connection>> connections_; - catalog::mojom::ResolverPtr resolver_; + catalog::mojom::CatalogPtr catalog_; std::set<base::string16> app_names_; bool suggestion_rejected_ = false; @@ -189,11 +191,11 @@ windows_.back()->Activate(); return; } - catalog::mojom::ResolverPtr resolver; - connector_->ConnectToInterface("mojo:catalog", &resolver); + catalog::mojom::CatalogPtr catalog; + connector_->ConnectToInterface("mojo:catalog", &catalog); views::Widget* window = views::Widget::CreateWindowWithContextAndBounds( - new QuickLaunchUI(this, connector_, std::move(resolver)), nullptr, + new QuickLaunchUI(this, connector_, std::move(catalog)), nullptr, gfx::Rect(10, 640, 0, 0)); window->Show(); windows_.push_back(window);
diff --git a/mash/wm/BUILD.gn b/mash/wm/BUILD.gn index 5ef347d..7438e4f 100644 --- a/mash/wm/BUILD.gn +++ b/mash/wm/BUILD.gn
@@ -138,6 +138,7 @@ sources = [ "accelerator_registrar_unittest.cc", + "app_launch_unittest.cc", "frame/move_loop_unittest.cc", "layout_manager_unittest.cc", "window_manager_unittest.cc", @@ -168,5 +169,6 @@ data_deps = [ ":wm", + "//mash/quick_launch", ] }
diff --git a/mash/wm/app_launch_unittest.cc b/mash/wm/app_launch_unittest.cc new file mode 100644 index 0000000..337ab6f --- /dev/null +++ b/mash/wm/app_launch_unittest.cc
@@ -0,0 +1,50 @@ +// 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 "base/bind.h" +#include "base/command_line.h" +#include "base/run_loop.h" +#include "components/mus/public/interfaces/window_server_test.mojom.h" +#include "services/shell/public/cpp/shell_test.h" + +namespace mash { +namespace wm { + +void RunCallback(bool* success, const base::Closure& callback, bool result) { + *success = result; + callback.Run(); +} + +class AppLaunchTest : public shell::test::ShellTest { + public: + AppLaunchTest() : ShellTest("exe:mash_unittests") {} + ~AppLaunchTest() override {} + + private: + void SetUp() override { + base::CommandLine::ForCurrentProcess()->AppendSwitch("use-test-config"); + ShellTest::SetUp(); + } + + DISALLOW_COPY_AND_ASSIGN(AppLaunchTest); +}; + +TEST_F(AppLaunchTest, TestQuickLaunch) { + connector()->Connect("mojo:desktop_wm"); + connector()->Connect("mojo:quick_launch"); + + mus::mojom::WindowServerTestPtr test_interface; + connector()->ConnectToInterface("mojo:mus", &test_interface); + + base::RunLoop run_loop; + bool success = false; + test_interface->EnsureClientHasDrawnWindow( + "mojo:quick_launch", + base::Bind(&RunCallback, &success, run_loop.QuitClosure())); + run_loop.Run(); + EXPECT_TRUE(success); +} + +} // namespace wm +} // namespace mash
diff --git a/mash/wm/public/interfaces/BUILD.gn b/mash/wm/public/interfaces/BUILD.gn index 591bc8d..2c60c4ca 100644 --- a/mash/wm/public/interfaces/BUILD.gn +++ b/mash/wm/public/interfaces/BUILD.gn
@@ -11,4 +11,8 @@ "shelf_layout.mojom", "user_window_controller.mojom", ] + + public_deps = [ + "//mash/shelf/public/interfaces", + ] }
diff --git a/media/BUILD.gn b/media/BUILD.gn index c8ebd28..7086cfb 100644 --- a/media/BUILD.gn +++ b/media/BUILD.gn
@@ -19,6 +19,7 @@ "ENABLE_AC3_EAC3_AUDIO_DEMUXING=$enable_ac3_eac3_audio_demuxing", "ENABLE_HEVC_DEMUXING=$enable_hevc_demuxing", "ENABLE_MSE_MPEG2TS_STREAM_PARSER=$enable_mse_mpeg2ts_stream_parser", + "ENABLE_MP4_VP9_DEMUXING=0", ] } @@ -237,6 +238,7 @@ deps = [ ":cdm_api", ] + public_deps = [] include_dirs = [ "." ] if (media_use_ffmpeg) { @@ -343,7 +345,7 @@ } if (is_mac) { - deps += [ "//media/base/mac" ] + public_deps += [ "//media/base/mac" ] libs += [ "CoreVideo.framework", "OpenGL.framework", @@ -443,7 +445,7 @@ ] } - public_deps = [ + public_deps += [ ":media_features", ":shared_memory_support", "//media/audio",
diff --git a/media/audio/alsa/alsa_output_unittest.cc b/media/audio/alsa/alsa_output_unittest.cc index 1b13863..acf6d28 100644 --- a/media/audio/alsa/alsa_output_unittest.cc +++ b/media/audio/alsa/alsa_output_unittest.cc
@@ -5,7 +5,10 @@ #include <stdint.h> #include "base/macros.h" +#include "base/run_loop.h" #include "base/strings/stringprintf.h" +#include "base/test/test_message_loop.h" +#include "base/thread_task_runner_handle.h" #include "media/audio/alsa/alsa_output.h" #include "media/audio/alsa/alsa_wrapper.h" #include "media/audio/alsa/audio_manager_alsa.h" @@ -72,7 +75,10 @@ class MockAudioManagerAlsa : public AudioManagerAlsa { public: - MockAudioManagerAlsa() : AudioManagerAlsa(&fake_audio_log_factory_) {} + MockAudioManagerAlsa() + : AudioManagerAlsa(base::ThreadTaskRunnerHandle::Get(), + base::ThreadTaskRunnerHandle::Get(), + &fake_audio_log_factory_) {} MOCK_METHOD0(Init, void()); MOCK_METHOD0(HasAudioOutputDevices, bool()); MOCK_METHOD0(HasAudioInputDevices, bool()); @@ -93,12 +99,6 @@ delete stream; } - // We don't mock this method since all tests will do the same thing - // and use the current task runner. - scoped_refptr<base::SingleThreadTaskRunner> GetTaskRunner() override { - return base::MessageLoop::current()->task_runner(); - } - private: FakeAudioLogFactory fake_audio_log_factory_; }; @@ -168,9 +168,10 @@ static void* kFakeHints[]; static char kGenericSurround50[]; + base::TestMessageLoop message_loop_; StrictMock<MockAlsaWrapper> mock_alsa_wrapper_; - scoped_ptr<StrictMock<MockAudioManagerAlsa> > mock_manager_; - base::MessageLoop message_loop_; + std::unique_ptr<StrictMock<MockAudioManagerAlsa>, AudioManagerDeleter> + mock_manager_; scoped_refptr<media::DataBuffer> packet_; private: @@ -442,7 +443,7 @@ // call Stop() immediately after to ensure we don't run the message loop // forever. test_stream->Stop(); - message_loop_.RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_CALL(mock_alsa_wrapper_, PcmClose(kFakeHandle)) .WillOnce(Return(0));
diff --git a/media/audio/alsa/audio_manager_alsa.cc b/media/audio/alsa/audio_manager_alsa.cc index 5ddc425..80f8a213 100644 --- a/media/audio/alsa/audio_manager_alsa.cc +++ b/media/audio/alsa/audio_manager_alsa.cc
@@ -86,8 +86,13 @@ return HasAnyAlsaAudioDevice(kStreamCapture); } -AudioManagerAlsa::AudioManagerAlsa(AudioLogFactory* audio_log_factory) - : AudioManagerBase(audio_log_factory), +AudioManagerAlsa::AudioManagerAlsa( + scoped_refptr<base::SingleThreadTaskRunner> task_runner, + scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner, + AudioLogFactory* audio_log_factory) + : AudioManagerBase(std::move(task_runner), + std::move(worker_task_runner), + audio_log_factory), wrapper_(new AlsaWrapper()) { SetMaxOutputStreamsAllowed(kMaxOutputStreams); }
diff --git a/media/audio/alsa/audio_manager_alsa.h b/media/audio/alsa/audio_manager_alsa.h index d8410fd..5a6ebc1 100644 --- a/media/audio/alsa/audio_manager_alsa.h +++ b/media/audio/alsa/audio_manager_alsa.h
@@ -18,7 +18,10 @@ class MEDIA_EXPORT AudioManagerAlsa : public AudioManagerBase { public: - AudioManagerAlsa(AudioLogFactory* audio_log_factory); + AudioManagerAlsa( + scoped_refptr<base::SingleThreadTaskRunner> task_runner, + scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner, + AudioLogFactory* audio_log_factory); static void ShowLinuxAudioInputSettings();
diff --git a/media/audio/android/audio_android_unittest.cc b/media/audio/android/audio_android_unittest.cc index a918a10..8079c166 100644 --- a/media/audio/android/audio_android_unittest.cc +++ b/media/audio/android/audio_android_unittest.cc
@@ -415,11 +415,16 @@ public: AudioAndroidOutputTest() : loop_(new base::MessageLoopForUI()), - audio_manager_(AudioManager::CreateForTesting()), + audio_manager_(AudioManager::CreateForTesting(loop_->task_runner())), audio_output_stream_(NULL) { + // Flush the message loop to ensure that AudioManager is fully initialized. + loop_->RunUntilIdle(); } - ~AudioAndroidOutputTest() override {} + ~AudioAndroidOutputTest() override { + audio_manager_.reset(); + loop_->RunUntilIdle(); + } protected: AudioManager* audio_manager() { return audio_manager_.get(); } @@ -561,7 +566,7 @@ } scoped_ptr<base::MessageLoopForUI> loop_; - scoped_ptr<AudioManager> audio_manager_; + ScopedAudioManagerPtr audio_manager_; AudioParameters audio_output_parameters_; AudioOutputStream* audio_output_stream_; base::TimeTicks start_time_;
diff --git a/media/audio/android/audio_manager_android.cc b/media/audio/android/audio_manager_android.cc index 96a7c78..35534b3 100644 --- a/media/audio/android/audio_manager_android.cc +++ b/media/audio/android/audio_manager_android.cc
@@ -45,12 +45,22 @@ } // namespace -AudioManager* CreateAudioManager(AudioLogFactory* audio_log_factory) { - return new AudioManagerAndroid(audio_log_factory); +ScopedAudioManagerPtr CreateAudioManager( + scoped_refptr<base::SingleThreadTaskRunner> task_runner, + scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner, + AudioLogFactory* audio_log_factory) { + return ScopedAudioManagerPtr(new AudioManagerAndroid( + std::move(task_runner), std::move(worker_task_runner), + audio_log_factory)); } -AudioManagerAndroid::AudioManagerAndroid(AudioLogFactory* audio_log_factory) - : AudioManagerBase(audio_log_factory), +AudioManagerAndroid::AudioManagerAndroid( + scoped_refptr<base::SingleThreadTaskRunner> task_runner, + scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner, + AudioLogFactory* audio_log_factory) + : AudioManagerBase(std::move(task_runner), + std::move(worker_task_runner), + audio_log_factory), communication_mode_is_on_(false), output_volume_override_set_(false), output_volume_override_(0) { @@ -68,11 +78,13 @@ } AudioManagerAndroid::~AudioManagerAndroid() { - // It's safe to post a task here since Shutdown() will wait for all tasks to - // complete before returning. - GetTaskRunner()->PostTask(FROM_HERE, base::Bind( - &AudioManagerAndroid::ShutdownOnAudioThread, base::Unretained(this))); + DCHECK(GetTaskRunner()->BelongsToCurrentThread()); Shutdown(); + + DVLOG(2) << "Destroying Java part of the audio manager"; + Java_AudioManagerAndroid_close(base::android::AttachCurrentThread(), + j_audio_manager_.obj()); + j_audio_manager_.Reset(); } bool AudioManagerAndroid::HasAudioOutputDevices() { @@ -337,15 +349,6 @@ j_audio_manager_.obj()); } -void AudioManagerAndroid::ShutdownOnAudioThread() { - DCHECK(GetTaskRunner()->BelongsToCurrentThread()); - DVLOG(2) << "Destroying Java part of the audio manager"; - Java_AudioManagerAndroid_close( - base::android::AttachCurrentThread(), - j_audio_manager_.obj()); - j_audio_manager_.Reset(); -} - void AudioManagerAndroid::SetCommunicationAudioModeOn(bool on) { Java_AudioManagerAndroid_setCommunicationAudioModeOn( base::android::AttachCurrentThread(),
diff --git a/media/audio/android/audio_manager_android.h b/media/audio/android/audio_manager_android.h index f9b7db25..22b48c8 100644 --- a/media/audio/android/audio_manager_android.h +++ b/media/audio/android/audio_manager_android.h
@@ -20,7 +20,10 @@ // Android implemention of AudioManager. class MEDIA_EXPORT AudioManagerAndroid : public AudioManagerBase { public: - explicit AudioManagerAndroid(AudioLogFactory* audio_log_factory); + AudioManagerAndroid( + scoped_refptr<base::SingleThreadTaskRunner> task_runner, + scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner, + AudioLogFactory* audio_log_factory); // Implementation of AudioManager. bool HasAudioOutputDevices() override; @@ -71,7 +74,6 @@ private: void InitializeOnAudioThread(); - void ShutdownOnAudioThread(); bool HasNoAudioInputStreams(); void SetCommunicationAudioModeOn(bool on);
diff --git a/media/audio/audio_input_controller_unittest.cc b/media/audio/audio_input_controller_unittest.cc index 6a35d87..36ebc02c 100644 --- a/media/audio/audio_input_controller_unittest.cc +++ b/media/audio/audio_input_controller_unittest.cc
@@ -67,11 +67,20 @@ // Test fixture. class AudioInputControllerTest : public testing::Test { public: - AudioInputControllerTest() {} - ~AudioInputControllerTest() override {} + AudioInputControllerTest() + : audio_manager_( + AudioManager::CreateForTesting(message_loop_.task_runner())) { + // Flush the message loop to ensure that AudioManager is fully initialized. + message_loop_.RunUntilIdle(); + } + ~AudioInputControllerTest() override { + audio_manager_.reset(); + message_loop_.RunUntilIdle(); + } protected: base::MessageLoop message_loop_; + ScopedAudioManagerPtr audio_manager_; private: DISALLOW_COPY_AND_ASSIGN(AudioInputControllerTest); @@ -85,16 +94,12 @@ EXPECT_CALL(event_handler, OnCreated(NotNull())) .WillOnce(QuitMessageLoop(&message_loop_)); - scoped_ptr<AudioManager> audio_manager(AudioManager::CreateForTesting()); AudioParameters params(AudioParameters::AUDIO_FAKE, kChannelLayout, kSampleRate, kBitsPerSample, kSamplesPerPacket); scoped_refptr<AudioInputController> controller = - AudioInputController::Create(audio_manager.get(), - &event_handler, - params, - AudioManagerBase::kDefaultDeviceId, - NULL); + AudioInputController::Create(audio_manager_.get(), &event_handler, params, + AudioManagerBase::kDefaultDeviceId, NULL); ASSERT_TRUE(controller.get()); // Wait for OnCreated() to fire. @@ -123,17 +128,13 @@ .WillRepeatedly(CheckCountAndPostQuitTask( &count, 10, message_loop_.task_runner())); - scoped_ptr<AudioManager> audio_manager(AudioManager::CreateForTesting()); AudioParameters params(AudioParameters::AUDIO_FAKE, kChannelLayout, kSampleRate, kBitsPerSample, kSamplesPerPacket); // Creating the AudioInputController should render an OnCreated() call. scoped_refptr<AudioInputController> controller = - AudioInputController::Create(audio_manager.get(), - &event_handler, - params, - AudioManagerBase::kDefaultDeviceId, - NULL); + AudioInputController::Create(audio_manager_.get(), &event_handler, params, + AudioManagerBase::kDefaultDeviceId, NULL); ASSERT_TRUE(controller.get()); // Start recording and trigger one OnRecording() call. @@ -176,17 +177,13 @@ .Times(Exactly(1)) .WillOnce(QuitMessageLoop(&message_loop_)); - scoped_ptr<AudioManager> audio_manager(AudioManager::CreateForTesting()); AudioParameters params(AudioParameters::AUDIO_FAKE, kChannelLayout, kSampleRate, kBitsPerSample, kSamplesPerPacket); // Creating the AudioInputController should render an OnCreated() call. scoped_refptr<AudioInputController> controller = - AudioInputController::Create(audio_manager.get(), - &event_handler, - params, - AudioManagerBase::kDefaultDeviceId, - NULL); + AudioInputController::Create(audio_manager_.get(), &event_handler, params, + AudioManagerBase::kDefaultDeviceId, NULL); ASSERT_TRUE(controller.get()); // Start recording and trigger one OnRecording() call. @@ -213,18 +210,14 @@ EXPECT_CALL(event_handler, OnCreated(NotNull())) .Times(Exactly(0)); - scoped_ptr<AudioManager> audio_manager(AudioManager::CreateForTesting()); AudioParameters params(AudioParameters::AUDIO_FAKE, kChannelLayout, kSampleRate, kBitsPerSample, kSamplesPerPacket * 1000); scoped_refptr<AudioInputController> controller = - AudioInputController::Create(audio_manager.get(), - &event_handler, - params, - AudioManagerBase::kDefaultDeviceId, - NULL); + AudioInputController::Create(audio_manager_.get(), &event_handler, params, + AudioManagerBase::kDefaultDeviceId, NULL); ASSERT_FALSE(controller.get()); } @@ -239,18 +232,14 @@ EXPECT_CALL(event_handler, OnRecording(NotNull())) .Times(Exactly(1)); - scoped_ptr<AudioManager> audio_manager(AudioManager::CreateForTesting()); AudioParameters params(AudioParameters::AUDIO_FAKE, kChannelLayout, kSampleRate, kBitsPerSample, kSamplesPerPacket); scoped_refptr<AudioInputController> controller = - AudioInputController::Create(audio_manager.get(), - &event_handler, - params, - AudioManagerBase::kDefaultDeviceId, - NULL); + AudioInputController::Create(audio_manager_.get(), &event_handler, params, + AudioManagerBase::kDefaultDeviceId, NULL); ASSERT_TRUE(controller.get()); controller->Record();
diff --git a/media/audio/audio_input_unittest.cc b/media/audio/audio_input_unittest.cc index abb47ce..5d3ce9f 100644 --- a/media/audio/audio_input_unittest.cc +++ b/media/audio/audio_input_unittest.cc
@@ -7,10 +7,9 @@ #include "base/bind.h" #include "base/environment.h" #include "base/macros.h" -#include "base/memory/scoped_ptr.h" -#include "base/message_loop/message_loop.h" #include "base/run_loop.h" -#include "base/synchronization/waitable_event.h" +#include "base/test/test_message_loop.h" +#include "base/thread_task_runner_handle.h" #include "base/threading/platform_thread.h" #include "build/build_config.h" #include "media/audio/audio_io.h" @@ -50,16 +49,16 @@ }; class AudioInputTest : public testing::Test { - public: - AudioInputTest() : - message_loop_(base::MessageLoop::TYPE_UI), - audio_manager_(AudioManager::CreateForTesting()), - audio_input_stream_(NULL) { - // Wait for the AudioManager to finish any initialization on the audio loop. + public: + AudioInputTest() + : message_loop_(base::MessageLoop::TYPE_UI), + audio_manager_(AudioManager::CreateForTesting( + base::ThreadTaskRunnerHandle::Get())), + audio_input_stream_(NULL) { base::RunLoop().RunUntilIdle(); } - ~AudioInputTest() override { base::RunLoop().RunUntilIdle(); } + ~AudioInputTest() override {} protected: bool InputDevicesAvailable() { @@ -144,29 +143,12 @@ // Synchronously runs the provided callback/closure on the audio thread. void RunOnAudioThread(const base::Closure& closure) { - if (!audio_manager_->GetTaskRunner()->BelongsToCurrentThread()) { - base::WaitableEvent event(false, false); - audio_manager_->GetTaskRunner()->PostTask( - FROM_HERE, - base::Bind(&AudioInputTest::RunOnAudioThreadImpl, - base::Unretained(this), - closure, - &event)); - event.Wait(); - } else { - closure.Run(); - } - } - - void RunOnAudioThreadImpl(const base::Closure& closure, - base::WaitableEvent* event) { DCHECK(audio_manager_->GetTaskRunner()->BelongsToCurrentThread()); closure.Run(); - event->Signal(); } - base::MessageLoop message_loop_; - scoped_ptr<AudioManager> audio_manager_; + base::TestMessageLoop message_loop_; + ScopedAudioManagerPtr audio_manager_; AudioInputStream* audio_input_stream_; private: @@ -222,10 +204,11 @@ TestInputCallback test_callback; OpenAndStartAudioInputStreamOnAudioThread(&test_callback); - message_loop_.PostDelayedTask(FROM_HERE, - base::MessageLoop::QuitWhenIdleClosure(), - base::TimeDelta::FromMilliseconds(500)); - message_loop_.Run(); + base::RunLoop run_loop; + base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( + FROM_HERE, run_loop.QuitClosure(), + base::TimeDelta::FromMilliseconds(500)); + run_loop.Run(); EXPECT_GE(test_callback.callback_count(), 2); EXPECT_FALSE(test_callback.had_error());
diff --git a/media/audio/audio_low_latency_input_output_unittest.cc b/media/audio/audio_low_latency_input_output_unittest.cc index 010b349..8a7728c 100644 --- a/media/audio/audio_low_latency_input_output_unittest.cc +++ b/media/audio/audio_low_latency_input_output_unittest.cc
@@ -12,6 +12,7 @@ #include "base/path_service.h" #include "base/synchronization/lock.h" #include "base/test/test_timeouts.h" +#include "base/thread_task_runner_handle.h" #include "base/time/time.h" #include "build/build_config.h" #include "media/audio/audio_io.h" @@ -96,13 +97,12 @@ // the main thread instead of the audio thread. class MockAudioManager : public AudioManagerAnyPlatform { public: - MockAudioManager() : AudioManagerAnyPlatform(&fake_audio_log_factory_) {} + MockAudioManager() + : AudioManagerAnyPlatform(base::ThreadTaskRunnerHandle::Get(), + base::ThreadTaskRunnerHandle::Get(), + &fake_audio_log_factory_) {} ~MockAudioManager() override {} - scoped_refptr<base::SingleThreadTaskRunner> GetTaskRunner() override { - return base::MessageLoop::current()->task_runner(); - } - private: FakeAudioLogFactory fake_audio_log_factory_; DISALLOW_COPY_AND_ASSIGN(MockAudioManager);
diff --git a/media/audio/audio_manager.cc b/media/audio/audio_manager.cc index 5d5f3b3a..573102a0 100644 --- a/media/audio/audio_manager.cc +++ b/media/audio/audio_manager.cc
@@ -69,30 +69,50 @@ AudioManagerHelper() {} ~AudioManagerHelper() override {} - void HistogramThreadStatus(ThreadStatus status) { - audio_thread_status_ = status; - UMA_HISTOGRAM_ENUMERATION("Media.AudioThreadStatus", audio_thread_status_, - THREAD_MAX + 1); - } - void StartHangTimer( - const scoped_refptr<base::SingleThreadTaskRunner>& monitor_task_runner) { + scoped_refptr<base::SingleThreadTaskRunner> monitor_task_runner) { CHECK(!monitor_task_runner_); - monitor_task_runner_ = monitor_task_runner; + CHECK(!audio_task_runner_); + CHECK(g_last_created); + monitor_task_runner_ = std::move(monitor_task_runner); + audio_task_runner_ = g_last_created->GetTaskRunner(); base::PowerMonitor::Get()->AddObserver(this); - failed_pings_ = 0; + io_task_running_ = audio_task_running_ = true; - UpdateLastAudioThreadTimeTick(); - RecordAudioThreadStatus(); + audio_task_runner_->PostTask( + FROM_HERE, + base::Bind(&AudioManagerHelper::UpdateLastAudioThreadTimeTick, + base::Unretained(this))); + monitor_task_runner_->PostTask( + FROM_HERE, base::Bind(&AudioManagerHelper::RecordAudioThreadStatus, + base::Unretained(this))); } + AudioLogFactory* fake_log_factory() { return &fake_log_factory_; } + +#if defined(OS_WIN) + // This should be called before creating an AudioManager in tests to ensure + // that the creating thread is COM initialized. + void InitializeCOMForTesting() { + com_initializer_for_testing_.reset(new base::win::ScopedCOMInitializer()); + } +#endif + +#if defined(OS_LINUX) + void set_app_name(const std::string& app_name) { app_name_ = app_name; } + const std::string& app_name() const { return app_name_; } +#endif + + void enable_crash_key_logging() { enable_crash_key_logging_ = true; } + + private: + // base::PowerObserver overrides. // Disable hang detection when the system goes into the suspend state. void OnSuspend() override { base::AutoLock lock(hang_lock_); hang_detection_enabled_ = false; failed_pings_ = successful_pings_ = 0; } - // Reenable hang detection once the system comes out of the suspend state. void OnResume() override { base::AutoLock lock(hang_lock_); @@ -105,19 +125,25 @@ audio_task_running_ = true; base::AutoUnlock unlock(hang_lock_); - UpdateLastAudioThreadTimeTick(); + audio_task_runner_->PostTask( + FROM_HERE, + base::Bind(&AudioManagerHelper::UpdateLastAudioThreadTimeTick, + base::Unretained(this))); } if (!io_task_running_) { io_task_running_ = true; base::AutoUnlock unlock(hang_lock_); - RecordAudioThreadStatus(); + monitor_task_runner_->PostTask( + FROM_HERE, base::Bind(&AudioManagerHelper::RecordAudioThreadStatus, + base::Unretained(this))); } } - // Runs on |monitor_task_runner| typically, but may be started on any thread. + // Runs on |monitor_task_runner|. void RecordAudioThreadStatus() { + DCHECK(monitor_task_runner_->BelongsToCurrentThread()); { base::AutoLock lock(hang_lock_); @@ -159,8 +185,9 @@ max_hung_task_time_); } - // Runs on the audio thread typically, but may be started on any thread. + // Runs on the audio thread. void UpdateLastAudioThreadTimeTick() { + DCHECK(audio_task_runner_->BelongsToCurrentThread()); { base::AutoLock lock(hang_lock_); last_audio_thread_timer_tick_ = base::TimeTicks::Now(); @@ -176,37 +203,22 @@ } // Don't hold the lock while posting the next task. - g_last_created->GetTaskRunner()->PostDelayedTask( + audio_task_runner_->PostDelayedTask( FROM_HERE, base::Bind(&AudioManagerHelper::UpdateLastAudioThreadTimeTick, base::Unretained(this)), max_hung_task_time_ / 5); } - AudioLogFactory* fake_log_factory() { return &fake_log_factory_; } - -#if defined(OS_WIN) - // This should be called before creating an AudioManager in tests to ensure - // that the creating thread is COM initialized. - void InitializeCOMForTesting() { - com_initializer_for_testing_.reset(new base::win::ScopedCOMInitializer()); - } -#endif - -#if defined(OS_LINUX) - void set_app_name(const std::string& app_name) { - app_name_ = app_name; + void HistogramThreadStatus(ThreadStatus status) { + DCHECK(monitor_task_runner_->BelongsToCurrentThread()); + audio_thread_status_ = status; + UMA_HISTOGRAM_ENUMERATION("Media.AudioThreadStatus", audio_thread_status_, + THREAD_MAX + 1); } - const std::string& app_name() const { - return app_name_; - } -#endif - - void enable_crash_key_logging() { enable_crash_key_logging_ = true; } - - private: void LogAudioDriverCrashKeys() { + DCHECK(monitor_task_runner_->BelongsToCurrentThread()); DCHECK(enable_crash_key_logging_); #if defined(OS_WIN) @@ -228,6 +240,7 @@ const base::TimeDelta max_hung_task_time_ = base::TimeDelta::FromMinutes(1); scoped_refptr<base::SingleThreadTaskRunner> monitor_task_runner_; + scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner_; base::Lock hang_lock_; bool hang_detection_enabled_ = true; @@ -255,14 +268,51 @@ } // namespace -// Forward declaration of the platform specific AudioManager factory function. -AudioManager* CreateAudioManager(AudioLogFactory* audio_log_factory); +void AudioManagerDeleter::operator()(const AudioManager* instance) const { + CHECK(instance); + // We reset g_last_created here instead of in the destructor of AudioManager + // because the destructor runs on the audio thread. We want to always change + // g_last_created from the main thread. + if (g_last_created == instance) { + g_last_created = nullptr; + } else { + // We create multiple instances of AudioManager only when testing. + // We should not encounter this case in production. + LOG(WARNING) << "Multiple instances of AudioManager detected"; + } -AudioManager::AudioManager() {} + // AudioManager must be destroyed on the audio thread. + if (!instance->GetTaskRunner()->DeleteSoon(FROM_HERE, instance)) { + LOG(WARNING) << "Failed to delete AudioManager instance."; + } +} + +// Forward declaration of the platform specific AudioManager factory function. +ScopedAudioManagerPtr CreateAudioManager( + scoped_refptr<base::SingleThreadTaskRunner> task_runner, + scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner, + AudioLogFactory* audio_log_factory); + +AudioManager::AudioManager( + scoped_refptr<base::SingleThreadTaskRunner> task_runner, + scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner) + : task_runner_(std::move(task_runner)), + worker_task_runner_(std::move(worker_task_runner)) { + DCHECK(task_runner_); + DCHECK(worker_task_runner_); + + if (g_last_created) { + // We create multiple instances of AudioManager only when testing. + // We should not encounter this case in production. + LOG(WARNING) << "Multiple instances of AudioManager detected"; + } + // We always override |g_last_created| irrespective of whether it is already + // set or not becuase it represents the last created instance. + g_last_created = this; +} AudioManager::~AudioManager() { - CHECK(!g_last_created || g_last_created == this); - g_last_created = nullptr; + DCHECK(task_runner_->BelongsToCurrentThread()); } // static @@ -282,37 +332,38 @@ } // static -AudioManager* AudioManager::Create(AudioLogFactory* audio_log_factory) { - CHECK(!g_last_created); - if (g_audio_manager_factory) - g_last_created = g_audio_manager_factory->CreateInstance(audio_log_factory); - else - g_last_created = CreateAudioManager(audio_log_factory); +ScopedAudioManagerPtr AudioManager::Create( + scoped_refptr<base::SingleThreadTaskRunner> task_runner, + scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner, + scoped_refptr<base::SingleThreadTaskRunner> monitor_task_runner, + AudioLogFactory* audio_log_factory) { + DCHECK(task_runner); + DCHECK(worker_task_runner); + ScopedAudioManagerPtr manager; + if (g_audio_manager_factory) { + manager = g_audio_manager_factory->CreateInstance( + std::move(task_runner), std::move(worker_task_runner), + audio_log_factory); + } else { + manager = + CreateAudioManager(std::move(task_runner), + std::move(worker_task_runner), audio_log_factory); + } - return g_last_created; -} - -// static -AudioManager* AudioManager::CreateWithHangTimer( - AudioLogFactory* audio_log_factory, - const scoped_refptr<base::SingleThreadTaskRunner>& monitor_task_runner) { - AudioManager* manager = Create(audio_log_factory); - -// On OSX the audio thread is the UI thread, for which a hang monitor is not -// necessary or recommended. -#if !defined(OS_MACOSX) - g_helper.Pointer()->StartHangTimer(monitor_task_runner); -#endif + if (monitor_task_runner) + g_helper.Pointer()->StartHangTimer(std::move(monitor_task_runner)); return manager; } // static -AudioManager* AudioManager::CreateForTesting() { +ScopedAudioManagerPtr AudioManager::CreateForTesting( + scoped_refptr<base::SingleThreadTaskRunner> task_runner) { #if defined(OS_WIN) g_helper.Pointer()->InitializeCOMForTesting(); #endif - return Create(g_helper.Pointer()->fake_log_factory()); + return Create(task_runner, task_runner, nullptr, + g_helper.Pointer()->fake_log_factory()); } // static
diff --git a/media/audio/audio_manager.h b/media/audio/audio_manager.h index d3eea4a..4142581 100644 --- a/media/audio/audio_manager.h +++ b/media/audio/audio_manager.h
@@ -5,10 +5,12 @@ #ifndef MEDIA_AUDIO_AUDIO_MANAGER_H_ #define MEDIA_AUDIO_AUDIO_MANAGER_H_ +#include <memory> #include <string> #include "base/macros.h" #include "base/memory/ref_counted.h" +#include "base/sequenced_task_runner_helpers.h" #include "base/strings/string16.h" #include "build/build_config.h" #include "media/audio/audio_device_name.h" @@ -22,9 +24,17 @@ namespace media { class AudioInputStream; +class AudioManager; class AudioManagerFactory; class AudioOutputStream; +class MEDIA_EXPORT AudioManagerDeleter { + public: + void operator()(const AudioManager* instance) const; +}; +using ScopedAudioManagerPtr = + std::unique_ptr<AudioManager, AudioManagerDeleter>; + // Manages all audio resources. Provides some convenience functions that avoid // the need to provide iterators over the existing streams. // @@ -34,8 +44,6 @@ // logged on Windows (this allows us to report driver hangs to Microsoft). class MEDIA_EXPORT AudioManager { public: - virtual ~AudioManager(); - // This provides an alternative to the statically linked factory method used // to create AudioManager. This is useful for dynamically-linked third // party clients seeking to provide a platform-specific implementation of @@ -46,20 +54,35 @@ // which must not be NULL. static void SetFactory(AudioManagerFactory* factory); - // Construct the audio manager; only one instance is allowed. The manager - // will forward CreateAudioLog() calls to the provided AudioLogFactory; as - // such |audio_log_factory| must outlive the AudioManager. - static AudioManager* Create(AudioLogFactory* audio_log_factory); + // Construct the audio manager; only one instance is allowed. + // The returned instance must be deleted on AudioManager::GetTaskRunnner(). + // + // The manager will forward CreateAudioLog() calls to the provided + // AudioLogFactory; as such |audio_log_factory| must outlive the AudioManager. + // + // The manager will use |task_runner| for audio IO. This same task runner + // is returned by GetTaskRunner(). + // On OS_MACOSX, CoreAudio requires that |task_runner| must belong to the + // main thread of the process, which in our case is sadly the browser UI + // thread. Failure to execute calls on the right thread leads to crashes and + // odd behavior. See http://crbug.com/158170. + // + // The manager will use |worker_task_runner| for heavyweight tasks. + // The |worker_task_runner| may be the same as |task_runner|. This same + // task runner is returned by GetWorkerTaskRunner. + // + // If |monitor_task_runner| is not NULL, a monitor will be scheduled on + // |monitor_task_runner| to monitor |task_runner|. See EnableHangMonitor(). + static ScopedAudioManagerPtr Create( + scoped_refptr<base::SingleThreadTaskRunner> task_runner, + scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner, + scoped_refptr<base::SingleThreadTaskRunner> monitor_task_runner, + AudioLogFactory* audio_log_factory); - // Similar to Create() except also schedules a monitor on the given task - // runner to ensure the audio thread is not stuck for more than 60 seconds; if - // a hang is detected, the process will be crashed. See EnableHangMonitor(). - static AudioManager* CreateWithHangTimer( - AudioLogFactory* audio_log_factory, - const scoped_refptr<base::SingleThreadTaskRunner>& monitor_task_runner); - - // Similar to Create() except uses a FakeAudioLogFactory for testing. - static AudioManager* CreateForTesting(); + // A convenience wrapper of AudioManager::Create for testing. + // The given |task_runner| is shared for both audio io and heavyweight tasks. + static ScopedAudioManagerPtr CreateForTesting( + scoped_refptr<base::SingleThreadTaskRunner> task_runner); // Enables non-crash dumps when audio thread hangs are detected. // TODO(dalecurtis): There are no callers to this function at present. A list @@ -178,12 +201,18 @@ const std::string& device_id) = 0; // Returns the task runner used for audio IO. - virtual scoped_refptr<base::SingleThreadTaskRunner> GetTaskRunner() = 0; + // TODO(alokp): Rename to task_runner(). + base::SingleThreadTaskRunner* GetTaskRunner() const { + return task_runner_.get(); + } // Heavyweight tasks should use GetWorkerTaskRunner() instead of // GetTaskRunner(). On most platforms they are the same, but some share the // UI loop with the audio IO loop. - virtual scoped_refptr<base::SingleThreadTaskRunner> GetWorkerTaskRunner() = 0; + // TODO(alokp): Rename to worker_task_runner(). + base::SingleThreadTaskRunner* GetWorkerTaskRunner() const { + return worker_task_runner_.get(); + } // Allows clients to listen for device state changes; e.g. preferred sample // rate or channel layout changes. The typical response to receiving this @@ -230,9 +259,15 @@ AudioLogFactory::AudioComponent component) = 0; protected: - AudioManager(); + AudioManager(scoped_refptr<base::SingleThreadTaskRunner> task_runner, + scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner); + virtual ~AudioManager(); private: + friend class base::DeleteHelper<AudioManager>; + + scoped_refptr<base::SingleThreadTaskRunner> task_runner_; + scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner_; DISALLOW_COPY_AND_ASSIGN(AudioManager); };
diff --git a/media/audio/audio_manager_base.cc b/media/audio/audio_manager_base.cc index 8a6acc2..8845585f 100644 --- a/media/audio/audio_manager_base.cc +++ b/media/audio/audio_manager_base.cc
@@ -89,8 +89,12 @@ return session_id && device_id.empty(); } -AudioManagerBase::AudioManagerBase(AudioLogFactory* audio_log_factory) - : max_num_output_streams_(kDefaultMaxOutputStreams), +AudioManagerBase::AudioManagerBase( + scoped_refptr<base::SingleThreadTaskRunner> task_runner, + scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner, + AudioLogFactory* audio_log_factory) + : AudioManager(std::move(task_runner), std::move(worker_task_runner)), + max_num_output_streams_(kDefaultMaxOutputStreams), max_num_input_streams_(kDefaultMaxInputStreams), num_output_streams_(0), num_input_streams_(0), @@ -99,42 +103,21 @@ // block the UI thread when swapping devices. output_listeners_( base::ObserverList<AudioDeviceListener>::NOTIFY_EXISTING_ONLY), - audio_log_factory_(audio_log_factory) { -} + audio_log_factory_(audio_log_factory) {} AudioManagerBase::~AudioManagerBase() { - // The platform specific AudioManager implementation must have already - // stopped the audio thread. Otherwise, we may destroy audio streams before - // stopping the thread, resulting an unexpected behavior. - // This way we make sure activities of the audio streams are all stopped - // before we destroy them. - CHECK(!audio_thread_); + DCHECK(GetTaskRunner()->BelongsToCurrentThread()); + // All the output streams should have been deleted. - DCHECK_EQ(0, num_output_streams_); + CHECK_EQ(0, num_output_streams_); // All the input streams should have been deleted. - DCHECK_EQ(0, num_input_streams_); + CHECK_EQ(0, num_input_streams_); } base::string16 AudioManagerBase::GetAudioInputDeviceModel() { return base::string16(); } -scoped_refptr<base::SingleThreadTaskRunner> AudioManagerBase::GetTaskRunner() { - if (!audio_thread_) { - audio_thread_.reset(new base::Thread("AudioThread")); -#if defined(OS_WIN) - audio_thread_->init_com_with_mta(true); -#endif - CHECK(audio_thread_->Start()); - } - return audio_thread_->task_runner(); -} - -scoped_refptr<base::SingleThreadTaskRunner> -AudioManagerBase::GetWorkerTaskRunner() { - return GetTaskRunner(); -} - AudioOutputStream* AudioManagerBase::MakeAudioOutputStream( const AudioParameters& params, const std::string& device_id) { @@ -329,26 +312,8 @@ } void AudioManagerBase::Shutdown() { - // Only true when we're sharing the UI message loop with the browser. The UI - // loop is no longer running at this time and browser destruction is imminent. - auto task_runner = GetTaskRunner(); - if (task_runner->BelongsToCurrentThread()) { - ShutdownOnAudioThread(); - } else { - task_runner->PostTask(FROM_HERE, - base::Bind(&AudioManagerBase::ShutdownOnAudioThread, - base::Unretained(this))); - } - - // Stop() will wait for any posted messages to be processed first. - if (audio_thread_) { - audio_thread_->Stop(); - audio_thread_.reset(); - } -} - -void AudioManagerBase::ShutdownOnAudioThread() { DCHECK(GetTaskRunner()->BelongsToCurrentThread()); + // Close all output streams. while (!output_dispatchers_.empty()) { output_dispatchers_.back()->dispatcher->Shutdown(); output_dispatchers_.pop_back();
diff --git a/media/audio/audio_manager_base.h b/media/audio/audio_manager_base.h index d850447..61292c67 100644 --- a/media/audio/audio_manager_base.h +++ b/media/audio/audio_manager_base.h
@@ -63,8 +63,6 @@ ~AudioManagerBase() override; // AudioManager: - scoped_refptr<base::SingleThreadTaskRunner> GetTaskRunner() override; - scoped_refptr<base::SingleThreadTaskRunner> GetWorkerTaskRunner() override; base::string16 GetAudioInputDeviceModel() override; void ShowAudioInputSettings() override; void GetAudioInputDeviceNames(AudioDeviceNames* device_names) override; @@ -122,11 +120,14 @@ int output_stream_count() const { return num_output_streams_; } protected: - AudioManagerBase(AudioLogFactory* audio_log_factory); + AudioManagerBase( + scoped_refptr<base::SingleThreadTaskRunner> task_runner, + scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner, + AudioLogFactory* audio_log_factory); - // Shuts down the audio thread and releases all the audio output dispatchers - // on the audio thread. All audio streams should be freed before Shutdown() - // is called. This must be called in the destructor of every AudioManagerBase + // Releases all the audio output dispatchers. + // All audio streams should be closed before Shutdown() is called. + // This must be called in the destructor of every AudioManagerBase // implementation. void Shutdown(); @@ -162,9 +163,6 @@ class CompareByParams; - // Called by Shutdown(). - void ShutdownOnAudioThread(); - // Max number of open output streams, modified by // SetMaxOutputStreamsAllowed(). int max_num_output_streams_; @@ -181,9 +179,6 @@ // Track output state change listeners. base::ObserverList<AudioDeviceListener> output_listeners_; - // Thread used to interact with audio streams created by this audio manager. - scoped_ptr<base::Thread> audio_thread_; - // Map of cached AudioOutputDispatcher instances. Must only be touched // from the audio thread (no locking). AudioOutputDispatchers output_dispatchers_;
diff --git a/media/audio/audio_manager_factory.h b/media/audio/audio_manager_factory.h index 11f1338..72501486 100644 --- a/media/audio/audio_manager_factory.h +++ b/media/audio/audio_manager_factory.h
@@ -5,11 +5,18 @@ #ifndef MEDIA_AUDIO_AUDIO_MANAGER_FACTORY_H_ #define MEDIA_AUDIO_AUDIO_MANAGER_FACTORY_H_ +#include "base/memory/ref_counted.h" +#include "base/memory/scoped_ptr.h" #include "media/base/media_export.h" +namespace base { +class SingleThreadTaskRunner; +} // namespace base + namespace media { class AudioManager; +class AudioManagerDeleter; class AudioLogFactory; // Allows a platform-specific implementation of AudioManager to be provided in @@ -20,7 +27,10 @@ // Creates an instance of AudioManager implementation. Caller owns the // returned instance. |audio_log_factory| must outlive the returned instance. - virtual AudioManager* CreateInstance(AudioLogFactory* audio_log_factory) = 0; + virtual scoped_ptr<AudioManager, AudioManagerDeleter> CreateInstance( + scoped_refptr<base::SingleThreadTaskRunner> task_runner, + scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner, + AudioLogFactory* audio_log_factory) = 0; }; } // namespace media
diff --git a/media/audio/audio_manager_factory_unittest.cc b/media/audio/audio_manager_factory_unittest.cc index 1d13c2e0..b4ceb363 100644 --- a/media/audio/audio_manager_factory_unittest.cc +++ b/media/audio/audio_manager_factory_unittest.cc
@@ -2,10 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "base/memory/scoped_ptr.h" +#include "base/test/test_message_loop.h" +#include "base/thread_task_runner_handle.h" #include "media/audio/audio_manager.h" #include "media/audio/audio_manager_factory.h" -#include "media/audio/fake_audio_log_factory.h" #include "media/audio/fake_audio_manager.h" #include "testing/gtest/include/gtest/gtest.h" @@ -17,11 +17,17 @@ FakeAudioManagerFactory() {} ~FakeAudioManagerFactory() override {} - AudioManager* CreateInstance(AudioLogFactory* audio_log_factory) override { + ScopedAudioManagerPtr CreateInstance( + scoped_refptr<base::SingleThreadTaskRunner> task_runner, + scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner, + AudioLogFactory* audio_log_factory) override { + ScopedAudioManagerPtr instance( + new FakeAudioManager(std::move(task_runner), + std::move(worker_task_runner), audio_log_factory)); // |created_instance_| is used for verifying. Ownership is transferred to // caller. - created_instance_ = new FakeAudioManager(audio_log_factory); - return created_instance_; + created_instance_ = instance.get(); + return instance; } AudioManager* created_instance() { return created_instance_; } @@ -34,24 +40,29 @@ // Verifies that SetFactory has the intended effect. TEST(AudioManagerFactoryTest, CreateInstance) { - // Create an audio manager and verify that it is not null. - scoped_ptr<AudioManager> manager(AudioManager::CreateForTesting()); - ASSERT_NE(nullptr, manager.get()); - manager.reset(); + { + base::TestMessageLoop message_loop; + // Create an audio manager and verify that it is not null. + ScopedAudioManagerPtr manager = + AudioManager::CreateForTesting(base::ThreadTaskRunnerHandle::Get()); + ASSERT_NE(nullptr, manager.get()); + } // Set the factory. Note that ownership of |factory| is transferred to // AudioManager. FakeAudioManagerFactory* factory = new FakeAudioManagerFactory(); AudioManager::SetFactory(factory); - - // Create the AudioManager instance. Verify that it matches the instance - // provided by the factory. - manager.reset(AudioManager::CreateForTesting()); - ASSERT_NE(nullptr, manager.get()); - ASSERT_EQ(factory->created_instance(), manager.get()); - + { + base::TestMessageLoop message_loop; + // Create the AudioManager instance. Verify that it matches the instance + // provided by the factory. + ScopedAudioManagerPtr manager = + AudioManager::CreateForTesting(base::ThreadTaskRunnerHandle::Get()); + ASSERT_NE(nullptr, manager.get()); + ASSERT_EQ(factory->created_instance(), manager.get()); + } // Reset AudioManagerFactory to prevent factory from persisting to other - // tests on the same process. |manager| will reset when scope exits. + // tests on the same process. AudioManager::ResetFactoryForTesting(); }
diff --git a/media/audio/audio_manager_unittest.cc b/media/audio/audio_manager_unittest.cc index 894f861..9c50d62 100644 --- a/media/audio/audio_manager_unittest.cc +++ b/media/audio/audio_manager_unittest.cc
@@ -6,7 +6,10 @@ #include "base/environment.h" #include "base/logging.h" #include "base/memory/scoped_ptr.h" +#include "base/run_loop.h" #include "base/synchronization/waitable_event.h" +#include "base/test/test_message_loop.h" +#include "base/thread_task_runner_handle.h" #include "build/build_config.h" #include "media/audio/audio_manager.h" #include "media/audio/audio_manager_base.h" @@ -32,6 +35,39 @@ namespace media { +namespace { +template <typename T> +struct TestAudioManagerFactory { + static ScopedAudioManagerPtr Create(AudioLogFactory* audio_log_factory) { + return ScopedAudioManagerPtr(new T(base::ThreadTaskRunnerHandle::Get(), + base::ThreadTaskRunnerHandle::Get(), + audio_log_factory)); + } +}; + +#if defined(USE_PULSEAUDIO) +template <> +struct TestAudioManagerFactory<AudioManagerPulse> { + static ScopedAudioManagerPtr Create(AudioLogFactory* audio_log_factory) { + std::unique_ptr<AudioManagerPulse, AudioManagerDeleter> manager( + new AudioManagerPulse(base::ThreadTaskRunnerHandle::Get(), + base::ThreadTaskRunnerHandle::Get(), + audio_log_factory)); + if (!manager->Init()) + manager.reset(); + return std::move(manager); + } +}; +#endif // defined(USE_PULSEAUDIO) + +template <> +struct TestAudioManagerFactory<std::nullptr_t> { + static ScopedAudioManagerPtr Create(AudioLogFactory* audio_log_factory) { + return AudioManager::CreateForTesting(base::ThreadTaskRunnerHandle::Get()); + } +}; +} // namespace + // Test fixture which allows us to override the default enumeration API on // Windows. class AudioManagerTest : public ::testing::Test { @@ -77,14 +113,8 @@ } protected: - AudioManagerTest() : audio_manager_(AudioManager::CreateForTesting()) { - // Wait for audio thread initialization to complete. Otherwise the - // enumeration type may not have been set yet. - base::WaitableEvent event(false, false); - audio_manager_->GetTaskRunner()->PostTask(FROM_HERE, base::Bind( - &base::WaitableEvent::Signal, base::Unretained(&event))); - event.Wait(); - } + AudioManagerTest() { CreateAudioManagerForTesting(); } + ~AudioManagerTest() override {} #if defined(OS_WIN) bool SetMMDeviceEnumeration() { @@ -149,71 +179,41 @@ } } - void HasInputDevicesAvailable(bool* has_devices) { - *has_devices = audio_manager_->HasAudioInputDevices(); - } - - void HasOutputDevicesAvailable(bool* has_devices) { - *has_devices = audio_manager_->HasAudioOutputDevices(); - } - bool InputDevicesAvailable() { - bool has_devices = false; - RunOnAudioThread(base::Bind(&AudioManagerTest::HasInputDevicesAvailable, - base::Unretained(this), &has_devices)); - return has_devices; + return audio_manager_->HasAudioInputDevices(); } - bool OutputDevicesAvailable() { - bool has_devices = false; - RunOnAudioThread(base::Bind(&AudioManagerTest::HasOutputDevicesAvailable, - base::Unretained(this), &has_devices)); - return has_devices; + return audio_manager_->HasAudioOutputDevices(); } -#if defined(USE_ALSA) || defined(USE_PULSEAUDIO) - template <class T> + template <typename T = std::nullptr_t> void CreateAudioManagerForTesting() { // Only one AudioManager may exist at a time, so destroy the one we're // currently holding before creating a new one. + // Flush the message loop to run any shutdown tasks posted by AudioManager. audio_manager_.reset(); - audio_manager_.reset(T::Create(&fake_audio_log_factory_)); - } -#endif + base::RunLoop().RunUntilIdle(); - // Synchronously runs the provided callback/closure on the audio thread. - void RunOnAudioThread(const base::Closure& closure) { - if (!audio_manager_->GetTaskRunner()->BelongsToCurrentThread()) { - base::WaitableEvent event(false, false); - audio_manager_->GetTaskRunner()->PostTask( - FROM_HERE, - base::Bind(&AudioManagerTest::RunOnAudioThreadImpl, - base::Unretained(this), - closure, - &event)); - event.Wait(); - } else { - closure.Run(); - } + audio_manager_ = + TestAudioManagerFactory<T>::Create(&fake_audio_log_factory_); + // A few AudioManager implementations post initialization tasks to + // audio thread. Flush the thread to ensure that |audio_manager_| is + // initialized and ready to use before returning from this function. + // TODO(alokp): We should perhaps do this in AudioManager::Create(). + base::RunLoop().RunUntilIdle(); } - void RunOnAudioThreadImpl(const base::Closure& closure, - base::WaitableEvent* event) { - DCHECK(audio_manager_->GetTaskRunner()->BelongsToCurrentThread()); - closure.Run(); - event->Signal(); - } - + base::TestMessageLoop message_loop_; FakeAudioLogFactory fake_audio_log_factory_; - scoped_ptr<AudioManager> audio_manager_; + ScopedAudioManagerPtr audio_manager_; }; TEST_F(AudioManagerTest, HandleDefaultDeviceIDs) { // Use a fake manager so we can makeup device ids, this will still use the // AudioManagerBase code. - audio_manager_.reset(new FakeAudioManager(&fake_audio_log_factory_)); - RunOnAudioThread(base::Bind(&AudioManagerTest::HandleDefaultDeviceIDsTest, - base::Unretained(this))); + CreateAudioManagerForTesting<FakeAudioManager>(); + HandleDefaultDeviceIDsTest(); + base::RunLoop().RunUntilIdle(); } // Test that devices can be enumerated. @@ -221,10 +221,7 @@ ABORT_AUDIO_TEST_IF_NOT(InputDevicesAvailable()); AudioDeviceNames device_names; - RunOnAudioThread( - base::Bind(&AudioManager::GetAudioInputDeviceNames, - base::Unretained(audio_manager_.get()), - &device_names)); + audio_manager_->GetAudioInputDeviceNames(&device_names); CheckDeviceNames(device_names); } @@ -233,10 +230,7 @@ ABORT_AUDIO_TEST_IF_NOT(OutputDevicesAvailable()); AudioDeviceNames device_names; - RunOnAudioThread( - base::Bind(&AudioManager::GetAudioOutputDeviceNames, - base::Unretained(audio_manager_.get()), - &device_names)); + audio_manager_->GetAudioOutputDeviceNames(&device_names); CheckDeviceNames(device_names); } @@ -403,9 +397,7 @@ ABORT_AUDIO_TEST_IF_NOT(InputDevicesAvailable()); AudioParameters params; - RunOnAudioThread( - base::Bind(&AudioManagerTest::GetDefaultOutputStreamParameters, - base::Unretained(this), ¶ms)); + GetDefaultOutputStreamParameters(¶ms); EXPECT_TRUE(params.IsValid()); #endif // defined(OS_WIN) || defined(OS_MACOSX) } @@ -415,9 +407,7 @@ ABORT_AUDIO_TEST_IF_NOT(InputDevicesAvailable() && OutputDevicesAvailable()); AudioDeviceNames device_names; - RunOnAudioThread(base::Bind(&AudioManager::GetAudioInputDeviceNames, - base::Unretained(audio_manager_.get()), - &device_names)); + audio_manager_->GetAudioInputDeviceNames(&device_names); bool found_an_associated_device = false; for (AudioDeviceNames::iterator it = device_names.begin(); it != device_names.end(); @@ -425,9 +415,7 @@ EXPECT_FALSE(it->unique_id.empty()); EXPECT_FALSE(it->device_name.empty()); std::string output_device_id; - RunOnAudioThread(base::Bind(&AudioManagerTest::GetAssociatedOutputDeviceID, - base::Unretained(this), it->unique_id, - &output_device_id)); + GetAssociatedOutputDeviceID(it->unique_id, &output_device_id); if (!output_device_id.empty()) { DVLOG(2) << it->unique_id << " matches with " << output_device_id; found_an_associated_device = true;
diff --git a/media/audio/audio_output_controller_unittest.cc b/media/audio/audio_output_controller_unittest.cc index 1046893..b81cb10 100644 --- a/media/audio/audio_output_controller_unittest.cc +++ b/media/audio/audio_output_controller_unittest.cc
@@ -10,8 +10,9 @@ #include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" -#include "base/message_loop/message_loop.h" -#include "base/synchronization/waitable_event.h" +#include "base/run_loop.h" +#include "base/test/test_message_loop.h" +#include "base/thread_task_runner_handle.h" #include "media/audio/audio_manager_base.h" #include "media/audio/audio_output_controller.h" #include "media/audio/audio_parameters.h" @@ -79,10 +80,6 @@ AudioSourceCallback* callback_; }; -ACTION_P(SignalEvent, event) { - event->Signal(); -} - static const float kBufferNonZeroData = 1.0f; ACTION(PopulateBuffer) { arg0->Zero(); @@ -94,29 +91,21 @@ class AudioOutputControllerTest : public testing::Test { public: AudioOutputControllerTest() - : audio_manager_(AudioManager::CreateForTesting()), - create_event_(false, false), - play_event_(false, false), - read_event_(false, false), - pause_event_(false, false) { + : audio_manager_(AudioManager::CreateForTesting( + base::ThreadTaskRunnerHandle::Get())) { + base::RunLoop().RunUntilIdle(); } ~AudioOutputControllerTest() override {} protected: void Create(int samples_per_packet) { - EXPECT_FALSE(create_event_.IsSignaled()); - EXPECT_FALSE(play_event_.IsSignaled()); - EXPECT_FALSE(read_event_.IsSignaled()); - EXPECT_FALSE(pause_event_.IsSignaled()); - params_ = AudioParameters( AudioParameters::AUDIO_FAKE, kChannelLayout, kSampleRate, kBitsPerSample, samples_per_packet); if (params_.IsValid()) { - EXPECT_CALL(mock_event_handler_, OnCreated()) - .WillOnce(SignalEvent(&create_event_)); + EXPECT_CALL(mock_event_handler_, OnCreated()); } controller_ = AudioOutputController::Create( @@ -126,35 +115,33 @@ controller_->SetVolume(kTestVolume); EXPECT_EQ(params_.IsValid(), controller_.get() != NULL); + base::RunLoop().RunUntilIdle(); } void Play() { // Expect the event handler to receive one OnPlaying() call. - EXPECT_CALL(mock_event_handler_, OnPlaying()) - .WillOnce(SignalEvent(&play_event_)); + EXPECT_CALL(mock_event_handler_, OnPlaying()); // During playback, the mock pretends to provide audio data rendered and // sent from the render process. EXPECT_CALL(mock_sync_reader_, UpdatePendingBytes(_, _)).Times(AtLeast(1)); - EXPECT_CALL(mock_sync_reader_, Read(_)) - .WillRepeatedly(DoAll(PopulateBuffer(), - SignalEvent(&read_event_))); + EXPECT_CALL(mock_sync_reader_, Read(_)).WillRepeatedly(PopulateBuffer()); controller_->Play(); + base::RunLoop().RunUntilIdle(); } void Pause() { // Expect the event handler to receive one OnPaused() call. - EXPECT_CALL(mock_event_handler_, OnPaused()) - .WillOnce(SignalEvent(&pause_event_)); + EXPECT_CALL(mock_event_handler_, OnPaused()); controller_->Pause(); + base::RunLoop().RunUntilIdle(); } void ChangeDevice() { // Expect the event handler to receive one OnPaying() call and no OnPaused() // call. - EXPECT_CALL(mock_event_handler_, OnPlaying()) - .WillOnce(SignalEvent(&play_event_)); + EXPECT_CALL(mock_event_handler_, OnPlaying()); EXPECT_CALL(mock_event_handler_, OnPaused()) .Times(0); @@ -169,8 +156,7 @@ if (was_playing) { // Expect the handler to receive one OnPlaying() call as a result of the // stream switching. - EXPECT_CALL(mock_event_handler_, OnPlaying()) - .WillOnce(SignalEvent(&play_event_)); + EXPECT_CALL(mock_event_handler_, OnPlaying()); } EXPECT_CALL(mock_stream_, Open()) @@ -186,6 +172,7 @@ } controller_->StartDiverting(&mock_stream_); + base::RunLoop().RunUntilIdle(); } void ReadDivertedAudioData() { @@ -201,13 +188,13 @@ if (was_playing) { // Expect the handler to receive one OnPlaying() call as a result of the // stream switching back. - EXPECT_CALL(mock_event_handler_, OnPlaying()) - .WillOnce(SignalEvent(&play_event_)); + EXPECT_CALL(mock_event_handler_, OnPlaying()); } EXPECT_CALL(mock_stream_, Close()); controller_->StopDiverting(); + base::RunLoop().RunUntilIdle(); } void SwitchDevice(bool diverting) { @@ -215,19 +202,22 @@ // Expect the current stream to close and a new stream to start // playing if not diverting. When diverting, nothing happens // until diverting is stopped. - EXPECT_CALL(mock_event_handler_, OnPlaying()) - .WillOnce(SignalEvent(&play_event_)); + EXPECT_CALL(mock_event_handler_, OnPlaying()); } controller_->SwitchOutputDevice(AudioManager::GetDefaultDeviceName(), base::Bind(&base::DoNothing)); + base::RunLoop().RunUntilIdle(); } void Close() { EXPECT_CALL(mock_sync_reader_, Close()); - controller_->Close(base::MessageLoop::QuitWhenIdleClosure()); - base::MessageLoop::current()->Run(); + base::RunLoop run_loop; + base::MessageLoop::current()->PostTask( + FROM_HERE, base::Bind(&AudioOutputController::Close, controller_, + run_loop.QuitClosure())); + run_loop.Run(); } // These help make test sequences more readable. @@ -237,30 +227,12 @@ void RevertWasNotPlaying() { Revert(false); } void RevertWhilePlaying() { Revert(true); } - // These synchronize the main thread with key events taking place on other - // threads. - void WaitForCreate() { create_event_.Wait(); } - void WaitForPlay() { play_event_.Wait(); } - void WaitForReads() { - // Note: Arbitrarily chosen, but more iterations causes tests to take - // significantly more time. - static const int kNumIterations = 3; - for (int i = 0; i < kNumIterations; ++i) { - read_event_.Wait(); - } - } - void WaitForPause() { pause_event_.Wait(); } - private: - base::MessageLoopForIO message_loop_; - scoped_ptr<AudioManager> audio_manager_; + base::TestMessageLoop message_loop_; + ScopedAudioManagerPtr audio_manager_; MockAudioOutputControllerEventHandler mock_event_handler_; MockAudioOutputControllerSyncReader mock_sync_reader_; MockAudioOutputStream mock_stream_; - base::WaitableEvent create_event_; - base::WaitableEvent play_event_; - base::WaitableEvent read_event_; - base::WaitableEvent pause_event_; AudioParameters params_; scoped_refptr<AudioOutputController> controller_; @@ -278,134 +250,84 @@ TEST_F(AudioOutputControllerTest, PlayAndClose) { Create(kSamplesPerPacket); - WaitForCreate(); Play(); - WaitForPlay(); - WaitForReads(); Close(); } TEST_F(AudioOutputControllerTest, PlayPauseClose) { Create(kSamplesPerPacket); - WaitForCreate(); Play(); - WaitForPlay(); - WaitForReads(); Pause(); - WaitForPause(); Close(); } TEST_F(AudioOutputControllerTest, PlayPausePlayClose) { Create(kSamplesPerPacket); - WaitForCreate(); Play(); - WaitForPlay(); - WaitForReads(); Pause(); - WaitForPause(); Play(); - WaitForPlay(); Close(); } TEST_F(AudioOutputControllerTest, PlayDeviceChangeClose) { Create(kSamplesPerPacket); - WaitForCreate(); Play(); - WaitForPlay(); - WaitForReads(); ChangeDevice(); - WaitForPlay(); - WaitForReads(); Close(); } TEST_F(AudioOutputControllerTest, PlaySwitchDeviceClose) { Create(kSamplesPerPacket); - WaitForCreate(); Play(); - WaitForPlay(); - WaitForReads(); SwitchDevice(false); - WaitForPlay(); - WaitForReads(); Close(); } TEST_F(AudioOutputControllerTest, PlayDivertRevertClose) { Create(kSamplesPerPacket); - WaitForCreate(); Play(); - WaitForPlay(); - WaitForReads(); DivertWhilePlaying(); - WaitForPlay(); ReadDivertedAudioData(); RevertWhilePlaying(); - WaitForPlay(); - WaitForReads(); Close(); } TEST_F(AudioOutputControllerTest, PlayDivertSwitchDeviceRevertClose) { Create(kSamplesPerPacket); - WaitForCreate(); Play(); - WaitForPlay(); - WaitForReads(); DivertWhilePlaying(); - WaitForPlay(); SwitchDevice(true); ReadDivertedAudioData(); RevertWhilePlaying(); - WaitForPlay(); - WaitForReads(); Close(); } TEST_F(AudioOutputControllerTest, PlayDivertRevertDivertRevertClose) { Create(kSamplesPerPacket); - WaitForCreate(); Play(); - WaitForPlay(); - WaitForReads(); DivertWhilePlaying(); - WaitForPlay(); ReadDivertedAudioData(); RevertWhilePlaying(); - WaitForPlay(); - WaitForReads(); DivertWhilePlaying(); - WaitForPlay(); ReadDivertedAudioData(); RevertWhilePlaying(); - WaitForPlay(); - WaitForReads(); Close(); } TEST_F(AudioOutputControllerTest, DivertPlayPausePlayRevertClose) { Create(kSamplesPerPacket); - WaitForCreate(); DivertWillEventuallyBeTwicePlayed(); Play(); - WaitForPlay(); ReadDivertedAudioData(); Pause(); - WaitForPause(); Play(); - WaitForPlay(); ReadDivertedAudioData(); RevertWhilePlaying(); - WaitForPlay(); - WaitForReads(); Close(); } TEST_F(AudioOutputControllerTest, DivertRevertClose) { Create(kSamplesPerPacket); - WaitForCreate(); DivertNeverPlaying(); RevertWasNotPlaying(); Close();
diff --git a/media/audio/audio_output_proxy_unittest.cc b/media/audio/audio_output_proxy_unittest.cc index f0374618..3c5d0b5 100644 --- a/media/audio/audio_output_proxy_unittest.cc +++ b/media/audio/audio_output_proxy_unittest.cc
@@ -8,6 +8,7 @@ #include "base/message_loop/message_loop.h" #include "base/run_loop.h" +#include "base/thread_task_runner_handle.h" #include "build/build_config.h" #include "media/audio/audio_manager.h" #include "media/audio/audio_manager_base.h" @@ -87,10 +88,11 @@ class MockAudioManager : public AudioManagerBase { public: - MockAudioManager() : AudioManagerBase(&fake_audio_log_factory_) {} - virtual ~MockAudioManager() { - Shutdown(); - } + MockAudioManager() + : AudioManagerBase(base::ThreadTaskRunnerHandle::Get(), + base::ThreadTaskRunnerHandle::Get(), + &fake_audio_log_factory_) {} + ~MockAudioManager() override { Shutdown(); } MOCK_METHOD0(HasAudioOutputDevices, bool()); MOCK_METHOD0(HasAudioInputDevices, bool()); @@ -143,10 +145,6 @@ class AudioOutputProxyTest : public testing::Test { protected: void SetUp() override { - EXPECT_CALL(manager_, GetTaskRunner()) - .WillRepeatedly(Return(message_loop_.task_runner())); - EXPECT_CALL(manager_, GetWorkerTaskRunner()) - .WillRepeatedly(Return(message_loop_.task_runner())); // Use a low sample rate and large buffer size when testing otherwise the // FakeAudioOutputStream will keep the message loop busy indefinitely; i.e., // RunUntilIdle() will never terminate.
diff --git a/media/audio/cras/audio_manager_cras.cc b/media/audio/cras/audio_manager_cras.cc index 2a9b77d..0d70a58d 100644 --- a/media/audio/cras/audio_manager_cras.cc +++ b/media/audio/cras/audio_manager_cras.cc
@@ -135,8 +135,13 @@ return false; } -AudioManagerCras::AudioManagerCras(AudioLogFactory* audio_log_factory) - : AudioManagerBase(audio_log_factory), +AudioManagerCras::AudioManagerCras( + scoped_refptr<base::SingleThreadTaskRunner> task_runner, + scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner, + AudioLogFactory* audio_log_factory) + : AudioManagerBase(std::move(task_runner), + std::move(worker_task_runner), + audio_log_factory), beamforming_on_device_id_(nullptr), beamforming_off_device_id_(nullptr) { SetMaxOutputStreamsAllowed(kMaxOutputStreams);
diff --git a/media/audio/cras/audio_manager_cras.h b/media/audio/cras/audio_manager_cras.h index 6ad4f0e..3383a2f 100644 --- a/media/audio/cras/audio_manager_cras.h +++ b/media/audio/cras/audio_manager_cras.h
@@ -18,7 +18,10 @@ class MEDIA_EXPORT AudioManagerCras : public AudioManagerBase { public: - AudioManagerCras(AudioLogFactory* audio_log_factory); + AudioManagerCras( + scoped_refptr<base::SingleThreadTaskRunner> task_runner, + scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner, + AudioLogFactory* audio_log_factory); // AudioManager implementation. bool HasAudioOutputDevices() override;
diff --git a/media/audio/cras/cras_input_unittest.cc b/media/audio/cras/cras_input_unittest.cc index 3735322b0..9062bbda 100644 --- a/media/audio/cras/cras_input_unittest.cc +++ b/media/audio/cras/cras_input_unittest.cc
@@ -4,11 +4,15 @@ #include <stdint.h> +#include <memory> #include <string> #include "base/macros.h" +#include "base/run_loop.h" #include "base/synchronization/waitable_event.h" +#include "base/test/test_message_loop.h" #include "base/test/test_timeouts.h" +#include "base/thread_task_runner_handle.h" #include "base/time/time.h" #include "media/audio/cras/audio_manager_cras.h" #include "media/audio/fake_audio_log_factory.h" @@ -38,7 +42,10 @@ class MockAudioManagerCrasInput : public AudioManagerCras { public: - MockAudioManagerCrasInput() : AudioManagerCras(&fake_audio_log_factory_) {} + MockAudioManagerCrasInput() + : AudioManagerCras(base::ThreadTaskRunnerHandle::Get(), + base::ThreadTaskRunnerHandle::Get(), + &fake_audio_log_factory_) {} // We need to override this function in order to skip checking the number // of active output streams. It is because the number of active streams @@ -57,10 +64,10 @@ protected: CrasInputStreamTest() { mock_manager_.reset(new StrictMock<MockAudioManagerCrasInput>()); + base::RunLoop().RunUntilIdle(); } - virtual ~CrasInputStreamTest() { - } + ~CrasInputStreamTest() override {} CrasInputStream* CreateStream(ChannelLayout layout) { return CreateStream(layout, kTestFramesPerPacket); @@ -115,7 +122,9 @@ static const uint32_t kTestFramesPerPacket; static const int kTestSampleRate; - scoped_ptr<StrictMock<MockAudioManagerCrasInput> > mock_manager_; + base::TestMessageLoop message_loop_; + std::unique_ptr<StrictMock<MockAudioManagerCrasInput>, AudioManagerDeleter> + mock_manager_; private: DISALLOW_COPY_AND_ASSIGN(CrasInputStreamTest);
diff --git a/media/audio/cras/cras_unified_unittest.cc b/media/audio/cras/cras_unified_unittest.cc index cb4d71bf..2bc199ed 100644 --- a/media/audio/cras/cras_unified_unittest.cc +++ b/media/audio/cras/cras_unified_unittest.cc
@@ -7,8 +7,11 @@ #include <string> #include "base/macros.h" +#include "base/run_loop.h" #include "base/synchronization/waitable_event.h" +#include "base/test/test_message_loop.h" #include "base/test/test_timeouts.h" +#include "base/thread_task_runner_handle.h" #include "base/time/time.h" #include "media/audio/cras/audio_manager_cras.h" #include "media/audio/fake_audio_log_factory.h" @@ -33,7 +36,10 @@ class MockAudioManagerCras : public AudioManagerCras { public: - MockAudioManagerCras() : AudioManagerCras(&fake_audio_log_factory_) {} + MockAudioManagerCras() + : AudioManagerCras(base::ThreadTaskRunnerHandle::Get(), + base::ThreadTaskRunnerHandle::Get(), + &fake_audio_log_factory_) {} MOCK_METHOD0(Init, void()); MOCK_METHOD0(HasAudioOutputDevices, bool()); @@ -65,10 +71,10 @@ protected: CrasUnifiedStreamTest() { mock_manager_.reset(new StrictMock<MockAudioManagerCras>()); + base::RunLoop().RunUntilIdle(); } - virtual ~CrasUnifiedStreamTest() { - } + ~CrasUnifiedStreamTest() override {} CrasUnifiedStream* CreateStream(ChannelLayout layout) { return CreateStream(layout, kTestFramesPerPacket); @@ -91,7 +97,9 @@ static const AudioParameters::Format kTestFormat; static const uint32_t kTestFramesPerPacket; - scoped_ptr<StrictMock<MockAudioManagerCras> > mock_manager_; + base::TestMessageLoop message_loop_; + scoped_ptr<StrictMock<MockAudioManagerCras>, AudioManagerDeleter> + mock_manager_; private: DISALLOW_COPY_AND_ASSIGN(CrasUnifiedStreamTest);
diff --git a/media/audio/fake_audio_manager.cc b/media/audio/fake_audio_manager.cc index 3d76401..a4005e1f 100644 --- a/media/audio/fake_audio_manager.cc +++ b/media/audio/fake_audio_manager.cc
@@ -13,10 +13,18 @@ } // namespace -FakeAudioManager::FakeAudioManager(AudioLogFactory* audio_log_factory) - : AudioManagerBase(audio_log_factory) {} +FakeAudioManager::FakeAudioManager( + scoped_refptr<base::SingleThreadTaskRunner> task_runner, + scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner, + AudioLogFactory* audio_log_factory) + : AudioManagerBase(std::move(task_runner), + std::move(worker_task_runner), + audio_log_factory) { + LOG(INFO) << __FUNCTION__; +} FakeAudioManager::~FakeAudioManager() { + LOG(INFO) << __FUNCTION__; Shutdown(); }
diff --git a/media/audio/fake_audio_manager.h b/media/audio/fake_audio_manager.h index ee055c7..326988c 100644 --- a/media/audio/fake_audio_manager.h +++ b/media/audio/fake_audio_manager.h
@@ -16,7 +16,10 @@ class MEDIA_EXPORT FakeAudioManager : public AudioManagerBase { public: - FakeAudioManager(AudioLogFactory* audio_log_factory); + FakeAudioManager( + scoped_refptr<base::SingleThreadTaskRunner> task_runner, + scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner, + AudioLogFactory* audio_log_factory); // Implementation of AudioManager. bool HasAudioOutputDevices() override;
diff --git a/media/audio/linux/audio_manager_linux.cc b/media/audio/linux/audio_manager_linux.cc index 0e7c981..5d9676e 100644 --- a/media/audio/linux/audio_manager_linux.cc +++ b/media/audio/linux/audio_manager_linux.cc
@@ -4,6 +4,8 @@ #include "base/command_line.h" #include "base/metrics/histogram.h" +#include "media/base/media_switches.h" + #if defined(USE_ALSA) #include "media/audio/alsa/audio_manager_alsa.h" #else @@ -15,7 +17,6 @@ #if defined(USE_PULSEAUDIO) #include "media/audio/pulse/audio_manager_pulse.h" #endif -#include "media/base/media_switches.h" namespace media { @@ -26,27 +27,42 @@ kAudioIOMax = kCras // Must always be equal to largest logged entry. }; -AudioManager* CreateAudioManager(AudioLogFactory* audio_log_factory) { +ScopedAudioManagerPtr CreateAudioManager( + scoped_refptr<base::SingleThreadTaskRunner> task_runner, + scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner, + AudioLogFactory* audio_log_factory) { #if defined(USE_CRAS) if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseCras)) { UMA_HISTOGRAM_ENUMERATION("Media.LinuxAudioIO", kCras, kAudioIOMax + 1); - return new AudioManagerCras(audio_log_factory); + return ScopedAudioManagerPtr( + new AudioManagerCras(std::move(task_runner), + std::move(worker_task_runner), audio_log_factory)); } #endif #if defined(USE_PULSEAUDIO) - AudioManager* manager = AudioManagerPulse::Create(audio_log_factory); - if (manager) { + // Do not move task runners when creating AudioManagerPulse. + // If the creation fails, we need to use the task runners to create other + // AudioManager implementations. + std::unique_ptr<AudioManagerPulse, AudioManagerDeleter> manager( + new AudioManagerPulse(task_runner, worker_task_runner, + audio_log_factory)); + if (manager->Init()) { UMA_HISTOGRAM_ENUMERATION("Media.LinuxAudioIO", kPulse, kAudioIOMax + 1); - return manager; + return std::move(manager); } + DVLOG(1) << "PulseAudio is not available on the OS"; #endif #if defined(USE_ALSA) UMA_HISTOGRAM_ENUMERATION("Media.LinuxAudioIO", kAlsa, kAudioIOMax + 1); - return new AudioManagerAlsa(audio_log_factory); + return ScopedAudioManagerPtr( + new AudioManagerAlsa(std::move(task_runner), + std::move(worker_task_runner), audio_log_factory)); #else - return new FakeAudioManager(audio_log_factory); + return ScopedAudioManagerPtr( + new FakeAudioManager(std::move(task_runner), + std::move(worker_task_runner), audio_log_factory)); #endif }
diff --git a/media/audio/mac/audio_auhal_mac_unittest.cc b/media/audio/mac/audio_auhal_mac_unittest.cc index 73191cd..044116b 100644 --- a/media/audio/mac/audio_auhal_mac_unittest.cc +++ b/media/audio/mac/audio_auhal_mac_unittest.cc
@@ -4,9 +4,10 @@ #include "base/macros.h" #include "base/memory/scoped_ptr.h" -#include "base/message_loop/message_loop.h" #include "base/run_loop.h" #include "base/synchronization/waitable_event.h" +#include "base/test/test_message_loop.h" +#include "base/thread_task_runner_handle.h" #include "media/audio/audio_io.h" #include "media/audio/audio_manager.h" #include "media/audio/audio_unittest_util.h" @@ -35,12 +36,13 @@ public: AUHALStreamTest() : message_loop_(base::MessageLoop::TYPE_UI), - manager_(AudioManager::CreateForTesting()) { + manager_(AudioManager::CreateForTesting( + base::ThreadTaskRunnerHandle::Get())) { // Wait for the AudioManager to finish any initialization on the audio loop. base::RunLoop().RunUntilIdle(); } - ~AUHALStreamTest() override { base::RunLoop().RunUntilIdle(); } + ~AUHALStreamTest() override {} AudioOutputStream* Create() { return manager_->MakeAudioOutputStream( @@ -52,8 +54,8 @@ } protected: - base::MessageLoop message_loop_; - scoped_ptr<AudioManager> manager_; + base::TestMessageLoop message_loop_; + ScopedAudioManagerPtr manager_; MockAudioSourceCallback source_; private:
diff --git a/media/audio/mac/audio_low_latency_input_mac_unittest.cc b/media/audio/mac/audio_low_latency_input_mac_unittest.cc index ba30cf13..7309586 100644 --- a/media/audio/mac/audio_low_latency_input_mac_unittest.cc +++ b/media/audio/mac/audio_low_latency_input_mac_unittest.cc
@@ -107,12 +107,16 @@ protected: MacAudioInputTest() : message_loop_(base::MessageLoop::TYPE_UI), - audio_manager_(AudioManager::CreateForTesting()) { + audio_manager_( + AudioManager::CreateForTesting(message_loop_.task_runner())) { // Wait for the AudioManager to finish any initialization on the audio loop. base::RunLoop().RunUntilIdle(); } - ~MacAudioInputTest() override { base::RunLoop().RunUntilIdle(); } + ~MacAudioInputTest() override { + audio_manager_.reset(); + base::RunLoop().RunUntilIdle(); + } bool InputDevicesAvailable() { return audio_manager_->HasAudioInputDevices(); @@ -146,7 +150,7 @@ } base::MessageLoop message_loop_; - scoped_ptr<AudioManager> audio_manager_; + ScopedAudioManagerPtr audio_manager_; }; // Test Create(), Close().
diff --git a/media/audio/mac/audio_manager_mac.cc b/media/audio/mac/audio_manager_mac.cc index 20cd4c8..0b29dcc13 100644 --- a/media/audio/mac/audio_manager_mac.cc +++ b/media/audio/mac/audio_manager_mac.cc
@@ -293,18 +293,6 @@ return GetDefaultDevice(device, false); } -template <class T> -void StopStreams(std::list<T*>* streams) { - for (typename std::list<T*>::iterator it = streams->begin(); - it != streams->end(); - ++it) { - // Stop() is safe to call multiple times, so it doesn't matter if a stream - // has already been stopped. - (*it)->Stop(); - } - streams->clear(); -} - class AudioManagerMac::AudioPowerObserver : public base::PowerObserver { public: AudioPowerObserver() @@ -370,55 +358,29 @@ DISALLOW_COPY_AND_ASSIGN(AudioPowerObserver); }; -AudioManagerMac::AudioManagerMac(AudioLogFactory* audio_log_factory) - : AudioManagerBase(audio_log_factory), +AudioManagerMac::AudioManagerMac( + scoped_refptr<base::SingleThreadTaskRunner> task_runner, + scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner, + AudioLogFactory* audio_log_factory) + : AudioManagerBase(std::move(task_runner), + std::move(worker_task_runner), + audio_log_factory), current_sample_rate_(0), current_output_device_(kAudioDeviceUnknown) { SetMaxOutputStreamsAllowed(kMaxOutputStreams); - // CoreAudio calls must occur on the main thread of the process, which in our - // case is sadly the browser UI thread. Failure to execute calls on the right - // thread leads to crashes and odd behavior. See http://crbug.com/158170. - // TODO(dalecurtis): We should require the message loop to be passed in. - task_runner_ = base::MessageLoopForUI::IsCurrent() - ? base::ThreadTaskRunnerHandle::Get() - : AudioManagerBase::GetTaskRunner(); - // Task must be posted last to avoid races from handing out "this" to the // audio thread. Always PostTask even if we're on the right thread since // AudioManager creation is on the startup path and this may be slow. - task_runner_->PostTask(FROM_HERE, - base::Bind(&AudioManagerMac::InitializeOnAudioThread, - base::Unretained(this))); + GetTaskRunner()->PostTask( + FROM_HERE, base::Bind(&AudioManagerMac::InitializeOnAudioThread, + base::Unretained(this))); } AudioManagerMac::~AudioManagerMac() { - if (task_runner_->BelongsToCurrentThread()) { - ShutdownOnAudioThread(); - } else { - // It's safe to post a task here since Shutdown() will wait for all tasks to - // complete before returning. - task_runner_->PostTask(FROM_HERE, - base::Bind(&AudioManagerMac::ShutdownOnAudioThread, - base::Unretained(this))); - } - Shutdown(); } -scoped_refptr<base::SingleThreadTaskRunner> AudioManagerMac::GetTaskRunner() { - return task_runner_; -} - -scoped_refptr<base::SingleThreadTaskRunner> -AudioManagerMac::GetWorkerTaskRunner() { - if (!worker_thread_) { - worker_thread_.reset(new base::Thread("AudioWorkerThread")); - CHECK(worker_thread_->Start()); - } - return worker_thread_->task_runner(); -} - bool AudioManagerMac::HasAudioOutputDevices() { return HasAudioHardware(kAudioHardwarePropertyDefaultOutputDevice); } @@ -556,7 +518,7 @@ std::string AudioManagerMac::GetAssociatedOutputDeviceID( const std::string& input_device_id) { - DCHECK(task_runner_->BelongsToCurrentThread()); + DCHECK(GetTaskRunner()->BelongsToCurrentThread()); AudioDeviceID device = GetAudioDeviceIdByUId(true, input_device_id); if (device == kAudioObjectUnknown) return std::string(); @@ -681,7 +643,7 @@ } std::string AudioManagerMac::GetDefaultOutputDeviceID() { - DCHECK(task_runner_->BelongsToCurrentThread()); + DCHECK(GetTaskRunner()->BelongsToCurrentThread()); AudioDeviceID device_id = kAudioObjectUnknown; if (!GetDefaultOutputDevice(&device_id)) return std::string(); @@ -780,31 +742,12 @@ } void AudioManagerMac::InitializeOnAudioThread() { - DCHECK(task_runner_->BelongsToCurrentThread()); + DCHECK(GetTaskRunner()->BelongsToCurrentThread()); power_observer_.reset(new AudioPowerObserver()); } -void AudioManagerMac::ShutdownOnAudioThread() { - DCHECK(task_runner_->BelongsToCurrentThread()); - output_device_listener_.reset(); - power_observer_.reset(); - - // Since CoreAudio calls have to run on the UI thread and browser shutdown - // doesn't wait for outstanding tasks to complete, we may have input/output - // streams still running at shutdown. - // - // To avoid calls into destructed classes, we need to stop the OS callbacks - // by stopping the streams. Note: The streams are leaked since process - // destruction is imminent. - // - // See http://crbug.com/354139 for crash details. - StopStreams(&basic_input_streams_); - StopStreams(&low_latency_input_streams_); - StopStreams(&output_streams_); -} - void AudioManagerMac::HandleDeviceChanges() { - DCHECK(task_runner_->BelongsToCurrentThread()); + DCHECK(GetTaskRunner()->BelongsToCurrentThread()); const int new_sample_rate = HardwareSampleRate(); AudioDeviceID new_output_device; GetDefaultOutputDevice(&new_output_device); @@ -846,22 +789,22 @@ } bool AudioManagerMac::IsSuspending() const { - DCHECK(task_runner_->BelongsToCurrentThread()); + DCHECK(GetTaskRunner()->BelongsToCurrentThread()); return power_observer_->IsSuspending(); } bool AudioManagerMac::ShouldDeferStreamStart() const { - DCHECK(task_runner_->BelongsToCurrentThread()); + DCHECK(GetTaskRunner()->BelongsToCurrentThread()); return power_observer_->ShouldDeferStreamStart(); } bool AudioManagerMac::IsOnBatteryPower() const { - DCHECK(task_runner_->BelongsToCurrentThread()); + DCHECK(GetTaskRunner()->BelongsToCurrentThread()); return power_observer_->IsOnBatteryPower(); } size_t AudioManagerMac::GetNumberOfResumeNotifications() const { - DCHECK(task_runner_->BelongsToCurrentThread()); + DCHECK(GetTaskRunner()->BelongsToCurrentThread()); return power_observer_->num_resume_notifications(); } @@ -871,7 +814,7 @@ size_t desired_buffer_size, bool* size_was_changed, size_t* io_buffer_frame_size) { - DCHECK(task_runner_->BelongsToCurrentThread()); + DCHECK(GetTaskRunner()->BelongsToCurrentThread()); const bool is_input = (element == 1); DVLOG(1) << "MaybeChangeBufferSize(id=0x" << std::hex << device_id << ", is_input=" << is_input << ", desired_buffer_size=" << std::dec @@ -991,8 +934,13 @@ AudioManagerBase::ReleaseInputStream(stream); } -AudioManager* CreateAudioManager(AudioLogFactory* audio_log_factory) { - return new AudioManagerMac(audio_log_factory); +ScopedAudioManagerPtr CreateAudioManager( + scoped_refptr<base::SingleThreadTaskRunner> task_runner, + scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner, + AudioLogFactory* audio_log_factory) { + return ScopedAudioManagerPtr( + new AudioManagerMac(std::move(task_runner), std::move(worker_task_runner), + audio_log_factory)); } } // namespace media
diff --git a/media/audio/mac/audio_manager_mac.h b/media/audio/mac/audio_manager_mac.h index c110538..f8c99e8 100644 --- a/media/audio/mac/audio_manager_mac.h +++ b/media/audio/mac/audio_manager_mac.h
@@ -26,11 +26,12 @@ // the AudioManager class. class MEDIA_EXPORT AudioManagerMac : public AudioManagerBase { public: - AudioManagerMac(AudioLogFactory* audio_log_factory); + AudioManagerMac( + scoped_refptr<base::SingleThreadTaskRunner> task_runner, + scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner, + AudioLogFactory* audio_log_factory); // Implementation of AudioManager. - scoped_refptr<base::SingleThreadTaskRunner> GetTaskRunner() override; - scoped_refptr<base::SingleThreadTaskRunner> GetWorkerTaskRunner() override; bool HasAudioOutputDevices() override; bool HasAudioInputDevices() override; void GetAudioInputDeviceNames(AudioDeviceNames* device_names) override; @@ -117,7 +118,6 @@ private: void InitializeOnAudioThread(); - void ShutdownOnAudioThread(); int ChooseBufferSize(bool is_input, int sample_rate); @@ -127,9 +127,6 @@ scoped_ptr<AudioDeviceListenerMac> output_device_listener_; - scoped_refptr<base::SingleThreadTaskRunner> task_runner_; - scoped_ptr<base::Thread> worker_thread_; - // Track the output sample-rate and the default output device // so we can intelligently handle device notifications only when necessary. int current_sample_rate_; @@ -141,8 +138,11 @@ class AudioPowerObserver; scoped_ptr<AudioPowerObserver> power_observer_; - // Tracks all constructed input and output streams so they can be stopped at - // shutdown. See ShutdownOnAudioThread() for more details. + // Tracks all constructed input and output streams. + // TODO(alokp): We used to track these streams to close before destruction. + // We no longer close the streams, so we may be able to get rid of these + // member variables. They are currently used by MaybeChangeBufferSize(). + // Investigate if we can remove these. std::list<AudioInputStream*> basic_input_streams_; std::list<AUAudioInputStream*> low_latency_input_streams_; std::list<AUHALStream*> output_streams_;
diff --git a/media/audio/mock_audio_manager.cc b/media/audio/mock_audio_manager.cc index 7183405a..e7726ca 100644 --- a/media/audio/mock_audio_manager.cc +++ b/media/audio/mock_audio_manager.cc
@@ -11,8 +11,8 @@ namespace media { MockAudioManager::MockAudioManager( - const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) - : task_runner_(task_runner) {} + scoped_refptr<base::SingleThreadTaskRunner> task_runner) + : AudioManager(task_runner, task_runner) {} MockAudioManager::~MockAudioManager() { } @@ -63,15 +63,6 @@ return NULL; } -scoped_refptr<base::SingleThreadTaskRunner> MockAudioManager::GetTaskRunner() { - return task_runner_; -} - -scoped_refptr<base::SingleThreadTaskRunner> -MockAudioManager::GetWorkerTaskRunner() { - return task_runner_; -} - void MockAudioManager::AddOutputDeviceChangeListener( AudioDeviceListener* listener) { }
diff --git a/media/audio/mock_audio_manager.h b/media/audio/mock_audio_manager.h index 60a8b1e..33f7e5e 100644 --- a/media/audio/mock_audio_manager.h +++ b/media/audio/mock_audio_manager.h
@@ -11,19 +11,13 @@ namespace media { // This class is a simple mock around AudioManager, used exclusively for tests, -// which has the following purposes: -// 1) Avoids to use the actual (system and platform dependent) AudioManager. -// Some bots does not have input devices, thus using the actual AudioManager -// would causing failures on classes which expect that. -// 2) Allows the mock audio events to be dispatched on an arbitrary thread, -// rather than forcing them on the audio thread, easing their handling in -// browser tests (Note: sharing a thread can cause deadlocks on production -// classes if WaitableEvents or any other form of lock is used for -// synchronization purposes). +// which avoids to use the actual (system and platform dependent) AudioManager. +// Some bots does not have input devices, thus using the actual AudioManager +// would causing failures on classes which expect that. class MockAudioManager : public media::AudioManager { public: explicit MockAudioManager( - const scoped_refptr<base::SingleThreadTaskRunner>& task_runner); + scoped_refptr<base::SingleThreadTaskRunner> task_runner); bool HasAudioOutputDevices() override; @@ -50,9 +44,6 @@ const media::AudioParameters& params, const std::string& device_id) override; - scoped_refptr<base::SingleThreadTaskRunner> GetTaskRunner() override; - scoped_refptr<base::SingleThreadTaskRunner> GetWorkerTaskRunner() override; - void AddOutputDeviceChangeListener(AudioDeviceListener* listener) override; void RemoveOutputDeviceChangeListener(AudioDeviceListener* listener) override; @@ -71,8 +62,6 @@ ~MockAudioManager() override; private: - scoped_refptr<base::SingleThreadTaskRunner> task_runner_; - DISALLOW_COPY_AND_ASSIGN(MockAudioManager); };
diff --git a/media/audio/pulse/audio_manager_pulse.cc b/media/audio/pulse/audio_manager_pulse.cc index d6e9543..b96728c 100644 --- a/media/audio/pulse/audio_manager_pulse.cc +++ b/media/audio/pulse/audio_manager_pulse.cc
@@ -47,18 +47,13 @@ FILE_PATH_LITERAL("libpulse.so.0"); #endif -// static -AudioManager* AudioManagerPulse::Create(AudioLogFactory* audio_log_factory) { - scoped_ptr<AudioManagerPulse> ret(new AudioManagerPulse(audio_log_factory)); - if (ret->Init()) - return ret.release(); - - DVLOG(1) << "PulseAudio is not available on the OS"; - return NULL; -} - -AudioManagerPulse::AudioManagerPulse(AudioLogFactory* audio_log_factory) - : AudioManagerBase(audio_log_factory), +AudioManagerPulse::AudioManagerPulse( + scoped_refptr<base::SingleThreadTaskRunner> task_runner, + scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner, + AudioLogFactory* audio_log_factory) + : AudioManagerBase(std::move(task_runner), + std::move(worker_task_runner), + audio_log_factory), input_mainloop_(NULL), input_context_(NULL), devices_(NULL), @@ -68,12 +63,20 @@ AudioManagerPulse::~AudioManagerPulse() { Shutdown(); - // The Pulse objects are the last things to be destroyed since Shutdown() // needs them. DestroyPulse(); } +bool AudioManagerPulse::Init() { + // TODO(alokp): Investigate if InitPulse can happen on the audio thread. + // It currently needs to happen on the main thread so that is InitPulse fails, + // we can fallback to ALSA implementation. Initializing it on audio thread + // would unblock the main thread and make InitPulse consistent with + // DestroyPulse which happens on the audio thread. + return InitPulse(); +} + // Implementation of AudioManager. bool AudioManagerPulse::HasAudioOutputDevices() { AudioDeviceNames devices; @@ -217,7 +220,7 @@ return native_input_sample_rate_; } -bool AudioManagerPulse::Init() { +bool AudioManagerPulse::InitPulse() { DCHECK(!input_mainloop_); #if defined(DLOPEN_PULSEAUDIO)
diff --git a/media/audio/pulse/audio_manager_pulse.h b/media/audio/pulse/audio_manager_pulse.h index 93a1c94..d2f6450 100644 --- a/media/audio/pulse/audio_manager_pulse.h +++ b/media/audio/pulse/audio_manager_pulse.h
@@ -17,10 +17,12 @@ class MEDIA_EXPORT AudioManagerPulse : public AudioManagerBase { public: - AudioManagerPulse(AudioLogFactory* audio_log_factory); - ~AudioManagerPulse() override; + AudioManagerPulse( + scoped_refptr<base::SingleThreadTaskRunner> task_runner, + scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner, + AudioLogFactory* audio_log_factory); - static AudioManager* Create(AudioLogFactory* audio_log_factory); + bool Init(); // Implementation of AudioManager. bool HasAudioOutputDevices() override; @@ -45,12 +47,14 @@ const std::string& device_id) override; protected: + ~AudioManagerPulse() override; + AudioParameters GetPreferredOutputStreamParameters( const std::string& output_device_id, const AudioParameters& input_params) override; private: - bool Init(); + bool InitPulse(); void DestroyPulse(); void GetAudioDeviceNames(bool input, media::AudioDeviceNames* device_names);
diff --git a/media/audio/sounds/audio_stream_handler_unittest.cc b/media/audio/sounds/audio_stream_handler_unittest.cc index 1b87ca42..4863bc9 100644 --- a/media/audio/sounds/audio_stream_handler_unittest.cc +++ b/media/audio/sounds/audio_stream_handler_unittest.cc
@@ -7,8 +7,9 @@ #include "base/compiler_specific.h" #include "base/macros.h" #include "base/memory/scoped_ptr.h" -#include "base/message_loop/message_loop.h" #include "base/run_loop.h" +#include "base/test/test_message_loop.h" +#include "base/thread_task_runner_handle.h" #include "media/audio/audio_io.h" #include "media/audio/audio_manager.h" #include "media/audio/simple_sources.h" @@ -25,7 +26,9 @@ ~AudioStreamHandlerTest() override {} void SetUp() override { - audio_manager_.reset(AudioManager::CreateForTesting()); + audio_manager_ = + AudioManager::CreateForTesting(base::ThreadTaskRunnerHandle::Get()); + base::RunLoop().RunUntilIdle(); base::StringPiece data(kTestAudioData, arraysize(kTestAudioData)); audio_stream_handler_.reset(new AudioStreamHandler(data)); @@ -33,7 +36,7 @@ void TearDown() override { audio_stream_handler_.reset(); - audio_manager_.reset(); + base::RunLoop().RunUntilIdle(); } AudioStreamHandler* audio_stream_handler() { @@ -50,10 +53,9 @@ } private: - scoped_ptr<AudioManager> audio_manager_; + base::TestMessageLoop message_loop_; + ScopedAudioManagerPtr audio_manager_; scoped_ptr<AudioStreamHandler> audio_stream_handler_; - - base::MessageLoop message_loop_; }; TEST_F(AudioStreamHandlerTest, Play) {
diff --git a/media/audio/sounds/sounds_manager_unittest.cc b/media/audio/sounds/sounds_manager_unittest.cc index 6dfcf119..21f5c65 100644 --- a/media/audio/sounds/sounds_manager_unittest.cc +++ b/media/audio/sounds/sounds_manager_unittest.cc
@@ -7,10 +7,10 @@ #include "base/compiler_specific.h" #include "base/logging.h" #include "base/macros.h" -#include "base/memory/scoped_ptr.h" -#include "base/message_loop/message_loop.h" #include "base/run_loop.h" #include "base/strings/string_piece.h" +#include "base/test/test_message_loop.h" +#include "base/thread_task_runner_handle.h" #include "media/audio/audio_manager.h" #include "media/audio/simple_sources.h" #include "media/audio/sounds/audio_stream_handler.h" @@ -26,13 +26,15 @@ ~SoundsManagerTest() override {} void SetUp() override { - audio_manager_.reset(AudioManager::CreateForTesting()); + audio_manager_ = + AudioManager::CreateForTesting(base::ThreadTaskRunnerHandle::Get()); SoundsManager::Create(); + base::RunLoop().RunUntilIdle(); } void TearDown() override { SoundsManager::Shutdown(); - audio_manager_.reset(); + base::RunLoop().RunUntilIdle(); } void SetObserverForTesting(AudioStreamHandler::TestObserver* observer) { @@ -45,9 +47,8 @@ } private: - scoped_ptr<AudioManager> audio_manager_; - - base::MessageLoop message_loop_; + base::TestMessageLoop message_loop_; + ScopedAudioManagerPtr audio_manager_; }; TEST_F(SoundsManagerTest, Play) {
diff --git a/media/audio/win/audio_low_latency_input_win_unittest.cc b/media/audio/win/audio_low_latency_input_win_unittest.cc index 8a9f366..1c67150 100644 --- a/media/audio/win/audio_low_latency_input_win_unittest.cc +++ b/media/audio/win/audio_low_latency_input_win_unittest.cc
@@ -250,15 +250,31 @@ DISALLOW_COPY_AND_ASSIGN(ScopedAudioInputStream); }; +class WinAudioInputTest : public ::testing::Test { + public: + WinAudioInputTest() { + audio_manager_ = + AudioManager::CreateForTesting(message_loop_.task_runner()); + message_loop_.RunUntilIdle(); + } + ~WinAudioInputTest() override { + audio_manager_.reset(); + message_loop_.RunUntilIdle(); + } + + protected: + base::MessageLoop message_loop_; + ScopedAudioManagerPtr audio_manager_; +}; + // Verify that we can retrieve the current hardware/mixing sample rate // for all available input devices. -TEST(WinAudioInputTest, WASAPIAudioInputStreamHardwareSampleRate) { - scoped_ptr<AudioManager> audio_manager(AudioManager::CreateForTesting()); - ABORT_AUDIO_TEST_IF_NOT(HasCoreAudioAndInputDevices(audio_manager.get())); +TEST_F(WinAudioInputTest, WASAPIAudioInputStreamHardwareSampleRate) { + ABORT_AUDIO_TEST_IF_NOT(HasCoreAudioAndInputDevices(audio_manager_.get())); // Retrieve a list of all available input devices. media::AudioDeviceNames device_names; - audio_manager->GetAudioInputDeviceNames(&device_names); + audio_manager_->GetAudioInputDeviceNames(&device_names); // Scan all available input devices and repeat the same test for all of them. for (media::AudioDeviceNames::const_iterator it = device_names.begin(); @@ -272,30 +288,27 @@ } // Test Create(), Close() calling sequence. -TEST(WinAudioInputTest, WASAPIAudioInputStreamCreateAndClose) { - scoped_ptr<AudioManager> audio_manager(AudioManager::CreateForTesting()); - ABORT_AUDIO_TEST_IF_NOT(HasCoreAudioAndInputDevices(audio_manager.get())); +TEST_F(WinAudioInputTest, WASAPIAudioInputStreamCreateAndClose) { + ABORT_AUDIO_TEST_IF_NOT(HasCoreAudioAndInputDevices(audio_manager_.get())); ScopedAudioInputStream ais( - CreateDefaultAudioInputStream(audio_manager.get())); + CreateDefaultAudioInputStream(audio_manager_.get())); ais.Close(); } // Test Open(), Close() calling sequence. -TEST(WinAudioInputTest, WASAPIAudioInputStreamOpenAndClose) { - scoped_ptr<AudioManager> audio_manager(AudioManager::CreateForTesting()); - ABORT_AUDIO_TEST_IF_NOT(HasCoreAudioAndInputDevices(audio_manager.get())); +TEST_F(WinAudioInputTest, WASAPIAudioInputStreamOpenAndClose) { + ABORT_AUDIO_TEST_IF_NOT(HasCoreAudioAndInputDevices(audio_manager_.get())); ScopedAudioInputStream ais( - CreateDefaultAudioInputStream(audio_manager.get())); + CreateDefaultAudioInputStream(audio_manager_.get())); EXPECT_TRUE(ais->Open()); ais.Close(); } // Test Open(), Start(), Close() calling sequence. -TEST(WinAudioInputTest, WASAPIAudioInputStreamOpenStartAndClose) { - scoped_ptr<AudioManager> audio_manager(AudioManager::CreateForTesting()); - ABORT_AUDIO_TEST_IF_NOT(HasCoreAudioAndInputDevices(audio_manager.get())); +TEST_F(WinAudioInputTest, WASAPIAudioInputStreamOpenStartAndClose) { + ABORT_AUDIO_TEST_IF_NOT(HasCoreAudioAndInputDevices(audio_manager_.get())); ScopedAudioInputStream ais( - CreateDefaultAudioInputStream(audio_manager.get())); + CreateDefaultAudioInputStream(audio_manager_.get())); EXPECT_TRUE(ais->Open()); MockAudioInputCallback sink; ais->Start(&sink); @@ -303,11 +316,10 @@ } // Test Open(), Start(), Stop(), Close() calling sequence. -TEST(WinAudioInputTest, WASAPIAudioInputStreamOpenStartStopAndClose) { - scoped_ptr<AudioManager> audio_manager(AudioManager::CreateForTesting()); - ABORT_AUDIO_TEST_IF_NOT(HasCoreAudioAndInputDevices(audio_manager.get())); +TEST_F(WinAudioInputTest, WASAPIAudioInputStreamOpenStartStopAndClose) { + ABORT_AUDIO_TEST_IF_NOT(HasCoreAudioAndInputDevices(audio_manager_.get())); ScopedAudioInputStream ais( - CreateDefaultAudioInputStream(audio_manager.get())); + CreateDefaultAudioInputStream(audio_manager_.get())); EXPECT_TRUE(ais->Open()); MockAudioInputCallback sink; ais->Start(&sink); @@ -316,11 +328,10 @@ } // Test some additional calling sequences. -TEST(WinAudioInputTest, WASAPIAudioInputStreamMiscCallingSequences) { - scoped_ptr<AudioManager> audio_manager(AudioManager::CreateForTesting()); - ABORT_AUDIO_TEST_IF_NOT(HasCoreAudioAndInputDevices(audio_manager.get())); +TEST_F(WinAudioInputTest, WASAPIAudioInputStreamMiscCallingSequences) { + ABORT_AUDIO_TEST_IF_NOT(HasCoreAudioAndInputDevices(audio_manager_.get())); ScopedAudioInputStream ais( - CreateDefaultAudioInputStream(audio_manager.get())); + CreateDefaultAudioInputStream(audio_manager_.get())); WASAPIAudioInputStream* wais = static_cast<WASAPIAudioInputStream*>(ais.get()); @@ -344,18 +355,16 @@ ais.Close(); } -TEST(WinAudioInputTest, WASAPIAudioInputStreamTestPacketSizes) { - scoped_ptr<AudioManager> audio_manager(AudioManager::CreateForTesting()); - ABORT_AUDIO_TEST_IF_NOT(HasCoreAudioAndInputDevices(audio_manager.get())); +TEST_F(WinAudioInputTest, WASAPIAudioInputStreamTestPacketSizes) { + ABORT_AUDIO_TEST_IF_NOT(HasCoreAudioAndInputDevices(audio_manager_.get())); int count = 0; - base::MessageLoopForUI loop; // 10 ms packet size. // Create default WASAPI input stream which records in stereo using // the shared mixing rate. The default buffer size is 10ms. - AudioInputStreamWrapper aisw(audio_manager.get()); + AudioInputStreamWrapper aisw(audio_manager_.get()); ScopedAudioInputStream ais(aisw.Create()); EXPECT_TRUE(ais->Open()); @@ -370,9 +379,9 @@ // estimate. EXPECT_CALL(sink, OnData(ais.get(), NotNull(), _, _)) .Times(AtLeast(10)) - .WillRepeatedly(CheckCountAndPostQuitTask(&count, 10, &loop)); + .WillRepeatedly(CheckCountAndPostQuitTask(&count, 10, &message_loop_)); ais->Start(&sink); - loop.Run(); + message_loop_.Run(); ais->Stop(); // Store current packet size (to be used in the subsequent tests). @@ -390,9 +399,9 @@ EXPECT_CALL(sink, OnData(ais.get(), NotNull(), _, _)) .Times(AtLeast(10)) - .WillRepeatedly(CheckCountAndPostQuitTask(&count, 10, &loop)); + .WillRepeatedly(CheckCountAndPostQuitTask(&count, 10, &message_loop_)); ais->Start(&sink); - loop.Run(); + message_loop_.Run(); ais->Stop(); ais.Close(); @@ -406,29 +415,28 @@ EXPECT_CALL(sink, OnData(ais.get(), NotNull(), _, _)) .Times(AtLeast(10)) - .WillRepeatedly(CheckCountAndPostQuitTask(&count, 10, &loop)); + .WillRepeatedly(CheckCountAndPostQuitTask(&count, 10, &message_loop_)); ais->Start(&sink); - loop.Run(); + message_loop_.Run(); ais->Stop(); ais.Close(); } // Test that we can capture a stream in loopback. -TEST(WinAudioInputTest, WASAPIAudioInputStreamLoopback) { - scoped_ptr<AudioManager> audio_manager(AudioManager::CreateForTesting()); - ABORT_AUDIO_TEST_IF_NOT(audio_manager->HasAudioOutputDevices() && +TEST_F(WinAudioInputTest, WASAPIAudioInputStreamLoopback) { + ABORT_AUDIO_TEST_IF_NOT(audio_manager_->HasAudioOutputDevices() && CoreAudioUtil::IsSupported()); - AudioParameters params = audio_manager->GetInputStreamParameters( + AudioParameters params = audio_manager_->GetInputStreamParameters( AudioManagerBase::kLoopbackInputDeviceId); EXPECT_EQ(params.effects(), 0); AudioParameters output_params = - audio_manager->GetOutputStreamParameters(std::string()); + audio_manager_->GetOutputStreamParameters(std::string()); EXPECT_EQ(params.sample_rate(), output_params.sample_rate()); EXPECT_EQ(params.channel_layout(), output_params.channel_layout()); - ScopedAudioInputStream stream(audio_manager->MakeAudioInputStream( + ScopedAudioInputStream stream(audio_manager_->MakeAudioInputStream( params, AudioManagerBase::kLoopbackInputDeviceId)); ASSERT_TRUE(stream->Open()); FakeAudioInputCallback sink; @@ -448,16 +456,15 @@ // To include disabled tests in test execution, just invoke the test program // with --gtest_also_run_disabled_tests or set the GTEST_ALSO_RUN_DISABLED_TESTS // environment variable to a value greater than 0. -TEST(WinAudioInputTest, DISABLED_WASAPIAudioInputStreamRecordToFile) { - scoped_ptr<AudioManager> audio_manager(AudioManager::CreateForTesting()); - ABORT_AUDIO_TEST_IF_NOT(HasCoreAudioAndInputDevices(audio_manager.get())); +TEST_F(WinAudioInputTest, DISABLED_WASAPIAudioInputStreamRecordToFile) { + ABORT_AUDIO_TEST_IF_NOT(HasCoreAudioAndInputDevices(audio_manager_.get())); // Name of the output PCM file containing captured data. The output file // will be stored in the directory containing 'media_unittests.exe'. // Example of full name: \src\build\Debug\out_stereo_10sec.pcm. const char* file_name = "out_stereo_10sec.pcm"; - AudioInputStreamWrapper aisw(audio_manager.get()); + AudioInputStreamWrapper aisw(audio_manager_.get()); ScopedAudioInputStream ais(aisw.Create()); EXPECT_TRUE(ais->Open());
diff --git a/media/audio/win/audio_low_latency_output_win_unittest.cc b/media/audio/win/audio_low_latency_output_win_unittest.cc index 5b748e7f..c8c6bdf 100644 --- a/media/audio/win/audio_low_latency_output_win_unittest.cc +++ b/media/audio/win/audio_low_latency_output_win_unittest.cc
@@ -16,7 +16,6 @@ #include "base/time/time.h" #include "base/win/scoped_com_initializer.h" #include "media/audio/audio_io.h" -#include "media/audio/audio_manager.h" #include "media/audio/audio_manager_base.h" #include "media/audio/audio_unittest_util.h" #include "media/audio/mock_audio_source_callback.h" @@ -228,16 +227,32 @@ return aos; } +class WASAPIAudioOutputStreamTest : public ::testing::Test { + public: + WASAPIAudioOutputStreamTest() { + audio_manager_ = + AudioManager::CreateForTesting(message_loop_.task_runner()); + message_loop_.RunUntilIdle(); + } + ~WASAPIAudioOutputStreamTest() override { + audio_manager_.reset(); + message_loop_.RunUntilIdle(); + } + + protected: + base::MessageLoopForUI message_loop_; + ScopedAudioManagerPtr audio_manager_; +}; + // Verify that we can retrieve the current hardware/mixing sample rate // for the default audio device. // TODO(henrika): modify this test when we support full device enumeration. -TEST(WASAPIAudioOutputStreamTest, HardwareSampleRate) { +TEST_F(WASAPIAudioOutputStreamTest, HardwareSampleRate) { // Skip this test in exclusive mode since the resulting rate is only utilized // for shared mode streams. if (ExclusiveModeIsEnabled()) return; - scoped_ptr<AudioManager> audio_manager(AudioManager::CreateForTesting()); - ABORT_AUDIO_TEST_IF_NOT(HasCoreAudioAndOutputDevices(audio_manager.get())); + ABORT_AUDIO_TEST_IF_NOT(HasCoreAudioAndOutputDevices(audio_manager_.get())); // Default device intended for games, system notification sounds, // and voice commands. @@ -247,27 +262,24 @@ } // Test Create(), Close() calling sequence. -TEST(WASAPIAudioOutputStreamTest, CreateAndClose) { - scoped_ptr<AudioManager> audio_manager(AudioManager::CreateForTesting()); - ABORT_AUDIO_TEST_IF_NOT(HasCoreAudioAndOutputDevices(audio_manager.get())); - AudioOutputStream* aos = CreateDefaultAudioOutputStream(audio_manager.get()); +TEST_F(WASAPIAudioOutputStreamTest, CreateAndClose) { + ABORT_AUDIO_TEST_IF_NOT(HasCoreAudioAndOutputDevices(audio_manager_.get())); + AudioOutputStream* aos = CreateDefaultAudioOutputStream(audio_manager_.get()); aos->Close(); } // Test Open(), Close() calling sequence. -TEST(WASAPIAudioOutputStreamTest, OpenAndClose) { - scoped_ptr<AudioManager> audio_manager(AudioManager::CreateForTesting()); - ABORT_AUDIO_TEST_IF_NOT(HasCoreAudioAndOutputDevices(audio_manager.get())); - AudioOutputStream* aos = CreateDefaultAudioOutputStream(audio_manager.get()); +TEST_F(WASAPIAudioOutputStreamTest, OpenAndClose) { + ABORT_AUDIO_TEST_IF_NOT(HasCoreAudioAndOutputDevices(audio_manager_.get())); + AudioOutputStream* aos = CreateDefaultAudioOutputStream(audio_manager_.get()); EXPECT_TRUE(aos->Open()); aos->Close(); } // Test Open(), Start(), Close() calling sequence. -TEST(WASAPIAudioOutputStreamTest, OpenStartAndClose) { - scoped_ptr<AudioManager> audio_manager(AudioManager::CreateForTesting()); - ABORT_AUDIO_TEST_IF_NOT(HasCoreAudioAndOutputDevices(audio_manager.get())); - AudioOutputStream* aos = CreateDefaultAudioOutputStream(audio_manager.get()); +TEST_F(WASAPIAudioOutputStreamTest, OpenStartAndClose) { + ABORT_AUDIO_TEST_IF_NOT(HasCoreAudioAndOutputDevices(audio_manager_.get())); + AudioOutputStream* aos = CreateDefaultAudioOutputStream(audio_manager_.get()); EXPECT_TRUE(aos->Open()); MockAudioSourceCallback source; EXPECT_CALL(source, OnError(aos)) @@ -277,10 +289,9 @@ } // Test Open(), Start(), Stop(), Close() calling sequence. -TEST(WASAPIAudioOutputStreamTest, OpenStartStopAndClose) { - scoped_ptr<AudioManager> audio_manager(AudioManager::CreateForTesting()); - ABORT_AUDIO_TEST_IF_NOT(HasCoreAudioAndOutputDevices(audio_manager.get())); - AudioOutputStream* aos = CreateDefaultAudioOutputStream(audio_manager.get()); +TEST_F(WASAPIAudioOutputStreamTest, OpenStartStopAndClose) { + ABORT_AUDIO_TEST_IF_NOT(HasCoreAudioAndOutputDevices(audio_manager_.get())); + AudioOutputStream* aos = CreateDefaultAudioOutputStream(audio_manager_.get()); EXPECT_TRUE(aos->Open()); MockAudioSourceCallback source; EXPECT_CALL(source, OnError(aos)) @@ -291,10 +302,9 @@ } // Test SetVolume(), GetVolume() -TEST(WASAPIAudioOutputStreamTest, Volume) { - scoped_ptr<AudioManager> audio_manager(AudioManager::CreateForTesting()); - ABORT_AUDIO_TEST_IF_NOT(HasCoreAudioAndOutputDevices(audio_manager.get())); - AudioOutputStream* aos = CreateDefaultAudioOutputStream(audio_manager.get()); +TEST_F(WASAPIAudioOutputStreamTest, Volume) { + ABORT_AUDIO_TEST_IF_NOT(HasCoreAudioAndOutputDevices(audio_manager_.get())); + AudioOutputStream* aos = CreateDefaultAudioOutputStream(audio_manager_.get()); // Initial volume should be full volume (1.0). double volume = 0.0; @@ -327,11 +337,10 @@ } // Test some additional calling sequences. -TEST(WASAPIAudioOutputStreamTest, MiscCallingSequences) { - scoped_ptr<AudioManager> audio_manager(AudioManager::CreateForTesting()); - ABORT_AUDIO_TEST_IF_NOT(HasCoreAudioAndOutputDevices(audio_manager.get())); +TEST_F(WASAPIAudioOutputStreamTest, MiscCallingSequences) { + ABORT_AUDIO_TEST_IF_NOT(HasCoreAudioAndOutputDevices(audio_manager_.get())); - AudioOutputStream* aos = CreateDefaultAudioOutputStream(audio_manager.get()); + AudioOutputStream* aos = CreateDefaultAudioOutputStream(audio_manager_.get()); WASAPIAudioOutputStream* waos = static_cast<WASAPIAudioOutputStream*>(aos); // Open(), Open() is a valid calling sequence (second call does nothing). @@ -366,16 +375,13 @@ } // Use preferred packet size and verify that rendering starts. -TEST(WASAPIAudioOutputStreamTest, ValidPacketSize) { - scoped_ptr<AudioManager> audio_manager(AudioManager::CreateForTesting()); - ABORT_AUDIO_TEST_IF_NOT(HasCoreAudioAndOutputDevices(audio_manager.get())); +TEST_F(WASAPIAudioOutputStreamTest, ValidPacketSize) { + ABORT_AUDIO_TEST_IF_NOT(HasCoreAudioAndOutputDevices(audio_manager_.get())); - base::MessageLoopForUI loop; MockAudioSourceCallback source; - // Create default WASAPI output stream which plays out in stereo using // the shared mixing rate. The default buffer size is 10ms. - AudioOutputStreamWrapper aosw(audio_manager.get()); + AudioOutputStreamWrapper aosw(audio_manager_.get()); AudioOutputStream* aos = aosw.Create(); EXPECT_TRUE(aos->Open()); @@ -386,14 +392,15 @@ // Wait for the first callback and verify its parameters. Ignore any // subsequent callbacks that might arrive. EXPECT_CALL(source, OnMoreData(NotNull(), HasValidDelay(bytes_per_packet), 0)) - .WillOnce(DoAll(QuitLoop(loop.task_runner()), + .WillOnce(DoAll(QuitLoop(message_loop_.task_runner()), Return(aosw.samples_per_packet()))) .WillRepeatedly(Return(0)); aos->Start(&source); - loop.PostDelayedTask(FROM_HERE, base::MessageLoop::QuitWhenIdleClosure(), - TestTimeouts::action_timeout()); - loop.Run(); + message_loop_.PostDelayedTask(FROM_HERE, + base::MessageLoop::QuitWhenIdleClosure(), + TestTimeouts::action_timeout()); + message_loop_.Run(); aos->Stop(); aos->Close(); } @@ -405,11 +412,10 @@ // with --gtest_also_run_disabled_tests or set the GTEST_ALSO_RUN_DISABLED_TESTS // environment variable to a value greater than 0. // The test files are approximately 20 seconds long. -TEST(WASAPIAudioOutputStreamTest, DISABLED_ReadFromStereoFile) { - scoped_ptr<AudioManager> audio_manager(AudioManager::CreateForTesting()); - ABORT_AUDIO_TEST_IF_NOT(HasCoreAudioAndOutputDevices(audio_manager.get())); +TEST_F(WASAPIAudioOutputStreamTest, DISABLED_ReadFromStereoFile) { + ABORT_AUDIO_TEST_IF_NOT(HasCoreAudioAndOutputDevices(audio_manager_.get())); - AudioOutputStreamWrapper aosw(audio_manager.get()); + AudioOutputStreamWrapper aosw(audio_manager_.get()); AudioOutputStream* aos = aosw.Create(); EXPECT_TRUE(aos->Open()); @@ -455,12 +461,11 @@ // The expected outcomes of each setting in this test has been derived // manually using log outputs (--v=1). // It's disabled by default because a flag is required to enable exclusive mode. -TEST(WASAPIAudioOutputStreamTest, DISABLED_ExclusiveModeBufferSizesAt48kHz) { - scoped_ptr<AudioManager> audio_manager(AudioManager::CreateForTesting()); - ABORT_AUDIO_TEST_IF_NOT(HasCoreAudioAndOutputDevices(audio_manager.get()) && +TEST_F(WASAPIAudioOutputStreamTest, DISABLED_ExclusiveModeBufferSizesAt48kHz) { + ABORT_AUDIO_TEST_IF_NOT(HasCoreAudioAndOutputDevices(audio_manager_.get()) && ExclusiveModeIsEnabled()); - AudioOutputStreamWrapper aosw(audio_manager.get()); + AudioOutputStreamWrapper aosw(audio_manager_.get()); // 10ms @ 48kHz shall work. // Note that, this is the same size as we can use for shared-mode streaming @@ -504,12 +509,11 @@ // The expected outcomes of each setting in this test has been derived // manually using log outputs (--v=1). // It's disabled by default because a flag is required to enable exclusive mode. -TEST(WASAPIAudioOutputStreamTest, DISABLED_ExclusiveModeBufferSizesAt44kHz) { - scoped_ptr<AudioManager> audio_manager(AudioManager::CreateForTesting()); - ABORT_AUDIO_TEST_IF_NOT(HasCoreAudioAndOutputDevices(audio_manager.get()) && +TEST_F(WASAPIAudioOutputStreamTest, DISABLED_ExclusiveModeBufferSizesAt44kHz) { + ABORT_AUDIO_TEST_IF_NOT(HasCoreAudioAndOutputDevices(audio_manager_.get()) && ExclusiveModeIsEnabled()); - AudioOutputStreamWrapper aosw(audio_manager.get()); + AudioOutputStreamWrapper aosw(audio_manager_.get()); // 10ms @ 44.1kHz does not work due to misalignment. // This test will propose an aligned buffer size of 10.1587ms. @@ -560,17 +564,15 @@ // Verify that we can open and start the output stream in exclusive mode at // the lowest possible delay at 48kHz. // It's disabled by default because a flag is required to enable exclusive mode. -TEST(WASAPIAudioOutputStreamTest, DISABLED_ExclusiveModeMinBufferSizeAt48kHz) { - scoped_ptr<AudioManager> audio_manager(AudioManager::CreateForTesting()); - ABORT_AUDIO_TEST_IF_NOT(HasCoreAudioAndOutputDevices(audio_manager.get()) && +TEST_F(WASAPIAudioOutputStreamTest, + DISABLED_ExclusiveModeMinBufferSizeAt48kHz) { + ABORT_AUDIO_TEST_IF_NOT(HasCoreAudioAndOutputDevices(audio_manager_.get()) && ExclusiveModeIsEnabled()); - base::MessageLoopForUI loop; MockAudioSourceCallback source; - // Create exclusive-mode WASAPI output stream which plays out in stereo // using the minimum buffer size at 48kHz sample rate. - AudioOutputStreamWrapper aosw(audio_manager.get()); + AudioOutputStreamWrapper aosw(audio_manager_.get()); AudioOutputStream* aos = aosw.Create(48000, 160); EXPECT_TRUE(aos->Open()); @@ -580,14 +582,15 @@ // Wait for the first callback and verify its parameters. EXPECT_CALL(source, OnMoreData(NotNull(), HasValidDelay(bytes_per_packet), 0)) - .WillOnce(DoAll(QuitLoop(loop.task_runner()), + .WillOnce(DoAll(QuitLoop(message_loop_.task_runner()), Return(aosw.samples_per_packet()))) .WillRepeatedly(Return(aosw.samples_per_packet())); aos->Start(&source); - loop.PostDelayedTask(FROM_HERE, base::MessageLoop::QuitWhenIdleClosure(), - TestTimeouts::action_timeout()); - loop.Run(); + message_loop_.PostDelayedTask(FROM_HERE, + base::MessageLoop::QuitWhenIdleClosure(), + TestTimeouts::action_timeout()); + message_loop_.Run(); aos->Stop(); aos->Close(); } @@ -595,16 +598,14 @@ // Verify that we can open and start the output stream in exclusive mode at // the lowest possible delay at 44.1kHz. // It's disabled by default because a flag is required to enable exclusive mode. -TEST(WASAPIAudioOutputStreamTest, DISABLED_ExclusiveModeMinBufferSizeAt44kHz) { +TEST_F(WASAPIAudioOutputStreamTest, + DISABLED_ExclusiveModeMinBufferSizeAt44kHz) { ABORT_AUDIO_TEST_IF_NOT(ExclusiveModeIsEnabled()); - scoped_ptr<AudioManager> audio_manager(AudioManager::CreateForTesting()); - base::MessageLoopForUI loop; MockAudioSourceCallback source; - // Create exclusive-mode WASAPI output stream which plays out in stereo // using the minimum buffer size at 44.1kHz sample rate. - AudioOutputStreamWrapper aosw(audio_manager.get()); + AudioOutputStreamWrapper aosw(audio_manager_.get()); AudioOutputStream* aos = aosw.Create(44100, 160); EXPECT_TRUE(aos->Open()); @@ -614,14 +615,15 @@ // Wait for the first callback and verify its parameters. EXPECT_CALL(source, OnMoreData(NotNull(), HasValidDelay(bytes_per_packet), 0)) - .WillOnce(DoAll(QuitLoop(loop.task_runner()), + .WillOnce(DoAll(QuitLoop(message_loop_.task_runner()), Return(aosw.samples_per_packet()))) .WillRepeatedly(Return(aosw.samples_per_packet())); aos->Start(&source); - loop.PostDelayedTask(FROM_HERE, base::MessageLoop::QuitWhenIdleClosure(), - TestTimeouts::action_timeout()); - loop.Run(); + message_loop_.PostDelayedTask(FROM_HERE, + base::MessageLoop::QuitWhenIdleClosure(), + TestTimeouts::action_timeout()); + message_loop_.Run(); aos->Stop(); aos->Close(); }
diff --git a/media/audio/win/audio_manager_win.cc b/media/audio/win/audio_manager_win.cc index a3d5ead..df7faf4 100644 --- a/media/audio/win/audio_manager_win.cc +++ b/media/audio/win/audio_manager_win.cc
@@ -126,14 +126,19 @@ return (base::win::GetVersion() == base::win::VERSION_VISTA) ? 4 : 3; } -AudioManagerWin::AudioManagerWin(AudioLogFactory* audio_log_factory) - : AudioManagerBase(audio_log_factory), +AudioManagerWin::AudioManagerWin( + scoped_refptr<base::SingleThreadTaskRunner> task_runner, + scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner, + AudioLogFactory* audio_log_factory) + : AudioManagerBase(std::move(task_runner), + std::move(worker_task_runner), + audio_log_factory), // |CoreAudioUtil::IsSupported()| uses static variables to avoid doing // multiple initializations. This is however not thread safe. // So, here we call it explicitly before we kick off the audio thread // or do any other work. - enumeration_type_(CoreAudioUtil::IsSupported() ? - kMMDeviceEnumeration : kWaveEnumeration) { + enumeration_type_(CoreAudioUtil::IsSupported() ? kMMDeviceEnumeration + : kWaveEnumeration) { SetMaxOutputStreamsAllowed(kMaxOutputStreams); // WARNING: This is executed on the UI loop, do not add any code here which @@ -147,10 +152,6 @@ } AudioManagerWin::~AudioManagerWin() { - // It's safe to post a task here since Shutdown() will wait for all tasks to - // complete before returning. - GetTaskRunner()->PostTask(FROM_HERE, base::Bind( - &AudioManagerWin::ShutdownOnAudioThread, base::Unretained(this))); Shutdown(); } @@ -174,11 +175,6 @@ } } -void AudioManagerWin::ShutdownOnAudioThread() { - DCHECK(GetTaskRunner()->BelongsToCurrentThread()); - output_device_listener_.reset(); -} - base::string16 AudioManagerWin::GetAudioInputDeviceModel() { // Get the default audio capture device and its device interface name. DWORD device_id = 0; @@ -537,8 +533,13 @@ } /// static -AudioManager* CreateAudioManager(AudioLogFactory* audio_log_factory) { - return new AudioManagerWin(audio_log_factory); +ScopedAudioManagerPtr CreateAudioManager( + scoped_refptr<base::SingleThreadTaskRunner> task_runner, + scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner, + AudioLogFactory* audio_log_factory) { + return ScopedAudioManagerPtr( + new AudioManagerWin(std::move(task_runner), std::move(worker_task_runner), + audio_log_factory)); } } // namespace media
diff --git a/media/audio/win/audio_manager_win.h b/media/audio/win/audio_manager_win.h index 583a98b..66b24260 100644 --- a/media/audio/win/audio_manager_win.h +++ b/media/audio/win/audio_manager_win.h
@@ -19,7 +19,10 @@ // the AudioManager class. class MEDIA_EXPORT AudioManagerWin : public AudioManagerBase { public: - AudioManagerWin(AudioLogFactory* audio_log_factory); + AudioManagerWin( + scoped_refptr<base::SingleThreadTaskRunner> task_runner, + scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner, + AudioLogFactory* audio_log_factory); // Implementation of AudioManager. bool HasAudioOutputDevices() override; @@ -85,7 +88,6 @@ // Helper methods for performing expensive initialization tasks on the audio // thread instead of on the UI thread which AudioManager is constructed on. void InitializeOnAudioThread(); - void ShutdownOnAudioThread(); void GetAudioDeviceNamesImpl(bool input, AudioDeviceNames* device_names);
diff --git a/media/audio/win/audio_output_win_unittest.cc b/media/audio/win/audio_output_win_unittest.cc index 0c59d9b3..8fca2f55 100644 --- a/media/audio/win/audio_output_win_unittest.cc +++ b/media/audio/win/audio_output_win_unittest.cc
@@ -9,6 +9,7 @@ #include "base/base_paths.h" #include "base/memory/aligned_memory.h" +#include "base/message_loop/message_loop.h" #include "base/sync_socket.h" #include "base/win/scoped_com_initializer.h" #include "base/win/windows_version.h" @@ -143,6 +144,23 @@ uint32_t size_; }; +class WinAudioTest : public ::testing::Test { + public: + WinAudioTest() { + audio_manager_ = + AudioManager::CreateForTesting(message_loop_.task_runner()); + message_loop_.RunUntilIdle(); + } + ~WinAudioTest() override { + audio_manager_.reset(); + message_loop_.RunUntilIdle(); + } + + protected: + base::MessageLoop message_loop_; + ScopedAudioManagerPtr audio_manager_; +}; + // =========================================================================== // Validation of AudioManager::AUDIO_PCM_LINEAR // @@ -152,11 +170,10 @@ // at some point, possibly when the connection goes idle. // Test that can it be created and closed. -TEST(WinAudioTest, PCMWaveStreamGetAndClose) { - scoped_ptr<AudioManager> audio_man(AudioManager::CreateForTesting()); - ABORT_AUDIO_TEST_IF_NOT(audio_man->HasAudioOutputDevices()); +TEST_F(WinAudioTest, PCMWaveStreamGetAndClose) { + ABORT_AUDIO_TEST_IF_NOT(audio_manager_->HasAudioOutputDevices()); - AudioOutputStream* oas = audio_man->MakeAudioOutputStream( + AudioOutputStream* oas = audio_manager_->MakeAudioOutputStream( AudioParameters(AudioParameters::AUDIO_PCM_LINEAR, CHANNEL_LAYOUT_STEREO, 8000, 16, 256), std::string()); @@ -165,44 +182,53 @@ } // Test that can it be cannot be created with invalid parameters. -TEST(WinAudioTest, SanityOnMakeParams) { - scoped_ptr<AudioManager> audio_man(AudioManager::CreateForTesting()); - ABORT_AUDIO_TEST_IF_NOT(audio_man->HasAudioOutputDevices()); +TEST_F(WinAudioTest, SanityOnMakeParams) { + ABORT_AUDIO_TEST_IF_NOT(audio_manager_->HasAudioOutputDevices()); AudioParameters::Format fmt = AudioParameters::AUDIO_PCM_LINEAR; - EXPECT_TRUE(NULL == audio_man->MakeAudioOutputStream( - AudioParameters(fmt, CHANNEL_LAYOUT_UNSUPPORTED, 8000, 16, 256), - std::string())); - EXPECT_TRUE(NULL == audio_man->MakeAudioOutputStream( - AudioParameters(fmt, CHANNEL_LAYOUT_MONO, 1024 * 1024, 16, 256), - std::string())); - EXPECT_TRUE(NULL == audio_man->MakeAudioOutputStream( - AudioParameters(fmt, CHANNEL_LAYOUT_STEREO, 8000, 80, 256), - std::string())); - EXPECT_TRUE(NULL == audio_man->MakeAudioOutputStream( - AudioParameters(fmt, CHANNEL_LAYOUT_UNSUPPORTED, 8000, 16, 256), - std::string())); - EXPECT_TRUE(NULL == audio_man->MakeAudioOutputStream( - AudioParameters(fmt, CHANNEL_LAYOUT_STEREO, -8000, 16, 256), - std::string())); - EXPECT_TRUE(NULL == audio_man->MakeAudioOutputStream( - AudioParameters(fmt, CHANNEL_LAYOUT_MONO, 8000, 16, -100), - std::string())); - EXPECT_TRUE(NULL == audio_man->MakeAudioOutputStream( - AudioParameters(fmt, CHANNEL_LAYOUT_MONO, 8000, 16, 0), - std::string())); - EXPECT_TRUE(NULL == audio_man->MakeAudioOutputStream( - AudioParameters(fmt, CHANNEL_LAYOUT_MONO, 8000, 16, - media::limits::kMaxSamplesPerPacket + 1), - std::string())); + EXPECT_TRUE( + NULL == + audio_manager_->MakeAudioOutputStream( + AudioParameters(fmt, CHANNEL_LAYOUT_UNSUPPORTED, 8000, 16, 256), + std::string())); + EXPECT_TRUE( + NULL == + audio_manager_->MakeAudioOutputStream( + AudioParameters(fmt, CHANNEL_LAYOUT_MONO, 1024 * 1024, 16, 256), + std::string())); + EXPECT_TRUE(NULL == + audio_manager_->MakeAudioOutputStream( + AudioParameters(fmt, CHANNEL_LAYOUT_STEREO, 8000, 80, 256), + std::string())); + EXPECT_TRUE( + NULL == + audio_manager_->MakeAudioOutputStream( + AudioParameters(fmt, CHANNEL_LAYOUT_UNSUPPORTED, 8000, 16, 256), + std::string())); + EXPECT_TRUE(NULL == + audio_manager_->MakeAudioOutputStream( + AudioParameters(fmt, CHANNEL_LAYOUT_STEREO, -8000, 16, 256), + std::string())); + EXPECT_TRUE(NULL == + audio_manager_->MakeAudioOutputStream( + AudioParameters(fmt, CHANNEL_LAYOUT_MONO, 8000, 16, -100), + std::string())); + EXPECT_TRUE(NULL == + audio_manager_->MakeAudioOutputStream( + AudioParameters(fmt, CHANNEL_LAYOUT_MONO, 8000, 16, 0), + std::string())); + EXPECT_TRUE(NULL == + audio_manager_->MakeAudioOutputStream( + AudioParameters(fmt, CHANNEL_LAYOUT_MONO, 8000, 16, + media::limits::kMaxSamplesPerPacket + 1), + std::string())); } // Test that it can be opened and closed. -TEST(WinAudioTest, PCMWaveStreamOpenAndClose) { - scoped_ptr<AudioManager> audio_man(AudioManager::CreateForTesting()); - ABORT_AUDIO_TEST_IF_NOT(audio_man->HasAudioOutputDevices()); +TEST_F(WinAudioTest, PCMWaveStreamOpenAndClose) { + ABORT_AUDIO_TEST_IF_NOT(audio_manager_->HasAudioOutputDevices()); - AudioOutputStream* oas = audio_man->MakeAudioOutputStream( + AudioOutputStream* oas = audio_manager_->MakeAudioOutputStream( AudioParameters(AudioParameters::AUDIO_PCM_LINEAR, CHANNEL_LAYOUT_STEREO, 8000, 16, 256), std::string()); @@ -212,11 +238,10 @@ } // Test that it has a maximum packet size. -TEST(WinAudioTest, PCMWaveStreamOpenLimit) { - scoped_ptr<AudioManager> audio_man(AudioManager::CreateForTesting()); - ABORT_AUDIO_TEST_IF_NOT(audio_man->HasAudioOutputDevices()); +TEST_F(WinAudioTest, PCMWaveStreamOpenLimit) { + ABORT_AUDIO_TEST_IF_NOT(audio_manager_->HasAudioOutputDevices()); - AudioOutputStream* oas = audio_man->MakeAudioOutputStream( + AudioOutputStream* oas = audio_manager_->MakeAudioOutputStream( AudioParameters(AudioParameters::AUDIO_PCM_LINEAR, CHANNEL_LAYOUT_STEREO, 8000, 16, 1024 * 1024 * 1024), std::string()); @@ -228,11 +253,10 @@ // Test potential deadlock situation if the source is slow or blocks for some // time. The actual EXPECT_GT are mostly meaningless and the real test is that // the test completes in reasonable time. -TEST(WinAudioTest, PCMWaveSlowSource) { - scoped_ptr<AudioManager> audio_man(AudioManager::CreateForTesting()); - ABORT_AUDIO_TEST_IF_NOT(audio_man->HasAudioOutputDevices()); +TEST_F(WinAudioTest, PCMWaveSlowSource) { + ABORT_AUDIO_TEST_IF_NOT(audio_manager_->HasAudioOutputDevices()); - AudioOutputStream* oas = audio_man->MakeAudioOutputStream( + AudioOutputStream* oas = audio_manager_->MakeAudioOutputStream( AudioParameters(AudioParameters::AUDIO_PCM_LINEAR, CHANNEL_LAYOUT_MONO, 16000, 16, 256), std::string()); @@ -253,12 +277,11 @@ // Test another potential deadlock situation if the thread that calls Start() // gets paused. This test is best when run over RDP with audio enabled. See // bug 19276 for more details. -TEST(WinAudioTest, PCMWaveStreamPlaySlowLoop) { - scoped_ptr<AudioManager> audio_man(AudioManager::CreateForTesting()); - ABORT_AUDIO_TEST_IF_NOT(audio_man->HasAudioOutputDevices()); +TEST_F(WinAudioTest, PCMWaveStreamPlaySlowLoop) { + ABORT_AUDIO_TEST_IF_NOT(audio_manager_->HasAudioOutputDevices()); uint32_t samples_100_ms = AudioParameters::kAudioCDSampleRate / 10; - AudioOutputStream* oas = audio_man->MakeAudioOutputStream( + AudioOutputStream* oas = audio_manager_->MakeAudioOutputStream( AudioParameters(AudioParameters::AUDIO_PCM_LINEAR, CHANNEL_LAYOUT_MONO, AudioParameters::kAudioCDSampleRate, 16, samples_100_ms), std::string()); @@ -281,15 +304,14 @@ // This test produces actual audio for .5 seconds on the default wave // device at 44.1K s/sec. Parameters have been chosen carefully so you should // not hear pops or noises while the sound is playing. -TEST(WinAudioTest, PCMWaveStreamPlay200HzTone44Kss) { - scoped_ptr<AudioManager> audio_man(AudioManager::CreateForTesting()); - if (!audio_man->HasAudioOutputDevices()) { +TEST_F(WinAudioTest, PCMWaveStreamPlay200HzTone44Kss) { + if (!audio_manager_->HasAudioOutputDevices()) { LOG(WARNING) << "No output device detected."; return; } uint32_t samples_100_ms = AudioParameters::kAudioCDSampleRate / 10; - AudioOutputStream* oas = audio_man->MakeAudioOutputStream( + AudioOutputStream* oas = audio_manager_->MakeAudioOutputStream( AudioParameters(AudioParameters::AUDIO_PCM_LINEAR, CHANNEL_LAYOUT_MONO, AudioParameters::kAudioCDSampleRate, 16, samples_100_ms), std::string()); @@ -309,12 +331,11 @@ // device at 22K s/sec. Parameters have been chosen carefully so you should // not hear pops or noises while the sound is playing. The audio also should // sound with a lower volume than PCMWaveStreamPlay200HzTone44Kss. -TEST(WinAudioTest, PCMWaveStreamPlay200HzTone22Kss) { - scoped_ptr<AudioManager> audio_man(AudioManager::CreateForTesting()); - ABORT_AUDIO_TEST_IF_NOT(audio_man->HasAudioOutputDevices()); +TEST_F(WinAudioTest, PCMWaveStreamPlay200HzTone22Kss) { + ABORT_AUDIO_TEST_IF_NOT(audio_manager_->HasAudioOutputDevices()); uint32_t samples_100_ms = AudioParameters::kAudioCDSampleRate / 20; - AudioOutputStream* oas = audio_man->MakeAudioOutputStream( + AudioOutputStream* oas = audio_manager_->MakeAudioOutputStream( AudioParameters(AudioParameters::AUDIO_PCM_LINEAR, CHANNEL_LAYOUT_MONO, AudioParameters::kAudioCDSampleRate / 2, 16, samples_100_ms), @@ -341,9 +362,8 @@ // Uses a restricted source to play ~2 seconds of audio for about 5 seconds. We // try hard to generate situation where the two threads are accessing the // object roughly at the same time. -TEST(WinAudioTest, PushSourceFile16KHz) { - scoped_ptr<AudioManager> audio_man(AudioManager::CreateForTesting()); - ABORT_AUDIO_TEST_IF_NOT(audio_man->HasAudioOutputDevices()); +TEST_F(WinAudioTest, PushSourceFile16KHz) { + ABORT_AUDIO_TEST_IF_NOT(audio_manager_->HasAudioOutputDevices()); static const int kSampleRate = 16000; SineWaveAudioSource source(1, 200.0, kSampleRate); @@ -352,7 +372,7 @@ // Restrict SineWaveAudioSource to 100ms of samples. source.CapSamples(kSamples100ms); - AudioOutputStream* oas = audio_man->MakeAudioOutputStream( + AudioOutputStream* oas = audio_manager_->MakeAudioOutputStream( AudioParameters(AudioParameters::AUDIO_PCM_LINEAR, CHANNEL_LAYOUT_MONO, kSampleRate, 16, kSamples100ms), std::string()); @@ -381,12 +401,11 @@ // This test is to make sure an AudioOutputStream can be started after it was // stopped. You will here two .5 seconds wave signal separated by 0.5 seconds // of silence. -TEST(WinAudioTest, PCMWaveStreamPlayTwice200HzTone44Kss) { - scoped_ptr<AudioManager> audio_man(AudioManager::CreateForTesting()); - ABORT_AUDIO_TEST_IF_NOT(audio_man->HasAudioOutputDevices()); +TEST_F(WinAudioTest, PCMWaveStreamPlayTwice200HzTone44Kss) { + ABORT_AUDIO_TEST_IF_NOT(audio_manager_->HasAudioOutputDevices()); uint32_t samples_100_ms = AudioParameters::kAudioCDSampleRate / 10; - AudioOutputStream* oas = audio_man->MakeAudioOutputStream( + AudioOutputStream* oas = audio_manager_->MakeAudioOutputStream( AudioParameters(AudioParameters::AUDIO_PCM_LINEAR, CHANNEL_LAYOUT_MONO, AudioParameters::kAudioCDSampleRate, 16, samples_100_ms), std::string()); @@ -415,21 +434,20 @@ // With the low latency mode, WASAPI is utilized by default for Vista and // higher and Wave is used for XP and lower. It is possible to utilize a // smaller buffer size for WASAPI than for Wave. -TEST(WinAudioTest, PCMWaveStreamPlay200HzToneLowLatency) { - scoped_ptr<AudioManager> audio_man(AudioManager::CreateForTesting()); - ABORT_AUDIO_TEST_IF_NOT(audio_man->HasAudioOutputDevices()); +TEST_F(WinAudioTest, PCMWaveStreamPlay200HzToneLowLatency) { + ABORT_AUDIO_TEST_IF_NOT(audio_manager_->HasAudioOutputDevices()); // Use 10 ms buffer size for WASAPI and 50 ms buffer size for Wave. // Take the existing native sample rate into account. - const AudioParameters params = audio_man->GetDefaultOutputStreamParameters(); + const AudioParameters params = + audio_manager_->GetDefaultOutputStreamParameters(); int sample_rate = params.sample_rate(); uint32_t samples_10_ms = sample_rate / 100; int n = 1; (base::win::GetVersion() <= base::win::VERSION_XP) ? n = 5 : n = 1; - AudioOutputStream* oas = audio_man->MakeAudioOutputStream( + AudioOutputStream* oas = audio_manager_->MakeAudioOutputStream( AudioParameters(AudioParameters::AUDIO_PCM_LOW_LATENCY, - CHANNEL_LAYOUT_MONO, sample_rate, - 16, n * samples_10_ms), + CHANNEL_LAYOUT_MONO, sample_rate, 16, n * samples_10_ms), std::string()); ASSERT_TRUE(NULL != oas); @@ -453,12 +471,11 @@ } // Check that the pending bytes value is correct what the stream starts. -TEST(WinAudioTest, PCMWaveStreamPendingBytes) { - scoped_ptr<AudioManager> audio_man(AudioManager::CreateForTesting()); - ABORT_AUDIO_TEST_IF_NOT(audio_man->HasAudioOutputDevices()); +TEST_F(WinAudioTest, PCMWaveStreamPendingBytes) { + ABORT_AUDIO_TEST_IF_NOT(audio_manager_->HasAudioOutputDevices()); uint32_t samples_100_ms = AudioParameters::kAudioCDSampleRate / 10; - AudioOutputStream* oas = audio_man->MakeAudioOutputStream( + AudioOutputStream* oas = audio_manager_->MakeAudioOutputStream( AudioParameters(AudioParameters::AUDIO_PCM_LINEAR, CHANNEL_LAYOUT_MONO, AudioParameters::kAudioCDSampleRate, 16, samples_100_ms), std::string()); @@ -585,18 +602,16 @@ // principle of the test still remains and we avoid the additional complexity // related to the two different audio-layers for AUDIO_PCM_LOW_LATENCY. // In this test you should hear a continuous 200Hz tone for 2 seconds. -TEST(WinAudioTest, SyncSocketBasic) { - scoped_ptr<AudioManager> audio_man(AudioManager::CreateForTesting()); - ABORT_AUDIO_TEST_IF_NOT(audio_man->HasAudioOutputDevices()); +TEST_F(WinAudioTest, SyncSocketBasic) { + ABORT_AUDIO_TEST_IF_NOT(audio_manager_->HasAudioOutputDevices()); static const int sample_rate = AudioParameters::kAudioCDSampleRate; static const uint32_t kSamples20ms = sample_rate / 50; AudioParameters params(AudioParameters::AUDIO_PCM_LINEAR, CHANNEL_LAYOUT_MONO, sample_rate, 16, kSamples20ms); - - AudioOutputStream* oas = audio_man->MakeAudioOutputStream(params, - std::string()); + AudioOutputStream* oas = + audio_manager_->MakeAudioOutputStream(params, std::string()); ASSERT_TRUE(NULL != oas); ASSERT_TRUE(oas->Open());
diff --git a/media/base/android/java/src/org/chromium/media/MediaCodecUtil.java b/media/base/android/java/src/org/chromium/media/MediaCodecUtil.java index d4f4769..047656d 100644 --- a/media/base/android/java/src/org/chromium/media/MediaCodecUtil.java +++ b/media/base/android/java/src/org/chromium/media/MediaCodecUtil.java
@@ -222,14 +222,14 @@ } // MediaTek decoders do not work properly on vp8. See http://crbug.com/446974 and // http://crbug.com/597836. - if (getDefaultCodecName(mime, MEDIA_CODEC_DECODER).startsWith("OMX.MTK.")) return false; + if (Build.HARDWARE.startsWith("mt")) return false; } else if (mime.equals("video/x-vnd.on2.vp9")) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) return false; // MediaTek decoders do not work properly on vp9 before Lollipop. See // http://crbug.com/597836. if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP - && getDefaultCodecName(mime, MEDIA_CODEC_DECODER).startsWith("OMX.MTK.")) { + && Build.HARDWARE.startsWith("mt")) { return false; } } else if (mime.equals("audio/opus")
diff --git a/media/base/eme_constants.h b/media/base/eme_constants.h index ba49c7d..22fbeba 100644 --- a/media/base/eme_constants.h +++ b/media/base/eme_constants.h
@@ -44,7 +44,8 @@ EME_CODEC_MP4_AAC = 1 << 4, EME_CODEC_MP4_AUDIO_ALL = EME_CODEC_MP4_AAC, EME_CODEC_MP4_AVC1 = 1 << 5, - EME_CODEC_MP4_VIDEO_ALL = EME_CODEC_MP4_AVC1, + EME_CODEC_MP4_VP9 = 1 << 6, + EME_CODEC_MP4_VIDEO_ALL = (EME_CODEC_MP4_AVC1 | EME_CODEC_MP4_VP9), EME_CODEC_MP4_ALL = (EME_CODEC_MP4_AUDIO_ALL | EME_CODEC_MP4_VIDEO_ALL), EME_CODEC_AUDIO_ALL = (EME_CODEC_WEBM_AUDIO_ALL | EME_CODEC_MP4_AUDIO_ALL), EME_CODEC_VIDEO_ALL = (EME_CODEC_WEBM_VIDEO_ALL | EME_CODEC_MP4_VIDEO_ALL),
diff --git a/media/base/key_system_properties.h b/media/base/key_system_properties.h new file mode 100644 index 0000000..935fcb1 --- /dev/null +++ b/media/base/key_system_properties.h
@@ -0,0 +1,61 @@ +// Copyright 2013 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 MEDIA_BASE_KEY_SYSTEM_PROPERTIES_H_ +#define MEDIA_BASE_KEY_SYSTEM_PROPERTIES_H_ + +#include <string> + +#include "media/base/eme_constants.h" +#include "media/base/media_export.h" + +namespace media { + +// Provides an interface for querying the properties of a registered key system. +class MEDIA_EXPORT KeySystemProperties { + public: + virtual ~KeySystemProperties() {} + + // Returns whether |init_data_type| is supported by this key system. + virtual bool IsSupportedInitDataType( + EmeInitDataType init_data_type) const = 0; + + // Returns the codecs supported by this key system. + virtual SupportedCodecs GetSupportedCodecs() const = 0; +#if defined(OS_ANDROID) + // Returns the codecs with hardware-secure support in this key system. + virtual SupportedCodecs GetSupportedSecureCodecs() const = 0; +#endif + + // Returns the configuration rule for supporting a robustness requirement. + virtual EmeConfigRule GetRobustnessConfigRule( + EmeMediaType media_type, + const std::string& requested_robustness) const = 0; + + // Returns the support this key system provides for persistent-license + // sessions. + virtual EmeSessionTypeSupport GetPersistentLicenseSessionSupport() const = 0; + + // Returns the support this key system provides for persistent-release-message + // sessions. + virtual EmeSessionTypeSupport GetPersistentReleaseMessageSessionSupport() + const = 0; + + // Returns the support this key system provides for persistent state. + virtual EmeFeatureSupport GetPersistentStateSupport() const = 0; + + // Returns the support this key system provides for distinctive identifiers. + virtual EmeFeatureSupport GetDistinctiveIdentifierSupport() const = 0; + + // Returns whether AesDecryptor can be used for this key system. + virtual bool UseAesDecryptor() const = 0; + +#if defined(ENABLE_PEPPER_CDMS) + virtual std::string GetPepperType() const = 0; +#endif +}; + +} // namespace media + +#endif // MEDIA_BASE_KEY_SYSTEM_PROPERTIES_H_
diff --git a/media/base/key_systems.cc b/media/base/key_systems.cc index 8a3ae69..5e442a3a 100644 --- a/media/base/key_systems.cc +++ b/media/base/key_systems.cc
@@ -6,6 +6,8 @@ #include <stddef.h> +#include <memory> + #include "base/containers/hash_tables.h" #include "base/lazy_instance.h" #include "base/logging.h" @@ -15,9 +17,11 @@ #include "base/time/time.h" #include "build/build_config.h" #include "media/base/key_system_info.h" +#include "media/base/key_system_properties.h" #include "media/base/media.h" #include "media/base/media_client.h" #include "media/cdm/key_system_names.h" +#include "media/media_features.h" #include "third_party/widevine/cdm/widevine_cdm_common.h" namespace media { @@ -54,6 +58,9 @@ {"vp9", EME_CODEC_WEBM_VP9}, // VP9. {"vp9.0", EME_CODEC_WEBM_VP9}, // VP9. #if defined(USE_PROPRIETARY_CODECS) +#if BUILDFLAG(ENABLE_MP4_VP9_DEMUXING) + {"vp09", EME_CODEC_MP4_VP9}, // VP9 in MP4. +#endif {"mp4a", EME_CODEC_MP4_AAC}, // AAC. {"avc1", EME_CODEC_MP4_AVC1}, // AVC1. {"avc3", EME_CODEC_MP4_AVC1} // AVC3. @@ -166,6 +173,42 @@ return false; } +// TODO(halliwell): remove this before M52. Replace with subclasses that +// directly implement the different cases (e.g. ClearKey, Widevine, Cast). +class InfoBasedKeySystemProperties : public KeySystemProperties { + public: + explicit InfoBasedKeySystemProperties(const KeySystemInfo& info) + : info_(info) {} + + bool IsSupportedInitDataType(EmeInitDataType init_data_type) const override; + + SupportedCodecs GetSupportedCodecs() const override { + return info_.supported_codecs; + } +#if defined(OS_ANDROID) + SupportedCodecs GetSupportedSecureCodecs() const override { + return info_.supported_secure_codecs; + } +#endif + + EmeConfigRule GetRobustnessConfigRule( + EmeMediaType media_type, + const std::string& requested_robustness) const override; + EmeSessionTypeSupport GetPersistentLicenseSessionSupport() const override; + EmeSessionTypeSupport GetPersistentReleaseMessageSessionSupport() + const override; + EmeFeatureSupport GetPersistentStateSupport() const override; + EmeFeatureSupport GetDistinctiveIdentifierSupport() const override; + bool UseAesDecryptor() const override; + +#if defined(ENABLE_PEPPER_CDMS) + std::string GetPepperType() const override; +#endif + + private: + const KeySystemInfo info_; +}; + class KeySystemsImpl : public KeySystems { public: static KeySystemsImpl* GetInstance(); @@ -231,7 +274,8 @@ friend struct base::DefaultLazyInstanceTraits<KeySystemsImpl>; - typedef base::hash_map<std::string, KeySystemInfo> KeySystemInfoMap; + typedef base::hash_map<std::string, std::unique_ptr<KeySystemProperties>> + KeySystemPropertiesMap; typedef base::hash_map<std::string, SupportedCodecs> MimeTypeCodecsMap; typedef base::hash_map<std::string, EmeCodec> CodecsMap; typedef base::hash_map<std::string, EmeInitDataType> InitDataTypesMap; @@ -244,8 +288,8 @@ const std::string& container_mime_type) const; EmeCodec GetCodecForString(const std::string& codec) const; - // Map from key system string to capabilities. - KeySystemInfoMap key_system_map_; + // Map from key system string to KeySystemProperties instance. + KeySystemPropertiesMap key_system_properties_map_; // This member should only be modified by RegisterMimeType(). MimeTypeCodecsMap mime_type_to_codec_mask_map_; @@ -337,7 +381,7 @@ void KeySystemsImpl::UpdateSupportedKeySystems() { DCHECK(thread_checker_.CalledOnValidThread()); - key_system_map_.clear(); + key_system_properties_map_.clear(); // Build KeySystemInfo. std::vector<KeySystemInfo> key_systems_info; @@ -355,7 +399,7 @@ void KeySystemsImpl::AddSupportedKeySystems( const std::vector<KeySystemInfo>& key_systems) { DCHECK(thread_checker_.CalledOnValidThread()); - DCHECK(key_system_map_.empty()); + DCHECK(key_system_properties_map_.empty()); for (const KeySystemInfo& info : key_systems) { DCHECK(!info.key_system.empty()); @@ -408,7 +452,7 @@ EmeFeatureSupport::ALWAYS_ENABLED); } - DCHECK_EQ(key_system_map_.count(info.key_system), 0u) + DCHECK_EQ(key_system_properties_map_.count(info.key_system), 0u) << "Key system '" << info.key_system << "' already registered"; #if defined(OS_ANDROID) @@ -420,7 +464,9 @@ } #endif // defined(OS_ANDROID) - key_system_map_[info.key_system] = info; + std::unique_ptr<KeySystemProperties> properties( + new InfoBasedKeySystemProperties(info)); + key_system_properties_map_[info.key_system] = std::move(properties); } } @@ -457,16 +503,19 @@ EmeInitDataType init_data_type) const { DCHECK(thread_checker_.CalledOnValidThread()); - KeySystemInfoMap::const_iterator key_system_iter = - key_system_map_.find(key_system); - if (key_system_iter == key_system_map_.end()) { + KeySystemPropertiesMap::const_iterator key_system_iter = + key_system_properties_map_.find(key_system); + if (key_system_iter == key_system_properties_map_.end()) { NOTREACHED(); return false; } + return key_system_iter->second->IsSupportedInitDataType(init_data_type); +} +bool InfoBasedKeySystemProperties::IsSupportedInitDataType( + EmeInitDataType init_data_type) const { // Check |init_data_type|. - InitDataTypeMask available_init_data_types = - key_system_iter->second.supported_init_data_types; + InitDataTypeMask available_init_data_types = info_.supported_init_data_types; switch (init_data_type) { case EmeInitDataType::UNKNOWN: return false; @@ -496,29 +545,35 @@ bool KeySystemsImpl::UseAesDecryptor(const std::string& key_system) const { DCHECK(thread_checker_.CalledOnValidThread()); - KeySystemInfoMap::const_iterator key_system_iter = - key_system_map_.find(key_system); - if (key_system_iter == key_system_map_.end()) { + KeySystemPropertiesMap::const_iterator key_system_iter = + key_system_properties_map_.find(key_system); + if (key_system_iter == key_system_properties_map_.end()) { DLOG(ERROR) << key_system << " is not a known system"; return false; } + return key_system_iter->second->UseAesDecryptor(); +} - return key_system_iter->second.use_aes_decryptor; +bool InfoBasedKeySystemProperties::UseAesDecryptor() const { + return info_.use_aes_decryptor; } #if defined(ENABLE_PEPPER_CDMS) std::string KeySystemsImpl::GetPepperType(const std::string& key_system) const { DCHECK(thread_checker_.CalledOnValidThread()); - KeySystemInfoMap::const_iterator key_system_iter = - key_system_map_.find(key_system); - if (key_system_iter == key_system_map_.end()) { + KeySystemPropertiesMap::const_iterator key_system_iter = + key_system_properties_map_.find(key_system); + if (key_system_iter == key_system_properties_map_.end()) { DLOG(FATAL) << key_system << " is not a known system"; return std::string(); } + return key_system_iter->second->GetPepperType(); +} - const std::string& type = key_system_iter->second.pepper_type; - DLOG_IF(FATAL, type.empty()) << key_system << " is not Pepper-based"; +std::string InfoBasedKeySystemProperties::GetPepperType() const { + const std::string& type = info_.pepper_type; + DLOG_IF(FATAL, type.empty()) << info_.key_system << " is not Pepper-based"; return type; } #endif @@ -544,7 +599,7 @@ bool KeySystemsImpl::IsSupportedKeySystem(const std::string& key_system) const { DCHECK(thread_checker_.CalledOnValidThread()); - if (!key_system_map_.count(key_system)) + if (!key_system_properties_map_.count(key_system)) return false; // TODO(ddorwin): Move this to where we add key systems when prefixed EME is @@ -581,20 +636,20 @@ } // Look up the key system's supported codecs. - KeySystemInfoMap::const_iterator key_system_iter = - key_system_map_.find(key_system); - if (key_system_iter == key_system_map_.end()) { + KeySystemPropertiesMap::const_iterator key_system_iter = + key_system_properties_map_.find(key_system); + if (key_system_iter == key_system_properties_map_.end()) { NOTREACHED(); return EmeConfigRule::NOT_SUPPORTED; } + SupportedCodecs key_system_codec_mask = - key_system_iter->second.supported_codecs; + key_system_iter->second->GetSupportedCodecs(); #if defined(OS_ANDROID) SupportedCodecs key_system_secure_codec_mask = - key_system_iter->second.supported_secure_codecs; + key_system_iter->second->GetSupportedSecureCodecs(); #endif // defined(OS_ANDROID) - // Check that the container is supported by the key system. (This check is // necessary because |codecs| may be empty.) SupportedCodecs mime_type_codec_mask = @@ -631,24 +686,30 @@ const std::string& requested_robustness) const { DCHECK(thread_checker_.CalledOnValidThread()); + KeySystemPropertiesMap::const_iterator key_system_iter = + key_system_properties_map_.find(key_system); + if (key_system_iter == key_system_properties_map_.end()) { + NOTREACHED(); + return EmeConfigRule::NOT_SUPPORTED; + } + return key_system_iter->second->GetRobustnessConfigRule(media_type, + requested_robustness); +} + +EmeConfigRule InfoBasedKeySystemProperties::GetRobustnessConfigRule( + EmeMediaType media_type, + const std::string& requested_robustness) const { EmeRobustness robustness = ConvertRobustness(requested_robustness); if (robustness == EmeRobustness::INVALID) return EmeConfigRule::NOT_SUPPORTED; - KeySystemInfoMap::const_iterator key_system_iter = - key_system_map_.find(key_system); - if (key_system_iter == key_system_map_.end()) { - NOTREACHED(); - return EmeConfigRule::NOT_SUPPORTED; - } - EmeRobustness max_robustness = EmeRobustness::INVALID; switch (media_type) { case EmeMediaType::AUDIO: - max_robustness = key_system_iter->second.max_audio_robustness; + max_robustness = info_.max_audio_robustness; break; case EmeMediaType::VIDEO: - max_robustness = key_system_iter->second.max_video_robustness; + max_robustness = info_.max_video_robustness; break; } @@ -664,7 +725,7 @@ } #if defined(OS_CHROMEOS) - if (key_system == kWidevineKeySystem) { + if (info_.key_system == kWidevineKeySystem) { // TODO(ddorwin): Remove this once we have confirmed it is not necessary. // See https://crbug.com/482277 if (robustness == EmeRobustness::EMPTY) @@ -686,9 +747,9 @@ #elif defined(OS_ANDROID) // Require hardware secure codecs for Widevine when SW_SECURE_DECODE or above // is specified, or for all other key systems (excluding Clear Key). - if ((key_system == kWidevineKeySystem && + if ((info_.key_system == kWidevineKeySystem && robustness >= EmeRobustness::SW_SECURE_DECODE) || - !IsClearKey(key_system)) { + !IsClearKey(info_.key_system)) { return EmeConfigRule::HW_SECURE_CODECS_REQUIRED; } #endif // defined(OS_CHROMEOS) @@ -700,52 +761,73 @@ const std::string& key_system) const { DCHECK(thread_checker_.CalledOnValidThread()); - KeySystemInfoMap::const_iterator key_system_iter = - key_system_map_.find(key_system); - if (key_system_iter == key_system_map_.end()) { + KeySystemPropertiesMap::const_iterator key_system_iter = + key_system_properties_map_.find(key_system); + if (key_system_iter == key_system_properties_map_.end()) { NOTREACHED(); return EmeSessionTypeSupport::INVALID; } - return key_system_iter->second.persistent_license_support; + return key_system_iter->second->GetPersistentLicenseSessionSupport(); +} + +EmeSessionTypeSupport +InfoBasedKeySystemProperties::GetPersistentLicenseSessionSupport() const { + return info_.persistent_license_support; } EmeSessionTypeSupport KeySystemsImpl::GetPersistentReleaseMessageSessionSupport( const std::string& key_system) const { DCHECK(thread_checker_.CalledOnValidThread()); - KeySystemInfoMap::const_iterator key_system_iter = - key_system_map_.find(key_system); - if (key_system_iter == key_system_map_.end()) { + KeySystemPropertiesMap::const_iterator key_system_iter = + key_system_properties_map_.find(key_system); + if (key_system_iter == key_system_properties_map_.end()) { NOTREACHED(); return EmeSessionTypeSupport::INVALID; } - return key_system_iter->second.persistent_release_message_support; + return key_system_iter->second->GetPersistentReleaseMessageSessionSupport(); +} + +EmeSessionTypeSupport +InfoBasedKeySystemProperties::GetPersistentReleaseMessageSessionSupport() + const { + return info_.persistent_release_message_support; } EmeFeatureSupport KeySystemsImpl::GetPersistentStateSupport( const std::string& key_system) const { DCHECK(thread_checker_.CalledOnValidThread()); - KeySystemInfoMap::const_iterator key_system_iter = - key_system_map_.find(key_system); - if (key_system_iter == key_system_map_.end()) { + KeySystemPropertiesMap::const_iterator key_system_iter = + key_system_properties_map_.find(key_system); + if (key_system_iter == key_system_properties_map_.end()) { NOTREACHED(); return EmeFeatureSupport::INVALID; } - return key_system_iter->second.persistent_state_support; + return key_system_iter->second->GetPersistentStateSupport(); +} + +EmeFeatureSupport InfoBasedKeySystemProperties::GetPersistentStateSupport() + const { + return info_.persistent_state_support; } EmeFeatureSupport KeySystemsImpl::GetDistinctiveIdentifierSupport( const std::string& key_system) const { DCHECK(thread_checker_.CalledOnValidThread()); - KeySystemInfoMap::const_iterator key_system_iter = - key_system_map_.find(key_system); - if (key_system_iter == key_system_map_.end()) { + KeySystemPropertiesMap::const_iterator key_system_iter = + key_system_properties_map_.find(key_system); + if (key_system_iter == key_system_properties_map_.end()) { NOTREACHED(); return EmeFeatureSupport::INVALID; } - return key_system_iter->second.distinctive_identifier_support; + return key_system_iter->second->GetDistinctiveIdentifierSupport(); +} + +EmeFeatureSupport +InfoBasedKeySystemProperties::GetDistinctiveIdentifierSupport() const { + return info_.distinctive_identifier_support; } KeySystems* KeySystems::GetInstance() {
diff --git a/media/base/key_systems.h b/media/base/key_systems.h index 92c15d8..0471e63 100644 --- a/media/base/key_systems.h +++ b/media/base/key_systems.h
@@ -10,7 +10,6 @@ #include <string> #include <vector> -#include "base/memory/scoped_ptr.h" #include "media/base/eme_constants.h" #include "media/base/media_export.h"
diff --git a/media/base/mime_util_internal.cc b/media/base/mime_util_internal.cc index 7a26254f..02e2ab3 100644 --- a/media/base/mime_util_internal.cc +++ b/media/base/mime_util_internal.cc
@@ -33,6 +33,8 @@ {"1", MimeUtil::PCM}, // We only allow this for WAV so it isn't ambiguous. // avc1/avc3.XXXXXX may be unambiguous; handled by ParseAVCCodecId(). // hev1/hvc1.XXXXXX may be unambiguous; handled by ParseHEVCCodecID(). + // vp9, vp9.0, vp09.xx.xx.xx.xx.xx.xx.xx may be unambiguous; handled by + // ParseVp9CodecID(). {"mp3", MimeUtil::MP3}, // Following is the list of RFC 6381 compliant audio codec strings: // mp4a.66 - MPEG-2 AAC MAIN @@ -74,8 +76,6 @@ {"opus", MimeUtil::OPUS}, {"vp8", MimeUtil::VP8}, {"vp8.0", MimeUtil::VP8}, - {"vp9", MimeUtil::VP9}, - {"vp9.0", MimeUtil::VP9}, {"theora", MimeUtil::THEORA}}; // List of codec IDs that are ambiguous and don't provide @@ -185,6 +185,97 @@ } #endif +// Handle parsing of vp9 codec IDs. +static bool ParseVp9CodecID(const std::string& mime_type_lower_case, + const std::string& codec_id, + VideoCodecProfile* profile) { + if (mime_type_lower_case == "video/webm") { + if (codec_id == "vp9" || codec_id == "vp9.0") { + // Profile is not included in the codec string. Assuming profile 0 to be + // backward compatible. + *profile = VP9PROFILE_PROFILE0; + return true; + } + // TODO(kqyang): Should we support new codec string in WebM? + return false; + } else if (mime_type_lower_case == "audio/webm") { + return false; + } + +#if BUILDFLAG(ENABLE_MP4_VP9_DEMUXING) + std::vector<std::string> fields = base::SplitString( + codec_id, ".", base::KEEP_WHITESPACE, base::SPLIT_WANT_ALL); + if (fields.size() < 1) + return false; + + if (fields[0] != "vp09") + return false; + + if (fields.size() > 8) + return false; + + std::vector<int> values; + for (size_t i = 1; i < fields.size(); ++i) { + // Missing value is not allowed. + if (fields[i] == "") + return false; + int value; + if (!base::StringToInt(fields[i], &value)) + return false; + if (value < 0) + return false; + values.push_back(value); + } + + // The spec specifies 8 fields (7 values excluding the first codec field). + // We do not allow missing fields. + if (values.size() < 7) + return false; + + const int profile_idc = values[0]; + switch (profile_idc) { + case 0: + *profile = VP9PROFILE_PROFILE0; + break; + case 1: + *profile = VP9PROFILE_PROFILE1; + break; + case 2: + *profile = VP9PROFILE_PROFILE2; + break; + case 3: + *profile = VP9PROFILE_PROFILE3; + break; + default: + return false; + } + + const int bit_depth = values[2]; + if (bit_depth != 8 && bit_depth != 10 && bit_depth != 12) + return false; + + const int color_space = values[3]; + if (color_space > 7) + return false; + + const int chroma_subsampling = values[4]; + if (chroma_subsampling > 3) + return false; + + const int transfer_function = values[5]; + if (transfer_function > 1) + return false; + + const int video_full_range_flag = values[6]; + if (video_full_range_flag > 1) + return false; + + return true; +#else + return false; +#endif // #if BUILDFLAG(ENABLE_MP4_VP9_DEMUXING) +} + MimeUtil::MimeUtil() : allow_proprietary_codecs_(false) { #if defined(OS_ANDROID) platform_info_.is_unified_media_pipeline_enabled = @@ -217,8 +308,10 @@ for (size_t i = 0; i < codecs.size(); ++i) { bool is_ambiguous = true; Codec codec = INVALID_CODEC; - if (!StringToCodec(codecs[i], &codec, &is_ambiguous, is_encrypted)) + if (!StringToCodec(mime_type_lower_case, codecs[i], &codec, &is_ambiguous, + is_encrypted)) { return IsNotSupported; + } if (!IsCodecSupported(codec, mime_type_lower_case, is_encrypted) || supported_codecs.find(codec) == supported_codecs.end()) { @@ -301,6 +394,11 @@ #if BUILDFLAG(ENABLE_HEVC_DEMUXING) mp4_video_codecs.insert(HEVC_MAIN); #endif // BUILDFLAG(ENABLE_HEVC_DEMUXING) +#if BUILDFLAG(ENABLE_MP4_VP9_DEMUXING) + // Only VP9 with valid codec string vp09.xx.xx.xx.xx.xx.xx.xx is supported. + // See ParseVp9CodecID for details. + mp4_video_codecs.insert(VP9); +#endif // BUILDFLAG(ENABLE_MP4_VP9_DEMUXING) CodecSet mp4_codecs(mp4_audio_codecs); mp4_codecs.insert(mp4_video_codecs.begin(), mp4_video_codecs.end()); #endif // defined(USE_PROPRIETARY_CODECS) @@ -553,15 +651,23 @@ if (!is_encrypted && platform_info.is_unified_media_pipeline_enabled) return true; - // Otherwise, platform support is required. - return platform_info.has_platform_vp9_decoder; + if (!platform_info.has_platform_vp9_decoder) + return false; + + // Encrypted content is demuxed so the container is irrelevant. + if (is_encrypted) + return true; + + // MediaPlayer only supports VP9 in WebM. + return mime_type_lower_case == "video/webm"; } } return false; } -bool MimeUtil::StringToCodec(const std::string& codec_id, +bool MimeUtil::StringToCodec(const std::string& mime_type_lower_case, + const std::string& codec_id, Codec* codec, bool* is_ambiguous, bool is_encrypted) const { @@ -612,6 +718,22 @@ return true; } + if (ParseVp9CodecID(mime_type_lower_case, codec_id, &profile)) { + *codec = MimeUtil::VP9; + switch (profile) { + case VP9PROFILE_PROFILE0: + // Profile 0 should always be supported if VP9 is supported. + *is_ambiguous = false; + break; + default: + // We don't know if the underlying platform supports these profiles. + // Need to add platform level querying to get supported profiles + // (crbug/604566). + *is_ambiguous = true; + } + return true; + } + DVLOG(4) << __FUNCTION__ << ": Unrecognized codec id " << codec_id; return false; }
diff --git a/media/base/mime_util_internal.h b/media/base/mime_util_internal.h index 67396cf6..b96c913 100644 --- a/media/base/mime_util_internal.h +++ b/media/base/mime_util_internal.h
@@ -111,14 +111,16 @@ // Converts a codec ID into an Codec enum value and indicates // whether the conversion was ambiguous. - // Returns true if this method was able to map |codec_id| to a specific - // Codec enum value. |codec| and |is_ambiguous| are only valid if true - // is returned. Otherwise their value is undefined after the call. + // Returns true if this method was able to map |codec_id| with + // |mime_type_lower_case| to a specific Codec enum value. |codec| and + // |is_ambiguous| are only valid if true is returned. Otherwise their value is + // undefined after the call. // |is_ambiguous| is true if |codec_id| did not have enough information to // unambiguously determine the proper Codec enum value. If |is_ambiguous| // is true |codec| contains the best guess for the intended Codec enum value. // |is_encrypted| means the codec will be used with encrypted blocks. - bool StringToCodec(const std::string& codec_id, + bool StringToCodec(const std::string& mime_type_lower_case, + const std::string& codec_id, Codec* codec, bool* is_ambiguous, bool is_encrypted) const;
diff --git a/media/base/mime_util_unittest.cc b/media/base/mime_util_unittest.cc index 4db5aa7c9..f346abd 100644 --- a/media/base/mime_util_unittest.cc +++ b/media/base/mime_util_unittest.cc
@@ -329,7 +329,8 @@ break; case MimeUtil::VP9: - EXPECT_EQ(info.has_platform_vp9_decoder, result); + // MediaPlayer only supports VP9 in WebM. + EXPECT_FALSE(result); break; case MimeUtil::HEVC_MAIN: @@ -337,6 +338,16 @@ break; } }); + + // Verify vp9 support in WebM. + RunCodecSupportTest( + states_to_vary, test_states, + [](const MimeUtil::PlatformInfo& info, MimeUtil::Codec codec) { + const bool result = MimeUtil::IsCodecSupportedOnPlatform( + codec, "video/webm", true, info); + if (codec == MimeUtil::VP9) + EXPECT_EQ(info.has_platform_vp9_decoder, result); + }); } TEST(IsCodecSupportedOnPlatformTest, ClearCodecBehaviorWithUnifiedPipeline) {
diff --git a/media/blink/websourcebuffer_impl.cc b/media/blink/websourcebuffer_impl.cc index 9386f52..e4aa84df 100644 --- a/media/blink/websourcebuffer_impl.cc +++ b/media/blink/websourcebuffer_impl.cc
@@ -179,16 +179,16 @@ std::vector<blink::WebSourceBufferClient::MediaTrackInfo> trackInfoVector; for (const auto& track : tracks->tracks()) { - trackInfoVector.push_back( - std::make_tuple(mediaTrackTypeToBlink(track->type()), - blink::WebString::fromUTF8(track->id()), - blink::WebString::fromUTF8(track->kind()), - blink::WebString::fromUTF8(track->label()), - blink::WebString::fromUTF8(track->language()))); + blink::WebSourceBufferClient::MediaTrackInfo trackInfo; + trackInfo.trackType = mediaTrackTypeToBlink(track->type()); + trackInfo.byteStreamTrackId = blink::WebString::fromUTF8(track->id()); + trackInfo.kind = blink::WebString::fromUTF8(track->kind()); + trackInfo.label = blink::WebString::fromUTF8(track->label()); + trackInfo.language = blink::WebString::fromUTF8(track->language()); + trackInfoVector.push_back(trackInfo); } - std::vector<blink::WebMediaPlayer::TrackId> blinkTrackIds = - client_->initializationSegmentReceived(trackInfoVector); + client_->initializationSegmentReceived(trackInfoVector); } } // namespace media
diff --git a/media/cast/test/receiver.cc b/media/cast/test/receiver.cc index d32dd2d0..b452221 100644 --- a/media/cast/test/receiver.cc +++ b/media/cast/test/receiver.cc
@@ -548,14 +548,15 @@ base::AtExitManager at_exit; base::CommandLine::Init(argc, argv); InitLogging(logging::LoggingSettings()); + base::MessageLoop message_loop; scoped_refptr<media::cast::CastEnvironment> cast_environment( new media::cast::StandaloneCastEnvironment); // Start up Chromium audio system. - media::FakeAudioLogFactory fake_audio_log_factory_; - const scoped_ptr<media::AudioManager> audio_manager( - media::AudioManager::Create(&fake_audio_log_factory_)); + const media::ScopedAudioManagerPtr audio_manager( + media::AudioManager::CreateForTesting( + base::ThreadTaskRunnerHandle::Get())); CHECK(media::AudioManager::Get()); media::cast::FrameReceiverConfig audio_config = @@ -600,7 +601,7 @@ window_height); player.Start(); - base::MessageLoop().Run(); // Run forever (i.e., until SIGTERM). + message_loop.Run(); // Run forever (i.e., until SIGTERM). NOTREACHED(); return 0; }
diff --git a/media/filters/gpu_video_decoder.cc b/media/filters/gpu_video_decoder.cc index 2e11d87..6149959c 100644 --- a/media/filters/gpu_video_decoder.cc +++ b/media/filters/gpu_video_decoder.cc
@@ -541,12 +541,15 @@ DCHECK(decoder_texture_target_); - bool opaque = IsOpaque(config_.format()); + VideoPixelFormat pixel_format = vda_->GetOutputFormat(); + if (pixel_format == PIXEL_FORMAT_UNKNOWN) { + pixel_format = + IsOpaque(config_.format()) ? PIXEL_FORMAT_XRGB : PIXEL_FORMAT_ARGB; + } scoped_refptr<VideoFrame> frame(VideoFrame::WrapNativeTexture( - opaque ? PIXEL_FORMAT_XRGB : PIXEL_FORMAT_ARGB, - gpu::MailboxHolder(pb.texture_mailbox(0), gpu::SyncToken(), - decoder_texture_target_), + pixel_format, gpu::MailboxHolder(pb.texture_mailbox(0), gpu::SyncToken(), + decoder_texture_target_), BindToCurrentLoop(base::Bind( &GpuVideoDecoder::ReleaseMailbox, weak_factory_.GetWeakPtr(), factories_, picture.picture_buffer_id(), pb.texture_ids())),
diff --git a/media/filters/source_buffer_stream_unittest.cc b/media/filters/source_buffer_stream_unittest.cc index a9558a2f..34f131637 100644 --- a/media/filters/source_buffer_stream_unittest.cc +++ b/media/filters/source_buffer_stream_unittest.cc
@@ -3002,39 +3002,6 @@ CheckNoNextBuffer(); } -// Currently disabled because of bug: crbug.com/140875. -TEST_F(SourceBufferStreamTest, DISABLED_GarbageCollection_WaitingForKeyframe) { - // Set memory limit to 10 buffers. - SetMemoryLimit(10); - - // Append 5 buffers at positions 10 through 14 and exhaust the buffers. - NewCodedFrameGroupAppend(10, 5, &kDataA); - Seek(10); - CheckExpectedBuffers(10, 14, &kDataA); - CheckExpectedRanges("{ [10,14) }"); - - // We are now stalled at position 15. - CheckNoNextBuffer(); - - // Do an end overlap that causes the latter half of the range to be deleted. - NewCodedFrameGroupAppend(5, 6, &kDataA); - CheckNoNextBuffer(); - CheckExpectedRanges("{ [5,10) }"); - - // Append buffers from position 20 to 29. This should trigger GC. - NewCodedFrameGroupAppend(20, 10, &kDataA); - - // GC should keep the keyframe before the seek position 15, and the next 9 - // buffers closest to the seek position. - CheckNoNextBuffer(); - CheckExpectedRanges("{ [10,10) [20,28) }"); - - // Fulfill the seek by appending one buffer at 15. - NewCodedFrameGroupAppend(15, 1, &kDataA); - CheckExpectedBuffers(15, 15, &kDataA); - CheckExpectedRanges("{ [15,15) [20,28) }"); -} - // Test the performance of garbage collection. TEST_F(SourceBufferStreamTest, GarbageCollection_Performance) { // Force |keyframes_per_second_| to be equal to kDefaultFramesPerSecond.
diff --git a/media/filters/stream_parser_factory.cc b/media/filters/stream_parser_factory.cc index 693e6518..52e87e2 100644 --- a/media/filters/stream_parser_factory.cc +++ b/media/filters/stream_parser_factory.cc
@@ -162,6 +162,10 @@ static const CodecInfo kHEVCHVC1CodecInfo = { "hvc1.*", CodecInfo::VIDEO, NULL, CodecInfo::HISTOGRAM_HEVC }; #endif +#if BUILDFLAG(ENABLE_MP4_VP9_DEMUXING) +static const CodecInfo kMPEG4VP09CodecInfo = {"vp09.*", CodecInfo::VIDEO, NULL, + CodecInfo::HISTOGRAM_VP9}; +#endif static const CodecInfo kMPEG4AACCodecInfo = { "mp4a.40.*", CodecInfo::AUDIO, &ValidateMP4ACodecID, CodecInfo::HISTOGRAM_MPEG4AAC }; @@ -190,11 +194,14 @@ #endif static const CodecInfo* kVideoMP4Codecs[] = { - &kH264AVC1CodecInfo, &kH264AVC3CodecInfo, + &kH264AVC1CodecInfo, &kH264AVC3CodecInfo, #if BUILDFLAG(ENABLE_HEVC_DEMUXING) - &kHEVCHEV1CodecInfo, &kHEVCHVC1CodecInfo, + &kHEVCHEV1CodecInfo, &kHEVCHVC1CodecInfo, #endif - &kMPEG4AACCodecInfo, &kMPEG2AACLCCodecInfo, NULL}; +#if BUILDFLAG(ENABLE_MP4_VP9_DEMUXING) + &kMPEG4VP09CodecInfo, +#endif + &kMPEG4AACCodecInfo, &kMPEG2AACLCCodecInfo, NULL}; static const CodecInfo* kAudioMP4Codecs[] = {&kMPEG4AACCodecInfo, &kMPEG2AACLCCodecInfo,
diff --git a/media/formats/mp4/box_definitions.cc b/media/formats/mp4/box_definitions.cc index 1b9a8338..82a94709 100644 --- a/media/formats/mp4/box_definitions.cc +++ b/media/formats/mp4/box_definitions.cc
@@ -594,26 +594,6 @@ return FOURCC_NULL; } -namespace { - -bool IsFormatValidH264(const FourCC& format, - const ProtectionSchemeInfo& sinf) { - return format == FOURCC_AVC1 || format == FOURCC_AVC3 || - (format == FOURCC_ENCV && (sinf.format.format == FOURCC_AVC1 || - sinf.format.format == FOURCC_AVC3)); -} - -#if BUILDFLAG(ENABLE_HEVC_DEMUXING) -bool IsFormatValidHEVC(const FourCC& format, - const ProtectionSchemeInfo& sinf) { - return format == FOURCC_HEV1 || format == FOURCC_HVC1 || - (format == FOURCC_ENCV && (sinf.format.format == FOURCC_HEV1 || - sinf.format.format == FOURCC_HVC1)); -} -#endif - -} - bool VideoSampleEntry::Parse(BoxReader* reader) { format = reader->type(); RCHECK(reader->SkipBytes(6) && @@ -635,44 +615,72 @@ } } - if (IsFormatValidH264(format, sinf)) { - DVLOG(2) << __FUNCTION__ - << " reading AVCDecoderConfigurationRecord (avcC)"; - std::unique_ptr<AVCDecoderConfigurationRecord> avcConfig( - new AVCDecoderConfigurationRecord()); - RCHECK(reader->ReadChild(avcConfig.get())); - frame_bitstream_converter = - make_scoped_refptr(new AVCBitstreamConverter(std::move(avcConfig))); - video_codec = kCodecH264; - video_codec_profile = H264PROFILE_MAIN; + const FourCC actual_format = + format == FOURCC_ENCV ? sinf.format.format : format; + switch (actual_format) { + case FOURCC_AVC1: + case FOURCC_AVC3: { + DVLOG(2) << __FUNCTION__ + << " reading AVCDecoderConfigurationRecord (avcC)"; + std::unique_ptr<AVCDecoderConfigurationRecord> avcConfig( + new AVCDecoderConfigurationRecord()); + RCHECK(reader->ReadChild(avcConfig.get())); + frame_bitstream_converter = + make_scoped_refptr(new AVCBitstreamConverter(std::move(avcConfig))); + video_codec = kCodecH264; + video_codec_profile = H264PROFILE_MAIN; + break; + } #if BUILDFLAG(ENABLE_HEVC_DEMUXING) - } else if (IsFormatValidHEVC(format, sinf)) { - DVLOG(2) << __FUNCTION__ - << " parsing HEVCDecoderConfigurationRecord (hvcC)"; - std::unique_ptr<HEVCDecoderConfigurationRecord> hevcConfig( - new HEVCDecoderConfigurationRecord()); - RCHECK(reader->ReadChild(hevcConfig.get())); - frame_bitstream_converter = - make_scoped_refptr(new HEVCBitstreamConverter(std::move(hevcConfig))); - video_codec = kCodecHEVC; + case FOURCC_HEV1: + case FOURCC_HVC1: { + DVLOG(2) << __FUNCTION__ + << " parsing HEVCDecoderConfigurationRecord (hvcC)"; + std::unique_ptr<HEVCDecoderConfigurationRecord> hevcConfig( + new HEVCDecoderConfigurationRecord()); + RCHECK(reader->ReadChild(hevcConfig.get())); + frame_bitstream_converter = + make_scoped_refptr(new HEVCBitstreamConverter(std::move(hevcConfig))); + video_codec = kCodecHEVC; + break; + } #endif - } else { - // Unknown/unsupported format - MEDIA_LOG(ERROR, reader->media_log()) << __FUNCTION__ - << " unsupported video format " - << FourCCToString(format); - return false; +#if BUILDFLAG(ENABLE_MP4_VP9_DEMUXING) + case FOURCC_VP09: + frame_bitstream_converter = NULL; + video_codec = kCodecVP9; + // TODO(kqyang): Read VPCodecConfiguration and extract profile + // (crbug.com/604863). + break; +#endif + default: + // Unknown/unsupported format + MEDIA_LOG(ERROR, reader->media_log()) << __FUNCTION__ + << " unsupported video format " + << FourCCToString(actual_format); + return false; } return true; } bool VideoSampleEntry::IsFormatValid() const { + const FourCC actual_format = + format == FOURCC_ENCV ? sinf.format.format : format; + switch (actual_format) { + case FOURCC_AVC1: + case FOURCC_AVC3: #if BUILDFLAG(ENABLE_HEVC_DEMUXING) - if (IsFormatValidHEVC(format, sinf)) - return true; + case FOURCC_HEV1: + case FOURCC_HVC1: #endif - return IsFormatValidH264(format, sinf); +#if BUILDFLAG(ENABLE_MP4_VP9_DEMUXING) + case FOURCC_VP09: +#endif + return true; + default: + return false; + } } ElementaryStreamDescriptor::ElementaryStreamDescriptor()
diff --git a/media/formats/mp4/fourccs.h b/media/formats/mp4/fourccs.h index 1ae3182..3518f73 100644 --- a/media/formats/mp4/fourccs.h +++ b/media/formats/mp4/fourccs.h
@@ -100,6 +100,7 @@ FOURCC_UUID = 0x75756964, FOURCC_VIDE = 0x76696465, FOURCC_VMHD = 0x766d6864, + FOURCC_VP09 = 0x76703039, FOURCC_WIDE = 0x77696465, };
diff --git a/media/formats/mp4/mp4_stream_parser.cc b/media/formats/mp4/mp4_stream_parser.cc index d248bad..dbd736d 100644 --- a/media/formats/mp4/mp4_stream_parser.cc +++ b/media/formats/mp4/mp4_stream_parser.cc
@@ -549,13 +549,16 @@ std::vector<uint8_t> frame_buf(buf, buf + runs_->sample_size()); if (video) { - DCHECK(runs_->video_description().frame_bitstream_converter); - if (!runs_->video_description().frame_bitstream_converter->ConvertFrame( - &frame_buf, runs_->is_keyframe(), &subsamples)) { - MEDIA_LOG(ERROR, media_log_) - << "Failed to prepare video sample for decode"; - *err = true; - return false; + if (runs_->video_description().video_codec == kCodecH264 || + runs_->video_description().video_codec == kCodecHEVC) { + DCHECK(runs_->video_description().frame_bitstream_converter); + if (!runs_->video_description().frame_bitstream_converter->ConvertFrame( + &frame_buf, runs_->is_keyframe(), &subsamples)) { + MEDIA_LOG(ERROR, media_log_) + << "Failed to prepare video sample for decode"; + *err = true; + return false; + } } }
diff --git a/media/gpu/ipc/client/gpu_jpeg_decode_accelerator_host.h b/media/gpu/ipc/client/gpu_jpeg_decode_accelerator_host.h index ec9a00c..ca16f17 100644 --- a/media/gpu/ipc/client/gpu_jpeg_decode_accelerator_host.h +++ b/media/gpu/ipc/client/gpu_jpeg_decode_accelerator_host.h
@@ -7,6 +7,8 @@ #include <stdint.h> +#include <memory> + #include "base/macros.h" #include "base/memory/weak_ptr.h" #include "base/threading/non_thread_safe.h" @@ -66,7 +68,7 @@ // GPU IO task runner. scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; - scoped_ptr<Receiver> receiver_; + std::unique_ptr<Receiver> receiver_; DISALLOW_COPY_AND_ASSIGN(GpuJpegDecodeAcceleratorHost); };
diff --git a/media/media.gyp b/media/media.gyp index ee32a6f..9b3596c 100644 --- a/media/media.gyp +++ b/media/media.gyp
@@ -64,6 +64,7 @@ "ENABLE_AC3_EAC3_AUDIO_DEMUXING=<(enable_ac3_eac3_audio_demuxing)", "ENABLE_HEVC_DEMUXING=<(enable_hevc_demuxing)", "ENABLE_MSE_MPEG2TS_STREAM_PARSER=<(enable_mse_mpeg2ts_stream_parser)", + "ENABLE_MP4_VP9_DEMUXING=0", ], }, },
diff --git a/media/mojo/interfaces/mojo_bindings.gyp b/media/mojo/interfaces/mojo_bindings.gyp index 3e3c6ac..353c642 100644 --- a/media/mojo/interfaces/mojo_bindings.gyp +++ b/media/mojo/interfaces/mojo_bindings.gyp
@@ -29,10 +29,12 @@ # GN version: //media/mojo/interfaces 'target_name': 'provision_fetcher_mojo_bindings', 'type': 'none', - 'sources': [ - 'provision_fetcher.mojom', - ], - 'includes': [ '../../../mojo/mojom_bindings_generator.gypi' ], + 'variables': { + 'mojom_files': [ + 'provision_fetcher.mojom', + ], + }, + 'includes': [ '../../../mojo/mojom_bindings_generator_explicit.gypi' ], }, { 'target_name': 'provision_fetcher_api', @@ -42,10 +44,6 @@ '../../../mojo/mojo_public.gyp:mojo_cpp_bindings', '../../../services/shell/shell.gyp:shell_public', ], - 'sources': [ - '<(SHARED_INTERMEDIATE_DIR)/media/mojo/interfaces/provision_fetcher.mojom.cc', - '<(SHARED_INTERMEDIATE_DIR)/media/mojo/interfaces/provision_fetcher.mojom.h', - ], }, ], }
diff --git a/media/mojo/services/mojo_media_application.cc b/media/mojo/services/mojo_media_application.cc index 76fd23a6..5ef80e50 100644 --- a/media/mojo/services/mojo_media_application.cc +++ b/media/mojo/services/mojo_media_application.cc
@@ -37,6 +37,11 @@ return true; } +bool MojoMediaApplication::ShellConnectionLost() { + mojo_media_client_->WillQuit(); + return true; +} + void MojoMediaApplication::Create( shell::Connection* connection, mojo::InterfaceRequest<interfaces::ServiceFactory> request) {
diff --git a/media/mojo/services/mojo_media_application.h b/media/mojo/services/mojo_media_application.h index 373c221..9682d01 100644 --- a/media/mojo/services/mojo_media_application.h +++ b/media/mojo/services/mojo_media_application.h
@@ -36,6 +36,7 @@ const shell::Identity& identity, uint32_t id) final; bool AcceptConnection(shell::Connection* connection) final; + bool ShellConnectionLost() final; // shell::InterfaceFactory<interfaces::ServiceFactory> implementation. void Create(shell::Connection* connection,
diff --git a/media/mojo/services/mojo_media_client.cc b/media/mojo/services/mojo_media_client.cc index 2d81841b..56d16b0 100644 --- a/media/mojo/services/mojo_media_client.cc +++ b/media/mojo/services/mojo_media_client.cc
@@ -12,6 +12,8 @@ void MojoMediaClient::Initialize() {} +void MojoMediaClient::WillQuit() {} + std::unique_ptr<AudioDecoder> MojoMediaClient::CreateAudioDecoder( scoped_refptr<base::SingleThreadTaskRunner> task_runner) { return nullptr;
diff --git a/media/mojo/services/mojo_media_client.h b/media/mojo/services/mojo_media_client.h index eb923e2..d64c06c 100644 --- a/media/mojo/services/mojo_media_client.h +++ b/media/mojo/services/mojo_media_client.h
@@ -32,6 +32,10 @@ // Called exactly once before any other method. virtual void Initialize(); + // Called before the host application is scheduled to quit. + // The application message loop is still valid at this point, so all clean + // up tasks requiring the message loop must be completed before returning. + virtual void WillQuit(); virtual std::unique_ptr<AudioDecoder> CreateAudioDecoder( scoped_refptr<base::SingleThreadTaskRunner> task_runner);
diff --git a/media/mojo/services/test_mojo_media_client.cc b/media/mojo/services/test_mojo_media_client.cc index 8dbd843..6388e530 100644 --- a/media/mojo/services/test_mojo_media_client.cc +++ b/media/mojo/services/test_mojo_media_client.cc
@@ -5,6 +5,8 @@ #include "media/mojo/services/test_mojo_media_client.h" #include "base/memory/ptr_util.h" +#include "base/run_loop.h" +#include "base/thread_task_runner_handle.h" #include "media/audio/audio_manager_base.h" #include "media/audio/audio_output_stream_sink.h" #include "media/base/audio_hardware_config.h" @@ -25,12 +27,14 @@ // TODO(dalecurtis): We should find a single owner per process for the audio // manager or make it a lazy instance. It's not safe to call Get()/Create() // across multiple threads... - // - // TODO(dalecurtis): Eventually we'll want something other than a fake audio - // log factory here too. We should probably at least DVLOG() such info. AudioManager* audio_manager = AudioManager::Get(); - if (!audio_manager) - audio_manager = media::AudioManager::Create(&fake_audio_log_factory_); + if (!audio_manager) { + audio_manager_ = media::AudioManager::CreateForTesting( + base::ThreadTaskRunnerHandle::Get()); + audio_manager = audio_manager_.get(); + // Flush the message loop to ensure that the audio manager is initialized. + base::RunLoop().RunUntilIdle(); + } audio_hardware_config_.reset(new AudioHardwareConfig( audio_manager->GetInputStreamParameters( @@ -38,6 +42,15 @@ audio_manager->GetDefaultOutputStreamParameters())); } +void TestMojoMediaClient::WillQuit() { + DVLOG(1) << __FUNCTION__; + // AudioManager destructor requires MessageLoop. + // Destroy it before the message loop goes away. + audio_manager_.reset(); + // Flush the message loop to ensure that the audio manager is destroyed. + base::RunLoop().RunUntilIdle(); +} + std::unique_ptr<RendererFactory> TestMojoMediaClient::CreateRendererFactory( const scoped_refptr<MediaLog>& media_log) { DVLOG(1) << __FUNCTION__;
diff --git a/media/mojo/services/test_mojo_media_client.h b/media/mojo/services/test_mojo_media_client.h index 8bf795cd..5494e365 100644 --- a/media/mojo/services/test_mojo_media_client.h +++ b/media/mojo/services/test_mojo_media_client.h
@@ -9,7 +9,7 @@ #include "base/macros.h" #include "base/memory/ref_counted.h" -#include "media/audio/fake_audio_log_factory.h" +#include "media/audio/audio_manager.h" #include "media/mojo/services/mojo_media_client.h" namespace media { @@ -26,6 +26,7 @@ // MojoMediaClient implementation. void Initialize() final; + void WillQuit() final; std::unique_ptr<RendererFactory> CreateRendererFactory( const scoped_refptr<MediaLog>& media_log) final; AudioRendererSink* CreateAudioRendererSink() final; @@ -35,7 +36,7 @@ shell::mojom::InterfaceProvider* /* interface_provider */) final; private: - FakeAudioLogFactory fake_audio_log_factory_; + ScopedAudioManagerPtr audio_manager_; std::unique_ptr<AudioHardwareConfig> audio_hardware_config_; scoped_refptr<AudioRendererSink> audio_renderer_sink_; std::unique_ptr<VideoRendererSink> video_renderer_sink_;
diff --git a/media/test/data/README b/media/test/data/README index c445e95..a4ef4753 100644 --- a/media/test/data/README +++ b/media/test/data/README
@@ -57,6 +57,10 @@ bear-1280x720-v_frag-cenc-key_rotation.mp4 - A fragmented MP4 version of the video track of bear-1280x720.mp4 encrypted (ISO CENC) using key ID [1] and key [2] with key rotation [3]. bear-1280x720-v_frag-cenc_clear-all.mp4 - Same as bear-1280x720-v_frag-cenc.mp4 but no fragments are encrypted. bear-1280x720-a_frag-cenc_missing-saiz-saio.mp4 - An invalid file similar to bear-1280x720-a_frag-cenc.mp4 but has no saiz and saio boxes. To save space, it has only one encrypted sample. +bear-320x240-v_frag-vp9.mp4 - Bear video with VP9 codec in MP4 container. Generated with edash-packager (https://github.com/google/edash-packager): + packager in=bear-vp9.webm,stream=video,out=bear-320x240-v_frag-vp9.mp4 +bear-320x240-v_frag-vp9-cenc.mp4 - Same as above, with video encrypted using key ID [1] and key [2]. Generated with edash-packager (https://github.com/google/edash-packager): + packager in=bear-vp9.webm,stream=video,out=bear-320x240-v_frag-vp9.mp4 --enable_fixed_key_encryption --key_id 30313233343536373839303132333435 --key ebdd62f16814d27b68ef122afce4ae3c bear-320x240-16x9-aspect-av_enc-av.webm - bear-320x240-16x9-aspect.webm with audio & video encrypted using key ID [1] and key [2] bear-320x240-av_enc-av.webm - bear-320x240.webm with audio & video encrypted using key ID [1] and key [2]. bear-320x240-av_enc-av_clear-1s.webm - Same as bear-320x240-av_enc-av.webm but with no frames in the first second encrypted.
diff --git a/media/test/data/bear-320x240-v_frag-vp9-cenc.mp4 b/media/test/data/bear-320x240-v_frag-vp9-cenc.mp4 new file mode 100644 index 0000000..c85aab1 --- /dev/null +++ b/media/test/data/bear-320x240-v_frag-vp9-cenc.mp4 Binary files differ
diff --git a/media/test/data/bear-320x240-v_frag-vp9.mp4 b/media/test/data/bear-320x240-v_frag-vp9.mp4 new file mode 100644 index 0000000..c9b87c03 --- /dev/null +++ b/media/test/data/bear-320x240-v_frag-vp9.mp4 Binary files differ
diff --git a/media/test/pipeline_integration_test.cc b/media/test/pipeline_integration_test.cc index 5411600..a50b446 100644 --- a/media/test/pipeline_integration_test.cc +++ b/media/test/pipeline_integration_test.cc
@@ -27,6 +27,7 @@ #include "media/cdm/aes_decryptor.h" #include "media/cdm/json_web_key.h" #include "media/filters/chunk_demuxer.h" +#include "media/media_features.h" #include "media/renderers/renderer_impl.h" #include "media/test/pipeline_integration_test_base.h" #include "testing/gmock/include/gmock/gmock.h" @@ -100,6 +101,9 @@ const char kADTS[] = "audio/aac"; const char kMP4[] = "video/mp4; codecs=\"avc1.4D4041,mp4a.40.2\""; const char kMP4VideoAVC3[] = "video/mp4; codecs=\"avc3.64001f\""; +#if BUILDFLAG(ENABLE_MP4_VP9_DEMUXING) +const char kMP4VideoVP9[] = "video/mp4; codecs=\"vp09.00.00.08.01.01.00.00\""; +#endif const char kMP4Video[] = "video/mp4; codecs=\"avc1.4D4041\""; const char kMP4Audio[] = "audio/mp4; codecs=\"mp4a.40.2\""; const char kMP3[] = "audio/mpeg"; @@ -1847,6 +1851,24 @@ Stop(); } +#if BUILDFLAG(ENABLE_MP4_VP9_DEMUXING) +TEST_F(PipelineIntegrationTest, EncryptedPlayback_MP4_VP9_CENC_VideoOnly) { + MockMediaSource source("bear-320x240-v_frag-vp9-cenc.mp4", kMP4VideoVP9, + kAppendWholeFile); + FakeEncryptedMedia encrypted_media(new KeyProvidingApp()); + StartPipelineWithEncryptedMedia(&source, &encrypted_media); + + source.EndOfStream(); + ASSERT_EQ(PIPELINE_OK, pipeline_status_); + + Play(); + + ASSERT_TRUE(WaitUntilOnEnded()); + source.Shutdown(); + Stop(); +} +#endif // #if BUILDFLAG(ENABLE_MP4_VP9_DEMUXING) + TEST_F(PipelineIntegrationTest, BasicPlayback_MediaSource_VideoOnly_MP4_AVC3) { MockMediaSource source("bear-1280x720-v_frag-avc3.mp4", kMP4VideoAVC3, kAppendWholeFile); @@ -1865,6 +1887,22 @@ Stop(); } +#if BUILDFLAG(ENABLE_MP4_VP9_DEMUXING) +TEST_F(PipelineIntegrationTest, BasicPlayback_MediaSource_VideoOnly_MP4_VP9) { + MockMediaSource source("bear-320x240-v_frag-vp9.mp4", kMP4VideoVP9, + kAppendWholeFile); + StartPipelineWithMediaSource(&source); + source.EndOfStream(); + ASSERT_EQ(PIPELINE_OK, pipeline_status_); + + Play(); + + ASSERT_TRUE(WaitUntilOnEnded()); + source.Shutdown(); + Stop(); +} +#endif // #if BUILDFLAG(ENABLE_MP4_VP9_DEMUXING) + #endif // defined(USE_PROPRIETARY_CODECS) TEST_F(PipelineIntegrationTest, SeekWhilePaused) {
diff --git a/media/video/video_decode_accelerator.cc b/media/video/video_decode_accelerator.cc index f0a5626..382625a0 100644 --- a/media/video/video_decode_accelerator.cc +++ b/media/video/video_decode_accelerator.cc
@@ -40,13 +40,23 @@ const scoped_refptr<base::SingleThreadTaskRunner>& decode_task_runner) { // Implementations in the process that VDA runs in must override this. LOG(FATAL) << "This may only be called in the same process as VDA impl."; - return false; // not reached + return false; +} + +void VideoDecodeAccelerator::ImportBufferForPicture( + int32_t picture_buffer_id, + const std::vector<gfx::GpuMemoryBufferHandle>& gpu_memory_buffer_handles) { + NOTREACHED() << "Buffer import not supported."; } GLenum VideoDecodeAccelerator::GetSurfaceInternalFormat() const { return GL_RGBA; } +VideoPixelFormat VideoDecodeAccelerator::GetOutputFormat() const { + return PIXEL_FORMAT_UNKNOWN; +} + VideoDecodeAccelerator::SupportedProfile::SupportedProfile() : profile(media::VIDEO_CODEC_PROFILE_UNKNOWN), encrypted_only(false) {}
diff --git a/media/video/video_decode_accelerator.h b/media/video/video_decode_accelerator.h index 6722e2b..950f3c5e 100644 --- a/media/video/video_decode_accelerator.h +++ b/media/video/video_decode_accelerator.h
@@ -17,6 +17,7 @@ #include "media/base/video_decoder_config.h" #include "media/video/picture.h" #include "ui/gfx/geometry/size.h" +#include "ui/gfx/gpu_memory_buffer.h" typedef unsigned int GLenum; @@ -102,6 +103,17 @@ struct MEDIA_EXPORT Config { enum { kNoSurfaceID = SurfaceManager::kNoSurfaceID }; + // Specifies the allocation and handling mode for output PictureBuffers. + // When set to ALLOCATE, the VDA is expected to allocate backing memory + // for PictureBuffers at the time of AssignPictureBuffers() call. + // When set to IMPORT, the VDA will not allocate, but after receiving + // AssignPictureBuffers() call, it will expect a call to + // ImportBufferForPicture() for each PictureBuffer before use. + enum class OutputMode { + ALLOCATE, + IMPORT, + }; + Config() = default; Config(VideoCodecProfile profile); Config(const VideoDecoderConfig& video_decoder_config); @@ -125,6 +137,8 @@ // Coded size of the video frame hint, subject to change. gfx::Size initial_expected_coded_size; + + OutputMode output_mode = OutputMode::ALLOCATE; }; // Interface for collaborating with picture interface to provide memory for @@ -230,6 +244,19 @@ virtual void AssignPictureBuffers( const std::vector<PictureBuffer>& buffers) = 0; + // Imports |gpu_memory_buffer_handles| as backing memory for picture buffer + // associated with |picture_buffer_id|. The n-th element in + // |gpu_memory_buffer_handles| should be a handle to a GpuMemoryBuffer backing + // the n-th plane of the PictureBuffer. This can only be be used if the VDA + // has been Initialize()d with config.output_mode = IMPORT, and should be + // preceded by a call to AssignPictureBuffers() to set up the number of + // PictureBuffers and their details. + // After this call, the VDA becomes the owner of the GpuMemoryBufferHandles, + // and is responsible for closing them after use, also on import failure. + virtual void ImportBufferForPicture( + int32_t picture_buffer_id, + const std::vector<gfx::GpuMemoryBufferHandle>& gpu_memory_buffer_handles); + // Sends picture buffers to be reused by the decoder. This needs to be called // for each buffer that has been processed so that decoder may know onto which // picture buffers it can write the output to. @@ -294,6 +321,10 @@ // TODO(dshwang): after moving to D3D11, remove this. crbug.com/438691 virtual GLenum GetSurfaceInternalFormat() const; + // In IMPORT OutputMode, if supported by the VDA, return the format that it + // requires for imported picture buffers. + virtual VideoPixelFormat GetOutputFormat() const; + protected: // Do not delete directly; use Destroy() or own it with a scoped_ptr, which // will Destroy() it properly by default.
diff --git a/mojo/android/BUILD.gn b/mojo/android/BUILD.gn index 020ef6d..6aeb601 100644 --- a/mojo/android/BUILD.gn +++ b/mojo/android/BUILD.gn
@@ -98,6 +98,8 @@ "//base:base_java", "//base:base_java_test_support", "//mojo/public/interfaces/bindings/tests:test_interfaces_java", + "//mojo/public/interfaces/bindings/tests:test_mojom_import2_java", + "//mojo/public/interfaces/bindings/tests:test_mojom_import_java", "//mojo/public/java:bindings", "//mojo/public/java:system", ]
diff --git a/mojo/android/javatests/src/org/chromium/mojo/bindings/InterfacesTest.java b/mojo/android/javatests/src/org/chromium/mojo/bindings/InterfacesTest.java index cb4b8a2d..f96b1e3 100644 --- a/mojo/android/javatests/src/org/chromium/mojo/bindings/InterfacesTest.java +++ b/mojo/android/javatests/src/org/chromium/mojo/bindings/InterfacesTest.java
@@ -148,7 +148,7 @@ /** * Implementation of DoStuffResponse that keeps track of if the response is called. */ - public class DoStuffResponseImpl implements Factory.DoStuffResponse { + public static class DoStuffResponseImpl implements Factory.DoStuffResponse { private boolean mResponseCalled = false; public boolean wasResponseCalled() {
diff --git a/mojo/android/javatests/src/org/chromium/mojo/bindings/RouterTest.java b/mojo/android/javatests/src/org/chromium/mojo/bindings/RouterTest.java index e6140086..0b632a9 100644 --- a/mojo/android/javatests/src/org/chromium/mojo/bindings/RouterTest.java +++ b/mojo/android/javatests/src/org/chromium/mojo/bindings/RouterTest.java
@@ -6,6 +6,7 @@ import android.test.suitebuilder.annotation.SmallTest; +import org.chromium.base.annotations.SuppressFBWarnings; import org.chromium.mojo.MojoTestCase; import org.chromium.mojo.bindings.BindingsTestUtils.CapturingErrorHandler; import org.chromium.mojo.bindings.BindingsTestUtils.RecordingMessageReceiverWithResponder; @@ -155,6 +156,7 @@ private void clearAllMessageReceivers() { Thread myFinalizerThread = new Thread() { @Override + @SuppressFBWarnings("FI_EXPLICIT_INVOCATION") public void run() { for (Pair<Message, MessageReceiver> receivedMessage : mReceiver.messagesWithReceivers) {
diff --git a/mojo/android/javatests/src/org/chromium/mojo/bindings/ValidationTest.java b/mojo/android/javatests/src/org/chromium/mojo/bindings/ValidationTest.java index cca0d4b..857d51b0 100644 --- a/mojo/android/javatests/src/org/chromium/mojo/bindings/ValidationTest.java +++ b/mojo/android/javatests/src/org/chromium/mojo/bindings/ValidationTest.java
@@ -91,14 +91,17 @@ return results; } - for (File dataFile : VALIDATION_TEST_DATA_PATH.listFiles(new DataFileFilter(prefix))) { - File resultFile = new File(dataFile.getParent(), - dataFile.getName().replaceFirst("\\.data$", ".expected")); - TestData testData = new TestData(); - testData.dataFile = dataFile; - testData.inputData = ValidationTestUtil.parseData(getStringContent(dataFile)); - testData.expectedResult = getStringContent(resultFile); - results.add(testData); + File[] files = VALIDATION_TEST_DATA_PATH.listFiles(new DataFileFilter(prefix)); + if (files != null) { + for (File dataFile : files) { + File resultFile = new File(dataFile.getParent(), + dataFile.getName().replaceFirst("\\.data$", ".expected")); + TestData testData = new TestData(); + testData.dataFile = dataFile; + testData.inputData = ValidationTestUtil.parseData(getStringContent(dataFile)); + testData.expectedResult = getStringContent(resultFile); + results.add(testData); + } } return results; }
diff --git a/mojo/common/BUILD.gn b/mojo/common/BUILD.gn index bffb612..cdf1f57 100644 --- a/mojo/common/BUILD.gn +++ b/mojo/common/BUILD.gn
@@ -2,15 +2,24 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import("//mojo/public/tools/bindings/mojom.gni") import("//testing/test.gni") group("common") { public_deps = [ ":common_base", + ":common_custom_types", ":url_type_converters", ] } +# GYP version: mojo/mojo_base.gyp:mojo_common_custom_types +mojom("common_custom_types") { + sources = [ + "common_custom_types.mojom", + ] +} + # GYP version: mojo/mojo_base.gyp:mojo_common_lib component("common_base") { output_name = "mojo_common_lib" @@ -58,10 +67,22 @@ ] } +# GYP version: mojo/mojo_base.gyp:mojo_test_common_custom_types +mojom("test_common_custom_types") { + sources = [ + "test_common_custom_types.mojom", + ] + public_deps = [ + ":common_custom_types", + ] +} + # GYP version: mojo/mojo_base.gyp:mojo_common_unittests test("mojo_common_unittests") { deps = [ ":common", + ":common_custom_types", + ":test_common_custom_types", "//base", "//base:message_loop_tests", "//base/test:test_support", @@ -79,6 +100,7 @@ # that we put them here. "../message_pump/handle_watcher_unittest.cc", "../message_pump/message_pump_mojo_unittest.cc", + "common_custom_types_unittest.cc", "common_type_converters_unittest.cc", ]
diff --git a/mojo/public/interfaces/bindings/tests/test_variant_import.mojom b/mojo/common/common_custom_types.mojom similarity index 74% rename from mojo/public/interfaces/bindings/tests/test_variant_import.mojom rename to mojo/common/common_custom_types.mojom index 1c7a783..10ebe05 100644 --- a/mojo/public/interfaces/bindings/tests/test_variant_import.mojom +++ b/mojo/common/common_custom_types.mojom
@@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -module mojo.test.test_import; +module mojo.common.mojom; -struct ImportedType {}; +[Native] +struct FilePath;
diff --git a/mojo/common/common_custom_types.typemap b/mojo/common/common_custom_types.typemap new file mode 100644 index 0000000..fc2c767a --- /dev/null +++ b/mojo/common/common_custom_types.typemap
@@ -0,0 +1,12 @@ +# 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. + +mojom = "//mojo/common/common_custom_types.mojom" +public_headers = [ "//base/files/file_path.h" ] +traits_headers = [ "//ipc/ipc_message_utils.h" ] +deps = [ + "//ipc", +] + +type_mappings = [ "mojo.common.mojom.FilePath=base::FilePath" ]
diff --git a/mojo/common/common_custom_types_unittest.cc b/mojo/common/common_custom_types_unittest.cc new file mode 100644 index 0000000..2223c26 --- /dev/null +++ b/mojo/common/common_custom_types_unittest.cc
@@ -0,0 +1,52 @@ +// 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 "base/files/file_path.h" +#include "base/message_loop/message_loop.h" +#include "base/run_loop.h" +#include "mojo/common/common_custom_types.mojom.h" +#include "mojo/common/test_common_custom_types.mojom.h" +#include "mojo/public/cpp/bindings/binding.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace mojo { +namespace common { +namespace test { + +class TestFilePathImpl : public TestFilePath { + public: + explicit TestFilePathImpl(TestFilePathRequest request) + : binding_(this, std::move(request)) {} + + // TestFilePath implementation: + void BounceFilePath(const base::FilePath& in, + const BounceFilePathCallback& callback) override { + callback.Run(in); + } + + private: + mojo::Binding<TestFilePath> binding_; +}; + +TEST(CommonCustomTypesTest, FilePath) { + base::MessageLoop message_loop; + base::RunLoop run_loop; + + TestFilePathPtr ptr; + TestFilePathImpl impl(GetProxy(&ptr)); + + base::FilePath dir(FILE_PATH_LITERAL("hello")); + base::FilePath file = dir.Append(FILE_PATH_LITERAL("world")); + + ptr->BounceFilePath(file, [&run_loop, &file](const base::FilePath& out) { + EXPECT_EQ(file, out); + run_loop.Quit(); + }); + + run_loop.Run(); +} + +} // namespace test +} // namespace common +} // namespace mojo
diff --git a/mojo/common/test_common_custom_types.mojom b/mojo/common/test_common_custom_types.mojom new file mode 100644 index 0000000..0d2f165 --- /dev/null +++ b/mojo/common/test_common_custom_types.mojom
@@ -0,0 +1,12 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module mojo.common.test; + +import "mojo/common/common_custom_types.mojom"; + +interface TestFilePath { + BounceFilePath(mojo.common.mojom.FilePath in) + => (mojo.common.mojom.FilePath out); +};
diff --git a/mojo/common/typemaps.gni b/mojo/common/typemaps.gni new file mode 100644 index 0000000..4c3809d --- /dev/null +++ b/mojo/common/typemaps.gni
@@ -0,0 +1,5 @@ +# 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. + +typemaps = [ "//mojo/common/common_custom_types.typemap" ]
diff --git a/mojo/gpu/mojo_gles2_impl_autogen.cc b/mojo/gpu/mojo_gles2_impl_autogen.cc index 2e0c661..f17af25 100644 --- a/mojo/gpu/mojo_gles2_impl_autogen.cc +++ b/mojo/gpu/mojo_gles2_impl_autogen.cc
@@ -1690,12 +1690,13 @@ GLboolean is_clipped, const GLfloat* clip_rect, GLint sorting_context_id, - const GLfloat* transform) { + const GLfloat* transform, + GLuint filter) { MojoGLES2MakeCurrent(context_); glScheduleCALayerCHROMIUM(contents_texture_id, contents_rect, opacity, background_color, edge_aa_mask, bounds_rect, is_clipped, clip_rect, sorting_context_id, - transform); + transform, filter); } void MojoGLES2Impl::CommitOverlayPlanesCHROMIUM() { MojoGLES2MakeCurrent(context_);
diff --git a/mojo/gpu/mojo_gles2_impl_autogen.h b/mojo/gpu/mojo_gles2_impl_autogen.h index bedb8e0..5d28990a1 100644 --- a/mojo/gpu/mojo_gles2_impl_autogen.h +++ b/mojo/gpu/mojo_gles2_impl_autogen.h
@@ -779,7 +779,8 @@ GLboolean is_clipped, const GLfloat* clip_rect, GLint sorting_context_id, - const GLfloat* transform) override; + const GLfloat* transform, + GLuint filter) override; void CommitOverlayPlanesCHROMIUM() override; void SwapInterval(GLint interval) override; void FlushDriverCachesCHROMIUM() override;
diff --git a/mojo/mojo_base.gyp b/mojo/mojo_base.gyp index d209a4d..414d6efd 100644 --- a/mojo/mojo_base.gyp +++ b/mojo/mojo_base.gyp
@@ -59,6 +59,23 @@ ], }, { + # GN version: //mojo/common:common_custom_types + 'target_name': 'mojo_common_custom_types', + 'type': 'static_library', + 'variables': { + 'mojom_typemaps': [ + 'common/common_custom_types.typemap', + ], + }, + 'sources': [ + 'common/common_custom_types.mojom', + ], + 'dependencies': [ + '../ipc/ipc.gyp:ipc', + ], + 'includes': [ 'mojom_bindings_generator.gypi' ], + }, + { # GN version: //mojo/common:url_type_converters 'target_name': 'mojo_url_type_converters', 'type': 'static_library', @@ -95,6 +112,23 @@ ], }, { + # GN version: //mojo/common:test_common_custom_types + 'target_name': 'mojo_test_common_custom_types', + 'type': 'static_library', + 'variables': { + 'mojom_typemaps': [ + 'common/common_custom_types.typemap', + ], + }, + 'sources': [ + 'common/test_common_custom_types.mojom', + ], + 'dependencies': [ + 'mojo_common_custom_types', + ], + 'includes': [ 'mojom_bindings_generator.gypi' ], + }, + { # GN version: //mojo/common:mojo_common_unittests 'target_name': 'mojo_common_unittests', 'type': 'executable', @@ -104,7 +138,9 @@ '../base/base.gyp:base_message_loop_tests', '../testing/gtest.gyp:gtest', '../url/url.gyp:url_lib', + 'mojo_common_custom_types', 'mojo_common_lib', + 'mojo_test_common_custom_types', 'mojo_edk.gyp:mojo_system_impl', 'mojo_edk.gyp:mojo_common_test_support', 'mojo_edk.gyp:mojo_run_all_unittests', @@ -114,6 +150,7 @@ 'mojo_url_type_converters', ], 'sources': [ + 'common/common_custom_types_unittest.cc', 'common/common_type_converters_unittest.cc', 'message_pump/handle_watcher_unittest.cc', 'message_pump/message_pump_mojo_unittest.cc',
diff --git a/mojo/mojo_edk_tests.gyp b/mojo/mojo_edk_tests.gyp index 788161fe..8599186 100644 --- a/mojo/mojo_edk_tests.gyp +++ b/mojo/mojo_edk_tests.gyp
@@ -52,10 +52,8 @@ 'mojo_public.gyp:mojo_public_test_associated_interfaces', 'mojo_public.gyp:mojo_public_test_interfaces', 'mojo_public.gyp:mojo_public_test_interfaces_blink', - 'mojo_public.gyp:mojo_public_test_interfaces_chromium', 'mojo_public.gyp:mojo_public_test_interfaces_struct_traits', 'mojo_public.gyp:mojo_public_test_utils', - 'mojo_public.gyp:mojo_public_test_variant', ], 'sources': [ 'public/cpp/bindings/tests/array_common_test.h',
diff --git a/mojo/mojo_public.gyp b/mojo/mojo_public.gyp index b377329..0e994dd 100644 --- a/mojo/mojo_public.gyp +++ b/mojo/mojo_public.gyp
@@ -27,10 +27,7 @@ 'public/interfaces/bindings/tests/serialization_test_structs.mojom', 'public/interfaces/bindings/tests/test_constants.mojom', 'public/interfaces/bindings/tests/test_native_types.mojom', - 'public/interfaces/bindings/tests/test_structs.mojom', 'public/interfaces/bindings/tests/test_sync_methods.mojom', - 'public/interfaces/bindings/tests/test_unions.mojom', - 'public/interfaces/bindings/tests/validation_test_interfaces.mojom', ] }, 'targets': [ @@ -391,7 +388,16 @@ 'target_name': 'mojo_public_test_interfaces_mojom', 'type': 'none', 'variables': { - 'mojom_files': '<(mojo_public_test_interfaces_mojom_files)', + 'mojom_files': [ + 'public/interfaces/bindings/tests/test_structs.mojom', + 'public/interfaces/bindings/tests/test_unions.mojom', + 'public/interfaces/bindings/tests/validation_test_interfaces.mojom', + '<@(mojo_public_test_interfaces_mojom_files)', + ], + 'mojom_typemaps': [ + 'public/cpp/bindings/tests/rect_chromium.typemap', + 'public/cpp/bindings/tests/test_native_types_chromium.typemap', + ], }, 'includes': [ 'mojom_bindings_generator_explicit.gypi' ], }, @@ -399,12 +405,13 @@ 'target_name': 'mojo_public_test_interfaces_struct_traits', 'type': 'static_library', 'variables': { - 'mojom_extra_generator_args': [ - '--typemap', '<(DEPTH)/mojo/public/interfaces/bindings/tests/struct_with_traits.typemap', + 'mojom_typemaps': [ + 'public/cpp/bindings/tests/struct_with_traits.typemap', ], }, 'sources': [ 'public/interfaces/bindings/tests/struct_with_traits.mojom', + 'public/cpp/bindings/tests/struct_with_traits_impl_traits.cc', ], 'includes': [ 'mojom_bindings_generator.gypi' ], }, @@ -412,31 +419,15 @@ 'target_name': 'mojo_public_test_interfaces_mojom_blink', 'type': 'none', 'variables': { - 'mojom_variant': 'blink', - 'mojom_extra_generator_args': [ - '--typemap', '<(DEPTH)/mojo/public/interfaces/bindings/tests/blink_test.typemap', + 'mojom_variant': 'wtf', + 'for_blink': 'true', + 'mojom_typemaps': [ + 'public/cpp/bindings/tests/rect_blink.typemap', + 'public/cpp/bindings/tests/test_native_types_blink.typemap', ], 'mojom_files': '<(mojo_public_test_interfaces_mojom_files)', }, 'includes': [ 'mojom_bindings_generator_explicit.gypi' ], - 'dependencies': [ - 'mojo_public_test_interfaces_mojom', - ], - }, - { - 'target_name': 'mojo_public_test_interfaces_mojom_chromium', - 'type': 'none', - 'variables': { - 'mojom_variant': 'chromium', - 'mojom_extra_generator_args': [ - '--typemap', '<(DEPTH)/mojo/public/interfaces/bindings/tests/chromium_test.typemap', - ], - 'mojom_files': '<(mojo_public_test_interfaces_mojom_files)', - }, - 'includes': [ 'mojom_bindings_generator_explicit.gypi' ], - 'dependencies': [ - 'mojo_public_test_interfaces_mojom', - ], }, { # GN version: //mojo/public/interfaces/bindings/tests:test_interfaces @@ -445,6 +436,9 @@ 'export_dependent_settings': [ 'mojo_cpp_bindings', ], + 'sources': [ + 'public/cpp/bindings/tests/pickled_struct_chromium.cc', + ], 'dependencies': [ 'mojo_public_test_interfaces_mojom', 'mojo_cpp_bindings', @@ -455,22 +449,14 @@ 'target_name': 'mojo_public_test_interfaces_blink', 'type': 'static_library', 'export_dependent_settings': [ - 'mojo_cpp_bindings', - ], - 'dependencies': [ 'mojo_public_test_interfaces_mojom_blink', 'mojo_cpp_bindings', ], - }, - { - # GN version: //mojo/public/interfaces/bindings/tests:test_interfaces_chromium - 'target_name': 'mojo_public_test_interfaces_chromium', - 'type': 'static_library', - 'export_dependent_settings': [ - 'mojo_cpp_bindings', + 'sources': [ + 'public/cpp/bindings/tests/pickled_struct_blink.cc', ], 'dependencies': [ - 'mojo_public_test_interfaces_mojom_chromium', + 'mojo_public_test_interfaces_mojom_blink', 'mojo_cpp_bindings', ], }, @@ -512,7 +498,7 @@ 'target_name': 'mojo_public_test_wtf_types_blink', 'type': 'static_library', 'variables': { - 'mojom_variant': 'blink', + 'mojom_variant': 'wtf', 'for_blink': 'true', }, 'sources': [ @@ -520,18 +506,6 @@ ], 'includes': [ 'mojom_bindings_generator.gypi' ], }, - { - 'target_name': 'mojo_public_test_variant', - 'type': 'static_library', - 'variables': { - 'mojom_variant': 'test_variant', - }, - 'sources': [ - 'public/interfaces/bindings/tests/test_variant_import.mojom', - 'public/interfaces/bindings/tests/test_variant.mojom', - ], - 'includes': [ 'mojom_bindings_generator.gypi' ], - }, ], 'conditions': [ ['OS == "android"', {
diff --git a/mojo/mojom_bindings_generator.gypi b/mojo/mojom_bindings_generator.gypi index bcf98b22..a10c2e47 100644 --- a/mojo/mojom_bindings_generator.gypi +++ b/mojo/mojom_bindings_generator.gypi
@@ -8,24 +8,18 @@ ], 'variables': { 'variables': { - 'mojom_typemap_dependencies%': [], - 'mojom_typemaps%': [], 'mojom_variant%': 'none', 'for_blink%': 'false', }, - 'mojom_typemap_dependencies%': ['<@(mojom_typemap_dependencies)'], - 'mojom_typemaps%': ['<@(mojom_typemaps)'], 'mojom_variant%': '<(mojom_variant)', + 'mojom_typemaps%': [], 'for_blink%': '<(for_blink)', 'mojom_base_output_dir': '<!(python <(DEPTH)/build/inverse_depth.py <(DEPTH))', 'mojom_generated_outputs': [ '<!@(python <(DEPTH)/mojo/public/tools/bindings/mojom_list_outputs.py --basedir <(mojom_base_output_dir) --variant <(mojom_variant) <@(_sources))', ], - 'mojom_generator_typemap_args': [ - '<!@(python <(DEPTH)/mojo/public/tools/bindings/mojom_get_generator_typemap_args.py <@(mojom_typemaps))', - ], - 'mojom_extra_generator_args%': [], + 'generated_typemap_file': '<(SHARED_INTERMEDIATE_DIR)/<(mojom_base_output_dir)/<(_target_name)_type_mappings', 'conditions': [ ['mojom_variant=="none"', { 'mojom_output_languages%': 'c++,javascript,java', @@ -62,7 +56,23 @@ ], 'inputs': [ '<@(_sources)' ], 'outputs': [ '<(stamp_filename)' ], - } + }, + { + 'variables': { + 'output': '<(generated_typemap_file)', + }, + 'action_name': '<(_target_name)_type_mappings', + 'action': [ + 'python', '<(DEPTH)/mojo/public/tools/bindings/generate_type_mappings.py', + '--output', + '<(output)', + '<!@(python <(DEPTH)/mojo/public/tools/bindings/format_typemap_generator_args.py <@(mojom_typemaps))', + ], + 'inputs':[ + '<(DEPTH)/mojo/public/tools/bindings/generate_type_mappings.py', + ], + 'outputs': [ '<(output)' ], + }, ], 'rules': [ { @@ -78,8 +88,8 @@ }, 'inputs': [ '<@(mojom_bindings_generator_sources)', - '<@(mojom_typemaps)', '<(stamp_filename)', + '<(generated_typemap_file)', '<(SHARED_INTERMEDIATE_DIR)/mojo/public/tools/bindings/cpp_templates.zip', '<(SHARED_INTERMEDIATE_DIR)/mojo/public/tools/bindings/java_templates.zip', '<(SHARED_INTERMEDIATE_DIR)/mojo/public/tools/bindings/js_templates.zip', @@ -110,8 +120,8 @@ '--java_output_directory=<(java_out_dir)', '--variant', '<(mojom_variant)', '-g', '<(mojom_output_languages)', - '<@(mojom_generator_typemap_args)', - '<@(mojom_extra_generator_args)', + '--typemap', + '<(generated_typemap_file)', '<@(mojom_generator_wtf_arg)', '--bytecode_path', '<(SHARED_INTERMEDIATE_DIR)/mojo/public/tools/bindings', @@ -124,11 +134,9 @@ '<(DEPTH)/base/base.gyp:base', '<(DEPTH)/mojo/mojo_public.gyp:mojo_interface_bindings_generation', '<(DEPTH)/mojo/public/tools/bindings/bindings.gyp:precompile_mojom_bindings_generator_templates', - '<@(mojom_typemap_dependencies)', '<@(wtf_dependencies)', ], 'export_dependent_settings': [ - '<@(mojom_typemap_dependencies)', '<@(wtf_dependencies)', ], 'include_dirs': [
diff --git a/mojo/mojom_bindings_generator_explicit.gypi b/mojo/mojom_bindings_generator_explicit.gypi index e3bb2e8..ea484de 100644 --- a/mojo/mojom_bindings_generator_explicit.gypi +++ b/mojo/mojom_bindings_generator_explicit.gypi
@@ -12,14 +12,15 @@ 'for_blink%': 'false', }, 'mojom_variant%': '<(mojom_variant)', + 'mojom_typemaps%': [], 'for_blink%': '<(for_blink)', 'mojom_base_output_dir': '<!(python <(DEPTH)/build/inverse_depth.py <(DEPTH))', 'mojom_generated_outputs': [ '<!@(python <(DEPTH)/mojo/public/tools/bindings/mojom_list_outputs.py --basedir <(mojom_base_output_dir) --variant <(mojom_variant) <@(mojom_files))', ], + 'generated_typemap_file': '<(SHARED_INTERMEDIATE_DIR)/<(mojom_base_output_dir)/<(_target_name)_type_mappings', 'mojom_include_path%': '<(DEPTH)', - 'mojom_extra_generator_args%': [], 'require_interface_bindings%': 1, 'conditions': [ ['mojom_variant=="none"', { @@ -65,6 +66,22 @@ 'outputs': [ '<(stamp_filename)' ], }, { + 'variables': { + 'output': '<(generated_typemap_file)', + }, + 'action_name': '<(_target_name)_type_mappings', + 'action': [ + 'python', '<(DEPTH)/mojo/public/tools/bindings/generate_type_mappings.py', + '--output', + '<(output)', + '<!@(python <(DEPTH)/mojo/public/tools/bindings/format_typemap_generator_args.py <@(mojom_typemaps))', + ], + 'inputs':[ + '<(DEPTH)/mojo/public/tools/bindings/generate_type_mappings.py', + ], + 'outputs': [ '<(output)' ], + }, + { 'action_name': '<(_target_name)_mojom_bindings_generator', 'variables': { 'java_out_dir': '<(PRODUCT_DIR)/java_mojo/<(_target_name)/src', @@ -79,6 +96,7 @@ '<@(mojom_bindings_generator_sources)', '<@(mojom_files)', '<(stamp_filename)', + '<(generated_typemap_file)', '<(SHARED_INTERMEDIATE_DIR)/mojo/public/tools/bindings/cpp_templates.zip', '<(SHARED_INTERMEDIATE_DIR)/mojo/public/tools/bindings/java_templates.zip', '<(SHARED_INTERMEDIATE_DIR)/mojo/public/tools/bindings/js_templates.zip', @@ -96,7 +114,8 @@ '--java_output_directory=<(java_out_dir)', '--variant', '<(mojom_variant)', '-g', '<(mojom_output_languages)', - '<@(mojom_extra_generator_args)', + '--typemap', + '<(generated_typemap_file)', '<@(mojom_generator_wtf_arg)', '--bytecode_path', '<(SHARED_INTERMEDIATE_DIR)/mojo/public/tools/bindings',
diff --git a/mojo/public/c/gles2/gles2_call_visitor_chromium_extension_autogen.h b/mojo/public/c/gles2/gles2_call_visitor_chromium_extension_autogen.h index 5eebe552..2fa3609 100644 --- a/mojo/public/c/gles2/gles2_call_visitor_chromium_extension_autogen.h +++ b/mojo/public/c/gles2/gles2_call_visitor_chromium_extension_autogen.h
@@ -365,7 +365,8 @@ GLboolean is_clipped, const GLfloat* clip_rect, GLint sorting_context_id, - const GLfloat* transform), + const GLfloat* transform, + GLuint filter), (contents_texture_id, contents_rect, opacity, @@ -375,7 +376,8 @@ is_clipped, clip_rect, sorting_context_id, - transform)) + transform, + filter)) VISIT_GL_CALL(CommitOverlayPlanesCHROMIUM, void, (), ()) VISIT_GL_CALL(SwapInterval, void, (GLint interval), (interval)) VISIT_GL_CALL(FlushDriverCachesCHROMIUM, void, (), ())
diff --git a/mojo/public/cpp/bindings/BUILD.gn b/mojo/public/cpp/bindings/BUILD.gn index 93df9a3..5fe4d9d 100644 --- a/mojo/public/cpp/bindings/BUILD.gn +++ b/mojo/public/cpp/bindings/BUILD.gn
@@ -103,12 +103,12 @@ "string.h", "strong_binding.h", "struct_ptr.h", - "struct_traits.h", "type_converter.h", ] public_deps = [ ":callback", + ":struct_traits", "//base", "//ipc:param_traits", "//mojo/public/cpp/system", @@ -135,6 +135,12 @@ ] } +source_set("struct_traits") { + sources = [ + "struct_traits.h", + ] +} + source_set("wtf_support") { sources = [ "lib/array_traits_wtf.h",
diff --git a/mojo/public/cpp/bindings/lib/connector.cc b/mojo/public/cpp/bindings/lib/connector.cc index 70f9fd7..6989231 100644 --- a/mojo/public/cpp/bindings/lib/connector.cc +++ b/mojo/public/cpp/bindings/lib/connector.cc
@@ -8,6 +8,7 @@ #include <utility> #include "base/bind.h" +#include "base/location.h" #include "base/logging.h" #include "base/macros.h" #include "base/synchronization/lock.h"
diff --git a/mojo/public/cpp/bindings/lib/sync_handle_registry.cc b/mojo/public/cpp/bindings/lib/sync_handle_registry.cc index 3d88ec9..e4b49557 100644 --- a/mojo/public/cpp/bindings/lib/sync_handle_registry.cc +++ b/mojo/public/cpp/bindings/lib/sync_handle_registry.cc
@@ -20,11 +20,12 @@ } // namespace // static -SyncHandleRegistry* SyncHandleRegistry::current() { - SyncHandleRegistry* result = g_current_sync_handle_watcher.Pointer()->Get(); +scoped_refptr<SyncHandleRegistry> SyncHandleRegistry::current() { + scoped_refptr<SyncHandleRegistry> result( + g_current_sync_handle_watcher.Pointer()->Get()); if (!result) { result = new SyncHandleRegistry(); - DCHECK_EQ(result, g_current_sync_handle_watcher.Pointer()->Get()); + DCHECK_EQ(result.get(), g_current_sync_handle_watcher.Pointer()->Get()); } return result; } @@ -66,10 +67,8 @@ MojoHandle ready_handle; MojoResult ready_handle_result; - // This object may be destroyed during a callback. So we have to preserve - // the boolean. - scoped_refptr<base::RefCountedData<bool>> destroyed = destroyed_; - while (!destroyed->data) { + scoped_refptr<SyncHandleRegistry> preserver(this); + while (true) { for (size_t i = 0; i < count; ++i) if (*should_stop[i]) return true; @@ -96,8 +95,7 @@ return false; } -SyncHandleRegistry::SyncHandleRegistry() - : destroyed_(new base::RefCountedData<bool>(false)) { +SyncHandleRegistry::SyncHandleRegistry() { MojoHandle handle; MojoResult result = MojoCreateWaitSet(&handle); CHECK_EQ(MOJO_RESULT_OK, result); @@ -106,24 +104,12 @@ DCHECK(!g_current_sync_handle_watcher.Pointer()->Get()); g_current_sync_handle_watcher.Pointer()->Set(this); - - base::MessageLoop::current()->AddDestructionObserver(this); } SyncHandleRegistry::~SyncHandleRegistry() { DCHECK(thread_checker_.CalledOnValidThread()); - destroyed_->data = true; g_current_sync_handle_watcher.Pointer()->Set(nullptr); } -void SyncHandleRegistry::WillDestroyCurrentMessageLoop() { - DCHECK(thread_checker_.CalledOnValidThread()); - DCHECK_EQ(this, g_current_sync_handle_watcher.Pointer()->Get()); - - base::MessageLoop::current()->RemoveDestructionObserver(this); - - delete this; -} - } // namespace internal } // namespace mojo
diff --git a/mojo/public/cpp/bindings/lib/sync_handle_registry.h b/mojo/public/cpp/bindings/lib/sync_handle_registry.h index df927db..d6b8c38e 100644 --- a/mojo/public/cpp/bindings/lib/sync_handle_registry.h +++ b/mojo/public/cpp/bindings/lib/sync_handle_registry.h
@@ -9,7 +9,7 @@ #include "base/callback.h" #include "base/macros.h" -#include "base/message_loop/message_loop.h" +#include "base/memory/ref_counted.h" #include "base/threading/thread_checker.h" #include "mojo/public/cpp/system/core.h" @@ -20,10 +20,10 @@ // be watched together. // // This class is not thread safe. -class SyncHandleRegistry : public base::MessageLoop::DestructionObserver { +class SyncHandleRegistry : public base::RefCounted<SyncHandleRegistry> { public: // Returns a thread-local object. - static SyncHandleRegistry* current(); + static scoped_refptr<SyncHandleRegistry> current(); using HandleCallback = base::Callback<void(MojoResult)>; bool RegisterHandle(const Handle& handle, @@ -40,6 +40,8 @@ bool WatchAllHandles(const bool* should_stop[], size_t count); private: + friend class base::RefCounted<SyncHandleRegistry>; + struct HandleHasher { size_t operator()(const Handle& handle) const { return std::hash<uint32_t>()(static_cast<uint32_t>(handle.value())); @@ -48,17 +50,12 @@ using HandleMap = std::unordered_map<Handle, HandleCallback, HandleHasher>; SyncHandleRegistry(); - ~SyncHandleRegistry() override; - - // base::MessageLoop::DestructionObserver implementation: - void WillDestroyCurrentMessageLoop() override; + ~SyncHandleRegistry(); HandleMap handles_; ScopedHandle wait_set_handle_; - scoped_refptr<base::RefCountedData<bool>> destroyed_; - base::ThreadChecker thread_checker_; DISALLOW_COPY_AND_ASSIGN(SyncHandleRegistry);
diff --git a/mojo/public/cpp/bindings/lib/sync_handle_watcher.cc b/mojo/public/cpp/bindings/lib/sync_handle_watcher.cc index e259578..44092038 100644 --- a/mojo/public/cpp/bindings/lib/sync_handle_watcher.cc +++ b/mojo/public/cpp/bindings/lib/sync_handle_watcher.cc
@@ -18,12 +18,13 @@ callback_(callback), registered_(false), register_request_count_(0), + registry_(SyncHandleRegistry::current()), destroyed_(new base::RefCountedData<bool>(false)) {} SyncHandleWatcher::~SyncHandleWatcher() { DCHECK(thread_checker_.CalledOnValidThread()); if (registered_) - SyncHandleRegistry::current()->UnregisterHandle(handle_); + registry_->UnregisterHandle(handle_); destroyed_->data = true; } @@ -45,8 +46,7 @@ // to preserve the boolean that WatchAllHandles uses. auto destroyed = destroyed_; const bool* should_stop_array[] = {should_stop, &destroyed->data}; - bool result = - SyncHandleRegistry::current()->WatchAllHandles(should_stop_array, 2); + bool result = registry_->WatchAllHandles(should_stop_array, 2); // This object has been destroyed. if (destroyed->data) @@ -59,8 +59,8 @@ void SyncHandleWatcher::IncrementRegisterCount() { register_request_count_++; if (!registered_) { - registered_ = SyncHandleRegistry::current()->RegisterHandle( - handle_, handle_signals_, callback_); + registered_ = + registry_->RegisterHandle(handle_, handle_signals_, callback_); } } @@ -69,7 +69,7 @@ register_request_count_--; if (register_request_count_ == 0 && registered_) { - SyncHandleRegistry::current()->UnregisterHandle(handle_); + registry_->UnregisterHandle(handle_); registered_ = false; } }
diff --git a/mojo/public/cpp/bindings/lib/sync_handle_watcher.h b/mojo/public/cpp/bindings/lib/sync_handle_watcher.h index 8d4fd55..93d527b 100644 --- a/mojo/public/cpp/bindings/lib/sync_handle_watcher.h +++ b/mojo/public/cpp/bindings/lib/sync_handle_watcher.h
@@ -61,6 +61,8 @@ // If non-zero, |handle_| should be registered with SyncHandleRegistry. size_t register_request_count_; + scoped_refptr<SyncHandleRegistry> registry_; + scoped_refptr<base::RefCountedData<bool>> destroyed_; base::ThreadChecker thread_checker_;
diff --git a/mojo/public/cpp/bindings/tests/BUILD.gn b/mojo/public/cpp/bindings/tests/BUILD.gn index 6aab247..2e073a4 100644 --- a/mojo/public/cpp/bindings/tests/BUILD.gn +++ b/mojo/public/cpp/bindings/tests/BUILD.gn
@@ -28,14 +28,6 @@ "message_queue.h", "multiplex_router_unittest.cc", "pickle_unittest.cc", - "pickled_struct_blink.cc", - "pickled_struct_blink.h", - "pickled_struct_chromium.cc", - "pickled_struct_chromium.h", - "rect_blink.h", - "rect_blink_traits.h", - "rect_chromium.h", - "rect_chromium_traits.h", "request_response_unittest.cc", "router_test_util.cc", "router_test_util.h", @@ -46,10 +38,6 @@ "string_unittest.cc", "struct_traits_unittest.cc", "struct_unittest.cc", - "struct_with_traits_impl.cc", - "struct_with_traits_impl.h", - "struct_with_traits_impl_traits.cc", - "struct_with_traits_impl_traits.h", "sync_method_unittest.cc", "type_conversion_unittest.cc", "union_unittest.cc", @@ -66,11 +54,9 @@ "//mojo/public/cpp/test_support:test_utils", "//mojo/public/interfaces/bindings/tests:test_associated_interfaces", "//mojo/public/interfaces/bindings/tests:test_interfaces", - "//mojo/public/interfaces/bindings/tests:test_interfaces_blink", - "//mojo/public/interfaces/bindings/tests:test_interfaces_chromium", "//mojo/public/interfaces/bindings/tests:test_interfaces_experimental", + "//mojo/public/interfaces/bindings/tests:test_interfaces_wtf", "//mojo/public/interfaces/bindings/tests:test_struct_traits_interfaces", - "//mojo/public/interfaces/bindings/tests:test_variant", "//testing/gtest", ] } @@ -93,11 +79,22 @@ "//mojo/public/cpp/system", "//mojo/public/interfaces/bindings/tests:test_interfaces", "//mojo/public/interfaces/bindings/tests:test_wtf_types", - "//mojo/public/interfaces/bindings/tests:test_wtf_types_blink", + "//mojo/public/interfaces/bindings/tests:test_wtf_types_wtf", "//testing/gtest", ] } +source_set("struct_with_traits_impl") { + sources = [ + "struct_with_traits_impl.cc", + "struct_with_traits_impl.h", + ] + + deps = [ + "//base", + ] +} + source_set("perftests") { testonly = true
diff --git a/mojo/public/cpp/bindings/tests/blink_typemaps.gni b/mojo/public/cpp/bindings/tests/blink_typemaps.gni new file mode 100644 index 0000000..b71dcf8 --- /dev/null +++ b/mojo/public/cpp/bindings/tests/blink_typemaps.gni
@@ -0,0 +1,8 @@ +# 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. + +typemaps = [ + "//mojo/public/cpp/bindings/tests/rect_blink.typemap", + "//mojo/public/cpp/bindings/tests/test_native_types_blink.typemap", +]
diff --git a/mojo/public/cpp/bindings/tests/chromium_typemaps.gni b/mojo/public/cpp/bindings/tests/chromium_typemaps.gni new file mode 100644 index 0000000..1da7cbf --- /dev/null +++ b/mojo/public/cpp/bindings/tests/chromium_typemaps.gni
@@ -0,0 +1,9 @@ +# 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. + +typemaps = [ + "//mojo/public/cpp/bindings/tests/rect_chromium.typemap", + "//mojo/public/cpp/bindings/tests/struct_with_traits.typemap", + "//mojo/public/cpp/bindings/tests/test_native_types_chromium.typemap", +]
diff --git a/mojo/public/cpp/bindings/tests/pickle_unittest.cc b/mojo/public/cpp/bindings/tests/pickle_unittest.cc index 17b1724..34aec26a 100644 --- a/mojo/public/cpp/bindings/tests/pickle_unittest.cc +++ b/mojo/public/cpp/bindings/tests/pickle_unittest.cc
@@ -14,8 +14,8 @@ #include "mojo/public/cpp/bindings/tests/pickled_struct_blink.h" #include "mojo/public/cpp/bindings/tests/pickled_struct_chromium.h" #include "mojo/public/cpp/bindings/tests/variant_test_util.h" -#include "mojo/public/interfaces/bindings/tests/test_native_types.mojom-blink.h" -#include "mojo/public/interfaces/bindings/tests/test_native_types.mojom-chromium.h" +#include "mojo/public/interfaces/bindings/tests/test_native_types.mojom-wtf.h" +#include "mojo/public/interfaces/bindings/tests/test_native_types.mojom.h" #include "testing/gtest/include/gtest/gtest.h" namespace mojo { @@ -54,18 +54,18 @@ } // This implements the generated Chromium variant of PicklePasser. -class ChromiumPicklePasserImpl : public chromium::PicklePasser { +class ChromiumPicklePasserImpl : public PicklePasser { public: ChromiumPicklePasserImpl() {} - // mojo::test::chromium::PicklePasser: + // mojo::test::PicklePasser: void PassPickle(const PickledStructChromium& pickle, const PassPickleCallback& callback) override { callback.Run(pickle); } void PassPickleContainer( - chromium::PickleContainerPtr container, + PickleContainerPtr container, const PassPickleContainerCallback& callback) override { callback.Run(std::move(container)); } @@ -82,28 +82,28 @@ }; // This implements the generated Blink variant of PicklePasser. -class BlinkPicklePasserImpl : public blink::PicklePasser { +class BlinkPicklePasserImpl : public wtf::PicklePasser { public: BlinkPicklePasserImpl() {} - // mojo::test::blink::PicklePasser: + // mojo::test::wtf::PicklePasser: void PassPickle(const PickledStructBlink& pickle, const PassPickleCallback& callback) override { callback.Run(pickle); } void PassPickleContainer( - blink::PickleContainerPtr container, + wtf::PickleContainerPtr container, const PassPickleContainerCallback& callback) override { callback.Run(std::move(container)); } - void PassPickles(Array<PickledStructBlink> pickles, + void PassPickles(WTFArray<PickledStructBlink> pickles, const PassPicklesCallback& callback) override { callback.Run(std::move(pickles)); } - void PassPickleArrays(Array<Array<PickledStructBlink>> pickle_arrays, + void PassPickleArrays(WTFArray<WTFArray<PickledStructBlink>> pickle_arrays, const PassPickleArraysCallback& callback) override { callback.Run(std::move(pickle_arrays)); } @@ -115,32 +115,32 @@ public: PickleTest() {} - template <typename ProxyType = chromium::PicklePasser> + template <typename ProxyType = PicklePasser> InterfacePtr<ProxyType> ConnectToChromiumService() { InterfacePtr<ProxyType> proxy; InterfaceRequest<ProxyType> request = GetProxy(&proxy); chromium_bindings_.AddBinding( &chromium_service_, - ConvertInterfaceRequest<chromium::PicklePasser>(std::move(request))); + ConvertInterfaceRequest<PicklePasser>(std::move(request))); return proxy; } - template <typename ProxyType = blink::PicklePasser> + template <typename ProxyType = wtf::PicklePasser> InterfacePtr<ProxyType> ConnectToBlinkService() { InterfacePtr<ProxyType> proxy; InterfaceRequest<ProxyType> request = GetProxy(&proxy); blink_bindings_.AddBinding( &blink_service_, - ConvertInterfaceRequest<blink::PicklePasser>(std::move(request))); + ConvertInterfaceRequest<wtf::PicklePasser>(std::move(request))); return proxy; } private: base::MessageLoop loop_; ChromiumPicklePasserImpl chromium_service_; - BindingSet<chromium::PicklePasser> chromium_bindings_; + BindingSet<PicklePasser> chromium_bindings_; BlinkPicklePasserImpl blink_service_; - BindingSet<blink::PicklePasser> blink_bindings_; + BindingSet<wtf::PicklePasser> blink_bindings_; }; } // namespace @@ -164,7 +164,7 @@ } TEST_F(PickleTest, ChromiumProxyToBlinkService) { - auto chromium_proxy = ConnectToBlinkService<chromium::PicklePasser>(); + auto chromium_proxy = ConnectToBlinkService<PicklePasser>(); { base::RunLoop loop; chromium_proxy->PassPickle( @@ -203,7 +203,7 @@ } TEST_F(PickleTest, BlinkProxyToChromiumService) { - auto blink_proxy = ConnectToChromiumService<blink::PicklePasser>(); + auto blink_proxy = ConnectToChromiumService<wtf::PicklePasser>(); { base::RunLoop loop; blink_proxy->PassPickle( @@ -291,22 +291,20 @@ TEST_F(PickleTest, PickleContainer) { auto proxy = ConnectToChromiumService(); - chromium::PickleContainerPtr pickle_container = - chromium::PickleContainer::New(); + PickleContainerPtr pickle_container = PickleContainer::New(); pickle_container->pickle.set_foo(42); pickle_container->pickle.set_bar(43); pickle_container->pickle.set_baz(44); { base::RunLoop run_loop; - proxy->PassPickleContainer( - std::move(pickle_container), - [&](chromium::PickleContainerPtr passed) { - ASSERT_FALSE(passed.is_null()); - EXPECT_EQ(42, passed->pickle.foo()); - EXPECT_EQ(43, passed->pickle.bar()); - EXPECT_EQ(0, passed->pickle.baz()); - run_loop.Quit(); - }); + proxy->PassPickleContainer(std::move(pickle_container), + [&](PickleContainerPtr passed) { + ASSERT_FALSE(passed.is_null()); + EXPECT_EQ(42, passed->pickle.foo()); + EXPECT_EQ(43, passed->pickle.bar()); + EXPECT_EQ(0, passed->pickle.baz()); + run_loop.Quit(); + }); run_loop.Run(); } }
diff --git a/mojo/public/cpp/bindings/tests/rect_blink.typemap b/mojo/public/cpp/bindings/tests/rect_blink.typemap new file mode 100644 index 0000000..37ee409 --- /dev/null +++ b/mojo/public/cpp/bindings/tests/rect_blink.typemap
@@ -0,0 +1,9 @@ +# 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. + +mojom = "//mojo/public/interfaces/bindings/tests/rect.mojom" +public_headers = [ "//mojo/public/cpp/bindings/tests/rect_blink.h" ] +traits_headers = [ "//mojo/public/cpp/bindings/tests/rect_blink_traits.h" ] + +type_mappings = [ "mojo.test.TypemappedRect=mojo::test::RectBlink" ]
diff --git a/mojo/public/cpp/bindings/tests/rect_blink_traits.h b/mojo/public/cpp/bindings/tests/rect_blink_traits.h index c4e4014..a6ac8c3e 100644 --- a/mojo/public/cpp/bindings/tests/rect_blink_traits.h +++ b/mojo/public/cpp/bindings/tests/rect_blink_traits.h
@@ -7,19 +7,18 @@ #include "mojo/public/cpp/bindings/struct_traits.h" #include "mojo/public/cpp/bindings/tests/rect_blink.h" -#include "mojo/public/interfaces/bindings/tests/rect.mojom-blink.h" +#include "mojo/public/interfaces/bindings/tests/rect.mojom-wtf.h" namespace mojo { template <> -struct StructTraits<test::blink::TypemappedRect, test::RectBlink> { +struct StructTraits<test::wtf::TypemappedRect, test::RectBlink> { static int x(const test::RectBlink& r) { return r.x(); } static int y(const test::RectBlink& r) { return r.y(); } static int width(const test::RectBlink& r) { return r.width(); } static int height(const test::RectBlink& r) { return r.height(); } - static bool Read(test::blink::TypemappedRect::Reader r, - test::RectBlink* out) { + static bool Read(test::wtf::TypemappedRect::Reader r, test::RectBlink* out) { if (r.x() < 0 || r.y() < 0 || r.width() < 0 || r.height() < 0) { return false; }
diff --git a/mojo/public/cpp/bindings/tests/rect_chromium.typemap b/mojo/public/cpp/bindings/tests/rect_chromium.typemap new file mode 100644 index 0000000..0da4021 --- /dev/null +++ b/mojo/public/cpp/bindings/tests/rect_chromium.typemap
@@ -0,0 +1,9 @@ +# 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. + +mojom = "//mojo/public/interfaces/bindings/tests/rect.mojom" +public_headers = [ "//mojo/public/cpp/bindings/tests/rect_chromium.h" ] +traits_headers = [ "//mojo/public/cpp/bindings/tests/rect_chromium_traits.h" ] + +type_mappings = [ "mojo.test.TypemappedRect=mojo::test::RectChromium" ]
diff --git a/mojo/public/cpp/bindings/tests/rect_chromium_traits.h b/mojo/public/cpp/bindings/tests/rect_chromium_traits.h index 72c0838..252de72d 100644 --- a/mojo/public/cpp/bindings/tests/rect_chromium_traits.h +++ b/mojo/public/cpp/bindings/tests/rect_chromium_traits.h
@@ -7,19 +7,18 @@ #include "mojo/public/cpp/bindings/struct_traits.h" #include "mojo/public/cpp/bindings/tests/rect_chromium.h" -#include "mojo/public/interfaces/bindings/tests/rect.mojom-chromium.h" +#include "mojo/public/interfaces/bindings/tests/rect.mojom.h" namespace mojo { template <> -struct StructTraits<test::chromium::TypemappedRect, test::RectChromium> { +struct StructTraits<test::TypemappedRect, test::RectChromium> { static int x(const test::RectChromium& r) { return r.x(); } static int y(const test::RectChromium& r) { return r.y(); } static int width(const test::RectChromium& r) { return r.width(); } static int height(const test::RectChromium& r) { return r.height(); } - static bool Read(test::chromium::TypemappedRect::Reader r, - test::RectChromium* out) { + static bool Read(test::TypemappedRect::Reader r, test::RectChromium* out) { if (r.width() < 0 || r.height() < 0) return false; out->set_x(r.x());
diff --git a/mojo/public/cpp/bindings/tests/struct_traits_unittest.cc b/mojo/public/cpp/bindings/tests/struct_traits_unittest.cc index cd99785..a304ce5 100644 --- a/mojo/public/cpp/bindings/tests/struct_traits_unittest.cc +++ b/mojo/public/cpp/bindings/tests/struct_traits_unittest.cc
@@ -14,8 +14,8 @@ #include "mojo/public/cpp/bindings/tests/struct_with_traits_impl.h" #include "mojo/public/cpp/bindings/tests/variant_test_util.h" #include "mojo/public/interfaces/bindings/tests/struct_with_traits.mojom.h" -#include "mojo/public/interfaces/bindings/tests/test_native_types.mojom-blink.h" -#include "mojo/public/interfaces/bindings/tests/test_native_types.mojom-chromium.h" +#include "mojo/public/interfaces/bindings/tests/test_native_types.mojom-wtf.h" +#include "mojo/public/interfaces/bindings/tests/test_native_types.mojom.h" #include "testing/gtest/include/gtest/gtest.h" namespace mojo { @@ -55,11 +55,11 @@ } // This implements the generated Chromium variant of RectService. -class ChromiumRectServiceImpl : public chromium::RectService { +class ChromiumRectServiceImpl : public RectService { public: ChromiumRectServiceImpl() {} - // mojo::test::chromium::RectService: + // mojo::test::RectService: void AddRect(const RectChromium& r) override { if (r.GetArea() > largest_rect_.GetArea()) largest_rect_ = r; @@ -74,11 +74,11 @@ }; // This implements the generated Blink variant of RectService. -class BlinkRectServiceImpl : public blink::RectService { +class BlinkRectServiceImpl : public wtf::RectService { public: BlinkRectServiceImpl() {} - // mojo::test::blink::RectService: + // mojo::test::wtf::RectService: void AddRect(const RectBlink& r) override { if (r.computeArea() > largest_rect_.computeArea()) { largest_rect_.setX(r.x()); @@ -103,22 +103,22 @@ StructTraitsTest() {} protected: - void BindToChromiumService(chromium::RectServiceRequest request) { + void BindToChromiumService(RectServiceRequest request) { chromium_bindings_.AddBinding(&chromium_service_, std::move(request)); } - void BindToChromiumService(blink::RectServiceRequest request) { + void BindToChromiumService(wtf::RectServiceRequest request) { chromium_bindings_.AddBinding( &chromium_service_, - ConvertInterfaceRequest<chromium::RectService>(std::move(request))); + ConvertInterfaceRequest<RectService>(std::move(request))); } - void BindToBlinkService(blink::RectServiceRequest request) { + void BindToBlinkService(wtf::RectServiceRequest request) { blink_bindings_.AddBinding(&blink_service_, std::move(request)); } - void BindToBlinkService(chromium::RectServiceRequest request) { + void BindToBlinkService(RectServiceRequest request) { blink_bindings_.AddBinding( &blink_service_, - ConvertInterfaceRequest<blink::RectService>(std::move(request))); + ConvertInterfaceRequest<wtf::RectService>(std::move(request))); } TraitsTestServicePtr GetTraitsTestProxy() { @@ -136,10 +136,10 @@ base::MessageLoop loop_; ChromiumRectServiceImpl chromium_service_; - BindingSet<chromium::RectService> chromium_bindings_; + BindingSet<RectService> chromium_bindings_; BlinkRectServiceImpl blink_service_; - BindingSet<blink::RectService> blink_bindings_; + BindingSet<wtf::RectService> blink_bindings_; BindingSet<TraitsTestService> traits_test_bindings_; }; @@ -147,7 +147,7 @@ } // namespace TEST_F(StructTraitsTest, ChromiumProxyToChromiumService) { - chromium::RectServicePtr chromium_proxy; + RectServicePtr chromium_proxy; BindToChromiumService(GetProxy(&chromium_proxy)); { base::RunLoop loop; @@ -160,7 +160,7 @@ } TEST_F(StructTraitsTest, ChromiumToBlinkService) { - chromium::RectServicePtr chromium_proxy; + RectServicePtr chromium_proxy; BindToBlinkService(GetProxy(&chromium_proxy)); { base::RunLoop loop; @@ -183,7 +183,7 @@ } TEST_F(StructTraitsTest, BlinkProxyToBlinkService) { - blink::RectServicePtr blink_proxy; + wtf::RectServicePtr blink_proxy; BindToBlinkService(GetProxy(&blink_proxy)); { base::RunLoop loop; @@ -196,7 +196,7 @@ } TEST_F(StructTraitsTest, BlinkProxyToChromiumService) { - blink::RectServicePtr blink_proxy; + wtf::RectServicePtr blink_proxy; BindToChromiumService(GetProxy(&blink_proxy)); { base::RunLoop loop;
diff --git a/mojo/public/cpp/bindings/tests/struct_with_traits.typemap b/mojo/public/cpp/bindings/tests/struct_with_traits.typemap new file mode 100644 index 0000000..9e39a1fc --- /dev/null +++ b/mojo/public/cpp/bindings/tests/struct_with_traits.typemap
@@ -0,0 +1,18 @@ +# 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. + +mojom = "//mojo/public/interfaces/bindings/tests/struct_with_traits.mojom" +public_headers = + [ "//mojo/public/cpp/bindings/tests/struct_with_traits_impl.h" ] +traits_headers = + [ "//mojo/public/cpp/bindings/tests/struct_with_traits_impl_traits.h" ] +sources = [ + "//mojo/public/cpp/bindings/tests/struct_with_traits_impl_traits.cc", +] +deps = [ + "//mojo/public/cpp/bindings/tests:struct_with_traits_impl", +] + +type_mappings = + [ "mojo.test.StructWithTraits=mojo::test::StructWithTraitsImpl" ]
diff --git a/mojo/public/cpp/bindings/tests/struct_with_traits_impl.h b/mojo/public/cpp/bindings/tests/struct_with_traits_impl.h index b10c8b3..3ba8ef64 100644 --- a/mojo/public/cpp/bindings/tests/struct_with_traits_impl.h +++ b/mojo/public/cpp/bindings/tests/struct_with_traits_impl.h
@@ -10,16 +10,10 @@ #include <string> #include "base/strings/string_piece.h" -#include "mojo/public/cpp/bindings/struct_traits.h" namespace mojo { namespace test { -// The mojom types are forward-declared to avoid circular dependencies between -// this and generated headers. -class StructWithTraits; -class StructWithTraits_Reader; - // A type which knows how to look like a mojo::test::StructWithTraits mojom type // by way of mojo::StructTraits. class StructWithTraitsImpl {
diff --git a/mojo/public/cpp/bindings/tests/struct_with_traits_impl_traits.h b/mojo/public/cpp/bindings/tests/struct_with_traits_impl_traits.h index e945abca..fa0fbab 100644 --- a/mojo/public/cpp/bindings/tests/struct_with_traits_impl_traits.h +++ b/mojo/public/cpp/bindings/tests/struct_with_traits_impl_traits.h
@@ -14,6 +14,10 @@ #include "mojo/public/cpp/bindings/tests/struct_with_traits_impl.h" namespace mojo { +namespace test { +class StructWithTraits; +class StructWithTraits_Reader; +} template <> struct StructTraits<test::StructWithTraits, test::StructWithTraitsImpl> {
diff --git a/mojo/public/cpp/bindings/tests/test_native_types_blink.typemap b/mojo/public/cpp/bindings/tests/test_native_types_blink.typemap new file mode 100644 index 0000000..34d289a --- /dev/null +++ b/mojo/public/cpp/bindings/tests/test_native_types_blink.typemap
@@ -0,0 +1,11 @@ +# 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. + +mojom = "//mojo/public/interfaces/bindings/tests/test_native_types.mojom" +public_headers = [ "//mojo/public/cpp/bindings/tests/pickled_struct_blink.h" ] +sources = [ + "//mojo/public/cpp/bindings/tests/pickled_struct_blink.cc", +] + +type_mappings = [ "mojo.test.PickledStruct=mojo::test::PickledStructBlink" ]
diff --git a/mojo/public/cpp/bindings/tests/test_native_types_chromium.typemap b/mojo/public/cpp/bindings/tests/test_native_types_chromium.typemap new file mode 100644 index 0000000..d7786733 --- /dev/null +++ b/mojo/public/cpp/bindings/tests/test_native_types_chromium.typemap
@@ -0,0 +1,15 @@ +# 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. + +mojom = "//mojo/public/interfaces/bindings/tests/test_native_types.mojom" +public_headers = + [ "//mojo/public/cpp/bindings/tests/pickled_struct_chromium.h" ] +sources = [ + "//mojo/public/cpp/bindings/tests/pickled_struct_chromium.cc", +] +deps = [ + "//ipc:param_traits", +] + +type_mappings = [ "mojo.test.PickledStruct=mojo::test::PickledStructChromium" ]
diff --git a/mojo/public/cpp/bindings/tests/wtf_types_unittest.cc b/mojo/public/cpp/bindings/tests/wtf_types_unittest.cc index ef781bc..bc391d32 100644 --- a/mojo/public/cpp/bindings/tests/wtf_types_unittest.cc +++ b/mojo/public/cpp/bindings/tests/wtf_types_unittest.cc
@@ -10,7 +10,7 @@ #include "mojo/public/cpp/bindings/lib/serialization.h" #include "mojo/public/cpp/bindings/lib/wtf_serialization.h" #include "mojo/public/cpp/bindings/tests/variant_test_util.h" -#include "mojo/public/interfaces/bindings/tests/test_wtf_types.mojom-blink.h" +#include "mojo/public/interfaces/bindings/tests/test_wtf_types.mojom-wtf.h" #include "mojo/public/interfaces/bindings/tests/test_wtf_types.mojom.h" #include "testing/gtest/include/gtest/gtest.h" @@ -107,7 +107,7 @@ } TEST_F(WTFTypesTest, SendString) { - blink::TestWTFPtr ptr; + wtf::TestWTFPtr ptr; TestWTFImpl impl(ConvertInterfaceRequest<TestWTF>(GetProxy(&ptr))); WTFArray<WTF::String> strs = ConstructStringArray(); @@ -128,7 +128,7 @@ } TEST_F(WTFTypesTest, SendStringArray) { - blink::TestWTFPtr ptr; + wtf::TestWTFPtr ptr; TestWTFImpl impl(ConvertInterfaceRequest<TestWTF>(GetProxy(&ptr))); WTFArray<WTF::String> arrs[3];
diff --git a/mojo/public/interfaces/bindings/tests/BUILD.gn b/mojo/public/interfaces/bindings/tests/BUILD.gn index 3e4bb647..635b615 100644 --- a/mojo/public/interfaces/bindings/tests/BUILD.gn +++ b/mojo/public/interfaces/bindings/tests/BUILD.gn
@@ -4,29 +4,61 @@ import("../../../tools/bindings/mojom.gni") -test_interfaces_mojom = [ - "math_calculator.mojom", - "no_module.mojom", - "ping_service.mojom", - "rect.mojom", - "regression_tests.mojom", - "sample_factory.mojom", - "sample_import.mojom", - "sample_import2.mojom", - "sample_interfaces.mojom", - "sample_service.mojom", - "scoping.mojom", - "serialization_test_structs.mojom", - "test_constants.mojom", - "test_native_types.mojom", - "test_structs.mojom", - "test_sync_methods.mojom", - "validation_test_interfaces.mojom", -] - mojom("test_interfaces") { testonly = true - sources = test_interfaces_mojom + sources = [ + "math_calculator.mojom", + "no_module.mojom", + "ping_service.mojom", + "rect.mojom", + "regression_tests.mojom", + "sample_factory.mojom", + "sample_interfaces.mojom", + "sample_service.mojom", + "scoping.mojom", + "serialization_test_structs.mojom", + "test_constants.mojom", + "test_native_types.mojom", + "test_structs.mojom", + "test_sync_methods.mojom", + "validation_test_interfaces.mojom", + ] + public_deps = [ + ":test_mojom_import", + ":test_mojom_import2", + ] +} + +mojom("test_mojom_import") { + testonly = true + sources = [ + "sample_import.mojom", + ] +} + +mojom("test_mojom_import_wrapper") { + testonly = true + public_deps = [ + ":test_mojom_import", + ] +} + +mojom("test_mojom_import_wrapper_wrapper") { + testonly = true + public_deps = [ + ":test_mojom_import_wrapper", + ] +} + +mojom("test_mojom_import2") { + testonly = true + sources = [ + "sample_import2.mojom", + ] + public_deps = [ + ":test_mojom_import", + ":test_mojom_import_wrapper_wrapper", + ] } mojom("test_struct_traits_interfaces") { @@ -34,8 +66,6 @@ sources = [ "struct_with_traits.mojom", ] - - typemaps = [ "struct_with_traits.typemap" ] } mojom("test_interfaces_experimental") { @@ -69,24 +99,6 @@ ] } -mojom("test_interfaces_chromium") { - testonly = true - - sources = test_interfaces_mojom - - variant = "chromium" - typemaps = [ "chromium_test.typemap" ] -} - -mojom("test_interfaces_blink") { - testonly = true - - sources = test_interfaces_mojom - - variant = "blink" - typemaps = [ "blink_test.typemap" ] -} - mojom("test_wtf_types") { testonly = true @@ -95,24 +107,10 @@ ] } -mojom("test_wtf_types_blink") { +mojom("test_no_sources") { testonly = true - sources = [ - "test_wtf_types.mojom", + public_deps = [ + ":test_interfaces", ] - - for_blink = true - variant = "blink" -} - -mojom("test_variant") { - testonly = true - - sources = [ - "test_variant.mojom", - "test_variant_import.mojom", - ] - - variant = "variant_test" }
diff --git a/mojo/public/interfaces/bindings/tests/blink_test.typemap b/mojo/public/interfaces/bindings/tests/blink_test.typemap deleted file mode 100644 index 94a7d68f..0000000 --- a/mojo/public/interfaces/bindings/tests/blink_test.typemap +++ /dev/null
@@ -1,23 +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. - -{ - "c++": { - "mojo.test.PickledStruct": { - "typename": "mojo::test::PickledStructBlink", - "public_headers": [ - "mojo/public/cpp/bindings/tests/pickled_struct_blink.h" - ] - }, - "mojo.test.TypemappedRect": { - "typename": "mojo::test::RectBlink", - "public_headers": [ - "mojo/public/cpp/bindings/tests/rect_blink.h" - ], - "traits_headers": [ - "mojo/public/cpp/bindings/tests/rect_blink_traits.h" - ] - } - } -}
diff --git a/mojo/public/interfaces/bindings/tests/chromium_test.typemap b/mojo/public/interfaces/bindings/tests/chromium_test.typemap deleted file mode 100644 index 57474b12..0000000 --- a/mojo/public/interfaces/bindings/tests/chromium_test.typemap +++ /dev/null
@@ -1,23 +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. - -{ - "c++": { - "mojo.test.PickledStruct": { - "typename": "mojo::test::PickledStructChromium", - "public_headers": [ - "mojo/public/cpp/bindings/tests/pickled_struct_chromium.h" - ] - }, - "mojo.test.TypemappedRect": { - "typename": "mojo::test::RectChromium", - "public_headers": [ - "mojo/public/cpp/bindings/tests/rect_chromium.h" - ], - "traits_headers": [ - "mojo/public/cpp/bindings/tests/rect_chromium_traits.h" - ] - } - } -}
diff --git a/mojo/public/interfaces/bindings/tests/struct_with_traits.typemap b/mojo/public/interfaces/bindings/tests/struct_with_traits.typemap deleted file mode 100644 index 0d6e7b2..0000000 --- a/mojo/public/interfaces/bindings/tests/struct_with_traits.typemap +++ /dev/null
@@ -1,17 +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. - -{ - "c++": { - "mojo.test.StructWithTraits": { - "typename": "mojo::test::StructWithTraitsImpl", - "public_headers": [ - "mojo/public/cpp/bindings/tests/struct_with_traits_impl.h" - ], - "traits_headers": [ - "mojo/public/cpp/bindings/tests/struct_with_traits_impl_traits.h" - ] - } - } -}
diff --git a/mojo/public/interfaces/bindings/tests/test_variant.mojom b/mojo/public/interfaces/bindings/tests/test_variant.mojom deleted file mode 100644 index 8c36985..0000000 --- a/mojo/public/interfaces/bindings/tests/test_variant.mojom +++ /dev/null
@@ -1,17 +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. - -module mojo.test; - -import "test_variant_import.mojom"; - -enum TestEnum { - VALUE1, - VALUE2 -}; - -interface TestUseImportedType { - Use(mojo.test.test_import.ImportedType param) - => (mojo.test.test_import.ImportedType param); -};
diff --git a/mojo/public/tools/bindings/blink_bindings_configuration.gni b/mojo/public/tools/bindings/blink_bindings_configuration.gni new file mode 100644 index 0000000..2a191fa4 --- /dev/null +++ b/mojo/public/tools/bindings/blink_bindings_configuration.gni
@@ -0,0 +1,33 @@ +# 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. + +variant = "wtf" + +for_blink = true + +_typemap_imports = [ "//mojo/public/cpp/bindings/tests/blink_typemaps.gni" ] +_typemaps = [] + +foreach(typemap_import, _typemap_imports) { + _imported = read_file(typemap_import, "scope") + _typemaps += _imported.typemaps +} + +typemaps = [] +foreach(typemap, _typemaps) { + typemaps += [ read_file(typemap, "scope") ] +} + +blacklist = [ + # TODO(sammc): Remove the following once |for_blink| bindings support WTF + # maps. See https://crbug.com/583738. + "//components/mus/public/interfaces/window_manager.mojom", + "//components/mus/public/interfaces/window_tree.mojom", + "//extensions/common/api/mime_handler.mojom", + "//mojo/public/interfaces/bindings/tests/test_structs.mojom", + "//mojo/public/interfaces/bindings/tests/test_unions.mojom", + "//mojo/public/interfaces/bindings/tests/validation_test_interfaces.mojom", + "//services/catalog/public/interfaces/catalog.mojom", + "//services/shell/public/interfaces/capabilities.mojom", +]
diff --git a/mojo/public/tools/bindings/chromium_bindings_configuration.gni b/mojo/public/tools/bindings/chromium_bindings_configuration.gni new file mode 100644 index 0000000..0d44d6f --- /dev/null +++ b/mojo/public/tools/bindings/chromium_bindings_configuration.gni
@@ -0,0 +1,21 @@ +# 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. + +_typemap_imports = [ + "//gpu/command_buffer/common/typemaps.gni", + "//mojo/common/typemaps.gni", + "//mojo/public/cpp/bindings/tests/chromium_typemaps.gni", + "//url/mojo/typemaps.gni", +] +_typemaps = [] + +foreach(typemap_import, _typemap_imports) { + _imported = read_file(typemap_import, "scope") + _typemaps += _imported.typemaps +} + +typemaps = [] +foreach(typemap, _typemaps) { + typemaps += [ read_file(typemap, "scope") ] +}
diff --git a/mojo/public/tools/bindings/format_typemap_generator_args.py b/mojo/public/tools/bindings/format_typemap_generator_args.py new file mode 100755 index 0000000..5057d6c --- /dev/null +++ b/mojo/public/tools/bindings/format_typemap_generator_args.py
@@ -0,0 +1,34 @@ +#!/usr/bin/env python +# 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 sys + +# This utility converts mojom dependencies into their corresponding typemap +# paths and formats them to be consumed by generate_type_mappings.py. + + +def FormatTypemap(typemap_filename): + # A simple typemap is valid Python with a minor alteration. + with open(typemap_filename) as f: + typemap_content = f.read().replace('=\n', '=') + typemap = {} + exec typemap_content in typemap + + for header in typemap.get('public_headers', []): + yield 'public_headers=%s' % header + for header in typemap.get('traits_headers', []): + yield 'traits_headers=%s' % header + for header in typemap.get('type_mappings', []): + yield 'type_mappings=%s' % header + + +def main(): + typemaps = sys.argv[1:] + print ' '.join('--start-typemap %s' % ' '.join(FormatTypemap(typemap)) + for typemap in typemaps) + + +if __name__ == '__main__': + sys.exit(main())
diff --git a/mojo/public/tools/bindings/generate_type_mappings.py b/mojo/public/tools/bindings/generate_type_mappings.py new file mode 100755 index 0000000..20d0c72 --- /dev/null +++ b/mojo/public/tools/bindings/generate_type_mappings.py
@@ -0,0 +1,123 @@ +#!/usr/bin/env python +# 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. +"""Generates a JSON typemap from its command-line arguments and dependencies. + +Each typemap should be specified in an command-line argument of the form +key=value, with an argument of "--start-typemap" preceding each typemap. + +For example, +generate_type_mappings.py --output=foo.typemap --start-typemap \\ + public_headers=foo.h traits_headers=foo_traits.h \\ + type_mappings=mojom.Foo=FooImpl + +generates a foo.typemap containing +{ + "c++": { + "mojom.Foo": { + "typename": "FooImpl", + "traits_headers": [ + "foo_traits.h" + ], + "public_headers": [ + "foo.h" + ] + } + } +} + +Then, +generate_type_mappings.py --dependency foo.typemap --output=bar.typemap \\ + --start-typemap public_headers=bar.h traits_headers=bar_traits.h \\ + type_mappings=mojom.Bar=BarImpl + +generates a bar.typemap containing +{ + "c++": { + "mojom.Bar": { + "typename": "BarImpl", + "traits_headers": [ + "bar_traits.h" + ], + "public_headers": [ + "bar.h" + ] + }, + "mojom.Foo": { + "typename": "FooImpl", + "traits_headers": [ + "foo_traits.h" + ], + "public_headers": [ + "foo.h" + ] + } + } +} +""" + +import argparse +import json +import os + + +def ReadTypemap(path): + with open(path) as f: + return json.load(f)['c++'] + + +def ParseTypemapArgs(args): + typemaps = [s for s in '\n'.join(args).split('--start-typemap\n') if s] + result = {} + for typemap in typemaps: + result.update(ParseTypemap(typemap)) + return result + + +def ParseTypemap(typemap): + values = {'type_mappings': [], 'public_headers': [], 'traits_headers': []} + for line in typemap.split('\n'): + if not line: + continue + key, _, value = line.partition('=') + values[key].append(value.lstrip('/')) + result = {} + for typename in values['type_mappings']: + mojom_type, _, native_type = typename.partition('=') + result[mojom_type] = { + 'typename': native_type, + 'public_headers': values['public_headers'], + 'traits_headers': values['traits_headers'], + } + return result + + +def main(): + parser = argparse.ArgumentParser( + description=__doc__, + formatter_class=argparse.RawDescriptionHelpFormatter) + parser.add_argument( + '--dependency', + type=str, + action='append', + default=[], + help=('A path to another JSON typemap to merge into the output. ' + 'This may be repeated to merge multiple typemaps.')) + parser.add_argument('--output', + type=str, + required=True, + help='The path to which to write the generated JSON.') + params, typemap_params = parser.parse_known_args() + typemaps = ParseTypemapArgs(typemap_params) + missing = [path for path in params.dependency if not os.path.exists(path)] + if missing: + raise IOError('Missing dependencies: %s' % ', '.join(missing)) + for path in params.dependency: + typemaps.update(ReadTypemap(path)) + with open(params.output, 'w') as f: + json.dump({'c++': typemaps}, f, indent=2) + + +if __name__ == '__main__': + main()
diff --git a/mojo/public/tools/bindings/mojom.gni b/mojo/public/tools/bindings/mojom.gni index 14ddb2f..ccee9c3b 100644 --- a/mojo/public/tools/bindings/mojom.gni +++ b/mojo/public/tools/bindings/mojom.gni
@@ -25,6 +25,15 @@ "$mojom_generator_script", ] +_bindings_configuration_files = [ + "//mojo/public/tools/bindings/chromium_bindings_configuration.gni", + "//mojo/public/tools/bindings/blink_bindings_configuration.gni", +] +_bindings_configurations = [] +foreach(config_file, _bindings_configuration_files) { + _bindings_configurations += [ read_file(config_file, "scope") ] +} + # Generate C++/JavaScript/Java source files from mojom files. The output files # will go under the generated file directory tree with the same path as each # input file. @@ -46,161 +55,15 @@ # import_dirs (optional) # List of import directories that will get added when processing sources. # -# typemaps (optional) -# A list of typemap files to apply during bindings generation. -# -# typemap_deps (optional) -# A list of public dependencies needed to support active typemaps. -# -# variant (optional) -# A variant name to apply to generated bindings. Variant influences -# generated source filenames as wells the symbols they define. -# # testonly (optional) # # visibility (optional) -# -# for_blink (optional, C++ only) -# Use WTF types as generated type for mojo string/array/map. template("mojom") { assert( defined(invoker.sources) || defined(invoker.deps) || defined(invoker.public_deps), "\"sources\" or \"deps\" must be defined for the $target_name template.") - cpp_sources_suffix = "cpp_sources" - cpp_sources_target_name = "${target_name}_${cpp_sources_suffix}" - cpp_only = false - if (defined(invoker.sources)) { - if (defined(invoker.variant)) { - variant = invoker.variant - cpp_only = true - generator_cpp_outputs = [ - "{{source_gen_dir}}/{{source_name_part}}.mojom-${variant}.cc", - "{{source_gen_dir}}/{{source_name_part}}.mojom-${variant}.h", - "{{source_gen_dir}}/{{source_name_part}}.mojom-${variant}-internal.h", - ] - } else { - generator_cpp_outputs = [ - "{{source_gen_dir}}/{{source_name_part}}.mojom.cc", - "{{source_gen_dir}}/{{source_name_part}}.mojom.h", - "{{source_gen_dir}}/{{source_name_part}}.mojom-internal.h", - ] - } - } - - if (cpp_only) { - generator_js_outputs = [] - generator_java_outputs = [] - } else { - generator_js_outputs = - [ "{{source_gen_dir}}/{{source_name_part}}.mojom.js" ] - generator_java_outputs = - [ "{{source_gen_dir}}/{{source_name_part}}.mojom.srcjar" ] - } - - if (defined(invoker.sources)) { - generator_target_name = target_name + "__generator" - action_foreach(generator_target_name) { - script = mojom_generator_script - inputs = mojom_generator_sources - sources = invoker.sources - deps = [ - "//mojo/public/tools/bindings:precompile_templates", - ] - outputs = - generator_cpp_outputs + generator_java_outputs + generator_js_outputs - args = [ - "--use_bundled_pylibs", - "generate", - "{{source}}", - "-d", - rebase_path("//", root_build_dir), - "-I", - rebase_path("//", root_build_dir), - "-o", - rebase_path(root_gen_dir), - "--bytecode_path", - rebase_path("$root_gen_dir/mojo/public/tools/bindings"), - ] - - if (defined(invoker.import_dirs)) { - foreach(import_dir, invoker.import_dirs) { - args += [ - "-I", - rebase_path(import_dir, root_build_dir), - ] - } - } - - if (cpp_only) { - args += [ - "-g", - "c++", - ] - } else { - args += [ - "-g", - "c++,javascript,java", - ] - } - - if (defined(invoker.variant)) { - args += [ - "--variant", - invoker.variant, - ] - } - - if (defined(invoker.typemaps)) { - foreach(typemap, invoker.typemaps) { - args += [ - "--typemap", - rebase_path(typemap, root_build_dir), - ] - } - inputs += invoker.typemaps - } - - if (defined(invoker.for_blink) && invoker.for_blink) { - args += [ "--for_blink" ] - } - } - } - - source_set(target_name) { - if (defined(invoker.visibility)) { - visibility = invoker.visibility - } - if (defined(invoker.testonly)) { - testonly = invoker.testonly - } - if (defined(invoker.sources) && !defined(invoker.variant)) { - data = process_file_template(invoker.sources, generator_js_outputs) - } - - public_deps = [ - "//mojo/public/cpp/bindings", - ] - if (defined(invoker.sources)) { - public_deps += [ ":${cpp_sources_target_name}" ] - } - if (defined(invoker.deps)) { - public_deps += invoker.deps - } - if (defined(invoker.public_deps)) { - public_deps += invoker.public_deps - } - if (defined(invoker.typemap_deps)) { - public_deps += invoker.typemap_deps - } - - deps = [] - if (defined(invoker.sources)) { - public_deps += [ ":$generator_target_name" ] - } - } - all_deps = [] if (defined(invoker.deps)) { all_deps += invoker.deps @@ -209,26 +72,226 @@ all_deps += invoker.public_deps } - if (defined(invoker.variant)) { - variant_suffix = "of_variant_${invoker.variant}" - } else { - variant_suffix = "of_no_variant" - } - group("${target_name}__is_mojom_${variant_suffix}") { + group("${target_name}__is_mojom") { } # Explicitly ensure that all dependencies (invoker.deps and - # invoker.public_deps) are mojom targets of the same variant themselves. - group("${target_name}__check_deps_are_all_mojom_${variant_suffix}") { + # invoker.public_deps) are mojom targets. + group("${target_name}__check_deps_are_all_mojom") { deps = [] foreach(d, all_deps) { name = get_label_info(d, "label_no_toolchain") toolchain = get_label_info(d, "toolchain") - deps += [ "${name}__is_mojom_${variant_suffix}(${toolchain})" ] + deps += [ "${name}__is_mojom(${toolchain})" ] } } - if (defined(invoker.sources)) { + foreach(bindings_configuration, _bindings_configurations) { + cpp_only = false + variant_suffix = "" + if (defined(bindings_configuration.variant)) { + variant = bindings_configuration.variant + variant_suffix = "_${variant}" + cpp_only = true + } + type_mappings_target_name = "${target_name}${variant_suffix}__type_mappings" + type_mappings_path = + "$target_gen_dir/${target_name}${variant_suffix}__type_mappings" + active_typemaps = [] + cpp_sources_suffix = "cpp_sources" + cpp_sources_target_name = + "${target_name}${variant_suffix}_${cpp_sources_suffix}" + enabled_sources = [] + if (defined(invoker.sources)) { + generator_cpp_outputs = [] + generator_js_outputs = [] + generator_java_outputs = [] + variant_dash_suffix = "" + if (defined(variant)) { + variant_dash_suffix = "-${variant}" + } + generator_cpp_outputs += [ + "{{source_gen_dir}}/{{source_name_part}}.mojom${variant_dash_suffix}.cc", + "{{source_gen_dir}}/{{source_name_part}}.mojom${variant_dash_suffix}.h", + "{{source_gen_dir}}/{{source_name_part}}.mojom${variant_dash_suffix}-internal.h", + ] + enabled_sources = [] + if (defined(bindings_configuration.blacklist)) { + foreach(source, invoker.sources) { + blacklisted = false + foreach(blacklisted_source, bindings_configuration.blacklist) { + if (get_path_info(source, "abspath") == blacklisted_source) { + blacklisted = true + } + } + if (!blacklisted) { + enabled_sources += [ source ] + } + } + } else { + enabled_sources = invoker.sources + } + foreach(source, enabled_sources) { + # TODO(sammc): Use a map instead of a linear scan when GN supports maps. + foreach(typemap, bindings_configuration.typemaps) { + if (get_path_info(source, "abspath") == typemap.mojom) { + active_typemaps += [ typemap ] + } + } + } + + if (!cpp_only) { + generator_js_outputs = + [ "{{source_gen_dir}}/{{source_name_part}}.mojom.js" ] + generator_java_outputs = + [ "{{source_gen_dir}}/{{source_name_part}}.mojom.srcjar" ] + } + generator_target_name = "${target_name}${variant_suffix}__generator" + action_foreach(generator_target_name) { + script = mojom_generator_script + inputs = mojom_generator_sources + sources = invoker.sources + deps = [ + ":$type_mappings_target_name", + "//mojo/public/tools/bindings:precompile_templates", + ] + outputs = generator_cpp_outputs + generator_java_outputs + + generator_js_outputs + args = [ + "--use_bundled_pylibs", + "generate", + "{{source}}", + "-d", + rebase_path("//", root_build_dir), + "-I", + rebase_path("//", root_build_dir), + "-o", + rebase_path(root_gen_dir), + "--bytecode_path", + rebase_path("$root_gen_dir/mojo/public/tools/bindings"), + ] + + if (defined(invoker.import_dirs)) { + foreach(import_dir, invoker.import_dirs) { + args += [ + "-I", + rebase_path(import_dir, root_build_dir), + ] + } + } + + if (cpp_only) { + args += [ + "-g", + "c++", + ] + } else { + args += [ + "-g", + "c++,javascript,java", + ] + } + + if (defined(bindings_configuration.variant)) { + args += [ + "--variant", + bindings_configuration.variant, + ] + } + + args += [ + "--typemap", + rebase_path(type_mappings_path, root_build_dir), + ] + + if (defined(bindings_configuration.for_blink) && + bindings_configuration.for_blink) { + args += [ "--for_blink" ] + } + } + } + + action(type_mappings_target_name) { + outputs = [ + type_mappings_path, + ] + script = "$mojom_generator_root/generate_type_mappings.py" + deps = [] + args = [ + "--output", + rebase_path(type_mappings_path, root_build_dir), + ] + + foreach(d, all_deps) { + name = get_label_info(d, "label_no_toolchain") + toolchain = get_label_info(d, "toolchain") + dependency_output = "${name}${variant_suffix}__type_mappings" + dependency_target = "${dependency_output}(${toolchain})" + deps += [ dependency_target ] + dependency_output_dir = + get_label_info(dependency_output, "target_gen_dir") + dependency_name = get_label_info(dependency_output, "name") + dependency_path = + rebase_path("$dependency_output_dir/${dependency_name}", + root_build_dir) + args += [ + "--dependency", + dependency_path, + ] + } + + if (enabled_sources != []) { + # TODO(sammc): Pass the typemap description in a file to avoid command + # line length limitations. + typemap_description = [] + foreach(typemap, active_typemaps) { + typemap_description += [ "--start-typemap" ] + if (defined(typemap.public_headers)) { + foreach(value, typemap.public_headers) { + typemap_description += [ "public_headers=$value" ] + } + } + if (defined(typemap.traits_headers)) { + foreach(value, typemap.traits_headers) { + typemap_description += [ "traits_headers=$value" ] + } + } + foreach(value, typemap.type_mappings) { + typemap_description += [ "type_mappings=$value" ] + } + } + args += typemap_description + } + } + + source_set("${target_name}${variant_suffix}") { + if (defined(invoker.visibility)) { + visibility = invoker.visibility + } + if (defined(invoker.testonly)) { + testonly = invoker.testonly + } + if (defined(invoker.sources) && !defined(bindings_configuration.variant)) { + data = process_file_template(enabled_sources, generator_js_outputs) + } + + public_deps = [ + ":${cpp_sources_target_name}", + "//mojo/public/cpp/bindings", + ] + if (defined(invoker.deps)) { + public_deps += invoker.deps + } + if (defined(invoker.public_deps)) { + public_deps += invoker.public_deps + } + + deps = [] + if (defined(invoker.sources)) { + public_deps += [ ":$generator_target_name" ] + } + } + # The generated C++ source files. The main reason to introduce this target # is so that mojo/public/cpp/bindings can depend on mojom interfaces without # circular dependencies. It means that the target is missing the dependency @@ -239,69 +302,94 @@ if (defined(invoker.testonly)) { testonly = invoker.testonly } - sources = process_file_template(invoker.sources, generator_cpp_outputs) + if (enabled_sources != []) { + sources = process_file_template(enabled_sources, generator_cpp_outputs) + } deps = [ - ":$generator_target_name", + "//mojo/public/cpp/bindings:struct_traits", "//mojo/public/interfaces/bindings:bindings__generator", ] + if (enabled_sources != []) { + deps += [ ":$generator_target_name" ] + } public_deps = [ "//base", ] - if (defined(invoker.typemap_deps)) { - public_deps += invoker.typemap_deps - } foreach(d, all_deps) { # Resolve the name, so that a target //mojo/something becomes # //mojo/something:something and we can append cpp_sources_suffix to # get the cpp dependency name. - full_name = get_label_info(d, "label_no_toolchain") - deps += [ "${full_name}_${cpp_sources_suffix}" ] + full_name = get_label_info("$d", "label_no_toolchain") + deps += [ "${full_name}${variant_suffix}_${cpp_sources_suffix}" ] } - if (defined(invoker.for_blink) && invoker.for_blink) { + foreach(typemap, active_typemaps) { + if (defined(typemap.public_headers)) { + sources += typemap.public_headers + } + if (defined(typemap.traits_headers)) { + sources += typemap.traits_headers + } + if (defined(typemap.sources)) { + sources += typemap.sources + } + if (defined(typemap.deps)) { + deps += typemap.deps + } + } + if (defined(bindings_configuration.for_blink) && + bindings_configuration.for_blink) { public_deps += [ "//mojo/public/cpp/bindings:wtf_support" ] } } - } - if (is_android && !cpp_only) { - import("//build/config/android/rules.gni") + if (!cpp_only && is_android) { + import("//build/config/android/rules.gni") - java_srcjar_target_name = target_name + "_java_sources" - action(java_srcjar_target_name) { - script = "//mojo/public/tools/gn/zip.py" - inputs = process_file_template(invoker.sources, generator_java_outputs) - output = "$target_gen_dir/$target_name.srcjar" - outputs = [ - output, - ] - rebase_inputs = rebase_path(inputs, root_build_dir) - rebase_output = rebase_path(output, root_build_dir) - args = [ - "--zip-inputs=$rebase_inputs", - "--output=$rebase_output", - ] - deps = [ - ":$generator_target_name", - ] - } - - java_target_name = target_name + "_java" - android_library(java_target_name) { - deps = [ - "//base:base_java", - "//mojo/public/java:bindings", - "//mojo/public/java:system", - ] - - foreach(d, all_deps) { - # Resolve the name, so that a target //mojo/something becomes - # //mojo/something:something and we can append "_java" to get the java - # dependency name. - full_name = get_label_info(d, "label_no_toolchain") - deps += [ "${full_name}_java" ] + java_srcjar_target_name = target_name + "_java_sources" + action(java_srcjar_target_name) { + script = "//mojo/public/tools/gn/zip.py" + inputs = [] + if (enabled_sources != []) { + inputs = + process_file_template(enabled_sources, generator_java_outputs) + } + output = "$target_gen_dir/$target_name.srcjar" + outputs = [ + output, + ] + rebase_inputs = rebase_path(inputs, root_build_dir) + rebase_output = rebase_path(output, root_build_dir) + args = [ + "--zip-inputs=$rebase_inputs", + "--output=$rebase_output", + ] + deps = [] + if (enabled_sources != []) { + deps = [ + ":$generator_target_name", + ] + } } - srcjar_deps = [ ":$java_srcjar_target_name" ] + java_target_name = target_name + "_java" + android_library(java_target_name) { + deps = [ + "//base:base_java", + "//mojo/public/java:bindings", + "//mojo/public/java:system", + ] + + foreach(d, all_deps) { + # Resolve the name, so that a target //mojo/something becomes + # //mojo/something:something and we can append "_java" to get the java + # dependency name. + full_name = get_label_info(d, "label_no_toolchain") + deps += [ "${full_name}_java" ] + } + + srcjar_deps = [ ":$java_srcjar_target_name" ] + run_findbugs = false + } } } }
diff --git a/mojo/public/tools/bindings/mojom_get_generator_typemap_args.py b/mojo/public/tools/bindings/mojom_get_generator_typemap_args.py deleted file mode 100755 index 32eb1ea..0000000 --- a/mojo/public/tools/bindings/mojom_get_generator_typemap_args.py +++ /dev/null
@@ -1,21 +0,0 @@ -#!/usr/bin/env python -# 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 sys - - -# This unfortunate little utility is needed by GYP to intersperse "--typemap" -# flags before each entry in a list of typemaps. The resulting argument list -# can then be fed to the bindings generator. - - -def main(): - for filename in sys.argv[1:]: - print "--typemap" - print filename - - -if __name__ == "__main__": - sys.exit(main())
diff --git a/net/OWNERS b/net/OWNERS index 808c8631..8282dad 100644 --- a/net/OWNERS +++ b/net/OWNERS
@@ -14,7 +14,7 @@ rdsmith@chromium.org rsleevi@chromium.org rtenneti@chromium.org -ttuttle@chromium.org +juliatuttle@chromium.org xunjieli@chromium.org per-file *.isolate=maruel@chromium.org
diff --git a/net/base/load_timing_info.h b/net/base/load_timing_info.h index 8ee5a22..b4654e5 100644 --- a/net/base/load_timing_info.h +++ b/net/base/load_timing_info.h
@@ -38,12 +38,20 @@ // send_end // receive_headers_end // -// Times represent when a request starts/stops blocking on an event, not the -// time the events actually occurred. In particular, in the case of preconnects +// Times represent when a request starts/stops blocking on an event(*), not the +// time the events actually occurred. In particular, in the case of preconnects // and socket reuse, no time may be spent blocking on establishing a connection. // In the case of SPDY, PAC scripts are only run once for each shared session, // so no time may be spent blocking on them. // +// (*) Note 1: push_start and push_end are the exception to this, as they +// represent the operation which is asynchronous to normal request flow and +// hence are provided as absolute values and not converted to "blocking" time. +// +// (*) Note 2: Internally to the network stack, times are those of actual event +// occurrence. URLRequest converts them to time which the network stack was +// blocked on each state, as per resource timing specs. +// // DNS and SSL times are both times for the host, not the proxy, so DNS times // when using proxies are null, and only requests to HTTPS hosts (Not proxies) // have SSL times. One exception to this is when a proxy server itself returns @@ -52,9 +60,6 @@ // See HttpNetworkTransaction::OnHttpsProxyTunnelResponse. // TODO(mmenke): Is this worth fixing? // -// Note that internal to the network stack, times are when events actually -// occurred. URLRequest converts them to time which the network stack was -// blocked on each state. struct NET_EXPORT LoadTimingInfo { // Contains the LoadTimingInfo events related to establishing a connection. // These are all set by ConnectJobs. @@ -136,6 +141,13 @@ // The time at which the end of the HTTP headers were received. base::TimeTicks receive_headers_end; + + // In case the resource was proactively pushed by the server, these are + // the times that push started and ended. Note that push_end will be null + // if the request is still being transmitted, i.e. the underlying h2 stream + // is not closed by the server. + base::TimeTicks push_start; + base::TimeTicks push_end; }; } // namespace net
diff --git a/net/base/load_timing_info_test_util.cc b/net/base/load_timing_info_test_util.cc index a34a5832..84410d56 100644 --- a/net/base/load_timing_info_test_util.cc +++ b/net/base/load_timing_info_test_util.cc
@@ -54,6 +54,8 @@ EXPECT_TRUE(load_timing_info.send_start.is_null()); EXPECT_TRUE(load_timing_info.send_end.is_null()); EXPECT_TRUE(load_timing_info.receive_headers_end.is_null()); + EXPECT_TRUE(load_timing_info.push_start.is_null()); + EXPECT_TRUE(load_timing_info.push_end.is_null()); } } // namespace net
diff --git a/net/data/verify_certificate_chain_unittest/common.py b/net/data/verify_certificate_chain_unittest/common.py index c7e98d1..5a6c3ec 100755 --- a/net/data/verify_certificate_chain_unittest/common.py +++ b/net/data/verify_certificate_chain_unittest/common.py
@@ -24,14 +24,20 @@ TYPE_CA = 2 TYPE_END_ENTITY = 3 -# January 1st, 2015 midnight UTC +# March 1st, 2015 12:00 UTC +MARCH_1_2015_UTC = '150301120000Z' + +# March 2nd, 2015 12:00 UTC +MARCH_2_2015_UTC = '150302120000Z' + +# January 1st, 2015 12:00 UTC JANUARY_1_2015_UTC = '150101120000Z' -# January 1st, 2016 midnight UTC +# January 1st, 2016 12:00 UTC JANUARY_1_2016_UTC = '160101120000Z' -# March 2nd, 2015 midnight UTC -DEFAULT_TIME = '150302120000Z' +# The default time tests should use when verifying. +DEFAULT_TIME = MARCH_2_2015_UTC # Counter used to generate unique (but readable) path names. g_cur_path_id = 0
diff --git a/net/data/verify_certificate_chain_unittest/expired-intermediary.pem b/net/data/verify_certificate_chain_unittest/expired-intermediary.pem index f0bad52..f3f2054 100644 --- a/net/data/verify_certificate_chain_unittest/expired-intermediary.pem +++ b/net/data/verify_certificate_chain_unittest/expired-intermediary.pem
@@ -17,30 +17,30 @@ Public Key Algorithm: rsaEncryption Public-Key: (2048 bit) Modulus: - 00:b4:33:49:77:46:22:00:7b:a3:98:45:15:f7:e4: - 40:bc:c7:d1:86:bf:05:3b:c7:57:d7:12:e4:b0:aa: - 58:38:e7:bb:2f:1a:54:91:a8:78:39:d1:bd:67:5c: - c6:d5:08:44:d0:98:7e:7f:69:03:2a:5d:cd:f9:51: - 13:44:50:62:c4:ca:44:3e:1d:ea:bc:fd:eb:21:57: - e2:cd:85:3d:fe:70:e1:e8:92:c4:5f:68:67:4e:53: - 96:6b:02:59:39:31:c9:8b:fe:71:17:b3:b7:14:77: - 1b:89:b4:f8:ec:c5:b1:53:dd:42:ca:40:cd:14:c0: - 8a:b7:f6:32:72:16:d0:37:72:de:62:9f:49:e5:c3: - 2e:22:bc:a0:04:a7:d5:11:56:54:9f:7f:0e:92:f3: - 7a:88:bb:74:2e:19:3f:02:9e:69:fa:b4:bd:57:38: - 3d:19:99:48:f4:c1:07:57:91:52:db:63:dc:8b:0c: - ca:74:85:1a:cd:f1:8c:3f:b9:9f:61:44:31:f8:86: - ef:c1:ff:31:e7:fb:cd:7a:59:30:b2:8b:9c:5e:71: - 41:04:11:96:e4:8a:a7:8e:0e:58:76:ac:0f:1c:eb: - 1e:dc:0f:01:4f:ad:4e:29:ba:9b:40:7f:f5:c8:51: - 0c:8b:a9:19:01:51:c3:23:71:25:19:be:0c:10:ea: - 46:75 + 00:aa:15:ea:8b:25:e9:de:1a:5f:39:89:dd:71:6d: + 30:a6:24:ca:59:9b:63:ab:c2:18:2d:d4:80:ea:63: + 71:70:2e:fe:ac:c0:7d:01:b1:35:06:7c:ad:a8:8c: + 18:5f:34:16:23:07:78:07:f1:ee:92:08:39:68:1b: + 08:53:c0:4e:68:62:01:e3:5e:3f:6f:bf:84:18:06: + a8:59:8d:81:cc:39:71:b9:49:a8:19:2e:44:49:7b: + 8c:a6:71:15:2c:2a:3d:69:b9:42:5f:48:3c:1b:37: + c0:c0:fa:11:a8:d2:5a:bc:70:43:e3:b5:04:62:42: + 40:bc:5a:8d:f6:bb:27:7a:70:34:9b:dc:a8:12:75: + 0d:1b:5c:1e:81:44:41:7f:57:6e:c6:40:78:f6:a6: + 5b:98:93:61:4d:e6:dd:bd:49:8f:ba:1e:c5:ac:e9: + 3f:b3:d1:c5:c9:dd:db:88:f0:47:5a:fc:fc:ec:b3: + 87:2f:7f:f0:e1:a0:69:05:48:21:58:18:4b:79:e9: + de:92:9c:5f:89:79:68:f7:5e:59:58:9c:09:88:5e: + 7e:1c:6d:1e:ad:41:4d:f2:b9:9f:ef:9a:9b:57:8e: + ff:35:c3:69:2c:35:eb:30:f0:e4:07:94:09:87:a6: + ef:f4:1b:4b:61:47:64:d1:c9:8b:ba:08:e3:9a:01: + 99:43 Exponent: 65537 (0x10001) X509v3 extensions: X509v3 Subject Key Identifier: - 77:E8:2F:D7:FB:5C:C4:E2:A0:B9:44:4F:B4:A7:15:35:41:B6:C8:C3 + 40:79:FB:A7:C3:78:BA:A4:08:EC:1C:B2:14:21:D9:DD:6A:9E:B5:29 X509v3 Authority Key Identifier: - keyid:8C:5E:B2:DE:2B:9F:31:B1:26:55:4D:45:E8:E7:23:87:58:5B:83:D1 + keyid:6D:48:EB:C2:7F:9A:86:86:39:A3:39:79:C1:5B:A7:BD:A9:4E:23:00 Authority Information Access: CA Issuers - URI:http://url-for-aia/Intermediary.cer @@ -55,42 +55,42 @@ X509v3 Extended Key Usage: TLS Web Server Authentication, TLS Web Client Authentication Signature Algorithm: sha256WithRSAEncryption - 96:9d:3f:9e:85:d1:f5:b1:b8:42:a6:13:92:77:ea:af:0a:3e: - f1:2e:73:e5:db:55:e5:08:d9:54:35:67:ed:0c:7a:ec:b4:a6: - 3b:6e:7b:db:44:82:36:84:65:6e:f0:95:bc:a2:10:f3:73:39: - 41:ae:3d:2b:dc:de:3f:9b:8a:bc:67:83:75:83:dd:67:b1:96: - fc:79:0f:ca:89:73:7f:48:83:55:f5:e5:dd:b3:fd:8d:8c:1c: - c1:7f:41:fd:db:ac:59:33:58:0e:01:cb:8d:d9:c0:7d:bd:e0: - a1:1e:ce:cb:eb:a1:c8:97:05:4d:4d:28:26:f6:eb:1a:7d:20: - 3a:d5:a9:9c:12:2d:b4:56:42:ab:fa:4d:f4:50:68:62:e5:94: - 2c:9c:e7:83:25:db:d7:8b:40:2d:d7:ba:b8:f4:fe:f4:88:76: - 5d:b9:a0:6d:ee:ba:82:a1:33:42:3a:e4:10:77:30:9b:60:c2: - c7:8b:cd:9e:29:00:0c:2d:01:a1:eb:1b:ce:41:6a:c7:91:79: - ff:64:f4:fe:2e:20:34:c6:6e:8a:4b:82:be:09:6b:17:94:aa: - cb:75:82:3a:b4:03:16:8a:52:4e:3a:92:a3:85:fd:db:a2:e8: - e7:a3:8c:bf:85:7e:6b:2d:7a:53:1d:db:49:1e:30:d0:8d:99: - 06:f8:95:3a + 5d:d4:68:d4:44:96:48:60:17:d4:88:12:43:df:6b:f0:b3:4c: + b2:ab:70:57:bc:d3:98:ae:34:d2:ab:e9:a3:b7:ae:76:9b:49: + e5:c5:bd:45:33:6a:19:e2:58:96:c7:49:98:24:0b:c1:57:5e: + 64:a7:2d:7a:c6:1f:fb:9d:ba:a9:19:6e:25:31:2a:b1:82:41: + 47:d4:02:47:ba:03:c3:43:d1:6b:05:10:b0:25:30:5c:0c:17: + 3c:a6:7c:4e:6d:94:35:b4:65:e6:67:32:9a:9b:df:26:fa:c6: + f6:f9:c0:47:62:64:a9:95:02:a3:aa:70:82:38:c3:6d:b3:cd: + 75:37:bd:4e:c5:91:bc:a1:48:7e:47:a1:bb:39:c4:7d:06:ef: + dc:c1:28:6b:6e:c6:d5:a3:e1:a0:d5:ec:c3:0a:ae:e5:5b:da: + 67:14:af:f5:6e:6a:06:72:2e:0d:61:31:31:b7:d4:a4:7b:45: + 21:50:cb:2d:30:c4:1f:c5:55:5c:e2:50:ce:35:cc:23:35:b0: + c2:92:ae:89:16:93:66:94:36:43:ff:30:79:b1:28:4d:6f:d1: + 01:83:a4:e5:fd:d2:d8:6f:c0:0e:e2:d1:85:e8:56:ea:a7:9a: + d3:ec:f6:96:fc:d2:0c:ec:61:78:97:c8:2a:6d:49:67:ac:66: + 19:37:0a:f1 -----BEGIN CERTIFICATE----- MIIDjTCCAnWgAwIBAgIBATANBgkqhkiG9w0BAQsFADAXMRUwEwYDVQQDDAxJbnRl cm1lZGlhcnkwHhcNMTUwMTAxMTIwMDAwWhcNMTYwMTAxMTIwMDAwWjARMQ8wDQYD -VQQDDAZUYXJnZXQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC0M0l3 -RiIAe6OYRRX35EC8x9GGvwU7x1fXEuSwqlg457svGlSRqHg50b1nXMbVCETQmH5/ -aQMqXc35URNEUGLEykQ+Heq8/eshV+LNhT3+cOHoksRfaGdOU5ZrAlk5McmL/nEX -s7cUdxuJtPjsxbFT3ULKQM0UwIq39jJyFtA3ct5in0nlwy4ivKAEp9URVlSffw6S -83qIu3QuGT8Cnmn6tL1XOD0ZmUj0wQdXkVLbY9yLDMp0hRrN8Yw/uZ9hRDH4hu/B -/zHn+816WTCyi5xecUEEEZbkiqeODlh2rA8c6x7cDwFPrU4puptAf/XIUQyLqRkB -UcMjcSUZvgwQ6kZ1AgMBAAGjgekwgeYwHQYDVR0OBBYEFHfoL9f7XMTioLlET7Sn -FTVBtsjDMB8GA1UdIwQYMBaAFIxest4rnzGxJlVNRejnI4dYW4PRMD8GCCsGAQUF +VQQDDAZUYXJnZXQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCqFeqL +JeneGl85id1xbTCmJMpZm2Orwhgt1IDqY3FwLv6swH0BsTUGfK2ojBhfNBYjB3gH +8e6SCDloGwhTwE5oYgHjXj9vv4QYBqhZjYHMOXG5SagZLkRJe4ymcRUsKj1puUJf +SDwbN8DA+hGo0lq8cEPjtQRiQkC8Wo32uyd6cDSb3KgSdQ0bXB6BREF/V27GQHj2 +pluYk2FN5t29SY+6HsWs6T+z0cXJ3duI8Eda/Pzss4cvf/DhoGkFSCFYGEt56d6S +nF+JeWj3XllYnAmIXn4cbR6tQU3yuZ/vmptXjv81w2ksNesw8OQHlAmHpu/0G0th +R2TRyYu6COOaAZlDAgMBAAGjgekwgeYwHQYDVR0OBBYEFEB5+6fDeLqkCOwcshQh +2d1qnrUpMB8GA1UdIwQYMBaAFG1I68J/moaGOaM5ecFbp72pTiMAMD8GCCsGAQUF BwEBBDMwMTAvBggrBgEFBQcwAoYjaHR0cDovL3VybC1mb3ItYWlhL0ludGVybWVk aWFyeS5jZXIwNAYDVR0fBC0wKzApoCegJYYjaHR0cDovL3VybC1mb3ItY3JsL0lu dGVybWVkaWFyeS5jcmwwDgYDVR0PAQH/BAQDAgWgMB0GA1UdJQQWMBQGCCsGAQUF -BwMBBggrBgEFBQcDAjANBgkqhkiG9w0BAQsFAAOCAQEAlp0/noXR9bG4QqYTknfq -rwo+8S5z5dtV5QjZVDVn7Qx67LSmO25720SCNoRlbvCVvKIQ83M5Qa49K9zeP5uK -vGeDdYPdZ7GW/HkPyolzf0iDVfXl3bP9jYwcwX9B/dusWTNYDgHLjdnAfb3goR7O -y+uhyJcFTU0oJvbrGn0gOtWpnBIttFZCq/pN9FBoYuWULJzngyXb14tALde6uPT+ -9Ih2Xbmgbe66gqEzQjrkEHcwm2DCx4vNnikADC0BoesbzkFqx5F5/2T0/i4gNMZu -ikuCvglrF5Sqy3WCOrQDFopSTjqSo4X926Lo56OMv4V+ay16Ux3bSR4w0I2ZBviV -Og== +BwMBBggrBgEFBQcDAjANBgkqhkiG9w0BAQsFAAOCAQEAXdRo1ESWSGAX1IgSQ99r +8LNMsqtwV7zTmK400qvpo7eudptJ5cW9RTNqGeJYlsdJmCQLwVdeZKctesYf+526 +qRluJTEqsYJBR9QCR7oDw0PRawUQsCUwXAwXPKZ8Tm2UNbRl5mcympvfJvrG9vnA +R2JkqZUCo6pwgjjDbbPNdTe9TsWRvKFIfkehuznEfQbv3MEoa27G1aPhoNXswwqu +5VvaZxSv9W5qBnIuDWExMbfUpHtFIVDLLTDEH8VVXOJQzjXMIzWwwpKuiRaTZpQ2 +Q/8webEoTW/RAYOk5f3S2G/ADuLRhehW6qea0+z2lvzSDOxheJfIKm1JZ6xmGTcK +8Q== -----END CERTIFICATE----- Certificate: @@ -101,36 +101,36 @@ Issuer: CN=Root Validity Not Before: Jan 1 12:00:00 2015 GMT - Not After : Jan 1 12:00:00 2016 GMT + Not After : Mar 1 12:00:00 2015 GMT Subject: CN=Intermediary Subject Public Key Info: Public Key Algorithm: rsaEncryption Public-Key: (2048 bit) Modulus: - 00:ab:a7:65:bb:25:26:49:f5:55:58:4e:25:97:97: - 19:be:89:c0:d7:29:77:db:32:59:71:e5:92:4c:6e: - c3:9c:29:73:65:a7:60:ba:a6:59:06:25:28:df:90: - ec:d7:fb:b9:fd:67:f4:0a:e2:2f:9c:e6:0d:77:77: - 12:60:e7:57:71:08:ba:87:50:30:a0:5f:d6:02:0c: - 9a:64:6c:fb:cf:f7:6b:12:ce:09:98:27:d9:15:46: - 00:14:58:63:08:e1:58:7f:98:5d:86:09:6b:59:78: - 69:c1:74:5b:6e:a4:fc:b0:d7:64:30:e6:50:7a:3a: - 98:fd:48:ed:b9:d3:b2:04:5a:f6:67:c8:50:f2:bb: - 2a:49:4c:82:2c:9c:1a:ab:5c:e8:0d:7b:ae:2b:5f: - 4f:77:90:4a:c9:63:cd:0f:07:1d:63:23:7f:e6:6b: - 16:f8:70:f1:43:ac:4c:e0:72:05:36:0e:3f:62:ed: - 71:61:8f:e1:7c:8b:16:7d:9c:99:e1:18:d4:8e:52: - 14:07:3b:49:7e:5d:06:ac:6b:34:63:6c:86:c5:8a: - fb:f0:e5:a3:aa:40:4f:35:da:4b:31:c6:a0:7e:49: - c1:47:22:19:5b:2d:c3:07:ac:25:fe:e8:97:4c:e1: - 59:59:2c:6b:bd:96:ee:b5:67:ca:03:1d:a7:e1:8e: - 19:a3 + 00:b5:a7:f6:93:6b:28:98:90:c6:36:f3:31:5e:b2: + 6d:43:8a:03:c7:8d:9a:04:1a:23:9d:07:ee:5c:47: + 26:da:31:7e:96:34:7e:9d:d8:29:ff:56:2c:05:f9: + d9:ff:e9:10:26:9e:53:12:4b:cb:9d:b6:2f:9d:87: + 33:9c:91:7e:d4:81:c7:63:cf:3a:52:b7:62:18:bb: + b5:47:c4:ba:80:79:71:30:31:ed:08:e6:c5:85:03: + d1:e7:05:24:bf:8b:24:f0:2d:44:3c:80:eb:da:75: + f5:8f:a7:6e:dc:1c:46:b8:c6:bf:76:7b:20:e6:f5: + 3d:0a:c1:32:54:c6:f1:e6:34:6c:18:c6:11:a5:16: + 5b:29:24:75:fa:d3:ee:b9:91:56:80:88:df:fe:7f: + 6b:fa:07:49:95:46:b0:0e:61:ce:8d:f0:a7:64:d5: + e5:05:7a:c1:9a:6f:e9:e0:44:05:f8:75:ea:d9:64: + c9:20:98:28:11:d0:c4:fe:31:2f:9b:a5:79:42:2c: + ee:95:6b:7c:34:d4:15:5c:f8:68:e9:de:5c:b7:c8: + 1c:33:aa:24:3d:29:60:6e:18:e8:c8:cb:6a:a6:ad: + 3c:eb:36:0f:1a:81:aa:0b:8a:0e:fd:7b:e5:8b:12: + 7b:76:04:56:7e:b7:1d:cf:cf:65:77:03:fe:a2:6d: + 02:29 Exponent: 65537 (0x10001) X509v3 extensions: X509v3 Subject Key Identifier: - 8C:5E:B2:DE:2B:9F:31:B1:26:55:4D:45:E8:E7:23:87:58:5B:83:D1 + 6D:48:EB:C2:7F:9A:86:86:39:A3:39:79:C1:5B:A7:BD:A9:4E:23:00 X509v3 Authority Key Identifier: - keyid:15:EB:EA:C0:58:73:9E:53:97:FB:86:13:F2:7A:4E:1C:E1:91:7C:C5 + keyid:7A:B1:AA:9D:A5:49:7E:15:F6:31:BC:33:C7:B6:57:F7:FD:13:5C:CF Authority Information Access: CA Issuers - URI:http://url-for-aia/Root.cer @@ -145,41 +145,41 @@ X509v3 Basic Constraints: critical CA:TRUE Signature Algorithm: sha256WithRSAEncryption - 0e:32:41:5f:b0:5f:c7:3e:3e:d7:54:43:2c:7d:d5:49:a0:2f: - 90:d6:70:2e:f4:d6:a7:13:15:83:3b:44:a0:c2:d8:d8:01:0b: - b0:37:ec:14:39:e5:85:99:de:80:f6:da:11:b4:31:5a:66:86: - f0:e8:ac:ad:d6:ac:4a:eb:49:4f:af:59:cc:c5:ca:e7:09:8c: - 98:e1:b7:86:c1:46:c3:85:34:7a:89:72:0b:0a:f5:e7:41:ac: - 6d:9c:78:ff:d6:ba:fc:86:f3:39:b9:77:44:f4:2f:f4:c0:5e: - b2:93:01:9e:85:8d:a8:58:dc:cd:77:37:40:28:0c:d7:42:19: - f5:bc:a0:e9:ea:f6:a1:42:6a:1f:d3:d6:01:b0:8e:ef:49:97: - 7a:d5:8b:37:28:96:95:00:dd:4c:6c:05:5a:59:fd:14:bd:69: - ae:03:c3:8b:47:ea:8e:48:92:4c:c9:bc:9c:b7:07:bd:e4:5e: - 6c:d3:e1:51:57:45:b2:79:bf:7e:22:c1:d5:65:a8:50:db:51: - 13:28:8e:02:2c:d2:19:09:69:16:6d:60:40:23:44:5b:38:4a: - a4:a1:61:27:ec:36:95:81:2e:5c:ac:f1:13:39:f5:d0:d5:3a: - 94:82:8f:c8:41:da:e8:a4:0e:19:a8:6d:19:6c:fb:29:39:74: - af:48:01:e2 + 1f:03:06:d7:ad:e1:fb:5a:3f:20:60:5d:d0:db:54:2b:b7:52: + 1a:67:c1:06:75:a7:48:d0:de:14:02:e2:6b:c6:71:d0:da:41: + 8e:59:c9:17:8e:c5:1e:27:2e:4a:16:2c:7c:77:1e:d4:1c:14: + 84:85:22:b2:d4:49:90:ab:c3:86:a6:b5:52:97:53:1e:1f:2e: + e4:ff:60:42:53:03:bb:59:e2:7e:f0:59:a6:4e:04:e6:73:3e: + d3:2a:c3:ff:1f:69:cd:29:4b:ce:39:aa:93:b9:97:d6:f0:e6: + e4:52:ca:30:5f:7f:2d:60:6f:93:20:ec:74:dc:d6:65:0d:5d: + bc:49:cd:ee:56:29:4f:34:8f:9f:5d:54:b6:2b:df:7b:33:8b: + 2a:b8:7d:f4:39:f3:e1:02:95:3f:e4:28:14:73:58:7d:88:2b: + e5:1b:e5:0a:9e:eb:b2:e7:7c:bf:e7:1a:70:5f:0f:3d:50:d9: + 8c:ea:4b:0a:e9:03:8e:5b:84:68:af:5f:72:6d:96:62:b3:90: + de:f7:be:8d:95:cb:59:5e:d8:7b:41:3e:32:3a:76:a6:01:45: + 54:9c:d5:98:78:f0:f7:bf:6b:00:4f:0e:c6:05:8b:0f:64:6a: + ca:0d:fc:ff:db:08:d4:20:11:5e:2b:70:59:bb:5d:46:da:07: + 94:12:e6:c7 -----BEGIN CERTIFICATE----- MIIDbTCCAlWgAwIBAgIBAjANBgkqhkiG9w0BAQsFADAPMQ0wCwYDVQQDDARSb290 -MB4XDTE1MDEwMTEyMDAwMFoXDTE2MDEwMTEyMDAwMFowFzEVMBMGA1UEAwwMSW50 -ZXJtZWRpYXJ5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAq6dluyUm -SfVVWE4ll5cZvonA1yl32zJZceWSTG7DnClzZadguqZZBiUo35Ds1/u5/Wf0CuIv -nOYNd3cSYOdXcQi6h1AwoF/WAgyaZGz7z/drEs4JmCfZFUYAFFhjCOFYf5hdhglr -WXhpwXRbbqT8sNdkMOZQejqY/UjtudOyBFr2Z8hQ8rsqSUyCLJwaq1zoDXuuK19P -d5BKyWPNDwcdYyN/5msW+HDxQ6xM4HIFNg4/Yu1xYY/hfIsWfZyZ4RjUjlIUBztJ -fl0GrGs0Y2yGxYr78OWjqkBPNdpLMcagfknBRyIZWy3DB6wl/uiXTOFZWSxrvZbu -tWfKAx2n4Y4ZowIDAQABo4HLMIHIMB0GA1UdDgQWBBSMXrLeK58xsSZVTUXo5yOH -WFuD0TAfBgNVHSMEGDAWgBQV6+rAWHOeU5f7hhPyek4c4ZF8xTA3BggrBgEFBQcB +MB4XDTE1MDEwMTEyMDAwMFoXDTE1MDMwMTEyMDAwMFowFzEVMBMGA1UEAwwMSW50 +ZXJtZWRpYXJ5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtaf2k2so +mJDGNvMxXrJtQ4oDx42aBBojnQfuXEcm2jF+ljR+ndgp/1YsBfnZ/+kQJp5TEkvL +nbYvnYcznJF+1IHHY886UrdiGLu1R8S6gHlxMDHtCObFhQPR5wUkv4sk8C1EPIDr +2nX1j6du3BxGuMa/dnsg5vU9CsEyVMbx5jRsGMYRpRZbKSR1+tPuuZFWgIjf/n9r ++gdJlUawDmHOjfCnZNXlBXrBmm/p4EQF+HXq2WTJIJgoEdDE/jEvm6V5QizulWt8 +NNQVXPho6d5ct8gcM6okPSlgbhjoyMtqpq086zYPGoGqC4oO/XvlixJ7dgRWfrcd +z89ldwP+om0CKQIDAQABo4HLMIHIMB0GA1UdDgQWBBRtSOvCf5qGhjmjOXnBW6e9 +qU4jADAfBgNVHSMEGDAWgBR6saqdpUl+FfYxvDPHtlf3/RNczzA3BggrBgEFBQcB AQQrMCkwJwYIKwYBBQUHMAKGG2h0dHA6Ly91cmwtZm9yLWFpYS9Sb290LmNlcjAs BgNVHR8EJTAjMCGgH6AdhhtodHRwOi8vdXJsLWZvci1jcmwvUm9vdC5jcmwwDgYD VR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEB -AA4yQV+wX8c+PtdUQyx91UmgL5DWcC701qcTFYM7RKDC2NgBC7A37BQ55YWZ3oD2 -2hG0MVpmhvDorK3WrErrSU+vWczFyucJjJjht4bBRsOFNHqJcgsK9edBrG2ceP/W -uvyG8zm5d0T0L/TAXrKTAZ6FjahY3M13N0AoDNdCGfW8oOnq9qFCah/T1gGwju9J -l3rVizcolpUA3UxsBVpZ/RS9aa4Dw4tH6o5IkkzJvJy3B73kXmzT4VFXRbJ5v34i -wdVlqFDbURMojgIs0hkJaRZtYEAjRFs4SqShYSfsNpWBLlys8RM59dDVOpSCj8hB -2uikDhmobRls+yk5dK9IAeI= +AB8DBtet4ftaPyBgXdDbVCu3UhpnwQZ1p0jQ3hQC4mvGcdDaQY5ZyReOxR4nLkoW +LHx3HtQcFISFIrLUSZCrw4amtVKXUx4fLuT/YEJTA7tZ4n7wWaZOBOZzPtMqw/8f +ac0pS845qpO5l9bw5uRSyjBffy1gb5Mg7HTc1mUNXbxJze5WKU80j59dVLYr33sz +iyq4ffQ58+EClT/kKBRzWH2IK+Ub5Qqe67LnfL/nGnBfDz1Q2YzqSwrpA45bhGiv +X3JtlmKzkN73vo2Vy1le2HtBPjI6dqYBRVSc1Zh48Pe/awBPDsYFiw9kasoN/P/b +CNQgEV4rcFm7XUbaB5QS5sc= -----END CERTIFICATE----- Certificate: @@ -196,30 +196,30 @@ Public Key Algorithm: rsaEncryption Public-Key: (2048 bit) Modulus: - 00:ca:63:ce:f6:f5:87:1c:17:7d:20:6c:eb:25:52: - 83:6a:00:1b:c4:76:25:c4:5e:e0:0e:eb:dc:c2:86: - 9f:84:9a:b2:da:cd:05:7f:5b:ad:e0:11:3a:f9:c5: - a9:97:96:77:9c:4a:3c:3d:e8:c2:fe:f0:e5:f4:1f: - c2:bd:cb:33:89:fa:a0:61:c2:85:c1:ea:8b:ec:97: - f4:5d:dc:cf:bd:45:c8:5d:a9:0d:8e:7a:b0:53:67: - 8b:37:bd:67:20:f0:e3:fd:20:5d:7e:e8:df:90:ba: - 0a:59:b3:08:fb:42:45:ae:83:89:b8:50:93:09:66: - ac:a3:7a:fe:b3:ee:ad:0c:fd:c3:a0:ab:3b:1a:49: - 4f:bb:2e:8a:0a:61:ae:99:40:15:79:9a:63:a9:f3: - e0:50:98:eb:11:7d:06:56:85:43:50:8d:9c:1f:a5: - c3:6e:17:6b:f3:07:3a:8a:ce:c2:4f:71:84:eb:c3: - ca:91:1c:71:96:57:14:93:15:f7:93:b6:39:4e:9e: - 99:8e:2b:e0:47:ad:86:ff:d4:7f:a4:b1:5b:3f:08: - 03:84:95:8f:2a:ff:0c:33:22:28:3e:e8:12:53:5d: - 10:3b:86:24:61:1b:85:a8:97:ad:b1:2f:d2:a0:5a: - 5f:51:49:7c:ab:4f:4b:4a:43:da:2f:4a:46:6a:c9: - 12:d5 + 00:ea:ec:57:02:47:92:bc:08:b2:1a:2b:0d:03:36: + e3:2c:b0:4a:52:00:ed:12:f6:5d:39:61:ba:1c:fc: + 06:9c:11:13:b6:97:b1:ae:bc:66:4c:8a:05:03:29: + 4c:8a:59:cb:27:86:96:98:ce:5c:35:17:74:ba:ad: + 1f:14:00:2c:84:cf:cf:2c:fa:5e:a4:70:e5:66:e1: + 28:79:be:5a:39:42:ad:a5:bb:66:ca:f2:59:d2:cc: + 22:30:c7:bd:aa:19:e2:ed:be:4f:67:05:26:71:a1: + 39:96:52:e1:42:cf:fe:83:d2:87:00:e2:96:7b:34: + 64:cb:a7:76:ed:cf:79:ca:0f:1d:44:49:9e:7c:0a: + cb:3f:f4:f2:95:1f:07:23:12:75:0c:f7:f4:55:4e: + 3c:39:ac:0b:93:a4:33:76:27:82:d7:fa:9e:41:17: + d6:98:e5:c9:a8:0d:40:62:b6:80:36:e7:35:71:6a: + aa:bb:ae:25:0d:12:b1:c7:f2:18:e6:05:3f:43:df: + 37:0b:92:30:1c:1f:7c:55:36:01:35:0b:8b:f0:19: + 81:39:52:70:c6:e8:51:14:41:ae:e8:90:e0:ce:78: + 31:98:8a:ed:0c:c7:24:bb:1a:3f:ef:78:80:0e:35: + 19:e2:57:f7:3e:f6:ca:03:c2:f5:46:25:80:32:c7: + 44:39 Exponent: 65537 (0x10001) X509v3 extensions: X509v3 Subject Key Identifier: - 15:EB:EA:C0:58:73:9E:53:97:FB:86:13:F2:7A:4E:1C:E1:91:7C:C5 + 7A:B1:AA:9D:A5:49:7E:15:F6:31:BC:33:C7:B6:57:F7:FD:13:5C:CF X509v3 Authority Key Identifier: - keyid:15:EB:EA:C0:58:73:9E:53:97:FB:86:13:F2:7A:4E:1C:E1:91:7C:C5 + keyid:7A:B1:AA:9D:A5:49:7E:15:F6:31:BC:33:C7:B6:57:F7:FD:13:5C:CF Authority Information Access: CA Issuers - URI:http://url-for-aia/Root.cer @@ -234,45 +234,45 @@ X509v3 Basic Constraints: critical CA:TRUE Signature Algorithm: sha256WithRSAEncryption - 35:78:42:b8:84:7a:f4:0a:9d:ab:2f:a2:95:a7:6a:f5:14:ee: - b7:5a:f4:36:43:22:ef:f7:39:c4:85:ff:eb:e4:24:47:c2:04: - ac:af:25:a5:04:68:64:a3:41:23:fe:a6:99:d2:2a:95:51:60: - 2a:97:31:31:01:a0:83:2c:d8:fe:81:5f:dc:2d:3f:5a:5c:6f: - 2f:df:43:57:61:35:a2:e3:d9:56:f0:26:7d:74:15:3f:24:07: - 1a:cd:49:d9:d0:2f:94:5b:d8:ae:da:f4:93:fa:7a:34:25:20: - a1:d0:ef:d2:1e:c3:eb:b5:63:49:c6:4c:a1:2f:11:d6:5b:88: - a8:89:b0:e6:22:92:3f:d2:a9:26:ad:32:85:e4:98:14:3c:9e: - 4d:9e:49:62:f9:88:25:bd:e0:0d:72:d0:dc:cc:55:b7:bc:38: - 58:70:6b:cb:e0:ce:6b:1a:f8:3a:b6:33:0f:21:0d:d1:80:e1: - 5f:2a:ca:b0:29:e0:e0:17:af:4a:39:bb:cc:29:97:30:08:64: - 26:d9:ba:0b:1f:17:a3:41:e3:0f:a2:d1:cd:21:a1:4e:40:ee: - 3d:c3:20:4a:6d:c4:35:3c:10:f1:f8:76:f8:04:da:7f:17:22: - 6a:de:fe:59:24:04:06:e8:57:f1:6b:f8:4d:63:17:c3:0e:dc: - 3b:26:f3:e2 + a2:db:fb:36:6b:24:df:02:28:0c:ba:9d:88:82:7b:e7:e0:87: + 58:75:70:78:40:3d:f6:53:b9:57:0f:a3:01:b6:aa:3e:80:34: + 2f:b5:dc:9b:30:3e:43:44:79:70:22:48:0a:33:28:87:6d:09: + 90:92:d8:41:d5:ca:18:72:ba:65:5d:cb:b2:25:50:1c:07:f7: + b7:b7:23:93:2c:da:61:b4:c8:15:66:17:17:b4:d3:a8:4a:cd: + b6:01:bf:4c:e5:84:5d:b2:fb:fe:24:98:44:e8:84:16:6b:f4: + 04:f9:88:50:ec:42:1c:31:4b:87:1b:67:76:63:01:8f:46:0b: + 66:1b:59:a6:83:43:ed:33:4f:f8:74:74:2e:fe:8d:2c:f4:55: + 9f:c5:f9:c1:eb:44:9b:5b:aa:bd:98:5e:36:87:0f:c8:8e:f3: + f7:e3:ef:08:72:a8:f6:d0:f9:86:fa:58:1e:fb:73:43:b0:ba: + f9:8d:b0:f5:29:da:64:be:d8:e2:94:88:75:25:54:ce:e6:4d: + 80:33:be:bc:c0:7e:76:fc:65:2e:dc:74:d7:86:64:08:47:f0: + 6c:a1:dc:ae:69:2e:71:23:56:eb:a0:6c:f6:2a:15:2c:a7:a5: + 05:92:68:56:16:07:cd:82:62:02:e8:77:1f:0f:85:31:02:0c: + c0:9a:56:cd -----BEGIN TRUSTED_CERTIFICATE----- MIIDZTCCAk2gAwIBAgIBATANBgkqhkiG9w0BAQsFADAPMQ0wCwYDVQQDDARSb290 MB4XDTE1MDEwMTEyMDAwMFoXDTE2MDEwMTEyMDAwMFowDzENMAsGA1UEAwwEUm9v -dDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMpjzvb1hxwXfSBs6yVS -g2oAG8R2JcRe4A7r3MKGn4SastrNBX9breAROvnFqZeWd5xKPD3owv7w5fQfwr3L -M4n6oGHChcHqi+yX9F3cz71FyF2pDY56sFNnize9ZyDw4/0gXX7o35C6ClmzCPtC -Ra6DibhQkwlmrKN6/rPurQz9w6CrOxpJT7suigphrplAFXmaY6nz4FCY6xF9BlaF -Q1CNnB+lw24Xa/MHOorOwk9xhOvDypEccZZXFJMV95O2OU6emY4r4Eethv/Uf6Sx -Wz8IA4SVjyr/DDMiKD7oElNdEDuGJGEbhaiXrbEv0qBaX1FJfKtPS0pD2i9KRmrJ -EtUCAwEAAaOByzCByDAdBgNVHQ4EFgQUFevqwFhznlOX+4YT8npOHOGRfMUwHwYD -VR0jBBgwFoAUFevqwFhznlOX+4YT8npOHOGRfMUwNwYIKwYBBQUHAQEEKzApMCcG +dDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOrsVwJHkrwIshorDQM2 +4yywSlIA7RL2XTlhuhz8BpwRE7aXsa68ZkyKBQMpTIpZyyeGlpjOXDUXdLqtHxQA +LITPzyz6XqRw5WbhKHm+WjlCraW7ZsryWdLMIjDHvaoZ4u2+T2cFJnGhOZZS4ULP +/oPShwDilns0ZMundu3PecoPHURJnnwKyz/08pUfByMSdQz39FVOPDmsC5OkM3Yn +gtf6nkEX1pjlyagNQGK2gDbnNXFqqruuJQ0SscfyGOYFP0PfNwuSMBwffFU2ATUL +i/AZgTlScMboURRBruiQ4M54MZiK7QzHJLsaP+94gA41GeJX9z72ygPC9UYlgDLH +RDkCAwEAAaOByzCByDAdBgNVHQ4EFgQUerGqnaVJfhX2Mbwzx7ZX9/0TXM8wHwYD +VR0jBBgwFoAUerGqnaVJfhX2Mbwzx7ZX9/0TXM8wNwYIKwYBBQUHAQEEKzApMCcG CCsGAQUFBzAChhtodHRwOi8vdXJsLWZvci1haWEvUm9vdC5jZXIwLAYDVR0fBCUw IzAhoB+gHYYbaHR0cDovL3VybC1mb3ItY3JsL1Jvb3QuY3JsMA4GA1UdDwEB/wQE -AwIBBjAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQA1eEK4hHr0 -Cp2rL6KVp2r1FO63WvQ2QyLv9znEhf/r5CRHwgSsryWlBGhko0Ej/qaZ0iqVUWAq -lzExAaCDLNj+gV/cLT9aXG8v30NXYTWi49lW8CZ9dBU/JAcazUnZ0C+UW9iu2vST -+no0JSCh0O/SHsPrtWNJxkyhLxHWW4ioibDmIpI/0qkmrTKF5JgUPJ5Nnkli+Ygl -veANctDczFW3vDhYcGvL4M5rGvg6tjMPIQ3RgOFfKsqwKeDgF69KObvMKZcwCGQm -2boLHxejQeMPotHNIaFOQO49wyBKbcQ1PBDx+Hb4BNp/FyJq3v5ZJAQG6Ffxa/hN -YxfDDtw7JvPi +AwIBBjAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQCi2/s2ayTf +AigMup2Ignvn4IdYdXB4QD32U7lXD6MBtqo+gDQvtdybMD5DRHlwIkgKMyiHbQmQ +kthB1coYcrplXcuyJVAcB/e3tyOTLNphtMgVZhcXtNOoSs22Ab9M5YRdsvv+JJhE +6IQWa/QE+YhQ7EIcMUuHG2d2YwGPRgtmG1mmg0PtM0/4dHQu/o0s9FWfxfnB60Sb +W6q9mF42hw/IjvP34+8Icqj20PmG+lge+3NDsLr5jbD1KdpkvtjilIh1JVTO5k2A +M768wH52/GUu3HTXhmQIR/BsodyuaS5xI1broGz2KhUsp6UFkmhWFgfNgmIC6Hcf +D4UxAgzAmlbN -----END TRUSTED_CERTIFICATE----- -----BEGIN TIME----- -MTYwMzAyMTIwMDAwWg== +MTUwMzAyMTIwMDAwWg== -----END TIME----- -----BEGIN VERIFY_RESULT-----
diff --git a/net/data/verify_certificate_chain_unittest/expired-target-notBefore.pem b/net/data/verify_certificate_chain_unittest/expired-target-notBefore.pem index e531d94..3a1096d4 100644 --- a/net/data/verify_certificate_chain_unittest/expired-target-notBefore.pem +++ b/net/data/verify_certificate_chain_unittest/expired-target-notBefore.pem
@@ -10,37 +10,37 @@ Signature Algorithm: sha256WithRSAEncryption Issuer: CN=Intermediary Validity - Not Before: Jan 1 12:00:00 2015 GMT + Not Before: Mar 2 12:00:00 2015 GMT Not After : Jan 1 12:00:00 2016 GMT Subject: CN=Target Subject Public Key Info: Public Key Algorithm: rsaEncryption Public-Key: (2048 bit) Modulus: - 00:e0:ba:cf:dc:e5:4a:42:65:18:58:f0:f8:21:32: - 87:ad:b6:d8:ff:96:c7:54:50:9c:6c:ff:f8:ef:1a: - 3a:46:57:8b:9f:8d:f3:ea:a3:f8:37:eb:57:73:bb: - cb:0e:bf:2f:b1:2e:7e:0f:10:d8:93:be:20:41:f0: - 6d:5c:ce:52:20:10:13:37:c5:fb:88:1a:72:e2:f4: - 0a:d2:14:43:21:ae:5f:7e:0f:3e:95:53:38:56:f3: - ab:b3:67:e0:b7:d9:f0:07:98:b0:50:7c:9c:05:9f: - a7:ef:ec:85:cd:e5:ab:22:a3:f1:55:b9:96:5b:c0: - 50:7d:8f:1b:37:a8:cf:40:5d:1f:be:6d:48:bc:22: - e4:65:ea:15:79:1c:9f:e2:7d:58:25:01:15:ac:7b: - 50:6f:53:4e:ed:14:d9:02:55:8d:84:35:34:bc:46: - 11:b3:27:5e:27:47:79:8d:f2:df:d1:43:df:73:19: - e8:06:11:ee:55:87:4b:11:d8:6d:53:12:47:8d:87: - f7:6b:e3:d9:a1:aa:8d:8f:81:ad:dd:6f:52:ce:39: - 97:28:83:63:39:3c:e4:f0:b1:93:4c:82:44:b6:2a: - 7e:fe:c5:7b:9a:f3:01:35:9c:e0:de:d5:0d:ee:b1: - e9:04:f6:bf:74:94:83:56:bb:3d:57:01:56:f9:24: - 2f:e5 + 00:b8:1e:b0:de:22:2f:b4:13:ca:c4:72:10:b9:bd: + 4c:80:81:be:17:f2:45:bb:5a:d2:b4:a1:f6:3e:1c: + 50:00:d5:8d:fe:27:5b:a2:21:07:8b:1a:de:56:56: + 58:88:25:41:09:4e:fd:04:bb:6c:75:c7:48:3f:98: + 6b:4c:54:8a:22:26:28:f3:c6:76:5f:e8:bf:ad:bf: + 4f:ad:6d:1a:1d:ba:5e:fc:0d:2f:92:b2:4f:f7:bb: + e5:fd:3a:ff:8d:fb:f1:9f:96:90:18:46:2c:cf:7b: + 62:75:b8:c5:e9:40:ce:67:21:e0:4b:9e:78:65:9b: + 9e:71:50:bd:33:12:53:78:7f:ad:fd:bf:e0:ae:d2: + 72:51:c1:18:d0:96:71:78:23:ff:a6:55:39:d5:9a: + 89:3e:21:72:cd:9d:13:fa:04:9f:08:6f:c0:d0:c5: + ab:b2:27:b5:b8:e2:2d:ab:31:a3:7a:c1:94:56:8b: + 35:9c:b8:46:71:1c:d6:69:95:c1:0a:98:e4:14:96: + 3c:2f:cb:12:ac:71:88:a4:aa:d0:c8:0e:51:98:47: + 71:e8:0e:a0:e7:7e:01:95:b3:73:3f:9b:c4:8b:9d: + d0:dc:17:a9:53:35:99:29:67:f3:28:d2:7f:1e:0d: + 17:6b:5d:56:c9:91:a6:ae:e8:07:a6:76:d6:8e:2a: + 48:47 Exponent: 65537 (0x10001) X509v3 extensions: X509v3 Subject Key Identifier: - C3:8F:E4:91:5B:59:E5:5A:12:DF:C4:31:8B:24:14:1F:CE:B1:8B:33 + 27:06:C6:75:1B:30:9B:E0:78:6C:9C:9B:F1:E1:29:B7:11:41:6D:BD X509v3 Authority Key Identifier: - keyid:22:8D:DE:5E:4F:B1:54:9D:71:73:E9:6B:39:85:BB:08:D8:87:CA:D0 + keyid:7A:68:26:1F:EE:59:FA:52:EB:B0:98:D1:5D:F6:19:9F:8D:1C:F5:FB Authority Information Access: CA Issuers - URI:http://url-for-aia/Intermediary.cer @@ -55,42 +55,42 @@ X509v3 Extended Key Usage: TLS Web Server Authentication, TLS Web Client Authentication Signature Algorithm: sha256WithRSAEncryption - 59:d5:11:a5:3a:be:47:f7:57:74:59:36:de:85:9f:e1:c4:17: - e9:03:98:69:f7:c8:f0:b2:49:f6:ff:96:0e:06:4d:e0:1e:4b: - b6:09:67:17:28:a6:3f:56:f5:8b:fe:03:0e:b1:76:a9:6d:7d: - 07:22:03:ae:df:92:a9:0a:94:96:d9:86:8d:55:34:05:c6:3e: - bb:59:c3:a1:84:da:f8:76:4e:cd:42:09:be:d0:72:18:8f:07: - f3:8a:04:27:81:05:0a:1a:13:a7:ce:ee:c1:a5:43:b5:a1:64: - c5:78:84:4c:fd:02:d7:3b:33:b3:ff:13:32:c3:1f:15:55:92: - 74:93:21:4c:c9:fd:a9:33:a1:a6:00:5a:ec:42:31:d2:98:58: - 8e:f3:12:32:3b:3f:96:58:19:a3:6b:fc:40:68:45:80:60:85: - 30:b3:50:d2:52:74:9c:7f:01:b9:8a:22:8f:60:18:c5:4f:04: - 0c:10:7e:ff:da:d6:8f:93:f2:80:a0:b3:3e:61:82:8a:c2:a6: - a7:6e:e1:85:76:ef:d3:64:ac:41:37:df:9f:1b:51:ac:8b:c6: - 42:e9:54:57:16:fc:ab:cc:79:b3:5e:6e:84:36:3a:67:fa:bd: - 8d:c8:b6:1e:a5:c2:af:41:7b:8a:5a:72:5d:bb:87:c8:8d:1e: - 51:06:44:ab + 4e:c4:5a:b3:1f:31:4c:04:75:f8:bb:7d:7b:ed:93:07:81:e3: + 41:b9:50:b0:c4:01:06:7d:64:f3:c5:d8:5b:96:0e:b6:c2:fa: + 66:50:25:79:c8:6f:6c:03:f1:7b:e6:73:60:cc:68:42:0e:43: + 85:58:46:c2:51:27:73:dd:f1:6d:9d:d1:7a:80:97:e5:cf:0c: + 9a:85:a1:92:ed:26:3a:d6:10:fd:19:c8:f2:fb:b9:47:ee:a9: + 63:1c:52:c5:97:1a:6b:2f:f4:dc:9c:cb:74:86:6a:48:2a:87: + ac:24:d5:cc:8c:2b:12:9d:6d:bc:7e:be:95:3f:88:83:18:68: + 75:59:db:79:fb:f0:c7:38:7b:8f:a3:16:e0:44:4c:19:e3:cd: + 36:98:fb:fd:c9:17:5e:2f:9c:0c:e1:ba:f2:6e:c0:6e:91:9d: + 5e:c0:0b:95:d8:62:7e:2e:8a:2d:4c:f9:b4:ca:17:0d:f0:d2: + 71:b0:4d:15:79:b0:8b:9e:96:cf:2e:44:1a:84:a7:4f:61:38: + 67:61:1c:a1:70:a0:a4:02:5b:42:f5:a0:09:95:cc:22:89:0d: + 4e:e2:1b:dd:1d:fe:ae:d7:84:58:db:dd:07:1d:96:6b:32:11: + da:c6:56:d9:cd:69:10:25:62:fd:91:2d:63:0f:8c:82:fe:00: + 8a:eb:87:4f -----BEGIN CERTIFICATE----- MIIDjTCCAnWgAwIBAgIBATANBgkqhkiG9w0BAQsFADAXMRUwEwYDVQQDDAxJbnRl -cm1lZGlhcnkwHhcNMTUwMTAxMTIwMDAwWhcNMTYwMTAxMTIwMDAwWjARMQ8wDQYD -VQQDDAZUYXJnZXQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDgus/c -5UpCZRhY8PghMoetttj/lsdUUJxs//jvGjpGV4ufjfPqo/g361dzu8sOvy+xLn4P -ENiTviBB8G1czlIgEBM3xfuIGnLi9ArSFEMhrl9+Dz6VUzhW86uzZ+C32fAHmLBQ -fJwFn6fv7IXN5asio/FVuZZbwFB9jxs3qM9AXR++bUi8IuRl6hV5HJ/ifVglARWs -e1BvU07tFNkCVY2ENTS8RhGzJ14nR3mN8t/RQ99zGegGEe5Vh0sR2G1TEkeNh/dr -49mhqo2Pga3db1LOOZcog2M5POTwsZNMgkS2Kn7+xXua8wE1nODe1Q3usekE9r90 -lINWuz1XAVb5JC/lAgMBAAGjgekwgeYwHQYDVR0OBBYEFMOP5JFbWeVaEt/EMYsk -FB/OsYszMB8GA1UdIwQYMBaAFCKN3l5PsVSdcXPpazmFuwjYh8rQMD8GCCsGAQUF +cm1lZGlhcnkwHhcNMTUwMzAyMTIwMDAwWhcNMTYwMTAxMTIwMDAwWjARMQ8wDQYD +VQQDDAZUYXJnZXQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC4HrDe +Ii+0E8rEchC5vUyAgb4X8kW7WtK0ofY+HFAA1Y3+J1uiIQeLGt5WVliIJUEJTv0E +u2x1x0g/mGtMVIoiJijzxnZf6L+tv0+tbRodul78DS+Ssk/3u+X9Ov+N+/GflpAY +RizPe2J1uMXpQM5nIeBLnnhlm55xUL0zElN4f639v+Cu0nJRwRjQlnF4I/+mVTnV +mok+IXLNnRP6BJ8Ib8DQxauyJ7W44i2rMaN6wZRWizWcuEZxHNZplcEKmOQUljwv +yxKscYikqtDIDlGYR3HoDqDnfgGVs3M/m8SLndDcF6lTNZkpZ/Mo0n8eDRdrXVbJ +kaau6AemdtaOKkhHAgMBAAGjgekwgeYwHQYDVR0OBBYEFCcGxnUbMJvgeGycm/Hh +KbcRQW29MB8GA1UdIwQYMBaAFHpoJh/uWfpS67CY0V32GZ+NHPX7MD8GCCsGAQUF BwEBBDMwMTAvBggrBgEFBQcwAoYjaHR0cDovL3VybC1mb3ItYWlhL0ludGVybWVk aWFyeS5jZXIwNAYDVR0fBC0wKzApoCegJYYjaHR0cDovL3VybC1mb3ItY3JsL0lu dGVybWVkaWFyeS5jcmwwDgYDVR0PAQH/BAQDAgWgMB0GA1UdJQQWMBQGCCsGAQUF -BwMBBggrBgEFBQcDAjANBgkqhkiG9w0BAQsFAAOCAQEAWdURpTq+R/dXdFk23oWf -4cQX6QOYaffI8LJJ9v+WDgZN4B5LtglnFyimP1b1i/4DDrF2qW19ByIDrt+SqQqU -ltmGjVU0BcY+u1nDoYTa+HZOzUIJvtByGI8H84oEJ4EFChoTp87uwaVDtaFkxXiE -TP0C1zszs/8TMsMfFVWSdJMhTMn9qTOhpgBa7EIx0phYjvMSMjs/llgZo2v8QGhF -gGCFMLNQ0lJ0nH8BuYoij2AYxU8EDBB+/9rWj5PygKCzPmGCisKmp27hhXbv02Ss -QTffnxtRrIvGQulUVxb8q8x5s15uhDY6Z/q9jci2HqXCr0F7ilpyXbuHyI0eUQZE -qw== +BwMBBggrBgEFBQcDAjANBgkqhkiG9w0BAQsFAAOCAQEATsRasx8xTAR1+Lt9e+2T +B4HjQblQsMQBBn1k88XYW5YOtsL6ZlAlechvbAPxe+ZzYMxoQg5DhVhGwlEnc93x +bZ3ReoCX5c8MmoWhku0mOtYQ/RnI8vu5R+6pYxxSxZcaay/03JzLdIZqSCqHrCTV +zIwrEp1tvH6+lT+IgxhodVnbefvwxzh7j6MW4ERMGePNNpj7/ckXXi+cDOG68m7A +bpGdXsALldhifi6KLUz5tMoXDfDScbBNFXmwi56Wzy5EGoSnT2E4Z2EcoXCgpAJb +QvWgCZXMIokNTuIb3R3+rteEWNvdBx2WazIR2sZW2c1pECVi/ZEtYw+Mgv4AiuuH +Tw== -----END CERTIFICATE----- Certificate: @@ -107,30 +107,30 @@ Public Key Algorithm: rsaEncryption Public-Key: (2048 bit) Modulus: - 00:a0:cf:ed:e6:2e:fe:fc:9c:7d:c5:b5:f9:ad:0c: - 07:3b:61:9a:29:79:7d:0b:c2:a0:2b:64:10:ce:17: - 64:a9:25:35:b4:17:0e:06:73:83:b2:4e:bb:d2:9d: - 38:05:06:0d:61:24:87:ee:f8:eb:0a:87:f4:8c:2d: - cf:ec:c2:13:43:f6:a0:ad:bf:e3:94:56:a6:7e:30: - 93:3d:65:64:62:88:a5:78:6a:dd:ca:54:3d:36:17: - 2b:79:bb:f0:fd:fe:ba:94:99:c7:ce:61:4e:aa:c9: - f3:87:98:05:8a:b8:fe:e9:96:52:e3:c7:3e:e9:60: - e0:7c:94:75:a2:11:d7:11:d3:70:f1:8e:25:c1:20: - af:93:f5:8a:be:76:75:2f:d0:3f:82:8f:99:c7:44: - 79:c3:f2:31:d7:24:30:cd:14:ba:b6:c4:a2:16:86: - 9c:b7:bf:00:1c:f7:eb:a1:e2:fa:14:f3:08:00:06: - f5:b0:a7:79:05:84:ad:a1:4c:e7:f7:e6:14:68:2f: - 67:67:aa:06:c7:31:f2:1f:d3:b7:c2:e8:e7:bc:0f: - 1a:69:55:a0:75:8d:45:fa:1e:52:f4:ea:87:5c:0c: - ef:d6:e4:b4:bb:59:7c:34:eb:67:16:5e:06:56:05: - e3:0a:6f:f6:c8:88:e3:1f:a6:cf:ab:6a:93:cd:b8: - e8:ab + 00:c0:6b:09:c5:84:c2:5f:1b:c6:98:31:2d:a2:3e: + 03:a9:13:4d:b8:4b:03:a6:1d:0a:e4:e1:ba:81:31: + 2b:dd:92:7c:6b:81:85:c4:d4:cf:73:30:33:b2:8d: + 9f:d9:0b:48:a0:70:51:88:93:d5:f1:ef:bd:14:6e: + 7b:da:b6:a4:c5:a9:ca:cd:27:90:38:c8:5e:12:68: + f8:f2:70:01:8a:da:e3:6c:2f:62:c4:67:40:e2:92: + 20:fe:77:d9:91:f4:6b:02:0c:40:d6:b5:ef:98:85: + 36:58:59:ec:e7:17:c8:72:53:8a:fc:2e:fa:08:70: + ba:ab:ea:42:40:50:e0:6b:14:04:73:78:34:96:db: + 8a:c9:22:21:f1:c1:1b:81:7c:95:c6:83:f8:d1:40: + 1f:5d:ec:bc:d0:4e:30:7f:b2:07:b4:e2:be:3f:f7: + 28:ab:a2:61:fd:98:3b:5a:1c:c9:61:30:13:ea:7c: + 7d:13:99:a0:9a:a5:a5:72:3f:a7:e7:7d:3b:a6:b7: + 09:6c:48:5c:ec:a3:d6:4c:2e:eb:21:e8:97:aa:44: + 32:23:03:dd:24:8d:08:b4:94:df:65:5b:7c:45:59: + 11:4b:ce:1f:78:e5:c4:bc:87:00:bb:c4:69:d7:3b: + ae:a6:b7:80:df:4c:e2:0d:be:a4:0e:1c:05:5d:cf: + dc:c9 Exponent: 65537 (0x10001) X509v3 extensions: X509v3 Subject Key Identifier: - 22:8D:DE:5E:4F:B1:54:9D:71:73:E9:6B:39:85:BB:08:D8:87:CA:D0 + 7A:68:26:1F:EE:59:FA:52:EB:B0:98:D1:5D:F6:19:9F:8D:1C:F5:FB X509v3 Authority Key Identifier: - keyid:85:85:73:C1:C8:A5:7B:1C:6D:25:84:2A:CE:2B:A3:E4:21:E4:AE:D0 + keyid:66:52:63:09:9B:DD:07:2A:2D:E0:F3:6C:29:FB:D9:74:87:F5:02:6A Authority Information Access: CA Issuers - URI:http://url-for-aia/Root.cer @@ -145,41 +145,41 @@ X509v3 Basic Constraints: critical CA:TRUE Signature Algorithm: sha256WithRSAEncryption - 32:34:d5:49:6d:d1:25:e9:5b:f5:a8:29:b0:9a:ae:56:da:c0: - 56:b5:e1:76:a8:71:a6:af:c7:3d:a9:cd:d2:7e:56:b4:12:ad: - ae:61:94:02:bf:f2:0c:c3:64:1c:a2:70:41:3c:7c:30:3f:db: - c7:97:69:52:fc:39:63:a3:ed:27:f8:d1:e1:90:09:b5:8a:75: - dc:6b:db:4c:f6:b6:e3:57:84:f8:4d:f2:dd:d6:eb:63:ca:5f: - 39:d1:c2:52:1a:44:dd:02:b9:7c:4a:46:69:25:52:e9:85:48: - a2:22:b4:a6:cc:a3:bb:00:e6:ea:67:e6:ed:40:15:5a:51:d7: - a1:a8:e3:58:91:ec:80:65:63:db:f0:85:62:b4:0c:29:b9:c2: - 0a:f7:96:10:ed:c9:92:b4:71:53:d1:71:12:9c:04:f7:c9:44: - 57:1f:fc:40:57:a9:e1:df:b8:39:17:d0:79:d9:ae:4c:4b:cb: - 24:6e:25:01:8b:ad:37:cc:6f:b6:c2:58:ee:54:3f:78:71:45: - 69:21:c2:15:7c:86:03:1d:64:22:53:d9:65:68:d2:10:d0:38: - be:bc:f2:49:11:a2:39:04:e5:36:79:bf:20:fe:10:03:1a:b5: - 6c:12:c7:8a:06:dd:9d:bb:4d:f8:5b:b6:2d:3e:18:9b:26:b2: - 6c:59:c3:15 + b2:03:09:bd:ed:73:cd:8d:d6:d0:f4:86:40:00:10:eb:b9:37: + 74:1d:f2:b3:dc:2d:df:a4:75:77:f1:62:23:b8:2d:70:14:af: + 33:4e:0c:8f:6d:13:db:d4:dc:92:04:8d:0e:b6:14:98:07:f6: + 80:cb:9a:8d:d3:0e:9d:6d:13:12:c1:01:f0:14:9d:a3:c1:05: + 45:3c:26:16:d2:39:3f:ed:3c:6c:ab:c0:2b:b2:21:29:dc:4b: + 6b:51:cf:e9:99:ef:fa:14:3a:c4:f1:77:c0:83:f5:7f:af:11: + 40:db:f3:3f:7c:18:26:79:e9:15:c0:62:79:06:85:15:8a:53: + 03:be:2f:e9:5c:69:7c:c7:d7:47:6a:7b:00:c8:d8:4f:55:ce: + d1:64:58:0f:87:ef:27:b2:7b:59:20:04:7d:4f:16:08:c7:d0: + f0:c1:aa:b6:a9:ae:aa:fd:a7:98:2c:40:28:bb:e5:d7:91:e5: + 72:c9:ab:0a:92:0e:b0:d5:ff:9c:db:73:5d:e1:9d:a5:fd:89: + 4e:c8:26:8d:f8:76:0b:7e:7f:94:70:73:e4:22:b4:fb:2f:bc: + 06:84:73:b1:99:78:fa:5f:e8:d7:20:8f:b9:cb:d9:a4:99:7e: + be:b9:89:1c:07:0a:19:cb:0c:f0:15:70:81:51:ee:d7:8e:e8: + f7:21:3f:fd -----BEGIN CERTIFICATE----- MIIDbTCCAlWgAwIBAgIBAjANBgkqhkiG9w0BAQsFADAPMQ0wCwYDVQQDDARSb290 MB4XDTE1MDEwMTEyMDAwMFoXDTE2MDEwMTEyMDAwMFowFzEVMBMGA1UEAwwMSW50 -ZXJtZWRpYXJ5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoM/t5i7+ -/Jx9xbX5rQwHO2GaKXl9C8KgK2QQzhdkqSU1tBcOBnODsk670p04BQYNYSSH7vjr -Cof0jC3P7MITQ/agrb/jlFamfjCTPWVkYoileGrdylQ9Nhcrebvw/f66lJnHzmFO -qsnzh5gFirj+6ZZS48c+6WDgfJR1ohHXEdNw8Y4lwSCvk/WKvnZ1L9A/go+Zx0R5 -w/Ix1yQwzRS6tsSiFoact78AHPfroeL6FPMIAAb1sKd5BYStoUzn9+YUaC9nZ6oG -xzHyH9O3wujnvA8aaVWgdY1F+h5S9OqHXAzv1uS0u1l8NOtnFl4GVgXjCm/2yIjj -H6bPq2qTzbjoqwIDAQABo4HLMIHIMB0GA1UdDgQWBBQijd5eT7FUnXFz6Ws5hbsI -2IfK0DAfBgNVHSMEGDAWgBSFhXPByKV7HG0lhCrOK6PkIeSu0DA3BggrBgEFBQcB +ZXJtZWRpYXJ5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwGsJxYTC +XxvGmDEtoj4DqRNNuEsDph0K5OG6gTEr3ZJ8a4GFxNTPczAzso2f2QtIoHBRiJPV +8e+9FG572rakxanKzSeQOMheEmj48nABitrjbC9ixGdA4pIg/nfZkfRrAgxA1rXv +mIU2WFns5xfIclOK/C76CHC6q+pCQFDgaxQEc3g0ltuKySIh8cEbgXyVxoP40UAf +Xey80E4wf7IHtOK+P/coq6Jh/Zg7WhzJYTAT6nx9E5mgmqWlcj+n5307prcJbEhc +7KPWTC7rIeiXqkQyIwPdJI0ItJTfZVt8RVkRS84feOXEvIcAu8Rp1zuupreA30zi +Db6kDhwFXc/cyQIDAQABo4HLMIHIMB0GA1UdDgQWBBR6aCYf7ln6UuuwmNFd9hmf +jRz1+zAfBgNVHSMEGDAWgBRmUmMJm90HKi3g82wp+9l0h/UCajA3BggrBgEFBQcB AQQrMCkwJwYIKwYBBQUHMAKGG2h0dHA6Ly91cmwtZm9yLWFpYS9Sb290LmNlcjAs BgNVHR8EJTAjMCGgH6AdhhtodHRwOi8vdXJsLWZvci1jcmwvUm9vdC5jcmwwDgYD VR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEB -ADI01Ult0SXpW/WoKbCarlbawFa14Xaocaavxz2pzdJ+VrQSra5hlAK/8gzDZByi -cEE8fDA/28eXaVL8OWOj7Sf40eGQCbWKddxr20z2tuNXhPhN8t3W62PKXznRwlIa -RN0CuXxKRmklUumFSKIitKbMo7sA5upn5u1AFVpR16Go41iR7IBlY9vwhWK0DCm5 -wgr3lhDtyZK0cVPRcRKcBPfJRFcf/EBXqeHfuDkX0HnZrkxLyyRuJQGLrTfMb7bC -WO5UP3hxRWkhwhV8hgMdZCJT2WVo0hDQOL688kkRojkE5TZ5vyD+EAMatWwSx4oG -3Z27Tfhbti0+GJsmsmxZwxU= +ALIDCb3tc82N1tD0hkAAEOu5N3Qd8rPcLd+kdXfxYiO4LXAUrzNODI9tE9vU3JIE +jQ62FJgH9oDLmo3TDp1tExLBAfAUnaPBBUU8JhbSOT/tPGyrwCuyISncS2tRz+mZ +7/oUOsTxd8CD9X+vEUDb8z98GCZ56RXAYnkGhRWKUwO+L+lcaXzH10dqewDI2E9V +ztFkWA+H7yeye1kgBH1PFgjH0PDBqraprqr9p5gsQCi75deR5XLJqwqSDrDV/5zb +c13hnaX9iU7IJo34dgt+f5Rwc+QitPsvvAaEc7GZePpf6Ncgj7nL2aSZfr65iRwH +ChnLDPAVcIFR7teO6PchP/0= -----END CERTIFICATE----- Certificate: @@ -196,30 +196,30 @@ Public Key Algorithm: rsaEncryption Public-Key: (2048 bit) Modulus: - 00:c1:48:07:e3:d2:dc:88:8f:f9:f5:ff:26:b3:cb: - 73:09:cf:36:b9:28:23:c0:8c:90:51:61:a7:a1:f6: - 73:c6:e2:41:b5:d3:ce:8f:38:99:84:3f:96:be:21: - df:15:74:e4:dc:1d:df:45:68:a1:bd:d8:75:ca:bc: - 42:64:74:de:25:3b:a5:0a:0b:fb:d7:6a:63:e3:19: - 48:a9:5b:33:07:e2:bc:02:d5:86:06:5d:3c:fc:75: - 96:ea:eb:6d:41:ea:96:52:28:63:2c:a7:f2:13:e9: - a9:7f:e3:15:c1:94:31:59:c2:48:e8:b1:9c:ee:10: - 57:64:ef:6d:35:66:c2:46:d0:af:5f:b8:60:d8:48: - 47:ed:75:5d:ae:86:d4:85:ed:95:5d:0e:e7:ec:be: - 85:14:22:03:3e:ed:62:b1:c3:05:b9:b8:2e:77:6a: - 86:42:13:68:2c:33:86:f4:89:34:67:db:90:77:51: - 0a:a1:23:b4:46:06:22:16:e5:fb:c1:85:ef:2d:60: - 60:76:5a:1f:d7:c7:93:83:5c:b7:3b:76:d9:ba:01: - 90:29:d3:ea:84:de:26:10:79:7f:05:2f:ab:80:6e: - 18:80:bb:eb:26:d1:8c:5d:bd:79:4b:24:05:62:0f: - 38:7c:87:fe:1d:6e:5c:16:a2:34:b4:7a:d3:bb:54: - 24:d5 + 00:bb:61:9d:50:28:51:f7:22:01:45:32:28:d0:d0: + b2:c3:41:a4:3a:1f:8b:9a:b0:eb:61:31:39:1a:87: + 5b:03:fb:02:82:15:8f:7f:d7:bb:4e:89:ae:08:df: + 7e:6f:2f:66:87:8f:57:ab:a0:61:79:25:64:eb:20: + 5d:e7:92:17:bd:c4:1b:e0:ea:27:e2:7b:b8:6e:05: + 08:07:54:3d:4e:d6:80:8b:b9:50:d0:75:23:93:c3: + e2:1b:de:f7:20:24:35:0f:d4:c3:dd:cf:07:19:29: + 6f:08:08:a6:b3:9f:6d:2a:8b:3c:b7:6f:32:fe:81: + 6d:1b:ad:88:96:c5:1f:a4:7a:a4:81:b5:e4:b3:9a: + bc:42:b0:40:e5:77:8d:12:32:cc:d9:05:12:6a:47: + 62:2b:22:5b:a8:48:fe:14:1a:a1:2f:03:34:f1:2b: + 8f:d5:bf:3c:18:ae:f1:67:79:c8:a3:8d:29:d0:ce: + 23:03:6f:ee:14:5e:97:dd:4d:c8:f5:1f:c4:1d:49: + 08:b5:9c:7d:fa:e1:79:08:27:83:2d:8a:f4:43:d6: + d6:6b:78:f4:0e:4c:42:57:72:03:61:73:b5:82:23: + 98:2a:a9:06:f9:b3:95:cd:01:66:c2:3e:96:da:02: + 13:95:e1:e6:51:94:67:2d:37:a5:cf:c1:18:62:fb: + 56:15 Exponent: 65537 (0x10001) X509v3 extensions: X509v3 Subject Key Identifier: - 85:85:73:C1:C8:A5:7B:1C:6D:25:84:2A:CE:2B:A3:E4:21:E4:AE:D0 + 66:52:63:09:9B:DD:07:2A:2D:E0:F3:6C:29:FB:D9:74:87:F5:02:6A X509v3 Authority Key Identifier: - keyid:85:85:73:C1:C8:A5:7B:1C:6D:25:84:2A:CE:2B:A3:E4:21:E4:AE:D0 + keyid:66:52:63:09:9B:DD:07:2A:2D:E0:F3:6C:29:FB:D9:74:87:F5:02:6A Authority Information Access: CA Issuers - URI:http://url-for-aia/Root.cer @@ -234,45 +234,45 @@ X509v3 Basic Constraints: critical CA:TRUE Signature Algorithm: sha256WithRSAEncryption - 37:89:65:ac:ae:76:77:0d:71:a3:1c:e3:bf:80:fe:87:f8:49: - d3:8b:7f:cf:2a:51:18:b1:f5:a3:6a:d0:e5:e1:7e:f9:83:ca: - 11:2b:fc:e5:9e:cc:df:ee:a2:f9:ea:d2:19:32:fa:58:88:cd: - 59:5c:d6:42:7f:75:2f:17:93:7d:90:8c:7a:60:3a:24:15:15: - 62:82:97:c1:49:81:81:12:25:4a:b9:83:d7:39:dc:2b:da:39: - a9:58:6a:82:5c:7d:49:00:c2:cd:c2:dc:84:4a:23:df:9c:81: - a2:42:fc:4b:66:87:0b:63:12:d3:b8:59:9b:a6:5a:b0:5f:ff: - 51:37:92:03:0c:bb:61:6c:1a:ed:2e:05:e6:d0:a7:2f:d8:7c: - 5c:31:f2:84:f2:9b:05:bd:b5:35:35:a4:28:55:fa:23:32:33: - 4f:6b:91:55:9e:0f:1e:c7:1e:9a:12:c3:97:8d:3c:f9:c8:51: - 27:5b:19:a2:7a:c6:2a:0d:d4:b3:6e:b8:f0:8f:d3:c4:e4:26: - 3a:64:93:70:65:5f:2d:f7:73:31:e7:95:e6:23:1f:f4:17:b9: - d4:ed:20:e2:4f:45:32:a3:e9:7d:6a:2e:02:76:40:8a:ac:64: - c0:b2:99:11:63:de:64:f4:1f:6d:65:4c:84:1e:59:4f:e1:07: - 99:23:0e:d4 + 09:c6:5a:c2:9c:aa:78:6d:66:79:43:2a:1c:a4:0b:04:42:8c: + 54:6c:89:d7:ce:e0:fd:8e:33:5b:6c:2b:a2:ed:05:de:ea:3b: + 11:21:bd:e9:23:45:bd:0f:e0:5c:fe:1b:11:8b:46:75:c1:24: + 84:5a:95:15:a5:b3:73:86:6b:aa:8f:dc:46:3c:64:d9:60:9e: + c1:7a:63:a3:d5:d6:b4:27:ed:c3:77:ea:5d:59:e7:93:05:df: + be:58:4c:a5:92:52:61:11:d1:7f:27:e6:9b:29:3c:b8:9d:a0: + 5c:d0:98:5f:a7:ed:39:14:f4:30:81:f6:0d:3b:cd:96:d6:dd: + 7a:e2:b0:55:7c:ab:87:10:54:a6:5d:ac:27:5b:a6:a1:1e:ee: + e7:26:cb:44:1d:fe:84:85:54:e0:cb:62:1b:5a:bb:ed:38:c0: + f4:bd:1e:5d:ee:c6:d7:6e:b3:27:56:5c:8d:1f:dd:70:52:35: + 8a:bc:07:0a:97:99:10:80:16:5b:a3:d1:de:f9:97:59:ca:5f: + 42:10:c0:26:3e:6e:92:a9:6d:e5:09:1e:4c:92:4b:2e:a7:e8: + 81:7f:e4:bb:b3:44:3c:71:e3:0c:ba:66:30:4a:fc:30:40:ce: + 50:98:1b:61:52:91:02:84:ff:a1:a3:09:ad:1b:68:db:52:a6: + cf:18:79:af -----BEGIN TRUSTED_CERTIFICATE----- MIIDZTCCAk2gAwIBAgIBATANBgkqhkiG9w0BAQsFADAPMQ0wCwYDVQQDDARSb290 MB4XDTE1MDEwMTEyMDAwMFoXDTE2MDEwMTEyMDAwMFowDzENMAsGA1UEAwwEUm9v -dDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMFIB+PS3IiP+fX/JrPL -cwnPNrkoI8CMkFFhp6H2c8biQbXTzo84mYQ/lr4h3xV05Nwd30Voob3Ydcq8QmR0 -3iU7pQoL+9dqY+MZSKlbMwfivALVhgZdPPx1lurrbUHqllIoYyyn8hPpqX/jFcGU -MVnCSOixnO4QV2TvbTVmwkbQr1+4YNhIR+11Xa6G1IXtlV0O5+y+hRQiAz7tYrHD -Bbm4LndqhkITaCwzhvSJNGfbkHdRCqEjtEYGIhbl+8GF7y1gYHZaH9fHk4Nctzt2 -2boBkCnT6oTeJhB5fwUvq4BuGIC76ybRjF29eUskBWIPOHyH/h1uXBaiNLR607tU -JNUCAwEAAaOByzCByDAdBgNVHQ4EFgQUhYVzwcilexxtJYQqziuj5CHkrtAwHwYD -VR0jBBgwFoAUhYVzwcilexxtJYQqziuj5CHkrtAwNwYIKwYBBQUHAQEEKzApMCcG +dDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALthnVAoUfciAUUyKNDQ +ssNBpDofi5qw62ExORqHWwP7AoIVj3/Xu06Jrgjffm8vZoePV6ugYXklZOsgXeeS +F73EG+DqJ+J7uG4FCAdUPU7WgIu5UNB1I5PD4hve9yAkNQ/Uw93PBxkpbwgIprOf +bSqLPLdvMv6BbRutiJbFH6R6pIG15LOavEKwQOV3jRIyzNkFEmpHYisiW6hI/hQa +oS8DNPErj9W/PBiu8Wd5yKONKdDOIwNv7hRel91NyPUfxB1JCLWcffrheQgngy2K +9EPW1mt49A5MQldyA2FztYIjmCqpBvmzlc0BZsI+ltoCE5Xh5lGUZy03pc/BGGL7 +VhUCAwEAAaOByzCByDAdBgNVHQ4EFgQUZlJjCZvdByot4PNsKfvZdIf1AmowHwYD +VR0jBBgwFoAUZlJjCZvdByot4PNsKfvZdIf1AmowNwYIKwYBBQUHAQEEKzApMCcG CCsGAQUFBzAChhtodHRwOi8vdXJsLWZvci1haWEvUm9vdC5jZXIwLAYDVR0fBCUw IzAhoB+gHYYbaHR0cDovL3VybC1mb3ItY3JsL1Jvb3QuY3JsMA4GA1UdDwEB/wQE -AwIBBjAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQA3iWWsrnZ3 -DXGjHOO/gP6H+EnTi3/PKlEYsfWjatDl4X75g8oRK/zlnszf7qL56tIZMvpYiM1Z -XNZCf3UvF5N9kIx6YDokFRVigpfBSYGBEiVKuYPXOdwr2jmpWGqCXH1JAMLNwtyE -SiPfnIGiQvxLZocLYxLTuFmbplqwX/9RN5IDDLthbBrtLgXm0Kcv2HxcMfKE8psF -vbU1NaQoVfojMjNPa5FVng8exx6aEsOXjTz5yFEnWxmiesYqDdSzbrjwj9PE5CY6 -ZJNwZV8t93Mx55XmIx/0F7nU7SDiT0Uyo+l9ai4CdkCKrGTAspkRY95k9B9tZUyE -HllP4QeZIw7U +AwIBBjAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQAJxlrCnKp4 +bWZ5QyocpAsEQoxUbInXzuD9jjNbbCui7QXe6jsRIb3pI0W9D+Bc/hsRi0Z1wSSE +WpUVpbNzhmuqj9xGPGTZYJ7BemOj1da0J+3Dd+pdWeeTBd++WEylklJhEdF/J+ab +KTy4naBc0Jhfp+05FPQwgfYNO82W1t164rBVfKuHEFSmXawnW6ahHu7nJstEHf6E +hVTgy2IbWrvtOMD0vR5d7sbXbrMnVlyNH91wUjWKvAcKl5kQgBZbo9He+ZdZyl9C +EMAmPm6SqW3lCR5Mkksup+iBf+S7s0Q8ceMMumYwSvwwQM5QmBthUpEChP+howmt +G2jbUqbPGHmv -----END TRUSTED_CERTIFICATE----- -----BEGIN TIME----- -MTQwMzAyMTIwMDAwWg== +MTUwMzAxMTIwMDAwWg== -----END TIME----- -----BEGIN VERIFY_RESULT-----
diff --git a/net/data/verify_certificate_chain_unittest/expired-target.pem b/net/data/verify_certificate_chain_unittest/expired-target.pem index 40b08c6..8afcd0f 100644 --- a/net/data/verify_certificate_chain_unittest/expired-target.pem +++ b/net/data/verify_certificate_chain_unittest/expired-target.pem
@@ -11,36 +11,36 @@ Issuer: CN=Intermediary Validity Not Before: Jan 1 12:00:00 2015 GMT - Not After : Jan 1 12:00:00 2016 GMT + Not After : Mar 1 12:00:00 2015 GMT Subject: CN=Target Subject Public Key Info: Public Key Algorithm: rsaEncryption Public-Key: (2048 bit) Modulus: - 00:e4:45:ec:2b:33:db:da:8a:1f:b0:9c:73:6b:4b: - c2:a7:60:29:4f:61:1c:a6:5d:2a:17:76:d1:87:76: - ec:d7:2c:a6:80:72:62:c1:0c:7b:01:d4:6e:7a:c5: - fe:cc:89:1b:e6:4b:ef:76:0b:b8:46:b0:39:c0:50: - 54:44:97:d8:ea:4a:95:ae:3e:2c:38:1a:69:51:06: - cb:4d:85:44:e0:57:49:30:78:cc:fd:40:81:52:1a: - 43:c7:4a:02:db:b0:90:3a:b9:5f:7a:bd:a1:b1:7d: - a5:f7:ed:95:c5:e6:da:0e:d5:1a:fa:12:ce:2e:4f: - 6b:7c:a4:6b:de:89:47:0d:b9:34:62:c2:3a:06:db: - 72:2e:56:29:ca:80:d0:80:27:9e:3f:bf:73:b1:14: - 3c:88:f5:31:d3:d9:27:54:46:c3:b2:e3:59:f4:54: - 37:b8:73:b5:04:6b:6d:d2:e2:93:e6:57:2e:f8:3a: - 36:24:7c:fa:33:da:1a:5b:5d:da:f5:91:87:67:4a: - ca:2e:79:47:df:8c:33:8b:36:76:39:79:63:a9:7d: - 26:ef:95:22:e2:16:de:0a:1a:4a:4b:74:e3:d8:c5: - b9:ee:60:8d:ad:f7:cf:d4:d6:4e:b0:27:18:84:d1: - e3:ef:23:b8:00:6d:71:e8:a0:8e:bb:84:72:d9:75: - 76:6d + 00:e3:02:17:8f:16:37:b7:e0:0b:44:86:f7:4f:de: + 18:39:31:91:ed:11:80:67:c4:e0:18:7e:42:8e:be: + dd:a9:0e:e7:ff:47:f2:1d:eb:a8:53:21:5b:c0:3e: + 32:59:cf:31:24:e3:0f:00:4a:d2:f7:9a:77:31:10: + 45:89:e3:e8:62:9c:c7:06:31:d0:c8:86:2b:3d:a7: + 71:83:82:fa:c1:c2:cb:84:74:48:ad:c9:8a:4d:27: + 1e:75:bb:4e:ce:54:3c:c1:b5:25:e5:02:d0:b3:8c: + 14:f3:f5:9e:f8:30:20:ec:c6:d9:c4:a2:aa:06:f9: + dc:ca:53:2f:76:cf:32:42:fd:7a:1a:c3:da:4a:d3: + 82:30:84:f5:fb:02:82:f6:db:6e:87:fc:e8:69:14: + a0:9f:2d:07:c4:ac:64:86:f5:ac:4b:22:f1:b0:d1: + 91:2e:29:f7:cf:e0:10:aa:5d:cd:df:d7:a7:b9:9d: + 72:cc:fd:16:d5:11:97:90:75:dc:5e:02:ab:7f:d3: + dd:0a:a8:bc:5a:34:c6:8d:bb:8f:7a:04:d5:b6:99: + 20:a4:72:c9:ba:00:cf:69:5e:e5:dd:bf:47:b3:3c: + be:83:0d:4b:95:be:91:58:a4:a4:33:2e:3b:b8:da: + 85:3d:74:66:8f:f9:0b:be:8e:9d:3e:b6:ca:8b:9b: + 7e:19 Exponent: 65537 (0x10001) X509v3 extensions: X509v3 Subject Key Identifier: - 40:D1:E0:A6:C2:37:1A:32:25:B8:D9:6D:5E:67:E7:CA:E0:76:30:16 + 1C:D2:85:3D:00:41:91:25:0B:8B:C2:CB:0E:D7:97:F1:14:8E:DE:01 X509v3 Authority Key Identifier: - keyid:DA:CD:B0:93:32:B4:DB:D9:38:FF:99:C6:AF:A7:44:80:D0:C0:4A:A1 + keyid:90:4B:3E:89:21:25:2A:3C:CA:35:BF:D9:A6:B1:CF:BC:1F:9D:3A:2F Authority Information Access: CA Issuers - URI:http://url-for-aia/Intermediary.cer @@ -55,42 +55,42 @@ X509v3 Extended Key Usage: TLS Web Server Authentication, TLS Web Client Authentication Signature Algorithm: sha256WithRSAEncryption - 08:63:be:8b:50:78:97:05:7a:ee:a4:f1:fe:6f:bd:68:84:c4: - ce:e6:c9:fd:30:d8:27:a6:3c:37:74:21:4a:69:23:81:5f:da: - 02:56:45:f4:1e:a0:22:4c:43:8c:f0:65:c2:cb:db:68:05:5b: - 94:4b:93:3a:08:77:da:a0:67:3f:b2:d3:95:09:ad:ed:1e:e2: - 91:a4:8e:63:7d:37:d8:90:20:83:60:ab:0f:b7:ec:73:69:69: - b3:8e:54:6f:54:5b:95:de:2d:c9:49:73:5e:87:43:7e:37:07: - 02:a7:b7:df:e5:5e:9b:77:fb:9a:1f:15:29:29:f4:7e:00:e4: - 6f:5c:d2:66:46:5f:54:c4:6b:b2:50:2f:f4:78:8a:5e:cb:da: - 32:56:1c:ae:a7:92:d0:8e:71:95:6c:b1:ba:6c:b3:eb:3c:29: - 57:4e:e1:cd:8a:ef:41:ea:bd:7f:ce:17:cf:f5:9c:ec:d6:21: - cf:e2:e8:2d:b6:b9:dd:d9:2a:fe:d0:91:54:0e:15:a0:d3:ae: - ea:92:f9:98:c5:a2:da:a6:0d:89:8f:c9:fe:2e:25:9b:f4:f1: - 7f:ae:1a:5b:0f:94:c0:49:fb:15:0a:bb:1f:2b:fe:ca:d1:8e: - 10:94:16:c6:a0:a0:af:b9:5d:6a:31:c2:87:94:ee:ca:1e:93: - b3:ac:d6:dd + 6d:36:b8:bc:75:67:0d:8a:5b:00:51:3b:06:31:af:83:23:80: + a0:4f:eb:05:d6:5c:15:20:a3:10:7b:3e:31:0a:ba:45:b5:6b: + 21:2b:02:bf:83:73:2c:cd:81:85:a0:38:ed:4e:bd:b7:36:dc: + b6:69:bb:81:7b:75:74:3c:ac:5a:c2:59:74:6d:d9:64:8e:5b: + 16:19:25:44:98:cb:9d:cd:a0:d4:6f:7f:d2:a3:11:cd:94:aa: + b0:74:ee:c2:a3:3b:aa:98:e0:c5:0d:01:a4:f8:a2:84:ab:d0: + db:19:9d:4d:ce:84:89:50:e8:3a:44:fb:e5:06:f3:d8:e9:d5: + aa:81:69:af:2a:f2:9e:58:35:d5:3d:97:44:3a:79:47:22:d6: + 9c:1b:b9:93:ea:3f:44:ac:cf:2a:54:52:86:0b:db:17:9d:f9: + 4d:54:46:4d:af:21:92:cf:8a:01:52:14:07:96:c7:48:75:3c: + 66:4d:74:fb:44:06:eb:a9:ab:12:2e:91:80:de:02:c1:12:5b: + 32:76:36:46:13:16:00:31:76:c9:ee:64:e6:75:03:49:7d:63: + d6:bf:f1:90:1f:b6:49:38:e5:af:37:63:46:e2:4d:d1:29:b8: + b3:24:ec:f5:f8:32:c3:03:fa:1a:ad:30:1a:db:41:4d:5e:43: + 46:ae:6d:4e -----BEGIN CERTIFICATE----- MIIDjTCCAnWgAwIBAgIBATANBgkqhkiG9w0BAQsFADAXMRUwEwYDVQQDDAxJbnRl -cm1lZGlhcnkwHhcNMTUwMTAxMTIwMDAwWhcNMTYwMTAxMTIwMDAwWjARMQ8wDQYD -VQQDDAZUYXJnZXQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDkRewr -M9vaih+wnHNrS8KnYClPYRymXSoXdtGHduzXLKaAcmLBDHsB1G56xf7MiRvmS+92 -C7hGsDnAUFREl9jqSpWuPiw4GmlRBstNhUTgV0kweMz9QIFSGkPHSgLbsJA6uV96 -vaGxfaX37ZXF5toO1Rr6Es4uT2t8pGveiUcNuTRiwjoG23IuVinKgNCAJ54/v3Ox -FDyI9THT2SdURsOy41n0VDe4c7UEa23S4pPmVy74OjYkfPoz2hpbXdr1kYdnSsou -eUffjDOLNnY5eWOpfSbvlSLiFt4KGkpLdOPYxbnuYI2t98/U1k6wJxiE0ePvI7gA -bXHooI67hHLZdXZtAgMBAAGjgekwgeYwHQYDVR0OBBYEFEDR4KbCNxoyJbjZbV5n -58rgdjAWMB8GA1UdIwQYMBaAFNrNsJMytNvZOP+Zxq+nRIDQwEqhMD8GCCsGAQUF +cm1lZGlhcnkwHhcNMTUwMTAxMTIwMDAwWhcNMTUwMzAxMTIwMDAwWjARMQ8wDQYD +VQQDDAZUYXJnZXQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDjAheP +Fje34AtEhvdP3hg5MZHtEYBnxOAYfkKOvt2pDuf/R/Id66hTIVvAPjJZzzEk4w8A +StL3mncxEEWJ4+hinMcGMdDIhis9p3GDgvrBwsuEdEityYpNJx51u07OVDzBtSXl +AtCzjBTz9Z74MCDsxtnEoqoG+dzKUy92zzJC/Xoaw9pK04IwhPX7AoL2226H/Ohp +FKCfLQfErGSG9axLIvGw0ZEuKffP4BCqXc3f16e5nXLM/RbVEZeQddxeAqt/090K +qLxaNMaNu496BNW2mSCkcsm6AM9pXuXdv0ezPL6DDUuVvpFYpKQzLju42oU9dGaP ++Qu+jp0+tsqLm34ZAgMBAAGjgekwgeYwHQYDVR0OBBYEFBzShT0AQZElC4vCyw7X +l/EUjt4BMB8GA1UdIwQYMBaAFJBLPokhJSo8yjW/2aaxz7wfnTovMD8GCCsGAQUF BwEBBDMwMTAvBggrBgEFBQcwAoYjaHR0cDovL3VybC1mb3ItYWlhL0ludGVybWVk aWFyeS5jZXIwNAYDVR0fBC0wKzApoCegJYYjaHR0cDovL3VybC1mb3ItY3JsL0lu dGVybWVkaWFyeS5jcmwwDgYDVR0PAQH/BAQDAgWgMB0GA1UdJQQWMBQGCCsGAQUF -BwMBBggrBgEFBQcDAjANBgkqhkiG9w0BAQsFAAOCAQEACGO+i1B4lwV67qTx/m+9 -aITEzubJ/TDYJ6Y8N3QhSmkjgV/aAlZF9B6gIkxDjPBlwsvbaAVblEuTOgh32qBn -P7LTlQmt7R7ikaSOY3032JAgg2CrD7fsc2lps45Ub1Rbld4tyUlzXodDfjcHAqe3 -3+Vem3f7mh8VKSn0fgDkb1zSZkZfVMRrslAv9HiKXsvaMlYcrqeS0I5xlWyxumyz -6zwpV07hzYrvQeq9f84Xz/Wc7NYhz+LoLba53dkq/tCRVA4VoNOu6pL5mMWi2qYN -iY/J/i4lm/Txf64aWw+UwEn7FQq7Hyv+ytGOEJQWxqCgr7ldajHCh5Tuyh6Ts6zW -3Q== +BwMBBggrBgEFBQcDAjANBgkqhkiG9w0BAQsFAAOCAQEAbTa4vHVnDYpbAFE7BjGv +gyOAoE/rBdZcFSCjEHs+MQq6RbVrISsCv4NzLM2BhaA47U69tzbctmm7gXt1dDys +WsJZdG3ZZI5bFhklRJjLnc2g1G9/0qMRzZSqsHTuwqM7qpjgxQ0BpPiihKvQ2xmd +Tc6EiVDoOkT75Qbz2OnVqoFpryrynlg11T2XRDp5RyLWnBu5k+o/RKzPKlRShgvb +F535TVRGTa8hks+KAVIUB5bHSHU8Zk10+0QG66mrEi6RgN4CwRJbMnY2RhMWADF2 +ye5k5nUDSX1j1r/xkB+2STjlrzdjRuJN0Sm4syTs9fgywwP6Gq0wGttBTV5DRq5t +Tg== -----END CERTIFICATE----- Certificate: @@ -107,30 +107,30 @@ Public Key Algorithm: rsaEncryption Public-Key: (2048 bit) Modulus: - 00:b9:80:44:8f:9b:41:d5:be:e0:1a:a7:a4:4d:4e: - a0:52:ae:81:e7:c4:bd:f9:79:80:36:6e:8e:2a:56: - a9:84:26:da:d5:ad:e2:2a:5a:0e:68:2d:e9:ab:24: - 52:89:8e:7e:99:3d:b6:b7:ca:27:b7:80:45:38:4a: - eb:66:54:e1:28:a3:0e:df:a1:b7:63:4c:e1:44:e1: - af:6f:60:b3:35:af:9e:4d:51:cc:51:4c:70:8f:6b: - f2:73:c4:39:cb:a6:0b:9f:14:27:1a:90:f6:75:d3: - 3c:a0:b7:ba:3d:7c:27:eb:b3:b1:37:58:2a:e1:d8: - 62:09:dc:07:33:41:40:34:2c:93:98:e5:26:bc:d6: - 98:ed:75:b2:f1:98:4a:71:b4:21:61:96:12:98:7f: - 24:6e:d8:37:f2:2b:54:1e:4a:b0:8a:d9:2c:ab:b7: - 88:f5:a7:fb:fe:a7:04:b7:35:82:66:3f:ea:fb:eb: - 15:26:ae:52:ae:34:ec:da:fe:08:fa:ef:fd:40:f6: - 8d:b4:c5:68:a7:e3:60:2c:dc:b8:e0:3e:54:a9:60: - 11:7d:1e:54:37:98:b1:c2:fe:d0:fd:fa:b5:e6:f9: - bd:a6:50:b9:b6:1b:ec:3f:dc:ed:c2:d7:01:37:9e: - 69:24:90:05:d5:f2:26:fa:76:f3:76:34:e5:b7:88: - 92:95 + 00:c1:92:e2:bf:d0:e9:8f:c6:45:f0:c9:ef:51:cc: + 97:cc:cb:80:ac:c1:7c:da:7e:28:12:0c:84:45:6b: + db:fb:4f:ba:16:3e:33:8b:a1:14:70:42:99:ca:4e: + 8e:55:ac:13:e5:ac:d4:30:9e:25:dc:19:d9:b9:de: + 46:7a:84:80:29:bd:a1:11:f8:f2:af:ce:c1:0c:73: + 43:29:37:c3:76:61:32:70:6d:e7:29:bf:dd:9f:68: + ed:9e:c2:b9:8c:f6:16:7c:b9:06:4b:65:ff:57:26: + 9d:62:48:ee:0b:0f:4c:5e:fb:d7:a9:e3:d8:4b:a9: + 0c:01:b6:00:f8:48:27:64:03:b6:73:d0:85:10:92: + 4c:50:f8:f4:33:95:ea:52:30:72:b0:c1:e1:d3:1e: + 8e:67:2a:64:42:c8:61:b8:3f:76:d2:01:1d:e6:dc: + d2:66:09:41:24:c3:22:b4:55:3a:f0:5e:3d:82:af: + 5d:0d:b7:d7:96:02:dc:94:e4:d2:24:dc:49:f8:d3: + dc:b9:78:0e:ce:cf:8f:1a:3f:06:8b:57:e4:51:91: + 7f:64:1b:cd:db:4d:80:88:26:21:dc:da:64:ae:64: + bb:03:21:1c:de:ce:44:eb:a7:b4:43:50:51:cc:67: + da:16:91:93:94:e4:d0:ed:28:dc:8a:16:8b:3d:d8: + cd:19 Exponent: 65537 (0x10001) X509v3 extensions: X509v3 Subject Key Identifier: - DA:CD:B0:93:32:B4:DB:D9:38:FF:99:C6:AF:A7:44:80:D0:C0:4A:A1 + 90:4B:3E:89:21:25:2A:3C:CA:35:BF:D9:A6:B1:CF:BC:1F:9D:3A:2F X509v3 Authority Key Identifier: - keyid:CB:65:23:DB:47:DE:B5:40:EC:44:D8:90:A7:D6:C0:78:81:FA:E2:CE + keyid:C3:6A:BF:B8:BB:62:64:F0:4C:4C:28:47:94:45:0F:15:0D:DC:CD:5A Authority Information Access: CA Issuers - URI:http://url-for-aia/Root.cer @@ -145,41 +145,41 @@ X509v3 Basic Constraints: critical CA:TRUE Signature Algorithm: sha256WithRSAEncryption - 9d:a0:3a:08:79:82:a7:ac:d8:e9:bc:8a:e1:32:88:09:c8:de: - 54:ed:6f:43:fd:ab:68:b2:32:37:8e:74:de:37:da:f9:31:2d: - ee:d6:f7:0b:d2:25:f9:16:1e:93:f1:f3:e1:fd:fd:0f:ac:75: - 7b:a4:60:09:4c:0f:ea:45:5b:46:cf:e5:5a:c9:36:37:17:ee: - cf:44:82:51:c9:ba:eb:55:13:2d:f5:6f:83:9e:01:0c:04:ff: - 58:ad:50:54:7c:ee:a5:a4:e6:3c:93:46:c8:a7:bd:6f:18:7f: - d0:5c:1c:8a:a4:f3:1d:e3:d7:a3:1d:7e:a4:ca:cd:1b:92:ff: - 26:13:cc:b8:89:b2:b8:24:0c:30:df:43:70:20:5d:72:3f:b0: - 0e:8b:08:3e:e5:52:c9:d8:65:db:c6:31:95:a1:c4:56:b4:1f: - eb:af:e8:9c:8b:78:c2:75:c4:f1:98:e1:20:d6:5a:32:9f:94: - 75:c0:a5:86:da:79:a7:d3:25:20:56:13:dd:04:27:bd:e7:27: - 21:9d:8d:1d:dd:87:bc:6e:07:fd:9f:64:c5:7e:ac:2a:a4:a8: - e5:29:d1:5b:e2:24:6c:db:ca:3a:b6:13:34:00:81:15:08:1d: - fb:eb:ac:1a:ab:53:3e:31:db:30:40:4e:17:f3:98:53:00:d8: - d1:b8:5c:58 + bd:cb:4f:22:e2:7a:50:05:dd:e3:d6:41:19:2b:6d:4a:3e:a8: + 90:27:4f:ce:eb:ee:83:4f:d5:b6:ea:a5:18:1c:00:83:84:76: + 92:76:a7:2c:54:5f:94:a7:fc:4c:2f:38:08:c5:24:3f:95:57: + e4:55:e2:a5:96:b7:c0:7b:cc:8f:ce:a1:81:e2:d2:51:17:d3: + 7f:6b:76:ed:f5:41:2a:7a:56:e2:d1:ed:55:94:38:2e:9f:cb: + 9b:a3:8b:d8:d7:42:24:81:55:97:82:a1:77:52:7c:1f:70:db: + 0b:bf:a5:eb:96:2e:d4:fb:9c:d5:6a:6e:9b:60:75:01:e1:fe: + f1:14:64:42:82:2a:f5:ea:b3:e1:2e:40:fe:b2:af:9f:c5:66: + 25:d8:7d:8c:5f:00:3d:04:b4:02:8c:c7:99:30:d0:c0:02:e4: + 5f:3b:75:01:59:76:1c:3c:95:5b:28:49:90:2f:c0:af:45:f0: + 4c:62:ca:40:66:80:7e:25:89:ab:91:55:ee:41:71:af:05:4c: + 7e:31:2c:99:24:50:c9:dd:97:79:73:97:f9:5a:79:79:05:ff: + c6:83:b7:e3:4d:86:b6:a3:60:1d:7c:e6:89:80:a3:50:8f:b1: + 4a:43:d2:a9:89:92:8b:38:20:71:64:0a:41:8b:fd:2f:4b:ab: + 3c:45:99:0f -----BEGIN CERTIFICATE----- MIIDbTCCAlWgAwIBAgIBAjANBgkqhkiG9w0BAQsFADAPMQ0wCwYDVQQDDARSb290 MB4XDTE1MDEwMTEyMDAwMFoXDTE2MDEwMTEyMDAwMFowFzEVMBMGA1UEAwwMSW50 -ZXJtZWRpYXJ5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuYBEj5tB -1b7gGqekTU6gUq6B58S9+XmANm6OKlaphCba1a3iKloOaC3pqyRSiY5+mT22t8on -t4BFOErrZlThKKMO36G3Y0zhROGvb2CzNa+eTVHMUUxwj2vyc8Q5y6YLnxQnGpD2 -ddM8oLe6PXwn67OxN1gq4dhiCdwHM0FANCyTmOUmvNaY7XWy8ZhKcbQhYZYSmH8k -btg38itUHkqwitksq7eI9af7/qcEtzWCZj/q++sVJq5SrjTs2v4I+u/9QPaNtMVo -p+NgLNy44D5UqWARfR5UN5ixwv7Q/fq15vm9plC5thvsP9ztwtcBN55pJJAF1fIm -+nbzdjTlt4iSlQIDAQABo4HLMIHIMB0GA1UdDgQWBBTazbCTMrTb2Tj/mcavp0SA -0MBKoTAfBgNVHSMEGDAWgBTLZSPbR961QOxE2JCn1sB4gfrizjA3BggrBgEFBQcB +ZXJtZWRpYXJ5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwZLiv9Dp +j8ZF8MnvUcyXzMuArMF82n4oEgyERWvb+0+6Fj4zi6EUcEKZyk6OVawT5azUMJ4l +3BnZud5GeoSAKb2hEfjyr87BDHNDKTfDdmEycG3nKb/dn2jtnsK5jPYWfLkGS2X/ +VyadYkjuCw9MXvvXqePYS6kMAbYA+EgnZAO2c9CFEJJMUPj0M5XqUjBysMHh0x6O +ZypkQshhuD920gEd5tzSZglBJMMitFU68F49gq9dDbfXlgLclOTSJNxJ+NPcuXgO +zs+PGj8Gi1fkUZF/ZBvN202AiCYh3NpkrmS7AyEc3s5E66e0Q1BRzGfaFpGTlOTQ +7SjcihaLPdjNGQIDAQABo4HLMIHIMB0GA1UdDgQWBBSQSz6JISUqPMo1v9mmsc+8 +H506LzAfBgNVHSMEGDAWgBTDar+4u2Jk8ExMKEeURQ8VDdzNWjA3BggrBgEFBQcB AQQrMCkwJwYIKwYBBQUHMAKGG2h0dHA6Ly91cmwtZm9yLWFpYS9Sb290LmNlcjAs BgNVHR8EJTAjMCGgH6AdhhtodHRwOi8vdXJsLWZvci1jcmwvUm9vdC5jcmwwDgYD VR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEB -AJ2gOgh5gqes2Om8iuEyiAnI3lTtb0P9q2iyMjeOdN432vkxLe7W9wvSJfkWHpPx -8+H9/Q+sdXukYAlMD+pFW0bP5VrJNjcX7s9EglHJuutVEy31b4OeAQwE/1itUFR8 -7qWk5jyTRsinvW8Yf9BcHIqk8x3j16MdfqTKzRuS/yYTzLiJsrgkDDDfQ3AgXXI/ -sA6LCD7lUsnYZdvGMZWhxFa0H+uv6JyLeMJ1xPGY4SDWWjKflHXApYbaeafTJSBW -E90EJ73nJyGdjR3dh7xuB/2fZMV+rCqkqOUp0VviJGzbyjq2EzQAgRUIHfvrrBqr -Uz4x2zBAThfzmFMA2NG4XFg= +AL3LTyLielAF3ePWQRkrbUo+qJAnT87r7oNP1bbqpRgcAIOEdpJ2pyxUX5Sn/Ewv +OAjFJD+VV+RV4qWWt8B7zI/OoYHi0lEX039rdu31QSp6VuLR7VWUOC6fy5uji9jX +QiSBVZeCoXdSfB9w2wu/peuWLtT7nNVqbptgdQHh/vEUZEKCKvXqs+EuQP6yr5/F +ZiXYfYxfAD0EtAKMx5kw0MAC5F87dQFZdhw8lVsoSZAvwK9F8ExiykBmgH4liauR +Ve5Bca8FTH4xLJkkUMndl3lzl/laeXkF/8aDt+NNhrajYB185omAo1CPsUpD0qmJ +kos4IHFkCkGL/S9LqzxFmQ8= -----END CERTIFICATE----- Certificate: @@ -196,30 +196,30 @@ Public Key Algorithm: rsaEncryption Public-Key: (2048 bit) Modulus: - 00:c6:2e:8f:2a:f4:b2:4f:96:3c:a7:4e:f6:92:54: - be:34:77:64:65:fe:dd:dc:fd:11:29:a7:6c:56:04: - 9d:70:2f:3c:3f:55:e5:54:79:f0:bb:5f:79:97:f0: - 7b:0a:22:fb:66:d5:e8:6d:30:81:93:99:a5:8f:a5: - e2:33:b8:bd:05:9e:b1:c7:0a:63:75:12:e6:ac:75: - a3:1c:58:a0:c5:7b:40:45:60:f9:6a:8e:45:2a:59: - 7e:5f:8a:b8:a3:c9:bc:9d:dd:aa:d9:1d:85:30:67: - 67:db:d3:04:aa:cf:e9:42:fe:5d:df:46:ac:06:59: - 51:16:a0:e0:6c:f4:c0:ca:f6:c4:85:24:91:60:84: - b1:d0:92:7f:ab:ef:ce:5c:35:07:bc:03:72:32:c8: - 40:67:23:13:08:db:08:f3:cc:a0:75:e4:08:f7:e9: - ba:b3:e1:17:57:b1:16:93:ac:07:fa:04:1c:a7:6c: - d6:12:4f:c5:75:da:d4:6d:99:21:d1:9e:84:15:7a: - 34:ff:89:4e:c2:5b:43:89:86:63:90:db:37:93:15: - 57:27:0e:7a:c9:bb:21:a8:06:69:5d:41:b5:19:24: - bf:08:ea:67:0c:26:22:a3:86:7e:e0:04:d0:82:48: - b4:f5:48:01:56:20:6e:73:6d:c5:e1:62:1b:8e:f2: - bd:e7 + 00:fa:da:12:88:da:6c:4d:a4:17:2e:e6:c7:c7:f6: + fc:0b:41:94:b9:ad:5e:72:7f:53:82:c3:9b:bd:f0: + 39:fd:6c:be:42:2f:28:fe:76:7e:e6:24:f7:6b:32: + 42:c7:0e:6f:b3:9b:4d:61:ab:f3:f1:76:67:29:77: + a5:6a:b9:64:65:40:42:0a:ad:dc:27:16:7a:94:ae: + 8f:f0:d2:db:e7:7c:71:21:c9:ca:f0:64:94:58:32: + b7:fa:d3:27:bc:84:95:ce:d2:81:43:dc:7d:b3:e8: + 76:aa:eb:0a:a6:c1:03:1f:ae:19:db:8a:c4:ef:a1: + bd:f3:d6:e9:e7:20:a8:83:1c:78:d5:85:c2:be:9f: + c9:e2:4e:ab:e6:a8:53:6b:c7:5d:d6:57:6f:4f:2d: + db:75:89:c6:10:a3:96:36:22:8d:c3:0a:20:7b:5f: + 75:04:a6:4a:8d:24:d3:21:0b:16:fe:70:ae:34:d4: + bd:33:27:86:cb:b3:c8:b8:9a:80:70:0c:01:38:af: + e8:dc:0a:32:ca:a8:da:6c:a7:0a:2d:f3:b6:f7:cb: + 7f:ea:59:38:66:ce:9d:93:f2:75:89:d3:5f:43:5c: + 9b:29:1c:d4:e9:37:6d:7c:79:ee:ad:c9:70:62:58: + 4f:25:f6:21:20:44:a8:0b:c6:52:9d:2f:ea:a5:f8: + b3:cf Exponent: 65537 (0x10001) X509v3 extensions: X509v3 Subject Key Identifier: - CB:65:23:DB:47:DE:B5:40:EC:44:D8:90:A7:D6:C0:78:81:FA:E2:CE + C3:6A:BF:B8:BB:62:64:F0:4C:4C:28:47:94:45:0F:15:0D:DC:CD:5A X509v3 Authority Key Identifier: - keyid:CB:65:23:DB:47:DE:B5:40:EC:44:D8:90:A7:D6:C0:78:81:FA:E2:CE + keyid:C3:6A:BF:B8:BB:62:64:F0:4C:4C:28:47:94:45:0F:15:0D:DC:CD:5A Authority Information Access: CA Issuers - URI:http://url-for-aia/Root.cer @@ -234,45 +234,45 @@ X509v3 Basic Constraints: critical CA:TRUE Signature Algorithm: sha256WithRSAEncryption - 74:69:8a:c4:51:dd:1d:be:5d:53:de:9d:de:c7:91:3a:0d:47: - 2f:36:0d:d8:a7:c9:89:7e:68:8f:86:ed:af:e6:83:9c:9e:4e: - 99:df:ae:bb:e7:d0:c2:e4:b9:e7:e5:71:f5:4f:c4:55:a5:1d: - a6:93:2c:f8:5f:ab:45:b4:37:74:bc:14:d6:32:b0:f5:c4:82: - b0:5e:47:14:52:37:64:14:4e:25:f5:bf:db:41:27:78:56:29: - 6a:35:87:62:ef:f8:35:fa:51:d7:36:96:b3:6a:6e:bd:3f:ad: - a5:0f:c8:25:7e:11:26:96:1b:a2:32:ac:21:ad:a8:ff:31:32: - 3d:f3:aa:07:df:f7:72:28:12:a7:b9:40:38:b6:6f:69:89:4e: - 33:52:fc:40:61:85:de:b1:29:92:b5:47:b3:f6:a4:37:1c:8c: - b9:1b:02:52:72:a1:4d:46:aa:84:32:8e:d8:c9:e5:87:87:3d: - 66:8f:a1:af:ef:71:3e:a0:a3:8d:cb:75:4b:57:d6:c8:03:e2: - 40:e3:85:cd:a7:cb:af:cc:49:9c:4c:a2:2a:8c:75:6a:70:88: - 3e:6a:24:a1:35:85:e7:6d:0d:7a:b1:35:45:e3:8e:a8:a6:c9: - 0c:d3:78:41:44:5c:0b:d1:ff:b0:b2:91:ed:a0:83:c7:04:b3: - a9:a7:c1:6e + 48:d9:ed:17:dd:a3:7c:5f:6b:aa:90:6d:f5:d4:61:a3:27:8e: + 83:92:15:7a:6c:d7:87:71:95:6a:e4:e0:d9:11:4e:2a:af:14: + 5c:11:ba:a0:2e:15:bd:f0:c6:2d:72:0a:17:ce:02:1a:3b:61: + 16:5d:1a:ff:e8:45:4d:d6:f2:93:9d:09:ce:e6:ec:a8:c8:de: + e6:40:dc:26:cc:15:89:38:b9:59:06:27:d0:93:af:0e:83:08: + 9f:c3:50:1c:b1:e0:88:69:b2:43:61:c3:4c:bc:d9:19:d7:87: + 57:c3:e6:99:7b:f0:02:09:ac:e1:f0:a1:55:d5:53:0c:fc:c4: + b3:3c:49:67:30:70:d5:c7:cd:94:a6:07:f0:cd:89:fd:68:b4: + 29:9d:63:91:f6:bf:79:da:6a:93:6d:b5:52:57:d8:1a:62:18: + 9f:ed:71:5c:d2:5d:53:0b:04:56:5c:05:81:6b:16:9a:dd:ff: + fe:5d:98:32:97:07:c1:7b:9c:d5:08:07:2e:b9:17:ab:1e:a3: + ea:64:b1:02:1b:04:ca:5f:4c:fd:1f:45:91:d9:f6:de:c7:78: + 9d:aa:5d:b7:cc:6f:58:7f:2d:71:cc:5c:3a:8c:e5:db:51:3e: + af:77:1f:d1:e1:81:cb:74:c0:36:46:be:51:4e:55:94:98:65: + 7d:33:c0:5e -----BEGIN TRUSTED_CERTIFICATE----- MIIDZTCCAk2gAwIBAgIBATANBgkqhkiG9w0BAQsFADAPMQ0wCwYDVQQDDARSb290 MB4XDTE1MDEwMTEyMDAwMFoXDTE2MDEwMTEyMDAwMFowDzENMAsGA1UEAwwEUm9v -dDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMYujyr0sk+WPKdO9pJU -vjR3ZGX+3dz9ESmnbFYEnXAvPD9V5VR58LtfeZfwewoi+2bV6G0wgZOZpY+l4jO4 -vQWesccKY3US5qx1oxxYoMV7QEVg+WqORSpZfl+KuKPJvJ3dqtkdhTBnZ9vTBKrP -6UL+Xd9GrAZZURag4Gz0wMr2xIUkkWCEsdCSf6vvzlw1B7wDcjLIQGcjEwjbCPPM -oHXkCPfpurPhF1exFpOsB/oEHKds1hJPxXXa1G2ZIdGehBV6NP+JTsJbQ4mGY5Db -N5MVVycOesm7IagGaV1BtRkkvwjqZwwmIqOGfuAE0IJItPVIAVYgbnNtxeFiG47y -vecCAwEAAaOByzCByDAdBgNVHQ4EFgQUy2Uj20fetUDsRNiQp9bAeIH64s4wHwYD -VR0jBBgwFoAUy2Uj20fetUDsRNiQp9bAeIH64s4wNwYIKwYBBQUHAQEEKzApMCcG +dDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAPraEojabE2kFy7mx8f2 +/AtBlLmtXnJ/U4LDm73wOf1svkIvKP52fuYk92syQscOb7ObTWGr8/F2Zyl3pWq5 +ZGVAQgqt3CcWepSuj/DS2+d8cSHJyvBklFgyt/rTJ7yElc7SgUPcfbPodqrrCqbB +Ax+uGduKxO+hvfPW6ecgqIMceNWFwr6fyeJOq+aoU2vHXdZXb08t23WJxhCjljYi +jcMKIHtfdQSmSo0k0yELFv5wrjTUvTMnhsuzyLiagHAMATiv6NwKMsqo2mynCi3z +tvfLf+pZOGbOnZPydYnTX0Ncmykc1Ok3bXx57q3JcGJYTyX2ISBEqAvGUp0v6qX4 +s88CAwEAAaOByzCByDAdBgNVHQ4EFgQUw2q/uLtiZPBMTChHlEUPFQ3czVowHwYD +VR0jBBgwFoAUw2q/uLtiZPBMTChHlEUPFQ3czVowNwYIKwYBBQUHAQEEKzApMCcG CCsGAQUFBzAChhtodHRwOi8vdXJsLWZvci1haWEvUm9vdC5jZXIwLAYDVR0fBCUw IzAhoB+gHYYbaHR0cDovL3VybC1mb3ItY3JsL1Jvb3QuY3JsMA4GA1UdDwEB/wQE -AwIBBjAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQB0aYrEUd0d -vl1T3p3ex5E6DUcvNg3Yp8mJfmiPhu2v5oOcnk6Z366759DC5Lnn5XH1T8RVpR2m -kyz4X6tFtDd0vBTWMrD1xIKwXkcUUjdkFE4l9b/bQSd4VilqNYdi7/g1+lHXNpaz -am69P62lD8glfhEmlhuiMqwhraj/MTI986oH3/dyKBKnuUA4tm9piU4zUvxAYYXe -sSmStUez9qQ3HIy5GwJScqFNRqqEMo7YyeWHhz1mj6Gv73E+oKONy3VLV9bIA+JA -44XNp8uvzEmcTKIqjHVqcIg+aiShNYXnbQ16sTVF446opskM03hBRFwL0f+wspHt -oIPHBLOpp8Fu +AwIBBjAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQBI2e0X3aN8 +X2uqkG311GGjJ46DkhV6bNeHcZVq5ODZEU4qrxRcEbqgLhW98MYtcgoXzgIaO2EW +XRr/6EVN1vKTnQnO5uyoyN7mQNwmzBWJOLlZBifQk68Ogwifw1AcseCIabJDYcNM +vNkZ14dXw+aZe/ACCazh8KFV1VMM/MSzPElnMHDVx82UpgfwzYn9aLQpnWOR9r95 +2mqTbbVSV9gaYhif7XFc0l1TCwRWXAWBaxaa3f/+XZgylwfBe5zVCAcuuRerHqPq +ZLECGwTKX0z9H0WR2fbex3idql23zG9Yfy1xzFw6jOXbUT6vdx/R4YHLdMA2Rr5R +TlWUmGV9M8Be -----END TRUSTED_CERTIFICATE----- -----BEGIN TIME----- -MTYwMzAyMTIwMDAwWg== +MTUwMzAyMTIwMDAwWg== -----END TIME----- -----BEGIN VERIFY_RESULT-----
diff --git a/net/data/verify_certificate_chain_unittest/generate-expired-intermediary.py b/net/data/verify_certificate_chain_unittest/generate-expired-intermediary.py index 7a97fe36..463a37b 100755 --- a/net/data/verify_certificate_chain_unittest/generate-expired-intermediary.py +++ b/net/data/verify_certificate_chain_unittest/generate-expired-intermediary.py
@@ -10,20 +10,23 @@ # Self-signed root certificate (part of trust store). root = common.create_self_signed_root_certificate('Root') +root.set_validity_range(common.JANUARY_1_2015_UTC, common.JANUARY_1_2016_UTC) # Intermediary certificate. intermediary = common.create_intermediary_certificate('Intermediary', root) intermediary.set_validity_range(common.JANUARY_1_2015_UTC, - common.JANUARY_1_2016_UTC) + common.MARCH_1_2015_UTC) # Target certificate. target = common.create_end_entity_certificate('Target', intermediary) +target.set_validity_range(common.JANUARY_1_2015_UTC, common.JANUARY_1_2016_UTC) chain = [target, intermediary] trusted = [root] -# March 2nd, 2016 midnight UTC -time = '160302120000Z' +# Both the root and target are valid at this time, however the +# intermediary certificate is not. +time = common.MARCH_2_2015_UTC verify_result = False common.write_test_file(__doc__, chain, trusted, time, verify_result)
diff --git a/net/data/verify_certificate_chain_unittest/generate-expired-target-notBefore.py b/net/data/verify_certificate_chain_unittest/generate-expired-target-notBefore.py index 3ff7d63cb..fae1831c 100755 --- a/net/data/verify_certificate_chain_unittest/generate-expired-target-notBefore.py +++ b/net/data/verify_certificate_chain_unittest/generate-expired-target-notBefore.py
@@ -10,19 +10,23 @@ # Self-signed root certificate (part of trust store). root = common.create_self_signed_root_certificate('Root') +root.set_validity_range(common.JANUARY_1_2015_UTC, common.JANUARY_1_2016_UTC) # Intermediary certificate. intermediary = common.create_intermediary_certificate('Intermediary', root) +intermediary.set_validity_range(common.JANUARY_1_2015_UTC, + common.JANUARY_1_2016_UTC) # Target certificate. target = common.create_end_entity_certificate('Target', intermediary) -target.set_validity_range(common.JANUARY_1_2015_UTC, common.JANUARY_1_2016_UTC) +target.set_validity_range(common.MARCH_2_2015_UTC, common.JANUARY_1_2016_UTC) chain = [target, intermediary] trusted = [root] -# March 2nd, 2014 midnight UTC -time = '140302120000Z' +# Both the root and intermediary are valid at this time, however the +# target is not. +time = common.MARCH_1_2015_UTC verify_result = False common.write_test_file(__doc__, chain, trusted, time, verify_result)
diff --git a/net/data/verify_certificate_chain_unittest/generate-expired-target.py b/net/data/verify_certificate_chain_unittest/generate-expired-target.py index b3b3c531..eaa94d3 100755 --- a/net/data/verify_certificate_chain_unittest/generate-expired-target.py +++ b/net/data/verify_certificate_chain_unittest/generate-expired-target.py
@@ -10,19 +10,23 @@ # Self-signed root certificate (part of trust store). root = common.create_self_signed_root_certificate('Root') +root.set_validity_range(common.JANUARY_1_2015_UTC, common.JANUARY_1_2016_UTC) # Intermediary certificate. intermediary = common.create_intermediary_certificate('Intermediary', root) +intermediary.set_validity_range(common.JANUARY_1_2015_UTC, + common.JANUARY_1_2016_UTC) # Target certificate. target = common.create_end_entity_certificate('Target', intermediary) -target.set_validity_range(common.JANUARY_1_2015_UTC, common.JANUARY_1_2016_UTC) +target.set_validity_range(common.JANUARY_1_2015_UTC, common.MARCH_1_2015_UTC) chain = [target, intermediary] trusted = [root] -# March 2nd, 2016 midnight UTC -time = '160302120000Z' +# Both the root and intermediary are valid at this time, however the +# target is not. +time = common.MARCH_2_2015_UTC verify_result = False common.write_test_file(__doc__, chain, trusted, time, verify_result)
diff --git a/net/disk_cache/simple/simple_entry_impl.cc b/net/disk_cache/simple/simple_entry_impl.cc index 3d9bd0f..d1af70f4 100644 --- a/net/disk_cache/simple/simple_entry_impl.cc +++ b/net/disk_cache/simple/simple_entry_impl.cc
@@ -81,8 +81,8 @@ "WriteResult2", cache_type, result, WRITE_RESULT_MAX); } -// TODO(ttuttle): Consider removing this once we have a good handle on header -// size changes. +// TODO(juliatuttle): Consider removing this once we have a good handle on +// header size changes. void RecordHeaderSizeChange(net::CacheType cache_type, int old_size, int new_size) { HeaderSizeChange size_change; @@ -521,7 +521,7 @@ bool SimpleEntryImpl::CouldBeSparse() const { DCHECK(io_thread_checker_.CalledOnValidThread()); - // TODO(ttuttle): Actually check. + // TODO(juliatuttle): Actually check. return true; }
diff --git a/net/disk_cache/simple/simple_synchronous_entry.cc b/net/disk_cache/simple/simple_synchronous_entry.cc index d68e426..864c05ac 100644 --- a/net/disk_cache/simple/simple_synchronous_entry.cc +++ b/net/disk_cache/simple/simple_synchronous_entry.cc
@@ -785,8 +785,9 @@ for (int i = 0; i < kSimpleEntryFileCount; ++i) { File::Error error; if (!MaybeOpenFile(i, &error)) { - // TODO(ttuttle,gavinp): Remove one each of these triplets of histograms. - // We can calculate the third as the sum or difference of the other two. + // TODO(juliatuttle,gavinp): Remove one each of these triplets of + // histograms. We can calculate the third as the sum or difference of the + // other two. RecordSyncOpenResult( cache_type_, OPEN_ENTRY_PLATFORM_FILE_ERROR, had_index); SIMPLE_CACHE_UMA(ENUMERATION, @@ -865,8 +866,9 @@ for (int i = 0; i < kSimpleEntryFileCount; ++i) { File::Error error; if (!MaybeCreateFile(i, FILE_NOT_REQUIRED, &error)) { - // TODO(ttuttle,gavinp): Remove one each of these triplets of histograms. - // We can calculate the third as the sum or difference of the other two. + // TODO(juliatuttle,gavinp): Remove one each of these triplets of + // histograms. We can calculate the third as the sum or difference of the + // other two. RecordSyncCreateResult(CREATE_ENTRY_PLATFORM_FILE_ERROR, had_index); SIMPLE_CACHE_UMA(ENUMERATION, "SyncCreatePlatformFileError", cache_type_, @@ -1381,7 +1383,7 @@ return false; } } - // TODO(ttuttle): Incremental crc32 calculation? + // TODO(juliatuttle): Incremental crc32 calculation? return true; }
diff --git a/net/dns/dns_config_service_posix.cc b/net/dns/dns_config_service_posix.cc index efb2712a..cb941cb 100644 --- a/net/dns/dns_config_service_posix.cc +++ b/net/dns/dns_config_service_posix.cc
@@ -161,8 +161,8 @@ // DNS code (and its clients) are already robust against failing to get the DNS // config for whatever reason, so the properties can disappear and the world // won't end. -// TODO(ttuttle): Depend on libcutils, then switch this (and other uses of -// __system_property_get) to property_get. +// TODO(juliatuttle): Depend on libcutils, then switch this (and other uses of +// __system_property_get) to property_get. ConfigParsePosixResult ReadDnsConfig(DnsConfig* dns_config) { std::string dns1_string, dns2_string; char property_value[PROP_VALUE_MAX];
diff --git a/net/http/http_cache_transaction.cc b/net/http/http_cache_transaction.cc index e47a20a..23295ad 100644 --- a/net/http/http_cache_transaction.cc +++ b/net/http/http_cache_transaction.cc
@@ -413,7 +413,7 @@ if (network_trans_) return network_trans_->GetFullRequestHeaders(headers); - // TODO(ttuttle): Read headers from cache. + // TODO(juliatuttle): Read headers from cache. return false; }
diff --git a/net/http/http_network_session.cc b/net/http/http_network_session.cc index e23324d6..afb5ff0 100644 --- a/net/http/http_network_session.cc +++ b/net/http/http_network_session.cc
@@ -98,7 +98,7 @@ time_func(&base::TimeTicks::Now), parse_alternative_services(false), enable_alternative_service_with_different_host(false), - enable_npn(true), + enable_npn(false), enable_brotli(false), enable_priority_dependencies(true), enable_quic(false),
diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc index 5a70587..9917c69f 100644 --- a/net/http/http_network_transaction.cc +++ b/net/http/http_network_transaction.cc
@@ -359,7 +359,7 @@ bool HttpNetworkTransaction::GetFullRequestHeaders( HttpRequestHeaders* headers) const { - // TODO(ttuttle): Make sure we've populated request_headers_. + // TODO(juliatuttle): Make sure we've populated request_headers_. *headers = request_headers_; return true; }
diff --git a/net/http/http_network_transaction_unittest.cc b/net/http/http_network_transaction_unittest.cc index 31250f3a..7aa07db 100644 --- a/net/http/http_network_transaction_unittest.cc +++ b/net/http/http_network_transaction_unittest.cc
@@ -4664,7 +4664,7 @@ rv = callback1.WaitForResult(); EXPECT_EQ(ERR_TUNNEL_CONNECTION_FAILED, rv); - // TODO(ttuttle): Anything else to check here? + // TODO(juliatuttle): Anything else to check here? } // Test load timing in the case of two HTTPS (non-SPDY) requests through a SPDY @@ -7493,7 +7493,7 @@ rv = callback.WaitForResult(); EXPECT_EQ(ERR_TUNNEL_CONNECTION_FAILED, rv); - // TODO(ttuttle): Anything else to check here? + // TODO(juliatuttle): Anything else to check here? } // Test that a SPDY proxy's response to a CONNECT request is filtered. @@ -7549,7 +7549,7 @@ rv = callback.WaitForResult(); EXPECT_EQ(ERR_TUNNEL_CONNECTION_FAILED, rv); - // TODO(ttuttle): Anything else to check here? + // TODO(juliatuttle): Anything else to check here? } // Test the request-challenge-retry sequence for basic auth, through
diff --git a/net/http/http_stream_parser.cc b/net/http/http_stream_parser.cc index dd7fabd..c718761e 100644 --- a/net/http/http_stream_parser.cc +++ b/net/http/http_stream_parser.cc
@@ -367,6 +367,8 @@ DCHECK(callback_.is_null()); DCHECK(!callback.is_null()); DCHECK_LE(buf_len, kMaxBufSize); + // Added to investigate crbug.com/499663. + CHECK(buf); if (io_state_ == STATE_DONE) return OK; @@ -645,6 +647,9 @@ int HttpStreamParser::DoReadBody() { io_state_ = STATE_READ_BODY_COMPLETE; + // Added to investigate crbug.com/499663. + CHECK(user_read_buf_.get()); + // There may be some data left over from reading the response headers. if (read_buf_->offset()) { int available = read_buf_->offset() - read_buf_unused_offset_;
diff --git a/net/net.gypi b/net/net.gypi index 9cbcd905..003e7d56f 100644 --- a/net/net.gypi +++ b/net/net.gypi
@@ -1154,6 +1154,7 @@ 'spdy/spdy_buffer.h', 'spdy/spdy_buffer_producer.cc', 'spdy/spdy_buffer_producer.h', + 'spdy/spdy_bug_tracker.h', 'spdy/spdy_frame_builder.cc', 'spdy/spdy_frame_builder.h', 'spdy/spdy_frame_reader.cc',
diff --git a/net/quic/quic_protocol.h b/net/quic/quic_protocol.h index d39e36da..e2e6ee01 100644 --- a/net/quic/quic_protocol.h +++ b/net/quic/quic_protocol.h
@@ -1390,8 +1390,6 @@ // Non-empty if there is a listener for this packet. std::list<AckListenerWrapper> ack_listeners; }; -static_assert(sizeof(TransmissionInfo) <= 128, - "TODO(ianswett): Keep the TransmissionInfo size to a cacheline."); // Struct to store the pending retransmission information. struct PendingRetransmission {
diff --git a/net/spdy/hpack/hpack_input_stream.cc b/net/spdy/hpack/hpack_input_stream.cc index e9e9540..ba64b41 100644 --- a/net/spdy/hpack/hpack_input_stream.cc +++ b/net/spdy/hpack/hpack_input_stream.cc
@@ -8,6 +8,7 @@ #include "base/logging.h" #include "net/spdy/hpack/hpack_huffman_decoder.h" +#include "net/spdy/spdy_bug_tracker.h" namespace net { @@ -200,8 +201,8 @@ break; } } else { - LOG(DFATAL) << "InitializePeekBits called with non-zero bit_offset_: " - << bit_offset_; + SPDY_BUG << "InitializePeekBits called with non-zero bit_offset_: " + << bit_offset_; } return std::make_pair(peeked_count, bits); }
diff --git a/net/spdy/hpack/hpack_input_stream_test.cc b/net/spdy/hpack/hpack_input_stream_test.cc index 1b68754..520f6f7 100644 --- a/net/spdy/hpack/hpack_input_stream_test.cc +++ b/net/spdy/hpack/hpack_input_stream_test.cc
@@ -674,8 +674,8 @@ bits <<= 28; EXPECT_EQ(0xb0000000, bits); - EXPECT_DFATAL(peeked_count_and_bits = input_stream.InitializePeekBits(), - "bit_offset_"); + EXPECT_SPDY_BUG(peeked_count_and_bits = input_stream.InitializePeekBits(), + "bit_offset_"); EXPECT_EQ(0u, peeked_count_and_bits.first); EXPECT_EQ(0u, peeked_count_and_bits.second); EXPECT_TRUE(input_stream.HasMoreData());
diff --git a/net/spdy/http2_write_scheduler.h b/net/spdy/http2_write_scheduler.h index e7fb924..c8b0c39c 100644 --- a/net/spdy/http2_write_scheduler.h +++ b/net/spdy/http2_write_scheduler.h
@@ -23,6 +23,7 @@ #include "base/logging.h" #include "base/macros.h" #include "base/stl_util.h" +#include "net/spdy/spdy_bug_tracker.h" namespace net { @@ -65,38 +66,38 @@ // Registers a new stream with the given weight and parent, adding it to the // dependency tree. Non-exclusive streams simply get added below the parent // stream. If exclusive = true, the stream becomes the parent's sole child - // and the parent's previous children become the children of the new - // stream. If the stream was already registered, logs DFATAL and does - // nothing. If the parent stream is not registered, logs DFATAL and uses the - // root stream as the parent. + // and the parent's previous children become the children of the new stream. + // If the stream was already registered, logs SPDY_BUG and does nothing. If + // the parent stream is not registered, logs SPDY_BUG and uses the root stream + // as the parent. void RegisterStream(StreamIdType stream_id, StreamIdType parent_id, int weight, bool exclusive); // Unregisters the given stream from the scheduler, removing it from the - // dependency tree. If the stream was not previously registered, logs DFATAL - // and does nothing. + // dependency tree. If the stream was not previously registered, logs + // SPDY_BUG and does nothing. void UnregisterStream(StreamIdType stream_id); // Returns the weight value for the specified stream. If the stream is not - // registered, logs DFATAL and returns the lowest weight. + // registered, logs SPDY_BUG and returns the lowest weight. int GetStreamWeight(StreamIdType stream_id) const; // Returns the stream ID for the parent of the given stream. If the stream - // isn't registered, logs DFATAL and returns the root stream ID (0). + // isn't registered, logs SPDY_BUG and returns the root stream ID (0). StreamIdType GetStreamParent(StreamIdType stream_id) const; // Returns stream IDs of the children of the given stream, if any. If the - // stream isn't registered, logs DFATAL and returns an empty vector. + // stream isn't registered, logs SPDY_BUG and returns an empty vector. std::vector<StreamIdType> GetStreamChildren(StreamIdType stream_id) const; // Sets the weight of the given stream. If the stream isn't registered or is - // the root stream, logs DFATAL and does nothing. + // the root stream, logs SPDY_BUG and does nothing. void SetStreamWeight(StreamIdType stream_id, int weight); // Sets the parent of the given stream. If the stream and/or parent aren't - // registered, logs DFATAL and does nothing. If the new parent is a + // registered, logs SPDY_BUG and does nothing. If the new parent is a // descendant of the stream (i.e. this would have created a cycle) then the // topology of the tree is rearranged as described in section 5.3.3 of RFC // 7540: https://tools.ietf.org/html/rfc7540#section-5.3.3 @@ -105,17 +106,17 @@ bool exclusive); // Returns true if the stream parent_id has child_id in its children. If - // either parent or child stream aren't registered, logs DFATAL and returns + // either parent or child stream aren't registered, logs SPDY_BUG and returns // false. bool StreamHasChild(StreamIdType parent_id, StreamIdType child_id) const; // Marks the stream as blocked or unblocked. If the stream is not registered, - // logs DFATAL and does nothing. + // logs SPDY_BUG and does nothing. void MarkStreamBlocked(StreamIdType stream_id, bool blocked); // Marks the stream as ready or not ready to write; i.e. whether there is // buffered data for the associated stream. If the stream is not registered, - // logs DFATAL and does nothing. + // logs SPDY_BUG and does nothing. void MarkStreamReady(StreamIdType stream_id, bool ready); // Returns true iff the scheduler has one or more usable streams. A stream is @@ -126,7 +127,7 @@ // If the scheduler has any usable streams, returns the ID of the next usable // stream, in the process changing its ready state to false. If the scheduler - // does not have any usable streams, logs DFATAL and returns the root stream + // does not have any usable streams, logs SPDY_BUG and returns the root stream // ID (0). If there are multiple usable streams, precedence is given to the // one with the highest priority (thus preserving SPDY priority semantics), // or, if there are multiple with the highest priority, the one with the @@ -262,14 +263,14 @@ int weight, bool exclusive) { if (StreamRegistered(stream_id)) { - LOG(DFATAL) << "Stream " << stream_id << " already registered"; + SPDY_BUG << "Stream " << stream_id << " already registered"; return; } weight = ClampWeight(weight); StreamInfo* parent = FindStream(parent_id); if (parent == nullptr) { - LOG(DFATAL) << "Parent stream " << parent_id << " not registered"; + SPDY_BUG << "Parent stream " << parent_id << " not registered"; parent = root_stream_info_; } @@ -307,13 +308,13 @@ void Http2PriorityWriteScheduler<StreamIdType>::UnregisterStream( StreamIdType stream_id) { if (stream_id == kHttp2RootStreamId) { - LOG(DFATAL) << "Cannot unregister root stream"; + SPDY_BUG << "Cannot unregister root stream"; return; } // Remove the stream from table. typename StreamInfoMap::iterator it = all_stream_infos_.find(stream_id); if (it == all_stream_infos_.end()) { - LOG(DFATAL) << "Stream " << stream_id << " not registered"; + SPDY_BUG << "Stream " << stream_id << " not registered"; return; } std::unique_ptr<StreamInfo> stream_info(std::move(it->second)); @@ -353,7 +354,7 @@ StreamIdType stream_id) const { const StreamInfo* stream_info = FindStream(stream_id); if (stream_info == nullptr) { - LOG(DFATAL) << "Stream " << stream_id << " not registered"; + SPDY_BUG << "Stream " << stream_id << " not registered"; return kHttp2MinStreamWeight; } return stream_info->weight; @@ -364,7 +365,7 @@ StreamIdType stream_id) const { const StreamInfo* stream_info = FindStream(stream_id); if (stream_info == nullptr) { - LOG(DFATAL) << "Stream " << stream_id << " not registered"; + SPDY_BUG << "Stream " << stream_id << " not registered"; return kHttp2RootStreamId; } if (stream_info->parent == nullptr) { // root stream @@ -379,7 +380,7 @@ std::vector<StreamIdType> child_vec; const StreamInfo* stream_info = FindStream(stream_id); if (stream_info == nullptr) { - LOG(DFATAL) << "Stream " << stream_id << " not registered"; + SPDY_BUG << "Stream " << stream_id << " not registered"; } else { child_vec.reserve(stream_info->children.size()); for (StreamInfo* child : stream_info->children) { @@ -394,12 +395,12 @@ StreamIdType stream_id, int weight) { if (stream_id == kHttp2RootStreamId) { - LOG(DFATAL) << "Cannot set weight of root stream"; + SPDY_BUG << "Cannot set weight of root stream"; return; } StreamInfo* stream_info = FindStream(stream_id); if (stream_info == nullptr) { - LOG(DFATAL) << "Stream " << stream_id << " not registered"; + SPDY_BUG << "Stream " << stream_id << " not registered"; return; } weight = ClampWeight(weight); @@ -421,21 +422,21 @@ StreamIdType parent_id, bool exclusive) { if (stream_id == kHttp2RootStreamId) { - LOG(DFATAL) << "Cannot set parent of root stream"; + SPDY_BUG << "Cannot set parent of root stream"; return; } if (stream_id == parent_id) { - LOG(DFATAL) << "Cannot set stream to be its own parent"; + SPDY_BUG << "Cannot set stream to be its own parent"; return; } StreamInfo* stream_info = FindStream(stream_id); if (stream_info == nullptr) { - LOG(DFATAL) << "Stream " << stream_id << " not registered"; + SPDY_BUG << "Stream " << stream_id << " not registered"; return; } StreamInfo* new_parent = FindStream(parent_id); if (new_parent == nullptr) { - LOG(DFATAL) << "Parent stream " << parent_id << " not registered"; + SPDY_BUG << "Parent stream " << parent_id << " not registered"; return; } @@ -491,12 +492,12 @@ StreamIdType stream_id, bool blocked) { if (stream_id == kHttp2RootStreamId) { - LOG(DFATAL) << "Cannot mark root stream blocked or unblocked"; + SPDY_BUG << "Cannot mark root stream blocked or unblocked"; return; } StreamInfo* stream_info = FindStream(stream_id); if (stream_info == nullptr) { - LOG(DFATAL) << "Stream " << stream_id << " not registered"; + SPDY_BUG << "Stream " << stream_id << " not registered"; return; } stream_info->blocked = blocked; @@ -508,12 +509,12 @@ StreamIdType stream_id, bool ready) { if (stream_id == kHttp2RootStreamId) { - LOG(DFATAL) << "Cannot mark root stream ready or unready"; + SPDY_BUG << "Cannot mark root stream ready or unready"; return; } StreamInfo* stream_info = FindStream(stream_id); if (stream_info == nullptr) { - LOG(DFATAL) << "Stream " << stream_id << " not registered"; + SPDY_BUG << "Stream " << stream_id << " not registered"; return; } stream_info->ready = ready; @@ -537,11 +538,11 @@ template <typename StreamIdType> int Http2PriorityWriteScheduler<StreamIdType>::ClampWeight(int weight) { if (weight < kHttp2MinStreamWeight) { - LOG(DFATAL) << "Invalid weight: " << weight; + SPDY_BUG << "Invalid weight: " << weight; return kHttp2MinStreamWeight; } if (weight > kHttp2MaxStreamWeight) { - LOG(DFATAL) << "Invalid weight: " << weight; + SPDY_BUG << "Invalid weight: " << weight; return kHttp2MaxStreamWeight; } return weight; @@ -638,11 +639,11 @@ StreamIdType child_id) const { const StreamInfo* parent = FindStream(parent_id); if (parent == nullptr) { - LOG(DFATAL) << "Parent stream " << parent_id << " not registered"; + SPDY_BUG << "Parent stream " << parent_id << " not registered"; return false; } if (!StreamRegistered(child_id)) { - LOG(DFATAL) << "Child stream " << child_id << " not registered"; + SPDY_BUG << "Child stream " << child_id << " not registered"; return false; } auto found = std::find_if(parent->children.begin(), parent->children.end(), @@ -671,7 +672,7 @@ return stream_info->id; } } - LOG(DFATAL) << "No usable streams"; + SPDY_BUG << "No usable streams"; return kHttp2RootStreamId; }
diff --git a/net/spdy/http2_write_scheduler_test.cc b/net/spdy/http2_write_scheduler_test.cc index f581d35..5f36b41 100644 --- a/net/spdy/http2_write_scheduler_test.cc +++ b/net/spdy/http2_write_scheduler_test.cc
@@ -4,6 +4,7 @@ #include "net/spdy/http2_write_scheduler.h" +#include "net/spdy/spdy_test_utils.h" #include "net/test/gtest_util.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" @@ -62,8 +63,8 @@ scheduler_.RegisterStream(5, 0, 50, false); // Should not be able to add a stream with an id that already exists. - EXPECT_DFATAL(scheduler_.RegisterStream(5, 1, 50, false), - "Stream 5 already registered"); + EXPECT_SPDY_BUG(scheduler_.RegisterStream(5, 1, 50, false), + "Stream 5 already registered"); EXPECT_EQ(3, scheduler_.num_streams()); EXPECT_TRUE(scheduler_.StreamRegistered(1)); ASSERT_TRUE(scheduler_.StreamRegistered(5)); @@ -80,7 +81,7 @@ scheduler_.UnregisterStream(5); // Cannot remove a stream that has already been removed. - EXPECT_DFATAL(scheduler_.UnregisterStream(5), "Stream 5 not registered"); + EXPECT_SPDY_BUG(scheduler_.UnregisterStream(5), "Stream 5 not registered"); EXPECT_EQ(3, scheduler_.num_streams()); EXPECT_TRUE(scheduler_.StreamRegistered(1)); EXPECT_FALSE(scheduler_.StreamRegistered(5)); @@ -88,13 +89,13 @@ EXPECT_EQ(kHttp2RootStreamId, scheduler_.GetStreamParent(13)); // The parent stream 19 doesn't exist, so this should use 0 as parent stream: - EXPECT_DFATAL(scheduler_.RegisterStream(7, 19, 70, false), - "Parent stream 19 not registered"); + EXPECT_SPDY_BUG(scheduler_.RegisterStream(7, 19, 70, false), + "Parent stream 19 not registered"); EXPECT_TRUE(scheduler_.StreamRegistered(7)); EXPECT_EQ(0u, scheduler_.GetStreamParent(7)); // Now stream 7 already exists, so this should fail: - EXPECT_DFATAL(scheduler_.RegisterStream(7, 1, 70, false), - "Stream 7 already registered"); + EXPECT_SPDY_BUG(scheduler_.RegisterStream(7, 1, 70, false), + "Stream 7 already registered"); // Try adding a second child to stream 13: scheduler_.RegisterStream(17, 13, 170, false); @@ -107,8 +108,9 @@ } TEST_F(Http2PriorityWriteSchedulerTest, GetStreamWeight) { - EXPECT_DFATAL(EXPECT_EQ(kHttp2MinStreamWeight, scheduler_.GetStreamWeight(3)), - "Stream 3 not registered"); + EXPECT_SPDY_BUG( + EXPECT_EQ(kHttp2MinStreamWeight, scheduler_.GetStreamWeight(3)), + "Stream 3 not registered"); scheduler_.RegisterStream(3, 0, 130, true); EXPECT_EQ(130, scheduler_.GetStreamWeight(3)); scheduler_.SetStreamWeight(3, 50); @@ -119,42 +121,42 @@ } TEST_F(Http2PriorityWriteSchedulerTest, GetStreamParent) { - EXPECT_DFATAL(EXPECT_EQ(kHttp2RootStreamId, scheduler_.GetStreamParent(3)), - "Stream 3 not registered"); + EXPECT_SPDY_BUG(EXPECT_EQ(kHttp2RootStreamId, scheduler_.GetStreamParent(3)), + "Stream 3 not registered"); scheduler_.RegisterStream(2, 0, 20, false); scheduler_.RegisterStream(3, 2, 30, false); EXPECT_EQ(2u, scheduler_.GetStreamParent(3)); scheduler_.UnregisterStream(3); - EXPECT_DFATAL(EXPECT_EQ(kHttp2RootStreamId, scheduler_.GetStreamParent(3)), - "Stream 3 not registered"); + EXPECT_SPDY_BUG(EXPECT_EQ(kHttp2RootStreamId, scheduler_.GetStreamParent(3)), + "Stream 3 not registered"); } TEST_F(Http2PriorityWriteSchedulerTest, GetStreamChildren) { - EXPECT_DFATAL(EXPECT_THAT(scheduler_.GetStreamChildren(7), IsEmpty()), - "Stream 7 not registered"); + EXPECT_SPDY_BUG(EXPECT_THAT(scheduler_.GetStreamChildren(7), IsEmpty()), + "Stream 7 not registered"); scheduler_.RegisterStream(7, 0, 70, false); EXPECT_THAT(scheduler_.GetStreamChildren(7), IsEmpty()); scheduler_.RegisterStream(9, 7, 90, false); scheduler_.RegisterStream(15, 7, 150, false); EXPECT_THAT(scheduler_.GetStreamChildren(7), UnorderedElementsAre(9, 15)); scheduler_.UnregisterStream(7); - EXPECT_DFATAL(EXPECT_THAT(scheduler_.GetStreamChildren(7), IsEmpty()), - "Stream 7 not registered"); + EXPECT_SPDY_BUG(EXPECT_THAT(scheduler_.GetStreamChildren(7), IsEmpty()), + "Stream 7 not registered"); } TEST_F(Http2PriorityWriteSchedulerTest, SetStreamWeight) { - EXPECT_DFATAL(scheduler_.SetStreamWeight(0, 10), - "Cannot set weight of root stream"); - EXPECT_DFATAL(scheduler_.SetStreamWeight(3, 10), "Stream 3 not registered"); + EXPECT_SPDY_BUG(scheduler_.SetStreamWeight(0, 10), + "Cannot set weight of root stream"); + EXPECT_SPDY_BUG(scheduler_.SetStreamWeight(3, 10), "Stream 3 not registered"); scheduler_.RegisterStream(3, 0, 10, false); scheduler_.SetStreamWeight(3, 20); EXPECT_EQ(20, scheduler_.GetStreamWeight(3)); - EXPECT_DFATAL(scheduler_.SetStreamWeight(3, 500), "Invalid weight: 500"); + EXPECT_SPDY_BUG(scheduler_.SetStreamWeight(3, 500), "Invalid weight: 500"); EXPECT_EQ(kHttp2MaxStreamWeight, scheduler_.GetStreamWeight(3)); - EXPECT_DFATAL(scheduler_.SetStreamWeight(3, 0), "Invalid weight: 0"); + EXPECT_SPDY_BUG(scheduler_.SetStreamWeight(3, 0), "Invalid weight: 0"); EXPECT_EQ(kHttp2MinStreamWeight, scheduler_.GetStreamWeight(3)); scheduler_.UnregisterStream(3); - EXPECT_DFATAL(scheduler_.SetStreamWeight(3, 10), "Stream 3 not registered"); + EXPECT_SPDY_BUG(scheduler_.SetStreamWeight(3, 10), "Stream 3 not registered"); } // Basic case of reparenting a subtree. @@ -208,12 +210,12 @@ scheduler_.RegisterStream(1, 0, 100, false); scheduler_.RegisterStream(2, 0, 100, false); for (bool exclusive : {true, false}) { - EXPECT_DFATAL(scheduler_.SetStreamParent(1, 3, exclusive), - "Parent stream 3 not registered"); - EXPECT_DFATAL(scheduler_.SetStreamParent(4, 2, exclusive), - "Stream 4 not registered"); - EXPECT_DFATAL(scheduler_.SetStreamParent(3, 4, exclusive), - "Stream 3 not registered"); + EXPECT_SPDY_BUG(scheduler_.SetStreamParent(1, 3, exclusive), + "Parent stream 3 not registered"); + EXPECT_SPDY_BUG(scheduler_.SetStreamParent(4, 2, exclusive), + "Stream 4 not registered"); + EXPECT_SPDY_BUG(scheduler_.SetStreamParent(3, 4, exclusive), + "Stream 3 not registered"); EXPECT_THAT(scheduler_.GetStreamChildren(0), UnorderedElementsAre(1, 2)); EXPECT_THAT(scheduler_.GetStreamChildren(1), IsEmpty()); EXPECT_THAT(scheduler_.GetStreamChildren(2), IsEmpty()); @@ -391,10 +393,10 @@ TEST_F(Http2PriorityWriteSchedulerTest, SetStreamParentToSelf) { scheduler_.RegisterStream(1, 0, 100, false); - EXPECT_DFATAL(scheduler_.SetStreamParent(1, 1, false), - "Cannot set stream to be its own parent"); - EXPECT_DFATAL(scheduler_.SetStreamParent(1, 1, true), - "Cannot set stream to be its own parent"); + EXPECT_SPDY_BUG(scheduler_.SetStreamParent(1, 1, false), + "Cannot set stream to be its own parent"); + EXPECT_SPDY_BUG(scheduler_.SetStreamParent(1, 1, true), + "Cannot set stream to be its own parent"); EXPECT_THAT(scheduler_.GetStreamChildren(0), ElementsAre(1)); EXPECT_THAT(scheduler_.GetStreamChildren(1), IsEmpty()); ASSERT_TRUE(peer_.ValidateInvariants()); @@ -404,10 +406,10 @@ scheduler_.RegisterStream(1, 0, 10, false); scheduler_.RegisterStream(2, 1, 20, false); scheduler_.RegisterStream(3, 1, 30, false); - EXPECT_DFATAL(EXPECT_FALSE(scheduler_.StreamHasChild(4, 1)), - "Parent stream 4 not registered"); - EXPECT_DFATAL(EXPECT_FALSE(scheduler_.StreamHasChild(3, 7)), - "Child stream 7 not registered"); + EXPECT_SPDY_BUG(EXPECT_FALSE(scheduler_.StreamHasChild(4, 1)), + "Parent stream 4 not registered"); + EXPECT_SPDY_BUG(EXPECT_FALSE(scheduler_.StreamHasChild(3, 7)), + "Child stream 7 not registered"); EXPECT_FALSE(scheduler_.StreamHasChild(3, 1)); EXPECT_TRUE(scheduler_.StreamHasChild(1, 3)); EXPECT_TRUE(scheduler_.StreamHasChild(1, 2));
diff --git a/net/spdy/priority_write_scheduler.h b/net/spdy/priority_write_scheduler.h index e1e144d..86b4f5f 100644 --- a/net/spdy/priority_write_scheduler.h +++ b/net/spdy/priority_write_scheduler.h
@@ -13,6 +13,7 @@ #include <utility> #include "base/logging.h" +#include "net/spdy/spdy_bug_tracker.h" #include "net/spdy/spdy_protocol.h" namespace net { @@ -46,24 +47,22 @@ // Registers the given stream with the scheduler, which will now track its // priority and ready state. If the stream was already registered, logs - // DFATAL and does nothing. + // SPDY_BUG and does nothing. void RegisterStream(StreamIdType stream_id, SpdyPriority priority) { priority = ClampPriority(priority); StreamInfo stream_info = {priority, false}; bool inserted = stream_infos_.insert(std::make_pair(stream_id, stream_info)).second; - if (!inserted) { - LOG(DFATAL) << "Stream " << stream_id << " already registered"; - } + SPDY_BUG_IF(!inserted) << "Stream " << stream_id << " already registered"; } // Unregisters the given stream from the scheduler, which will no // longer keep track of its priority and ready state. If the stream - // was not previously registered, logs DFATAL and does nothing. + // was not previously registered, logs SPDY_BUG and does nothing. void UnregisterStream(StreamIdType stream_id) { auto it = stream_infos_.find(stream_id); if (it == stream_infos_.end()) { - LOG(DFATAL) << "Stream " << stream_id << " not registered"; + SPDY_BUG << "Stream " << stream_id << " not registered"; return; } StreamInfo& stream_info = it->second; @@ -75,22 +74,22 @@ } // Returns the priority value for the specified stream. If the stream is not - // registered, logs DFATAL and returns the lowest priority. + // registered, logs SPDY_BUG and returns the lowest priority. SpdyPriority GetStreamPriority(StreamIdType stream_id) const { auto it = stream_infos_.find(stream_id); if (it == stream_infos_.end()) { - LOG(DFATAL) << "Stream " << stream_id << " not registered"; + SPDY_BUG << "Stream " << stream_id << " not registered"; return kV3LowestPriority; } return it->second.priority; } // Updates the priority of the given stream. If the stream is not registered, - // logs DFATAL and does nothing. + // logs SPDY_BUG and does nothing. void UpdateStreamPriority(StreamIdType stream_id, SpdyPriority priority) { auto it = stream_infos_.find(stream_id); if (it == stream_infos_.end()) { - LOG(DFATAL) << "Stream " << stream_id << " not registered"; + SPDY_BUG << "Stream " << stream_id << " not registered"; return; } StreamInfo& stream_info = it->second; @@ -108,7 +107,7 @@ // If the scheduler has any ready streams, pops the next stream ID from the // highest priority non-empty ready list and returns it, transitioning the // stream from ready to not ready. If the scheduler doesn't have any ready - // streams, logs DFATAL and returns 0. + // streams, logs SPDY_BUG and returns 0. StreamIdType PopNextReadyStream() { StreamIdType stream_id = 0; for (SpdyPriority p = kV3HighestPriority; p <= kV3LowestPriority; ++p) { @@ -119,14 +118,14 @@ auto it = stream_infos_.find(stream_id); if (it == stream_infos_.end()) { - LOG(DFATAL) << "Missing StreamInfo for stream " << stream_id; + SPDY_BUG << "Missing StreamInfo for stream " << stream_id; } else { it->second.ready = false; } return stream_id; } } - LOG(DFATAL) << "No ready streams available"; + SPDY_BUG << "No ready streams available"; return stream_id; } @@ -141,7 +140,7 @@ auto it = stream_infos_.find(stream_id); if (it == stream_infos_.end()) { - LOG(DFATAL) << "Stream " << stream_id << " not registered"; + SPDY_BUG << "Stream " << stream_id << " not registered"; return false; } @@ -159,11 +158,11 @@ // Returns true if the scheduler has any ready streams with a higher priority // than that of the specified stream. If the stream is not registered, logs - // DFATAL and returns false. + // SPDY_BUG and returns false. bool HasHigherPriorityReadyStream(StreamIdType stream_id) const { auto it = stream_infos_.find(stream_id); if (it == stream_infos_.end()) { - LOG(DFATAL) << "Stream " << stream_id << " not registered"; + SPDY_BUG << "Stream " << stream_id << " not registered"; return false; } const StreamInfo& stream_info = it->second; @@ -176,13 +175,13 @@ } // Marks the given stream as ready to write. If stream was already ready, - // does nothing. If stream was not registered, logs DFATAL and does + // does nothing. If stream was not registered, logs SPDY_BUG and does // nothing. If |add_to_front| is true, adds stream to the front of its // per-priority ready list, otherwise adds it to the back. void MarkStreamReady(StreamIdType stream_id, bool add_to_front) { auto it = stream_infos_.find(stream_id); if (it == stream_infos_.end()) { - LOG(DFATAL) << "Stream " << stream_id << " not registered"; + SPDY_BUG << "Stream " << stream_id << " not registered"; return; } StreamInfo& stream_info = it->second; @@ -200,11 +199,11 @@ // Marks the given stream as not ready to write, removing it from the ready // list for its priority. If stream was already not ready, does nothing. If - // stream was not registered, logs DFATAL and does nothing. + // stream was not registered, logs SPDY_BUG and does nothing. void MarkStreamNotReady(StreamIdType stream_id) { auto it = stream_infos_.find(stream_id); if (it == stream_infos_.end()) { - LOG(DFATAL) << "Stream " << stream_id << " not registered"; + SPDY_BUG << "Stream " << stream_id << " not registered"; return; } StreamInfo& stream_info = it->second; @@ -256,11 +255,11 @@ static SpdyPriority ClampPriority(SpdyPriority priority) { if (priority < kV3HighestPriority) { - LOG(DFATAL) << "Invalid priority: " << static_cast<int>(priority); + SPDY_BUG << "Invalid priority: " << static_cast<int>(priority); return kV3HighestPriority; } if (priority > kV3LowestPriority) { - LOG(DFATAL) << "Invalid priority: " << static_cast<int>(priority); + SPDY_BUG << "Invalid priority: " << static_cast<int>(priority); return kV3LowestPriority; } return priority;
diff --git a/net/spdy/priority_write_scheduler_test.cc b/net/spdy/priority_write_scheduler_test.cc index 56f659d..d261ef2 100644 --- a/net/spdy/priority_write_scheduler_test.cc +++ b/net/spdy/priority_write_scheduler_test.cc
@@ -4,6 +4,7 @@ #include "net/spdy/priority_write_scheduler.h" +#include "net/spdy/spdy_test_utils.h" #include "net/test/gtest_util.h" namespace net { @@ -20,8 +21,10 @@ scheduler_.RegisterStream(1, 1); // Try redundant registrations. - EXPECT_DFATAL(scheduler_.RegisterStream(1, 1), "Stream 1 already registered"); - EXPECT_DFATAL(scheduler_.RegisterStream(1, 2), "Stream 1 already registered"); + EXPECT_SPDY_BUG(scheduler_.RegisterStream(1, 1), + "Stream 1 already registered"); + EXPECT_SPDY_BUG(scheduler_.RegisterStream(1, 2), + "Stream 1 already registered"); scheduler_.RegisterStream(2, 3); @@ -32,19 +35,20 @@ scheduler_.UnregisterStream(2); // Try redundant unregistration. - EXPECT_DFATAL(scheduler_.UnregisterStream(1), "Stream 1 not registered"); - EXPECT_DFATAL(scheduler_.UnregisterStream(2), "Stream 2 not registered"); + EXPECT_SPDY_BUG(scheduler_.UnregisterStream(1), "Stream 1 not registered"); + EXPECT_SPDY_BUG(scheduler_.UnregisterStream(2), "Stream 2 not registered"); } TEST_F(PriorityWriteSchedulerTest, GetStreamPriority) { - EXPECT_DFATAL(EXPECT_EQ(kV3LowestPriority, scheduler_.GetStreamPriority(1)), - "Stream 1 not registered"); + EXPECT_SPDY_BUG(EXPECT_EQ(kV3LowestPriority, scheduler_.GetStreamPriority(1)), + "Stream 1 not registered"); scheduler_.RegisterStream(1, 3); EXPECT_EQ(3, scheduler_.GetStreamPriority(1)); // Redundant registration shouldn't change stream priority. - EXPECT_DFATAL(scheduler_.RegisterStream(1, 4), "Stream 1 already registered"); + EXPECT_SPDY_BUG(scheduler_.RegisterStream(1, 4), + "Stream 1 already registered"); EXPECT_EQ(3, scheduler_.GetStreamPriority(1)); scheduler_.UpdateStreamPriority(1, 5); @@ -65,18 +69,18 @@ EXPECT_EQ(6, scheduler_.GetStreamPriority(1)); scheduler_.UnregisterStream(1); - EXPECT_DFATAL(EXPECT_EQ(kV3LowestPriority, scheduler_.GetStreamPriority(1)), - "Stream 1 not registered"); + EXPECT_SPDY_BUG(EXPECT_EQ(kV3LowestPriority, scheduler_.GetStreamPriority(1)), + "Stream 1 not registered"); } TEST_F(PriorityWriteSchedulerTest, UpdateStreamPriority) { // Updating priority of unregistered stream should have no effect. - EXPECT_DFATAL(EXPECT_EQ(kV3LowestPriority, scheduler_.GetStreamPriority(3)), - "Stream 3 not registered"); - EXPECT_DFATAL(scheduler_.UpdateStreamPriority(3, 1), - "Stream 3 not registered"); - EXPECT_DFATAL(EXPECT_EQ(kV3LowestPriority, scheduler_.GetStreamPriority(3)), - "Stream 3 not registered"); + EXPECT_SPDY_BUG(EXPECT_EQ(kV3LowestPriority, scheduler_.GetStreamPriority(3)), + "Stream 3 not registered"); + EXPECT_SPDY_BUG(scheduler_.UpdateStreamPriority(3, 1), + "Stream 3 not registered"); + EXPECT_SPDY_BUG(EXPECT_EQ(kV3LowestPriority, scheduler_.GetStreamPriority(3)), + "Stream 3 not registered"); scheduler_.RegisterStream(3, 1); EXPECT_EQ(1, scheduler_.GetStreamPriority(3)); @@ -105,13 +109,13 @@ EXPECT_EQ(4, scheduler_.PopNextReadyStream()); scheduler_.UnregisterStream(3); - EXPECT_DFATAL(scheduler_.UpdateStreamPriority(3, 1), - "Stream 3 not registered"); + EXPECT_SPDY_BUG(scheduler_.UpdateStreamPriority(3, 1), + "Stream 3 not registered"); } TEST_F(PriorityWriteSchedulerTest, HasHigherPriorityReadyStream) { - EXPECT_DFATAL(EXPECT_FALSE(scheduler_.HasHigherPriorityReadyStream(1)), - "Stream 1 not registered"); + EXPECT_SPDY_BUG(EXPECT_FALSE(scheduler_.HasHigherPriorityReadyStream(1)), + "Stream 1 not registered"); // Add ready streams of lower and equal priority. scheduler_.RegisterStream(1, 4); @@ -137,11 +141,11 @@ TEST_F(PriorityWriteSchedulerTest, MarkStreamReadyBack) { EXPECT_FALSE(scheduler_.HasReadyStreams()); - EXPECT_DFATAL(scheduler_.MarkStreamReady(1, false), - "Stream 1 not registered"); + EXPECT_SPDY_BUG(scheduler_.MarkStreamReady(1, false), + "Stream 1 not registered"); EXPECT_FALSE(scheduler_.HasReadyStreams()); - EXPECT_DFATAL(EXPECT_EQ(0, scheduler_.PopNextReadyStream()), - "No ready streams available"); + EXPECT_SPDY_BUG(EXPECT_EQ(0, scheduler_.PopNextReadyStream()), + "No ready streams available"); // Add a bunch of ready streams to tail of per-priority lists. // Expected order: (P2) 4, (P3) 1, 2, 3, (P5) 5. @@ -162,16 +166,17 @@ EXPECT_EQ(2, scheduler_.PopNextReadyStream()); EXPECT_EQ(3, scheduler_.PopNextReadyStream()); EXPECT_EQ(5, scheduler_.PopNextReadyStream()); - EXPECT_DFATAL(EXPECT_EQ(0, scheduler_.PopNextReadyStream()), - "No ready streams available"); + EXPECT_SPDY_BUG(EXPECT_EQ(0, scheduler_.PopNextReadyStream()), + "No ready streams available"); } TEST_F(PriorityWriteSchedulerTest, MarkStreamReadyFront) { EXPECT_FALSE(scheduler_.HasReadyStreams()); - EXPECT_DFATAL(scheduler_.MarkStreamReady(1, true), "Stream 1 not registered"); + EXPECT_SPDY_BUG(scheduler_.MarkStreamReady(1, true), + "Stream 1 not registered"); EXPECT_FALSE(scheduler_.HasReadyStreams()); - EXPECT_DFATAL(EXPECT_EQ(0, scheduler_.PopNextReadyStream()), - "No ready streams available"); + EXPECT_SPDY_BUG(EXPECT_EQ(0, scheduler_.PopNextReadyStream()), + "No ready streams available"); // Add a bunch of ready streams to head of per-priority lists. // Expected order: (P2) 4, (P3) 3, 2, 1, (P5) 5 @@ -192,8 +197,8 @@ EXPECT_EQ(2, scheduler_.PopNextReadyStream()); EXPECT_EQ(1, scheduler_.PopNextReadyStream()); EXPECT_EQ(5, scheduler_.PopNextReadyStream()); - EXPECT_DFATAL(EXPECT_EQ(0, scheduler_.PopNextReadyStream()), - "No ready streams available"); + EXPECT_SPDY_BUG(EXPECT_EQ(0, scheduler_.PopNextReadyStream()), + "No ready streams available"); } TEST_F(PriorityWriteSchedulerTest, MarkStreamReadyBackAndFront) { @@ -220,8 +225,8 @@ EXPECT_EQ(3, scheduler_.PopNextReadyStream()); EXPECT_EQ(1, scheduler_.PopNextReadyStream()); EXPECT_EQ(5, scheduler_.PopNextReadyStream()); - EXPECT_DFATAL(EXPECT_EQ(0, scheduler_.PopNextReadyStream()), - "No ready streams available"); + EXPECT_SPDY_BUG(EXPECT_EQ(0, scheduler_.PopNextReadyStream()), + "No ready streams available"); } TEST_F(PriorityWriteSchedulerTest, MarkStreamNotReady) { @@ -234,15 +239,15 @@ EXPECT_EQ(0u, scheduler_.NumReadyStreams()); // Empty pop should fail. - EXPECT_DFATAL(EXPECT_EQ(0, scheduler_.PopNextReadyStream()), - "No ready streams available"); + EXPECT_SPDY_BUG(EXPECT_EQ(0, scheduler_.PopNextReadyStream()), + "No ready streams available"); // Tolerate redundant marking of a stream as not ready. scheduler_.MarkStreamNotReady(1); EXPECT_EQ(0u, scheduler_.NumReadyStreams()); // Should only be able to mark registered streams. - EXPECT_DFATAL(scheduler_.MarkStreamNotReady(3), "Stream 3 not registered"); + EXPECT_SPDY_BUG(scheduler_.MarkStreamNotReady(3), "Stream 3 not registered"); } TEST_F(PriorityWriteSchedulerTest, UnregisterRemovesStream) { @@ -253,8 +258,8 @@ // Unregistering a stream should remove it from set of ready streams. scheduler_.UnregisterStream(3); EXPECT_EQ(0u, scheduler_.NumReadyStreams()); - EXPECT_DFATAL(EXPECT_EQ(0, scheduler_.PopNextReadyStream()), - "No ready streams available"); + EXPECT_SPDY_BUG(EXPECT_EQ(0, scheduler_.PopNextReadyStream()), + "No ready streams available"); } TEST_F(PriorityWriteSchedulerTest, ShouldYield) {
diff --git a/net/spdy/spdy_bug_tracker.h b/net/spdy/spdy_bug_tracker.h new file mode 100644 index 0000000..fc05f68 --- /dev/null +++ b/net/spdy/spdy_bug_tracker.h
@@ -0,0 +1,14 @@ +// Copyright (c) 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 NET_SPDY_SPDY_BUG_TRACKER_H_ +#define NET_SPDY_SPDY_BUG_TRACKER_H_ + +#include "base/logging.h" + +#define SPDY_BUG LOG(DFATAL) +#define SPDY_BUG_IF(condition) LOG_IF(DFATAL, (condition)) +#define FLAGS_spdy_always_log_bugs_for_tests (true) + +#endif // NET_SPDY_SPDY_BUG_TRACKER_H_
diff --git a/net/spdy/spdy_frame_builder.cc b/net/spdy/spdy_frame_builder.cc index 7911b80..91a48b12 100644 --- a/net/spdy/spdy_frame_builder.cc +++ b/net/spdy/spdy_frame_builder.cc
@@ -7,6 +7,7 @@ #include <limits> #include "base/logging.h" +#include "net/spdy/spdy_bug_tracker.h" #include "net/spdy/spdy_framer.h" #include "net/spdy/spdy_protocol.h" @@ -108,7 +109,7 @@ if (length_ > 0) { // Update length field for previous frame. OverwriteLength(framer, length_ - framer.GetPrefixLength(type)); - DLOG_IF(DFATAL, SpdyConstants::GetFrameMaximumSize(version_) < length_) + SPDY_BUG_IF(SpdyConstants::GetFrameMaximumSize(version_) < length_) << "Frame length " << length_ << " is longer than the maximum allowed length."; }
diff --git a/net/spdy/spdy_frame_builder.h b/net/spdy/spdy_frame_builder.h index 65d5f288..86c8ee0 100644 --- a/net/spdy/spdy_frame_builder.h +++ b/net/spdy/spdy_frame_builder.h
@@ -14,6 +14,7 @@ #include "base/strings/string_piece.h" #include "base/sys_byteorder.h" #include "net/base/net_export.h" +#include "net/spdy/spdy_bug_tracker.h" #include "net/spdy/spdy_protocol.h" namespace net { @@ -76,7 +77,7 @@ // Takes the buffer from the SpdyFrameBuilder. SpdySerializedFrame take() { if (version_ == HTTP2) { - DLOG_IF(DFATAL, SpdyConstants::GetFrameMaximumSize(version_) < length_) + SPDY_BUG_IF(SpdyConstants::GetFrameMaximumSize(version_) < length_) << "Frame length " << length_ << " is longer than the maximum allowed length."; }
diff --git a/net/spdy/spdy_framer.cc b/net/spdy/spdy_framer.cc index 611f3e4..f142086 100644 --- a/net/spdy/spdy_framer.cc +++ b/net/spdy/spdy_framer.cc
@@ -17,6 +17,7 @@ #include "net/quic/quic_flags.h" #include "net/spdy/hpack/hpack_constants.h" #include "net/spdy/spdy_bitmasks.h" +#include "net/spdy/spdy_bug_tracker.h" #include "net/spdy/spdy_frame_builder.h" #include "net/spdy/spdy_frame_reader.h" #include "third_party/zlib/zlib.h" @@ -144,7 +145,7 @@ SettingsFlagsAndId::SettingsFlagsAndId(uint8_t flags, uint32_t id) : flags_(flags), id_(id & 0x00ffffff) { - LOG_IF(DFATAL, id > (1u << 24)) << "SPDY setting ID too large: " << id; + SPDY_BUG_IF(id > (1u << 24)) << "SPDY setting ID too large: " << id; } uint32_t SettingsFlagsAndId::GetWireFormat(SpdyMajorVersion version) const { @@ -419,6 +420,8 @@ switch (error_code) { case SPDY_NO_ERROR: return "NO_ERROR"; + case SPDY_INVALID_STREAM_ID: + return "INVALID_STREAM_ID"; case SPDY_INVALID_CONTROL_FRAME: return "INVALID_CONTROL_FRAME"; case SPDY_CONTROL_PAYLOAD_TOO_LARGE: @@ -638,8 +641,8 @@ } default: - LOG(DFATAL) << "Invalid value for " << display_protocol_ - << " framer state: " << state_; + SPDY_BUG << "Invalid value for " << display_protocol_ + << " framer state: " << state_; // This ensures that we don't infinite-loop if state_ gets an // invalid value somehow, such as due to a SpdyFramer getting deleted // from a callback it calls. @@ -679,6 +682,68 @@ last_setting_id = -1; } +SpdyFrameType SpdyFramer::ValidateFrameHeader(bool is_control_frame, + int frame_type_field) { + if (!SpdyConstants::IsValidFrameType(protocol_version_, frame_type_field)) { + if (protocol_version_ == SPDY3) { + if (is_control_frame) { + DLOG(WARNING) << "Invalid control frame type " << frame_type_field + << " (protocol version: " << protocol_version_ << ")"; + set_error(SPDY_INVALID_CONTROL_FRAME); + } else { + // Else it's a SPDY3 data frame which we don't validate further here + } + } else { + // In HTTP2 we ignore unknown frame types for extensibility, as long as + // the rest of the control frame header is valid. + // We rely on the visitor to check validity of current_frame_stream_id_. + bool valid_stream = + visitor_->OnUnknownFrame(current_frame_stream_id_, frame_type_field); + if (valid_stream) { + DLOG(WARNING) << "Ignoring unknown frame type."; + CHANGE_STATE(SPDY_IGNORE_REMAINING_PAYLOAD); + } else { + // Report an invalid frame error and close the stream if the + // stream_id is not valid. + DLOG(WARNING) << "Unknown control frame type " << frame_type_field + << " received on invalid stream " + << current_frame_stream_id_; + set_error(SPDY_INVALID_CONTROL_FRAME); + } + } + return DATA; + } + + SpdyFrameType frame_type = + SpdyConstants::ParseFrameType(protocol_version_, frame_type_field); + + if (protocol_version_ == HTTP2) { + if (!SpdyConstants::IsValidHTTP2FrameStreamId(current_frame_stream_id_, + frame_type)) { + DLOG(ERROR) << "The framer received an invalid streamID of " + << current_frame_stream_id_ << " for a frame of type " + << FrameTypeToString(frame_type); + set_error(SPDY_INVALID_STREAM_ID); + return frame_type; + } + + // Ensure that we see a CONTINUATION frame iff we expect to. + if ((frame_type == CONTINUATION) != (expect_continuation_ != 0)) { + if (expect_continuation_ != 0) { + DLOG(ERROR) << "The framer was expecting to receive a CONTINUATION " + << "frame, but instead received a frame of type " + << FrameTypeToString(frame_type); + } else { + DLOG(ERROR) << "The framer received an unexpected CONTINUATION frame."; + } + set_error(SPDY_UNEXPECTED_FRAME); + return frame_type; + } + } + + return frame_type; +} + size_t SpdyFramer::ProcessCommonHeader(const char* data, size_t len) { // This should only be called when we're in the SPDY_READING_COMMON_HEADER // state. @@ -721,8 +786,6 @@ set_error(SPDY_UNSUPPORTED_VERSION); return 0; } - // We check control_frame_type_field's validity in - // ProcessControlFrameHeader(). uint16_t control_frame_type_field_uint16; successful_read = reader.ReadUInt16(&control_frame_type_field_uint16); control_frame_type_field = control_frame_type_field_uint16; @@ -768,24 +831,8 @@ DCHECK(successful_read); remaining_data_length_ = current_frame_length_ - reader.GetBytesConsumed(); - - // Before we accept a DATA frame, we need to make sure we're not in the - // middle of processing a header block. - const bool is_continuation_frame = - (control_frame_type_field == - SpdyConstants::SerializeFrameType(protocol_version_, CONTINUATION)); - if ((expect_continuation_ != 0) != is_continuation_frame) { - if (expect_continuation_ != 0) { - DLOG(ERROR) << "The framer was expecting to receive a CONTINUATION " - << "frame, but instead received frame type " - << control_frame_type_field; - } else { - DLOG(ERROR) << "The framer received an unexpected CONTINUATION frame."; - } - set_error(SPDY_UNEXPECTED_FRAME); - return original_len - len; - } } + DCHECK_EQ(is_control_frame ? GetControlFrameHeaderSize() : GetDataFrameMinimumSize(), reader.GetBytesConsumed()); @@ -807,6 +854,13 @@ } } + current_frame_type_ = + ValidateFrameHeader(is_control_frame, control_frame_type_field); + + if (state_ == SPDY_ERROR || state_ == SPDY_IGNORE_REMAINING_PAYLOAD) { + return original_len - len; + } + // if we're here, then we have the common header all received. if (!is_control_frame) { if (protocol_version_ == HTTP2) { @@ -855,38 +909,6 @@ DCHECK_EQ(SPDY_NO_ERROR, error_code_); DCHECK_LE(GetControlFrameHeaderSize(), current_frame_buffer_.len()); - if (!SpdyConstants::IsValidFrameType(protocol_version_, - control_frame_type_field)) { - if (protocol_version_ == SPDY3) { - DLOG(WARNING) << "Invalid control frame type " << control_frame_type_field - << " (protocol version: " << protocol_version_ << ")"; - set_error(SPDY_INVALID_CONTROL_FRAME); - return; - } else { - // In HTTP2 we ignore unknown frame types for extensibility, as long as - // the rest of the control frame header is valid. - // We rely on the visitor to check validity of current_frame_stream_id_. - bool valid_stream = visitor_->OnUnknownFrame(current_frame_stream_id_, - control_frame_type_field); - if (valid_stream) { - DVLOG(1) << "Ignoring unknown frame type."; - CHANGE_STATE(SPDY_IGNORE_REMAINING_PAYLOAD); - } else { - // Report an invalid frame error and close the stream if the - // stream_id is not valid. - DLOG(WARNING) << "Unknown control frame type " - << control_frame_type_field - << " received on invalid stream " - << current_frame_stream_id_; - set_error(SPDY_INVALID_CONTROL_FRAME); - } - return; - } - } - - current_frame_type_ = SpdyConstants::ParseFrameType(protocol_version_, - control_frame_type_field); - // Do some sanity checking on the control frame sizes and flags. switch (current_frame_type_) { case SYN_STREAM: @@ -1125,8 +1147,8 @@ // We should already be in an error state. Double-check. DCHECK_EQ(SPDY_ERROR, state_); if (state_ != SPDY_ERROR) { - LOG(DFATAL) << display_protocol_ - << " control frame buffer too small for fixed-length frame."; + SPDY_BUG << display_protocol_ + << " control frame buffer too small for fixed-length frame."; set_error(SPDY_CONTROL_PAYLOAD_TOO_LARGE); } return; @@ -1569,7 +1591,7 @@ current_frame_type_ != HEADERS && current_frame_type_ != PUSH_PROMISE && current_frame_type_ != CONTINUATION) { - LOG(DFATAL) << "Unhandled frame type in ProcessControlFrameHeaderBlock."; + SPDY_BUG << "Unhandled frame type in ProcessControlFrameHeaderBlock."; } size_t process_bytes = std::min( data_len, remaining_data_length_ - remaining_padding_payload_length_); @@ -2089,7 +2111,8 @@ DCHECK_EQ(remaining_padding_payload_length_, remaining_data_length_); size_t amount_to_discard = std::min(remaining_padding_payload_length_, len); if (current_frame_type_ == DATA && amount_to_discard > 0) { - DCHECK_EQ(HTTP2, protocol_version_); + SPDY_BUG_IF(protocol_version_ == SPDY3) + << "Padding invalid for SPDY version " << protocol_version_; visitor_->OnStreamPadding(current_frame_stream_id_, amount_to_discard); } data += amount_to_discard; @@ -2197,9 +2220,9 @@ (*block)[name] = value; } if (reader.GetBytesConsumed() != header_length) { - LOG(DFATAL) << "Buffer expected to consist entirely of headers, but only " - << reader.GetBytesConsumed() << " bytes consumed, from " - << header_length; + SPDY_BUG << "Buffer expected to consist entirely of headers, but only " + << reader.GetBytesConsumed() << " bytes consumed, from " + << header_length; return false; } @@ -2290,7 +2313,7 @@ // Sanitize priority. uint8_t priority = syn_stream.priority(); if (priority > GetLowestPriority()) { - DLOG(DFATAL) << "Priority out-of-bounds."; + SPDY_BUG << "Priority out-of-bounds."; priority = GetLowestPriority(); } @@ -2514,7 +2537,7 @@ SpdyPriority priority = static_cast<SpdyPriority>(headers.priority()); if (headers.has_priority()) { if (headers.priority() > GetLowestPriority()) { - DLOG(DFATAL) << "Priority out-of-bounds."; + SPDY_BUG << "Priority out-of-bounds."; priority = GetLowestPriority(); } size += 5; @@ -2981,7 +3004,7 @@ // Get a decompressor or set error. z_stream* decomp = GetHeaderDecompressor(); if (decomp == NULL) { - LOG(DFATAL) << "Couldn't get decompressor for handling compressed headers."; + SPDY_BUG << "Couldn't get decompressor for handling compressed headers."; set_error(SPDY_DECOMPRESS_FAILURE); return false; } @@ -3101,7 +3124,7 @@ z_stream* compressor = GetHeaderCompressor(); if (!compressor) { - LOG(DFATAL) << "Could not obtain compressor."; + SPDY_BUG << "Could not obtain compressor."; return; } // Create an output frame.
diff --git a/net/spdy/spdy_framer.h b/net/spdy/spdy_framer.h index 7e25329..f8c3256 100644 --- a/net/spdy/spdy_framer.h +++ b/net/spdy/spdy_framer.h
@@ -328,6 +328,7 @@ // SPDY error codes. enum SpdyError { SPDY_NO_ERROR, + SPDY_INVALID_STREAM_ID, // Stream ID is invalid SPDY_INVALID_CONTROL_FRAME, // Control frame is mal-formatted. SPDY_CONTROL_PAYLOAD_TOO_LARGE, // Control frame payload was too large. SPDY_ZLIB_INIT_FAILURE, // The Zlib library could not initialize. @@ -631,6 +632,18 @@ size_t ProcessAltSvcFramePayload(const char* data, size_t len); size_t ProcessIgnoredControlFramePayload(/*const char* data,*/ size_t len); + // Validates the frame header against the current protocol, e.g. + // Frame type must be known, must specify a non-zero stream id. + // + // is_control_frame: the control bit for SPDY3 + // frame_type_field: the unparsed frame type octet(s) + // + // For valid frames, returns the correct SpdyFrameType. + // Otherwise returns a best guess at invalid frame type, + // after setting the appropriate SpdyError. + SpdyFrameType ValidateFrameHeader(bool is_control_frame, + int frame_type_field); + // TODO(jgraettinger): To be removed with migration to // SpdyHeadersHandlerInterface. Serializes the last-processed // header block of |hpack_decoder_| as a SPDY3 format block, and
diff --git a/net/spdy/spdy_framer_test.cc b/net/spdy/spdy_framer_test.cc index e08169e..c105c16 100644 --- a/net/spdy/spdy_framer_test.cc +++ b/net/spdy/spdy_framer_test.cc
@@ -825,6 +825,29 @@ << SpdyFramer::ErrorCodeToString(framer.error_code()); } +// Test that if we receive a DATA with stream ID zero, we signal an error +// (but don't crash). +TEST_P(SpdyFramerTest, DataWithStreamIdZero) { + if (!IsHttp2()) { + return; + } + + testing::StrictMock<test::MockSpdyFramerVisitor> visitor; + SpdyFramer framer(spdy_version_); + framer.set_visitor(&visitor); + + const char bytes[] = "hello"; + SpdyDataIR data_ir(0, bytes); + SpdySerializedFrame frame(framer.SerializeData(data_ir)); + + // We shouldn't have to read the whole frame before we signal an error. + EXPECT_CALL(visitor, OnError(testing::Eq(&framer))); + EXPECT_GT(frame.size(), framer.ProcessInput(frame.data(), frame.size())); + EXPECT_TRUE(framer.HasError()); + EXPECT_EQ(SpdyFramer::SPDY_INVALID_STREAM_ID, framer.error_code()) + << SpdyFramer::ErrorCodeToString(framer.error_code()); +} + // Test that if we receive a HEADERS with stream ID zero, we signal an error // (but don't crash). TEST_P(SpdyFramerTest, HeadersWithStreamIdZero) { @@ -840,7 +863,145 @@ EXPECT_CALL(visitor, OnError(testing::Eq(&framer))); EXPECT_GT(frame.size(), framer.ProcessInput(frame.data(), frame.size())); EXPECT_TRUE(framer.HasError()); - EXPECT_EQ(SpdyFramer::SPDY_INVALID_CONTROL_FRAME, framer.error_code()) + if (IsHttp2()) { + EXPECT_EQ(SpdyFramer::SPDY_INVALID_STREAM_ID, framer.error_code()) + << SpdyFramer::ErrorCodeToString(framer.error_code()); + } else { + EXPECT_EQ(SpdyFramer::SPDY_INVALID_CONTROL_FRAME, framer.error_code()) + << SpdyFramer::ErrorCodeToString(framer.error_code()); + } +} + +// Test that if we receive a PRIORITY with stream ID zero, we signal an error +// (but don't crash). +TEST_P(SpdyFramerTest, PriorityWithStreamIdZero) { + if (!IsHttp2()) { + return; + } + + testing::StrictMock<test::MockSpdyFramerVisitor> visitor; + SpdyFramer framer(spdy_version_); + framer.set_visitor(&visitor); + + SpdyPriorityIR priority_ir(0, 1, 16, true); + SpdySerializedFrame frame(framer.SerializeFrame(priority_ir)); + + // We shouldn't have to read the whole frame before we signal an error. + EXPECT_CALL(visitor, OnError(testing::Eq(&framer))); + EXPECT_GT(frame.size(), framer.ProcessInput(frame.data(), frame.size())); + EXPECT_TRUE(framer.HasError()); + EXPECT_EQ(SpdyFramer::SPDY_INVALID_STREAM_ID, framer.error_code()) + << SpdyFramer::ErrorCodeToString(framer.error_code()); +} + +// Test that if we receive a RST_STREAM with stream ID zero, we signal an error +// (but don't crash). +TEST_P(SpdyFramerTest, RstStreamWithStreamIdZero) { + if (!IsHttp2()) { + return; + } + + testing::StrictMock<test::MockSpdyFramerVisitor> visitor; + SpdyFramer framer(spdy_version_); + framer.set_visitor(&visitor); + + SpdyRstStreamIR rst_stream_ir(0, RST_STREAM_PROTOCOL_ERROR); + SpdySerializedFrame frame(framer.SerializeRstStream(rst_stream_ir)); + + // We shouldn't have to read the whole frame before we signal an error. + EXPECT_CALL(visitor, OnError(testing::Eq(&framer))); + EXPECT_GT(frame.size(), framer.ProcessInput(frame.data(), frame.size())); + EXPECT_TRUE(framer.HasError()); + EXPECT_EQ(SpdyFramer::SPDY_INVALID_STREAM_ID, framer.error_code()) + << SpdyFramer::ErrorCodeToString(framer.error_code()); +} + +// Test that if we receive a SETTINGS with stream ID other than zero, +// we signal an error (but don't crash). +TEST_P(SpdyFramerTest, SettingsWithStreamIdNotZero) { + if (!IsHttp2()) { + return; + } + + testing::StrictMock<test::MockSpdyFramerVisitor> visitor; + SpdyFramer framer(spdy_version_); + framer.set_visitor(&visitor); + + // Settings frame with invalid StreamID of 0x01 + char kH2FrameData[] = { + 0x00, 0x00, 0x06, // Length + 0x04, // Type (SETTINGS) + 0x00, // Flags + 0x00, 0x00, 0x00, 0x01, // Stream id + 0x00, 0x04, // Setting id + 0x0a, 0x0b, 0x0c, 0x0d, // Setting value + }; + + SpdySerializedFrame frame(kH2FrameData, sizeof(kH2FrameData), false); + + // We shouldn't have to read the whole frame before we signal an error. + EXPECT_CALL(visitor, OnError(testing::Eq(&framer))); + EXPECT_GT(frame.size(), framer.ProcessInput(frame.data(), frame.size())); + EXPECT_TRUE(framer.HasError()); + EXPECT_EQ(SpdyFramer::SPDY_INVALID_STREAM_ID, framer.error_code()) + << SpdyFramer::ErrorCodeToString(framer.error_code()); +} + +// Test that if we receive a GOAWAY with stream ID other than zero, +// we signal an error (but don't crash). +TEST_P(SpdyFramerTest, GoawayWithStreamIdNotZero) { + if (!IsHttp2()) { + return; + } + + testing::StrictMock<test::MockSpdyFramerVisitor> visitor; + SpdyFramer framer(spdy_version_); + framer.set_visitor(&visitor); + + // GOAWAY frame with invalid StreamID of 0x01 + char kH2FrameData[] = { + 0x00, 0x00, 0x0a, // Length + 0x07, // Type (GOAWAY) + 0x00, // Flags + 0x00, 0x00, 0x00, 0x01, // Stream id + 0x00, 0x00, 0x00, 0x00, // Last-stream ID + 0x00, 0x00, 0x00, 0x00, // Error code + 0x47, 0x41, // Opaque Description + }; + + SpdySerializedFrame frame(kH2FrameData, sizeof(kH2FrameData), false); + + // We shouldn't have to read the whole frame before we signal an error. + EXPECT_CALL(visitor, OnError(testing::Eq(&framer))); + EXPECT_GT(frame.size(), framer.ProcessInput(frame.data(), frame.size())); + EXPECT_TRUE(framer.HasError()); + EXPECT_EQ(SpdyFramer::SPDY_INVALID_STREAM_ID, framer.error_code()) + << SpdyFramer::ErrorCodeToString(framer.error_code()); +} + +// Test that if we receive a CONTINUATION with stream ID zero, we signal an +// error +// (but don't crash). +TEST_P(SpdyFramerTest, ContinuationWithStreamIdZero) { + if (!IsHttp2()) { + return; + } + + testing::StrictMock<test::MockSpdyFramerVisitor> visitor; + SpdyFramer framer(spdy_version_); + framer.set_visitor(&visitor); + + SpdyContinuationIR continuation(0); + continuation.SetHeader("bar", "foo"); + continuation.SetHeader("foo", "bar"); + continuation.set_end_headers(true); + SpdySerializedFrame frame(framer.SerializeContinuation(continuation)); + + // We shouldn't have to read the whole frame before we signal an error. + EXPECT_CALL(visitor, OnError(testing::Eq(&framer))); + EXPECT_GT(frame.size(), framer.ProcessInput(frame.data(), frame.size())); + EXPECT_TRUE(framer.HasError()); + EXPECT_EQ(SpdyFramer::SPDY_INVALID_STREAM_ID, framer.error_code()) << SpdyFramer::ErrorCodeToString(framer.error_code()); } @@ -863,7 +1024,7 @@ EXPECT_CALL(visitor, OnError(testing::Eq(&framer))); EXPECT_GT(frame.size(), framer.ProcessInput(frame.data(), frame.size())); EXPECT_TRUE(framer.HasError()); - EXPECT_EQ(SpdyFramer::SPDY_INVALID_CONTROL_FRAME, framer.error_code()) + EXPECT_EQ(SpdyFramer::SPDY_INVALID_STREAM_ID, framer.error_code()) << SpdyFramer::ErrorCodeToString(framer.error_code()); } @@ -3236,9 +3397,6 @@ // Create a frame at exatly that size. string big_value(kBigValueSize, 'x'); syn_stream.SetHeader("aa", big_value); - // Upstream branches here and wraps HTTP/2 with EXPECT_DEBUG_DFATAL. We - // neither support that in Chromium, nor do we use the same DFATAL (see - // SpdyFrameBuilder::WriteFramePrefix()). control_frame = framer.SerializeSynStream(syn_stream); EXPECT_EQ(SpdyConstants::GetFrameMaximumSize(spdy_version_), @@ -3967,20 +4125,16 @@ } const unsigned char kInput[] = { - 0x00, 0x00, 0x18, 0x01, 0x00, // HEADERS - 0x00, 0x00, 0x00, 0x01, // Stream 1 - 0x00, 0x06, 0x63, 0x6f, - 0x6f, 0x6b, 0x69, 0x65, - 0x07, 0x66, 0x6f, 0x6f, - 0x3d, 0x62, 0x61, 0x72, + 0x00, 0x00, 0x10, 0x01, 0x00, // HEADERS + 0x00, 0x00, 0x00, 0x01, // Stream 1 + 0x00, 0x06, 0x63, 0x6f, 0x6f, 0x6b, 0x69, 0x65, + 0x07, 0x66, 0x6f, 0x6f, 0x3d, 0x62, 0x61, 0x72, - 0x00, 0x00, 0x1c, 0x08, 0x00, // HEADERS - 0x00, 0x00, 0x00, 0x01, // Stream 1 - 0x00, 0x06, 0x63, 0x6f, // (Note this is a valid continued encoding). - 0x6f, 0x6b, 0x69, 0x65, - 0x08, 0x62, 0x61, 0x7a, - 0x3d, 0x62, 0x69, 0x6e, - 0x67, 0x00, 0x06, 0x63, + 0x00, 0x00, 0x1c, 0x08, 0x00, // HEADERS + 0x00, 0x00, 0x00, 0x01, // Stream 1 + 0x00, 0x06, 0x63, 0x6f, // (Note this is a valid continued encoding). + 0x6f, 0x6b, 0x69, 0x65, 0x08, 0x62, 0x61, 0x7a, + 0x3d, 0x62, 0x69, 0x6e, 0x67, 0x00, 0x06, 0x63, }; SpdyFramer framer(spdy_version_); @@ -4224,6 +4378,8 @@ TEST_P(SpdyFramerTest, ErrorCodeToStringTest) { EXPECT_STREQ("NO_ERROR", SpdyFramer::ErrorCodeToString(SpdyFramer::SPDY_NO_ERROR)); + EXPECT_STREQ("INVALID_STREAM_ID", SpdyFramer::ErrorCodeToString( + SpdyFramer::SPDY_INVALID_STREAM_ID)); EXPECT_STREQ("INVALID_CONTROL_FRAME", SpdyFramer::ErrorCodeToString( SpdyFramer::SPDY_INVALID_CONTROL_FRAME)); @@ -5678,8 +5834,11 @@ // PING frame of size 4, which isn't correct. const unsigned char kFrameData[] = { - 0x00, 0x00, 0x04, 0x06, 0x00, 0x00, 0x00, - 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x04, // Length + 0x06, // Type (PING) + 0x00, // Flags + 0x00, 0x00, 0x00, 0x00, // Stream id + 0x00, 0x00, 0x00, 0x01, // Opaque data }; TestSpdyVisitor visitor(spdy_version_);
diff --git a/net/spdy/spdy_headers_block_parser.cc b/net/spdy/spdy_headers_block_parser.cc index 83a2160..d5f0341 100644 --- a/net/spdy/spdy_headers_block_parser.cc +++ b/net/spdy/spdy_headers_block_parser.cc
@@ -5,6 +5,7 @@ #include "net/spdy/spdy_headers_block_parser.h" #include "base/sys_byteorder.h" +#include "net/spdy/spdy_bug_tracker.h" namespace net { namespace { @@ -45,7 +46,7 @@ error_ = NO_PARSER_ERROR; } if (error_ != NO_PARSER_ERROR) { - LOG(DFATAL) << "Unexpected error: " << error_; + SPDY_BUG << "Unexpected error: " << error_; return false; } @@ -55,13 +56,13 @@ stream_id_ = stream_id; } if (stream_id != stream_id_) { - LOG(DFATAL) << "Unexpected stream id: " << stream_id << " (expected " - << stream_id_ << ")"; + SPDY_BUG << "Unexpected stream id: " << stream_id << " (expected " + << stream_id_ << ")"; error_ = UNEXPECTED_STREAM_ID; return false; } if (stream_id_ == kInvalidStreamId) { - LOG(DFATAL) << "Expected nonzero stream id, saw: " << stream_id_; + SPDY_BUG << "Expected nonzero stream id, saw: " << stream_id_; error_ = UNEXPECTED_STREAM_ID; return false; }
diff --git a/net/spdy/spdy_headers_block_parser_test.cc b/net/spdy/spdy_headers_block_parser_test.cc index edbff63..2f80fdc3 100644 --- a/net/spdy/spdy_headers_block_parser_test.cc +++ b/net/spdy/spdy_headers_block_parser_test.cc
@@ -9,6 +9,7 @@ #include "base/strings/string_number_conversions.h" #include "base/sys_byteorder.h" +#include "net/spdy/spdy_test_utils.h" #include "net/test/gtest_util.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" @@ -247,7 +248,7 @@ EXPECT_FALSE(parser_->HandleControlFrameHeadersData(1, headers.data(), 1)); EXPECT_EQ(SpdyHeadersBlockParser::NEED_MORE_DATA, parser_->get_error()); bool result; - EXPECT_DFATAL( + EXPECT_SPDY_BUG( result = parser_->HandleControlFrameHeadersData(2, headers.data() + 1, 1), "Unexpected stream id: 2 \\(expected 1\\)"); EXPECT_FALSE(result); @@ -257,7 +258,7 @@ TEST_P(SpdyHeadersBlockParserTest, InvalidStreamIdTest) { string headers(CreateHeaders(kNumHeadersInBlock, false)); bool result; - EXPECT_DFATAL( + EXPECT_SPDY_BUG( result = parser_->HandleControlFrameHeadersData(0, headers.data(), 1), "Expected nonzero stream id, saw: 0"); EXPECT_FALSE(result);
diff --git a/net/spdy/spdy_network_transaction_unittest.cc b/net/spdy/spdy_network_transaction_unittest.cc index 67d97f8..97dc9f2 100644 --- a/net/spdy/spdy_network_transaction_unittest.cc +++ b/net/spdy/spdy_network_transaction_unittest.cc
@@ -606,6 +606,16 @@ EXPECT_TRUE(data->AllReadDataConsumed()); EXPECT_TRUE(data->AllWriteDataConsumed()); + LoadTimingInfo load_timing_info; + EXPECT_TRUE(trans->GetLoadTimingInfo(&load_timing_info)); + EXPECT_TRUE(load_timing_info.push_start.is_null()); + EXPECT_TRUE(load_timing_info.push_end.is_null()); + + LoadTimingInfo load_timing_info2; + EXPECT_TRUE(trans2->GetLoadTimingInfo(&load_timing_info2)); + EXPECT_FALSE(load_timing_info2.push_start.is_null()); + EXPECT_FALSE(load_timing_info2.push_end.is_null()); + // Verify that the received push data is same as the expected push data. EXPECT_EQ(result2.compare(expected), 0) << "Received data: " << result2 @@ -2952,7 +2962,7 @@ "Push on even stream id.")); } else { goaway.reset(spdy_util_.ConstructSpdyGoAway( - 0, GOAWAY_PROTOCOL_ERROR, "Framer error: 1 (INVALID_CONTROL_FRAME).")); + 0, GOAWAY_PROTOCOL_ERROR, "Framer error: 1 (INVALID_STREAM_ID).")); } MockWrite writes[] = { CreateMockWrite(*stream1_syn, 0), CreateMockWrite(*goaway, 3), @@ -3546,7 +3556,7 @@ std::unique_ptr<SpdySerializedFrame> req( spdy_util_.ConstructSpdyGet(nullptr, 0, 1, LOWEST, true)); std::unique_ptr<SpdySerializedFrame> goaway(spdy_util_.ConstructSpdyGoAway( - 0, GOAWAY_COMPRESSION_ERROR, "Framer error: 5 (DECOMPRESS_FAILURE).")); + 0, GOAWAY_COMPRESSION_ERROR, "Framer error: 6 (DECOMPRESS_FAILURE).")); MockWrite writes[] = {CreateMockWrite(*req, 0), CreateMockWrite(*goaway, 2)}; // This is the length field that's too short. @@ -3581,7 +3591,7 @@ std::unique_ptr<SpdySerializedFrame> req( spdy_util_.ConstructSpdyGet(nullptr, 0, 1, LOWEST, true)); std::unique_ptr<SpdySerializedFrame> goaway(spdy_util_.ConstructSpdyGoAway( - 0, GOAWAY_COMPRESSION_ERROR, "Framer error: 5 (DECOMPRESS_FAILURE).")); + 0, GOAWAY_COMPRESSION_ERROR, "Framer error: 6 (DECOMPRESS_FAILURE).")); MockWrite writes[] = {CreateMockWrite(*req, 0), CreateMockWrite(*goaway, 2)}; // Read HEADERS with corrupted payload. @@ -3603,7 +3613,7 @@ spdy_util_.ConstructSpdyGet(nullptr, 0, 1, LOWEST, true)); std::unique_ptr<SpdySerializedFrame> goaway(spdy_util_.ConstructSpdyGoAway( 0, GOAWAY_FRAME_SIZE_ERROR, - "Framer error: 12 (INVALID_CONTROL_FRAME_SIZE).")); + "Framer error: 13 (INVALID_CONTROL_FRAME_SIZE).")); MockWrite writes[] = {CreateMockWrite(*req, 0), CreateMockWrite(*goaway, 2)}; // Read WINDOW_UPDATE with incorrectly-sized payload.
diff --git a/net/spdy/spdy_protocol.cc b/net/spdy/spdy_protocol.cc index f69e02c1..4ef25f6 100644 --- a/net/spdy/spdy_protocol.cc +++ b/net/spdy/spdy_protocol.cc
@@ -4,6 +4,8 @@ #include "net/spdy/spdy_protocol.h" +#include "net/spdy/spdy_bug_tracker.h" + namespace net { bool SpdyConstants::IsValidFrameType(SpdyMajorVersion version, @@ -41,7 +43,7 @@ return true; } - LOG(DFATAL) << "Unhandled SPDY version " << version; + SPDY_BUG << "Unhandled SPDY version " << version; return false; } @@ -98,7 +100,7 @@ break; } - LOG(DFATAL) << "Unhandled frame type " << frame_type_field; + SPDY_BUG << "Unhandled frame type " << frame_type_field; return DATA; } @@ -124,7 +126,7 @@ case WINDOW_UPDATE: return 9; default: - LOG(DFATAL) << "Serializing unhandled frame type " << frame_type; + SPDY_BUG << "Serializing unhandled frame type " << frame_type; return -1; } case HTTP2: @@ -155,12 +157,12 @@ case BLOCKED: return 11; default: - LOG(DFATAL) << "Serializing unhandled frame type " << frame_type; + SPDY_BUG << "Serializing unhandled frame type " << frame_type; return -1; } } - LOG(DFATAL) << "Unhandled SPDY version " << version; + SPDY_BUG << "Unhandled SPDY version " << version; return -1; } @@ -172,10 +174,39 @@ return SerializeFrameType(version, DATA); } - LOG(DFATAL) << "Unhandled SPDY version " << version; + SPDY_BUG << "Unhandled SPDY version " << version; return 0; } +bool SpdyConstants::IsValidHTTP2FrameStreamId( + SpdyStreamId current_frame_stream_id, + SpdyFrameType frame_type_field) { + if (current_frame_stream_id == 0) { + switch (frame_type_field) { + case DATA: + case HEADERS: + case PRIORITY: + case RST_STREAM: + case CONTINUATION: + case PUSH_PROMISE: + // These frame types must specify a stream + return false; + default: + return true; + } + } else { + switch (frame_type_field) { + case GOAWAY: + case SETTINGS: + case PING: + // These frame types must not specify a stream + return false; + default: + return true; + } + } +} + bool SpdyConstants::IsValidSettingId(SpdyMajorVersion version, int setting_id_field) { switch (version) { @@ -209,7 +240,7 @@ return true; } - LOG(DFATAL) << "Unhandled SPDY version " << version; + SPDY_BUG << "Unhandled SPDY version " << version; return false; } @@ -252,7 +283,7 @@ break; } - LOG(DFATAL) << "Unhandled setting ID " << setting_id_field; + SPDY_BUG << "Unhandled setting ID " << setting_id_field; return SETTINGS_UPLOAD_BANDWIDTH; } @@ -276,7 +307,7 @@ case SETTINGS_INITIAL_WINDOW_SIZE: return 7; default: - LOG(DFATAL) << "Serializing unhandled setting id " << id; + SPDY_BUG << "Serializing unhandled setting id " << id; return -1; } case HTTP2: @@ -294,11 +325,11 @@ case SETTINGS_MAX_HEADER_LIST_SIZE: return 6; default: - LOG(DFATAL) << "Serializing unhandled setting id " << id; + SPDY_BUG << "Serializing unhandled setting id " << id; return -1; } } - LOG(DFATAL) << "Unhandled SPDY version " << version; + SPDY_BUG << "Unhandled SPDY version " << version; return -1; } @@ -345,7 +376,7 @@ return true; } - LOG(DFATAL) << "Unhandled SPDY version " << version; + SPDY_BUG << "Unhandled SPDY version " << version; return false; } @@ -405,7 +436,7 @@ break; } - LOG(DFATAL) << "Invalid RST_STREAM status " << rst_stream_status_field; + SPDY_BUG << "Invalid RST_STREAM status " << rst_stream_status_field; return RST_STREAM_PROTOCOL_ERROR; } @@ -436,8 +467,7 @@ case RST_STREAM_FRAME_TOO_LARGE: return 11; default: - LOG(DFATAL) << "Unhandled RST_STREAM status " - << rst_stream_status; + SPDY_BUG << "Unhandled RST_STREAM status " << rst_stream_status; return -1; } case HTTP2: @@ -465,12 +495,11 @@ case RST_STREAM_HTTP_1_1_REQUIRED: return 13; default: - LOG(DFATAL) << "Unhandled RST_STREAM status " - << rst_stream_status; + SPDY_BUG << "Unhandled RST_STREAM status " << rst_stream_status; return -1; } } - LOG(DFATAL) << "Unhandled SPDY version " << version; + SPDY_BUG << "Unhandled SPDY version " << version; return -1; } @@ -505,7 +534,7 @@ return true; } - LOG(DFATAL) << "Unknown SpdyMajorVersion " << version; + SPDY_BUG << "Unknown SpdyMajorVersion " << version; return false; } @@ -556,7 +585,7 @@ break; } - LOG(DFATAL) << "Unhandled GOAWAY status " << goaway_status_field; + SPDY_BUG << "Unhandled GOAWAY status " << goaway_status_field; return GOAWAY_PROTOCOL_ERROR; } @@ -583,7 +612,7 @@ case GOAWAY_HTTP_1_1_REQUIRED: return 1; // PROTOCOL_ERROR. default: - LOG(DFATAL) << "Serializing unhandled GOAWAY status " << status; + SPDY_BUG << "Serializing unhandled GOAWAY status " << status; return -1; } case HTTP2: @@ -617,11 +646,11 @@ case GOAWAY_HTTP_1_1_REQUIRED: return 13; default: - LOG(DFATAL) << "Serializing unhandled GOAWAY status " << status; + SPDY_BUG << "Serializing unhandled GOAWAY status " << status; return -1; } } - LOG(DFATAL) << "Unknown SpdyMajorVersion " << version; + SPDY_BUG << "Unknown SpdyMajorVersion " << version; return -1; } @@ -632,7 +661,7 @@ case HTTP2: return 9; } - LOG(DFATAL) << "Unhandled SPDY version."; + SPDY_BUG << "Unhandled SPDY version."; return 0; } @@ -643,7 +672,7 @@ case HTTP2: return 9; } - LOG(DFATAL) << "Unhandled SPDY version."; + SPDY_BUG << "Unhandled SPDY version."; return 0; } @@ -692,7 +721,7 @@ case HTTP2: return "h2"; default: - LOG(DFATAL) << "Unsupported SPDY major version: " << version; + SPDY_BUG << "Unsupported SPDY major version: " << version; return "spdy/3"; } }
diff --git a/net/spdy/spdy_protocol.h b/net/spdy/spdy_protocol.h index baefbd8..11cc117 100644 --- a/net/spdy/spdy_protocol.h +++ b/net/spdy/spdy_protocol.h
@@ -441,6 +441,12 @@ // in the given SPDY version. static int DataFrameType(SpdyMajorVersion version); + // (HTTP/2) All standard frame types except WINDOW_UPDATE are + // (stream-specific xor connection-level). Returns false iff we know + // the given frame type does not align with the given streamID. + static bool IsValidHTTP2FrameStreamId(SpdyStreamId current_frame_stream_id, + SpdyFrameType frame_type_field); + // Returns true if a given on-the-wire enumeration of a setting id is valid // for a given protocol version, false otherwise. static bool IsValidSettingId(SpdyMajorVersion version, int setting_id_field);
diff --git a/net/spdy/spdy_protocol_test.cc b/net/spdy/spdy_protocol_test.cc index 77a4ce5..d451f05 100644 --- a/net/spdy/spdy_protocol_test.cc +++ b/net/spdy/spdy_protocol_test.cc
@@ -9,6 +9,7 @@ #include "net/spdy/spdy_bitmasks.h" #include "net/spdy/spdy_framer.h" +#include "net/spdy/spdy_test_utils.h" #include "net/test/gtest_util.h" #include "testing/gtest/include/gtest/gtest.h" @@ -21,8 +22,8 @@ TEST(SpdyProtocolDeathTest, TestSpdySettingsAndIdOutOfBounds) { std::unique_ptr<SettingsFlagsAndId> flags_and_id; - EXPECT_DFATAL(flags_and_id.reset(new SettingsFlagsAndId(1, 0xffffffff)), - "SPDY setting ID too large."); + EXPECT_SPDY_BUG(flags_and_id.reset(new SettingsFlagsAndId(1, 0xffffffff)), + "SPDY setting ID too large."); // Make sure that we get expected values in opt mode. if (flags_and_id.get() != nullptr) { EXPECT_EQ(1, flags_and_id->flags()); @@ -30,4 +31,33 @@ } } +TEST(SpdyProtocolTest, IsValidHTTP2FrameStreamId) { + // Stream-specific frames must have non-zero stream ids + EXPECT_TRUE(SpdyConstants::IsValidHTTP2FrameStreamId(1, DATA)); + EXPECT_FALSE(SpdyConstants::IsValidHTTP2FrameStreamId(0, DATA)); + EXPECT_TRUE(SpdyConstants::IsValidHTTP2FrameStreamId(1, HEADERS)); + EXPECT_FALSE(SpdyConstants::IsValidHTTP2FrameStreamId(0, HEADERS)); + EXPECT_TRUE(SpdyConstants::IsValidHTTP2FrameStreamId(1, PRIORITY)); + EXPECT_FALSE(SpdyConstants::IsValidHTTP2FrameStreamId(0, PRIORITY)); + EXPECT_TRUE(SpdyConstants::IsValidHTTP2FrameStreamId(1, RST_STREAM)); + EXPECT_FALSE(SpdyConstants::IsValidHTTP2FrameStreamId(0, RST_STREAM)); + EXPECT_TRUE(SpdyConstants::IsValidHTTP2FrameStreamId(1, CONTINUATION)); + EXPECT_FALSE(SpdyConstants::IsValidHTTP2FrameStreamId(0, CONTINUATION)); + EXPECT_TRUE(SpdyConstants::IsValidHTTP2FrameStreamId(1, PUSH_PROMISE)); + EXPECT_FALSE(SpdyConstants::IsValidHTTP2FrameStreamId(0, PUSH_PROMISE)); + + // Connection-level frames must have zero stream ids + EXPECT_FALSE(SpdyConstants::IsValidHTTP2FrameStreamId(1, GOAWAY)); + EXPECT_TRUE(SpdyConstants::IsValidHTTP2FrameStreamId(0, GOAWAY)); + EXPECT_FALSE(SpdyConstants::IsValidHTTP2FrameStreamId(1, SETTINGS)); + EXPECT_TRUE(SpdyConstants::IsValidHTTP2FrameStreamId(0, SETTINGS)); + EXPECT_FALSE(SpdyConstants::IsValidHTTP2FrameStreamId(1, PING)); + EXPECT_TRUE(SpdyConstants::IsValidHTTP2FrameStreamId(0, PING)); + + // Frames that are neither stream-specific nor connection-level + // should not have their stream id declared invalid + EXPECT_TRUE(SpdyConstants::IsValidHTTP2FrameStreamId(1, WINDOW_UPDATE)); + EXPECT_TRUE(SpdyConstants::IsValidHTTP2FrameStreamId(0, WINDOW_UPDATE)); +} + } // namespace net
diff --git a/net/spdy/spdy_session.cc b/net/spdy/spdy_session.cc index 4358e61c..05f426e 100644 --- a/net/spdy/spdy_session.cc +++ b/net/spdy/spdy_session.cc
@@ -376,6 +376,8 @@ return SPDY_ERROR_UNEXPECTED_FRAME; case SpdyFramer::SPDY_INVALID_CONTROL_FRAME_SIZE: return SPDY_ERROR_INVALID_CONTROL_FRAME_SIZE; + case SpdyFramer::SPDY_INVALID_STREAM_ID: + return SPDY_ERROR_INVALID_STREAM_ID; default: NOTREACHED(); return static_cast<SpdyProtocolErrorDetails>(-1); @@ -410,6 +412,8 @@ return ERR_SPDY_PROTOCOL_ERROR; case SpdyFramer::SPDY_INVALID_CONTROL_FRAME_SIZE: return ERR_SPDY_FRAME_SIZE_ERROR; + case SpdyFramer::SPDY_INVALID_STREAM_ID: + return ERR_SPDY_PROTOCOL_ERROR; default: NOTREACHED(); return ERR_SPDY_PROTOCOL_ERROR;
diff --git a/net/spdy/spdy_session.h b/net/spdy/spdy_session.h index 738f526..48cae069 100644 --- a/net/spdy/spdy_session.h +++ b/net/spdy/spdy_session.h
@@ -98,6 +98,7 @@ SPDY_ERROR_INVALID_CONTROL_FRAME_FLAGS = 9, SPDY_ERROR_UNEXPECTED_FRAME = 31, SPDY_ERROR_INVALID_CONTROL_FRAME_SIZE = 37, + SPDY_ERROR_INVALID_STREAM_ID = 38, // SpdyRstStreamStatus mappings. // RST_STREAM_INVALID not mapped. STATUS_CODE_PROTOCOL_ERROR = 11, @@ -126,7 +127,7 @@ PROTOCOL_ERROR_RECEIVE_WINDOW_VIOLATION = 28, // Next free value. - NUM_SPDY_PROTOCOL_ERROR_DETAILS = 38, + NUM_SPDY_PROTOCOL_ERROR_DETAILS = 39, }; SpdyProtocolErrorDetails NET_EXPORT_PRIVATE MapFramerErrorToProtocolError(SpdyFramer::SpdyError error); @@ -137,7 +138,7 @@ // If these compile asserts fail then SpdyProtocolErrorDetails needs // to be updated with new values, as do the mapping functions above. -static_assert(13 == SpdyFramer::LAST_ERROR, +static_assert(14 == SpdyFramer::LAST_ERROR, "SpdyProtocolErrorDetails / Spdy Errors mismatch"); static_assert(17 == RST_STREAM_NUM_STATUS_CODES, "SpdyProtocolErrorDetails / RstStreamStatus mismatch");
diff --git a/net/spdy/spdy_stream.cc b/net/spdy/spdy_stream.cc index 090fa188..e458d06 100644 --- a/net/spdy/spdy_stream.cc +++ b/net/spdy/spdy_stream.cc
@@ -476,6 +476,10 @@ void SpdyStream::OnDataReceived(std::unique_ptr<SpdyBuffer> buffer) { DCHECK(session_->IsStreamActive(stream_id_)); + // Track our bandwidth. + recv_bytes_ += buffer ? buffer->GetRemainingSize() : 0; + recv_last_byte_time_ = base::TimeTicks::Now(); + // If we're still buffering data for a push stream, we will do the // check for data received with incomplete headers in // PushedStreamReplayData(). @@ -537,10 +541,6 @@ buffer->AddConsumeCallback( base::Bind(&SpdyStream::OnReadBufferConsumed, GetWeakPtr())); - // Track our bandwidth. - recv_bytes_ += length; - recv_last_byte_time_ = base::TimeTicks::Now(); - // May close |this|. delegate_->OnDataReceived(std::move(buffer)); } @@ -572,9 +572,9 @@ } if (pending_send_status_ == NO_MORE_DATA_TO_SEND) { - if(io_state_ == STATE_OPEN) { + if (io_state_ == STATE_OPEN) { io_state_ = STATE_HALF_CLOSED_LOCAL; - } else if(io_state_ == STATE_HALF_CLOSED_REMOTE) { + } else if (io_state_ == STATE_HALF_CLOSED_REMOTE) { io_state_ = STATE_CLOSED; } else { NOTREACHED() << io_state_; @@ -770,8 +770,15 @@ bool SpdyStream::GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const { if (stream_id_ == 0) return false; - - return session_->GetLoadTimingInfo(stream_id_, load_timing_info); + bool result = session_->GetLoadTimingInfo(stream_id_, load_timing_info); + if (type_ == SPDY_PUSH_STREAM) { + load_timing_info->push_start = recv_first_byte_time_; + bool done_receiving = IsClosed() || (!pending_recv_data_.empty() && + !pending_recv_data_.back()); + if (done_receiving) + load_timing_info->push_end = recv_last_byte_time_; + } + return result; } GURL SpdyStream::GetUrlFromHeaders() const {
diff --git a/net/spdy/spdy_stream_unittest.cc b/net/spdy/spdy_stream_unittest.cc index 05c01d5..6a56ae3 100644 --- a/net/spdy/spdy_stream_unittest.cc +++ b/net/spdy/spdy_stream_unittest.cc
@@ -135,6 +135,13 @@ return writes_.size(); } + void ActivatePushStream(SpdySession* session, SpdyStream* stream) { + std::unique_ptr<SpdyStream> activated = + session->ActivateCreatedStream(stream); + activated->set_stream_id(2); + session->InsertActivatedStream(std::move(activated)); + } + SpdyTestUtil spdy_util_; SpdySessionDependencies session_deps_; std::unique_ptr<HttpNetworkSession> session_; @@ -305,36 +312,51 @@ base::WeakPtr<SpdySession> spdy_session(CreateDefaultSpdySession()); // Conjure up a stream. - SpdyStream stream(SPDY_PUSH_STREAM, spdy_session, GURL(), DEFAULT_PRIORITY, - SpdySession::GetDefaultInitialWindowSize(kProtoSPDY31), - SpdySession::GetDefaultInitialWindowSize(kProtoSPDY31), - BoundNetLog()); - stream.set_stream_id(2); - EXPECT_FALSE(stream.HasUrlFromHeaders()); + SpdyStreamRequest stream_request; + int result = stream_request.StartRequest(SPDY_PUSH_STREAM, spdy_session, + GURL(), DEFAULT_PRIORITY, + BoundNetLog(), CompletionCallback()); + ASSERT_EQ(OK, result); + base::WeakPtr<SpdyStream> stream = stream_request.ReleaseStream(); + ActivatePushStream(spdy_session.get(), stream.get()); + + EXPECT_FALSE(stream->HasUrlFromHeaders()); // Set required request headers. SpdyHeaderBlock request_headers; spdy_util_.AddUrlToHeaderBlock(kStreamUrl, &request_headers); - stream.OnPushPromiseHeadersReceived(request_headers); + stream->OnPushPromiseHeadersReceived(request_headers); + base::Time response_time = base::Time::Now(); + base::TimeTicks first_byte_time = base::TimeTicks::Now(); // Send some basic response headers. SpdyHeaderBlock response; response[spdy_util_.GetStatusKey()] = "200"; response[spdy_util_.GetVersionKey()] = "OK"; - stream.OnInitialResponseHeadersReceived( - response, base::Time::Now(), base::TimeTicks::Now()); + stream->OnInitialResponseHeadersReceived(response, response_time, + first_byte_time); // And some more headers. // TODO(baranovich): not valid for HTTP 2. SpdyHeaderBlock headers; headers["alpha"] = "beta"; - stream.OnAdditionalResponseHeadersReceived(headers); + stream->OnAdditionalResponseHeadersReceived(headers); - EXPECT_TRUE(stream.HasUrlFromHeaders()); - EXPECT_EQ(kStreamUrl, stream.GetUrlFromHeaders().spec()); + EXPECT_TRUE(stream->HasUrlFromHeaders()); + EXPECT_EQ(kStreamUrl, stream->GetUrlFromHeaders().spec()); - StreamDelegateDoNothing delegate(stream.GetWeakPtr()); - stream.SetDelegate(&delegate); + StreamDelegateDoNothing delegate(stream->GetWeakPtr()); + stream->SetDelegate(&delegate); + + LoadTimingInfo load_timing_info; + EXPECT_TRUE(stream->GetLoadTimingInfo(&load_timing_info)); + EXPECT_EQ(first_byte_time, load_timing_info.push_start); + EXPECT_TRUE(load_timing_info.push_end.is_null()); + + stream->OnDataReceived(nullptr); + LoadTimingInfo load_timing_info2; + EXPECT_TRUE(stream->GetLoadTimingInfo(&load_timing_info2)); + EXPECT_FALSE(load_timing_info2.push_end.is_null()); base::RunLoop().RunUntilIdle();
diff --git a/net/spdy/spdy_test_util_common.cc b/net/spdy/spdy_test_util_common.cc index 33b57b4..3583e39 100644 --- a/net/spdy/spdy_test_util_common.cc +++ b/net/spdy/spdy_test_util_common.cc
@@ -344,7 +344,7 @@ enable_ip_pooling(true), enable_ping(false), enable_user_alternate_protocol_ports(false), - enable_npn(true), + enable_npn(false), enable_priority_dependencies(true), enable_spdy31(true), enable_quic(false), @@ -383,7 +383,7 @@ enable_ip_pooling(true), enable_ping(false), enable_user_alternate_protocol_ports(false), - enable_npn(true), + enable_npn(false), enable_priority_dependencies(true), enable_spdy31(true), enable_quic(false),
diff --git a/net/spdy/spdy_test_utils.h b/net/spdy/spdy_test_utils.h index 388cb2b..297fcd1 100644 --- a/net/spdy/spdy_test_utils.h +++ b/net/spdy/spdy_test_utils.h
@@ -11,9 +11,13 @@ #include <string> #include "base/strings/string_piece.h" +#include "net/spdy/spdy_bug_tracker.h" #include "net/spdy/spdy_header_block.h" #include "net/spdy/spdy_headers_handler_interface.h" #include "net/spdy/spdy_protocol.h" +#include "net/test/gtest_util.h" + +#define EXPECT_SPDY_BUG EXPECT_DFATAL namespace net {
diff --git a/net/spdy/write_blocked_list.h b/net/spdy/write_blocked_list.h index 76d22da..1283037e 100644 --- a/net/spdy/write_blocked_list.h +++ b/net/spdy/write_blocked_list.h
@@ -12,6 +12,7 @@ #include "base/containers/hash_tables.h" #include "base/logging.h" +#include "net/spdy/spdy_bug_tracker.h" #include "net/spdy/spdy_protocol.h" namespace net { @@ -31,11 +32,11 @@ static SpdyPriority ClampPriority(SpdyPriority priority) { if (priority < kV3HighestPriority) { - LOG(DFATAL) << "Invalid priority: " << static_cast<int>(priority); + SPDY_BUG << "Invalid priority: " << static_cast<int>(priority); return kV3HighestPriority; } if (priority > kV3LowestPriority) { - LOG(DFATAL) << "Invalid priority: " << static_cast<int>(priority); + SPDY_BUG << "Invalid priority: " << static_cast<int>(priority); return kV3LowestPriority; } return priority; @@ -48,7 +49,7 @@ return i; } } - LOG(DFATAL) << "No blocked streams"; + SPDY_BUG << "No blocked streams"; return kV3HighestPriority; }
diff --git a/net/tools/net_docs/net_docs.py b/net/tools/net_docs/net_docs.py index a433a201..2dd30de8 100755 --- a/net/tools/net_docs/net_docs.py +++ b/net/tools/net_docs/net_docs.py
@@ -54,7 +54,7 @@ def FormatPage(markdown_html, title): - # TODO(ttuttle): Add a navigation list / table of contents of available + # TODO(juliatuttle): Add a navigation list / table of contents of available # Markdown files, perhaps? return TEMPLATE.format(title=title, body=markdown_html)
diff --git a/net/url_request/sdch_dictionary_fetcher.cc b/net/url_request/sdch_dictionary_fetcher.cc index 1141aab..e8eb326 100644 --- a/net/url_request/sdch_dictionary_fetcher.cc +++ b/net/url_request/sdch_dictionary_fetcher.cc
@@ -18,6 +18,7 @@ #include "net/base/sdch_net_log_params.h" #include "net/http/http_response_headers.h" #include "net/log/net_log.h" +#include "net/url_request/redirect_info.h" #include "net/url_request/url_request_context.h" #include "net/url_request/url_request_status.h" #include "net/url_request/url_request_throttler_manager.h" @@ -143,10 +144,21 @@ fetch_queue_->Clear(); } +void SdchDictionaryFetcher::OnReceivedRedirect( + URLRequest* request, + const RedirectInfo& redirect_info, + bool* defer_redirect) { + DCHECK_EQ(next_state_, STATE_SEND_REQUEST_PENDING); + + next_state_ = STATE_RECEIVED_REDIRECT; + + DoLoop(OK); +} + void SdchDictionaryFetcher::OnResponseStarted(URLRequest* request) { DCHECK(CalledOnValidThread()); DCHECK_EQ(request, current_request_.get()); - DCHECK_EQ(next_state_, STATE_SEND_REQUEST_COMPLETE); + DCHECK_EQ(next_state_, STATE_SEND_REQUEST_PENDING); DCHECK(!in_loop_); // Confirm that the response isn't a stale read from the cache (as @@ -228,8 +240,11 @@ case STATE_SEND_REQUEST: rv = DoSendRequest(rv); break; - case STATE_SEND_REQUEST_COMPLETE: - rv = DoSendRequestComplete(rv); + case STATE_RECEIVED_REDIRECT: + rv = DoReceivedRedirect(rv); + break; + case STATE_SEND_REQUEST_PENDING: + rv = DoSendRequestPending(rv); break; case STATE_READ_BODY: rv = DoReadBody(rv); @@ -259,7 +274,7 @@ return OK; } - next_state_ = STATE_SEND_REQUEST_COMPLETE; + next_state_ = STATE_SEND_REQUEST_PENDING; FetchInfo info; bool success = fetch_queue_->Pop(&info); @@ -279,7 +294,16 @@ return ERR_IO_PENDING; } -int SdchDictionaryFetcher::DoSendRequestComplete(int rv) { +int SdchDictionaryFetcher::DoReceivedRedirect(int rv) { + // Fetching SDCH through a redirect is forbidden; it raises possible + // security issues cross-origin, and isn't obviously useful within + // an origin. + ResetRequest(); + next_state_ = STATE_SEND_REQUEST; + return ERR_UNSAFE_REDIRECT; +} + +int SdchDictionaryFetcher::DoSendRequestPending(int rv) { DCHECK(CalledOnValidThread()); // If there's been an error, abort the current request.
diff --git a/net/url_request/sdch_dictionary_fetcher.h b/net/url_request/sdch_dictionary_fetcher.h index 695121b..e4b7c4f 100644 --- a/net/url_request/sdch_dictionary_fetcher.h +++ b/net/url_request/sdch_dictionary_fetcher.h
@@ -62,6 +62,9 @@ virtual void Cancel(); // Implementation of URLRequest::Delegate methods. + void OnReceivedRedirect(URLRequest* request, + const RedirectInfo& redirect_info, + bool* defer_redirect) override; void OnResponseStarted(URLRequest* request) override; void OnReadCompleted(URLRequest* request, int bytes_read) override; @@ -69,7 +72,8 @@ enum State { STATE_NONE, STATE_SEND_REQUEST, - STATE_SEND_REQUEST_COMPLETE, + STATE_RECEIVED_REDIRECT, + STATE_SEND_REQUEST_PENDING, STATE_READ_BODY, STATE_READ_BODY_COMPLETE, STATE_REQUEST_COMPLETE, @@ -90,7 +94,8 @@ // State machine implementation. int DoLoop(int rv); int DoSendRequest(int rv); - int DoSendRequestComplete(int rv); + int DoReceivedRedirect(int rv); + int DoSendRequestPending(int rv); int DoReadBody(int rv); int DoReadBodyComplete(int rv); int DoCompleteRequest(int rv);
diff --git a/net/url_request/sdch_dictionary_fetcher_unittest.cc b/net/url_request/sdch_dictionary_fetcher_unittest.cc index eddc0607..fecc5adb 100644 --- a/net/url_request/sdch_dictionary_fetcher_unittest.cc +++ b/net/url_request/sdch_dictionary_fetcher_unittest.cc
@@ -21,6 +21,7 @@ #include "net/url_request/url_request_data_job.h" #include "net/url_request/url_request_filter.h" #include "net/url_request/url_request_interceptor.h" +#include "net/url_request/url_request_redirect_job.h" #include "net/url_request/url_request_test_util.h" #include "testing/gtest/include/gtest/gtest.h" @@ -29,7 +30,8 @@ namespace { const char kSampleBufferContext[] = "This is a sample buffer."; -const char kTestDomain[] = "top.domain.test"; +const char kTestDomain1[] = "top.domain.test"; +const char kTestDomain2[] = "top2.domain.test"; class URLRequestSpecifiedResponseJob : public URLRequestSimpleJob { public: @@ -82,35 +84,66 @@ DISALLOW_COPY_AND_ASSIGN(URLRequestSpecifiedResponseJob); }; -class SpecifiedResponseJobInterceptor : public URLRequestInterceptor { +// Wrap URLRequestRedirectJob in a destruction callback. +class TestURLRequestRedirectJob : public URLRequestRedirectJob { public: - // A callback to be called whenever a URLRequestSpecifiedResponseJob is - // created or destroyed. The first argument will be the change in number of - // jobs (i.e. +1 for created, -1 for destroyed). - // The second argument will be undefined if the job is being created, - // and will contain the load flags passed to the request the - // job was created for if the job is being destroyed. + TestURLRequestRedirectJob(URLRequest* request, + NetworkDelegate* network_delegate, + const GURL& redirect_destination, + ResponseCode response_code, + const std::string& redirect_reason, + base::Closure destruction_callback) + : URLRequestRedirectJob(request, + network_delegate, + redirect_destination, + response_code, + redirect_reason), + destruction_callback_(destruction_callback) {} + ~TestURLRequestRedirectJob() override { destruction_callback_.Run(); } + + private: + const base::Closure destruction_callback_; +}; + +static const char* redirect_signal = "/redirect/"; +class SDCHTestRequestInterceptor : public URLRequestInterceptor { + public: + // A callback to be called whenever a URLRequestJob child of this + // interceptor is created or destroyed. The first argument will be the + // change in number of jobs (i.e. +1 for created, -1 for destroyed). + // The second argument will be undefined if the job is being created + // or a redirect job is being destroyed, and (for non-redirect job + // destruction) will contain the load flags passed to the request the + // job was created for. typedef base::Callback<void(int outstanding_job_delta, int destruction_load_flags)> LifecycleCallback; // |*info| will be returned from all child URLRequestSpecifiedResponseJobs. // Note that: a) this pointer is shared with the caller, and the caller must - // guarantee that |*info| outlives the SpecifiedResponseJobInterceptor, and + // guarantee that |*info| outlives the SDCHTestRequestInterceptor, and // b) |*info| is mutable, and changes to should propagate to // URLRequestSpecifiedResponseJobs created after any change. - SpecifiedResponseJobInterceptor(HttpResponseInfo* http_response_info, - const LifecycleCallback& lifecycle_callback) + SDCHTestRequestInterceptor(HttpResponseInfo* http_response_info, + const LifecycleCallback& lifecycle_callback) : http_response_info_(http_response_info), lifecycle_callback_(lifecycle_callback) { DCHECK(!lifecycle_callback_.is_null()); } - ~SpecifiedResponseJobInterceptor() override {} + ~SDCHTestRequestInterceptor() override {} URLRequestJob* MaybeInterceptRequest( URLRequest* request, NetworkDelegate* network_delegate) const override { lifecycle_callback_.Run(1, 0); + std::string path = request->url().path(); + if (path.substr(0, strlen(redirect_signal)) == redirect_signal) { + return new TestURLRequestRedirectJob( + request, network_delegate, GURL(path.substr(strlen(redirect_signal))), + URLRequestRedirectJob::REDIRECT_307_TEMPORARY_REDIRECT, "testing", + base::Bind(lifecycle_callback_, -1, 0)); + } + return new URLRequestSpecifiedResponseJob( request, network_delegate, *http_response_info_, base::Bind(lifecycle_callback_, -1)); @@ -118,25 +151,45 @@ // The caller must ensure that both |*http_response_info| and the // callback remain valid for the lifetime of the - // SpecifiedResponseJobInterceptor (i.e. until Unregister() is called). + // SDCHTestRequestInterceptor (i.e. until Unregister() is called). static void RegisterWithFilter(HttpResponseInfo* http_response_info, const LifecycleCallback& lifecycle_callback) { - std::unique_ptr<SpecifiedResponseJobInterceptor> interceptor( - new SpecifiedResponseJobInterceptor(http_response_info, - lifecycle_callback)); + URLRequestFilter::GetInstance()->AddHostnameInterceptor( + "http", kTestDomain1, + std::unique_ptr<URLRequestInterceptor>(new SDCHTestRequestInterceptor( + http_response_info, lifecycle_callback))); URLRequestFilter::GetInstance()->AddHostnameInterceptor( - "http", kTestDomain, std::move(interceptor)); + "https", kTestDomain1, + std::unique_ptr<URLRequestInterceptor>(new SDCHTestRequestInterceptor( + http_response_info, lifecycle_callback))); + + URLRequestFilter::GetInstance()->AddHostnameInterceptor( + "http", kTestDomain2, + std::unique_ptr<URLRequestInterceptor>(new SDCHTestRequestInterceptor( + http_response_info, lifecycle_callback))); + + URLRequestFilter::GetInstance()->AddHostnameInterceptor( + "https", kTestDomain2, + std::unique_ptr<URLRequestInterceptor>(new SDCHTestRequestInterceptor( + http_response_info, lifecycle_callback))); } static void Unregister() { - URLRequestFilter::GetInstance()->RemoveHostnameHandler("http", kTestDomain); + URLRequestFilter::GetInstance()->RemoveHostnameHandler("http", + kTestDomain1); + URLRequestFilter::GetInstance()->RemoveHostnameHandler("https", + kTestDomain1); + URLRequestFilter::GetInstance()->RemoveHostnameHandler("http", + kTestDomain2); + URLRequestFilter::GetInstance()->RemoveHostnameHandler("https", + kTestDomain2); } private: HttpResponseInfo* http_response_info_; LifecycleCallback lifecycle_callback_; - DISALLOW_COPY_AND_ASSIGN(SpecifiedResponseJobInterceptor); + DISALLOW_COPY_AND_ASSIGN(SDCHTestRequestInterceptor); }; // Local test infrastructure @@ -147,17 +200,19 @@ // that is called when the class is destroyed. That callback // takes as arguemnt the load flags used for the request the // job was created for. -// * SpecifiedResponseJobInterceptor: This class is a -// URLRequestInterceptor that generates the class above. It is constructed +// * SDCHTestRequestInterceptor: This class is a +// URLRequestInterceptor that generates either the class above or an +// instance of URLRequestRedirectJob (if the first component of the path +// is "redirect"). It is constructed // with a pointer to the (mutable) resposne info that should be -// returned from the URLRequestSpecifiedResponseJob children, as well as +// returned from constructed URLRequestSpecifiedResponseJobs, as well as // a callback that is run when URLRequestSpecifiedResponseJobs are // created or destroyed. // * SdchDictionaryFetcherTest: This class registers the above interceptor, // tracks the number of jobs requested and the subset of those // that are still outstanding. It exports an interface to wait until there // are no jobs outstanding. It shares an HttpResponseInfo structure -// with the SpecifiedResponseJobInterceptor to control the response +// with the SDCHTestRequestInterceptor to control the response // information returned by the jbos. // The standard pattern for tests is to schedule a dictionary fetch, wait // for no jobs outstanding, then test that the fetch results are as expected. @@ -182,14 +237,14 @@ factory_(this) { response_info_to_return_.request_time = base::Time::Now(); response_info_to_return_.response_time = base::Time::Now(); - SpecifiedResponseJobInterceptor::RegisterWithFilter( + SDCHTestRequestInterceptor::RegisterWithFilter( &response_info_to_return_, base::Bind(&SdchDictionaryFetcherTest::OnNumberJobsChanged, factory_.GetWeakPtr())); } ~SdchDictionaryFetcherTest() override { - SpecifiedResponseJobInterceptor::Unregister(); + SDCHTestRequestInterceptor::Unregister(); } void OnDictionaryFetched(const std::string& dictionary_text, @@ -214,7 +269,7 @@ GURL PathToGurl(const char* path) const { std::string gurl_string("http://"); - gurl_string += kTestDomain; + gurl_string += kTestDomain1; gurl_string += "/"; gurl_string += path; return GURL(gurl_string); @@ -434,6 +489,35 @@ EXPECT_EQ(2, jobs_requested()); } +TEST_F(SdchDictionaryFetcherTest, Redirect) { + GURL dictionary_url(PathToGurl("dictionary")); + GURL local_redirect_url(dictionary_url.GetWithEmptyPath().spec() + + "redirect/" + dictionary_url.spec()); + EXPECT_TRUE(fetcher()->Schedule(local_redirect_url, GetDefaultCallback())); + WaitForNoJobs(); + + // The redirect should have been rejected with no dictionary added. + EXPECT_EQ(1, jobs_requested()); + std::vector<DictionaryAdditions> additions; + GetDictionaryAdditions(&additions); + EXPECT_EQ(0u, additions.size()); + + // Simple SDCH dictionary fetch test, to make sure the fetcher was left + // in reasonable shape by the above. + + GURL dictionary2_url(PathToGurl("dictionary2")); + fetcher()->Schedule(dictionary2_url, GetDefaultCallback()); + WaitForNoJobs(); + + EXPECT_EQ(2, jobs_requested()); + GetDictionaryAdditions(&additions); + ASSERT_EQ(1u, additions.size()); + EXPECT_EQ( + URLRequestSpecifiedResponseJob::ExpectedResponseForURL(dictionary2_url), + additions[0].dictionary_text); + EXPECT_FALSE(last_load_flags_seen() & LOAD_ONLY_FROM_CACHE); +} + } // namespace } // namespace net
diff --git a/net/url_request/url_request.h b/net/url_request/url_request.h index 745160ea..b470d85 100644 --- a/net/url_request/url_request.h +++ b/net/url_request/url_request.h
@@ -149,12 +149,13 @@ // redirect call. // // When this function is called, the request will still contain the - // original URL, the destination of the redirect is provided in 'new_url'. - // If the delegate does not cancel the request and |*defer_redirect| is - // false, then the redirect will be followed, and the request's URL will be - // changed to the new URL. Otherwise if the delegate does not cancel the - // request and |*defer_redirect| is true, then the redirect will be - // followed once FollowDeferredRedirect is called on the URLRequest. + // original URL, the destination of the redirect is provided in + // |redirect_info.new_url|. If the delegate does not cancel the request + // and |*defer_redirect| is false, then the redirect will be followed, and + // the request's URL will be changed to the new URL. Otherwise if the + // delegate does not cancel the request and |*defer_redirect| is true, then + // the redirect will be followed once FollowDeferredRedirect is called + // on the URLRequest. // // The caller must set |*defer_redirect| to false, so that delegates do not // need to set it if they are happy with the default behavior of not
diff --git a/net/url_request/url_request_unittest.cc b/net/url_request/url_request_unittest.cc index 334f328..c59ee4f 100644 --- a/net/url_request/url_request_unittest.cc +++ b/net/url_request/url_request_unittest.cc
@@ -1906,6 +1906,8 @@ EXPECT_EQ(job_load_timing.send_end, resulting_load_timing.send_end); EXPECT_EQ(job_load_timing.receive_headers_end, resulting_load_timing.receive_headers_end); + EXPECT_EQ(job_load_timing.push_start, resulting_load_timing.push_start); + EXPECT_EQ(job_load_timing.push_end, resulting_load_timing.push_end); return resulting_load_timing; }
diff --git a/ppapi/BUILD.gn b/ppapi/BUILD.gn index 9ae8d5f..1a491cb 100644 --- a/ppapi/BUILD.gn +++ b/ppapi/BUILD.gn
@@ -42,7 +42,7 @@ import("//ppapi/ppapi_sources.gni") import("//testing/test.gni") -shared_library("ppapi_tests") { +source_set("ppapi_tests_sources") { sources = ppapi_sources.test_common_source_files + ppapi_sources.test_trusted_source_files @@ -63,7 +63,21 @@ ] } -shared_library("power_saver_test_plugin") { +if (!is_mac) { + shared_library("ppapi_tests") { + deps = [ + ":ppapi_tests_sources", + ] + } +} else { + mac_plugin_bundle("ppapi_tests") { + deps = [ + ":ppapi_tests_sources", + ] + } +} + +source_set("power_saver_test_plugin_sources") { sources = [ "tests/power_saver_test_plugin.cc", "tests/test_utils.cc", @@ -76,6 +90,20 @@ ] } +if (!is_mac) { + shared_library("power_saver_test_plugin") { + deps = [ + ":power_saver_test_plugin_sources", + ] + } +} else { + mac_plugin_bundle("power_saver_test_plugin") { + deps = [ + ":power_saver_test_plugin_sources", + ] + } +} + source_set("blink_deprecated_test_plugin_sources") { sources = [ "tests/blink_deprecated_test_plugin.cc",
diff --git a/ppapi/examples/ppapi_example.gni b/ppapi/examples/ppapi_example.gni index 5345b1df..3cedcc0 100644 --- a/ppapi/examples/ppapi_example.gni +++ b/ppapi/examples/ppapi_example.gni
@@ -2,21 +2,35 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +if (is_mac) { + import("//build/config/mac/rules.gni") +} + # Declares a PPAPI example target of the correct type for the current platform # and with the right linker flags. template("ppapi_example") { - # TODO(GYP) on Mac this should be loadable_module. - shared_library(target_name) { - testonly = true - if (defined(invoker.output_name)) { - output_name = invoker.output_name - } - sources = invoker.sources - deps = invoker.deps + if (!is_mac) { + shared_library(target_name) { + testonly = true - if (is_mac) { - # TODO(GYP) this should be a mac bundle - output_extension = "plugin" + if (defined(invoker.output_name)) { + output_name = invoker.output_name + } + + sources = invoker.sources + deps = invoker.deps + } + } else { + mac_plugin_bundle(target_name) { + testonly = true + + if (defined(invoker.output_name)) { + output_name = invoker.output_name + } + + sources = invoker.sources + deps = invoker.deps + ldflags = [ # Not to strip important symbols by -Wl,-dead_strip. "-Wl,-exported_symbol,_PPP_GetInterface",
diff --git a/remoting/BUILD.gn b/remoting/BUILD.gn index 72f1b6d..180bd43 100644 --- a/remoting/BUILD.gn +++ b/remoting/BUILD.gn
@@ -41,9 +41,11 @@ "//remoting:remoting_breakpad_tester", "//remoting/host:remoting_console", "//remoting/host:remoting_desktop", - - # "//remoting:remoting_host_installation", ] + + if (is_chrome_branded) { + deps += [ "//remoting/host:remoting_host_installation" ] + } } if (is_android) {
diff --git a/remoting/android/client_java_tmpl.gni b/remoting/android/client_java_tmpl.gni index 5cb581b..e64bf8c3 100644 --- a/remoting/android/client_java_tmpl.gni +++ b/remoting/android/client_java_tmpl.gni
@@ -29,7 +29,6 @@ "HostListAdapter.java", "HostListLoader.java", "InputStrategyInterface.java", - "OAuthTokenFetcher.java", "RenderData.java", "SessionAuthenticator.java", "SessionConnector.java", @@ -45,6 +44,7 @@ "accountswitcher/AccountSwitcherBase.java", "accountswitcher/AccountSwitcherBasic.java", "accountswitcher/AccountSwitcherFactory.java", + "base/OAuthTokenFetcher.java", "cardboard/CardboardRenderer.java", "cardboard/CardboardUtil.java", "cardboard/Cursor.java",
diff --git a/remoting/android/java/src/org/chromium/chromoting/Chromoting.java b/remoting/android/java/src/org/chromium/chromoting/Chromoting.java index ae8ccc5..a40b6ee1 100644 --- a/remoting/android/java/src/org/chromium/chromoting/Chromoting.java +++ b/remoting/android/java/src/org/chromium/chromoting/Chromoting.java
@@ -34,6 +34,7 @@ import org.chromium.base.Log; import org.chromium.chromoting.accountswitcher.AccountSwitcher; import org.chromium.chromoting.accountswitcher.AccountSwitcherFactory; +import org.chromium.chromoting.base.OAuthTokenFetcher; import org.chromium.chromoting.help.HelpContext; import org.chromium.chromoting.help.HelpSingleton; import org.chromium.chromoting.jni.Client; @@ -53,6 +54,10 @@ /** Only accounts of this type will be selectable for authentication. */ private static final String ACCOUNT_TYPE = "com.google"; + /** Scope to use when fetching the OAuth token. */ + private static final String TOKEN_SCOPE = "oauth2:https://www.googleapis.com/auth/chromoting " + + "https://www.googleapis.com/auth/googletalk"; + /** Result code used for starting {@link DesktopActivity}. */ public static final int DESKTOP_ACTIVITY = 0; @@ -490,7 +495,7 @@ private void requestAuthToken(boolean expireCurrentToken) { mWaitingForAuthToken = true; - OAuthTokenFetcher fetcher = new OAuthTokenFetcher(this, mAccount, + OAuthTokenFetcher fetcher = new OAuthTokenFetcher(this, mAccount, TOKEN_SCOPE, new OAuthTokenFetcher.Callback() { @Override public void onTokenFetched(String token) { @@ -500,10 +505,11 @@ } @Override - public void onError(int errorResource) { + public void onError(OAuthTokenFetcher.Error error) { mWaitingForAuthToken = false; updateHostListView(); - String explanation = getString(errorResource); + String explanation = getString(error == OAuthTokenFetcher.Error.NETWORK + ? R.string.error_network_error : R.string.error_unexpected); Toast.makeText(Chromoting.this, explanation, Toast.LENGTH_LONG).show(); } });
diff --git a/remoting/android/java/src/org/chromium/chromoting/OAuthTokenFetcher.java b/remoting/android/java/src/org/chromium/chromoting/base/OAuthTokenFetcher.java similarity index 86% rename from remoting/android/java/src/org/chromium/chromoting/OAuthTokenFetcher.java rename to remoting/android/java/src/org/chromium/chromoting/base/OAuthTokenFetcher.java index ad17b459..78bb27ea 100644 --- a/remoting/android/java/src/org/chromium/chromoting/OAuthTokenFetcher.java +++ b/remoting/android/java/src/org/chromium/chromoting/base/OAuthTokenFetcher.java
@@ -1,8 +1,8 @@ -// Copyright 2015 The Chromium Authors. All rights reserved. +// Copyright 2016 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -package org.chromium.chromoting; +package org.chromium.chromoting.base; import android.app.Activity; import android.os.AsyncTask; @@ -32,18 +32,16 @@ /** * Called if an unrecoverable error prevents fetching a token. - * @param errorResource String resource of error-message to be displayed. */ - void onError(int errorResource); + void onError(Error error); } + /** Error types that can be returned as non-recoverable errors from the token-fetcher. */ + public enum Error { NETWORK, UNEXPECTED } + /** Request code used for starting the OAuth recovery activity. */ public static final int REQUEST_CODE_RECOVER_FROM_OAUTH_ERROR = 100; - /** Scopes at which the authentication token we request will be valid. */ - private static final String TOKEN_SCOPE = "oauth2:https://www.googleapis.com/auth/chromoting " - + "https://www.googleapis.com/auth/googletalk"; - /** * Reference to the main activity. Used for running tasks on the main thread, and for * starting other activities to handle user-recoverable errors. @@ -53,11 +51,16 @@ /** Account name (e-mail) for which the token will be fetched. */ private String mAccountName; + /** OAuth scope used for the token request. */ + private String mTokenScope; + private Callback mCallback; - public OAuthTokenFetcher(Activity activity, String accountName, Callback callback) { + public OAuthTokenFetcher(Activity activity, String accountName, String tokenScope, + Callback callback) { mActivity = activity; mAccountName = accountName; + mTokenScope = tokenScope; mCallback = callback; } @@ -87,14 +90,14 @@ // This method is deprecated but its replacement is not yet available. // TODO(lambroslambrou): Fix this by replacing |mAccountName| with an instance // of android.accounts.Account. - String token = GoogleAuthUtil.getToken(mActivity, mAccountName, TOKEN_SCOPE); + String token = GoogleAuthUtil.getToken(mActivity, mAccountName, mTokenScope); handleTokenReceived(token); } catch (IOException ioException) { - handleError(R.string.error_network_error); + handleError(Error.NETWORK); } catch (UserRecoverableAuthException recoverableException) { handleRecoverableException(recoverableException); } catch (GoogleAuthException fatalException) { - handleError(R.string.error_unexpected); + handleError(Error.UNEXPECTED); } return null; } @@ -110,7 +113,7 @@ }); } - private void handleError(final int error) { + private void handleError(final Error error) { mActivity.runOnUiThread(new Runnable() { @Override public void run() {
diff --git a/remoting/host/BUILD.gn b/remoting/host/BUILD.gn index 29c7e33..aa416b4 100644 --- a/remoting/host/BUILD.gn +++ b/remoting/host/BUILD.gn
@@ -637,7 +637,7 @@ # GYP version: # //remoting/remoting_host_win.gypi:remoting_me2me_native_messaging_host - executable("remoting_me2me_native_messaging_host") { + executable("remoting_native_messaging_host") { configs += [ "//build/config/compiler:wexit_time_destructors" ] deps = [ @@ -829,6 +829,8 @@ } } else { executable("remoting_me2me_host") { + configs += [ "//remoting:version" ] + sources = [ "host_main.cc", "host_main.h", @@ -845,6 +847,35 @@ ] } + if (is_linux) { + copy("remoting_me2me_host_copy_script") { + sources = [ + "linux/linux_me2me_host.py", + ] + outputs = [ + "$root_build_dir/remoting/chrome-remote-desktop", + ] + } + copy("remoting_me2me_host_copy_host") { + sources = [ + "linux/remoting_me2me_host_wrapper.sh", + ] + outputs = [ + "$root_build_dir/remoting/chrome-remote-desktop-host", + ] + deps = [ + ":remoting_me2me_host", + ] + } + group("remoting_dev_me2me_host") { + deps = [ + ":remoting_me2me_host", + ":remoting_me2me_host_copy_host", + ":remoting_me2me_host_copy_script", + ] + } + } + executable("native_messaging_host") { sources = [ "setup/me2me_native_messaging_host_entry_point.cc", @@ -966,9 +997,133 @@ "//third_party/icu:icudata", ] } + } else if (is_win) { + # GYP version: //remoting/remoting_host_win.gypi:remoting_me2me_host_archive + action("remoting_me2me_host_archive") { + script = "//remoting/host/installer/build-installer-archive.py" + + deps = [ + ":credits", + ":remote_security_key", + ":remoting_core", + ":remoting_desktop", + ":remoting_me2me_host", + ":remoting_native_messaging_host", + ":remoting_native_messaging_manifests", + "it2me:remote_assistance_host", + "//third_party/icu:icudata", + ] + + _output = "$root_out_dir/remoting-me2me-host-$target_os.zip" + + outputs = [ + _output, + ] + if (is_chrome_branded) { + _branding = "Chrome" + } else { + _branding = "Chromium" + } + + if (is_official_build) { + _official_build = "1" + } else { + _official_build = "0" + } + + _generated_files = rebase_path( + [ + "$root_out_dir/remote_assistance_host.exe", + "$root_out_dir/remote_security_key.exe", + "$root_out_dir/remoting_core.dll", + "$root_out_dir/remoting_desktop.exe", + "$root_out_dir/remoting_host.exe", + "$root_out_dir/remoting_native_messaging_host.exe", + "$root_gen_dir/remoting/CREDITS.txt", + "$root_out_dir/remoting/com.google.chrome.remote_assistance.json", + "$root_out_dir/remoting/com.google.chrome.remote_desktop.json", + "$root_out_dir/icudtl.dat", + ], + root_build_dir) + _extra_files = [] + if (is_chrome_branded) { + if (target_cpu == "x64") { + _redist_cpu_path = "amd64" + } else { + _redist_cpu_path = "x64" + } + _generated_files += + [ rebase_path("//third_party/platformsdk_win7/files/Redist/" + + "$_redist_cpu_path/sas.dll", + root_build_dir) ] + _extra_files += [ "files/sas.dll" ] + } + + args = [ + rebase_path("$root_gen_dir/installation", root_build_dir), + rebase_path(_output, root_build_dir), + "--source-file-roots", + rebase_path("//remoting/host/installer/win"), + "--source-files", + rebase_path("//remoting/host/installer/win/chromoting.wxs"), + rebase_path("//remoting/host/installer/win/parameters.json"), + + # Input files + "--generated-files", + ] + _generated_files + + [ + rebase_path("//remoting/resources/chromoting.ico"), + + # Position of files in zip file + "--generated-files-dst", + "files/remote_assistance_host.exe", + "files/remote_security_key.exe", + "files/remoting_core.dll", + "files/remoting_desktop.exe", + "files/remoting_host.exe", + "files/remoting_native_messaging_host.exe", + "files/CREDITS.txt", + "files/com.google.chrome.remote_assistance.json", + "files/com.google.chrome.remote_desktop.json", + "files/chromoting.ico", + "files/icudtl.dat", + ] + _extra_files + # Defs + [ + "--defs", + "BRANDING=$_branding", + "DAEMON_CONTROLLER_CLSID=$daemon_controller_clsid", + "RDP_DESKTOP_SESSION_CLSID=$rdp_desktop_session_clsid", + "VERSION=$chrome_version_full", + "OFFICIAL_BUILD=$_official_build", + ] + } } else { group("remoting_me2me_host_archive") { } } + + if (is_win && is_chrome_branded) { + # GYP version: remoting/remoting_host_win.gyp:remoting_host_installation + action("remoting_host_installation") { + deps = [ + "//remoting/host:remoting_me2me_host_archive", + ] + script = "../tools/zip2msi.py" + outputs = [ + "$root_out_dir/chromoting.msi", + ] + args = [ + "--wix_path", + rebase_path("//third_party/wix"), + "--intermediate_dir", + rebase_path("$root_gen_dir/installation", root_build_dir), + "--target_arch", + "$target_cpu", + rebase_path("$root_out_dir/remoting-me2me-host-$current_os.zip", + root_build_dir), + rebase_path(outputs[0], root_build_dir), + ] + } + } } }
diff --git a/remoting/host/linux/linux_me2me_host.py b/remoting/host/linux/linux_me2me_host.py index 9c80e78..1deb89e0 100755 --- a/remoting/host/linux/linux_me2me_host.py +++ b/remoting/host/linux/linux_me2me_host.py
@@ -55,13 +55,7 @@ SCRIPT_PATH = os.path.abspath(sys.argv[0]) SCRIPT_DIR = os.path.dirname(SCRIPT_PATH) -IS_INSTALLED = (os.path.basename(sys.argv[0]) != 'linux_me2me_host.py') - -if IS_INSTALLED: - HOST_BINARY_NAME = "chrome-remote-desktop-host" -else: - HOST_BINARY_NAME = "remoting_me2me_host" - +HOST_BINARY_NAME = "chrome-remote-desktop-host" CHROME_REMOTING_GROUP_NAME = "chrome-remote-desktop" HOME_DIR = os.environ["HOME"] @@ -105,13 +99,16 @@ def get_randr_supporting_x_server(): """Returns a path to an X server that supports the RANDR extension, if this is found on the system. Otherwise returns None.""" - try: - xvfb = "/usr/bin/Xvfb-randr" - if not os.path.exists(xvfb): - xvfb = locate_executable("Xvfb-randr") + + xvfb = "/usr/bin/Xvfb-randr" + if os.path.exists(xvfb): return xvfb - except Exception: - return None + + xvfb = os.path.join(SCRIPT_DIR, "Xvfb-randr") + if os.path.exists(xvfb): + return xvfb + + return None class Config: @@ -497,7 +494,8 @@ def launch_host(self, host_config): # Start remoting host - args = [locate_executable(HOST_BINARY_NAME), "--host-config=-"] + host_path = os.path.join(SCRIPT_DIR, HOST_BINARY_NAME) + args = [host_path, "--host-config=-"] if self.pulseaudio_pipe: args.append("--audio-pipe-name=%s" % self.pulseaudio_pipe) if self.server_supports_exact_resize: @@ -517,9 +515,9 @@ signal.signal(signal.SIGUSR1, sigusr1_handler) args.append("--signal-parent") + logging.info(args) self.host_proc = subprocess.Popen(args, env=self.child_env, stdin=subprocess.PIPE) - logging.info(args) if not self.host_proc.pid: raise Exception("Could not start Chrome Remote Desktop host") @@ -630,25 +628,6 @@ return None -def locate_executable(exe_name): - if IS_INSTALLED: - # If the script is running from its installed location, search the host - # binary only in the same directory. - paths_to_try = [ SCRIPT_DIR ] - else: - paths_to_try = map(lambda p: os.path.join(SCRIPT_DIR, p), - [".", - "../../../out/Debug", - "../../../out/Default", - "../../../out/Release"]) - for path in paths_to_try: - exe_path = os.path.join(path, exe_name) - if os.path.exists(exe_path): - return exe_path - - raise Exception("Could not locate executable '%s'" % exe_name) - - class ParentProcessLogger(object): """Redirects logs to the parent process, until the host is ready or quits. @@ -1092,9 +1071,6 @@ action="store", metavar="USER", help="Adds the specified user to the chrome-remote-desktop " "group (must be run as root).") - parser.add_option("", "--host-version", dest="host_version", default=False, - action="store_true", - help="Prints version of the host.") parser.add_option("", "--watch-resolution", dest="watch_resolution", type="int", nargs=2, default=False, action="store", help=optparse.SUPPRESS_HELP) @@ -1190,10 +1166,6 @@ return 0 - if options.host_version: - # TODO(sergeyu): Also check RPM package version once we add RPM package. - return os.system(locate_executable(HOST_BINARY_NAME) + " --version") >> 8 - if options.watch_resolution: watch_for_resolution_changes(options.watch_resolution) return 0
diff --git a/remoting/host/linux/remoting_me2me_host_wrapper.sh b/remoting/host/linux/remoting_me2me_host_wrapper.sh new file mode 100755 index 0000000..12e4400 --- /dev/null +++ b/remoting/host/linux/remoting_me2me_host_wrapper.sh
@@ -0,0 +1,16 @@ +#!/bin/sh + +# 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. + +# This is a simple wrapper script around the remoting_me2me_host binary, +# intended only for development use. It is copied into a build +# subdirectory as +# $CHROMIUM_OUTPUT_DIR/remoting/chrome-remote-desktop-host +# and runs the remoting_me2me_host binary in the parent output directory. +# The linux_me2me_host.py script is also copied into the remoting/ +# build directory, so it finds this host wrapper script in the same +# directory. + +exec "$(dirname "$0")/../remoting_me2me_host" "$@"
diff --git a/remoting/host/security_key/remote_security_key_message_reader_impl.cc b/remoting/host/security_key/remote_security_key_message_reader_impl.cc index 55c4061..211f780 100644 --- a/remoting/host/security_key/remote_security_key_message_reader_impl.cc +++ b/remoting/host/security_key/remote_security_key_message_reader_impl.cc
@@ -64,33 +64,20 @@ return; } - // Read the message header to retrieve the remaining message length. - uint32_t total_message_size_bytes; - int read_result = read_stream_.ReadAtCurrentPos( - reinterpret_cast<char*>(&total_message_size_bytes), - SecurityKeyMessage::kHeaderSizeBytes); - if (read_result != SecurityKeyMessage::kHeaderSizeBytes) { - // 0 means EOF which is normal and should not be logged as an error. - if (read_result != 0) { - LOG(ERROR) << "Failed to read message header, read returned " - << read_result; - } + uint32_t message_length_bytes = 0; + if (!ReadFromStream(reinterpret_cast<char*>(&message_length_bytes), 4)) { NotifyError(); return; } - if (!SecurityKeyMessage::IsValidMessageSize(total_message_size_bytes)) { - LOG(ERROR) << "Message size too large: " << total_message_size_bytes; + if (!SecurityKeyMessage::IsValidMessageSize(message_length_bytes)) { + LOG(ERROR) << "Message size is invalid: " << message_length_bytes; NotifyError(); return; } - std::string message_data(total_message_size_bytes, '\0'); - read_result = read_stream_.ReadAtCurrentPos(string_as_array(&message_data), - total_message_size_bytes); - // The static cast is safe as we know the value is smaller than max int. - if (read_result != static_cast<int>(total_message_size_bytes)) { - LOG(ERROR) << "Failed to read message: " << read_result; + std::string message_data(message_length_bytes, '\0'); + if (!ReadFromStream(string_as_array(&message_data), message_data.size())) { NotifyError(); return; } @@ -110,6 +97,30 @@ } } +bool RemoteSecurityKeyMessageReaderImpl::ReadFromStream(char* buffer, + size_t bytes_to_read) { + DCHECK(buffer); + DCHECK_GT(bytes_to_read, 0u); + + size_t bytes_read = 0; + do { + int read_result = read_stream_.ReadAtCurrentPosNoBestEffort( + buffer + bytes_read, bytes_to_read - bytes_read); + if (read_result < 1) { + // 0 means EOF which is normal and should not be logged as an error. + if (read_result != 0) { + LOG(ERROR) << "Failed to read from stream, ReadAtCurrentPos returned " + << read_result; + } + return false; + } + bytes_read += read_result; + } while (bytes_read < bytes_to_read); + DCHECK_EQ(bytes_read, bytes_to_read); + + return true; +} + void RemoteSecurityKeyMessageReaderImpl::NotifyError() { DCHECK(read_task_runner_->RunsTasksOnCurrentThread());
diff --git a/remoting/host/security_key/remote_security_key_message_reader_impl.h b/remoting/host/security_key/remote_security_key_message_reader_impl.h index 873d478..051fc3338 100644 --- a/remoting/host/security_key/remote_security_key_message_reader_impl.h +++ b/remoting/host/security_key/remote_security_key_message_reader_impl.h
@@ -38,6 +38,10 @@ // |message_callback_| on the originating thread. Run on |read_task_runner_|. void ReadMessage(); + // Reads the nubmer of bytes indicated by |bytes_to_read| into |buffer| from + // |read_stream_|. Returns true if all bytes were retrieved successfully. + bool ReadFromStream(char* buffer, size_t bytes_to_read); + // Callback run on |read_task_runner_| when an error occurs or EOF is reached. void NotifyError();
diff --git a/remoting/host/security_key/remote_security_key_message_reader_impl_unittest.cc b/remoting/host/security_key/remote_security_key_message_reader_impl_unittest.cc index 88d5d71..c9c2d92 100644 --- a/remoting/host/security_key/remote_security_key_message_reader_impl_unittest.cc +++ b/remoting/host/security_key/remote_security_key_message_reader_impl_unittest.cc
@@ -148,6 +148,49 @@ CloseWriteFileAndRunLoop(); } +TEST_F(RemoteSecurityKeyMessageReaderImplTest, SingleMessageViaSingleWrite) { + // All other tests write in 2-3 chunks, this writes the message in one shot. + std::string payload("LLLLTI am the best payload in the history of testing."); + // Overwite the 'L' values with the actual length. + uint8_t length = payload.size() - SecurityKeyMessage::kHeaderSizeBytes; + payload[0] = static_cast<char>(length); + payload[1] = 0; + payload[2] = 0; + payload[3] = 0; + // Overwite the 'T' value with the actual type. + payload[4] = static_cast<char>(kTestMessageType); + WriteData(payload.data(), payload.size()); + RunLoop(); + ASSERT_EQ(1u, messages_received_.size()); + ASSERT_EQ(kTestMessageType, messages_received_[0]->type()); + ASSERT_EQ(payload.substr(5), messages_received_[0]->payload()); + + CloseWriteFileAndRunLoop(); +} + +TEST_F(RemoteSecurityKeyMessageReaderImplTest, SingleMessageViaMultipleWrites) { + // All other tests write in 2-3 chunks, this writes the message byte by byte. + std::string payload("LLLLTI am the worst payload in the history of testing."); + // Overwite the 'L' values with the actual length. + uint8_t length = payload.size() - SecurityKeyMessage::kHeaderSizeBytes; + payload[0] = static_cast<char>(length); + payload[1] = 0; + payload[2] = 0; + payload[3] = 0; + // Overwite the 'T' value with the actual type. + payload[4] = static_cast<char>(kTestMessageType); + + for (uint32_t i = 0; i < payload.size(); i++) { + WriteData(&payload[i], 1); + } + RunLoop(); + ASSERT_EQ(1u, messages_received_.size()); + ASSERT_EQ(kTestMessageType, messages_received_[0]->type()); + ASSERT_EQ(payload.substr(5), messages_received_[0]->payload()); + + CloseWriteFileAndRunLoop(); +} + TEST_F(RemoteSecurityKeyMessageReaderImplTest, SingleMessageWithLargePayload) { std::string payload(kMaxSecurityKeyMessageByteCount - SecurityKeyMessage::kMessageTypeSizeBytes, @@ -210,13 +253,11 @@ "", "Short", "", "Medium Length", "", "Longer than medium, but not super long", "", std::string(2048, 'Y'), ""}); - - for (auto& payload : payloads) { - WriteMessage(kTestMessageType, payload); + for (size_t i = 0; i < payloads.size(); i++) { + WriteMessage(kTestMessageType, payloads[i]); RunLoop(); + ASSERT_EQ(i + 1, messages_received_.size()); } - - ASSERT_EQ(payloads.size(), messages_received_.size()); CloseWriteFileAndRunLoop(); for (size_t i = 0; i < payloads.size(); i++) {
diff --git a/remoting/resources/remoting_strings_es-419.xtb b/remoting/resources/remoting_strings_es-419.xtb index e610f0d..86c2f0e 100644 --- a/remoting/resources/remoting_strings_es-419.xtb +++ b/remoting/resources/remoting_strings_es-419.xtb
@@ -165,7 +165,7 @@ <translation id="4918086044614829423">Aceptar</translation> <translation id="492843737083352574">Tengo problemas con el teclado o el mouse.</translation> <translation id="4973800994433240357">Al descargar el instalador del host de Chromoting, aceptas las <ph name="LINK_BEGIN" />Condiciones del servicio<ph name="LINK_END" /> de Google.</translation> -<translation id="4985296110227979402">Para tener acceso remoto, primero debes configurar la computadora</translation> +<translation id="4985296110227979402">Para obtener acceso remoto, primero debes configurar la computadora</translation> <translation id="5064360042339518108"><ph name="HOSTNAME" /> (sin conexión)</translation> <translation id="5070121137485264635">El host remoto requiere la autenticación de un sitio web de terceros. Para continuar, debes otorgar permisos adicionales al Escritorio remoto de Chrome para acceder a la siguiente dirección:</translation> <translation id="5156271271724754543">Ingresa el mismo PIN en ambos cuadros.</translation>
diff --git a/remoting/resources/remoting_strings_ms.xtb b/remoting/resources/remoting_strings_ms.xtb index 765d6de..47c521b 100644 --- a/remoting/resources/remoting_strings_ms.xtb +++ b/remoting/resources/remoting_strings_ms.xtb
@@ -165,7 +165,7 @@ <translation id="4918086044614829423">Terima</translation> <translation id="492843737083352574">Saya menghadapi masalah dengan papan kekunci atau tetikus saya.</translation> <translation id="4973800994433240357">Apabila memuat turun Pemasang Hos Chromoting, anda bersetuju menerima <ph name="LINK_BEGIN" />Syarat Perkhidmatan<ph name="LINK_END" /> Google.</translation> -<translation id="4985296110227979402">Anda perlu menyediakan komputer untuk akses jauh terlebih dahulu.</translation> +<translation id="4985296110227979402">Anda perlu menyediakan komputer untuk akses jauh terlebih dahulu</translation> <translation id="5064360042339518108"><ph name="HOSTNAME" /> (luar talian)</translation> <translation id="5070121137485264635">Hos jauh memerlukan anda membuat pengesahan pada tapak web pihak ketiga. Untuk meneruskan, anda hendaklah memberikan Desktop Jauh Chrome kebenaran tambahan untuk mengakses alamat ini:</translation> <translation id="5156271271724754543">Sila masukkan PIN yang sama dalam kedua-dua kotak.</translation>
diff --git a/remoting/resources/remoting_strings_ta.xtb b/remoting/resources/remoting_strings_ta.xtb index d2172ea..3ad8df6 100644 --- a/remoting/resources/remoting_strings_ta.xtb +++ b/remoting/resources/remoting_strings_ta.xtb
@@ -165,7 +165,7 @@ <translation id="4918086044614829423">ஏற்கிறேன்</translation> <translation id="492843737083352574">எனது விசைப்பலகை அல்லது மவுஸில் சிக்கல்கள் உள்ளன.</translation> <translation id="4973800994433240357">குரோமோட்டிங் ஹோஸ்ட் நிறுவியைப் பதிவிறக்குவதன் மூலம், Google இன் <ph name="LINK_BEGIN" />சேவை விதிமுறைகளை<ph name="LINK_END" /> ஏற்றுக்கொள்கிறீர்கள்.</translation> -<translation id="4985296110227979402">தொலைநிலை அணுகலுக்கு உங்கள் கணினியை முதலில் அமைக்க வேண்டும்</translation> +<translation id="4985296110227979402">முதலில் தொலைநிலை அணுகலுக்கு உங்கள் கணினியை அமைக்க வேண்டும்</translation> <translation id="5064360042339518108"><ph name="HOSTNAME" /> (ஆஃப்லைன்)</translation> <translation id="5070121137485264635">ஒரு மூன்றாம் தரப்பு இணையதளத்தை நீங்கள் அங்கீகரிக்க வேண்டும் என்று தொலைநிலை ஹோஸ்ட் கேட்கிறது. தொடர்வதற்கு, இந்த முகவரியை அணுக Chrome தொலைநிலை டெஸ்க்டாப்பிற்கு கூடுதல் அனுமதிகளை நீங்கள் வழங்க வேண்டும்:</translation> <translation id="5156271271724754543">இரண்டு பெட்டிகளிலும் ஒரே PIN ஐ உள்ளிடுக.</translation>
diff --git a/remoting/resources/remoting_strings_zh-CN.xtb b/remoting/resources/remoting_strings_zh-CN.xtb index c500cb78..380ed98 100644 --- a/remoting/resources/remoting_strings_zh-CN.xtb +++ b/remoting/resources/remoting_strings_zh-CN.xtb
@@ -165,7 +165,7 @@ <translation id="4918086044614829423">接受</translation> <translation id="492843737083352574">我的键盘或鼠标无法正常使用。</translation> <translation id="4973800994433240357">下载 Chrome 远程访问主机安装程序,即表示您同意遵守 Google <ph name="LINK_BEGIN" />服务条款<ph name="LINK_END" />。</translation> -<translation id="4985296110227979402">您需要先设置计算机,以便进行远程访问</translation> +<translation id="4985296110227979402">您需要先设置计算机,然后才能进行远程访问</translation> <translation id="5064360042339518108"><ph name="HOSTNAME" />(离线)</translation> <translation id="5070121137485264635">远程主机要求您对第三方网站进行身份验证。要继续操作,您必须向 Chrome 远程桌面授予访问以下地址的额外权限:</translation> <translation id="5156271271724754543">请在两个框中输入相同的 PIN。</translation>
diff --git a/services/catalog/BUILD.gn b/services/catalog/BUILD.gn index ef626922..88c9c5b 100644 --- a/services/catalog/BUILD.gn +++ b/services/catalog/BUILD.gn
@@ -21,11 +21,11 @@ "constants.h", "entry.cc", "entry.h", + "instance.cc", + "instance.h", "manifest_provider.h", "reader.cc", "reader.h", - "resolver.cc", - "resolver.h", "store.cc", "store.h", "types.h",
diff --git a/services/catalog/catalog.cc b/services/catalog/catalog.cc index 2680d75..68c4ab9 100644 --- a/services/catalog/catalog.cc +++ b/services/catalog/catalog.cc
@@ -6,8 +6,8 @@ #include "base/bind.h" #include "services/catalog/constants.h" +#include "services/catalog/instance.h" #include "services/catalog/reader.h" -#include "services/catalog/resolver.h" #include "services/shell/public/cpp/connection.h" #include "services/shell/public/cpp/shell_connection.h" @@ -26,7 +26,7 @@ PathService::Get(base::DIR_MODULE, &system_package_dir); system_package_dir = system_package_dir.AppendASCII(kMojoApplicationsDirName); system_reader_.reset(new Reader(file_task_runner, manifest_provider)); - system_reader_->Read(system_package_dir, &system_catalog_, + system_reader_->Read(system_package_dir, &system_cache_, base::Bind(&Catalog::SystemPackageDirScanned, weak_factory_.GetWeakPtr())); } @@ -39,50 +39,42 @@ bool Catalog::AcceptConnection(shell::Connection* connection) { connection->AddInterface<mojom::Catalog>(this); - connection->AddInterface<mojom::Resolver>(this); connection->AddInterface<shell::mojom::ShellResolver>(this); return true; } void Catalog::Create(shell::Connection* connection, - mojom::ResolverRequest request) { - Resolver* resolver = - GetResolverForUserId(connection->GetRemoteIdentity().user_id()); - resolver->BindResolver(std::move(request)); -} - -void Catalog::Create(shell::Connection* connection, shell::mojom::ShellResolverRequest request) { - Resolver* resolver = - GetResolverForUserId(connection->GetRemoteIdentity().user_id()); - resolver->BindShellResolver(std::move(request)); + Instance* instance = + GetInstanceForUserId(connection->GetRemoteIdentity().user_id()); + instance->BindShellResolver(std::move(request)); } void Catalog::Create(shell::Connection* connection, mojom::CatalogRequest request) { - Resolver* resolver = - GetResolverForUserId(connection->GetRemoteIdentity().user_id()); - resolver->BindCatalog(std::move(request)); + Instance* instance = + GetInstanceForUserId(connection->GetRemoteIdentity().user_id()); + instance->BindCatalog(std::move(request)); } -Resolver* Catalog::GetResolverForUserId(const std::string& user_id) { - auto it = resolvers_.find(user_id); - if (it != resolvers_.end()) +Instance* Catalog::GetInstanceForUserId(const std::string& user_id) { + auto it = instances_.find(user_id); + if (it != instances_.end()) return it->second.get(); // TODO(beng): There needs to be a way to load the store from different users. - Resolver* resolver = new Resolver(std::move(store_), system_reader_.get()); - resolvers_[user_id] = make_scoped_ptr(resolver); + Instance* instance = new Instance(std::move(store_), system_reader_.get()); + instances_[user_id] = make_scoped_ptr(instance); if (loaded_) - resolver->CacheReady(&system_catalog_); + instance->CacheReady(&system_cache_); - return resolver; + return instance; } void Catalog::SystemPackageDirScanned() { loaded_ = true; - for (auto& resolver : resolvers_) - resolver.second->CacheReady(&system_catalog_); + for (auto& instance : instances_) + instance.second->CacheReady(&system_cache_); } } // namespace catalog
diff --git a/services/catalog/catalog.h b/services/catalog/catalog.h index eccf24c..a2b8164 100644 --- a/services/catalog/catalog.h +++ b/services/catalog/catalog.h
@@ -13,7 +13,6 @@ #include "base/memory/weak_ptr.h" #include "mojo/public/cpp/bindings/binding.h" #include "services/catalog/public/interfaces/catalog.mojom.h" -#include "services/catalog/public/interfaces/resolver.mojom.h" #include "services/catalog/types.h" #include "services/shell/public/cpp/shell_client.h" #include "services/shell/public/interfaces/shell_client.mojom.h" @@ -29,16 +28,15 @@ namespace catalog { +class Instance; class ManifestProvider; class Reader; -class Resolver; class Store; // Creates and owns an instance of the catalog. Exposes a ShellClientPtr that // can be passed to the Shell, potentially in a different process. class Catalog : public shell::ShellClient, public shell::InterfaceFactory<mojom::Catalog>, - public shell::InterfaceFactory<mojom::Resolver>, public shell::InterfaceFactory<shell::mojom::ShellResolver> { public: // |manifest_provider| may be null. @@ -53,10 +51,6 @@ // shell::ShellClient: bool AcceptConnection(shell::Connection* connection) override; - // shell::InterfaceFactory<mojom::Resolver>: - void Create(shell::Connection* connection, - mojom::ResolverRequest request) override; - // shell::InterfaceFactory<shell::mojom::ShellResolver>: void Create(shell::Connection* connection, shell::mojom::ShellResolverRequest request) override; @@ -65,7 +59,7 @@ void Create(shell::Connection* connection, mojom::CatalogRequest request) override; - Resolver* GetResolverForUserId(const std::string& user_id); + Instance* GetInstanceForUserId(const std::string& user_id); void SystemPackageDirScanned(); @@ -75,10 +69,10 @@ shell::mojom::ShellClientPtr shell_client_; scoped_ptr<shell::ShellConnection> shell_connection_; - std::map<std::string, scoped_ptr<Resolver>> resolvers_; + std::map<std::string, scoped_ptr<Instance>> instances_; scoped_ptr<Reader> system_reader_; - EntryCache system_catalog_; + EntryCache system_cache_; bool loaded_ = false; base::WeakPtrFactory<Catalog> weak_factory_;
diff --git a/services/catalog/entry.h b/services/catalog/entry.h index 0923b40..1db0287 100644 --- a/services/catalog/entry.h +++ b/services/catalog/entry.h
@@ -10,7 +10,7 @@ #include "base/files/file_path.h" #include "base/memory/scoped_ptr.h" -#include "services/catalog/public/interfaces/entry.mojom.h" +#include "services/catalog/public/interfaces/catalog.mojom.h" #include "services/shell/public/cpp/capabilities.h" namespace base {
diff --git a/services/catalog/resolver.cc b/services/catalog/instance.cc similarity index 65% rename from services/catalog/resolver.cc rename to services/catalog/instance.cc index c729fafb..3fd88b1 100644 --- a/services/catalog/resolver.cc +++ b/services/catalog/instance.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "services/catalog/resolver.h" +#include "services/catalog/instance.h" #include "base/bind.h" #include "services/catalog/entry.h" @@ -24,41 +24,32 @@ } // namespace //////////////////////////////////////////////////////////////////////////////// -// Resolver, public: +// Instance, public: -Resolver::Resolver(scoped_ptr<Store> store, Reader* system_reader) +Instance::Instance(scoped_ptr<Store> store, Reader* system_reader) : store_(std::move(store)), system_reader_(system_reader), weak_factory_(this) {} -Resolver::~Resolver() {} +Instance::~Instance() {} -void Resolver::BindResolver(mojom::ResolverRequest request) { - if (system_catalog_) - resolver_bindings_.AddBinding(this, std::move(request)); - else - pending_resolver_requests_.push_back(std::move(request)); -} - -void Resolver::BindShellResolver( +void Instance::BindShellResolver( shell::mojom::ShellResolverRequest request) { - if (system_catalog_) + if (system_cache_) shell_resolver_bindings_.AddBinding(this, std::move(request)); else pending_shell_resolver_requests_.push_back(std::move(request)); } -void Resolver::BindCatalog(mojom::CatalogRequest request) { - if (system_catalog_) +void Instance::BindCatalog(mojom::CatalogRequest request) { + if (system_cache_) catalog_bindings_.AddBinding(this, std::move(request)); else pending_catalog_requests_.push_back(std::move(request)); } -void Resolver::CacheReady(EntryCache* cache) { - system_catalog_ = cache; +void Instance::CacheReady(EntryCache* cache) { + system_cache_ = cache; DeserializeCatalog(); - for (auto& request : pending_resolver_requests_) - BindResolver(std::move(request)); for (auto& request : pending_shell_resolver_requests_) BindShellResolver(std::move(request)); for (auto& request : pending_catalog_requests_) @@ -66,34 +57,11 @@ } //////////////////////////////////////////////////////////////////////////////// -// Resolver, mojom::Resolver: +// Instance, shell::mojom::ShellResolver: -void Resolver::ResolveClass(const mojo::String& clazz, - const ResolveClassCallback& callback) { - mojo::Array<mojom::EntryPtr> entries; - for (const auto& entry : *system_catalog_) - if (entry.second->ProvidesClass(clazz)) - entries.push_back(mojom::Entry::From(*entry.second)); - callback.Run(std::move(entries)); -} - -void Resolver::ResolveMIMEType(const mojo::String& mime_type, - const ResolveMIMETypeCallback& callback) { - // TODO(beng): implement. -} - -void Resolver::ResolveProtocolScheme( - const mojo::String& scheme, - const ResolveProtocolSchemeCallback& callback) { - // TODO(beng): implement. -} - -//////////////////////////////////////////////////////////////////////////////// -// Resolver, shell::mojom::ShellResolver: - -void Resolver::ResolveMojoName(const mojo::String& mojo_name, +void Instance::ResolveMojoName(const mojo::String& mojo_name, const ResolveMojoNameCallback& callback) { - DCHECK(system_catalog_); + DCHECK(system_cache_); std::string type = shell::GetNameType(mojo_name); if (type != shell::kNameType_Mojo && type != shell::kNameType_Exe) { @@ -103,8 +71,8 @@ } // TODO(beng): per-user catalogs. - auto entry = system_catalog_->find(mojo_name); - if (entry != system_catalog_->end()) { + auto entry = system_cache_->find(mojo_name); + if (entry != system_cache_->end()) { callback.Run(shell::mojom::ResolveResult::From(*entry->second)); return; } @@ -112,30 +80,30 @@ // Manifests for mojo: names should always be in the catalog by this point. //DCHECK(type == shell::kNameType_Exe); system_reader_->CreateEntryForName( - mojo_name, system_catalog_, - base::Bind(&Resolver::OnReadManifest, weak_factory_.GetWeakPtr(), + mojo_name, system_cache_, + base::Bind(&Instance::OnReadManifest, weak_factory_.GetWeakPtr(), mojo_name, callback)); } //////////////////////////////////////////////////////////////////////////////// -// Resolver, mojom::Catalog: +// Instance, mojom::Catalog: -void Resolver::GetEntries(mojo::Array<mojo::String> names, +void Instance::GetEntries(mojo::Array<mojo::String> names, const GetEntriesCallback& callback) { - DCHECK(system_catalog_); + DCHECK(system_cache_); mojo::Array<mojom::EntryPtr> entries; if (names.is_null()) { // TODO(beng): user catalog. - for (const auto& entry : *system_catalog_) + for (const auto& entry : *system_cache_) AddEntry(*entry.second, &entries); } else { std::vector<mojo::String> names_vec = names.PassStorage(); for (const std::string& name : names_vec) { Entry* entry = nullptr; // TODO(beng): user catalog. - if (system_catalog_->find(name) != system_catalog_->end()) - entry = (*system_catalog_)[name].get(); + if (system_cache_->find(name) != system_cache_->end()) + entry = (*system_cache_)[name].get(); else continue; AddEntry(*entry, &entries); @@ -144,11 +112,33 @@ callback.Run(std::move(entries)); } -//////////////////////////////////////////////////////////////////////////////// -// Resolver, private: +void Instance::GetEntriesProvidingClass( + const mojo::String& clazz, + const GetEntriesProvidingClassCallback& callback) { + mojo::Array<mojom::EntryPtr> entries; + for (const auto& entry : *system_cache_) + if (entry.second->ProvidesClass(clazz)) + entries.push_back(mojom::Entry::From(*entry.second)); + callback.Run(std::move(entries)); +} -void Resolver::DeserializeCatalog() { - DCHECK(system_catalog_); +void Instance::GetEntriesConsumingMIMEType( + const mojo::String& mime_type, + const GetEntriesConsumingMIMETypeCallback& callback) { + // TODO(beng): implement. +} + +void Instance::GetEntriesSupportingScheme( + const mojo::String& scheme, + const GetEntriesSupportingSchemeCallback& callback) { + // TODO(beng): implement. +} + +//////////////////////////////////////////////////////////////////////////////// +// Instance, private: + +void Instance::DeserializeCatalog() { + DCHECK(system_cache_); if (!store_) return; const base::ListValue* catalog = store_->GetStore(); @@ -162,28 +152,28 @@ scoped_ptr<Entry> entry = Entry::Deserialize(*dictionary); // TODO(beng): user catalog. if (entry) - (*system_catalog_)[entry->name()] = std::move(entry); + (*system_cache_)[entry->name()] = std::move(entry); } } -void Resolver::SerializeCatalog() { - DCHECK(system_catalog_); +void Instance::SerializeCatalog() { + DCHECK(system_cache_); scoped_ptr<base::ListValue> catalog(new base::ListValue); // TODO(beng): user catalog. - for (const auto& entry : *system_catalog_) + for (const auto& entry : *system_cache_) catalog->Append(entry.second->Serialize()); if (store_) store_->UpdateStore(std::move(catalog)); } // static -void Resolver::OnReadManifest(base::WeakPtr<Resolver> resolver, +void Instance::OnReadManifest(base::WeakPtr<Instance> instance, const std::string& mojo_name, const ResolveMojoNameCallback& callback, shell::mojom::ResolveResultPtr result) { callback.Run(std::move(result)); - if (resolver) - resolver->SerializeCatalog(); + if (instance) + instance->SerializeCatalog(); } } // namespace catalog
diff --git a/services/catalog/resolver.h b/services/catalog/instance.h similarity index 71% rename from services/catalog/resolver.h rename to services/catalog/instance.h index 3f284a3..d7d7a7b 100644 --- a/services/catalog/resolver.h +++ b/services/catalog/instance.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef SERVICES_CATALOG_RESOLVER_H_ -#define SERVICES_CATALOG_RESOLVER_H_ +#ifndef SERVICES_CATALOG_INSTANCE_H_ +#define SERVICES_CATALOG_INSTANCE_H_ #include "base/files/file_path.h" #include "base/memory/weak_ptr.h" @@ -12,7 +12,6 @@ #include "mojo/public/cpp/bindings/binding_set.h" #include "services/catalog/entry.h" #include "services/catalog/public/interfaces/catalog.mojom.h" -#include "services/catalog/public/interfaces/resolver.mojom.h" #include "services/catalog/store.h" #include "services/catalog/types.h" #include "services/shell/public/cpp/interface_factory.h" @@ -23,15 +22,13 @@ class Reader; class Store; -class Resolver : public mojom::Resolver, - public shell::mojom::ShellResolver, +class Instance : public shell::mojom::ShellResolver, public mojom::Catalog { public: // |manifest_provider| may be null. - Resolver(scoped_ptr<Store> store, Reader* system_reader); - ~Resolver() override; + Instance(scoped_ptr<Store> store, Reader* system_reader); + ~Instance() override; - void BindResolver(mojom::ResolverRequest request); void BindShellResolver(shell::mojom::ShellResolverRequest request); void BindCatalog(mojom::CatalogRequest request); @@ -42,15 +39,6 @@ using MojoNameAliasMap = std::map<std::string, std::pair<std::string, std::string>>; - // mojom::Resolver: - void ResolveClass(const mojo::String& clazz, - const ResolveClassCallback& callback) override; - void ResolveMIMEType(const mojo::String& mime_type, - const ResolveMIMETypeCallback& callback) override; - void ResolveProtocolScheme( - const mojo::String& scheme, - const ResolveProtocolSchemeCallback& callback) override; - // shell::mojom::ShellResolver: void ResolveMojoName(const mojo::String& mojo_name, const ResolveMojoNameCallback& callback) override; @@ -58,6 +46,15 @@ // mojom::Catalog: void GetEntries(mojo::Array<mojo::String> names, const GetEntriesCallback& callback) override; + void GetEntriesProvidingClass( + const mojo::String& clazz, + const GetEntriesProvidingClassCallback& callback) override; + void GetEntriesConsumingMIMEType( + const mojo::String& mime_type, + const GetEntriesConsumingMIMETypeCallback& callback) override; + void GetEntriesSupportingScheme( + const mojo::String& scheme, + const GetEntriesSupportingSchemeCallback& callback) override; // Populate/serialize the cache from/to the supplied store. void DeserializeCatalog(); @@ -65,7 +62,7 @@ // Receives the result of manifest parsing, may be received after the // catalog object that issued the request is destroyed. - static void OnReadManifest(base::WeakPtr<Resolver> resolver, + static void OnReadManifest(base::WeakPtr<Instance> instance, const std::string& mojo_name, const ResolveMojoNameCallback& callback, shell::mojom::ResolveResultPtr result); @@ -73,7 +70,6 @@ // User-specific persistent storage of package manifests and other settings. scoped_ptr<Store> store_; - mojo::BindingSet<mojom::Resolver> resolver_bindings_; mojo::BindingSet<shell::mojom::ShellResolver> shell_resolver_bindings_; mojo::BindingSet<mojom::Catalog> catalog_bindings_; @@ -82,20 +78,19 @@ // A map of name -> Entry data structure for system-level packages (i.e. those // that are visible to all users). // TODO(beng): eventually add per-user applications. - EntryCache* system_catalog_ = nullptr; + EntryCache* system_cache_ = nullptr; // We only bind requests for these interfaces once the catalog has been // populated. These data structures queue requests until that happens. - std::vector<mojom::ResolverRequest> pending_resolver_requests_; std::vector<shell::mojom::ShellResolverRequest> pending_shell_resolver_requests_; std::vector<mojom::CatalogRequest> pending_catalog_requests_; - base::WeakPtrFactory<Resolver> weak_factory_; + base::WeakPtrFactory<Instance> weak_factory_; - DISALLOW_COPY_AND_ASSIGN(Resolver); + DISALLOW_COPY_AND_ASSIGN(Instance); }; } // namespace catalog -#endif // SERVICES_CATALOG_RESOLVER_H_ +#endif // SERVICES_CATALOG_INSTANCE_H_
diff --git a/services/catalog/public/interfaces/BUILD.gn b/services/catalog/public/interfaces/BUILD.gn index 0a694af..77a6aaf1 100644 --- a/services/catalog/public/interfaces/BUILD.gn +++ b/services/catalog/public/interfaces/BUILD.gn
@@ -7,7 +7,5 @@ mojom("interfaces") { sources = [ "catalog.mojom", - "entry.mojom", - "resolver.mojom", ] }
diff --git a/services/catalog/public/interfaces/catalog.mojom b/services/catalog/public/interfaces/catalog.mojom index f445881..beff6cbe 100644 --- a/services/catalog/public/interfaces/catalog.mojom +++ b/services/catalog/public/interfaces/catalog.mojom
@@ -4,9 +4,25 @@ module catalog.mojom; -import "services/catalog/public/interfaces/entry.mojom"; +struct Entry { + string name; + string display_name; +}; interface Catalog { + // Returns the catalog entries for the specified mojo names. // If |names| is null, all available entries are returned. GetEntries(array<string>? names) => (array<Entry> entries); + + // Returns the entry(ies) for applications that export to the caller the + // specified class. + GetEntriesProvidingClass(string clazz) => (array<Entry> entries); + + // Returns the entry(ies) for applications that can consume content of the + // specified MIME type. + GetEntriesConsumingMIMEType(string mime_type) => (array<Entry> entries); + + // Returns the entry(ies) for applications that can handle links with the + // specified scheme. + GetEntriesSupportingScheme(string protocol_scheme) => (array<Entry> entries); };
diff --git a/services/catalog/public/interfaces/entry.mojom b/services/catalog/public/interfaces/entry.mojom deleted file mode 100644 index fbd2bb1..0000000 --- a/services/catalog/public/interfaces/entry.mojom +++ /dev/null
@@ -1,10 +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. - -module catalog.mojom; - -struct Entry { - string name; - string display_name; -};
diff --git a/services/catalog/public/interfaces/resolver.mojom b/services/catalog/public/interfaces/resolver.mojom deleted file mode 100644 index 9ddd0b4..0000000 --- a/services/catalog/public/interfaces/resolver.mojom +++ /dev/null
@@ -1,22 +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. - -module catalog.mojom; - -import "services/catalog/public/interfaces/entry.mojom"; - -// Resolves various things to Mojo names that can be passed to mojo::Shell's -// ConnectToApplication(). -interface Resolver { - // Returns the entry(ies) for applications that export to the caller the - // specified class. - ResolveClass(string clazz) => (array<Entry> entries); - - // Returns the mojo: name of the service that will handle content of type - // |mime_type|. - ResolveMIMEType(string mime_type) => (string resolved_mojo_name); - - // Called to return - ResolveProtocolScheme(string protocol_scheme) => (string resolved_mojo_name); -};
diff --git a/services/shell/shell.gyp b/services/shell/shell.gyp index 9163435..b6d1e07 100644 --- a/services/shell/shell.gyp +++ b/services/shell/shell.gyp
@@ -9,8 +9,6 @@ 'variables': { 'mojom_files': [ '../catalog/public/interfaces/catalog.mojom', - '../catalog/public/interfaces/entry.mojom', - '../catalog/public/interfaces/resolver.mojom', 'public/interfaces/capabilities.mojom', 'public/interfaces/connector.mojom', 'public/interfaces/interface_provider.mojom', @@ -73,10 +71,10 @@ '../catalog/constants.h', '../catalog/entry.cc', '../catalog/entry.h', + '../catalog/instance.cc', + '../catalog/instance.h', '../catalog/reader.cc', '../catalog/reader.h', - '../catalog/resolver.cc', - '../catalog/resolver.h', '../catalog/store.cc', '../catalog/store.h', '../catalog/types.h',
diff --git a/skia/config/SkUserConfig.h b/skia/config/SkUserConfig.h index 3e42d05..097bba9 100644 --- a/skia/config/SkUserConfig.h +++ b/skia/config/SkUserConfig.h
@@ -242,6 +242,10 @@ # define SK_SUPPORT_LEGACY_TYPEFACE_PTR #endif +#ifndef SK_SUPPORT_LEGACY_IMAGEFILTER_CTM +# define SK_SUPPORT_LEGACY_IMAGEFILTER_CTM +#endif + ///////////////////////// Imported from BUILD.gn and skia_common.gypi /* In some places Skia can use static initializers for global initialization,
diff --git a/sync/BUILD.gn b/sync/BUILD.gn index 4d8f323..dd177bc 100644 --- a/sync/BUILD.gn +++ b/sync/BUILD.gn
@@ -487,12 +487,12 @@ "test/engine/fake_model_worker.h", "test/engine/fake_sync_scheduler.cc", "test/engine/fake_sync_scheduler.h", - "test/engine/mock_commit_queue.cc", - "test/engine/mock_commit_queue.h", "test/engine/mock_connection_manager.cc", "test/engine/mock_connection_manager.h", "test/engine/mock_model_type_processor.cc", "test/engine/mock_model_type_processor.h", + "test/engine/mock_model_type_worker.cc", + "test/engine/mock_model_type_worker.h", "test/engine/mock_nudge_handler.cc", "test/engine/mock_nudge_handler.h", "test/engine/mock_update_handler.cc",
diff --git a/sync/internal_api/shared_model_type_processor_unittest.cc b/sync/internal_api/shared_model_type_processor_unittest.cc index c536a45..13fe80c 100644 --- a/sync/internal_api/shared_model_type_processor_unittest.cc +++ b/sync/internal_api/shared_model_type_processor_unittest.cc
@@ -25,14 +25,12 @@ #include "sync/protocol/data_type_state.pb.h" #include "sync/protocol/sync.pb.h" #include "sync/syncable/syncable_util.h" -#include "sync/test/engine/mock_commit_queue.h" +#include "sync/test/engine/mock_model_type_worker.h" #include "sync/util/time.h" #include "testing/gtest/include/gtest/gtest.h" namespace syncer_v2 { -static const syncer::ModelType kModelType = syncer::PREFERENCES; - namespace { const std::string kTag1 = "tag1"; @@ -43,7 +41,7 @@ const std::string kValue3 = "value3"; std::string GenerateTagHash(const std::string& tag) { - return syncer::syncable::GenerateSyncableHash(kModelType, tag); + return syncer::syncable::GenerateSyncableHash(syncer::PREFERENCES, tag); } sync_pb::EntitySpecifics GenerateSpecifics(const std::string& tag, @@ -171,9 +169,9 @@ // Tests the various functionality of SharedModelTypeProcessor. // // The processor sits between the service (implemented by this test class) and -// the worker, which is represented as a commit queue (MockCommitQueue). This -// test suite exercises the initialization flows (whether initial sync is done, -// performing the initial merge, etc) as well as normal functionality: +// the worker, which is represented by a MockModelTypeWorker. This test suite +// exercises the initialization flows (whether initial sync is done, performing +// the initial merge, etc) as well as normal functionality: // // - Initialization before the initial sync and merge correctly performs a merge // and initializes the metadata in storage. @@ -190,7 +188,9 @@ : FakeModelTypeService( base::Bind(&SharedModelTypeProcessor::CreateAsChangeProcessor)) {} - ~SharedModelTypeProcessorTest() override {} + ~SharedModelTypeProcessorTest() override { + DCHECK(data_callback_.is_null()); + } void InitializeToMetadataLoaded() { CreateChangeProcessor(); @@ -227,7 +227,7 @@ void DisconnectSync() { type_processor()->DisconnectSync(); - mock_queue_ = nullptr; + worker_ = nullptr; } // Local data modification. Emulates signals from the model thread. @@ -250,8 +250,9 @@ // Writes data for |tag| and simulates a commit response for it. void WriteItemAndAck(const std::string& tag, const std::string& value) { WriteItem(tag, value); - ASSERT_TRUE(HasCommitRequestForTag(tag)); - SuccessfulCommitResponse(GetLatestCommitRequestForTag(tag)); + worker()->ExpectPendingCommits({tag}); + worker()->AckOnePendingCommit(); + EXPECT_EQ(0U, worker()->GetNumPendingCommits()); } void DeleteItem(const std::string& tag) { @@ -264,9 +265,8 @@ } } - // Wipes existing DB and simulates one uncommited, server-known item. - void ResetStateWriteAckedItem(const std::string& tag, - const std::string& value) { + // Wipes existing DB and simulates a pending update of a server-known item. + void ResetStateWriteItem(const std::string& tag, const std::string& value) { clear_change_processor(); db_.Reset(); InitializeToReadyState(); @@ -277,18 +277,7 @@ clear_change_processor(); } - // Wipes existing DB and simulates one uncommited item. - void ResetStateWriteItem(const std::string& tag, const std::string& value) { - clear_change_processor(); - db_.Reset(); - InitializeToReadyState(); - EXPECT_EQ(0U, ProcessorEntityCount()); - WriteItem(tag, value); - EXPECT_EQ(1U, ProcessorEntityCount()); - clear_change_processor(); - } - - // Wipes existing DB and simulates one uncommited deletion. + // Wipes existing DB and simulates a pending deletion of a server-known item. void ResetStateDeleteItem(const std::string& tag, const std::string& value) { clear_change_processor(); db_.Reset(); @@ -320,113 +309,12 @@ OnInitialSyncDone(updates); } - // Generate update data for the given parameters. - UpdateResponseData GenerateUpdateData(const std::string& tag, - const std::string& value, - const std::string& ekn) { - UpdateResponseData data = mock_queue_->UpdateFromServer( - 1, GenerateTagHash(tag), GenerateSpecifics(tag, value)); - data.encryption_key_name = ekn; - return data; - } - - // Emulate updates from the server. - // This harness has some functionality to help emulate server behavior. - void UpdateFromServer(int64_t version_offset, - const std::string& tag, - const std::string& value) { - const std::string tag_hash = GenerateTagHash(tag); - UpdateResponseData data = mock_queue_->UpdateFromServer( - version_offset, tag_hash, GenerateSpecifics(tag, value)); - - UpdateResponseDataList list; - list.push_back(data); - type_processor()->OnUpdateReceived(db_.data_type_state(), list); - } - - void TombstoneFromServer(int64_t version_offset, const std::string& tag) { - // Overwrite the existing server version if this is the new highest version. - std::string tag_hash = GenerateTagHash(tag); - - UpdateResponseData data = - mock_queue_->TombstoneFromServer(version_offset, tag_hash); - - UpdateResponseDataList list; - list.push_back(data); - type_processor()->OnUpdateReceived(db_.data_type_state(), list); - } - - // Read emitted commit requests as batches. - size_t GetNumCommitRequestLists() { - DCHECK(mock_queue_); - return mock_queue_->GetNumCommitRequestLists(); - } - - CommitRequestDataList GetNthCommitRequestList(size_t n) { - return mock_queue_->GetNthCommitRequestList(n); - } - - // Read emitted commit requests by tag, most recent only. - bool HasCommitRequestForTag(const std::string& tag) { - const std::string tag_hash = GenerateTagHash(tag); - return mock_queue_->HasCommitRequestForTagHash(tag_hash); - } - - CommitRequestData GetLatestCommitRequestForTag(const std::string& tag) { - const std::string tag_hash = GenerateTagHash(tag); - return mock_queue_->GetLatestCommitRequestForTagHash(tag_hash); - } - - // Sends the type sync proxy a successful commit response. - void SuccessfulCommitResponse(const CommitRequestData& request_data) { - CommitResponseDataList list; - list.push_back(mock_queue_->SuccessfulCommitResponse(request_data)); - type_processor()->OnCommitCompleted(db_.data_type_state(), list); - } - - // Sends the type sync proxy an updated DataTypeState to let it know that - // the desired encryption key has changed. - void UpdateDesiredEncryptionKey(const std::string& key_name) { - sync_pb::DataTypeState data_type_state(db_.data_type_state()); - data_type_state.set_encryption_key_name(key_name); - type_processor()->OnUpdateReceived(data_type_state, - UpdateResponseDataList()); - } - - // Sets the key_name that the mock CommitQueue will claim is in use - // when receiving items. - void SetServerEncryptionKey(const std::string& key_name) { - mock_queue_->SetServerEncryptionKey(key_name); - } - // Return the number of entities the processor has metadata for. size_t ProcessorEntityCount() const { DCHECK(type_processor()); return type_processor()->entities_.size(); } - // Expect that the |n|th commit request list has one commit request for |tag| - // with |value| set. - void ExpectNthCommitRequestList(size_t n, - const std::string& tag, - const std::string& value) { - const CommitRequestDataList& list = GetNthCommitRequestList(n); - ASSERT_EQ(1U, list.size()); - const EntityData& data = list[0].entity.value(); - EXPECT_EQ(GenerateTagHash(tag), data.client_tag_hash); - EXPECT_EQ(value, data.specifics.preference().value()); - } - - // For each tag in |tags|, expect a corresponding request list of length one. - void ExpectCommitRequests(const std::vector<std::string>& tags) { - EXPECT_EQ(tags.size(), GetNumCommitRequestLists()); - for (size_t i = 0; i < tags.size(); i++) { - const CommitRequestDataList& commits = GetNthCommitRequestList(i); - EXPECT_EQ(1U, commits.size()); - EXPECT_EQ(GenerateTagHash(tags[i]), commits[0].entity->client_tag_hash); - } - } - // Store a resolution for the next call to ResolveConflict. Note that if this // is a USE_NEW resolution, the data will only exist for one resolve call. void SetConflictResolution(ConflictResolution resolution) { @@ -435,7 +323,7 @@ const SimpleStore& db() const { return db_; } - MockCommitQueue* mock_queue() { return mock_queue_; } + MockModelTypeWorker* worker() { return worker_; } SharedModelTypeProcessor* type_processor() const { return static_cast<SharedModelTypeProcessor*>(change_processor()); @@ -444,12 +332,14 @@ private: void OnReadyToConnect(syncer::SyncError error, std::unique_ptr<ActivationContext> context) { - std::unique_ptr<MockCommitQueue> commit_queue(new MockCommitQueue()); + std::unique_ptr<MockModelTypeWorker> worker( + new MockModelTypeWorker(context->data_type_state, type_processor())); // Keep an unsafe pointer to the commit queue the processor will use. - mock_queue_ = commit_queue.get(); - context->type_processor->ConnectSync(std::move(commit_queue)); - // The context's type processor is a proxy; run the task it posted. - sync_loop_.RunUntilIdle(); + worker_ = worker.get(); + // The context contains a proxy to the processor, but this call is + // side-stepping that completely and connecting directly to the real + // processor, since these tests are single-threaded and don't need proxies. + type_processor()->ConnectSync(std::move(worker)); } // FakeModelTypeService overrides. @@ -561,7 +451,7 @@ base::MessageLoop sync_loop_; // The current mock queue, which is owned by |type_processor()|. - MockCommitQueue* mock_queue_; + MockModelTypeWorker* worker_; // Stores the data callback between GetData() and OnPendingCommitDataLoaded(). base::Closure data_callback_; @@ -583,7 +473,7 @@ EXPECT_EQ(1U, db().DataCount()); EXPECT_EQ(0U, db().MetadataCount()); EXPECT_EQ(0U, ProcessorEntityCount()); - EXPECT_EQ(0U, GetNumCommitRequestLists()); + EXPECT_EQ(0U, worker()->GetNumPendingCommits()); // Initial sync with one server item. OnInitialSyncDone(kTag2, kValue2); @@ -595,7 +485,7 @@ EXPECT_EQ(2U, ProcessorEntityCount()); EXPECT_EQ(1, db().GetMetadata(kTag1).sequence_number()); EXPECT_EQ(0, db().GetMetadata(kTag2).sequence_number()); - ExpectCommitRequests({kTag1}); + worker()->ExpectPendingCommits({kTag1}); } // This test covers race conditions during loading pending data. All cases @@ -610,137 +500,137 @@ // This results in 2 + 12 = 14 orderings of the events. TEST_F(SharedModelTypeProcessorTest, LoadPendingCommit) { // Data, connect. - ResetStateWriteAckedItem(kTag1, kValue1); + ResetStateWriteItem(kTag1, kValue1); InitializeToMetadataLoaded(); OnPendingCommitDataLoaded(); OnSyncStarting(); - EXPECT_EQ(1U, GetNumCommitRequestLists()); - ExpectNthCommitRequestList(0, kTag1, kValue1); + EXPECT_EQ(1U, worker()->GetNumPendingCommits()); + worker()->ExpectNthPendingCommit(0, kTag1, kValue1); // Connect, data. - ResetStateWriteAckedItem(kTag1, kValue1); + ResetStateWriteItem(kTag1, kValue1); InitializeToMetadataLoaded(); OnSyncStarting(); - EXPECT_EQ(0U, GetNumCommitRequestLists()); + EXPECT_EQ(0U, worker()->GetNumPendingCommits()); OnPendingCommitDataLoaded(); - EXPECT_EQ(1U, GetNumCommitRequestLists()); - ExpectNthCommitRequestList(0, kTag1, kValue1); + EXPECT_EQ(1U, worker()->GetNumPendingCommits()); + worker()->ExpectNthPendingCommit(0, kTag1, kValue1); // Data, connect, put. - ResetStateWriteAckedItem(kTag1, kValue1); + ResetStateWriteItem(kTag1, kValue1); InitializeToMetadataLoaded(); OnPendingCommitDataLoaded(); OnSyncStarting(); WriteItem(kTag1, kValue2); - EXPECT_EQ(2U, GetNumCommitRequestLists()); - ExpectNthCommitRequestList(0, kTag1, kValue1); - ExpectNthCommitRequestList(1, kTag1, kValue2); + EXPECT_EQ(2U, worker()->GetNumPendingCommits()); + worker()->ExpectNthPendingCommit(0, kTag1, kValue1); + worker()->ExpectNthPendingCommit(1, kTag1, kValue2); // Data, put, connect. - ResetStateWriteAckedItem(kTag1, kValue1); + ResetStateWriteItem(kTag1, kValue1); InitializeToMetadataLoaded(); OnPendingCommitDataLoaded(); WriteItem(kTag1, kValue2); OnSyncStarting(); - EXPECT_EQ(1U, GetNumCommitRequestLists()); - ExpectNthCommitRequestList(0, kTag1, kValue2); + EXPECT_EQ(1U, worker()->GetNumPendingCommits()); + worker()->ExpectNthPendingCommit(0, kTag1, kValue2); // Connect, data, put. - ResetStateWriteAckedItem(kTag1, kValue1); + ResetStateWriteItem(kTag1, kValue1); InitializeToMetadataLoaded(); OnSyncStarting(); OnPendingCommitDataLoaded(); WriteItem(kTag1, kValue2); - EXPECT_EQ(2U, GetNumCommitRequestLists()); - ExpectNthCommitRequestList(0, kTag1, kValue1); - ExpectNthCommitRequestList(1, kTag1, kValue2); + EXPECT_EQ(2U, worker()->GetNumPendingCommits()); + worker()->ExpectNthPendingCommit(0, kTag1, kValue1); + worker()->ExpectNthPendingCommit(1, kTag1, kValue2); // Connect, put, data. - ResetStateWriteAckedItem(kTag1, kValue1); + ResetStateWriteItem(kTag1, kValue1); InitializeToMetadataLoaded(); OnSyncStarting(); WriteItem(kTag1, kValue2); - EXPECT_EQ(1U, GetNumCommitRequestLists()); - ExpectNthCommitRequestList(0, kTag1, kValue2); + EXPECT_EQ(1U, worker()->GetNumPendingCommits()); + worker()->ExpectNthPendingCommit(0, kTag1, kValue2); OnPendingCommitDataLoaded(); - EXPECT_EQ(1U, GetNumCommitRequestLists()); + EXPECT_EQ(1U, worker()->GetNumPendingCommits()); // Put, data, connect. - ResetStateWriteAckedItem(kTag1, kValue1); + ResetStateWriteItem(kTag1, kValue1); InitializeToMetadataLoaded(); WriteItem(kTag1, kValue2); OnPendingCommitDataLoaded(); OnSyncStarting(); - EXPECT_EQ(1U, GetNumCommitRequestLists()); - ExpectNthCommitRequestList(0, kTag1, kValue2); + EXPECT_EQ(1U, worker()->GetNumPendingCommits()); + worker()->ExpectNthPendingCommit(0, kTag1, kValue2); // Put, connect, data. - ResetStateWriteAckedItem(kTag1, kValue1); + ResetStateWriteItem(kTag1, kValue1); InitializeToMetadataLoaded(); WriteItem(kTag1, kValue2); OnSyncStarting(); - EXPECT_EQ(1U, GetNumCommitRequestLists()); - ExpectNthCommitRequestList(0, kTag1, kValue2); + EXPECT_EQ(1U, worker()->GetNumPendingCommits()); + worker()->ExpectNthPendingCommit(0, kTag1, kValue2); OnPendingCommitDataLoaded(); - EXPECT_EQ(1U, GetNumCommitRequestLists()); + EXPECT_EQ(1U, worker()->GetNumPendingCommits()); // Data, connect, delete. - ResetStateWriteAckedItem(kTag1, kValue1); + ResetStateWriteItem(kTag1, kValue1); InitializeToMetadataLoaded(); OnPendingCommitDataLoaded(); OnSyncStarting(); DeleteItem(kTag1); - EXPECT_EQ(2U, GetNumCommitRequestLists()); - ExpectNthCommitRequestList(0, kTag1, kValue1); - ExpectNthCommitRequestList(1, kTag1, ""); + EXPECT_EQ(2U, worker()->GetNumPendingCommits()); + worker()->ExpectNthPendingCommit(0, kTag1, kValue1); + worker()->ExpectNthPendingCommit(1, kTag1, ""); // Data, delete, connect. - ResetStateWriteAckedItem(kTag1, kValue1); + ResetStateWriteItem(kTag1, kValue1); InitializeToMetadataLoaded(); OnPendingCommitDataLoaded(); DeleteItem(kTag1); OnSyncStarting(); - EXPECT_EQ(1U, GetNumCommitRequestLists()); - ExpectNthCommitRequestList(0, kTag1, ""); + EXPECT_EQ(1U, worker()->GetNumPendingCommits()); + worker()->ExpectNthPendingCommit(0, kTag1, ""); // Connect, data, delete. - ResetStateWriteAckedItem(kTag1, kValue1); + ResetStateWriteItem(kTag1, kValue1); InitializeToMetadataLoaded(); OnSyncStarting(); OnPendingCommitDataLoaded(); DeleteItem(kTag1); - EXPECT_EQ(2U, GetNumCommitRequestLists()); - ExpectNthCommitRequestList(0, kTag1, kValue1); - ExpectNthCommitRequestList(1, kTag1, ""); + EXPECT_EQ(2U, worker()->GetNumPendingCommits()); + worker()->ExpectNthPendingCommit(0, kTag1, kValue1); + worker()->ExpectNthPendingCommit(1, kTag1, ""); // Connect, delete, data. - ResetStateWriteAckedItem(kTag1, kValue1); + ResetStateWriteItem(kTag1, kValue1); InitializeToMetadataLoaded(); OnSyncStarting(); DeleteItem(kTag1); - EXPECT_EQ(1U, GetNumCommitRequestLists()); - ExpectNthCommitRequestList(0, kTag1, ""); + EXPECT_EQ(1U, worker()->GetNumPendingCommits()); + worker()->ExpectNthPendingCommit(0, kTag1, ""); OnPendingCommitDataLoaded(); - EXPECT_EQ(1U, GetNumCommitRequestLists()); + EXPECT_EQ(1U, worker()->GetNumPendingCommits()); // Delete, data, connect. - ResetStateWriteAckedItem(kTag1, kValue1); + ResetStateWriteItem(kTag1, kValue1); InitializeToMetadataLoaded(); DeleteItem(kTag1); OnPendingCommitDataLoaded(); OnSyncStarting(); - EXPECT_EQ(1U, GetNumCommitRequestLists()); - ExpectNthCommitRequestList(0, kTag1, ""); + EXPECT_EQ(1U, worker()->GetNumPendingCommits()); + worker()->ExpectNthPendingCommit(0, kTag1, ""); // Delete, connect, data. - ResetStateWriteAckedItem(kTag1, kValue1); + ResetStateWriteItem(kTag1, kValue1); InitializeToMetadataLoaded(); DeleteItem(kTag1); OnSyncStarting(); - EXPECT_EQ(1U, GetNumCommitRequestLists()); - ExpectNthCommitRequestList(0, kTag1, ""); + EXPECT_EQ(1U, worker()->GetNumPendingCommits()); + worker()->ExpectNthPendingCommit(0, kTag1, ""); OnPendingCommitDataLoaded(); - EXPECT_EQ(1U, GetNumCommitRequestLists()); + EXPECT_EQ(1U, worker()->GetNumPendingCommits()); } // This test covers race conditions during loading a pending delete. All cases @@ -758,44 +648,44 @@ ResetStateDeleteItem(kTag1, kValue1); InitializeToMetadataLoaded(); OnSyncStarting(); - EXPECT_EQ(1U, GetNumCommitRequestLists()); - ExpectNthCommitRequestList(0, kTag1, ""); + EXPECT_EQ(1U, worker()->GetNumPendingCommits()); + worker()->ExpectNthPendingCommit(0, kTag1, ""); // Connect, put. ResetStateDeleteItem(kTag1, kValue1); InitializeToMetadataLoaded(); OnSyncStarting(); - EXPECT_EQ(1U, GetNumCommitRequestLists()); + EXPECT_EQ(1U, worker()->GetNumPendingCommits()); WriteItem(kTag1, kValue2); - EXPECT_EQ(2U, GetNumCommitRequestLists()); - ExpectNthCommitRequestList(0, kTag1, ""); - ExpectNthCommitRequestList(1, kTag1, kValue2); + EXPECT_EQ(2U, worker()->GetNumPendingCommits()); + worker()->ExpectNthPendingCommit(0, kTag1, ""); + worker()->ExpectNthPendingCommit(1, kTag1, kValue2); // Put, connect. ResetStateDeleteItem(kTag1, kValue1); InitializeToMetadataLoaded(); WriteItem(kTag1, kValue2); OnSyncStarting(); - EXPECT_EQ(1U, GetNumCommitRequestLists()); - ExpectNthCommitRequestList(0, kTag1, kValue2); + EXPECT_EQ(1U, worker()->GetNumPendingCommits()); + worker()->ExpectNthPendingCommit(0, kTag1, kValue2); // Connect, delete. ResetStateDeleteItem(kTag1, kValue1); InitializeToMetadataLoaded(); OnSyncStarting(); - EXPECT_EQ(1U, GetNumCommitRequestLists()); + EXPECT_EQ(1U, worker()->GetNumPendingCommits()); DeleteItem(kTag1); - EXPECT_EQ(2U, GetNumCommitRequestLists()); - ExpectNthCommitRequestList(0, kTag1, ""); - ExpectNthCommitRequestList(1, kTag1, ""); + EXPECT_EQ(2U, worker()->GetNumPendingCommits()); + worker()->ExpectNthPendingCommit(0, kTag1, ""); + worker()->ExpectNthPendingCommit(1, kTag1, ""); // Delete, connect. ResetStateDeleteItem(kTag1, kValue1); InitializeToMetadataLoaded(); DeleteItem(kTag1); OnSyncStarting(); - EXPECT_EQ(1U, GetNumCommitRequestLists()); - ExpectNthCommitRequestList(0, kTag1, ""); + EXPECT_EQ(1U, worker()->GetNumPendingCommits()); + worker()->ExpectNthPendingCommit(0, kTag1, ""); } // Test that loading a committed item does not queue another commit. @@ -807,21 +697,21 @@ // Test that a new processor loads the metadata without committing. InitializeToReadyState(); EXPECT_EQ(1U, ProcessorEntityCount()); - EXPECT_EQ(0U, GetNumCommitRequestLists()); + EXPECT_EQ(0U, worker()->GetNumPendingCommits()); } // Creates a new item locally. // Thoroughly tests the data generated by a local item creation. TEST_F(SharedModelTypeProcessorTest, LocalCreateItem) { InitializeToReadyState(); - EXPECT_EQ(0U, GetNumCommitRequestLists()); + EXPECT_EQ(0U, worker()->GetNumPendingCommits()); WriteItem(kTag1, kValue1); // Verify the commit request this operation has triggered. - ExpectCommitRequests({kTag1}); + worker()->ExpectPendingCommits({kTag1}); const CommitRequestData& tag1_request_data = - GetLatestCommitRequestForTag(kTag1); + worker()->GetLatestPendingCommitForTag(kTag1); const EntityData& tag1_data = tag1_request_data.entity.value(); EXPECT_EQ(kUncommittedVersion, tag1_request_data.base_version); @@ -853,30 +743,30 @@ const std::string kId2 = "cid2"; const std::string kName1 = "name1"; const std::string kName2 = "name2"; - const std::string kHash = "hash"; + const std::string kTag3Hash = GenerateTagHash(kTag3); InitializeToReadyState(); - EXPECT_EQ(0U, GetNumCommitRequestLists()); + EXPECT_EQ(0U, worker()->GetNumPendingCommits()); std::unique_ptr<EntityData> entity_data = base::WrapUnique(new EntityData()); entity_data->specifics.mutable_preference()->set_name(kName1); entity_data->specifics.mutable_preference()->set_value(kValue1); entity_data->non_unique_name = kName1; - entity_data->client_tag_hash = kHash; + entity_data->client_tag_hash = kTag3Hash; entity_data->id = kId1; WriteItem(kTag1, std::move(entity_data)); - EXPECT_EQ(1U, GetNumCommitRequestLists()); - ASSERT_FALSE(mock_queue()->HasCommitRequestForTagHash(kHash)); - ASSERT_TRUE(HasCommitRequestForTag(kTag1)); + EXPECT_EQ(1U, worker()->GetNumPendingCommits()); + ASSERT_FALSE(worker()->HasPendingCommitForTag(kTag3)); + ASSERT_TRUE(worker()->HasPendingCommitForTag(kTag1)); EXPECT_EQ(1U, db().MetadataCount()); const EntityData& out_entity1 = - GetLatestCommitRequestForTag(kTag1).entity.value(); + worker()->GetLatestPendingCommitForTag(kTag1).entity.value(); const sync_pb::EntityMetadata metadata_v1 = db().GetMetadata(kTag1); EXPECT_EQ(kId1, out_entity1.id); - EXPECT_NE(kHash, out_entity1.client_tag_hash); + EXPECT_NE(kTag3Hash, out_entity1.client_tag_hash); EXPECT_EQ(kValue1, out_entity1.specifics.preference().value()); EXPECT_EQ(kId1, metadata_v1.server_id()); EXPECT_EQ(metadata_v1.client_tag_hash(), out_entity1.client_tag_hash); @@ -885,17 +775,17 @@ entity_data->specifics.mutable_preference()->set_name(kName2); entity_data->specifics.mutable_preference()->set_value(kValue2); entity_data->non_unique_name = kName2; - entity_data->client_tag_hash = kHash; + entity_data->client_tag_hash = kTag3Hash; // Make sure ID isn't overwritten either. entity_data->id = kId2; WriteItem(kTag1, std::move(entity_data)); - EXPECT_EQ(2U, GetNumCommitRequestLists()); - ASSERT_FALSE(mock_queue()->HasCommitRequestForTagHash(kHash)); - ASSERT_TRUE(HasCommitRequestForTag(kTag1)); + EXPECT_EQ(2U, worker()->GetNumPendingCommits()); + ASSERT_FALSE(worker()->HasPendingCommitForTag(kTag3)); + ASSERT_TRUE(worker()->HasPendingCommitForTag(kTag1)); EXPECT_EQ(1U, db().MetadataCount()); const EntityData& out_entity2 = - GetLatestCommitRequestForTag(kTag1).entity.value(); + worker()->GetLatestPendingCommitForTag(kTag1).entity.value(); const sync_pb::EntityMetadata metadata_v2 = db().GetMetadata(kTag1); EXPECT_EQ(kValue2, out_entity2.specifics.preference().value()); @@ -915,19 +805,19 @@ WriteItem(kTag1, kValue1); EXPECT_EQ(1U, db().MetadataCount()); - ExpectCommitRequests({kTag1}); + worker()->ExpectPendingCommits({kTag1}); const CommitRequestData& request_data_v1 = - GetLatestCommitRequestForTag(kTag1); + worker()->GetLatestPendingCommitForTag(kTag1); const EntityData& data_v1 = request_data_v1.entity.value(); const sync_pb::EntityMetadata metadata_v1 = db().GetMetadata(kTag1); WriteItem(kTag1, kValue2); EXPECT_EQ(1U, db().MetadataCount()); - ExpectCommitRequests({kTag1, kTag1}); + worker()->ExpectPendingCommits({kTag1, kTag1}); const CommitRequestData& request_data_v2 = - GetLatestCommitRequestForTag(kTag1); + worker()->GetLatestPendingCommitForTag(kTag1); const EntityData& data_v2 = request_data_v2.entity.value(); const sync_pb::EntityMetadata metadata_v2 = db().GetMetadata(kTag1); @@ -967,20 +857,20 @@ InitializeToReadyState(); WriteItem(kTag1, kValue1); EXPECT_EQ(1U, db().MetadataCount()); - ExpectCommitRequests({kTag1}); + worker()->ExpectPendingCommits({kTag1}); WriteItem(kTag1, kValue1); - ExpectCommitRequests({kTag1}); + worker()->ExpectPendingCommits({kTag1}); } // Thoroughly tests the data generated by a server item creation. TEST_F(SharedModelTypeProcessorTest, ServerCreateItem) { InitializeToReadyState(); - UpdateFromServer(5, kTag1, kValue1); + worker()->UpdateFromServer(kTag1, kValue1); EXPECT_EQ(1U, db().DataCount()); EXPECT_EQ(1U, db().MetadataCount()); EXPECT_EQ(1U, ProcessorEntityCount()); - EXPECT_EQ(0U, GetNumCommitRequestLists()); + EXPECT_EQ(0U, worker()->GetNumPendingCommits()); const EntityData& data = db().GetData(kTag1); EXPECT_FALSE(data.id.empty()); @@ -997,7 +887,7 @@ EXPECT_FALSE(metadata.is_deleted()); EXPECT_EQ(0, metadata.sequence_number()); EXPECT_EQ(0, metadata.acked_sequence_number()); - EXPECT_EQ(5, metadata.server_version()); + EXPECT_EQ(1, metadata.server_version()); EXPECT_TRUE(metadata.has_creation_time()); EXPECT_TRUE(metadata.has_modification_time()); EXPECT_TRUE(metadata.has_specifics_hash()); @@ -1013,12 +903,12 @@ EXPECT_EQ(2U, db().MetadataChangeCount()); // Redundant update from server doesn't write data but updates metadata. - UpdateFromServer(5, kTag1, kValue1); + worker()->UpdateFromServer(kTag1, kValue1); EXPECT_EQ(1U, db().DataChangeCount()); EXPECT_EQ(3U, db().MetadataChangeCount()); // A reflection (update already received) is ignored completely. - UpdateFromServer(0 /* version_offset */, kTag1, kValue1); + worker()->UpdateFromServer(kTag1, kValue1, 0 /* version_offset */); EXPECT_EQ(1U, db().DataChangeCount()); EXPECT_EQ(3U, db().MetadataChangeCount()); } @@ -1027,7 +917,7 @@ TEST_F(SharedModelTypeProcessorTest, LocalDeleteItem) { InitializeToReadyState(); WriteItemAndAck(kTag1, kValue1); - ExpectCommitRequests({kTag1}); + EXPECT_EQ(0U, worker()->GetNumPendingCommits()); const sync_pb::EntityMetadata metadata_v1 = db().GetMetadata(kTag1); EXPECT_FALSE(metadata_v1.is_deleted()); @@ -1040,7 +930,7 @@ // Metadata is not removed until the commit response comes back. EXPECT_EQ(1U, db().MetadataCount()); EXPECT_EQ(1U, ProcessorEntityCount()); - ExpectCommitRequests({kTag1, kTag1}); + worker()->ExpectPendingCommits({kTag1}); const sync_pb::EntityMetadata metadata_v2 = db().GetMetadata(kTag1); EXPECT_TRUE(metadata_v2.is_deleted()); @@ -1049,7 +939,7 @@ EXPECT_EQ(1, metadata_v2.server_version()); // Ack the delete and check that the metadata is cleared. - SuccessfulCommitResponse(GetLatestCommitRequestForTag(kTag1)); + worker()->AckOnePendingCommit(); EXPECT_EQ(0U, db().MetadataCount()); EXPECT_EQ(0U, ProcessorEntityCount()); } @@ -1059,8 +949,9 @@ TEST_F(SharedModelTypeProcessorTest, LocalDeleteItemInterleaved) { InitializeToReadyState(); WriteItem(kTag1, kValue1); - ExpectCommitRequests({kTag1}); - const CommitRequestData& data_v1 = GetLatestCommitRequestForTag(kTag1); + worker()->ExpectPendingCommits({kTag1}); + const CommitRequestData& data_v1 = + worker()->GetLatestPendingCommitForTag(kTag1); const sync_pb::EntityMetadata metadata_v1 = db().GetMetadata(kTag1); EXPECT_FALSE(metadata_v1.is_deleted()); @@ -1072,9 +963,10 @@ EXPECT_EQ(0U, db().DataCount()); EXPECT_EQ(1U, db().MetadataCount()); EXPECT_EQ(1U, ProcessorEntityCount()); - ExpectCommitRequests({kTag1, kTag1}); + worker()->ExpectPendingCommits({kTag1, kTag1}); - const CommitRequestData& data_v2 = GetLatestCommitRequestForTag(kTag1); + const CommitRequestData& data_v2 = + worker()->GetLatestPendingCommitForTag(kTag1); EXPECT_GT(data_v2.sequence_number, data_v1.sequence_number); EXPECT_TRUE(data_v2.entity->id.empty()); EXPECT_EQ(kUncommittedVersion, data_v2.base_version); @@ -1087,7 +979,7 @@ EXPECT_EQ(kUncommittedVersion, metadata_v2.server_version()); // A response for the first commit doesn't change much. - SuccessfulCommitResponse(data_v1); + worker()->AckOnePendingCommit(); EXPECT_EQ(0U, db().DataCount()); EXPECT_EQ(1U, db().MetadataCount()); EXPECT_EQ(1U, ProcessorEntityCount()); @@ -1098,7 +990,7 @@ EXPECT_EQ(1, metadata_v3.acked_sequence_number()); EXPECT_EQ(1, metadata_v3.server_version()); - SuccessfulCommitResponse(data_v2); + worker()->AckOnePendingCommit(); // The delete was acked so the metadata should now be cleared. EXPECT_EQ(0U, db().MetadataCount()); EXPECT_EQ(0U, ProcessorEntityCount()); @@ -1110,14 +1002,14 @@ EXPECT_EQ(1U, ProcessorEntityCount()); EXPECT_EQ(1U, db().MetadataCount()); EXPECT_EQ(1U, db().DataCount()); - EXPECT_EQ(1U, GetNumCommitRequestLists()); + EXPECT_EQ(0U, worker()->GetNumPendingCommits()); - TombstoneFromServer(5, kTag1); + worker()->TombstoneFromServer(kTag1); // Delete from server should clear the data and all the metadata. EXPECT_EQ(0U, db().DataCount()); EXPECT_EQ(0U, db().MetadataCount()); EXPECT_EQ(0U, ProcessorEntityCount()); - EXPECT_EQ(1U, GetNumCommitRequestLists()); + EXPECT_EQ(0U, worker()->GetNumPendingCommits()); } // Deletes an item we've never seen before. @@ -1128,25 +1020,25 @@ EXPECT_EQ(0U, db().DataCount()); EXPECT_EQ(0U, db().MetadataCount()); EXPECT_EQ(0U, ProcessorEntityCount()); - EXPECT_EQ(0U, GetNumCommitRequestLists()); + EXPECT_EQ(0U, worker()->GetNumPendingCommits()); } // Deletes an item we've never seen before. // Should have no effect and not crash. TEST_F(SharedModelTypeProcessorTest, ServerDeleteUnknown) { InitializeToReadyState(); - TombstoneFromServer(5, kTag1); + worker()->TombstoneFromServer(kTag1); EXPECT_EQ(0U, db().DataCount()); EXPECT_EQ(0U, db().MetadataCount()); EXPECT_EQ(0U, ProcessorEntityCount()); - EXPECT_EQ(0U, GetNumCommitRequestLists()); + EXPECT_EQ(0U, worker()->GetNumPendingCommits()); } // Creates two different sync items. // Verifies that the second has no effect on the first. TEST_F(SharedModelTypeProcessorTest, TwoIndependentItems) { InitializeToReadyState(); - EXPECT_EQ(0U, GetNumCommitRequestLists()); + EXPECT_EQ(0U, worker()->GetNumPendingCommits()); WriteItem(kTag1, kValue1); EXPECT_EQ(1U, db().DataCount()); @@ -1154,7 +1046,7 @@ const sync_pb::EntityMetadata metadata1 = db().GetMetadata(kTag1); // There should be one commit request for this item only. - ExpectCommitRequests({kTag1}); + worker()->ExpectPendingCommits({kTag1}); WriteItem(kTag2, kValue2); EXPECT_EQ(2U, db().DataCount()); @@ -1162,7 +1054,7 @@ const sync_pb::EntityMetadata metadata2 = db().GetMetadata(kTag2); // The second write should trigger another single-item commit request. - ExpectCommitRequests({kTag1, kTag2}); + worker()->ExpectPendingCommits({kTag1, kTag2}); EXPECT_FALSE(metadata1.is_deleted()); EXPECT_EQ(1, metadata1.sequence_number()); @@ -1182,16 +1074,16 @@ EXPECT_EQ(kValue1, db().GetValue(kTag1)); EXPECT_EQ(1U, db().MetadataChangeCount()); EXPECT_EQ(kUncommittedVersion, db().GetMetadata(kTag1).server_version()); - ExpectCommitRequests({kTag1}); - ExpectNthCommitRequestList(0, kTag1, kValue1); + worker()->ExpectPendingCommits({kTag1}); + worker()->ExpectNthPendingCommit(0, kTag1, kValue1); // Changes match doesn't call ResolveConflict. - UpdateFromServer(5, kTag1, kValue1); + worker()->UpdateFromServer(kTag1, kValue1); // Updated metadata but not data; no new commit request. EXPECT_EQ(1U, db().DataChangeCount()); - EXPECT_EQ(5, db().GetMetadata(kTag1).server_version()); - ExpectCommitRequests({kTag1}); + EXPECT_EQ(1, db().GetMetadata(kTag1).server_version()); + worker()->ExpectPendingCommits({kTag1}); } TEST_F(SharedModelTypeProcessorTest, ConflictResolutionUseLocal) { @@ -1199,28 +1091,28 @@ WriteItem(kTag1, kValue1); SetConflictResolution(ConflictResolution::UseLocal()); - UpdateFromServer(5, kTag1, kValue2); + worker()->UpdateFromServer(kTag1, kValue2); // Updated metadata but not data; new commit request. EXPECT_EQ(1U, db().DataChangeCount()); EXPECT_EQ(2U, db().MetadataChangeCount()); - EXPECT_EQ(5, db().GetMetadata(kTag1).server_version()); - ExpectCommitRequests({kTag1, kTag1}); - ExpectNthCommitRequestList(1, kTag1, kValue1); + EXPECT_EQ(1, db().GetMetadata(kTag1).server_version()); + worker()->ExpectPendingCommits({kTag1, kTag1}); + worker()->ExpectNthPendingCommit(1, kTag1, kValue1); } TEST_F(SharedModelTypeProcessorTest, ConflictResolutionUseRemote) { InitializeToReadyState(); WriteItem(kTag1, kValue1); SetConflictResolution(ConflictResolution::UseRemote()); - UpdateFromServer(5, kTag1, kValue2); + worker()->UpdateFromServer(kTag1, kValue2); // Updated client data and metadata; no new commit request. EXPECT_EQ(2U, db().DataChangeCount()); EXPECT_EQ(kValue2, db().GetValue(kTag1)); EXPECT_EQ(2U, db().MetadataChangeCount()); - EXPECT_EQ(5, db().GetMetadata(kTag1).server_version()); - ExpectCommitRequests({kTag1}); + EXPECT_EQ(1, db().GetMetadata(kTag1).server_version()); + worker()->ExpectPendingCommits({kTag1}); } TEST_F(SharedModelTypeProcessorTest, ConflictResolutionUseNew) { @@ -1229,13 +1121,13 @@ SetConflictResolution( ConflictResolution::UseNew(GenerateEntityData(kTag1, kValue3))); - UpdateFromServer(5, kTag1, kValue2); + worker()->UpdateFromServer(kTag1, kValue2); EXPECT_EQ(2U, db().DataChangeCount()); EXPECT_EQ(kValue3, db().GetValue(kTag1)); EXPECT_EQ(2U, db().MetadataChangeCount()); - EXPECT_EQ(5, db().GetMetadata(kTag1).server_version()); - ExpectCommitRequests({kTag1, kTag1}); - ExpectNthCommitRequestList(1, kTag1, kValue3); + EXPECT_EQ(1, db().GetMetadata(kTag1).server_version()); + worker()->ExpectPendingCommits({kTag1, kTag1}); + worker()->ExpectNthPendingCommit(1, kTag1, kValue3); } // Test proper handling of disconnect and reconnect. @@ -1250,7 +1142,7 @@ // The second item has a commit request in progress. WriteItem(kTag2, kValue2); - EXPECT_TRUE(HasCommitRequestForTag(kTag2)); + EXPECT_TRUE(worker()->HasPendingCommitForTag(kTag2)); DisconnectSync(); @@ -1260,17 +1152,17 @@ // Reconnect. OnSyncStarting(); - EXPECT_EQ(1U, GetNumCommitRequestLists()); - EXPECT_EQ(2U, GetNthCommitRequestList(0).size()); + EXPECT_EQ(1U, worker()->GetNumPendingCommits()); + EXPECT_EQ(2U, worker()->GetNthPendingCommit(0).size()); // The first item was already in sync. - EXPECT_FALSE(HasCommitRequestForTag(kTag1)); + EXPECT_FALSE(worker()->HasPendingCommitForTag(kTag1)); // The second item's commit was interrupted and should be retried. - EXPECT_TRUE(HasCommitRequestForTag(kTag2)); + EXPECT_TRUE(worker()->HasPendingCommitForTag(kTag2)); // The third item's commit was not started until the reconnect. - EXPECT_TRUE(HasCommitRequestForTag(kTag3)); + EXPECT_TRUE(worker()->HasPendingCommitForTag(kTag3)); } // Test proper handling of disable and re-enable. @@ -1285,7 +1177,7 @@ // The second item has a commit request in progress. WriteItem(kTag2, kValue2); - EXPECT_TRUE(HasCommitRequestForTag(kTag2)); + EXPECT_TRUE(worker()->HasPendingCommitForTag(kTag2)); DisableSync(); @@ -1300,7 +1192,7 @@ // Once we're ready to commit, all three local items should consider // themselves uncommitted and pending for commit. - ExpectCommitRequests({kTag1, kTag2, kTag3}); + worker()->ExpectPendingCommits({kTag1, kTag2, kTag3}); } // Test re-encrypt everything when desired encryption key changes. @@ -1311,23 +1203,23 @@ WriteItemAndAck(kTag1, kValue1); // Create another item and don't wait for its commit response. WriteItem(kTag2, kValue2); - ExpectCommitRequests({kTag1, kTag2}); + worker()->ExpectPendingCommits({kTag2}); EXPECT_EQ(1U, db().GetMetadata(kTag1).sequence_number()); EXPECT_EQ(1U, db().GetMetadata(kTag2).sequence_number()); // Receive notice that the account's desired encryption key has changed. - UpdateDesiredEncryptionKey("k1"); + worker()->UpdateWithEncryptionKey("k1"); // Tag 2 is recommitted immediately because the data was in memory. - ASSERT_EQ(3U, GetNumCommitRequestLists()); - ExpectNthCommitRequestList(2, kTag2, kValue2); + ASSERT_EQ(2U, worker()->GetNumPendingCommits()); + worker()->ExpectNthPendingCommit(1, kTag2, kValue2); // Sequence numbers in the store are updated. EXPECT_EQ(2U, db().GetMetadata(kTag1).sequence_number()); EXPECT_EQ(2U, db().GetMetadata(kTag2).sequence_number()); // Tag 1 needs to go to the store to load its data before recommitting. OnPendingCommitDataLoaded(); - ASSERT_EQ(4U, GetNumCommitRequestLists()); - ExpectNthCommitRequestList(3, kTag1, kValue1); + ASSERT_EQ(3U, worker()->GetNumPendingCommits()); + worker()->ExpectNthPendingCommit(2, kTag1, kValue1); } // Test receipt of updates with new and old keys. @@ -1335,80 +1227,79 @@ InitializeToReadyState(); // Receive an unencrypted update. - UpdateFromServer(1, kTag1, kValue1); - ASSERT_EQ(0U, GetNumCommitRequestLists()); + worker()->UpdateFromServer(kTag1, kValue1); + ASSERT_EQ(0U, worker()->GetNumPendingCommits()); - // Set desired encryption key to k2 to force updates to some items. - sync_pb::DataTypeState data_type_state(db().data_type_state()); - data_type_state.set_encryption_key_name("k2"); - UpdateResponseDataList updates; + UpdateResponseDataList update; // Receive an entity with old encryption as part of the update. - updates.push_back(GenerateUpdateData(kTag2, kValue2, "k1")); + update.push_back(worker()->GenerateUpdateData(kTag2, kValue2, 1, "k1")); // Receive an entity with up-to-date encryption as part of the update. - updates.push_back(GenerateUpdateData(kTag3, kValue3, "k2")); - type_processor()->OnUpdateReceived(data_type_state, updates); + update.push_back(worker()->GenerateUpdateData(kTag3, kValue3, 1, "k2")); + // Set desired encryption key to k2 to force updates to some items. + worker()->UpdateWithEncryptionKey("k2", update); // kTag2 needed to be re-encrypted and had data so it was queued immediately. - ExpectCommitRequests({kTag2}); + worker()->ExpectPendingCommits({kTag2}); OnPendingCommitDataLoaded(); // kTag1 needed data so once that's loaded, it is also queued. - ExpectCommitRequests({kTag2, kTag1}); + worker()->ExpectPendingCommits({kTag2, kTag1}); // Receive a separate update that was encrypted with key k1. - SetServerEncryptionKey("k1"); - UpdateFromServer(10, "enc_k1", kValue1); + worker()->UpdateFromServer("enc_k1", kValue1, 1, "k1"); // Receipt of updates encrypted with old key also forces a re-encrypt commit. - ExpectCommitRequests({kTag2, kTag1, "enc_k1"}); + worker()->ExpectPendingCommits({kTag2, kTag1, "enc_k1"}); // Receive an update that was encrypted with key k2. - SetServerEncryptionKey("k2"); - UpdateFromServer(15, "enc_k2", kValue1); + worker()->UpdateFromServer("enc_k2", kValue1, 1, "k2"); // That was the correct key, so no re-encryption is required. - ExpectCommitRequests({kTag2, kTag1, "enc_k1"}); + worker()->ExpectPendingCommits({kTag2, kTag1, "enc_k1"}); } // Test that re-encrypting enqueues the right data for USE_LOCAL conflicts. TEST_F(SharedModelTypeProcessorTest, ReEncryptConflictResolutionUseLocal) { InitializeToReadyState(); - UpdateDesiredEncryptionKey("k1"); + worker()->UpdateWithEncryptionKey("k1"); WriteItem(kTag1, kValue1); - ExpectCommitRequests({kTag1}); + worker()->ExpectPendingCommits({kTag1}); SetConflictResolution(ConflictResolution::UseLocal()); - UpdateFromServer(5, kTag1, kValue2); + // Unencrypted update needs to be re-commited with key k1. + worker()->UpdateFromServer(kTag1, kValue2, 1, ""); // Ensure the re-commit has the correct value. - EXPECT_EQ(2U, GetNumCommitRequestLists()); - ExpectNthCommitRequestList(1, kTag1, kValue1); + EXPECT_EQ(2U, worker()->GetNumPendingCommits()); + worker()->ExpectNthPendingCommit(1, kTag1, kValue1); } // Test that re-encrypting enqueues the right data for USE_REMOTE conflicts. TEST_F(SharedModelTypeProcessorTest, ReEncryptConflictResolutionUseRemote) { InitializeToReadyState(); - UpdateDesiredEncryptionKey("k1"); + worker()->UpdateWithEncryptionKey("k1"); WriteItem(kTag1, kValue1); SetConflictResolution(ConflictResolution::UseRemote()); - UpdateFromServer(5, kTag1, kValue2); + // Unencrypted update needs to be re-commited with key k1. + worker()->UpdateFromServer(kTag1, kValue2, 1, ""); // Ensure the re-commit has the correct value. - EXPECT_EQ(2U, GetNumCommitRequestLists()); - ExpectNthCommitRequestList(1, kTag1, kValue2); + EXPECT_EQ(2U, worker()->GetNumPendingCommits()); + worker()->ExpectNthPendingCommit(1, kTag1, kValue2); } // Test that re-encrypting enqueues the right data for USE_NEW conflicts. TEST_F(SharedModelTypeProcessorTest, ReEncryptConflictResolutionUseNew) { InitializeToReadyState(); - UpdateDesiredEncryptionKey("k1"); + worker()->UpdateWithEncryptionKey("k1"); WriteItem(kTag1, kValue1); SetConflictResolution( ConflictResolution::UseNew(GenerateEntityData(kTag1, kValue3))); - UpdateFromServer(5, kTag1, kValue2); + // Unencrypted update needs to be re-commited with key k1. + worker()->UpdateFromServer(kTag1, kValue2, 1, ""); // Ensure the re-commit has the correct value. - EXPECT_EQ(2U, GetNumCommitRequestLists()); - ExpectNthCommitRequestList(1, kTag1, kValue3); + EXPECT_EQ(2U, worker()->GetNumPendingCommits()); + worker()->ExpectNthPendingCommit(1, kTag1, kValue3); } // TODO(maxbogue): Fix this case (crbug.com/561814). @@ -1417,15 +1308,16 @@ // Create item and ack so its data is no longer cached. WriteItemAndAck(kTag1, kValue1); // Update key so that it needs to fetch data to re-commit. - UpdateDesiredEncryptionKey("k1"); + worker()->UpdateWithEncryptionKey("k1"); SetConflictResolution(ConflictResolution::UseLocal()); - UpdateFromServer(5, kTag1, kValue2); + // Unencrypted update needs to be re-commited with key k1. + worker()->UpdateFromServer(kTag1, kValue2, 1, ""); OnPendingCommitDataLoaded(); // Ensure the re-commit has the correct value. - EXPECT_EQ(2U, GetNumCommitRequestLists()); - ExpectNthCommitRequestList(1, kTag1, kValue1); + EXPECT_EQ(2U, worker()->GetNumPendingCommits()); + worker()->ExpectNthPendingCommit(1, kTag1, kValue1); } } // namespace syncer_v2
diff --git a/sync/sync_tests.gypi b/sync/sync_tests.gypi index 06085de..f98f1684 100644 --- a/sync/sync_tests.gypi +++ b/sync/sync_tests.gypi
@@ -41,12 +41,12 @@ 'test/engine/fake_model_worker.h', 'test/engine/fake_sync_scheduler.cc', 'test/engine/fake_sync_scheduler.h', - 'test/engine/mock_commit_queue.cc', - 'test/engine/mock_commit_queue.h', 'test/engine/mock_connection_manager.cc', 'test/engine/mock_connection_manager.h', 'test/engine/mock_model_type_processor.cc', 'test/engine/mock_model_type_processor.h', + 'test/engine/mock_model_type_worker.cc', + 'test/engine/mock_model_type_worker.h', 'test/engine/mock_nudge_handler.cc', 'test/engine/mock_nudge_handler.h', 'test/engine/mock_update_handler.cc',
diff --git a/sync/test/engine/mock_commit_queue.cc b/sync/test/engine/mock_commit_queue.cc deleted file mode 100644 index 1cf4f2bf..0000000 --- a/sync/test/engine/mock_commit_queue.cc +++ /dev/null
@@ -1,182 +0,0 @@ -// Copyright 2014 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 "sync/test/engine/mock_commit_queue.h" - -#include <stddef.h> -#include <stdint.h> - -#include "base/logging.h" - -namespace syncer_v2 { - -MockCommitQueue::MockCommitQueue() { -} - -MockCommitQueue::~MockCommitQueue() { -} - -void MockCommitQueue::EnqueueForCommit( - const CommitRequestDataList& list) { - commit_request_lists_.push_back(list); -} - -size_t MockCommitQueue::GetNumCommitRequestLists() const { - return commit_request_lists_.size(); -} - -CommitRequestDataList MockCommitQueue::GetNthCommitRequestList( - size_t n) const { - DCHECK_LT(n, GetNumCommitRequestLists()); - return commit_request_lists_[n]; -} - -bool MockCommitQueue::HasCommitRequestForTagHash( - const std::string& tag_hash) const { - // Iterate backward through the sets of commit requests to find the most - // recent one that applies to the specified tag_hash. - for (std::vector<CommitRequestDataList>::const_reverse_iterator lists_it = - commit_request_lists_.rbegin(); - lists_it != commit_request_lists_.rend(); ++lists_it) { - for (CommitRequestDataList::const_iterator it = lists_it->begin(); - it != lists_it->end(); ++it) { - if (it->entity->client_tag_hash == tag_hash) { - return true; - } - } - } - - return false; -} - -CommitRequestData MockCommitQueue::GetLatestCommitRequestForTagHash( - const std::string& tag_hash) const { - // Iterate backward through the sets of commit requests to find the most - // recent one that applies to the specified tag_hash. - for (std::vector<CommitRequestDataList>::const_reverse_iterator lists_it = - commit_request_lists_.rbegin(); - lists_it != commit_request_lists_.rend(); ++lists_it) { - for (CommitRequestDataList::const_iterator it = lists_it->begin(); - it != lists_it->end(); ++it) { - if (it->entity->client_tag_hash == tag_hash) { - return *it; - } - } - } - - NOTREACHED() << "Could not find commit for tag hash " << tag_hash << "."; - return CommitRequestData(); -} - -UpdateResponseData MockCommitQueue::UpdateFromServer( - int64_t version_offset, - const std::string& tag_hash, - const sync_pb::EntitySpecifics& specifics) { - // Overwrite the existing server version if this is the new highest version. - int64_t old_version = GetServerVersion(tag_hash); - int64_t version = old_version + version_offset; - if (version > old_version) { - SetServerVersion(tag_hash, version); - } - - EntityData data; - data.id = GenerateId(tag_hash); - data.client_tag_hash = tag_hash; - data.specifics = specifics; - // These elements should have no effect on behavior, but we set them anyway - // so we can test they are properly copied around the system if we want to. - data.creation_time = base::Time::UnixEpoch() + base::TimeDelta::FromDays(1); - data.modification_time = - data.creation_time + base::TimeDelta::FromSeconds(version); - data.non_unique_name = specifics.preference().name(); - - UpdateResponseData response_data; - response_data.entity = data.PassToPtr(); - response_data.response_version = version; - response_data.encryption_key_name = server_encryption_key_name_; - - return response_data; -} - -UpdateResponseData MockCommitQueue::TombstoneFromServer( - int64_t version_offset, - const std::string& tag_hash) { - int64_t old_version = GetServerVersion(tag_hash); - int64_t version = old_version + version_offset; - if (version > old_version) { - SetServerVersion(tag_hash, version); - } - - EntityData data; - data.id = GenerateId(tag_hash); - data.client_tag_hash = tag_hash; - // These elements should have no effect on behavior, but we set them anyway - // so we can test they are properly copied around the system if we want to. - data.creation_time = base::Time::UnixEpoch() + base::TimeDelta::FromDays(1); - data.modification_time = - data.creation_time + base::TimeDelta::FromSeconds(version); - data.non_unique_name = "Name Non Unique"; - - UpdateResponseData response_data; - response_data.entity = data.PassToPtr(); - response_data.response_version = version; - response_data.encryption_key_name = server_encryption_key_name_; - - return response_data; -} - -CommitResponseData MockCommitQueue::SuccessfulCommitResponse( - const CommitRequestData& request_data) { - const EntityData& entity = request_data.entity.value(); - const std::string& client_tag_hash = entity.client_tag_hash; - - CommitResponseData response_data; - - if (request_data.base_version == 0) { - // Server assigns new ID to newly committed items. - DCHECK(entity.id.empty()); - response_data.id = entity.id; - } else { - // Otherwise we reuse the ID from the request. - response_data.id = GenerateId(client_tag_hash); - } - - response_data.client_tag_hash = client_tag_hash; - response_data.sequence_number = request_data.sequence_number; - - // Increment the server version on successful commit. - int64_t version = GetServerVersion(client_tag_hash); - version++; - SetServerVersion(client_tag_hash, version); - - response_data.response_version = version; - - return response_data; -} - -void MockCommitQueue::SetServerEncryptionKey( - const std::string& key_name) { - server_encryption_key_name_ = key_name; -} - -std::string MockCommitQueue::GenerateId(const std::string& tag_hash) { - return "FakeId:" + tag_hash; -} - -int64_t MockCommitQueue::GetServerVersion(const std::string& tag_hash) { - std::map<const std::string, int64_t>::const_iterator it; - it = server_versions_.find(tag_hash); - if (it == server_versions_.end()) { - return 0; - } else { - return it->second; - } -} - -void MockCommitQueue::SetServerVersion(const std::string& tag_hash, - int64_t version) { - server_versions_[tag_hash] = version; -} - -} // namespace syncer_v2
diff --git a/sync/test/engine/mock_commit_queue.h b/sync/test/engine/mock_commit_queue.h deleted file mode 100644 index f217183d..0000000 --- a/sync/test/engine/mock_commit_queue.h +++ /dev/null
@@ -1,93 +0,0 @@ -// Copyright 2014 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 SYNC_TEST_ENGINE_MOCK_COMMIT_QUEUE_H_ -#define SYNC_TEST_ENGINE_MOCK_COMMIT_QUEUE_H_ - -#include <stddef.h> -#include <stdint.h> - -#include <map> -#include <string> -#include <vector> - -#include "base/macros.h" -#include "sync/engine/commit_queue.h" -#include "sync/internal_api/public/non_blocking_sync_common.h" - -namespace syncer_v2 { - -// Receives and records commit requests sent through the CommitQueue. -// -// This class also includes features intended to help mock out server behavior. -// It has some basic functionality to keep track of server state and generate -// plausible UpdateResponseData and CommitResponseData messages. -class MockCommitQueue : public CommitQueue { - public: - MockCommitQueue(); - ~MockCommitQueue() override; - - // Implementation of CommitQueue. - void EnqueueForCommit(const CommitRequestDataList& list) override; - - // Getters to inspect the requests sent to this object. - size_t GetNumCommitRequestLists() const; - CommitRequestDataList GetNthCommitRequestList(size_t n) const; - bool HasCommitRequestForTagHash(const std::string& tag_hash) const; - CommitRequestData GetLatestCommitRequestForTagHash( - const std::string& tag_hash) const; - - // Functions to produce state as though it came from a real server and had - // been filtered through a real CommitQueue. - - // Returns an UpdateResponseData representing an update received from - // the server. Updates server state accordingly. - // - // The |version_offset| field can be used to emulate stale data (ie. versions - // going backwards), reflections and redeliveries (ie. several instances of - // the same version) or new updates. - UpdateResponseData UpdateFromServer( - int64_t version_offset, - const std::string& tag_hash, - const sync_pb::EntitySpecifics& specifics); - - // Returns an UpdateResponseData representing a tombstone update from the - // server. Updates server state accordingly. - UpdateResponseData TombstoneFromServer(int64_t version_offset, - const std::string& tag_hash); - - // Returns a commit response that indicates a successful commit of the - // given |request_data|. Updates server state accordingly. - CommitResponseData SuccessfulCommitResponse( - const CommitRequestData& request_data); - - // Sets the encryption key name used for updates from the server. - // (ie. the key other clients are using to encrypt their commits.) - // The default value is an empty string, which indicates no encryption. - void SetServerEncryptionKey(const std::string& key_name); - - private: - // Generate an ID string. - static std::string GenerateId(const std::string& tag_hash); - - // Retrieve or set the server version. - int64_t GetServerVersion(const std::string& tag_hash); - void SetServerVersion(const std::string& tag_hash, int64_t version); - - // A record of past commits requests. - std::vector<CommitRequestDataList> commit_request_lists_; - - // Map of versions by client tag. - // This is an essential part of the mocked server state. - std::map<const std::string, int64_t> server_versions_; - - // Name of the encryption key in use on other clients. - std::string server_encryption_key_name_; - - DISALLOW_COPY_AND_ASSIGN(MockCommitQueue); -}; - -} // namespace syncer_v2 - -#endif // SYNC_TEST_ENGINE_MOCK_COMMIT_QUEUE_H_
diff --git a/sync/test/engine/mock_model_type_worker.cc b/sync/test/engine/mock_model_type_worker.cc new file mode 100644 index 0000000..4aabfd3 --- /dev/null +++ b/sync/test/engine/mock_model_type_worker.cc
@@ -0,0 +1,250 @@ +// Copyright 2014 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 "sync/test/engine/mock_model_type_worker.h" + +#include <stddef.h> +#include <stdint.h> + +#include "base/logging.h" +#include "sync/internal_api/public/base/model_type.h" +#include "sync/syncable/syncable_util.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace syncer_v2 { + +namespace { + +std::string GenerateTagHash(const std::string& tag) { + return syncer::syncable::GenerateSyncableHash(syncer::PREFERENCES, tag); +} + +sync_pb::EntitySpecifics GenerateSpecifics(const std::string& tag, + const std::string& value) { + sync_pb::EntitySpecifics specifics; + specifics.mutable_preference()->set_name(tag); + specifics.mutable_preference()->set_value(value); + return specifics; +} + +} // namespace + +MockModelTypeWorker::MockModelTypeWorker( + const sync_pb::DataTypeState& data_type_state, + ModelTypeProcessor* processor) + : data_type_state_(data_type_state), processor_(processor) {} + +MockModelTypeWorker::~MockModelTypeWorker() {} + +void MockModelTypeWorker::EnqueueForCommit(const CommitRequestDataList& list) { + pending_commits_.push_back(list); +} + +size_t MockModelTypeWorker::GetNumPendingCommits() const { + return pending_commits_.size(); +} + +CommitRequestDataList MockModelTypeWorker::GetNthPendingCommit(size_t n) const { + DCHECK_LT(n, GetNumPendingCommits()); + return pending_commits_[n]; +} + +bool MockModelTypeWorker::HasPendingCommitForTag(const std::string& tag) const { + const std::string tag_hash = GenerateTagHash(tag); + for (const CommitRequestDataList& commit : pending_commits_) { + for (const CommitRequestData& data : commit) { + if (data.entity->client_tag_hash == tag_hash) { + return true; + } + } + } + return false; +} + +CommitRequestData MockModelTypeWorker::GetLatestPendingCommitForTag( + const std::string& tag) const { + const std::string tag_hash = GenerateTagHash(tag); + // Iterate backward through the sets of commit requests to find the most + // recent one that applies to the specified tag_hash. + for (auto rev_it = pending_commits_.rbegin(); + rev_it != pending_commits_.rend(); ++rev_it) { + for (const CommitRequestData& data : *rev_it) { + if (data.entity->client_tag_hash == tag_hash) { + return data; + } + } + } + NOTREACHED() << "Could not find commit for tag hash " << tag_hash << "."; + return CommitRequestData(); +} + +void MockModelTypeWorker::ExpectNthPendingCommit(size_t n, + const std::string& tag, + const std::string& value) { + const CommitRequestDataList& list = GetNthPendingCommit(n); + ASSERT_EQ(1U, list.size()); + const EntityData& data = list[0].entity.value(); + EXPECT_EQ(GenerateTagHash(tag), data.client_tag_hash); + EXPECT_EQ(value, data.specifics.preference().value()); +} + +void MockModelTypeWorker::ExpectPendingCommits( + const std::vector<std::string>& tags) { + EXPECT_EQ(tags.size(), GetNumPendingCommits()); + for (size_t i = 0; i < tags.size(); i++) { + const CommitRequestDataList& commits = GetNthPendingCommit(i); + EXPECT_EQ(1U, commits.size()); + EXPECT_EQ(GenerateTagHash(tags[i]), commits[0].entity->client_tag_hash) + << "Hash for tag " << tags[i] << " doesn't match."; + } +} + +void MockModelTypeWorker::UpdateFromServer(const std::string& tag, + const std::string& value) { + UpdateFromServer(tag, value, 1); +} + +void MockModelTypeWorker::UpdateFromServer(const std::string& tag, + const std::string& value, + int64_t version_offset) { + UpdateFromServer(tag, value, version_offset, + data_type_state_.encryption_key_name()); +} + +void MockModelTypeWorker::UpdateFromServer(const std::string& tag, + const std::string& value, + int64_t version_offset, + const std::string& ekn) { + UpdateResponseDataList update; + update.push_back(GenerateUpdateData(tag, value, version_offset, ekn)); + processor_->OnUpdateReceived(data_type_state_, update); +} + +UpdateResponseData MockModelTypeWorker::GenerateUpdateData( + const std::string& tag, + const std::string& value, + int64_t version_offset, + const std::string& ekn) { + const std::string tag_hash = GenerateTagHash(tag); + // Overwrite the existing server version if this is the new highest version. + int64_t old_version = GetServerVersion(tag_hash); + int64_t version = old_version + version_offset; + if (version > old_version) { + SetServerVersion(tag_hash, version); + } + + EntityData data; + data.id = GenerateId(tag_hash); + data.client_tag_hash = tag_hash; + data.specifics = GenerateSpecifics(tag, value); + // These elements should have no effect on behavior, but we set them anyway + // so we can test they are properly copied around the system if we want to. + data.creation_time = base::Time::UnixEpoch() + base::TimeDelta::FromDays(1); + data.modification_time = + data.creation_time + base::TimeDelta::FromSeconds(version); + data.non_unique_name = data.specifics.preference().name(); + + UpdateResponseData response_data; + response_data.entity = data.PassToPtr(); + response_data.response_version = version; + response_data.encryption_key_name = ekn; + + return response_data; +} + +void MockModelTypeWorker::TombstoneFromServer(const std::string& tag) { + const std::string tag_hash = GenerateTagHash(tag); + int64_t old_version = GetServerVersion(tag_hash); + int64_t version = old_version + 1; + SetServerVersion(tag_hash, version); + + EntityData data; + data.id = GenerateId(tag_hash); + data.client_tag_hash = tag_hash; + // These elements should have no effect on behavior, but we set them anyway + // so we can test they are properly copied around the system if we want to. + data.creation_time = base::Time::UnixEpoch() + base::TimeDelta::FromDays(1); + data.modification_time = + data.creation_time + base::TimeDelta::FromSeconds(version); + data.non_unique_name = "Name Non Unique"; + + UpdateResponseData response_data; + response_data.entity = data.PassToPtr(); + response_data.response_version = version; + response_data.encryption_key_name = data_type_state_.encryption_key_name(); + + UpdateResponseDataList list; + list.push_back(response_data); + processor_->OnUpdateReceived(data_type_state_, list); +} + +void MockModelTypeWorker::AckOnePendingCommit() { + CommitResponseDataList list; + for (const CommitRequestData& data : pending_commits_.front()) { + list.push_back(SuccessfulCommitResponse(data)); + } + pending_commits_.pop_front(); + processor_->OnCommitCompleted(data_type_state_, list); +} + +CommitResponseData MockModelTypeWorker::SuccessfulCommitResponse( + const CommitRequestData& request_data) { + const EntityData& entity = request_data.entity.value(); + const std::string& client_tag_hash = entity.client_tag_hash; + + CommitResponseData response_data; + + if (request_data.base_version == 0) { + // Server assigns new ID to newly committed items. + DCHECK(entity.id.empty()); + response_data.id = entity.id; + } else { + // Otherwise we reuse the ID from the request. + response_data.id = GenerateId(client_tag_hash); + } + + response_data.client_tag_hash = client_tag_hash; + response_data.sequence_number = request_data.sequence_number; + + // Increment the server version on successful commit. + int64_t version = GetServerVersion(client_tag_hash); + version++; + SetServerVersion(client_tag_hash, version); + + response_data.response_version = version; + + return response_data; +} + +void MockModelTypeWorker::UpdateWithEncryptionKey(const std::string& ekn) { + UpdateWithEncryptionKey(ekn, UpdateResponseDataList()); +} + +void MockModelTypeWorker::UpdateWithEncryptionKey( + const std::string& ekn, + const UpdateResponseDataList& update) { + data_type_state_.set_encryption_key_name(ekn); + processor_->OnUpdateReceived(data_type_state_, update); +} + +std::string MockModelTypeWorker::GenerateId(const std::string& tag_hash) { + return "FakeId:" + tag_hash; +} + +int64_t MockModelTypeWorker::GetServerVersion(const std::string& tag_hash) { + std::map<const std::string, int64_t>::const_iterator it; + it = server_versions_.find(tag_hash); + if (it == server_versions_.end()) { + return 0; + } else { + return it->second; + } +} + +void MockModelTypeWorker::SetServerVersion(const std::string& tag_hash, + int64_t version) { + server_versions_[tag_hash] = version; +} + +} // namespace syncer_v2
diff --git a/sync/test/engine/mock_model_type_worker.h b/sync/test/engine/mock_model_type_worker.h new file mode 100644 index 0000000..b8499cf --- /dev/null +++ b/sync/test/engine/mock_model_type_worker.h
@@ -0,0 +1,123 @@ +// Copyright 2014 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 SYNC_TEST_ENGINE_MOCK_MODEL_TYPE_WORKER_H_ +#define SYNC_TEST_ENGINE_MOCK_MODEL_TYPE_WORKER_H_ + +#include <stddef.h> +#include <stdint.h> + +#include <deque> +#include <map> +#include <string> +#include <vector> + +#include "base/macros.h" +#include "sync/engine/commit_queue.h" +#include "sync/internal_api/public/model_type_processor.h" +#include "sync/internal_api/public/non_blocking_sync_common.h" +#include "sync/protocol/data_type_state.pb.h" + +namespace syncer_v2 { + +// Receives and records commit requests sent through the ModelTypeWorker. +// +// This class also includes features intended to help mock out server behavior. +// It has some basic functionality to keep track of server state and generate +// plausible UpdateResponseData and CommitResponseData messages. +class MockModelTypeWorker : public CommitQueue { + public: + MockModelTypeWorker(const sync_pb::DataTypeState& data_type_state, + ModelTypeProcessor* processor); + ~MockModelTypeWorker() override; + + // Implementation of ModelTypeWorker. + void EnqueueForCommit(const CommitRequestDataList& list) override; + + // Getters to inspect the requests sent to this object. + size_t GetNumPendingCommits() const; + CommitRequestDataList GetNthPendingCommit(size_t n) const; + bool HasPendingCommitForTag(const std::string& tag) const; + CommitRequestData GetLatestPendingCommitForTag(const std::string& tag) const; + + // Expect that the |n|th commit request list has one commit request for |tag| + // with |value| set. + void ExpectNthPendingCommit(size_t n, + const std::string& tag, + const std::string& value); + + // For each tag in |tags|, expect a corresponding request list of length one. + void ExpectPendingCommits(const std::vector<std::string>& tags); + + // Trigger an update from the server containing a single entity. See + // GenerateUpdateData for parameter descriptions. |version_offset| defaults to + // 1 and |ekn| defaults to the current encryption key name the worker has. + void UpdateFromServer(const std::string& tag, const std::string& value); + void UpdateFromServer(const std::string& tag, + const std::string& value, + int64_t version_offset); + void UpdateFromServer(const std::string& tag, + const std::string& value, + int64_t version_offset, + const std::string& ekn); + + // Returns an UpdateResponseData representing an update received from + // the server. Updates server state accordingly. |tag| is used to generate the + // tag hash and the specifics along with |value|. + // + // The |version_offset| field can be used to emulate stale data (ie. versions + // going backwards), reflections and redeliveries (ie. several instances of + // the same version) or new updates. + // + // |ekn| is the encryption key name this item will fake having. + UpdateResponseData GenerateUpdateData(const std::string& tag, + const std::string& value, + int64_t version_offset, + const std::string& ekn); + + // Triggers a server-side deletion of the entity with |tag|; updates server + // state accordingly. + void TombstoneFromServer(const std::string& tag); + + // Pops one pending commit from the front of the queue and send a commit + // response to the processor for it. + void AckOnePendingCommit(); + + // Set the encryption key to |ekn| and inform the processor with an update + // containing the data in |update|, which defaults to an empty list. + void UpdateWithEncryptionKey(const std::string& ekn); + void UpdateWithEncryptionKey(const std::string& ekn, + const UpdateResponseDataList& update); + + private: + // Generate an ID string. + static std::string GenerateId(const std::string& tag_hash); + + // Returns a commit response that indicates a successful commit of the + // given |request_data|. Updates server state accordingly. + CommitResponseData SuccessfulCommitResponse( + const CommitRequestData& request_data); + + // Retrieve or set the server version. + int64_t GetServerVersion(const std::string& tag_hash); + void SetServerVersion(const std::string& tag_hash, int64_t version); + + sync_pb::DataTypeState data_type_state_; + + // A pointer to the processor for this mock worker. + ModelTypeProcessor* processor_; + + // A record of past commits requests. + std::deque<CommitRequestDataList> pending_commits_; + + // Map of versions by client tag. + // This is an essential part of the mocked server state. + std::map<const std::string, int64_t> server_versions_; + + DISALLOW_COPY_AND_ASSIGN(MockModelTypeWorker); +}; + +} // namespace syncer_v2 + +#endif // SYNC_TEST_ENGINE_MOCK_MODEL_TYPE_WORKER_H_
diff --git a/testing/buildbot/chromium.android.json b/testing/buildbot/chromium.android.json index 31bef969..e353724 100644 --- a/testing/buildbot/chromium.android.json +++ b/testing/buildbot/chromium.android.json
@@ -16,8 +16,8 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { - "build.id": "KTU84P", - "product.board": "hammerhead" + "device_os": "KTU84P", + "device_type": "hammerhead" } ] }, @@ -28,8 +28,8 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { - "build.id": "KTU84P", - "product.board": "hammerhead" + "device_os": "KTU84P", + "device_type": "hammerhead" } ] },
diff --git a/testing/buildbot/chromium.fyi.json b/testing/buildbot/chromium.fyi.json index fcf83c2..afeab78 100644 --- a/testing/buildbot/chromium.fyi.json +++ b/testing/buildbot/chromium.fyi.json
@@ -1109,6 +1109,139 @@ } ] }, + "Chromium Mac 10.10 MacViews": { + "gtest_tests": [ + { + "test": "accessibility_unittests" + }, + { + "test": "app_list_unittests" + }, + { + "test": "base_unittests" + }, + { + "test": "browser_tests" + }, + { + "test": "cacheinvalidation_unittests" + }, + { + "test": "cast_unittests" + }, + { + "test": "cc_unittests" + }, + { + "test": "chromedriver_unittests" + }, + { + "test": "components_unittests" + }, + { + "test": "content_browsertests" + }, + { + "test": "content_unittests" + }, + { + "test": "crypto_unittests" + }, + { + "test": "extensions_unittests" + }, + { + "test": "gcm_unit_tests" + }, + { + "test": "gfx_unittests" + }, + { + "test": "google_apis_unittests" + }, + { + "test": "gpu_unittests" + }, + { + "test": "interactive_ui_tests" + }, + { + "test": "ipc_tests" + }, + { + "test": "jingle_unittests" + }, + { + "test": "media_blink_unittests" + }, + { + "test": "media_unittests" + }, + { + "test": "message_center_unittests" + }, + { + "test": "midi_unittests" + }, + { + "test": "mojo_common_unittests" + }, + { + "test": "mojo_public_bindings_unittests" + }, + { + "swarming": { + "can_use_on_swarming_builders": true + }, + "test": "mojo_public_system_unittests" + }, + { + "test": "mojo_system_unittests" + }, + { + "test": "net_unittests" + }, + { + "test": "ppapi_unittests" + }, + { + "test": "printing_unittests" + }, + { + "test": "remoting_unittests" + }, + { + "test": "sandbox_mac_unittests" + }, + { + "test": "skia_unittests" + }, + { + "test": "sql_unittests" + }, + { + "test": "sync_integration_tests" + }, + { + "test": "sync_unit_tests" + }, + { + "test": "ui_base_unittests" + }, + { + "test": "unit_tests" + }, + { + "test": "url_unittests" + } + ], + "scripts": [ + { + "name": "nacl_integration", + "script": "nacl_integration.py" + } + ] + }, "Chromium Mac 10.11": { "gtest_tests": [ {
diff --git a/testing/buildbot/chromium.linux.json b/testing/buildbot/chromium.linux.json index 2f984f7..01bc6e7 100644 --- a/testing/buildbot/chromium.linux.json +++ b/testing/buildbot/chromium.linux.json
@@ -150,8 +150,8 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { - "build.id": "KTU84P", - "product.board": "hammerhead" + "device_os": "KTU84P", + "device_type": "hammerhead" } ], "hard_timeout": 960
diff --git a/testing/test.gni b/testing/test.gni index 84c51e3..8434fc5 100644 --- a/testing/test.gni +++ b/testing/test.gni
@@ -25,6 +25,7 @@ _output_name = invoker.output_name } + _test_runner_target = "${_output_name}__test_runner_script" _wrapper_script_vars = [ "isolate_file", "shard_timeout", @@ -105,6 +106,16 @@ install_script_name = "install_${invoker.output_name}" } deps += [ ":$_library_target" ] + + # TODO(agrieve): Remove this data_dep once bots don't build the _apk + # target (post-GYP). + # It's a bit backwards for the apk to depend on the runner script, since + # the apk is conceptually a runtime_dep of the script. However, it is + # currently necessary because the bots build this _apk target directly + # rather than the group() below. + data_deps = [ + ":$_test_runner_target", + ] } # Incremental test targets work only for .apks.
diff --git a/testing/variations/fieldtrial_testing_config_chromeos.json b/testing/variations/fieldtrial_testing_config_chromeos.json index 2bbe06b..07ad33b5 100644 --- a/testing/variations/fieldtrial_testing_config_chromeos.json +++ b/testing/variations/fieldtrial_testing_config_chromeos.json
@@ -43,6 +43,16 @@ "group_name": "Button" } ], + "EnableMediaRouter": [ + { + "group_name": "Enabled" + } + ], + "EnableMediaRouterWithCastExtension": [ + { + "group_name": "Enabled" + } + ], "ExtensionActionRedesign": [ { "group_name": "Enabled"
diff --git a/testing/variations/fieldtrial_testing_config_linux.json b/testing/variations/fieldtrial_testing_config_linux.json index 8426b085..96b6baa 100644 --- a/testing/variations/fieldtrial_testing_config_linux.json +++ b/testing/variations/fieldtrial_testing_config_linux.json
@@ -56,6 +56,16 @@ "group_name": "Button" } ], + "EnableMediaRouter": [ + { + "group_name": "Enabled" + } + ], + "EnableMediaRouterWithCastExtension": [ + { + "group_name": "Enabled" + } + ], "EnableSessionCrashedBubbleUI": [ { "group_name": "Enabled"
diff --git a/testing/variations/fieldtrial_testing_config_mac.json b/testing/variations/fieldtrial_testing_config_mac.json index 2359b27..b04d535 100644 --- a/testing/variations/fieldtrial_testing_config_mac.json +++ b/testing/variations/fieldtrial_testing_config_mac.json
@@ -62,6 +62,16 @@ "group_name": "Button" } ], + "EnableMediaRouter": [ + { + "group_name": "Enabled" + } + ], + "EnableMediaRouterWithCastExtension": [ + { + "group_name": "Enabled" + } + ], "ExtensionActionRedesign": [ { "group_name": "Enabled"
diff --git a/testing/variations/fieldtrial_testing_config_win.json b/testing/variations/fieldtrial_testing_config_win.json index 761424a..709c469 100644 --- a/testing/variations/fieldtrial_testing_config_win.json +++ b/testing/variations/fieldtrial_testing_config_win.json
@@ -77,6 +77,16 @@ "group_name": "Button" } ], + "EnableMediaRouter": [ + { + "group_name": "Enabled" + } + ], + "EnableMediaRouterWithCastExtension": [ + { + "group_name": "Enabled" + } + ], "EnableSessionCrashedBubbleUI": [ { "group_name": "Enabled"
diff --git a/third_party/WebKit/LayoutTests/ASANExpectations b/third_party/WebKit/LayoutTests/ASANExpectations index bbf9d12..fb79de5 100644 --- a/third_party/WebKit/LayoutTests/ASANExpectations +++ b/third_party/WebKit/LayoutTests/ASANExpectations
@@ -20,19 +20,6 @@ crbug.com/144118 [ Linux ] plugins/destroy-on-setwindow.html [ Skip ] -# heap-use-after-free in bluethooth notifications tests. http://crbug.com/604318 -#0 0xd038118 in size buildtools/third_party/libc++/trunk/include/vector:639:46 -#1 0xd038118 in size base/observer_list.h:114:0 -#2 0xd038118 in might_have_observers base/observer_list.h:232:0 -#3 0xd038118 in DoNotify device/bluetooth/test/mock_bluetooth_gatt_notify_session.cc:44:0 -crbug.com/604318 bluetooth/notifications/concurrent-starts.html [ Skip ] -crbug.com/604318 bluetooth/notifications/start-before-stop-resolves.html [ Skip ] -crbug.com/604318 bluetooth/notifications/add-listener-after-promise.html [ Skip ] -crbug.com/604318 bluetooth/notifications/gc-with-pending-start.html [ Skip ] -crbug.com/604318 bluetooth/notifications/start-twice-in-a-row.html [ Skip ] -crbug.com/604318 bluetooth/notifications/start-succeeds.html [ Skip ] - - # Use-after-free in NPP_DestroyStream, http://crbug.com/166932 # ==17332== ERROR: AddressSanitizer: heap-use-after-free on address 0x7f48e8a05a58 # WRITE of size 1 at 0x7f48e8a05a58 thread T0
diff --git a/third_party/WebKit/LayoutTests/MSANExpectations b/third_party/WebKit/LayoutTests/MSANExpectations index 8dd3cdb..eef8802 100644 --- a/third_party/WebKit/LayoutTests/MSANExpectations +++ b/third_party/WebKit/LayoutTests/MSANExpectations
@@ -21,14 +21,6 @@ crbug.com/420606 [ Linux ] virtual/slimmingpaint/fast/workers/worker-constructor.html [ Skip ] crbug.com/420606 [ Linux ] virtual/sharedarraybuffer/fast/workers/worker-constructor.html [ Skip ] -# heap-use-after-free in bluethooth notifications tests. http://crbug.com/604318 -crbug.com/604318 bluetooth/notifications/concurrent-starts.html [ Skip ] -crbug.com/604318 bluetooth/notifications/start-before-stop-resolves.html [ Skip ] -crbug.com/604318 bluetooth/notifications/add-listener-after-promise.html [ Skip ] -crbug.com/604318 bluetooth/notifications/gc-with-pending-start.html [ Skip ] -crbug.com/604318 bluetooth/notifications/start-twice-in-a-row.html [ Skip ] -crbug.com/604318 bluetooth/notifications/start-succeeds.html [ Skip ] - # Flaky under MSan (hang forever). crbug.com/422982 [ Linux ] virtual/threaded [ Skip ]
diff --git a/third_party/WebKit/LayoutTests/TestExpectations b/third_party/WebKit/LayoutTests/TestExpectations index b1f22232..5ed06ff 100644 --- a/third_party/WebKit/LayoutTests/TestExpectations +++ b/third_party/WebKit/LayoutTests/TestExpectations
@@ -49,13 +49,6 @@ # See also crbug.com/521730 for the these two text/emphasis tests (non-Oilpan) Win10 failures. crbug.com/574660 [ Win7 ] fast/text/emphasis-combined-text.html [ Pass Failure ] -# TODO(wangxianzhu): verify this after rebaseline for crbug.com/602483 -crbug.com/584211 [ Mac ] svg/transforms/animated-path-inside-transformed-html.xhtml [ Pass Failure ] - -# This test violates lifecycle assertions. -# Timeout because of crbug.com/603231 -crbug.com/372245 media/track/track-word-breaking.html [ Crash Timeout ] - # ====== Oilpan-only failures until here ====== # Run these tests with under virtual/spv2 only. @@ -431,12 +424,9 @@ crbug.com/600618 virtual/spv2/svg/custom/object-sizing-explicit-height.xhtml [ Pass ] crbug.com/600618 virtual/spv2/svg/custom/object-sizing-explicit-width-height.xhtml [ Pass ] crbug.com/600618 virtual/spv2/svg/custom/object-sizing-explicit-width.xhtml [ Pass ] -# TODO(wangxianzhu): restore this after rebaseline -#crbug.com/600618 virtual/spv2/svg/custom/object-sizing-no-width-height-change-content-box-size.xhtml [ Pass ] -crbug.com/600618 virtual/spv2/svg/custom/object-sizing-no-width-height-change-content-box-size.xhtml [ NeedsManualRebaseline ] +crbug.com/600618 virtual/spv2/svg/custom/object-sizing-no-width-height-change-content-box-size.xhtml [ Pass ] crbug.com/600618 virtual/spv2/svg/custom/svg-root-padding-left.html [ Pass ] crbug.com/600618 virtual/spv2/svg/custom/svg-root-padding-top.html [ Pass ] -crbug.com/600618 virtual/spv2/svg/custom/viewport-em.svg [ Pass ] crbug.com/600618 virtual/spv2/svg/css/border-image-zoomed.html [ Pass ] crbug.com/600618 virtual/spv2/svg/css/max-height.html [ Pass ] crbug.com/600618 virtual/spv2/svg/css/max-width.html [ Pass ] @@ -1257,14 +1247,10 @@ crbug.com/577380 [ Linux Debug ] http/tests/serviceworker/chromium/registration-stress.html [ Failure ] crbug.com/581038 fast/text/first-letter-bad-line-boxes-crash.html [ Crash Pass ] -crbug.com/442484 fast/forms/range/range-appearance-basic.html [ NeedsManualRebaseline ] crbug.com/587136 [ Linux Debug ] http/tests/security/xss-DENIED-cross-origin-stack-overflow.html [ Timeout Pass ] crbug.com/587593 [ Android ] fast/js/pic/cached-single-entry-transition.html [ Pass Failure ] -# TODO(wangxianzhu): Examine bot result. -crbug.com/602614 svg/carto.net/tabgroup.svg [ Pass Failure ] - crbug.com/587779 [ Linux Mac10.10 Mac10.11 Retina ] fast/dynamic/window-resize-scrollbars-test.html [ Timeout Failure Pass ] crbug.com/588103 fast/xmlhttprequest/xmlhttprequest-responsetype-arraybuffer.html [ Pass Failure ] @@ -1305,6 +1291,10 @@ crbug.com/587737 [ Mac10.11 Retina ] virtual/gpu-rasterization/fast/images/color-profile-filter.html [ Timeout Failure ] +crbug.com/602933 fast/canvas/canvas-incremental-repaint.html [ NeedsManualRebaseline ] +crbug.com/602933 virtual/gpu/fast/canvas/canvas-incremental-repaint.html [ NeedsManualRebaseline ] +crbug.com/602933 virtual/display_list_2d_canvas/fast/canvas/canvas-incremental-repaint.html [ NeedsManualRebaseline ] + crbug.com/599975 [ Android ] media/video-autoplay.html [ Timeout ] # DocumentWriteEvaluator is still experimental @@ -1440,7 +1430,6 @@ crbug.com/601166 [ Mac10.9 ] fast/text/line-breaks-after-white-space.html [ Failure ] crbug.com/601166 [ Mac10.9 ] fast/text/line-breaks.html [ Failure ] crbug.com/601166 [ Mac10.9 ] fast/text/line-initial-and-final-swashes.html [ Failure ] -crbug.com/601166 [ Mac10.9 ] fast/text/midword-break-after-breakable-char.html [ Failure ] crbug.com/601166 [ Mac10.9 ] fast/text/midword-break-before-surrogate-pair.html [ Failure ] crbug.com/601166 [ Mac10.9 ] fast/text/midword-break-hang.html [ Failure ] crbug.com/601166 [ Mac10.9 ] fast/text/monospace-width-cache.html [ Failure ] @@ -1510,17 +1499,1217 @@ crbug.com/601166 [ Mac10.9 ] fast/text/zero-font-size.html [ Failure ] crbug.com/601166 [ Mac10.9 ] ietestcenter/css3/text/textshadow-003.htm [ Failure ] crbug.com/601166 [ Mac10.9 ] ietestcenter/css3/text/textshadow-004.htm [ Failure ] +crbug.com/601166 [ Mac10.9 ] svg/transforms/animated-path-inside-transformed-html.xhtml [ Failure ] crbug.com/600261 imported/web-platform-tests/mediacapture-streams/GUM-deny.html [ Failure ] crbug.com/600261 imported/web-platform-tests/mediacapture-streams/MediaStream-MediaElement-srcObject.html [ Failure ] +Bug(eae) compositing/compositing-visible-descendant.html [ NeedsManualRebaseline ] +Bug(eae) compositing/geometry/abs-position-inside-opacity.html [ NeedsManualRebaseline ] +Bug(eae) compositing/geometry/partial-layout-update.html [ NeedsManualRebaseline ] +Bug(eae) compositing/geometry/transfrom-origin-on-zero-size-layer.html [ NeedsManualRebaseline ] +Bug(eae) compositing/iframes/composited-iframe-alignment.html [ NeedsManualRebaseline ] +Bug(eae) compositing/iframes/iframe-copy-on-scroll.html [ NeedsManualRebaseline ] +Bug(eae) compositing/layers-inside-overflow-scroll.html [ NeedsManualRebaseline ] +Bug(eae) compositing/overflow/nested-scrolling.html [ NeedsManualRebaseline ] +Bug(eae) compositing/overflow/remove-overflow-crash2.html [ NeedsManualRebaseline ] +Bug(eae) compositing/overflow/scroll-ancestor-update.html [ NeedsManualRebaseline ] +Bug(eae) compositing/reflections/compositing-change-inside-reflection.html [ NeedsManualRebaseline ] +Bug(eae) compositing/reflections/load-video-in-reflection.html [ NeedsManualRebaseline ] +Bug(eae) compositing/reflections/reflection-in-composited.html [ NeedsManualRebaseline ] +Bug(eae) compositing/reflections/reflection-opacity.html [ NeedsManualRebaseline ] +Bug(eae) compositing/reflections/reflection-positioning2.html [ NeedsManualRebaseline ] +Bug(eae) compositing/reflections/reflection-positioning.html [ NeedsManualRebaseline ] +Bug(eae) compositing/reflections/transform-inside-reflection.html [ NeedsManualRebaseline ] +Bug(eae) compositing/repaint/layer-repaint.html [ NeedsManualRebaseline ] +Bug(eae) compositing/text-on-large-layer.html [ NeedsManualRebaseline ] +Bug(eae) css1/box_properties/border_bottom.html [ NeedsManualRebaseline ] +Bug(eae) css1/box_properties/border_bottom_inline.html [ NeedsManualRebaseline ] +Bug(eae) css1/box_properties/border_bottom_width_inline.html [ NeedsManualRebaseline ] +Bug(eae) css1/box_properties/border_color_inline.html [ NeedsManualRebaseline ] +Bug(eae) css1/box_properties/border.html [ NeedsManualRebaseline ] +Bug(eae) css1/box_properties/border_inline.html [ NeedsManualRebaseline ] +Bug(eae) css1/box_properties/border_left.html [ NeedsManualRebaseline ] +Bug(eae) css1/box_properties/border_left_inline.html [ NeedsManualRebaseline ] +Bug(eae) css1/box_properties/border_left_width_inline.html [ NeedsManualRebaseline ] +Bug(eae) css1/box_properties/border_right.html [ NeedsManualRebaseline ] +Bug(eae) css1/box_properties/border_right_inline.html [ NeedsManualRebaseline ] +Bug(eae) css1/box_properties/border_right_width_inline.html [ NeedsManualRebaseline ] +Bug(eae) css1/box_properties/border_style.html [ NeedsManualRebaseline ] +Bug(eae) css1/box_properties/border_style_inline.html [ NeedsManualRebaseline ] +Bug(eae) css1/box_properties/border_top.html [ NeedsManualRebaseline ] +Bug(eae) css1/box_properties/border_top_inline.html [ NeedsManualRebaseline ] +Bug(eae) css1/box_properties/border_top_width_inline.html [ NeedsManualRebaseline ] +Bug(eae) css1/box_properties/border_width_inline.html [ NeedsManualRebaseline ] +Bug(eae) css1/box_properties/clear.html [ NeedsManualRebaseline ] +Bug(eae) css1/box_properties/float_elements_in_series.html [ NeedsManualRebaseline ] +Bug(eae) css1/box_properties/float.html [ NeedsManualRebaseline ] +Bug(eae) css1/box_properties/float_margin.html [ NeedsManualRebaseline ] +Bug(eae) css1/box_properties/float_on_text_elements.html [ NeedsManualRebaseline ] +Bug(eae) css1/box_properties/margin_bottom.html [ NeedsManualRebaseline ] +Bug(eae) css1/box_properties/margin_bottom_inline.html [ NeedsManualRebaseline ] +Bug(eae) css1/box_properties/margin.html [ NeedsManualRebaseline ] +Bug(eae) css1/box_properties/margin_inline.html [ NeedsManualRebaseline ] +Bug(eae) css1/box_properties/margin_left.html [ NeedsManualRebaseline ] +Bug(eae) css1/box_properties/margin_left_inline.html [ NeedsManualRebaseline ] +Bug(eae) css1/box_properties/margin_right.html [ NeedsManualRebaseline ] +Bug(eae) css1/box_properties/margin_right_inline.html [ NeedsManualRebaseline ] +Bug(eae) css1/box_properties/margin_top.html [ NeedsManualRebaseline ] +Bug(eae) css1/box_properties/margin_top_inline.html [ NeedsManualRebaseline ] +Bug(eae) css1/box_properties/padding_bottom_inline.html [ NeedsManualRebaseline ] +Bug(eae) css1/box_properties/padding_inline.html [ NeedsManualRebaseline ] +Bug(eae) css1/box_properties/padding_left.html [ NeedsManualRebaseline ] +Bug(eae) css1/box_properties/padding_left_inline.html [ NeedsManualRebaseline ] +Bug(eae) css1/box_properties/padding_right_inline.html [ NeedsManualRebaseline ] +Bug(eae) css1/box_properties/padding_top_inline.html [ NeedsManualRebaseline ] +Bug(eae) css1/box_properties/width.html [ NeedsManualRebaseline ] +Bug(eae) css1/cascade/cascade_order.html [ NeedsManualRebaseline ] +Bug(eae) css1/classification/display.html [ NeedsManualRebaseline ] +Bug(eae) css1/classification/white_space.html [ NeedsManualRebaseline ] +Bug(eae) css1/color_and_background/background_attachment.html [ NeedsManualRebaseline ] +Bug(eae) css1/color_and_background/background_color.html [ NeedsManualRebaseline ] +Bug(eae) css1/color_and_background/background.html [ NeedsManualRebaseline ] +Bug(eae) css1/color_and_background/background_image.html [ NeedsManualRebaseline ] +Bug(eae) css1/color_and_background/background_position.html [ NeedsManualRebaseline ] +Bug(eae) css1/color_and_background/background_repeat.html [ NeedsManualRebaseline ] +Bug(eae) css1/conformance/forward_compatible_parsing.html [ NeedsManualRebaseline ] +Bug(eae) css1/font_properties/font_family.html [ NeedsManualRebaseline ] +Bug(eae) css1/font_properties/font.html [ NeedsManualRebaseline ] +Bug(eae) css1/formatting_model/canvas.html [ NeedsManualRebaseline ] +Bug(eae) css1/formatting_model/floating_elements.html [ NeedsManualRebaseline ] +Bug(eae) css1/formatting_model/inline_elements.html [ NeedsManualRebaseline ] +Bug(eae) css1/formatting_model/replaced_elements.html [ NeedsManualRebaseline ] +Bug(eae) css1/formatting_model/vertical_formatting.html [ NeedsManualRebaseline ] +Bug(eae) css1/pseudo/anchor.html [ NeedsManualRebaseline ] +Bug(eae) css1/pseudo/firstletter.html [ NeedsManualRebaseline ] +Bug(eae) css1/pseudo/firstline.html [ NeedsManualRebaseline ] +Bug(eae) css1/pseudo/multiple_pseudo_elements.html [ NeedsManualRebaseline ] +Bug(eae) css1/pseudo/pseudo_elements_in_selectors.html [ NeedsManualRebaseline ] +Bug(eae) css1/text_properties/letter_spacing.html [ NeedsManualRebaseline ] +Bug(eae) css1/text_properties/line_height.html [ NeedsManualRebaseline ] +Bug(eae) css1/text_properties/text_decoration.html [ NeedsManualRebaseline ] +Bug(eae) css1/text_properties/vertical_align.html [ NeedsManualRebaseline ] +Bug(eae) css1/text_properties/word_spacing.html [ NeedsManualRebaseline ] +Bug(eae) css1/units/color_units.html [ NeedsManualRebaseline ] +Bug(eae) css1/units/percentage_units.html [ NeedsManualRebaseline ] +Bug(eae) css1/units/urls.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/20110323/absolute-non-replaced-height-008.htm [ NeedsManualRebaseline ] +Bug(eae) css2.1/20110323/absolute-non-replaced-max-height-008.htm [ NeedsManualRebaseline ] +Bug(eae) css2.1/20110323/absolute-non-replaced-width-021.htm [ NeedsManualRebaseline ] +Bug(eae) css2.1/20110323/absolute-non-replaced-width-022.htm [ NeedsManualRebaseline ] +Bug(eae) css2.1/20110323/absolute-non-replaced-width-023.htm [ NeedsManualRebaseline ] +Bug(eae) css2.1/20110323/absolute-non-replaced-width-024.htm [ NeedsManualRebaseline ] +Bug(eae) css2.1/20110323/block-non-replaced-height-007.htm [ NeedsManualRebaseline ] +Bug(eae) css2.1/20110323/block-non-replaced-height-008.htm [ NeedsManualRebaseline ] +Bug(eae) css2.1/20110323/block-non-replaced-height-009.htm [ NeedsManualRebaseline ] +Bug(eae) css2.1/20110323/block-non-replaced-height-010.htm [ NeedsManualRebaseline ] +Bug(eae) css2.1/20110323/floating-replaced-height-008.htm [ NeedsManualRebaseline ] +Bug(eae) css2.1/20110323/inline-block-replaced-height-008.htm [ NeedsManualRebaseline ] +Bug(eae) css2.1/20110323/inline-replaced-height-008.htm [ NeedsManualRebaseline ] +Bug(eae) css2.1/20110323/inline-replaced-width-011.htm [ NeedsManualRebaseline ] +Bug(eae) css2.1/20110323/inline-replaced-width-012.htm [ NeedsManualRebaseline ] +Bug(eae) css2.1/20110323/inline-replaced-width-013.htm [ NeedsManualRebaseline ] +Bug(eae) css2.1/20110323/inline-replaced-width-014.htm [ NeedsManualRebaseline ] +Bug(eae) css2.1/20110323/inline-replaced-width-015.htm [ NeedsManualRebaseline ] +Bug(eae) css2.1/20110323/margin-applies-to-001.htm [ NeedsManualRebaseline ] +Bug(eae) css2.1/20110323/margin-applies-to-002.htm [ NeedsManualRebaseline ] +Bug(eae) css2.1/20110323/margin-applies-to-003.htm [ NeedsManualRebaseline ] +Bug(eae) css2.1/20110323/margin-applies-to-004.htm [ NeedsManualRebaseline ] +Bug(eae) css2.1/20110323/margin-applies-to-005.htm [ NeedsManualRebaseline ] +Bug(eae) css2.1/20110323/margin-applies-to-006.htm [ NeedsManualRebaseline ] +Bug(eae) css2.1/20110323/margin-applies-to-007.htm [ NeedsManualRebaseline ] +Bug(eae) css2.1/20110323/margin-applies-to-008.htm [ NeedsManualRebaseline ] +Bug(eae) css2.1/20110323/margin-applies-to-009.htm [ NeedsManualRebaseline ] +Bug(eae) css2.1/20110323/margin-applies-to-012.htm [ NeedsManualRebaseline ] +Bug(eae) css2.1/20110323/margin-applies-to-013.htm [ NeedsManualRebaseline ] +Bug(eae) css2.1/20110323/margin-applies-to-015.htm [ NeedsManualRebaseline ] +Bug(eae) css2.1/20110323/replaced-elements-001.htm [ NeedsManualRebaseline ] +Bug(eae) css2.1/20110323/replaced-intrinsic-001.htm [ NeedsManualRebaseline ] +Bug(eae) css2.1/t010403-shand-border-00-c.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t040302-c61-phys-len-00-b.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t040302-c61-rel-len-00-b-ag.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t040303-c62-percent-00-b-ag.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t040304-c64-uri-00-a-g.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t040306-c63-color-00-b-ag.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t0510-c25-pseudo-elmnt-00-c.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t051201-c23-first-line-00-b.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t051202-c24-first-lttr-00-b.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t051202-c26-psudo-nest-00-c.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t0602-inherit-bdr-pad-b-00.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t060403-c21-pseu-cls-00-e-i.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t060403-c21-pseu-id-00-e-i.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t0803-c5502-mrgn-r-02-c.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t0803-c5504-mrgn-l-02-c.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t0803-c5505-mrgn-02-c.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t0805-c5511-ibrdr-tw-00-a.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t0805-c5512-ibrdr-rw-00-a.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t0805-c5513-ibrdr-bw-00-a.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t0805-c5514-ibrdr-lw-00-a.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t0805-c5515-ibrdr-00-b.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t0805-c5516-brdr-c-00-a.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t0805-c5516-ibrdr-c-00-a.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t0805-c5517-ibrdr-s-00-a.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t0805-c5519-brdr-r-02-e.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t0805-c5521-brdr-l-02-e.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t0805-c5522-brdr-00-b.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t090204-display-change-01-b-ao.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t0905-c414-flt-fit-00-d.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t0905-c414-flt-fit-01-d-g.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t0905-c414-flt-wrap-00-e.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t0905-c414-flt-wrap-01-d-g.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t0905-c5525-fltclr-00-c-ag.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t0905-c5525-flthw-00-c-g.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t0905-c5525-fltinln-00-c-ag.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t0905-c5525-fltmrgn-00-c-ag.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t0905-c5525-fltwidth-02-c-g.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t0905-c5525-fltwidth-03-c-g.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t0905-c5526-fltclr-00-c-ag.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t0905-c5526-flthw-00-c-g.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t1002-c5523-width-00-b-g.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t1002-c5523-width-02-b-g.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t100303-c412-blockw-00-d-ag.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t100304-c43-rpl-bbx-01-d-g.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t1005-c5524-width-00-b-g.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t1005-c5524-width-01-b-g.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t100801-c42-ibx-ht-00-d-a.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t100801-c544-valgn-00-a-ag.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t100801-c544-valgn-01-d-ag.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t100801-c548-leadin-00-d-a.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t100801-c548-ln-ht-01-b-ag.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t100801-c548-ln-ht-02-b-ag.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t1008-c44-ln-box-00-d-ag.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t1008-c44-ln-box-01-d-ag.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t1008-c44-ln-box-02-d-ag.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t1008-c44-ln-box-03-d-ag.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t1204-order-01-d.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t1205-c561-list-displ-00-b.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t1205-c566-list-stl-00-e-ag.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t140201-c534-bgre-00-b-ag.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t140201-c534-bgre-01-b-ag.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t140201-c534-bgreps-00-c-ag.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t140201-c534-bgreps-01-c-ag.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t140201-c534-bgreps-02-c-ag.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t140201-c534-bgreps-03-c-ag.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t140201-c534-bgreps-04-c-ag.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t140201-c534-bgreps-05-c-ag.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t140201-c537-bgfxps-00-c-ag.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t1503-c522-font-family-00-b.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t1507-c526-font-sz-01-b-a.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t1507-c526-font-sz-02-b-a.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t1601-c547-indent-00-b-a.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t1601-c547-indent-01-d.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t1605-c545-txttrans-00-b-ag.html [ NeedsManualRebaseline ] +Bug(eae) css2.1/t1606-c562-white-sp-00-b-ag.html [ NeedsManualRebaseline ] +Bug(eae) css3/flexbox/flexbox-baseline-margins.html [ NeedsManualRebaseline ] +Bug(eae) css3/font-feature-settings-rendering.html [ NeedsManualRebaseline ] +Bug(eae) css3/masking/clip-path-inset-corners.html [ NeedsManualRebaseline ] +Bug(eae) css3/selectors3/html/css3-modsel-17.html [ NeedsManualRebaseline ] +Bug(eae) css3/selectors3/html/css3-modsel-19b.html [ NeedsManualRebaseline ] +Bug(eae) css3/selectors3/html/css3-modsel-39a.html [ NeedsManualRebaseline ] +Bug(eae) css3/selectors3/html/css3-modsel-39c.html [ NeedsManualRebaseline ] +Bug(eae) css3/selectors3/xhtml/css3-modsel-17.xml [ NeedsManualRebaseline ] +Bug(eae) css3/selectors3/xhtml/css3-modsel-19b.xml [ NeedsManualRebaseline ] +Bug(eae) css3/selectors3/xhtml/css3-modsel-39a.xml [ NeedsManualRebaseline ] +Bug(eae) css3/selectors3/xhtml/css3-modsel-39c.xml [ NeedsManualRebaseline ] +Bug(eae) css3/selectors3/xml/css3-modsel-17.xml [ NeedsManualRebaseline ] +Bug(eae) css3/selectors3/xml/css3-modsel-19b.xml [ NeedsManualRebaseline ] +Bug(eae) css3/selectors3/xml/css3-modsel-39a.xml [ NeedsManualRebaseline ] +Bug(eae) css3/selectors3/xml/css3-modsel-39c.xml [ NeedsManualRebaseline ] +Bug(eae) editing/caret/caret-position.html [ NeedsManualRebaseline ] +Bug(eae) editing/deleting/4922367.html [ NeedsManualRebaseline ] +Bug(eae) editing/deleting/5144139-2.html [ NeedsManualRebaseline ] +Bug(eae) editing/deleting/5206311-1.html [ NeedsManualRebaseline ] +Bug(eae) editing/deleting/5369009.html [ NeedsManualRebaseline ] +Bug(eae) editing/deleting/5433862-2.html [ NeedsManualRebaseline ] +Bug(eae) editing/deleting/5483370.html [ NeedsManualRebaseline ] +Bug(eae) editing/deleting/delete-3608445-fix.html [ NeedsManualRebaseline ] +Bug(eae) editing/deleting/delete-at-paragraph-boundaries-002.html [ NeedsManualRebaseline ] +Bug(eae) editing/deleting/delete-at-paragraph-boundaries-003.html [ NeedsManualRebaseline ] +Bug(eae) editing/deleting/delete-at-paragraph-boundaries-004.html [ NeedsManualRebaseline ] +Bug(eae) editing/deleting/delete-at-paragraph-boundaries-005.html [ NeedsManualRebaseline ] +Bug(eae) editing/deleting/delete-at-paragraph-boundaries-006.html [ NeedsManualRebaseline ] +Bug(eae) editing/deleting/delete-at-paragraph-boundaries-011.html [ NeedsManualRebaseline ] +Bug(eae) editing/deleting/delete-ws-fixup-001.html [ NeedsManualRebaseline ] +Bug(eae) editing/deleting/delete-ws-fixup-002.html [ NeedsManualRebaseline ] +Bug(eae) editing/deleting/pruning-after-merge-2.html [ NeedsManualRebaseline ] +Bug(eae) editing/execCommand/4580583-1.html [ NeedsManualRebaseline ] +Bug(eae) editing/execCommand/4580583-2.html [ NeedsManualRebaseline ] +Bug(eae) editing/execCommand/5136770.html [ NeedsManualRebaseline ] +Bug(eae) editing/execCommand/5142012-1.html [ NeedsManualRebaseline ] +Bug(eae) editing/execCommand/5481523.html [ NeedsManualRebaseline ] +Bug(eae) editing/execCommand/find-after-replace.html [ NeedsManualRebaseline ] +Bug(eae) editing/execCommand/findString.html [ NeedsManualRebaseline ] +Bug(eae) editing/execCommand/indent-list-item.html [ NeedsManualRebaseline ] +Bug(eae) editing/execCommand/indent-selection.html [ NeedsManualRebaseline ] +Bug(eae) editing/execCommand/nsresponder-indent.html [ NeedsManualRebaseline ] +Bug(eae) editing/execCommand/nsresponder-outdent.html [ NeedsManualRebaseline ] +Bug(eae) editing/execCommand/print.html [ NeedsManualRebaseline ] +Bug(eae) editing/execCommand/selectAll.html [ NeedsManualRebaseline ] +Bug(eae) editing/input/caret-at-the-edge-of-contenteditable.html [ NeedsManualRebaseline ] +Bug(eae) editing/inserting/12882.html [ NeedsManualRebaseline ] +Bug(eae) editing/inserting/4875189-2.html [ NeedsManualRebaseline ] +Bug(eae) editing/inserting/5510537.html [ NeedsManualRebaseline ] +Bug(eae) editing/inserting/6703873.html [ NeedsManualRebaseline ] +Bug(eae) editing/inserting/editing-empty-divs.html [ NeedsManualRebaseline ] +Bug(eae) editing/inserting/insert-at-end-01.html [ NeedsManualRebaseline ] +Bug(eae) editing/inserting/insert-at-end-02.html [ NeedsManualRebaseline ] +Bug(eae) editing/inserting/insert-br-009.html [ NeedsManualRebaseline ] +Bug(eae) editing/inserting/insert-paragraph-05.html [ NeedsManualRebaseline ] +Bug(eae) editing/inserting/typing-at-end-of-line.html [ NeedsManualRebaseline ] +Bug(eae) editing/pasteboard/4631972.html [ NeedsManualRebaseline ] +Bug(eae) editing/pasteboard/5006779.html [ NeedsManualRebaseline ] +Bug(eae) editing/pasteboard/5032095.html [ NeedsManualRebaseline ] +Bug(eae) editing/pasteboard/5134759.html [ NeedsManualRebaseline ] +Bug(eae) editing/pasteboard/5387578.html [ NeedsManualRebaseline ] +Bug(eae) editing/pasteboard/bad-placeholder.html [ NeedsManualRebaseline ] +Bug(eae) editing/pasteboard/copy-standalone-image.html [ NeedsManualRebaseline ] +Bug(eae) editing/pasteboard/displaced-generic-placeholder.html [ NeedsManualRebaseline ] +Bug(eae) editing/pasteboard/drop-text-without-selection.html [ NeedsManualRebaseline ] +Bug(eae) editing/pasteboard/emacs-cntl-y-001.html [ NeedsManualRebaseline ] +Bug(eae) editing/pasteboard/emacs-ctrl-k-y-001.html [ NeedsManualRebaseline ] +Bug(eae) editing/pasteboard/merge-after-delete-1.html [ NeedsManualRebaseline ] +Bug(eae) editing/pasteboard/merge-after-delete-2.html [ NeedsManualRebaseline ] +Bug(eae) editing/pasteboard/merge-end-borders.html [ NeedsManualRebaseline ] +Bug(eae) editing/pasteboard/paste-line-endings-001.html [ NeedsManualRebaseline ] +Bug(eae) editing/pasteboard/paste-line-endings-002.html [ NeedsManualRebaseline ] +Bug(eae) editing/pasteboard/paste-line-endings-003.html [ NeedsManualRebaseline ] +Bug(eae) editing/pasteboard/paste-line-endings-004.html [ NeedsManualRebaseline ] +Bug(eae) editing/pasteboard/paste-line-endings-005.html [ NeedsManualRebaseline ] +Bug(eae) editing/pasteboard/paste-line-endings-006.html [ NeedsManualRebaseline ] +Bug(eae) editing/pasteboard/paste-line-endings-007.html [ NeedsManualRebaseline ] +Bug(eae) editing/pasteboard/paste-line-endings-008.html [ NeedsManualRebaseline ] +Bug(eae) editing/pasteboard/paste-line-endings-009.html [ NeedsManualRebaseline ] +Bug(eae) editing/pasteboard/paste-line-endings-010.html [ NeedsManualRebaseline ] +Bug(eae) editing/pasteboard/paste-match-style-001.html [ NeedsManualRebaseline ] +Bug(eae) editing/pasteboard/pasting-object.html [ NeedsManualRebaseline ] +Bug(eae) editing/pasteboard/quirks-mode-br-1.html [ NeedsManualRebaseline ] +Bug(eae) editing/selection/14971.html [ NeedsManualRebaseline ] +Bug(eae) editing/selection/4776665.html [ NeedsManualRebaseline ] +Bug(eae) editing/selection/4947387.html [ NeedsManualRebaseline ] +Bug(eae) editing/selection/4975120.html [ NeedsManualRebaseline ] +Bug(eae) editing/selection/5057506.html [ NeedsManualRebaseline ] +Bug(eae) editing/selection/5232159.html [ NeedsManualRebaseline ] +Bug(eae) editing/selection/5240265.html [ NeedsManualRebaseline ] +Bug(eae) editing/selection/5354455-2.html [ NeedsManualRebaseline ] +Bug(eae) editing/selection/6476.html [ NeedsManualRebaseline ] +Bug(eae) editing/selection/after-line-wrap.html [ NeedsManualRebaseline ] +Bug(eae) editing/selection/caret-ltr-2.html [ NeedsManualRebaseline ] +Bug(eae) editing/selection/caret-ltr-2-left.html [ NeedsManualRebaseline ] +Bug(eae) editing/selection/caret-ltr.html [ NeedsManualRebaseline ] +Bug(eae) editing/selection/caret-ltr-right.html [ NeedsManualRebaseline ] +Bug(eae) editing/selection/caret-rtl-2.html [ NeedsManualRebaseline ] +Bug(eae) editing/selection/caret-rtl-2-left.html [ NeedsManualRebaseline ] +Bug(eae) editing/selection/caret-rtl.html [ NeedsManualRebaseline ] +Bug(eae) editing/selection/caret-rtl-right.html [ NeedsManualRebaseline ] +Bug(eae) editing/selection/clear-selection.html [ NeedsManualRebaseline ] +Bug(eae) editing/selection/click-start-of-line.html [ NeedsManualRebaseline ] +Bug(eae) editing/selection/designmode-no-caret.html [ NeedsManualRebaseline ] +Bug(eae) editing/selection/drag-in-iframe.html [ NeedsManualRebaseline ] +Bug(eae) editing/selection/drag-select-1.html [ NeedsManualRebaseline ] +Bug(eae) editing/selection/expanding-selections2.html [ NeedsManualRebaseline ] +Bug(eae) editing/selection/expanding-selections.html [ NeedsManualRebaseline ] +Bug(eae) editing/selection/focus-body.html [ NeedsManualRebaseline ] +Bug(eae) editing/selection/line-wrap-2.html [ NeedsManualRebaseline ] +Bug(eae) editing/selection/linux_selection_color.html [ NeedsManualRebaseline ] +Bug(eae) editing/selection/mixed-editability-1.html [ NeedsManualRebaseline ] +Bug(eae) editing/selection/mixed-editability-4.html [ NeedsManualRebaseline ] +Bug(eae) editing/selection/mixed-editability-5.html [ NeedsManualRebaseline ] +Bug(eae) editing/selection/mixed-editability-8.html [ NeedsManualRebaseline ] +Bug(eae) editing/selection/mixed-editability-9.html [ NeedsManualRebaseline ] +Bug(eae) editing/selection/node-removal-2.html [ NeedsManualRebaseline ] +Bug(eae) editing/selection/paragraph-granularity.html [ NeedsManualRebaseline ] +Bug(eae) editing/selection/replace-selection-1.html [ NeedsManualRebaseline ] +Bug(eae) editing/selection/select-element-paragraph-boundary.html [ NeedsManualRebaseline ] +Bug(eae) editing/selection/selectNodeContents.html [ NeedsManualRebaseline ] +Bug(eae) editing/selection/selectNode.html [ NeedsManualRebaseline ] +Bug(eae) editing/selection/triple-click-in-pre.html [ NeedsManualRebaseline ] +Bug(eae) editing/selection/word-granularity.html [ NeedsManualRebaseline ] +Bug(eae) editing/spelling/grammar-markers-hidpi.html [ NeedsManualRebaseline ] +Bug(eae) editing/spelling/grammar-markers.html [ NeedsManualRebaseline ] +Bug(eae) editing/spelling/spelling.html [ NeedsManualRebaseline ] +Bug(eae) editing/style/5017613-2.html [ NeedsManualRebaseline ] +Bug(eae) editing/style/5084241.html [ NeedsManualRebaseline ] +Bug(eae) editing/style/5279521.html [ NeedsManualRebaseline ] +Bug(eae) editing/style/relative-font-size-change-004.html [ NeedsManualRebaseline ] +Bug(eae) editing/style/smoosh-styles-001.html [ NeedsManualRebaseline ] +Bug(eae) fast/backgrounds/001.html [ NeedsManualRebaseline ] +Bug(eae) fast/backgrounds/background-clip-text.html [ NeedsManualRebaseline ] +Bug(eae) fast/backgrounds/background-origin-root-element.html [ NeedsManualRebaseline ] +Bug(eae) fast/backgrounds/background-position-rounding.html [ NeedsManualRebaseline ] +Bug(eae) fast/backgrounds/opacity-on-document-element.html [ NeedsManualRebaseline ] +Bug(eae) fast/backgrounds/selection-background-color-of-image-list-style.html [ NeedsManualRebaseline ] +Bug(eae) fast/backgrounds/selection-background-color-of-list-style.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/basic/014.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/basic/015.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/basic/minheight.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/basic/truncation-rtl.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/float/002.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/float/003.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/float/015.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/float/021.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/float/023.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/float/add-inline-between-floats-with-preceding-anonymous-box.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/float/add-inline-to-block-flow-with-block-children-that-do-not-need-anonymous-boxes.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/float/centered-float-avoidance-complexity.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/float/editable-text-overlapping-float.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/float/float-avoidance.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/float/float-in-float-hit-testing.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/float/float-in-float-painting.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/float/floats-and-text-indent.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/float/nopaint-after-layer-destruction2.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/float/nopaint-after-layer-destruction.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/float/overlapping-floats-with-overflow-hidden.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/margin-collapse/006.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/margin-collapse/010.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/margin-collapse/011.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/margin-collapse/017.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/margin-collapse/018.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/margin-collapse/026.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/margin-collapse/027.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/margin-collapse/028.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/margin-collapse/029.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/margin-collapse/030.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/margin-collapse/035.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/margin-collapse/039.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/margin-collapse/040.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/margin-collapse/101.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/margin-collapse/102.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/margin-collapse/104.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/margin-collapse/block-inside-inline/006.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/margin-collapse/block-inside-inline/010.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/margin-collapse/block-inside-inline/011.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/margin-collapse/block-inside-inline/017.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/margin-collapse/block-inside-inline/018.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/margin-collapse/negative-margins.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/positioning/053.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/positioning/056.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/positioning/057.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/positioning/059.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/positioning/060.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/positioning/absolute-in-inline-ltr-2.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/positioning/absolute-in-inline-ltr-3.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/positioning/absolute-in-inline-ltr.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/positioning/absolute-in-inline-rtl-2.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/positioning/absolute-in-inline-rtl-3.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/positioning/absolute-in-inline-rtl.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/positioning/absolute-in-inline-short-ltr.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/positioning/absolute-in-inline-short-rtl.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/positioning/absolute-positioning-no-scrollbar.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/positioning/auto-height-with-top-and-bottom.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/positioning/fixed-positioning-scrollbar-bug.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/positioning/hiding-inside-relpositioned-inline.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/positioning/leftmargin-topmargin.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/positioning/relative-overflow-replaced-float.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/positioning/relative-overflow-replaced.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/positioning/rtl-fixed-positioning.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/positioning/rtl-static-positioning.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/positioning/rtl-static-positioning-inline-block.html [ NeedsManualRebaseline ] +Bug(eae) fast/block/positioning/vertical-rl/fixed-positioning.html [ NeedsManualRebaseline ] +Bug(eae) fast/body-propagation/background-color/001.html [ NeedsManualRebaseline ] +Bug(eae) fast/body-propagation/background-color/001-xhtml.xhtml [ NeedsManualRebaseline ] +Bug(eae) fast/body-propagation/background-color/005-declarative.xhtml [ NeedsManualRebaseline ] +Bug(eae) fast/body-propagation/background-color/005.html [ NeedsManualRebaseline ] +Bug(eae) fast/body-propagation/background-color/005-xhtml.xhtml [ NeedsManualRebaseline ] +Bug(eae) fast/body-propagation/background-image/001.html [ NeedsManualRebaseline ] +Bug(eae) fast/body-propagation/background-image/001-xhtml.xhtml [ NeedsManualRebaseline ] +Bug(eae) fast/body-propagation/background-image/005-declarative.xhtml [ NeedsManualRebaseline ] +Bug(eae) fast/body-propagation/background-image/005.html [ NeedsManualRebaseline ] +Bug(eae) fast/body-propagation/background-image/005-xhtml.xhtml [ NeedsManualRebaseline ] +Bug(eae) fast/body-propagation/background-image/009.html [ NeedsManualRebaseline ] +Bug(eae) fast/body-propagation/background-image/009-xhtml.xhtml [ NeedsManualRebaseline ] +Bug(eae) fast/body-propagation/background-image/010.html [ NeedsManualRebaseline ] +Bug(eae) fast/body-propagation/background-image/010-xhtml.xhtml [ NeedsManualRebaseline ] +Bug(eae) fast/body-propagation/overflow/005-declarative.xhtml [ NeedsManualRebaseline ] +Bug(eae) fast/body-propagation/overflow/005.html [ NeedsManualRebaseline ] +Bug(eae) fast/body-propagation/overflow/005-xhtml.xhtml [ NeedsManualRebaseline ] +Bug(eae) fast/borders/bidi-002.html [ NeedsManualRebaseline ] +Bug(eae) fast/borders/bidi-009a.html [ NeedsManualRebaseline ] +Bug(eae) fast/borders/bidi-012.html [ NeedsManualRebaseline ] +Bug(eae) fast/borders/block-mask-overlay-image.html [ NeedsManualRebaseline ] +Bug(eae) fast/borders/block-mask-overlay-image-outset.html [ NeedsManualRebaseline ] +Bug(eae) fast/borders/border-radius-huge-assert.html [ NeedsManualRebaseline ] +Bug(eae) fast/borders/different-color-borders.html [ NeedsManualRebaseline ] +Bug(eae) fast/borders/inline-mask-overlay-image.html [ NeedsManualRebaseline ] +Bug(eae) fast/borders/inline-mask-overlay-image-outset.html [ NeedsManualRebaseline ] +Bug(eae) fast/borders/inline-mask-overlay-image-outset-vertical-rl.html [ NeedsManualRebaseline ] +Bug(eae) fast/borders/rtl-border-01.html [ NeedsManualRebaseline ] +Bug(eae) fast/borders/rtl-border-02.html [ NeedsManualRebaseline ] +Bug(eae) fast/borders/rtl-border-03.html [ NeedsManualRebaseline ] +Bug(eae) fast/borders/rtl-border-04.html [ NeedsManualRebaseline ] +Bug(eae) fast/box-shadow/border-radius-big.html [ NeedsManualRebaseline ] +Bug(eae) fast/box-sizing/percentage-height.html [ NeedsManualRebaseline ] +Bug(eae) fast/canvas/setWidthResetAfterForcedRender.html [ NeedsManualRebaseline ] +Bug(eae) fast/canvas/shadow-offset-1.html [ NeedsManualRebaseline ] +Bug(eae) fast/canvas/toDataURL-alpha.html [ NeedsManualRebaseline ] +Bug(eae) fast/clip/001.html [ NeedsManualRebaseline ] +Bug(eae) fast/clip/002.html [ NeedsManualRebaseline ] +Bug(eae) fast/clip/003.html [ NeedsManualRebaseline ] +Bug(eae) fast/clip/004.html [ NeedsManualRebaseline ] +Bug(eae) fast/clip/005.html [ NeedsManualRebaseline ] +Bug(eae) fast/clip/006.html [ NeedsManualRebaseline ] +Bug(eae) fast/clip/007.html [ NeedsManualRebaseline ] +Bug(eae) fast/clip/008.html [ NeedsManualRebaseline ] +Bug(eae) fast/clip/009.html [ NeedsManualRebaseline ] +Bug(eae) fast/clip/010.html [ NeedsManualRebaseline ] +Bug(eae) fast/clip/011.html [ NeedsManualRebaseline ] +Bug(eae) fast/clip/012.html [ NeedsManualRebaseline ] +Bug(eae) fast/clip/013.html [ NeedsManualRebaseline ] +Bug(eae) fast/clip/014.html [ NeedsManualRebaseline ] +Bug(eae) fast/clip/015.html [ NeedsManualRebaseline ] +Bug(eae) fast/clip/016.html [ NeedsManualRebaseline ] +Bug(eae) fast/clip/nestedTransparencyClip.html [ NeedsManualRebaseline ] +Bug(eae) fast/clip/outline-overflowClip.html [ NeedsManualRebaseline ] +Bug(eae) fast/compact/001.html [ NeedsManualRebaseline ] +Bug(eae) fast/compact/002.html [ NeedsManualRebaseline ] +Bug(eae) fast/css/004.html [ NeedsManualRebaseline ] +Bug(eae) fast/css/005.html [ NeedsManualRebaseline ] +Bug(eae) fast/css/008.html [ NeedsManualRebaseline ] +Bug(eae) fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-all.html [ NeedsManualRebaseline ] +Bug(eae) fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under.html [ NeedsManualRebaseline ] +Bug(eae) fast/css/beforeSelectorOnCodeElement.html [ NeedsManualRebaseline ] +Bug(eae) fast/css/bidi-override-in-anonymous-block.html [ NeedsManualRebaseline ] +Bug(eae) fast/css/color-correction-on-background-image.html [ NeedsManualRebaseline ] +Bug(eae) fast/css/color-correction-untagged-images.html [ NeedsManualRebaseline ] +Bug(eae) fast/css/continuationCrash.html [ NeedsManualRebaseline ] +Bug(eae) fast/css/css1_forward_compatible_parsing.html [ NeedsManualRebaseline ] +Bug(eae) fast/css/css3-nth-child.html [ NeedsManualRebaseline ] +Bug(eae) fast/css/css-imports.html [ NeedsManualRebaseline ] +Bug(eae) fast/css/dynamic-sibling-selector.html [ NeedsManualRebaseline ] +Bug(eae) fast/css/first-child-pseudo-class.html [ NeedsManualRebaseline ] +Bug(eae) fast/css/first-letter-detach.html [ NeedsManualRebaseline ] +Bug(eae) fast/css/first-letter-visibility.html [ NeedsManualRebaseline ] +Bug(eae) fast/css/first-line-text-decoration-inherited-from-parent.html [ NeedsManualRebaseline ] +Bug(eae) fast/css/first-of-type-pseudo-class.html [ NeedsManualRebaseline ] +Bug(eae) fast/css/focus-ring-outline-color.html [ NeedsManualRebaseline ] +Bug(eae) fast/css/font-face-opentype.html [ NeedsManualRebaseline ] +Bug(eae) fast/css/font-face-synthetic-bold-italic-for-locally-installed.html [ NeedsManualRebaseline ] +Bug(eae) fast/css-generated-content/002.html [ NeedsManualRebaseline ] +Bug(eae) fast/css-generated-content/009.html [ NeedsManualRebaseline ] +Bug(eae) fast/css-generated-content/012.html [ NeedsManualRebaseline ] +Bug(eae) fast/css-generated-content/014.html [ NeedsManualRebaseline ] +Bug(eae) fast/css-generated-content/015.html [ NeedsManualRebaseline ] +Bug(eae) fast/css-generated-content/table-row-before-after.html [ NeedsManualRebaseline ] +Bug(eae) fast/css/hsl-color.html [ NeedsManualRebaseline ] +Bug(eae) fast/css/import-rule-regression-11590.html [ NeedsManualRebaseline ] +Bug(eae) fast/css/invalidation-errors-2.html [ NeedsManualRebaseline ] +Bug(eae) fast/css/invalidation-errors-3.html [ NeedsManualRebaseline ] +Bug(eae) fast/css/invalidation-errors.html [ NeedsManualRebaseline ] +Bug(eae) fast/css/last-child-pseudo-class.html [ NeedsManualRebaseline ] +Bug(eae) fast/css/last-of-type-pseudo-class.html [ NeedsManualRebaseline ] +Bug(eae) fast/css/layerZOrderCrash.html [ NeedsManualRebaseline ] +Bug(eae) fast/css/line-after-floating-div.html [ NeedsManualRebaseline ] +Bug(eae) fast/css/line-height.html [ NeedsManualRebaseline ] +Bug(eae) fast/css/link-outside-head.html [ NeedsManualRebaseline ] +Bug(eae) fast/css/negative-leading.html [ NeedsManualRebaseline ] +Bug(eae) fast/css/negative-nth-child.html [ NeedsManualRebaseline ] +Bug(eae) fast/css/position-negative-top-margin.html [ NeedsManualRebaseline ] +Bug(eae) fast/css/relative-positioned-block-with-inline-ancestor-and-parent-dynamic.html [ NeedsManualRebaseline ] +Bug(eae) fast/css/relative-positioned-block-with-inline-ancestor-dynamic.html [ NeedsManualRebaseline ] +Bug(eae) fast/css/relative-positioned-block-with-inline-ancestor-dynamic-removed.html [ NeedsManualRebaseline ] +Bug(eae) fast/css/relative-positioned-block-with-inline-ancestor.html [ NeedsManualRebaseline ] +Bug(eae) fast/css/relative-positioned-block-with-inline-parent-dynamic.html [ NeedsManualRebaseline ] +Bug(eae) fast/css/relative-positioned-block-with-inline-parent-dynamic-removed.html [ NeedsManualRebaseline ] +Bug(eae) fast/css/relative-positioned-block-with-inline-parent-keeps-style.html [ NeedsManualRebaseline ] +Bug(eae) fast/css/style-outside-head.html [ NeedsManualRebaseline ] +Bug(eae) fast/css/style-parsed-outside-head.html [ NeedsManualRebaseline ] +Bug(eae) fast/css/text-align.html [ NeedsManualRebaseline ] +Bug(eae) fast/css/text-overflow-ellipsis-text-align-center.html [ NeedsManualRebaseline ] +Bug(eae) fast/css/text-overflow-ellipsis-text-align-justify.html [ NeedsManualRebaseline ] +Bug(eae) fast/css/text-overflow-ellipsis-text-align-left.html [ NeedsManualRebaseline ] +Bug(eae) fast/css/text-overflow-ellipsis-text-align-right.html [ NeedsManualRebaseline ] +Bug(eae) fast/css/text-overflow-input.html [ NeedsManualRebaseline ] +Bug(eae) fast/css/visibility-hit-test.html [ NeedsManualRebaseline ] +Bug(eae) fast/css/ZeroOpacityLayers2.html [ NeedsManualRebaseline ] +Bug(eae) fast/css/ZeroOpacityLayers.html [ NeedsManualRebaseline ] +Bug(eae) fast/deprecated-flexbox/001.html [ NeedsManualRebaseline ] +Bug(eae) fast/deprecated-flexbox/004.html [ NeedsManualRebaseline ] +Bug(eae) fast/deprecated-flexbox/007.html [ NeedsManualRebaseline ] +Bug(eae) fast/deprecated-flexbox/008.html [ NeedsManualRebaseline ] +Bug(eae) fast/deprecated-flexbox/009-horizontal.html [ NeedsManualRebaseline ] +Bug(eae) fast/deprecated-flexbox/009.html [ NeedsManualRebaseline ] +Bug(eae) fast/deprecated-flexbox/010.html [ NeedsManualRebaseline ] +Bug(eae) fast/deprecated-flexbox/011.html [ NeedsManualRebaseline ] +Bug(eae) fast/deprecated-flexbox/012.html [ NeedsManualRebaseline ] +Bug(eae) fast/deprecated-flexbox/013.html [ NeedsManualRebaseline ] +Bug(eae) fast/deprecated-flexbox/014.html [ NeedsManualRebaseline ] +Bug(eae) fast/deprecated-flexbox/015.html [ NeedsManualRebaseline ] +Bug(eae) fast/deprecated-flexbox/016.html [ NeedsManualRebaseline ] +Bug(eae) fast/deprecated-flexbox/017.html [ NeedsManualRebaseline ] +Bug(eae) fast/deprecated-flexbox/018.html [ NeedsManualRebaseline ] +Bug(eae) fast/deprecated-flexbox/019.html [ NeedsManualRebaseline ] +Bug(eae) fast/deprecated-flexbox/020.html [ NeedsManualRebaseline ] +Bug(eae) fast/deprecated-flexbox/021.html [ NeedsManualRebaseline ] +Bug(eae) fast/deprecated-flexbox/022.html [ NeedsManualRebaseline ] +Bug(eae) fast/deprecated-flexbox/023.html [ NeedsManualRebaseline ] +Bug(eae) fast/deprecated-flexbox/024.html [ NeedsManualRebaseline ] +Bug(eae) fast/deprecated-flexbox/025.html [ NeedsManualRebaseline ] +Bug(eae) fast/doctypes/002.html [ NeedsManualRebaseline ] +Bug(eae) fast/dom/blur-contenteditable.html [ NeedsManualRebaseline ] +Bug(eae) fast/dom/Element/null-offset-parent.html [ NeedsManualRebaseline ] +Bug(eae) fast/dom/focus-contenteditable.html [ NeedsManualRebaseline ] +Bug(eae) fast/dom/HTMLElement/bdo.html [ NeedsManualRebaseline ] +Bug(eae) fast/dom/HTMLHeadElement/head-link-style-href-check.html [ NeedsManualRebaseline ] +Bug(eae) fast/dom/HTMLLinkElement/pending-stylesheet-count.html [ NeedsManualRebaseline ] +Bug(eae) fast/dom/HTMLMeterElement/meter-boundary-values.html [ NeedsManualRebaseline ] +Bug(eae) fast/dom/HTMLMeterElement/meter-styles.html [ NeedsManualRebaseline ] +Bug(eae) fast/dom/HTMLObjectElement/vspace-hspace-as-number.html [ NeedsManualRebaseline ] +Bug(eae) fast/dom/HTMLTableColElement/resize-table-using-col-width.html [ NeedsManualRebaseline ] +Bug(eae) fast/dynamic/004.html [ NeedsManualRebaseline ] +Bug(eae) fast/dynamic/create-renderer-for-whitespace-only-text.html [ NeedsManualRebaseline ] +Bug(eae) fast/dynamic/positioned-movement-with-positioned-children.html [ NeedsManualRebaseline ] +Bug(eae) fast/dynamic/view-overflow.html [ NeedsManualRebaseline ] +Bug(eae) fast/encoding/utf-16-big-endian.html [ NeedsManualRebaseline ] +Bug(eae) fast/encoding/utf-16-little-endian.html [ NeedsManualRebaseline ] +Bug(eae) fast/events/autoscroll.html [ NeedsManualRebaseline ] +Bug(eae) fast/events/pointer-events-2.html [ NeedsManualRebaseline ] +Bug(eae) fast/files/file-in-input-display.html [ NeedsManualRebaseline ] +Bug(eae) fast/forms/basic-buttons.html [ NeedsManualRebaseline ] +Bug(eae) fast/forms/calendar-picker/calendar-picker-appearance.html [ NeedsManualRebaseline ] +Bug(eae) fast/forms/calendar-picker/calendar-picker-appearance-minimum-date.html [ NeedsManualRebaseline ] +Bug(eae) fast/forms/calendar-picker/calendar-picker-appearance-required.html [ NeedsManualRebaseline ] +Bug(eae) fast/forms/calendar-picker/calendar-picker-appearance-ru.html [ NeedsManualRebaseline ] +Bug(eae) fast/forms/calendar-picker/calendar-picker-appearance-step.html [ NeedsManualRebaseline ] +Bug(eae) fast/forms/calendar-picker/calendar-picker-appearance-zoom125.html [ NeedsManualRebaseline ] +Bug(eae) fast/forms/calendar-picker/calendar-picker-appearance-zoom200.html [ NeedsManualRebaseline ] +Bug(eae) fast/forms/calendar-picker/month-picker-appearance.html [ NeedsManualRebaseline ] +Bug(eae) fast/forms/calendar-picker/month-picker-appearance-step.html [ NeedsManualRebaseline ] +Bug(eae) fast/forms/caret-rtl.html [ NeedsManualRebaseline ] +Bug(eae) fast/forms/color/color-suggestion-picker-appearance.html [ NeedsManualRebaseline ] +Bug(eae) fast/forms/color/color-suggestion-picker-appearance-zoom125.html [ NeedsManualRebaseline ] +Bug(eae) fast/forms/color/color-suggestion-picker-appearance-zoom200.html [ NeedsManualRebaseline ] +Bug(eae) fast/forms/color/color-suggestion-picker-one-row-appearance.html [ NeedsManualRebaseline ] +Bug(eae) fast/forms/color/color-suggestion-picker-two-row-appearance.html [ NeedsManualRebaseline ] +Bug(eae) fast/forms/color/color-suggestion-picker-with-scrollbar-appearance.html [ NeedsManualRebaseline ] +Bug(eae) fast/forms/control-clip.html [ NeedsManualRebaseline ] +Bug(eae) fast/forms/datetimelocal/datetimelocal-appearance-basic.html [ NeedsManualRebaseline ] +Bug(eae) fast/forms/image-border.html [ NeedsManualRebaseline ] +Bug(eae) fast/forms/input-value.html [ NeedsManualRebaseline ] +Bug(eae) fast/forms/select/basic-selects.html [ NeedsManualRebaseline ] +Bug(eae) fast/forms/select/HTMLOptionElement_label01.html [ NeedsManualRebaseline ] +Bug(eae) fast/forms/select/HTMLOptionElement_label02.html [ NeedsManualRebaseline ] +Bug(eae) fast/forms/select/HTMLOptionElement_label05.html [ NeedsManualRebaseline ] +Bug(eae) fast/forms/select/menulist-appearance-basic.html [ NeedsManualRebaseline ] +Bug(eae) fast/forms/select/option-text-clip.html [ NeedsManualRebaseline ] +Bug(eae) fast/forms/select/select-autofilled.html [ NeedsManualRebaseline ] +Bug(eae) fast/forms/select/select-style.html [ NeedsManualRebaseline ] +Bug(eae) fast/forms/select/select-writing-direction-natural.html [ NeedsManualRebaseline ] +Bug(eae) fast/forms/suggestion-picker/datetimelocal-suggestion-picker-appearance.html [ NeedsManualRebaseline ] +Bug(eae) fast/forms/suggestion-picker/datetimelocal-suggestion-picker-appearance-locale-hebrew.html [ NeedsManualRebaseline ] +Bug(eae) fast/forms/suggestion-picker/datetimelocal-suggestion-picker-appearance-rtl.html [ NeedsManualRebaseline ] +Bug(eae) fast/forms/suggestion-picker/datetimelocal-suggestion-picker-appearance-with-scroll-bar.html [ NeedsManualRebaseline ] +Bug(eae) fast/forms/suggestion-picker/month-suggestion-picker-appearance.html [ NeedsManualRebaseline ] +Bug(eae) fast/forms/suggestion-picker/month-suggestion-picker-appearance-rtl.html [ NeedsManualRebaseline ] +Bug(eae) fast/forms/suggestion-picker/month-suggestion-picker-appearance-with-scroll-bar.html [ NeedsManualRebaseline ] +Bug(eae) fast/forms/suggestion-picker/time-suggestion-picker-appearance.html [ NeedsManualRebaseline ] +Bug(eae) fast/forms/suggestion-picker/week-suggestion-picker-appearance.html [ NeedsManualRebaseline ] +Bug(eae) fast/forms/suggestion-picker/week-suggestion-picker-appearance-rtl.html [ NeedsManualRebaseline ] +Bug(eae) fast/forms/suggestion-picker/week-suggestion-picker-appearance-with-scroll-bar.html [ NeedsManualRebaseline ] +Bug(eae) fast/forms/targeted-frame-submission.html [ NeedsManualRebaseline ] +Bug(eae) fast/forms/textarea/reset-textarea.html [ NeedsManualRebaseline ] +Bug(eae) fast/forms/textarea/textarea-placeholder-pseudo-style.html [ NeedsManualRebaseline ] +Bug(eae) fast/forms/textarea/textarea-placeholder-visibility-1.html [ NeedsManualRebaseline ] +Bug(eae) fast/forms/textarea/textarea-placeholder-visibility-2.html [ NeedsManualRebaseline ] +Bug(eae) fast/forms/text/input-appearance-focus.html [ NeedsManualRebaseline ] +Bug(eae) fast/forms/text/input-no-renderer.html [ NeedsManualRebaseline ] +Bug(eae) fast/forms/text/input-placeholder-visibility-1.html [ NeedsManualRebaseline ] +Bug(eae) fast/forms/text/input-placeholder-visibility-3.html [ NeedsManualRebaseline ] +Bug(eae) fast/forms/text/placeholder-pseudo-style.html [ NeedsManualRebaseline ] +Bug(eae) fast/forms/time/time-appearance-basic.html [ NeedsManualRebaseline ] +Bug(eae) fast/frames/frameElement-frame.html [ NeedsManualRebaseline ] +Bug(eae) fast/frames/frameElement-iframe.html [ NeedsManualRebaseline ] +Bug(eae) fast/frames/frameset-style-recalc.html [ NeedsManualRebaseline ] +Bug(eae) fast/frames/iframe-with-frameborder.html [ NeedsManualRebaseline ] +Bug(eae) fast/frames/onlyCommentInIFrame.html [ NeedsManualRebaseline ] +Bug(eae) fast/gradients/radial-centered.html [ NeedsManualRebaseline ] +Bug(eae) fast/html/font-weight-bold-for-b-and-strong.html [ NeedsManualRebaseline ] +Bug(eae) fast/images/favicon-as-image.html [ NeedsManualRebaseline ] +Bug(eae) fast/inline-block/14498-positionForCoordinates.html [ NeedsManualRebaseline ] +Bug(eae) fast/inline-block/contenteditable-baseline.html [ NeedsManualRebaseline ] +Bug(eae) fast/inline/continuation-outlines.html [ NeedsManualRebaseline ] +Bug(eae) fast/inline/continuation-outlines-with-layers.html [ NeedsManualRebaseline ] +Bug(eae) fast/inline/drawStyledEmptyInlines.html [ NeedsManualRebaseline ] +Bug(eae) fast/inline/drawStyledEmptyInlinesWithWS.html [ NeedsManualRebaseline ] +Bug(eae) fast/inline/inline-borders-with-bidi-override.html [ NeedsManualRebaseline ] +Bug(eae) fast/inline/inline-continuation-borders.html [ NeedsManualRebaseline ] +Bug(eae) fast/inline/long-wrapped-line.html [ NeedsManualRebaseline ] +Bug(eae) fast/invalid/003.html [ NeedsManualRebaseline ] +Bug(eae) fast/invalid/012.html [ NeedsManualRebaseline ] +Bug(eae) fast/invalid/016.html [ NeedsManualRebaseline ] +Bug(eae) fast/invalid/019.html [ NeedsManualRebaseline ] +Bug(eae) fast/invalid/junk-data.xml [ NeedsManualRebaseline ] +Bug(eae) fast/invalid/missing-end-tag.xhtml [ NeedsManualRebaseline ] +Bug(eae) fast/layers/inline-dirty-z-order-lists.html [ NeedsManualRebaseline ] +Bug(eae) fast/layers/opacity-transforms.html [ NeedsManualRebaseline ] +Bug(eae) fast/layers/scroll-rect-to-visible.html [ NeedsManualRebaseline ] +Bug(eae) fast/layers/video-layer.html [ NeedsManualRebaseline ] +Bug(eae) fast/layers/zindex-inherit.html [ NeedsManualRebaseline ] +Bug(eae) fast/lists/003.html [ NeedsManualRebaseline ] +Bug(eae) fast/lists/003-vertical.html [ NeedsManualRebaseline ] +Bug(eae) fast/lists/007.html [ NeedsManualRebaseline ] +Bug(eae) fast/lists/007-vertical.html [ NeedsManualRebaseline ] +Bug(eae) fast/lists/big-list-marker.html [ NeedsManualRebaseline ] +Bug(eae) fast/lists/ol-display-types.html [ NeedsManualRebaseline ] +Bug(eae) fast/masking/clip-path-inset-large-radii.html [ NeedsManualRebaseline ] +Bug(eae) fast/overflow/003.xml [ NeedsManualRebaseline ] +Bug(eae) fast/overflow/004.html [ NeedsManualRebaseline ] +Bug(eae) fast/overflow/007.html [ NeedsManualRebaseline ] +Bug(eae) fast/overflow/border-radius-clipping.html [ NeedsManualRebaseline ] +Bug(eae) fast/overflow/dynamic-hidden.html [ NeedsManualRebaseline ] +Bug(eae) fast/overflow/float-in-relpositioned.html [ NeedsManualRebaseline ] +Bug(eae) fast/overflow/hit-test-overflow-controls.html [ NeedsManualRebaseline ] +Bug(eae) fast/overflow/overflow-auto-position-absolute.html [ NeedsManualRebaseline ] +Bug(eae) fast/overflow/overflow-auto-table.html [ NeedsManualRebaseline ] +Bug(eae) fast/overflow/overflow-focus-ring.html [ NeedsManualRebaseline ] +Bug(eae) fast/overflow/overflow-stacking.html [ NeedsManualRebaseline ] +Bug(eae) fast/overflow/overflow-text-hit-testing.html [ NeedsManualRebaseline ] +Bug(eae) fast/overflow/overflow-with-local-background-attachment.html [ NeedsManualRebaseline ] +Bug(eae) fast/overflow/overflow-x-y.html [ NeedsManualRebaseline ] +Bug(eae) fast/overflow/position-fixed-transform-clipping.html [ NeedsManualRebaseline ] +Bug(eae) fast/overflow/scrollbar-position-update.html [ NeedsManualRebaseline ] +Bug(eae) fast/overflow/scroll-nested-positioned-layer-in-overflow.html [ NeedsManualRebaseline ] +Bug(eae) fast/overflow/table-overflow-float.html [ NeedsManualRebaseline ] +Bug(eae) fast/parser/document-write-option.html [ NeedsManualRebaseline ] +Bug(eae) fast/parser/fonts.html [ NeedsManualRebaseline ] +Bug(eae) fast/parser/nofoo-tags-inside-paragraph.html [ NeedsManualRebaseline ] +Bug(eae) fast/parser/xhtml-alternate-entities.xml [ NeedsManualRebaseline ] +Bug(eae) fast/reflections/abs-position-in-reflection.html [ NeedsManualRebaseline ] +Bug(eae) fast/reflections/inline-crash.html [ NeedsManualRebaseline ] +Bug(eae) fast/reflections/reflection-overflow-hidden.html [ NeedsManualRebaseline ] +Bug(eae) fast/reflections/transparent-reflected-sublayers.html [ NeedsManualRebaseline ] +Bug(eae) fast/repaint/inline-block-overflow.html [ NeedsManualRebaseline ] +Bug(eae) fast/repaint/line-flow-with-floats-10.html [ NeedsManualRebaseline ] +Bug(eae) fast/repaint/line-flow-with-floats-1.html [ NeedsManualRebaseline ] +Bug(eae) fast/repaint/line-flow-with-floats-2.html [ NeedsManualRebaseline ] +Bug(eae) fast/repaint/line-flow-with-floats-3.html [ NeedsManualRebaseline ] +Bug(eae) fast/repaint/line-flow-with-floats-4.html [ NeedsManualRebaseline ] +Bug(eae) fast/repaint/line-flow-with-floats-5.html [ NeedsManualRebaseline ] +Bug(eae) fast/repaint/line-flow-with-floats-6.html [ NeedsManualRebaseline ] +Bug(eae) fast/repaint/line-flow-with-floats-7.html [ NeedsManualRebaseline ] +Bug(eae) fast/repaint/line-flow-with-floats-8.html [ NeedsManualRebaseline ] +Bug(eae) fast/repaint/line-flow-with-floats-9.html [ NeedsManualRebaseline ] +Bug(eae) fast/repaint/overflow-outline-repaint.html [ NeedsManualRebaseline ] +Bug(eae) fast/repaint/remove-inline-after-layout.html [ NeedsManualRebaseline ] +Bug(eae) fast/repaint/remove-inline-layer-after-layout.html [ NeedsManualRebaseline ] +Bug(eae) fast/repaint/text-append-dirty-lines.html [ NeedsManualRebaseline ] +Bug(eae) fast/repaint/text-selection-rect-in-overflow-2.html [ NeedsManualRebaseline ] +Bug(eae) fast/replaced/001.html [ NeedsManualRebaseline ] +Bug(eae) fast/replaced/002.html [ NeedsManualRebaseline ] +Bug(eae) fast/replaced/003.html [ NeedsManualRebaseline ] +Bug(eae) fast/replaced/004.html [ NeedsManualRebaseline ] +Bug(eae) fast/replaced/image-sizing.html [ NeedsManualRebaseline ] +Bug(eae) fast/replaced/inline-box-wrapper-handover.html [ NeedsManualRebaseline ] +Bug(eae) fast/ruby/rubyDOM-remove-text1.html [ NeedsManualRebaseline ] +Bug(eae) fast/ruby/rubyDOM-remove-text2.html [ NeedsManualRebaseline ] +Bug(eae) fast/ruby/ruby-empty-rt.html [ NeedsManualRebaseline ] +Bug(eae) fast/ruby/ruby-length.html [ NeedsManualRebaseline ] +Bug(eae) fast/ruby/ruby-simple.html [ NeedsManualRebaseline ] +Bug(eae) fast/selectors/unqualified-hover-quirks.html [ NeedsManualRebaseline ] +Bug(eae) fast/selectors/unqualified-hover-strict.html [ NeedsManualRebaseline ] +Bug(eae) fast/selectors/visited-descendant.html [ NeedsManualRebaseline ] +Bug(eae) fast/table/003.html [ NeedsManualRebaseline ] +Bug(eae) fast/table/009.html [ NeedsManualRebaseline ] +Bug(eae) fast/table/016.html [ NeedsManualRebaseline ] +Bug(eae) fast/table/017.html [ NeedsManualRebaseline ] +Bug(eae) fast/table/018.html [ NeedsManualRebaseline ] +Bug(eae) fast/table/038.html [ NeedsManualRebaseline ] +Bug(eae) fast/table/038-vertical.html [ NeedsManualRebaseline ] +Bug(eae) fast/table/absolute-table-at-bottom.html [ NeedsManualRebaseline ] +Bug(eae) fast/table/add-before-anonymous-child.html [ NeedsManualRebaseline ] +Bug(eae) fast/table/border-collapsing/003.html [ NeedsManualRebaseline ] +Bug(eae) fast/table/border-collapsing/003-vertical.html [ NeedsManualRebaseline ] +Bug(eae) fast/table/border-collapsing/004.html [ NeedsManualRebaseline ] +Bug(eae) fast/table/border-collapsing/004-vertical.html [ NeedsManualRebaseline ] +Bug(eae) fast/table/cell-absolute-child.html [ NeedsManualRebaseline ] +Bug(eae) fast/table/cell-width-auto.html [ NeedsManualRebaseline ] +Bug(eae) fast/table/click-near-anonymous-table.html [ NeedsManualRebaseline ] +Bug(eae) fast/table/edge-offsets.html [ NeedsManualRebaseline ] +Bug(eae) fast/table/empty-cells.html [ NeedsManualRebaseline ] +Bug(eae) fast/table/fixed-table-with-percent-width-inside-extra-large-div.html [ NeedsManualRebaseline ] +Bug(eae) fast/table/insert-cell-before-form.html [ NeedsManualRebaseline ] +Bug(eae) fast/table/insert-row-before-form.html [ NeedsManualRebaseline ] +Bug(eae) fast/table/large-width.html [ NeedsManualRebaseline ] +Bug(eae) fast/table/nested-percent-height-table.html [ NeedsManualRebaseline ] +Bug(eae) fast/table/nobr.html [ NeedsManualRebaseline ] +Bug(eae) fast/table/overflowHidden.html [ NeedsManualRebaseline ] +Bug(eae) fast/table/percent-heights.html [ NeedsManualRebaseline ] +Bug(eae) fast/table/table-display-types.html [ NeedsManualRebaseline ] +Bug(eae) fast/table/table-display-types-strict.html [ NeedsManualRebaseline ] +Bug(eae) fast/table/table-display-types-vertical.html [ NeedsManualRebaseline ] +Bug(eae) fast/table/text-field-baseline.html [ NeedsManualRebaseline ] +Bug(eae) fast/text-autosizing/display-type-change.html [ NeedsManualRebaseline ] +Bug(eae) fast/text/chromium-linux-fontconfig-renderstyle.html [ NeedsManualRebaseline ] +Bug(eae) fast/text/stroking-decorations.html [ NeedsManualRebaseline ] +Bug(eae) fast/text/stroking.html [ NeedsManualRebaseline ] +Bug(eae) fast/transforms/diamond.html [ NeedsManualRebaseline ] +Bug(eae) fast/transforms/transform-on-inline.html [ NeedsManualRebaseline ] +Bug(eae) fast/transforms/transforms-with-opacity.html [ NeedsManualRebaseline ] +Bug(eae) fast/transforms/transforms-with-zoom.html [ NeedsManualRebaseline ] +Bug(eae) fast/writing-mode/english-rl-text.html [ NeedsManualRebaseline ] +Bug(eae) fast/writing-mode/japanese-lr-selection.html [ NeedsManualRebaseline ] +Bug(eae) fast/writing-mode/japanese-rl-selection.html [ NeedsManualRebaseline ] +Bug(eae) fast/writing-mode/text-combine-various-fonts.html [ NeedsManualRebaseline ] +Bug(eae) fast/writing-mode/text-orientation-basic.html [ NeedsManualRebaseline ] +Bug(eae) fast/writing-mode/vertical-baseline-alignment.html [ NeedsManualRebaseline ] +Bug(eae) fast/xsl/document-function.xml [ NeedsManualRebaseline ] +Bug(eae) fast/xsl/xslt-extra-content-at-end.xml [ NeedsManualRebaseline ] +Bug(eae) http/tests/filesystem/input-display.html [ NeedsManualRebaseline ] +Bug(eae) http/tests/misc/acid3.html [ NeedsManualRebaseline ] +Bug(eae) http/tests/misc/favicon-as-image.html [ NeedsManualRebaseline ] +Bug(eae) http/tests/misc/slow-loading-mask.html [ NeedsManualRebaseline ] +Bug(eae) http/tests/security/dataTransfer-set-data-file-url.html [ NeedsManualRebaseline ] +Bug(eae) ietestcenter/css3/bordersbackgrounds/background-color-applied-to-rounded-inline-element.htm [ NeedsManualRebaseline ] +Bug(eae) ietestcenter/css3/bordersbackgrounds/background_repeat_space_content_box.htm [ NeedsManualRebaseline ] +Bug(eae) ietestcenter/css3/bordersbackgrounds/border-radius-applies-to-001.htm [ NeedsManualRebaseline ] +Bug(eae) ietestcenter/css3/bordersbackgrounds/border-radius-applies-to-002.htm [ NeedsManualRebaseline ] +Bug(eae) ietestcenter/css3/bordersbackgrounds/border-radius-applies-to-003.htm [ NeedsManualRebaseline ] +Bug(eae) ietestcenter/css3/bordersbackgrounds/border-radius-applies-to-004.htm [ NeedsManualRebaseline ] +Bug(eae) ietestcenter/css3/bordersbackgrounds/border-radius-applies-to-005.htm [ NeedsManualRebaseline ] +Bug(eae) ietestcenter/css3/bordersbackgrounds/border-radius-applies-to-006.htm [ NeedsManualRebaseline ] +Bug(eae) ietestcenter/css3/bordersbackgrounds/border-radius-applies-to-007.htm [ NeedsManualRebaseline ] +Bug(eae) ietestcenter/css3/bordersbackgrounds/border-radius-applies-to-008.htm [ NeedsManualRebaseline ] +Bug(eae) ietestcenter/css3/bordersbackgrounds/border-radius-applies-to-009.htm [ NeedsManualRebaseline ] +Bug(eae) ietestcenter/css3/bordersbackgrounds/border-radius-applies-to-011.htm [ NeedsManualRebaseline ] +Bug(eae) ietestcenter/css3/bordersbackgrounds/border-radius-applies-to-012.htm [ NeedsManualRebaseline ] +Bug(eae) ietestcenter/css3/bordersbackgrounds/border-radius-applies-to-013.htm [ NeedsManualRebaseline ] +Bug(eae) ietestcenter/css3/bordersbackgrounds/border-radius-applies-to-014.htm [ NeedsManualRebaseline ] +Bug(eae) ietestcenter/css3/bordersbackgrounds/border-radius-applies-to-015.htm [ NeedsManualRebaseline ] +Bug(eae) ietestcenter/css3/bordersbackgrounds/border-radius-applies-to-016.htm [ NeedsManualRebaseline ] +Bug(eae) ietestcenter/css3/bordersbackgrounds/border-radius-not-inherited-001.htm [ NeedsManualRebaseline ] +Bug(eae) ietestcenter/css3/bordersbackgrounds/border-top-left-radius-values-001.htm [ NeedsManualRebaseline ] +Bug(eae) [ Mac10.10 Linux ] fast/text/justify-ideograph-vertical.html [ NeedsManualRebaseline ] +Bug(eae) [ Mac10.10 Win Linux ] fast/text/emphasis.html [ NeedsManualRebaseline ] +Bug(eae) [ Mac10.10 Win ] fast/text/emoticons.html [ NeedsManualRebaseline ] +Bug(eae) [ Mac10.10 Win ] fast/text/emphasis-complex.html [ NeedsManualRebaseline ] +Bug(eae) [ Mac10.10 Win Linux ] fast/text/international/complex-character-based-fallback.html [ NeedsManualRebaseline ] +Bug(eae) [ Mac10.10 Win ] fast/text/international/danda-space.html [ NeedsManualRebaseline ] +Bug(eae) [ Mac10.10 Win ] fast/text/international/hindi-spacing.html [ NeedsManualRebaseline ] +Bug(eae) [ Mac10.10 Win ] fast/text/international/hindi-whitespace.html [ NeedsManualRebaseline ] +Bug(eae) [ Mac10.10 Win ] fast/text/unicode-fallback-font.html [ NeedsManualRebaseline ] +Bug(eae) [ Mac10.9 ] fast/dynamic/window-resize-scrollbars-test.html [ NeedsManualRebaseline ] +Bug(eae) [ Mac ] fast/forms/text/text-font-height-mismatch.html [ NeedsManualRebaseline ] +Bug(eae) [ Mac Linux ] fast/writing-mode/english-lr-text.html [ NeedsManualRebaseline ] +Bug(eae) [ Mac Linux Win10 ] fast/css/font-weight-1.html [ NeedsManualRebaseline ] +Bug(eae) media/video-display-toggle.html [ NeedsManualRebaseline ] +Bug(eae) media/video-empty-source.html [ NeedsManualRebaseline ] +Bug(eae) media/video-no-audio.html [ NeedsManualRebaseline ] +Bug(eae) plugins/embed-attributes-style.html [ NeedsManualRebaseline ] +Bug(eae) printing/forced-break-tree-dump-only.html [ NeedsManualRebaseline ] +Bug(eae) scrollbars/scrollbars-on-positioned-content.html [ NeedsManualRebaseline ] +Bug(eae) svg/as-background-image/svg-as-background-5.html [ NeedsManualRebaseline ] +Bug(eae) svg/as-image/image-respects-pageScaleFactor.html [ NeedsManualRebaseline ] +Bug(eae) svg/batik/paints/patternRegionA.svg [ NeedsManualRebaseline ] +Bug(eae) svg/batik/text/smallFonts.svg [ NeedsManualRebaseline ] +Bug(eae) svg/batik/text/textFeatures.svg [ NeedsManualRebaseline ] +Bug(eae) svg/batik/text/textProperties2.svg [ NeedsManualRebaseline ] +Bug(eae) svg/batik/text/textProperties.svg [ NeedsManualRebaseline ] +Bug(eae) svg/canvas/canvas-pattern-svg.html [ NeedsManualRebaseline ] +Bug(eae) svg/carto.net/textbox.svg [ NeedsManualRebaseline ] +Bug(eae) svg/carto.net/window.svg [ NeedsManualRebaseline ] +Bug(eae) svg/custom/bug45331.svg [ NeedsManualRebaseline ] +Bug(eae) svg/custom/clip-mask-negative-scale.svg [ NeedsManualRebaseline ] +Bug(eae) svg/custom/fill-fallback.svg [ NeedsManualRebaseline ] +Bug(eae) svg/custom/image-rescale-scroll.html [ NeedsManualRebaseline ] +Bug(eae) svg/custom/invalid-css.svg [ NeedsManualRebaseline ] +Bug(eae) svg/custom/invalid-fill-hex.svg [ NeedsManualRebaseline ] +Bug(eae) svg/custom/invalid-stroke-hex.svg [ NeedsManualRebaseline ] +Bug(eae) svg/custom/junk-data.svg [ NeedsManualRebaseline ] +Bug(eae) svg/custom/load-non-wellformed.svg [ NeedsManualRebaseline ] +Bug(eae) svg/custom/marker-orient-auto.html [ NeedsManualRebaseline ] +Bug(eae) svg/custom/missing-xlink.svg [ NeedsManualRebaseline ] +Bug(eae) svg/custom/path-bad-data.svg [ NeedsManualRebaseline ] +Bug(eae) svg/custom/rootmost-svg-xy-attrs.xhtml [ NeedsManualRebaseline ] +Bug(eae) svg/custom/scrolling-embedded-svg-file-image-repaint-problem.html [ NeedsManualRebaseline ] +Bug(eae) svg/custom/stroked-pattern.svg [ NeedsManualRebaseline ] +Bug(eae) svg/custom/stroke-fallback.svg [ NeedsManualRebaseline ] +Bug(eae) svg/custom/svg-float-border-padding.xml [ NeedsManualRebaseline ] +Bug(eae) svg/custom/text-filter.svg [ NeedsManualRebaseline ] +Bug(eae) svg/custom/use-font-face-crash.svg [ NeedsManualRebaseline ] +Bug(eae) svg/custom/viewport-em.svg [ NeedsManualRebaseline ] +Bug(eae) svg/hixie/data-types/002.xhtml [ NeedsManualRebaseline ] +Bug(eae) svg/hixie/error/012.xml [ NeedsManualRebaseline ] +Bug(eae) svg/hixie/error/013.xml [ NeedsManualRebaseline ] +Bug(eae) svg/hixie/mixed/003.xml [ NeedsManualRebaseline ] +Bug(eae) svg/hixie/mixed/008.xml [ NeedsManualRebaseline ] +Bug(eae) svg/hixie/mixed/009.xml [ NeedsManualRebaseline ] +Bug(eae) svg/hixie/mixed/010.xml [ NeedsManualRebaseline ] +Bug(eae) svg/hixie/perf/007.xml [ NeedsManualRebaseline ] +Bug(eae) svg/hixie/rendering-model/003.xhtml [ NeedsManualRebaseline ] +Bug(eae) svg/hixie/viewbox/preserveAspectRatio/001.xml [ NeedsManualRebaseline ] +Bug(eae) svg/text/foreignObject-text-clipping-bug.xml [ NeedsManualRebaseline ] +Bug(eae) svg/text/text-repaint-rects.xhtml [ NeedsManualRebaseline ] +Bug(eae) svg/text/text-selection-tselect-01-b.svg [ NeedsManualRebaseline ] +Bug(eae) svg/text/text-selection-tspan-01-b.svg [ NeedsManualRebaseline ] +Bug(eae) svg/W3C-SVG-1.1/animate-elem-25-t.svg [ NeedsManualRebaseline ] +Bug(eae) svg/W3C-SVG-1.1/animate-elem-34-t.svg [ NeedsManualRebaseline ] +Bug(eae) svg/W3C-SVG-1.1/animate-elem-44-t.svg [ NeedsManualRebaseline ] +Bug(eae) svg/W3C-SVG-1.1/animate-elem-65-t.svg [ NeedsManualRebaseline ] +Bug(eae) svg/W3C-SVG-1.1/animate-elem-83-t.svg [ NeedsManualRebaseline ] +Bug(eae) svg/W3C-SVG-1.1/filters-light-01-f.svg [ NeedsManualRebaseline ] +Bug(eae) svg/W3C-SVG-1.1/masking-path-05-f.svg [ NeedsManualRebaseline ] +Bug(eae) svg/W3C-SVG-1.1/painting-render-01-b.svg [ NeedsManualRebaseline ] +Bug(eae) svg/W3C-SVG-1.1/paths-data-06-t.svg [ NeedsManualRebaseline ] +Bug(eae) svg/W3C-SVG-1.1/paths-data-07-t.svg [ NeedsManualRebaseline ] +Bug(eae) svg/W3C-SVG-1.1/pservers-grad-01-b.svg [ NeedsManualRebaseline ] +Bug(eae) svg/W3C-SVG-1.1/pservers-grad-02-b.svg [ NeedsManualRebaseline ] +Bug(eae) svg/W3C-SVG-1.1/pservers-grad-03-b.svg [ NeedsManualRebaseline ] +Bug(eae) svg/W3C-SVG-1.1-SE/svgdom-over-01-f.svg [ NeedsManualRebaseline ] +Bug(eae) svg/W3C-SVG-1.1/styling-css-03-b.svg [ NeedsManualRebaseline ] +Bug(eae) svg/W3C-SVG-1.1/text-intro-04-t.svg [ NeedsManualRebaseline ] +Bug(eae) svg/W3C-SVG-1.1/text-tselect-01-b.svg [ NeedsManualRebaseline ] +Bug(eae) svg/W3C-SVG-1.1/text-tspan-01-b.svg [ NeedsManualRebaseline ] +Bug(eae) svg/zoom/page/zoom-hixie-mixed-008.xml [ NeedsManualRebaseline ] +Bug(eae) svg/zoom/page/zoom-hixie-mixed-009.xml [ NeedsManualRebaseline ] +Bug(eae) svg/zoom/page/zoom-svg-float-border-padding.xml [ NeedsManualRebaseline ] +Bug(eae) svg/zoom/text/zoom-hixie-mixed-008.xml [ NeedsManualRebaseline ] +Bug(eae) svg/zoom/text/zoom-hixie-mixed-009.xml [ NeedsManualRebaseline ] +Bug(eae) svg/zoom/text/zoom-svg-float-border-padding.xml [ NeedsManualRebaseline ] +Bug(eae) tables/layering/paint-test-layering-1.html [ NeedsManualRebaseline ] +Bug(eae) tables/layering/paint-test-layering-2.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/bugs/bug10296-1.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/bugs/bug1055-1.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/bugs/bug10633.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/bugs/bug113235-1.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/bugs/bug113235-2.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/bugs/bug1302.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/bugs/bug131020.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/bugs/bug131020_iframe.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/bugs/bug139524-2.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/bugs/bug1430.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/bugs/bug15544.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/bugs/bug16252.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/bugs/bug17130-1.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/bugs/bug17130-2.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/bugs/bug17138.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/bugs/bug18664.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/bugs/bug18955.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/bugs/bug2050.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/bugs/bug20579.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/bugs/bug20804.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/bugs/bug23235.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/bugs/bug23299.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/bugs/bug24200.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/bugs/bug24627.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/bugs/bug2479-1.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/bugs/bug2479-2.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/bugs/bug2479-3.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/bugs/bug2479-4.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/bugs/bug2509.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/bugs/bug25663.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/bugs/bug2947.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/bugs/bug2981-1.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/bugs/bug2997.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/bugs/bug30692.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/bugs/bug3977.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/bugs/bug44523.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/bugs/bug46268-3.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/bugs/bug46368-1.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/bugs/bug5538.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/bugs/bug5797.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/bugs/bug5799.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/bugs/bug5835.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/bugs/bug6304.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/bugs/bug68912.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/bugs/bug69382-1.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/bugs/bug709.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/bugs/bug7112-1.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/bugs/bug7112-2.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/bugs/bug7121-1.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/bugs/bug82946-1.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/bugs/bug82946-2.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/bugs/bug8858.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/bugs/bug93363.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/bugs/bug96334.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/collapsing_borders/bug41262-3.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/core/bloomberg.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/dom/deleteTbodyRebuild1.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla_expected_failures/bugs/bug1128.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla_expected_failures/bugs/bug14007-2.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla_expected_failures/bugs/bug1725.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla_expected_failures/bugs/bug18770.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla_expected_failures/bugs/bug2479-5.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla_expected_failures/bugs/bug25707.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla_expected_failures/bugs/bug32205-1.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla_expected_failures/bugs/bug42043.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla_expected_failures/bugs/bug46268-4.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla_expected_failures/bugs/bug51000.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla_expected_failures/bugs/bug56024.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla_expected_failures/bugs/bug80762-2.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla_expected_failures/bugs/bug8499.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla_expected_failures/bugs/bug89315.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla_expected_failures/core/backgrounds.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla_expected_failures/marvin/x_table_rules_all.xml [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla_expected_failures/marvin/x_table_rules_cols.xml [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla_expected_failures/marvin/x_table_rules_rows.xml [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla_expected_failures/other/test4.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/marvin/tables_border_1.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/marvin/tables_border_2.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/marvin/tables_border_3.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/marvin/tables_row_th_nowrap.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/marvin/tables_td_align_center.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/marvin/tables_td_nowrap.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/marvin/tables_width_percent.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/marvin/tbody_align_char.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/marvin/tbody_align_justify.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/marvin/tfoot_align_char.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/marvin/tfoot_align_justify.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/marvin/thead_align_char.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/marvin/thead_align_justify.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/marvin/tr_bgcolor_white.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/marvin/tr_bgcolor_white_rgb.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/marvin/x_table_border_none.xml [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/marvin/x_table_border_px.xml [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/marvin/x_table_border.xml [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/marvin/x_table_class.xml [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/marvin/x_table_id.xml [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/marvin/x_table_rules_groups.xml [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/marvin/x_table_rules_none.xml [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/other/cell_widths.html [ NeedsManualRebaseline ] +Bug(eae) tables/mozilla/other/wa_table_tr_align.html [ NeedsManualRebaseline ] +Bug(eae) transforms/3d/general/perspective-units.html [ NeedsManualRebaseline ] +Bug(eae) transforms/3d/hit-testing/backface-hit-test.html [ NeedsManualRebaseline ] +Bug(eae) transforms/3d/hit-testing/backface-no-transform-hit-test.html [ NeedsManualRebaseline ] +Bug(eae) virtual/display_list_2d_canvas/fast/canvas/setWidthResetAfterForcedRender.html [ NeedsManualRebaseline ] +Bug(eae) virtual/display_list_2d_canvas/fast/canvas/shadow-offset-1.html [ NeedsManualRebaseline ] +Bug(eae) virtual/display_list_2d_canvas/fast/canvas/toDataURL-alpha.html [ NeedsManualRebaseline ] +Bug(eae) virtual/gpu/fast/canvas/setWidthResetAfterForcedRender.html [ NeedsManualRebaseline ] +Bug(eae) virtual/gpu/fast/canvas/shadow-offset-1.html [ NeedsManualRebaseline ] +Bug(eae) virtual/gpu/fast/canvas/toDataURL-alpha.html [ NeedsManualRebaseline ] +Bug(eae) virtual/gpu-rasterization/fast/images/favicon-as-image.html [ NeedsManualRebaseline ] +Bug(eae) virtual/pointerevent/fast/events/autoscroll.html [ NeedsManualRebaseline ] +Bug(eae) virtual/pointerevent/fast/events/pointer-events-2.html [ NeedsManualRebaseline ] +Bug(eae) virtual/prefer_compositing_to_lcd_text/compositing/overflow/nested-scrolling.html [ NeedsManualRebaseline ] +Bug(eae) virtual/prefer_compositing_to_lcd_text/compositing/overflow/remove-overflow-crash2.html [ NeedsManualRebaseline ] +Bug(eae) virtual/prefer_compositing_to_lcd_text/compositing/overflow/scroll-ancestor-update.html [ NeedsManualRebaseline ] +Bug(eae) virtual/prefer_compositing_to_lcd_text/scrollbars/scrollbars-on-positioned-content.html [ NeedsManualRebaseline ] +Bug(eae) virtual/rootlayerscrolls/scrollbars/scrollbars-on-positioned-content.html [ NeedsManualRebaseline ] +Bug(eae) virtual/spv2/fast/clip/001.html [ NeedsManualRebaseline ] +Bug(eae) virtual/spv2/fast/clip/002.html [ NeedsManualRebaseline ] +Bug(eae) virtual/spv2/fast/clip/003.html [ NeedsManualRebaseline ] +Bug(eae) virtual/spv2/fast/clip/004.html [ NeedsManualRebaseline ] +Bug(eae) virtual/spv2/fast/clip/005.html [ NeedsManualRebaseline ] +Bug(eae) virtual/spv2/fast/clip/006.html [ NeedsManualRebaseline ] +Bug(eae) virtual/spv2/fast/clip/007.html [ NeedsManualRebaseline ] +Bug(eae) virtual/spv2/fast/clip/008.html [ NeedsManualRebaseline ] +Bug(eae) virtual/spv2/fast/clip/009.html [ NeedsManualRebaseline ] +Bug(eae) virtual/spv2/fast/clip/011.html [ NeedsManualRebaseline ] +Bug(eae) virtual/spv2/fast/clip/012.html [ NeedsManualRebaseline ] +Bug(eae) virtual/spv2/fast/clip/013.html [ NeedsManualRebaseline ] +Bug(eae) virtual/spv2/fast/clip/014.html [ NeedsManualRebaseline ] +Bug(eae) virtual/spv2/fast/clip/015.html [ NeedsManualRebaseline ] +Bug(eae) virtual/spv2/fast/clip/016.html [ NeedsManualRebaseline ] +Bug(eae) virtual/spv2/fast/overflow/004.html [ NeedsManualRebaseline ] +Bug(eae) virtual/spv2/fast/overflow/overflow-auto-position-absolute.html [ NeedsManualRebaseline ] +Bug(eae) virtual/spv2/fast/overflow/overflow-auto-table.html [ NeedsManualRebaseline ] +Bug(eae) virtual/threaded/printing/forced-break-tree-dump-only.html [ NeedsManualRebaseline ] +Bug(eae) virtual/trustedeventsdefaultaction/fast/events/autoscroll.html [ NeedsManualRebaseline ] +Bug(eae) virtual/trustedeventsdefaultaction/fast/events/pointer-events-2.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux ] fast/forms/select/menulist-narrow-width.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/aat-morx.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/atsui-kerning-and-ligatures.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/atsui-multiple-renderers.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/atsui-partial-selection.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/atsui-pointtooffset-calls-cg.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/atsui-rtl-override-selection.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/atsui-small-caps-punctuation-size.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/atsui-spacing-features.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text-autosizing/hackernews-comments.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text-autosizing/tables/css-table-lots-of-text-many-cells.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text-autosizing/tables/css-table-single-cell-lots-of-text.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text-autosizing/tables/fixed-table-lots-of-text-many-cells.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text-autosizing/tables/fixed-table-single-cell-lots-of-text.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text-autosizing/tables/lots-of-text-many-cells.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text-autosizing/tables/narrow-percentage-width.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text-autosizing/tables/narrow-specified-width.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text-autosizing/tables/nested-tables.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text-autosizing/tables/nested-table-wrapping.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text-autosizing/tables/single-cell-lots-of-text.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text-autosizing/tables/single-percent-width-cell-lots-of-text.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text-autosizing/tables/table-cell-inflation.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text-autosizing/tables/table-for-layout.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text-autosizing/tables/wide-percentage-width.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text-autosizing/tables/wide-specified-width.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/basic/002.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/basic/003.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/basic/004.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/basic/005.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/basic/006.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/basic/007.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/basic/008.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/basic/011.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/basic/012.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/basic/013.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/basic/014.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/basic/015.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/basic/generic-family-changes.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/bidi-embedding-pop-and-push-same.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/bidi-img-alt-text.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/break-word.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/capitalize-boundaries.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/capitalize-empty-generated-string.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/capitalize-preserve-nbsp.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/caps-lock-indicator-disabled.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/caps-lock-indicator-enabled.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/cg-fallback-bolding.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/complex-path-with-no-subpixel-fonts.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/complex-preferred-logical-widths.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/complex-synthetic-bold-space-width.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/complex-text-rtl-selection-repaint.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/delete-hard-break-character.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/drawBidiText.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/embed-at-end-of-pre-wrap-line.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/emoji-web-font.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/emphasis-ellipsis-complextext.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/emphasis-vertical.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/fake-italic.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/fallback-for-custom-font.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/firstline/001.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/firstline/002.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/firstline/003.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/font-ascent-mac.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/font-fallback.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/font-initial.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/font-smallcaps-layout.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/font-stretch.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/font-stretch-variant.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/font-weight.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/font-weight-variant.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/format-control.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/in-rendered-text-rtl.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/international/001.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/international/alef-connected.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/international/bidi-AN-after-empty-run.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/international/bidi-AN-after-L.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/international/bidi-control-chars-treated-as-ZWS.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/international/bidi-CS-after-AN.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/international/bidi-european-terminators.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/international/bidi-explicit-embedding.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/international/bidi-ignored-for-first-child-inline.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/international/bidi-innertext.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/international/bidi-L2-run-reordering.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/international/bidi-layout-across-linebreak.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/international/bidi-LDB-2-CSS.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/international/bidi-LDB-2-formatting-characters.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/international/bidi-LDB-2-HTML.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/international/bidi-linebreak-001.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/international/bidi-linebreak-002.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/international/bidi-linebreak-003.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/international/bidi-listbox-atsui.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/international/bidi-listbox.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/international/bidi-menulist.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/international/bidi-mirror-he-ar.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/international/bidi-neutral-directionality-paragraph-start.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/international/bidi-neutral-run.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/international/bidi-override.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/international/bold-bengali.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/international/complex-joining-using-gpos.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/international/hebrew-vowels.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/international/khmer-selection.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/international/lang-glyph-cache-separation.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/international/menulist-width-rtl.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/international/mixed-directionality-selection.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/international/plane2.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/international/pop-up-button-text-alignment-and-direction.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/international/rtl-caret.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/international/rtl-negative-letter-spacing.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/international/rtl-white-space-pre-wrap.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/international/text-spliced-font.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/international/thai-baht-space.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/international/thai-line-breaks.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/international/unicode-bidi-plaintext.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/international/unicode-bidi-plaintext-in-textarea.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/international/wrap-CJK-001.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/justified-selection-at-edge.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/justified-selection.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/justify-ideograph-complex.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/justify-ideograph-simple.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/large-text-composed-char.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/line-breaks-after-white-space.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/line-breaks.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/line-initial-and-final-swashes.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux ] fast/text/midword-break-after-breakable-char.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/midword-break-before-surrogate-pair.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/midword-break-hang.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/monospace-width-cache.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/reset-emptyRun.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/selection-hard-linebreak.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/selection-painting-hidpi.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/selection-rect-line-height-too-big.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/selection-rect-line-height-too-small.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/shadow-translucent-fill.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/shaping/same-script-different-lang.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/shaping/shaping-script-order.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/shaping/shaping-selection-rect.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/should-use-atsui.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/small-caps-turkish.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/softHyphen.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/sub-pixel/text-scaling-pixel.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/sub-pixel/text-scaling-vertical.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/textIteratorNilRenderer.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/text-letter-spacing.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/text-shadow-no-default-color.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/text-stroke-with-border.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/vertical-rl-rtl-linebreak.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/vertical-surrogate-pair.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/wbr.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/wbr-in-pre-crash.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/wbr-pre.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/wbr-styled.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/webfont-synthetic-bold.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/whitespace/001.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/whitespace/002.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/whitespace/003.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/whitespace/004.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/whitespace/005.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/whitespace/006.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/whitespace/007.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/whitespace/008.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/whitespace/009.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/whitespace/010.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/whitespace/011.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/whitespace/012.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/whitespace/015.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/whitespace/016.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/whitespace/018.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/whitespace/019.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/whitespace/020.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/whitespace/021.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/whitespace/023.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/whitespace/024.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/whitespace/025.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/whitespace/026.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/whitespace/027.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/whitespace/028.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/whitespace/029.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/whitespace/030.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/whitespace/normal-after-nowrap-breaking.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/whitespace/nowrap-clear-float.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/whitespace/pre-newline-box-test.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/whitespace/pre-wrap-last-char.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/whitespace/pre-wrap-line-test.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/whitespace/pre-wrap-overflow-selection.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/whitespace/pre-wrap-spaces-after-newline.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/whitespace/select-new-line-with-line-break-normal.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/whitespace/span-in-word-space-causes-overflow.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/wide-zero-width-space.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/word-break.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/word-break-run-rounding.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/word-break-soft-hyphen.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/word-space.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] fast/text/zero-font-size.html [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] ietestcenter/css3/text/textshadow-003.htm [ NeedsManualRebaseline ] +Bug(eae) [ Win Linux Mac10.10 Mac10.11 ] ietestcenter/css3/text/textshadow-004.htm [ NeedsManualRebaseline ] +Bug(eae) [ Win ] svg/W3C-SVG-1.1/paths-data-02-t.svg [ NeedsManualRebaseline ] +Bug(eae) [ Linux ] svg/transforms/animated-path-inside-transformed-html.xhtml [ NeedsManualRebaseline ] +Bug(eae) [ Win ] svg/transforms/animated-path-inside-transformed-html.xhtml [ NeedsManualRebaseline ] +Bug(eae) [ Win Release ] transforms/3d/point-mapping/3d-point-mapping-preserve-3d.html [ NeedsManualRebaseline ] + crbug.com/593679 virtual/scalefactor150/fast/hidpi/static/calendar-picker-appearance.html [ NeedsManualRebaseline ] crbug.com/593679 virtual/scalefactor200/fast/hidpi/static/calendar-picker-appearance.html [ NeedsManualRebaseline ] crbug.com/593679 virtual/scalefactor200withzoom/fast/hidpi/static/calendar-picker-appearance.html [ NeedsManualRebaseline ] crbug.com/603703 [ Linux ] imported/web-platform-tests/web-animations/animation-timeline/document-timeline.html [ Failure Pass ] -crbug.com/600248 imported/web-platform-tests/web-animations/keyframe-effect/getComputedTiming-progress.html [ Crash Failure ] -crbug.com/600248 imported/web-platform-tests/web-animations/keyframe-effect/getComputedTiming-currentIteration.html [ Crash Failure ] crbug.com/600248 imported/web-platform-tests/web-animations/animation-effect-timing/endDelay.html [ Failure ] crbug.com/600248 imported/web-platform-tests/web-animations/animation/constructor.html [ Failure Timeout ] + +crbug.com/604642 [ Mac ] fast/text/midword-break-after-breakable-char.html [ Failure ]
diff --git a/third_party/WebKit/LayoutTests/animations/animation-duration-infinite-expected.html b/third_party/WebKit/LayoutTests/animations/animation-duration-infinite-expected.html new file mode 100644 index 0000000..d4c112a --- /dev/null +++ b/third_party/WebKit/LayoutTests/animations/animation-duration-infinite-expected.html
@@ -0,0 +1,10 @@ +<!DOCTYPE html> +<div id='target'></div> +<style type="text/css"> + #target { + background-color: black; + width: 100px; + height: 100px; + opacity: 0.75; + } +</style>
diff --git a/third_party/WebKit/LayoutTests/animations/animation-duration-infinite.html b/third_party/WebKit/LayoutTests/animations/animation-duration-infinite.html new file mode 100644 index 0000000..3daebfd2 --- /dev/null +++ b/third_party/WebKit/LayoutTests/animations/animation-duration-infinite.html
@@ -0,0 +1,15 @@ +<!DOCTYPE html> +<div id='target'></div> +<style type="text/css"> + #target { + background-color: black; + width: 100px; + height: 100px; + } +</style> +<script> + var element = document.getElementById('target'); + var animation = element.animate( + {opacity: ['0', '1']}, + {duration: Infinity, iterationStart: 4.75}); +</script>
diff --git a/third_party/WebKit/LayoutTests/bluetooth/characteristicvaluechanged.html b/third_party/WebKit/LayoutTests/bluetooth/characteristicvaluechanged.html deleted file mode 100644 index 93243fd9..0000000 --- a/third_party/WebKit/LayoutTests/bluetooth/characteristicvaluechanged.html +++ /dev/null
@@ -1,58 +0,0 @@ -<!DOCTYPE html> -<script src="../resources/testharness.js"></script> -<script src="../resources/testharnessreport.js"></script> -<script src="../resources/bluetooth/bluetooth-helpers.js"></script> -<script> -'use strict'; -test(t => { assert_true(window.testRunner instanceof Object); t.done(); }, - 'window.testRunner is required for the following tests.'); - -promise_test(() => { - return setBluetoothFakeAdapter('HeartRateAdapter') - .then(() => requestDeviceWithKeyDown({ - filters: [{services: ['heart_rate']}]})) - .then(device => device.gatt.connect()) - .then(gattServer => gattServer.getPrimaryService('heart_rate')) - .then(service => service.getCharacteristic('body_sensor_location')) - .then(characteristic => { - return assert_event_fires_after_promise(characteristic, - 'readValue', - 'characteristicvaluechanged'); - }).then(results => { - let read_value = results[0].buffer; - let event_value = results[1].buffer; - // TODO(ortuno): The DataView used to resolve the promise - // should be the same DataView as the one saved in the - // characteristic. - // http://crbug.com/543347 - // assert_equals(event.target.value, value); - assert_array_equals(event_value, read_value); - }); -}, 'Reading a characteristic should fire an event.'); - -promise_test(() => { - return setBluetoothFakeAdapter('HeartRateAdapter') - .then(() => requestDeviceWithKeyDown({ - filters: [{services: ['heart_rate']}]})) - .then(device => device.gatt.connect()) - .then(gattServer => gattServer.getPrimaryService('heart_rate')) - .then(service => service.getCharacteristic('body_sensor_location')) - .then(characteristic => { - return assert_event_fires_after_promise(characteristic, - 'readValue', - 'characteristicvaluechanged', - 3 /* attach 3 listeners */); - }).then(results => { - let read_value = results[0].buffer; - let event_values = results.slice(1).map(v => v.buffer); - for (let event_value of event_values) { - // TODO(ortuno): The DataView used to resolve the promise - // should be the same DataView as the one saved in the - // characteristic. - // http://crbug.com/543347 - // assert_equals(event.target.value, value); - assert_array_equals(event_value, read_value); - } - }); -}, 'Add multiple event listeners then readValue().'); -</script>
diff --git a/third_party/WebKit/LayoutTests/bluetooth/readValue.html b/third_party/WebKit/LayoutTests/bluetooth/readValue.html deleted file mode 100644 index 9bb4418..0000000 --- a/third_party/WebKit/LayoutTests/bluetooth/readValue.html +++ /dev/null
@@ -1,118 +0,0 @@ -<!DOCTYPE html> -<script src="../resources/testharness.js"></script> -<script src="../resources/testharnessreport.js"></script> -<script src="../resources/bluetooth/bluetooth-helpers.js"></script> -<script> -'use strict'; - -test(t => { assert_true(window.testRunner instanceof Object); t.done(); }, - 'window.testRunner is required for the following tests.'); - -promise_test(() => { - return setBluetoothFakeAdapter('HeartRateAdapter') - .then(() => requestDeviceWithKeyDown({ - filters: [{services: ['heart_rate']}], - optionalServices: ['generic_access']})) - .then(device => device.gatt.connect()) - .then(gattServer => gattServer.getPrimaryService('generic_access')) - .then(service => service.getCharacteristic('gap.device_name')) - .then(characteristic => { - return setBluetoothFakeAdapter('EmptyAdapter') - .then(() => assert_promise_rejects_with_message( - characteristic.readValue(), - new DOMException( - 'Bluetooth Device is no longer in range.', - 'NetworkError'), - 'Device went out of range')); - }); -}, 'Device goes out of range. Reject with NetworkError.'); - -promise_test(() => { - return setBluetoothFakeAdapter('HeartRateAdapter') - .then(() => requestDeviceWithKeyDown({ - filters: [{services: ['heart_rate']}], - optionalServices: ['generic_access']})) - .then(device => device.gatt.connect()) - .then(gattServer => gattServer.getPrimaryService('generic_access')) - .then(service => service.getCharacteristic('gap.device_name')) - .then(characteristic => { - return setBluetoothFakeAdapter('MissingServiceHeartRateAdapter') - .then(() => assert_promise_rejects_with_message( - characteristic.readValue(), - new DOMException( - 'GATT Service no longer exists.', - 'InvalidStateError'), - 'Service got removed.')); - }); -}, 'Service gets removed. Reject with InvalidStateError.'); - -promise_test(() => { - return setBluetoothFakeAdapter('HeartRateAdapter') - .then(() => requestDeviceWithKeyDown({ - filters: [{services: ['heart_rate']}], - optionalServices: ['generic_access']})) - .then(device => device.gatt.connect()) - .then(gattService => gattService.getPrimaryService('generic_access')) - .then(service => service.getCharacteristic('gap.device_name')) - .then(characteristic => { - return setBluetoothFakeAdapter('MissingCharacteristicHeartRateAdapter') - .then(() => assert_promise_rejects_with_message( - characteristic.readValue(), - new DOMException( - 'GATT Characteristic no longer exists.', - 'InvalidStateError'), - 'Characteristic got removed.')); - }); -}, 'Characteristic gets removed. Reject with InvalidStateError.'); - -gatt_errors_tests.forEach(testSpec => { - promise_test(() => { - return setBluetoothFakeAdapter('FailingGATTOperationsAdapter') - .then(() => requestDeviceWithKeyDown({ - filters: [{services: [errorUUID(0xA0)]}]})) - .then(device => device.gatt.connect()) - .then(gattServer => gattServer.getPrimaryService(errorUUID(0xA0))) - .then(service => service.getCharacteristic(testSpec.uuid)) - .then(characteristic => { - return assert_promise_rejects_with_message( - characteristic.readValue(), - testSpec.error, - 'Trying to read the characteristic failed'); - }); - }, testSpec.testName); -}); - -promise_test(() => { - return setBluetoothFakeAdapter('HeartRateAdapter') - .then(() => requestDeviceWithKeyDown({ - filters: [{services: ['heart_rate']}], - optionalServices: ['generic_access']})) - .then(device => device.gatt.connect()) - .then(gattServer => gattServer.getPrimaryService('generic_access')) - .then(service => service.getCharacteristic('gap.device_name')) - .then(characteristic => characteristic.readValue()) - .then(value => { - let decoder = new TextDecoder('utf-8'); - let value_str = decoder.decode(value); - assert_equals(value_str, 'Heart Rate Device'); - }); -}, 'Request for characteristic. Should return right characteristic'); - -promise_test(() => { - return setBluetoothFakeAdapter('HeartRateAdapter') - .then(() => requestDeviceWithKeyDown({ - filters: [{services: ['heart_rate']}], - optionalServices: ['generic_access']})) - .then(device => device.gatt.connect()) - .then(gattServer => gattServer.getPrimaryService('generic_access')) - .then(service => service.getCharacteristic('gap.device_name')) - .then(characteristic => { - assert_equals(characteristic.value, null); - return characteristic.readValue().then(() => { - let decoder = new TextDecoder('utf-8'); - let value_str = decoder.decode(characteristic.value); - assert_equals(value_str, 'Heart Rate Device'); - }) - }); -}, 'Request for characteristic. Should update characteristic.value'); -</script>
diff --git a/third_party/WebKit/LayoutTests/bluetooth/readValue/add-multiple-event-listeners.html b/third_party/WebKit/LayoutTests/bluetooth/readValue/add-multiple-event-listeners.html new file mode 100644 index 0000000..883cbd4 --- /dev/null +++ b/third_party/WebKit/LayoutTests/bluetooth/readValue/add-multiple-event-listeners.html
@@ -0,0 +1,32 @@ +<!DOCTYPE html> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<script src="../../resources/bluetooth/bluetooth-helpers.js"></script> +<script> +'use strict'; +promise_test(() => { + return setBluetoothFakeAdapter('HeartRateAdapter') + .then(() => requestDeviceWithKeyDown({ + filters: [{services: ['heart_rate']}]})) + .then(device => device.gatt.connect()) + .then(gattServer => gattServer.getPrimaryService('heart_rate')) + .then(service => service.getCharacteristic('body_sensor_location')) + .then(characteristic => { + return assert_event_fires_after_promise(characteristic, + 'readValue', + 'characteristicvaluechanged', + 3 /* attach 3 listeners */); + }).then(results => { + let read_value = results[0].buffer; + let event_values = results.slice(1).map(v => v.buffer); + for (let event_value of event_values) { + // TODO(ortuno): The DataView used to resolve the promise + // should be the same DataView as the one saved in the + // characteristic. + // http://crbug.com/543347 + // assert_equals(event.target.value, value); + assert_array_equals(event_value, read_value); + } + }); +}, 'Add multiple event listeners then readValue().'); +</script>
diff --git a/third_party/WebKit/LayoutTests/bluetooth/readValue-blacklist.html b/third_party/WebKit/LayoutTests/bluetooth/readValue/blacklisted-characteristic.html similarity index 70% rename from third_party/WebKit/LayoutTests/bluetooth/readValue-blacklist.html rename to third_party/WebKit/LayoutTests/bluetooth/readValue/blacklisted-characteristic.html index 8f4c14c..458ca7c 100644 --- a/third_party/WebKit/LayoutTests/bluetooth/readValue-blacklist.html +++ b/third_party/WebKit/LayoutTests/bluetooth/readValue/blacklisted-characteristic.html
@@ -1,13 +1,9 @@ <!DOCTYPE html> -<script src="../resources/testharness.js"></script> -<script src="../resources/testharnessreport.js"></script> -<script src="../resources/bluetooth/bluetooth-helpers.js"></script> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<script src="../../resources/bluetooth/bluetooth-helpers.js"></script> <script> 'use strict'; - -test(t => { assert_true(window.testRunner instanceof Object); t.done(); }, - 'window.testRunner is required for the following tests.'); - promise_test(() => { return setBluetoothFakeAdapter('BlacklistTestAdapter') .then(() => requestDeviceWithKeyDown({ @@ -21,8 +17,8 @@ return characteristic.writeValue(new Uint8Array(1 /* length */)) .then(() => assert_promise_rejects_with_message( characteristic.readValue(), new DOMException( - 'readValue() called on blacklisted object marked exclude-reads.' + - ' https://goo.gl/4NeimX', + 'readValue() called on blacklisted object marked exclude-reads. ' + + 'https://goo.gl/4NeimX', 'SecurityError'), 'readValue() should reject.')) });
diff --git a/third_party/WebKit/LayoutTests/bluetooth/readValue/characteristic-is-removed.html b/third_party/WebKit/LayoutTests/bluetooth/readValue/characteristic-is-removed.html new file mode 100644 index 0000000..f89e58f2 --- /dev/null +++ b/third_party/WebKit/LayoutTests/bluetooth/readValue/characteristic-is-removed.html
@@ -0,0 +1,25 @@ +<!DOCTYPE html> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<script src="../../resources/bluetooth/bluetooth-helpers.js"></script> +<script> +'use strict'; +promise_test(() => { + return setBluetoothFakeAdapter('HeartRateAdapter') + .then(() => requestDeviceWithKeyDown({ + filters: [{services: ['heart_rate']}], + optionalServices: ['generic_access']})) + .then(device => device.gatt.connect()) + .then(gattServer => gattServer.getPrimaryService('generic_access')) + .then(service => service.getCharacteristic('gap.device_name')) + .then(characteristic => { + return setBluetoothFakeAdapter('MissingCharacteristicHeartRateAdapter') + .then(() => assert_promise_rejects_with_message( + characteristic.readValue(), + new DOMException( + 'GATT Characteristic no longer exists.', + 'InvalidStateError'), + 'Characteristic got removed.')); + }); +}, 'Characteristic gets removed. Reject with InvalidStateError.'); +</script>
diff --git a/third_party/WebKit/LayoutTests/bluetooth/readValue/device-goes-out-of-range.html b/third_party/WebKit/LayoutTests/bluetooth/readValue/device-goes-out-of-range.html new file mode 100644 index 0000000..ae5afa4 --- /dev/null +++ b/third_party/WebKit/LayoutTests/bluetooth/readValue/device-goes-out-of-range.html
@@ -0,0 +1,25 @@ +<!DOCTYPE html> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<script src="../../resources/bluetooth/bluetooth-helpers.js"></script> +<script> +'use strict'; +promise_test(() => { + return setBluetoothFakeAdapter('HeartRateAdapter') + .then(() => requestDeviceWithKeyDown({ + filters: [{services: ['heart_rate']}], + optionalServices: ['generic_access']})) + .then(device => device.gatt.connect()) + .then(gattServer => gattServer.getPrimaryService('generic_access')) + .then(service => service.getCharacteristic('gap.device_name')) + .then(characteristic => { + return setBluetoothFakeAdapter('EmptyAdapter') + .then(() => assert_promise_rejects_with_message( + characteristic.readValue(), + new DOMException( + 'Bluetooth Device is no longer in range.', + 'NetworkError'), + 'Device went out of range.')); + }); +}, 'Device goes out of range. Reject with NetworkError.'); +</script>
diff --git a/third_party/WebKit/LayoutTests/bluetooth/readValue/event-is-fired.html b/third_party/WebKit/LayoutTests/bluetooth/readValue/event-is-fired.html new file mode 100644 index 0000000..b57c1ba --- /dev/null +++ b/third_party/WebKit/LayoutTests/bluetooth/readValue/event-is-fired.html
@@ -0,0 +1,29 @@ +<!DOCTYPE html> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<script src="../../resources/bluetooth/bluetooth-helpers.js"></script> +<script> +'use strict'; +promise_test(() => { + return setBluetoothFakeAdapter('HeartRateAdapter') + .then(() => requestDeviceWithKeyDown({ + filters: [{services: ['heart_rate']}]})) + .then(device => device.gatt.connect()) + .then(gattServer => gattServer.getPrimaryService('heart_rate')) + .then(service => service.getCharacteristic('body_sensor_location')) + .then(characteristic => { + return assert_event_fires_after_promise(characteristic, + 'readValue', + 'characteristicvaluechanged'); + }).then(results => { + let read_value = results[0].buffer; + let event_value = results[1].buffer; + // TODO(ortuno): The DataView used to resolve the promise + // should be the same DataView as the one saved in the + // characteristic. + // http://crbug.com/543347 + // assert_equals(event.target.value, value); + assert_array_equals(event_value, read_value); + }); +}, 'Reading a characteristic should fire an event.'); +</script>
diff --git a/third_party/WebKit/LayoutTests/bluetooth/readValue/read-fails.html b/third_party/WebKit/LayoutTests/bluetooth/readValue/read-fails.html new file mode 100644 index 0000000..caf1ffb --- /dev/null +++ b/third_party/WebKit/LayoutTests/bluetooth/readValue/read-fails.html
@@ -0,0 +1,25 @@ +<!DOCTYPE html> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<script src="../../resources/bluetooth/bluetooth-helpers.js"></script> +<script> +'use strict'; +promise_test(() => { + return setBluetoothFakeAdapter('FailingGATTOperationsAdapter') + .then(() => requestDeviceWithKeyDown({ + filters: [{services: [errorUUID(0xA0)]}]})) + .then(device => device.gatt.connect()) + .then(gattServer => gattServer.getPrimaryService(errorUUID(0xA0))) + .then(service => { + let tests = Promise.resolve(); + gatt_errors_tests.forEach(testSpec => { + tests = tests.then(() => service.getCharacteristic(testSpec.uuid)) + .then(characteristic => assert_promise_rejects_with_message( + characteristic.readValue(), + testSpec.error, + testSpec.testName)); + }); + return tests; + }); +}, 'Read fails. Should reject with appropriate error.'); +</script>
diff --git a/third_party/WebKit/LayoutTests/bluetooth/readValue/read-succeeds.html b/third_party/WebKit/LayoutTests/bluetooth/readValue/read-succeeds.html new file mode 100644 index 0000000..590948a5 --- /dev/null +++ b/third_party/WebKit/LayoutTests/bluetooth/readValue/read-succeeds.html
@@ -0,0 +1,22 @@ +<!DOCTYPE html> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<script src="../../resources/bluetooth/bluetooth-helpers.js"></script> +<script> +'use strict'; +promise_test(() => { + return setBluetoothFakeAdapter('HeartRateAdapter') + .then(() => requestDeviceWithKeyDown({ + filters: [{services: ['heart_rate']}], + optionalServices: ['generic_access']})) + .then(device => device.gatt.connect()) + .then(gattServer => gattServer.getPrimaryService('generic_access')) + .then(service => service.getCharacteristic('gap.device_name')) + .then(characteristic => characteristic.readValue()) + .then(value => { + let decoder = new TextDecoder('utf-8'); + let value_str = decoder.decode(value); + assert_equals(value_str, 'Heart Rate Device'); + }); +}, 'A read request succeeds and returns the characteristic\'s value.'); +</script>
diff --git a/third_party/WebKit/LayoutTests/bluetooth/readValue/read-updates-value.html b/third_party/WebKit/LayoutTests/bluetooth/readValue/read-updates-value.html new file mode 100644 index 0000000..ee7d212 --- /dev/null +++ b/third_party/WebKit/LayoutTests/bluetooth/readValue/read-updates-value.html
@@ -0,0 +1,24 @@ +<!DOCTYPE html> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<script src="../../resources/bluetooth/bluetooth-helpers.js"></script> +<script> +'use strict'; +promise_test(() => { + return setBluetoothFakeAdapter('HeartRateAdapter') + .then(() => requestDeviceWithKeyDown({ + filters: [{services: ['heart_rate']}], + optionalServices: ['generic_access']})) + .then(device => device.gatt.connect()) + .then(gattServer => gattServer.getPrimaryService('generic_access')) + .then(service => service.getCharacteristic('gap.device_name')) + .then(characteristic => { + assert_equals(characteristic.value, null); + return characteristic.readValue().then(() => { + let decoder = new TextDecoder('utf-8'); + let value_str = decoder.decode(characteristic.value); + assert_equals(value_str, 'Heart Rate Device'); + }) + }); +}, 'Succesful read should update characteristic.value'); +</script>
diff --git a/third_party/WebKit/LayoutTests/bluetooth/readValue/service-is-removed.html b/third_party/WebKit/LayoutTests/bluetooth/readValue/service-is-removed.html new file mode 100644 index 0000000..2102375 --- /dev/null +++ b/third_party/WebKit/LayoutTests/bluetooth/readValue/service-is-removed.html
@@ -0,0 +1,25 @@ +<!DOCTYPE html> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<script src="../../resources/bluetooth/bluetooth-helpers.js"></script> +<script> +'use strict'; +promise_test(() => { + return setBluetoothFakeAdapter('HeartRateAdapter') + .then(() => requestDeviceWithKeyDown({ + filters: [{services: ['heart_rate']}], + optionalServices: ['generic_access']})) + .then(device => device.gatt.connect()) + .then(gattServer => gattServer.getPrimaryService('generic_access')) + .then(service => service.getCharacteristic('gap.device_name')) + .then(characteristic => { + return setBluetoothFakeAdapter('MissingServiceHeartRateAdapter') + .then(() => assert_promise_rejects_with_message( + characteristic.readValue(), + new DOMException( + 'GATT Service no longer exists.', + 'InvalidStateError'), + 'Service got removed.')); + }); +}, 'Service gets removed. Reject with InvalidStateError.'); +</script>
diff --git a/third_party/WebKit/LayoutTests/css3/flexbox/definite-cross-sizes.html b/third_party/WebKit/LayoutTests/css3/flexbox/definite-cross-sizes.html index d78de16a..9ab6f07 100644 --- a/third_party/WebKit/LayoutTests/css3/flexbox/definite-cross-sizes.html +++ b/third_party/WebKit/LayoutTests/css3/flexbox/definite-cross-sizes.html
@@ -31,22 +31,21 @@ <div id=log></div> <p>This test verifies that we consider flex items' cross sizes to be definite -iff the flexbox has a definite cross size, is single-line, and the align value -is stretch (the default)</p> +if the align value is stretch (the default)</p> -<p>Tests that we get an indefinite size in the normal case.</p> +<p>Tests that we get a definite size in the simple case.</p> <div class="flexbox" data-expected-height="50"> <div data-expected-height="50"> - <div style="height: 50%" data-expected-height="50"> + <div style="height: 50%" data-expected-height="25"> <div class="rect" data-expected-height="50"></div> </div> </div> </div> -<p>Tests that we get an indefinite size in a wrapping flexbox</p> +<p>Tests that we get an definite size in a wrapping flexbox</p> <div class="flexbox wrap" style="height: 50px;" data-expected-height="50"> <div data-expected-height="50"> - <div style="height: 50%" data-expected-height="50"> + <div style="height: 50%" data-expected-height="25"> <div class="rect" data-expected-height="50"></div> </div> </div> @@ -110,11 +109,11 @@ </div> </div> -<p>Tests that percentage sizes are not necessarily definite</p> +<p>Tests that we use a definite size even when a percentage size is not definite</p> <div> <div class="flexbox" style="height: 10%;" data-expected-height="50"> <div data-expected-height="50"> - <div style="height: 50%" data-expected-height="50"> + <div style="height: 50%" data-expected-height="25"> <div class="rect" data-expected-height="50"></div> </div> </div>
diff --git a/third_party/WebKit/LayoutTests/css3/flexbox/flex-align-vertical-writing-mode.html b/third_party/WebKit/LayoutTests/css3/flexbox/flex-align-vertical-writing-mode.html index a1181ac..63236cf5 100644 --- a/third_party/WebKit/LayoutTests/css3/flexbox/flex-align-vertical-writing-mode.html +++ b/third_party/WebKit/LayoutTests/css3/flexbox/flex-align-vertical-writing-mode.html
@@ -72,8 +72,7 @@ <div data-expected-width="50" data-offset-x="50" class="flex-one" style="width: 50px; margin: 0 20px 0 10px;"></div> <div data-expected-width="90" data-offset-x="10" class="flex-one" style="margin: 0 20px 0 10px;"></div> <div data-expected-width="120" data-offset-x="0" class="flex-one"> - <!-- Since no parent has a fixed height, this div shrink-wraps. --> - <div data-expected-width="0" style="width: 100%; background-color:black"></div> + <div data-expected-width="120" style="width: 100%; background-color:black"></div> </div> </div>
diff --git a/third_party/WebKit/LayoutTests/css3/flexbox/flex-align.html b/third_party/WebKit/LayoutTests/css3/flexbox/flex-align.html index 54b7921..fcb8f85cf 100644 --- a/third_party/WebKit/LayoutTests/css3/flexbox/flex-align.html +++ b/third_party/WebKit/LayoutTests/css3/flexbox/flex-align.html
@@ -71,8 +71,7 @@ <div data-expected-height="50" data-offset-y="20" style="flex: 1 0 0; height: 50px; margin: 20px 0 10px;"></div> <div data-expected-height="90" data-offset-y="20" style="flex: 1 0 0; margin: 20px 0 10px;"></div> <div data-expected-height="120" data-offset-y="0" style="flex: 1 0 0;"> - <!-- Since no parent has a fixed height, this div shrink-wraps. --> - <div data-expected-height="0" style="height: 100%; background-color:black"></div> + <div data-expected-height="120" style="height: 100%; background-color:black"></div> </div> </div>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Document/adopt-node-with-doctype-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Document/adopt-node-with-doctype-expected.txt deleted file mode 100644 index 9be2a96..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Document/adopt-node-with-doctype-expected.txt +++ /dev/null
@@ -1,6 +0,0 @@ -This page tests the DOM document.adoptNode method with DocumentType. - -This is a testharness.js-based test. -PASS Explicitly adopting a DocumentType should work. -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Document/adopt-node-with-doctype.html b/third_party/WebKit/LayoutTests/fast/dom/Document/adopt-node-with-doctype.html index b115d84..e15e7823 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Document/adopt-node-with-doctype.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Document/adopt-node-with-doctype.html
@@ -1,13 +1,12 @@ <!DOCTYPE html> <html> <head> -<title>Document.adoptNode</title> +<title>This page tests the DOM document.adoptNode method with DocumentType.</title> <script src="../../../resources/testharness.js"></script> <script src="../../../resources/testharnessreport.js"></script> <link rel="stylesheet" href="../../../resources/testharness.css"> </head> <body> -<p>This page tests the DOM document.adoptNode method with DocumentType.</p> <script> test(function() { var doctype = document.doctype;
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLInputElement/input-value-null-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLInputElement/input-value-null-expected.txt deleted file mode 100644 index 2c5cb67..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLInputElement/input-value-null-expected.txt +++ /dev/null
@@ -1,8 +0,0 @@ -This test checks that assigning null to HTMLInputElement.value behaves correctly; i.e. as if the empty string was assigned. - -This is a testharness.js-based test. -PASS input[type=text] with value content attribute. -PASS input[type=text] without value content attribute. -PASS input[type=hidden] with value content attribute. -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLInputElement/input-value-null.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLInputElement/input-value-null.html index 5e33ecd..2c88495 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLInputElement/input-value-null.html +++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLInputElement/input-value-null.html
@@ -1,13 +1,13 @@ <!DOCTYPE html> <html> <head> +<title>This test checks that assigning null to HTMLInputElement.value behaves +correctly; i.e. as if the empty string was assigned.</title> <script src="../../../resources/testharness.js"></script> <script src="../../../resources/testharnessreport.js"></script> <link rel="stylesheet" href="../../../resources/testharness.css"> </head> <body> -<p>This test checks that assigning null to HTMLInputElement.value behaves - correctly; i.e. as if the empty string was assigned.</p> <form style="display: none"> <input id="text-with-default" type="text" value="default"> <input id="text-without-default" type="text">
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Node/append-child-error-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Node/append-child-error-expected.txt deleted file mode 100644 index dece301..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Node/append-child-error-expected.txt +++ /dev/null
@@ -1,5 +0,0 @@ -This test case verifies if relevant TypeError is thrown when invalid Node argument is given. -This is a testharness.js-based test. -PASS Node.appendChild should throw TypeError when a wrong type of argument is passed. -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Node/append-child-error.html b/third_party/WebKit/LayoutTests/fast/dom/Node/append-child-error.html index 863e165..13dbf83f 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Node/append-child-error.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Node/append-child-error.html
@@ -1,17 +1,17 @@ <!DOCTYPE html> <html> <head> +<title>Test that Node.appendChild throws TypeError when a wrong type of argument is passed.</title> <script src="../../../resources/testharness.js"></script> <script src="../../../resources/testharnessreport.js"></script> </head> <body> -This test case verifies if relevant TypeError is thrown when invalid Node argument is given. <script> test(function() { assert_throws(new TypeError(), function() { document.body.appendChild() }) assert_throws(new TypeError(), function() { document.body.appendChild(null) }) assert_throws(new TypeError(), function() { document.body.appendChild({'a':'b'}) }) -}, "Node.appendChild should throw TypeError when a wrong type of argument is passed.") +}) </script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/NodeIterator/NodeIterator-basic-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/NodeIterator/NodeIterator-basic-expected.txt deleted file mode 100644 index bdda9441..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/NodeIterator/NodeIterator-basic-expected.txt +++ /dev/null
@@ -1,15 +0,0 @@ -This test checks the basic functionality of NodeIterator. - -This is a testharness.js-based test. -PASS Construct a NodeIterator by document.createNodeIterator(root). -PASS Construct a NodeIterator by document.createNodeIterator(root, undefined, undefined). -PASS Give an invalid root node to document.createNodeIterator(). -PASS Iterate over all nodes forward then backward. -PASS Iterate over all elements forward then backward. -PASS Iterate over all text nodes forward then backward. -PASS Iterate over all comment nodes forward then backward. -PASS Test the behavior of NodeIterator when no nodes match with the given filter. -PASS Test the behavior of NodeIterator when NodeFilter is specified. -PASS Optional arguments to createNodeIterator should be optional (3 passed, null). -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/fast/dom/NodeIterator/NodeIterator-basic.html b/third_party/WebKit/LayoutTests/fast/dom/NodeIterator/NodeIterator-basic.html index 43e03cf..e7f1b8a 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/NodeIterator/NodeIterator-basic.html +++ b/third_party/WebKit/LayoutTests/fast/dom/NodeIterator/NodeIterator-basic.html
@@ -1,13 +1,12 @@ <!DOCTYPE html> <html> <head> -<title>NodeIterator: Basic test</title> +<title>This test checks the basic functionality of NodeIterator.</title> <script src="../../../resources/testharness.js"></script> <script src="../../../resources/testharnessreport.js"></script> <link rel="stylesheet" href="../../../resources/testharness.css"> </head> <body> -<p>This test checks the basic functionality of NodeIterator.</p> <script> function createSampleDOM() {
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Range/collapsed-range-bounding-client-rect-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Range/collapsed-range-bounding-client-rect-expected.txt deleted file mode 100644 index e25c7934..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Range/collapsed-range-bounding-client-rect-expected.txt +++ /dev/null
@@ -1,7 +0,0 @@ -Tests that Range::getBoundingClientRect returns top and left coordinates for collapsed ranges as mandated by the spec. - -This is a testharness.js-based test. -PASS Check position for non-collapsed range. -PASS Check position for collapsed range. -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Range/collapsed-range-bounding-client-rect.html b/third_party/WebKit/LayoutTests/fast/dom/Range/collapsed-range-bounding-client-rect.html index aaee747e..d7ed127 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Range/collapsed-range-bounding-client-rect.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Range/collapsed-range-bounding-client-rect.html
@@ -5,6 +5,9 @@ <script src="../../../resources/testharness.js"></script> <script src="../../../resources/testharnessreport.js"></script> </head> + <style> + p {visibility: hidden;} + </style> <body> <p> Tests that Range::getBoundingClientRect returns top and left
diff --git a/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/TreeWalker-basic-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/TreeWalker-basic-expected.txt deleted file mode 100644 index 391867a1..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/TreeWalker-basic-expected.txt +++ /dev/null
@@ -1,10 +0,0 @@ -This test checks the basic functionality of TreeWalker. - -This is a testharness.js-based test. -PASS Construct a TreeWalker by document.createTreeWalker(root). -PASS Construct a TreeWalker by document.createTreeWalker(root, undefined, undefined). -PASS Give an invalid root node to document.createTreeWalker(). -PASS Walk over nodes. -PASS Optional arguments to createTreeWalker should be optional (3 passed, null). -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/TreeWalker-basic.html b/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/TreeWalker-basic.html index 4921af39..fce9663 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/TreeWalker-basic.html +++ b/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/TreeWalker-basic.html
@@ -1,13 +1,12 @@ <!DOCTYPE html> <html> <head> -<title>TreeWalker: Basic test</title> +<title>This test checks the basic functionality of TreeWalker.</title> <script src="../../../resources/testharness.js"></script> <script src="../../../resources/testharnessreport.js"></script> <link rel="stylesheet" href="../../../resources/testharness.css"> </head> <body> -<p>This test checks the basic functionality of TreeWalker.</p> <script> function createSampleDOM() {
diff --git a/third_party/WebKit/LayoutTests/fast/dom/innerHTML-namespaces-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/innerHTML-namespaces-expected.txt deleted file mode 100644 index d9b5bc6..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/innerHTML-namespaces-expected.txt +++ /dev/null
@@ -1,6 +0,0 @@ -Testing - -This is a testharness.js-based test. -PASS set innerHTML to an XHTML fragment with in-scope namespace prefixes on attributes -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/fast/dom/innerHTML-namespaces.xhtml b/third_party/WebKit/LayoutTests/fast/dom/innerHTML-namespaces.xhtml index 6e50ca05..4c5d09a 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/innerHTML-namespaces.xhtml +++ b/third_party/WebKit/LayoutTests/fast/dom/innerHTML-namespaces.xhtml
@@ -2,7 +2,7 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <body> -<p id="result" xmlns:a="urn:x-test:a"></p> +<p id="result" xmlns:a="urn:x-test:a" style="visibility: hidden;"></p> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> <script type="text/javascript">//<![CDATA[
diff --git a/third_party/WebKit/LayoutTests/fast/dom/insertAdjacentHTML-namespaces-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/insertAdjacentHTML-namespaces-expected.txt deleted file mode 100644 index 4ed62e25..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/insertAdjacentHTML-namespaces-expected.txt +++ /dev/null
@@ -1,6 +0,0 @@ -Testing - -This is a testharness.js-based test. -PASS insert an XHTML fragment with in-scope namespace prefixes on attributes -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/fast/dom/insertAdjacentHTML-namespaces.xhtml b/third_party/WebKit/LayoutTests/fast/dom/insertAdjacentHTML-namespaces.xhtml index 67deac13..cde9b26 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/insertAdjacentHTML-namespaces.xhtml +++ b/third_party/WebKit/LayoutTests/fast/dom/insertAdjacentHTML-namespaces.xhtml
@@ -2,7 +2,7 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <body> -<p id="result" xmlns:a="urn:x-test:a"></p> +<p id="result" xmlns:a="urn:x-test:a" style="visibility: hidden;"></p> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> <script>//<![CDATA[
diff --git a/third_party/WebKit/LayoutTests/fast/events/pointerevents/touch-pointercancel-expected.txt b/third_party/WebKit/LayoutTests/fast/events/pointerevents/touch-pointercancel-expected.txt index 203ce97..1f2f5e9 100644 --- a/third_party/WebKit/LayoutTests/fast/events/pointerevents/touch-pointercancel-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/events/pointerevents/touch-pointercancel-expected.txt
@@ -5,51 +5,37 @@ --- single drag tests --- --- preventDefault on none, without uncanceledMoveCausesScroll -- +-- preventDefault on none, without notifyStartOfTouchScroll -- Received touchstart, touchIds=0 Received touchmove, touchIds=0 Received touchmove, touchIds=0 Received touchmove, touchIds=0 Received touchend, touchIds=0 --- preventDefault on pointermove, without uncanceledMoveCausesScroll -- +-- preventDefault on pointermove, without notifyStartOfTouchScroll -- Received touchstart, touchIds=0 Received touchmove, touchIds=0 Received touchmove, touchIds=0 Received touchmove, touchIds=0 Received touchend, touchIds=0 --- preventDefault on touchmove, without uncanceledMoveCausesScroll -- -Received touchstart, touchIds=0 -Received touchmove, touchIds=0, prevented default -Received touchmove, touchIds=0, prevented default -Received touchmove, touchIds=0, prevented default -Received touchend, touchIds=0 - --- preventDefault on none, with uncanceledMoveCausesScroll -- +-- preventDefault on none, with notifyStartOfTouchScroll -- Received touchstart, touchIds=0 Received touchmove, touchIds=0 Received touchmove, touchIds=0 Received touchmove, touchIds=0 Received touchend, touchIds=0 --- preventDefault on pointermove, with uncanceledMoveCausesScroll -- +-- preventDefault on pointermove, with notifyStartOfTouchScroll -- Received touchstart, touchIds=0 Received touchmove, touchIds=0 Received touchmove, touchIds=0 Received touchmove, touchIds=0 Received touchend, touchIds=0 --- preventDefault on touchmove, with uncanceledMoveCausesScroll -- -Received touchstart, touchIds=0 -Received touchmove, touchIds=0, prevented default -Received touchmove, touchIds=0, prevented default -Received touchmove, touchIds=0, prevented default -Received touchend, touchIds=0 - --- multi drag tests --- --- preventDefault on none, without uncanceledMoveCausesScroll -- +-- preventDefault on none, without notifyStartOfTouchScroll -- Received touchstart, touchIds=012 Received touchmove, touchIds=012 Received touchmove, touchIds=012 @@ -57,7 +43,7 @@ Received touchmove, touchIds=0123 Received touchend, touchIds=0123 --- preventDefault on none, with uncanceledMoveCausesScroll -- +-- preventDefault on none, with notifyStartOfTouchScroll -- Received touchstart, touchIds=012 Received touchmove, touchIds=012 Received touchmove, touchIds=012
diff --git a/third_party/WebKit/LayoutTests/fast/events/pointerevents/touch-pointercancel.html b/third_party/WebKit/LayoutTests/fast/events/pointerevents/touch-pointercancel.html index 7ab34be..fcf0efc 100644 --- a/third_party/WebKit/LayoutTests/fast/events/pointerevents/touch-pointercancel.html +++ b/third_party/WebKit/LayoutTests/fast/events/pointerevents/touch-pointercancel.html
@@ -49,7 +49,7 @@ }); } -function testSingleDrag(uncanceledMoveCausesScroll) { +function testSingleDrag(notifyStartOfTouchScroll) { var rect = document.getElementById("target").getBoundingClientRect(); var x = rect.left + 50; var y = rect.top + 50; @@ -60,11 +60,11 @@ eventSender.updateTouchPoint(0, x, y+50); eventSender.touchMove(); + if (notifyStartOfTouchScroll) + eventSender.notifyStartOfTouchScroll(); + eventSender.updateTouchPoint(0, x, y+100); - if (uncanceledMoveCausesScroll) - eventSender.touchMoveCausingScrollIfUncanceled(); - else - eventSender.touchMove(); + eventSender.touchMove(); eventSender.updateTouchPoint(0, x, y+150); eventSender.touchMove(); @@ -73,7 +73,7 @@ eventSender.touchEnd(); } -function testMultiDrag(uncanceledMoveCausesScroll) { +function testMultiDrag(notifyStartOfTouchScroll) { var rect; rect = document.getElementById("target").getBoundingClientRect(); @@ -98,10 +98,10 @@ eventSender.updateTouchPoint(0, x0, y); eventSender.updateTouchPoint(1, x1, y); eventSender.updateTouchPoint(2, x2, y); - if (uncanceledMoveCausesScroll) - eventSender.touchMoveCausingScrollIfUncanceled(); - else - eventSender.touchMove(); + eventSender.touchMove(); + + if (notifyStartOfTouchScroll) + eventSender.notifyStartOfTouchScroll(); eventSender.addTouchPoint(x3, y); eventSender.touchStart(); @@ -151,45 +151,35 @@ debug("--- single drag tests ---"); debug(""); - debug("-- preventDefault on none, without uncanceledMoveCausesScroll --"); + debug("-- preventDefault on none, without notifyStartOfTouchScroll --"); eventToPreventDefault = "-none-"; testSingleDrag(false); debug(""); - debug("-- preventDefault on pointermove, without uncanceledMoveCausesScroll --"); + debug("-- preventDefault on pointermove, without notifyStartOfTouchScroll --"); eventToPreventDefault = "pointermove"; testSingleDrag(false); debug(""); - debug("-- preventDefault on touchmove, without uncanceledMoveCausesScroll --"); - eventToPreventDefault = "touchmove"; - testSingleDrag(false); - debug(""); - - debug("-- preventDefault on none, with uncanceledMoveCausesScroll --"); + debug("-- preventDefault on none, with notifyStartOfTouchScroll --"); eventToPreventDefault = "-none-"; testSingleDrag(true); debug(""); - debug("-- preventDefault on pointermove, with uncanceledMoveCausesScroll --"); + debug("-- preventDefault on pointermove, with notifyStartOfTouchScroll --"); eventToPreventDefault = "pointermove"; testSingleDrag(true); debug(""); - debug("-- preventDefault on touchmove, with uncanceledMoveCausesScroll --"); - eventToPreventDefault = "touchmove"; - testSingleDrag(true); - debug(""); - debug("--- multi drag tests ---"); debug(""); - debug("-- preventDefault on none, without uncanceledMoveCausesScroll --"); + debug("-- preventDefault on none, without notifyStartOfTouchScroll --"); eventToPreventDefault = "-none-"; testMultiDrag(false); debug(""); - debug("-- preventDefault on none, with uncanceledMoveCausesScroll --"); + debug("-- preventDefault on none, with notifyStartOfTouchScroll --"); eventToPreventDefault = "-none-"; testMultiDrag(true); debug("");
diff --git a/third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-generateCertificate-expected.txt b/third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-generateCertificate-expected.txt index cb8ed9e..2cf752a 100644 --- a/third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-generateCertificate-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-generateCertificate-expected.txt
@@ -9,6 +9,12 @@ PASS generateCertificate({ name: "ECDSA", namedCurve: "P-256" }) PASS certECDSA is non-null. PASS new Date().getTime() < certECDSA.expires is true +PASS certExpiresNegativeOneDay is non-null. +PASS new Date().getTime() < certExpiresNegativeOneDay.expires is true +PASS certExpiresZero is non-null. +PASS new Date().getTime() >= certExpiresZero.expires is true +PASS certExpiresPositiveOneDay is non-null. +PASS Math.abs(certExpiresPositiveOneDay.expires - (new Date().getTime() + dayInMs)) <= minuteInMs is true PASS successfullyParsed is true TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-generateCertificate.html b/third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-generateCertificate.html index 72b86eac..ab0dbf2 100644 --- a/third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-generateCertificate.html +++ b/third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-generateCertificate.html
@@ -7,11 +7,18 @@ <script> description("Tests RTCPeerConnection.generateCertificate RSA/ECDSA."); +// Constants +var minuteInMs = 60 * 1000; +var dayInMs = 24 * 60 * minuteInMs; + // Signature of the last generateCertificate call. var generateCallString = null; // Global certificate variables so that the "should..." methods can evaluate them. var certRSA = null; var certECDSA = null; +var certExpiresNegativeOneDay = null; +var certExpiresZero = null; +var certExpiresPositiveOneDay = null; // 1: RSA-2048 using public exponent = 65537. function generate1RSA() @@ -24,7 +31,7 @@ { certRSA = certificate; testPassed(generateCallString); - certificateSanityCheck(certificate, 'certRSA'); + certificateSanityCheck('certRSA'); generate2ECDSA(); } function generate1RSAFailed() @@ -44,17 +51,53 @@ { certECDSA = certificate; testPassed(generateCallString); - certificateSanityCheck(certificate, 'certECDSA'); - finishJSTest(); + certificateSanityCheck('certECDSA'); + generate3ExpiresNegativeOneDay(); } function generate2ECDSAFailed() { testFailed(generateCallString); + generate3ExpiresNegativeOneDay(); +} + +// 3-5: Verify that the |expires| attribute works (generate ECDSA because its faster). +function generate3ExpiresNegativeOneDay() +{ + generateCallString = 'generateCertificate({ name: "ECDSA", namedCurve: "P-256", expires:-dayInMs })'; + webkitRTCPeerConnection.generateCertificate({ name: "ECDSA", namedCurve: "P-256", expires:-dayInMs }) + .then(function(certificate) { certExpiresNegativeOneDay = certificate; generate4ExpiresZero(); }, generate4ExpiresZero); +} +function generate4ExpiresZero() +{ + generateCallString = 'generateCertificate({ name: "ECDSA", namedCurve: "P-256", expires:0 })'; + webkitRTCPeerConnection.generateCertificate({ name: "ECDSA", namedCurve: "P-256", expires:0 }) + .then(function(certificate) { certExpiresZero = certificate; generate5ExpiresPositiveOneDay(); }, generate5ExpiresPositiveOneDay); +} +function generate5ExpiresPositiveOneDay() +{ + generateCallString = 'generateCertificate({ name: "ECDSA", namedCurve: "P-256", expires:dayInMs })'; // +1 day + webkitRTCPeerConnection.generateCertificate({ name: "ECDSA", namedCurve: "P-256", expires:dayInMs }) + .then(function(certificate) { certExpiresPositiveOneDay = certificate; generate3to5ExpiresResolved(); }, generate3to5ExpiresResolved); +} +function generate3to5ExpiresResolved() +{ + // A negative |expires| value is not a DOMTimeStamp, it should be ignored and + // generate a certificate that has not expired. + certificateSanityCheck('certExpiresNegativeOneDay'); + + // Check that the zero expiration certificate was generated but has expired. + shouldBeNonNull('certExpiresZero'); + shouldBeTrue('new Date().getTime() >= certExpiresZero.expires'); + + // Check that the +1 day expiration certificate expires in approximately 1 day (+/- 1 minute). + shouldBeNonNull('certExpiresPositiveOneDay'); + shouldBeTrue('Math.abs(certExpiresPositiveOneDay.expires - (new Date().getTime() + dayInMs)) <= minuteInMs'); + finishJSTest(); } // Helper functions. -function certificateSanityCheck(cert, certVariableName) +function certificateSanityCheck(certVariableName) { shouldBeNonNull(certVariableName); shouldBeTrue('new Date().getTime() < ' + certVariableName + '.expires');
diff --git a/third_party/WebKit/LayoutTests/fast/overflow/do-not-calc-overflow-on-tables-needing-layout-expected.txt b/third_party/WebKit/LayoutTests/fast/overflow/do-not-calc-overflow-on-tables-needing-layout-expected.txt new file mode 100644 index 0000000..30da0633 --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/overflow/do-not-calc-overflow-on-tables-needing-layout-expected.txt
@@ -0,0 +1 @@ +crbug.com/604664: Tests passes if it doesn't crash.
diff --git a/third_party/WebKit/LayoutTests/fast/overflow/do-not-calc-overflow-on-tables-needing-layout.html b/third_party/WebKit/LayoutTests/fast/overflow/do-not-calc-overflow-on-tables-needing-layout.html new file mode 100644 index 0000000..6e5e3f7 --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/overflow/do-not-calc-overflow-on-tables-needing-layout.html
@@ -0,0 +1,16 @@ +<!DOCTYPE html> +<style> + .cell { display: table-cell; } + .cell:nth-last-child(even) { -webkit-transform: rotate(180deg); } +</style> +<body> + <div class="cell">crbug.com/604664: Tests passes if it doesn't crash.</div> + <div id="div" class="cell"></div> +</body> +<script> + if (window.testRunner) + testRunner.dumpAsText(); + var block = document.createElement('div'); + document.body.offsetTop; + block.appendChild(document.getElementById("div")); +</script>
diff --git a/third_party/WebKit/LayoutTests/fast/repaint/block-layout-inline-children-replaced-expected.txt b/third_party/WebKit/LayoutTests/fast/repaint/block-layout-inline-children-replaced-expected.txt deleted file mode 100644 index 1be8eb4d..0000000 --- a/third_party/WebKit/LayoutTests/fast/repaint/block-layout-inline-children-replaced-expected.txt +++ /dev/null
@@ -1,20 +0,0 @@ -{ - "bounds": [800, 600], - "children": [ - { - "bounds": [800, 600], - "contentsOpaque": true, - "drawsContent": true, - "repaintRects": [ - [154, 35, 94, 100], - [0, 34, 402, 152] - ], - "paintInvalidationClients": [ - "LayoutBlockFlow DIV id='target' class='target'", - "RootInlineBox", - "LayoutImage IMG" - ] - } - ] -} -
diff --git a/third_party/WebKit/LayoutTests/fast/transforms/focus-on-transformed-node-expected.txt b/third_party/WebKit/LayoutTests/fast/transforms/focus-on-transformed-node-expected.txt new file mode 100644 index 0000000..0383162 --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/transforms/focus-on-transformed-node-expected.txt
@@ -0,0 +1 @@ +Test passes if it does not crash.
diff --git a/third_party/WebKit/LayoutTests/fast/transforms/focus-on-transformed-node.html b/third_party/WebKit/LayoutTests/fast/transforms/focus-on-transformed-node.html new file mode 100644 index 0000000..eb1c20b --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/transforms/focus-on-transformed-node.html
@@ -0,0 +1,22 @@ +<!DOCTYPE html> +<html> + <head> + <style> + body { + -webkit-transform: matrix(913497906,874,-270122.666907739,44,-933.66,101839.742) scale(-988337314) skew(540817045turn,33481.000001turn) translateY(75959.0%) matrix(12388309,8375,1982.08233,-480110910,646202686,69006.99) skewX(4213.720135962deg) scale(+5.833098,+80974) scaleX(491057862) scale(+133,331676); + } + </style> + </head> + <body> + <a href="a" id="start"></a> + <p> + Test passes if it does not crash. + </p> + <script> + if (window.testRunner) + testRunner.dumpAsText(); + document.getElementById("start").focus(); + </script> + </body> +</html> +
diff --git a/third_party/WebKit/LayoutTests/fast/workers/resources/storagequota-query-usage.js b/third_party/WebKit/LayoutTests/fast/workers/resources/storagequota-query-usage.js deleted file mode 100644 index a761035..0000000 --- a/third_party/WebKit/LayoutTests/fast/workers/resources/storagequota-query-usage.js +++ /dev/null
@@ -1,28 +0,0 @@ - -description("This tests querying usage and quota using Quota API."); - -if (navigator.webkitTemporaryStorage) { - window.jsTestIsAsync = true; - // navigator.webkitTemporaryStorage.queryUsageAndQuota(usageCallback, errorCallback); -} - -var worker = createWorker(); - -worker.postMessage("ping"); -worker.postMessage("eval importScripts('worker-storagequota-query-usage.js');"); -worker.postMessage("eval requestUsage(self.port || self)"); -worker.onmessage = function(evt) { - var match = /^result:(.*)/.exec(evt.data); - if (match) { - usageData = JSON.parse(match[1]); - - // Quota value would vary depending on the test environment. - shouldBeGreaterThanOrEqual("usageData.usage", "0"); - shouldBeGreaterThanOrEqual("usageData.quota", "usageData.usage"); - - worker.postMessage("close"); - finishJSTest(); - } -}; - -window.successfullyParsed = true;
diff --git a/third_party/WebKit/LayoutTests/fast/workers/resources/worker-storagequota-query-usage.js b/third_party/WebKit/LayoutTests/fast/workers/resources/worker-storagequota-query-usage.js deleted file mode 100644 index c82ea9f2d..0000000 --- a/third_party/WebKit/LayoutTests/fast/workers/resources/worker-storagequota-query-usage.js +++ /dev/null
@@ -1,17 +0,0 @@ - -function requestUsage() { - port = self.port || self; - function errorCallback(error) - { - port.postMessage("errorCallback called"); - } - - function usageCallback(usage, quota) - { - port.postMessage("result: " + JSON.stringify({ usage: usage, quota: quota})); - } - - port.postMessage("Requesting quota from " + navigator.webkitTemporaryStorage); - navigator.webkitTemporaryStorage.queryUsageAndQuota(usageCallback, errorCallback); - return true; -}
diff --git a/third_party/WebKit/LayoutTests/fast/workers/shared-worker-storagequota-query-usage-expected.txt b/third_party/WebKit/LayoutTests/fast/workers/shared-worker-storagequota-query-usage-expected.txt deleted file mode 100644 index 07d71a1..0000000 --- a/third_party/WebKit/LayoutTests/fast/workers/shared-worker-storagequota-query-usage-expected.txt +++ /dev/null
@@ -1,11 +0,0 @@ -This tests querying usage and quota using Quota API. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - - -PASS usageData.usage is >= 0 -PASS usageData.quota is >= usageData.usage -PASS successfullyParsed is true - -TEST COMPLETE -Test storagequota APIs in Shared Worker
diff --git a/third_party/WebKit/LayoutTests/fast/workers/shared-worker-storagequota-query-usage.html b/third_party/WebKit/LayoutTests/fast/workers/shared-worker-storagequota-query-usage.html deleted file mode 100644 index 15dfc840..0000000 --- a/third_party/WebKit/LayoutTests/fast/workers/shared-worker-storagequota-query-usage.html +++ /dev/null
@@ -1,8 +0,0 @@ -<html> -<body> - <p>Test storagequota APIs in Shared Worker</p> - <script src="../../resources/js-test.js"></script> - <script src="resources/shared-worker-create-common.js"></script> - <script src="resources/storagequota-query-usage.js"></script> -</body> -</html>
diff --git a/third_party/WebKit/LayoutTests/fast/workers/worker-storagequota-query-usage-expected.txt b/third_party/WebKit/LayoutTests/fast/workers/worker-storagequota-query-usage-expected.txt deleted file mode 100644 index adc7823f4..0000000 --- a/third_party/WebKit/LayoutTests/fast/workers/worker-storagequota-query-usage-expected.txt +++ /dev/null
@@ -1,11 +0,0 @@ -This tests querying usage and quota using Quota API. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - - -PASS usageData.usage is >= 0 -PASS usageData.quota is >= usageData.usage -PASS successfullyParsed is true - -TEST COMPLETE -Test storagequota APIs in Dedicated Worker
diff --git a/third_party/WebKit/LayoutTests/fast/workers/worker-storagequota-query-usage.html b/third_party/WebKit/LayoutTests/fast/workers/worker-storagequota-query-usage.html deleted file mode 100644 index dcafa87..0000000 --- a/third_party/WebKit/LayoutTests/fast/workers/worker-storagequota-query-usage.html +++ /dev/null
@@ -1,8 +0,0 @@ -<html> -<body> - <p>Test storagequota APIs in Dedicated Worker</p> - <script src="../../resources/js-test.js"></script> - <script src="resources/worker-create-common.js"></script> - <script src="resources/storagequota-query-usage.js"></script> -</body> -</html>
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt b/third_party/WebKit/LayoutTests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt index a7326d6..ec5587b56 100644 --- a/third_party/WebKit/LayoutTests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt
@@ -798,8 +798,6 @@ getter product getter storage getter userAgent - getter webkitPersistentStorage - getter webkitTemporaryStorage method constructor interface webkitIDBCursor getter direction
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/browsers/the-window-object/window-indexed-properties-expected.txt b/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/browsers/the-window-object/window-indexed-properties-expected.txt index 8a9f074..e6e463c 100644 --- a/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/browsers/the-window-object/window-indexed-properties-expected.txt +++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/browsers/the-window-object/window-indexed-properties-expected.txt
@@ -1,6 +1,6 @@ This is a testharness.js-based test. PASS Indexed properties of the window object (non-strict mode) -FAIL Indexed properties of the window object (non-strict mode) 1 assert_equals: expected (object) object "[object Window]" but got (string) "foo" +PASS Indexed properties of the window object (non-strict mode) 1 FAIL Indexed properties of the window object (non-strict mode) 2 assert_equals: expected (undefined) undefined but got (string) "foo" PASS Indexed properties of the window object (non-strict mode) 3 Harness: the test ran to completion.
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/web-animations/keyframe-effect/getComputedTiming-currentIteration-expected.txt b/third_party/WebKit/LayoutTests/imported/web-platform-tests/web-animations/keyframe-effect/getComputedTiming-currentIteration-expected.txt new file mode 100644 index 0000000..d3532ce --- /dev/null +++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/web-animations/keyframe-effect/getComputedTiming-currentIteration-expected.txt
@@ -0,0 +1,40 @@ +This is a testharness.js-based test. +FAIL Test currentIteration during before and after phase when fill is none anim.effect.getComputedTiming is not a function +FAIL Test zero iterations: iterations:0 iterationStart:0 duration:0 delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test zero iterations: iterations:0 iterationStart:0 duration:100 delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test zero iterations: iterations:0 iterationStart:0 duration:Infinity delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test zero iterations: iterations:0 iterationStart:2.5 duration:0 delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test zero iterations: iterations:0 iterationStart:2.5 duration:100 delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test zero iterations: iterations:0 iterationStart:2.5 duration:Infinity delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test zero iterations: iterations:0 iterationStart:3 duration:0 delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test zero iterations: iterations:0 iterationStart:3 duration:100 delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test zero iterations: iterations:0 iterationStart:3 duration:Infinity delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test integer iterations: iterations:3 iterationStart:0 duration:0 delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test integer iterations: iterations:3 iterationStart:0 duration:100 delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test integer iterations: iterations:3 iterationStart:0 duration:Infinity delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test integer iterations: iterations:3 iterationStart:2.5 duration:0 delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test integer iterations: iterations:3 iterationStart:2.5 duration:100 delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test integer iterations: iterations:3 iterationStart:2.5 duration:Infinity delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test integer iterations: iterations:3 iterationStart:3 duration:0 delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test integer iterations: iterations:3 iterationStart:3 duration:100 delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test integer iterations: iterations:3 iterationStart:3 duration:Infinity delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test fractional iterations: iterations:3.5 iterationStart:0 duration:0 delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test fractional iterations: iterations:3.5 iterationStart:0 duration:100 delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test fractional iterations: iterations:3.5 iterationStart:0 duration:Infinity delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test fractional iterations: iterations:3.5 iterationStart:2.5 duration:0 delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test fractional iterations: iterations:3.5 iterationStart:2.5 duration:100 delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test fractional iterations: iterations:3.5 iterationStart:2.5 duration:Infinity delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test fractional iterations: iterations:3.5 iterationStart:3 duration:0 delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test fractional iterations: iterations:3.5 iterationStart:3 duration:100 delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test fractional iterations: iterations:3.5 iterationStart:3 duration:Infinity delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test infinity iterations: iterations:Infinity iterationStart:0 duration:0 delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test infinity iterations: iterations:Infinity iterationStart:0 duration:100 delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test infinity iterations: iterations:Infinity iterationStart:0 duration:Infinity delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test infinity iterations: iterations:Infinity iterationStart:2.5 duration:0 delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test infinity iterations: iterations:Infinity iterationStart:2.5 duration:100 delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test infinity iterations: iterations:Infinity iterationStart:2.5 duration:Infinity delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test infinity iterations: iterations:Infinity iterationStart:3 duration:0 delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test infinity iterations: iterations:Infinity iterationStart:3 duration:100 delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test infinity iterations: iterations:Infinity iterationStart:3 duration:Infinity delay:1 fill:both anim.effect.getComputedTiming is not a function +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/web-animations/keyframe-effect/getComputedTiming-progress-expected.txt b/third_party/WebKit/LayoutTests/imported/web-platform-tests/web-animations/keyframe-effect/getComputedTiming-progress-expected.txt new file mode 100644 index 0000000..595f7c4 --- /dev/null +++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/web-animations/keyframe-effect/getComputedTiming-progress-expected.txt
@@ -0,0 +1,40 @@ +This is a testharness.js-based test. +FAIL Test progress during before and after phase when fill is none anim.effect.getComputedTiming is not a function +FAIL Test zero iterations: iterations:0 iterationStart:0 duration:0 delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test zero iterations: iterations:0 iterationStart:0 duration:100 delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test zero iterations: iterations:0 iterationStart:0 duration:Infinity delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test zero iterations: iterations:0 iterationStart:2.5 duration:0 delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test zero iterations: iterations:0 iterationStart:2.5 duration:100 delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test zero iterations: iterations:0 iterationStart:2.5 duration:Infinity delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test zero iterations: iterations:0 iterationStart:3 duration:0 delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test zero iterations: iterations:0 iterationStart:3 duration:100 delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test zero iterations: iterations:0 iterationStart:3 duration:Infinity delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test integer iterations: iterations:3 iterationStart:0 duration:0 delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test integer iterations: iterations:3 iterationStart:0 duration:100 delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test integer iterations: iterations:3 iterationStart:0 duration:Infinity delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test integer iterations: iterations:3 iterationStart:2.5 duration:0 delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test integer iterations: iterations:3 iterationStart:2.5 duration:100 delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test integer iterations: iterations:3 iterationStart:2.5 duration:Infinity delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test integer iterations: iterations:3 iterationStart:3 duration:0 delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test integer iterations: iterations:3 iterationStart:3 duration:100 delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test integer iterations: iterations:3 iterationStart:3 duration:Infinity delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test fractional iterations: iterations:3.5 iterationStart:0 duration:0 delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test fractional iterations: iterations:3.5 iterationStart:0 duration:100 delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test fractional iterations: iterations:3.5 iterationStart:0 duration:Infinity delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test fractional iterations: iterations:3.5 iterationStart:2.5 duration:0 delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test fractional iterations: iterations:3.5 iterationStart:2.5 duration:100 delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test fractional iterations: iterations:3.5 iterationStart:2.5 duration:Infinity delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test fractional iterations: iterations:3.5 iterationStart:3 duration:0 delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test fractional iterations: iterations:3.5 iterationStart:3 duration:100 delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test fractional iterations: iterations:3.5 iterationStart:3 duration:Infinity delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test infinity iterations: iterations:Infinity iterationStart:0 duration:0 delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test infinity iterations: iterations:Infinity iterationStart:0 duration:100 delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test infinity iterations: iterations:Infinity iterationStart:0 duration:Infinity delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test infinity iterations: iterations:Infinity iterationStart:2.5 duration:0 delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test infinity iterations: iterations:Infinity iterationStart:2.5 duration:100 delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test infinity iterations: iterations:Infinity iterationStart:2.5 duration:Infinity delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test infinity iterations: iterations:Infinity iterationStart:3 duration:0 delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test infinity iterations: iterations:Infinity iterationStart:3 duration:100 delay:1 fill:both anim.effect.getComputedTiming is not a function +FAIL Test infinity iterations: iterations:Infinity iterationStart:3 duration:Infinity delay:1 fill:both anim.effect.getComputedTiming is not a function +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/inspector-enabled/sources/debugger/linkifier-expected.txt b/third_party/WebKit/LayoutTests/inspector-enabled/sources/debugger/linkifier-expected.txt index 0b51f2ee..6b395e6 100644 --- a/third_party/WebKit/LayoutTests/inspector-enabled/sources/debugger/linkifier-expected.txt +++ b/third_party/WebKit/LayoutTests/inspector-enabled/sources/debugger/linkifier-expected.txt
@@ -5,7 +5,7 @@ The columnNumber is 10 with type number listeners added on raw source code: 1 original location: linkifier.html:9 -pretty printed location: linkifier.html:formatted:14 +pretty printed location: linkifier.html:formatted:12 reverted location: linkifier.html:9 listeners removed from raw source code: 1
diff --git a/third_party/WebKit/LayoutTests/inspector-enabled/sources/debugger/linkifier.html b/third_party/WebKit/LayoutTests/inspector-enabled/sources/debugger/linkifier.html index 636142c..7445b61 100644 --- a/third_party/WebKit/LayoutTests/inspector-enabled/sources/debugger/linkifier.html +++ b/third_party/WebKit/LayoutTests/inspector-enabled/sources/debugger/linkifier.html
@@ -51,7 +51,7 @@ break; } } - + uiSourceCode = WebInspector.workspace.uiSourceCodeForURL(InspectorTest.resourceTreeModel.inspectedPageURL()); var linkifyMe = "at triggerError (http://localhost/show/:22:11)"; var fragment = WebInspector.linkifyStringAsFragment(linkifyMe);
diff --git a/third_party/WebKit/LayoutTests/inspector-enabled/sources/debugger/script-formatter-breakpoints-1-expected.txt b/third_party/WebKit/LayoutTests/inspector-enabled/sources/debugger/script-formatter-breakpoints-1-expected.txt index c319261..7d24697 100644 --- a/third_party/WebKit/LayoutTests/inspector-enabled/sources/debugger/script-formatter-breakpoints-1-expected.txt +++ b/third_party/WebKit/LayoutTests/inspector-enabled/sources/debugger/script-formatter-breakpoints-1-expected.txt
@@ -12,7 +12,7 @@ Script execution paused. Breakpoint sidebar pane while paused in pretty printed -script-formatter-breakpoints-1.html:formatted:17 var f = 0; +script-formatter-breakpoints-1.html:formatted:13 var f = 0; Breakpoint sidebar pane while paused in raw script-formatter-breakpoints-1.html:12 var f=0;
diff --git a/third_party/WebKit/LayoutTests/inspector-enabled/sources/debugger/script-formatter-breakpoints-4.html b/third_party/WebKit/LayoutTests/inspector-enabled/sources/debugger/script-formatter-breakpoints-4.html index c422a8b..b10c646 100644 --- a/third_party/WebKit/LayoutTests/inspector-enabled/sources/debugger/script-formatter-breakpoints-4.html +++ b/third_party/WebKit/LayoutTests/inspector-enabled/sources/debugger/script-formatter-breakpoints-4.html
@@ -59,7 +59,7 @@ { InspectorTest.addResult("Removing breakpoint."); var formattedSourceFrame = panel.visibleView; - InspectorTest.removeBreakpoint(formattedSourceFrame, 16); + InspectorTest.removeBreakpoint(formattedSourceFrame, 12); InspectorTest.addResult("Unformatting."); scriptFormatter._discardFormattedUISourceCodeScript(panel.visibleView.uiSourceCode()); var breakpoints = WebInspector.breakpointManager._storage._setting.get();
diff --git a/third_party/WebKit/LayoutTests/inspector-enabled/sources/debugger/script-formatter-console-expected.txt b/third_party/WebKit/LayoutTests/inspector-enabled/sources/debugger/script-formatter-console-expected.txt index 2e3d07b..47a19859b 100644 --- a/third_party/WebKit/LayoutTests/inspector-enabled/sources/debugger/script-formatter-console-expected.txt +++ b/third_party/WebKit/LayoutTests/inspector-enabled/sources/debugger/script-formatter-console-expected.txt
@@ -8,7 +8,7 @@ script-formatter-console.html:12 Pre-format row message list: ["11"] -script-formatter-console.html:formatted:16 +script-formatter-console.html:formatted:13 Post-format row message list: -["15"] +["12"]
diff --git a/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-bottom-up-times-expected.txt b/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-bottom-up-times-expected.txt index f63785a7..b970ba8 100644 --- a/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-bottom-up-times-expected.txt +++ b/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-bottom-up-times-expected.txt
@@ -1,10 +1,10 @@ Tests bottom-up view self and total time calculation in CPU profiler. -2: (idle) 300 300 300.0 ms30.00 %300.0 ms30.00 %(idle) -1001: A 250 370 250.0 ms25.00 %370.0 ms37.00 %A -2000: C 200 250 200.0 ms20.00 %250.0 ms25.00 %C -1002: B 150 280 150.0 ms15.00 %280.0 ms28.00 %B -3000: D 50 50 50.0 ms5.00 %50.0 ms5.00 %D +2: (idle) 500 500 500.0 ms500.0 ms(idle) +1001: A 125 185 125.0 ms25.00 %185.0 ms37.00 %A +2000: C 100 125 100.0 ms20.00 %125.0 ms25.00 %C +1002: B 75 140 75.0 ms15.00 %140.0 ms28.00 %B +3000: D 25 25 25.0 ms5.00 %25.0 ms5.00 %D Profiler was disabled.
diff --git a/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-bottom-up-times.html b/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-bottom-up-times.html index 1baecd5..68dde35a 100644 --- a/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-bottom-up-times.html +++ b/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-bottom-up-times.html
@@ -17,7 +17,7 @@ "scriptId": "0", "url": "a.js", "lineNumber": 0, - "hitCount": 50, + "hitCount": 350, "callUID": 1000, "children": [ { @@ -25,7 +25,7 @@ "scriptId": "0", "url": "a.js", "lineNumber": 1, - "hitCount": 300, + "hitCount": 1000, "callUID": 2, "children": [] }, @@ -89,7 +89,6 @@ } ] }, - "idleTime": 0.300, "startTime": 0, "endTime": 1.000 }
diff --git a/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-calculate-time.html b/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-calculate-time.html index eb45c3a..82d8916 100644 --- a/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-calculate-time.html +++ b/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-calculate-time.html
@@ -93,7 +93,7 @@ "endTime": 1375445601.070847, "samples": [ 1, 2 ] }; - WebInspector.CPUProfileDataModel.prototype._calculateTimes(profileAndExpectations); + WebInspector.ProfileTreeModel.prototype._calculateTotals(profileAndExpectations.head); function checkExpectations(node) { if (Math.abs(node.selfTime - node.expectedSelfTime) > 0.0001) {
diff --git a/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-flame-chart-overview.html b/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-flame-chart-overview.html index afe26e4..545558d 100644 --- a/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-flame-chart-overview.html +++ b/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-flame-chart-overview.html
@@ -809,6 +809,8 @@ var profile = profileAndExpectations._profile; var startTime = profile.startTime * 1000; var endTime = profile.endTime * 1000; + profile.startTime /= 1000; + profile.endTime /= 1000; var samplingInterval = (endTime - startTime) / (profile.samples.length - 1); profile.timestamps = []; for (var i = 0; i < profile.samples.length; ++i)
diff --git a/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-native-nodes-filter-expected.txt b/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-native-nodes-filter-expected.txt index 87ca284..f6756c0 100644 --- a/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-native-nodes-filter-expected.txt +++ b/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-native-nodes-filter-expected.txt
@@ -1,10 +1,10 @@ Tests filtering of native nodes. -(root) id:1 hits:100000 depth:-1 - holder id:10 hits:11110 depth:0 - Aaaaaa id:5 hits:20 depth:1 - Bbb id:6 hits:200 depth:1 - C id:7 hits:22000 depth:0 - Ccc id:9 hits:1000 depth:1 +(root) id:1 total:134330 self:100000 depth:-1 + holder id:10 total:11330 self:11110 depth:0 + Aaaaaa id:5 total:20 self:20 depth:1 + Bbb id:6 total:200 self:200 depth:1 + C id:7 total:23000 self:22000 depth:0 + Ccc id:9 total:1000 self:1000 depth:1 1, 10, 10, 10, 5, 6, 7, 7, 9, 10
diff --git a/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-native-nodes-filter.html b/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-native-nodes-filter.html index 1955179..0356a4d 100644 --- a/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-native-nodes-filter.html +++ b/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-native-nodes-filter.html
@@ -104,15 +104,15 @@ ] }, "idleTime": 202.88199791684747, - "startTime": 1375445600.000847, - "endTime": 1375445601.070847, + "startTime": 100000, + "endTime": 100000 + 111.110 + 22.220 + 1.000, "samples": [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ] }; var model = new WebInspector.CPUProfileDataModel(profile); printTree("", model.profileHead); function printTree(padding, node) { - InspectorTest.addResult(padding + node.functionName + " id:" + node.id + " hits:" + node.hitCount + " depth:" + node.depth); + InspectorTest.addResult(`${padding}${node.functionName} id:${node.id} total:${node.total} self:${node.self} depth:${node.depth}`); node.children.forEach(printTree.bind(null, padding + " ")); } InspectorTest.addResult(model.samples.join(", "));
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/pretty-print-css-expected.txt b/third_party/WebKit/LayoutTests/inspector/sources/pretty-print-css-expected.txt index fb73de3..71413eb 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/pretty-print-css-expected.txt +++ b/third_party/WebKit/LayoutTests/inspector/sources/pretty-print-css-expected.txt
@@ -38,28 +38,34 @@ Running: testFormatInlinedStyles ====== 8< ------ -<html><body><style> -@-webkit-keyframes { - from { - left: 0 - } +<html> + <body> + <style> + @-webkit-keyframes { + from { + left: 0 + } - to { - left: 100px; - } -} -</style><style> -badbraces { -} -} + to { + left: 100px; + } + } + </style> + <style> + badbraces { + } + } -@media screen { - a { - color: red; - text-decoration: none - } -} -</style></body></html> + @media screen { + a { + color: red; + text-decoration: none + } + } + </style> +</body> +</html> + ------ >8 ====== Running: testNonZeroLineMapping
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/pretty-print-html-1-expected.txt b/third_party/WebKit/LayoutTests/inspector/sources/pretty-print-html-1-expected.txt new file mode 100644 index 0000000..f7afe9b9 --- /dev/null +++ b/third_party/WebKit/LayoutTests/inspector/sources/pretty-print-html-1-expected.txt
@@ -0,0 +1,75 @@ +Verifies JavaScript pretty-printing functionality. + + +Running: simpleHTML +====== 8< ------ +<html> + <head> + <title>test</title> + </head> +</html> + +------ >8 ====== +Correct mapping for <</head>> +Correct mapping for <test> +Correct mapping for <</title>> + +Running: selfClosingTags +====== 8< ------ +<html> + <head> + <meta> + </head> + <img> + <hr/> +</html> + +------ >8 ====== +Correct mapping for <meta> +Correct mapping for <hr> +Correct mapping for <<html>> +Correct mapping for <</html>> + +Running: erroneousSelfClosingTags +====== 8< ------ +<head> + <meta> + <meta></meta> + <br/></br> + <link></link> + <title>test</title> +</head> + +------ >8 ====== +Correct mapping for <<br/>> +Correct mapping for <<title>> +Correct mapping for <test> +Correct mapping for <</head>> + +Running: testAttributes +====== 8< ------ +<body> + <canvas width=100 height=100 data-bad-attr='</canvas>'></canvas> +</body> + +------ >8 ====== +Correct mapping for <<body>> +Correct mapping for <width> +Correct mapping for <height> +Correct mapping for <</body>> + +Running: testCustomElements +====== 8< ------ +<body> + <custom-time year=2016 day=1 month=1> + <div>minutes/seconds</div> + </custom-time> +</body> + +------ >8 ====== +Correct mapping for <<body>> +Correct mapping for <custom-time> +Correct mapping for <year> +Correct mapping for <month> +Correct mapping for <</body>> +
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/pretty-print-html-1.html b/third_party/WebKit/LayoutTests/inspector/sources/pretty-print-html-1.html new file mode 100644 index 0000000..b8bc68b --- /dev/null +++ b/third_party/WebKit/LayoutTests/inspector/sources/pretty-print-html-1.html
@@ -0,0 +1,53 @@ +<html> +<head> +<script src="../../http/tests/inspector/inspector-test.js"></script> +<script src="../../http/tests/inspector/debugger-test.js"></script> +<script src="../../http/tests/inspector/sources-test.js"></script> + +<script> + +function test() +{ + var testFormatter = InspectorTest.testPrettyPrint.bind(InspectorTest, "text/html"); + + InspectorTest.runTestSuite([ + function simpleHTML(next) + { + var mappingQueries = ["</head>", "test", "</title>"]; + testFormatter("<html><head><title>test</title></head></html>", mappingQueries, next); + }, + + function selfClosingTags(next) + { + var mappingQueries = ["meta", "hr", "<html>", "</html>"]; + testFormatter("<html><head><meta></head><img><hr/></html>", mappingQueries, next); + }, + + function erroneousSelfClosingTags(next) + { + var mappingQueries = ["<br/>", "<title>", "test", "</head>"]; + testFormatter("<head><meta><meta></meta><br/></br><link></link><title>test</title></head>", mappingQueries, next); + }, + + function testAttributes(next) + { + var mappingQueries = ["<body>", "width", "height", "</body>"]; + testFormatter("<body><canvas width=100 height=100 data-bad-attr='</canvas>'></canvas></body>", mappingQueries, next); + }, + + function testCustomElements(next) + { + var mappingQueries = ["<body>", "custom-time", "year", "month", "</body>"]; + testFormatter("<body><custom-time year=2016 day=1 month=1><div>minutes/seconds</div></custom-time></body>", mappingQueries, next); + } + ]); +} + +</script> + +</head> + +<body onload="runTest()"> +<p>Verifies JavaScript pretty-printing functionality.</p> +</body> +</html>
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/pretty-print-html-2-expected.txt b/third_party/WebKit/LayoutTests/inspector/sources/pretty-print-html-2-expected.txt new file mode 100644 index 0000000..24df69df --- /dev/null +++ b/third_party/WebKit/LayoutTests/inspector/sources/pretty-print-html-2-expected.txt
@@ -0,0 +1,90 @@ +Verifies JavaScript pretty-printing functionality. + + +Running: testDocType +====== 8< ------ +<!DOCTYPE HTML> +<body>hello, world</body> + +------ >8 ====== +Correct mapping for <<body>> +Correct mapping for <hello> +Correct mapping for <</body>> + +Running: testComment +====== 8< ------ +<!-- comment 1 --> +<html> + <!-- comment 2--> + <meta/> + <body> + <!-- comment 3--> + <a>link</a> + </body> +</html> + +------ >8 ====== +Correct mapping for <<body>> +Correct mapping for <comment 1> +Correct mapping for <comment 2> +Correct mapping for <comment 3> +Correct mapping for <link> + +Running: testNonJavascriptScriptTag +====== 8< ------ +<div> + <script type='text/K'> + 2_&{&/x!/:2_!x}'!R + </script> +</div> + +------ >8 ====== +Correct mapping for <type> +Correct mapping for <R> +Correct mapping for <</div>> +Correct mapping for <</script>> + +Running: testList +====== 8< ------ +<ul> + <li>foo + <li> + hello <b>world</b> + ! + <li> + hello <b>world</b> + <b>i'm here</b> + <li>bar + <li>baz + <li> + hello <b>world</b> + <li>another +</ul> + +------ >8 ====== +Correct mapping for <foo> +Correct mapping for <bar> +Correct mapping for <baz> +Correct mapping for <hello> +Correct mapping for <world> +Correct mapping for <another> + +Running: testAutomaticClosingTags +====== 8< ------ +<a> + aaaa + <b> + bbbb1 + <c> + cccc<d>dddd + </c> + bbbb2 +</a> + +------ >8 ====== +Correct mapping for <aaaa> +Correct mapping for <bbbb1> +Correct mapping for <bbbb2> +Correct mapping for <cccc> +Correct mapping for <dddd> +
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/pretty-print-html-2.html b/third_party/WebKit/LayoutTests/inspector/sources/pretty-print-html-2.html new file mode 100644 index 0000000..6c0c575 --- /dev/null +++ b/third_party/WebKit/LayoutTests/inspector/sources/pretty-print-html-2.html
@@ -0,0 +1,53 @@ +<html> +<head> +<script src="../../http/tests/inspector/inspector-test.js"></script> +<script src="../../http/tests/inspector/debugger-test.js"></script> +<script src="../../http/tests/inspector/sources-test.js"></script> + +<script> + +function test() +{ + var testFormatter = InspectorTest.testPrettyPrint.bind(InspectorTest, "text/html"); + + InspectorTest.runTestSuite([ + function testDocType(next) + { + var mappingQueries = ["<body>", "hello", "</body>"]; + testFormatter("<!DOCTYPE HTML><body>hello, world</body>", mappingQueries, next); + }, + + function testComment(next) + { + var mappingQueries = ["<body>", "comment 1", "comment 2", "comment 3", "link"]; + testFormatter("<!-- comment 1 --><html><!-- comment 2--><meta/><body><!-- comment 3--><a>link</a></body></html>", mappingQueries, next); + }, + + function testNonJavascriptScriptTag(next) + { + var mappingQueries = ["type", "R", "</div>", "<\/script>"]; + testFormatter("<div><script type='text/K'>2_&{&/x!/:2_!x}'!R<\/script></div>", mappingQueries, next); + }, + + function testList(next) + { + var mappingQueries = ["foo", "bar", "baz", "hello", "world", "another"]; + testFormatter("<ul><li>foo<li> hello <b>world</b>!<li> hello <b>world</b> <b>i'm here</b><li>bar<li>baz<li>hello <b>world</b><li>another</ul>", mappingQueries, next); + }, + + function testAutomaticClosingTags(next) + { + var mappingQueries = ["aaaa", "bbbb1", "bbbb2", "cccc", "dddd"]; + testFormatter("<a>aaaa<b>bbbb1<c>cccc<d>dddd</c>bbbb2</a>", mappingQueries, next); + }, + ]); +} + +</script> + +</head> + +<body onload="runTest()"> +<p>Verifies JavaScript pretty-printing functionality.</p> +</body> +</html>
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/pretty-print-html-3-expected.txt b/third_party/WebKit/LayoutTests/inspector/sources/pretty-print-html-3-expected.txt new file mode 100644 index 0000000..122e9c7 --- /dev/null +++ b/third_party/WebKit/LayoutTests/inspector/sources/pretty-print-html-3-expected.txt
@@ -0,0 +1,89 @@ +Verifies JavaScript pretty-printing functionality. + + +Running: testLinkFollowedByComment +====== 8< ------ +<link href='a/b/c.css' rel='stylesheet'> +<!-- some comment --> + +------ >8 ====== +Correct mapping for <stylesheet> +Correct mapping for <some> +Correct mapping for <comment> + +Running: testInlineJavascript +====== 8< ------ +<html> + <script> + for (var i = 0; i < 10; ++i) + console.log('test ' + i); + </script> +</html> + +------ >8 ====== +Correct mapping for <console> +Correct mapping for <test> +Correct mapping for <</html> + +Running: testInlineCSS +====== 8< ------ +<html> + <style> + div { + color: red; + border: 1px solid black; + } + </style> +</html> + +------ >8 ====== +Correct mapping for <<html>> +Correct mapping for <red> +Correct mapping for <black> + +Running: testMultilineInput +====== 8< ------ +<html> + <head> + <meta name="ROBOTS" content="NOODP"> + <meta name='viewport' content='text/html'> + <title>foobar</title> + <body> + <script> + if (1 < 2) { + if (2 < 3) { + if (3 < 4) { + if (4 < 5) { + console.log("magic") + } + } + } + } + </script> + <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIA..."> + <style> + div { + display: flex; + align-items: center; + justify-content: center; + } + + body { + width: 100% + } + + * { + border: 1px solid black + } + </style> + </body> +</html> + +------ >8 ====== +Correct mapping for <ROBOTS> +Correct mapping for <image> +Correct mapping for <...> +Correct mapping for <</body>> +Correct mapping for <</html>> +Correct mapping for <</style>> +
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/pretty-print-html-3.html b/third_party/WebKit/LayoutTests/inspector/sources/pretty-print-html-3.html new file mode 100644 index 0000000..6c43174 --- /dev/null +++ b/third_party/WebKit/LayoutTests/inspector/sources/pretty-print-html-3.html
@@ -0,0 +1,59 @@ +<html> +<head> +<script src="../../http/tests/inspector/inspector-test.js"></script> +<script src="../../http/tests/inspector/debugger-test.js"></script> +<script src="../../http/tests/inspector/sources-test.js"></script> + +<script> + +function test() +{ + var testFormatter = InspectorTest.testPrettyPrint.bind(InspectorTest, "text/html"); + + InspectorTest.runTestSuite([ + function testLinkFollowedByComment(next) + { + var mappingQueries = ["stylesheet", "some", "comment"]; + testFormatter("<link href='a/b/c.css' rel='stylesheet'><!-- some comment -->", mappingQueries, next); + }, + + function testInlineJavascript(next) + { + var mappingQueries = ["console", "test", "</html"]; + testFormatter("<html><script>for(var i=0;i<10;++i)console.log('test '+i);<\/script></html>", mappingQueries, next); + }, + + function testInlineCSS(next) + { + var mappingQueries = ["<html>", "red", "black"]; + testFormatter("<html><style>div{color:red;border:1px solid black;}</style></html>", mappingQueries, next); + }, + + function testMultilineInput(next) + { + var html = `<html> +<head> +<meta name=\"ROBOTS\" content=\"NOODP\"> +<meta name='viewport' content='text/html'> +<title>foobar</title> +<body> +<script>if(1<2){if(2<3){if(3<4){if(4<5){console.log("magic")}}}}<\/script> +<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIA..."> +<style>div{display:flex;align-items:center;justify-content:center;}body{width:100%}*{border:1px solid black}</style> +</body> +</html> +`; + var mappingQueries = ["ROBOTS", "image", "...", "</body>", "</html>", "</style>"]; + testFormatter(html, mappingQueries, next); + }, + ]); +} + +</script> + +</head> + +<body onload="runTest()"> +<p>Verifies JavaScript pretty-printing functionality.</p> +</body> +</html>
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/pretty-print-javascript-6-expected.txt b/third_party/WebKit/LayoutTests/inspector/sources/pretty-print-javascript-6-expected.txt index 0753e1ff..ab1a048 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/pretty-print-javascript-6-expected.txt +++ b/third_party/WebKit/LayoutTests/inspector/sources/pretty-print-javascript-6-expected.txt
@@ -10,16 +10,22 @@ Running: inlinedScriptFormatting ====== 8< ------ -<html><body><script> -function f() {} -</script><script> -function g() { - var a; - window.return = 10; - if (a) - return; -} -</script></body></html> +<html> + <body> + <script> + function f() {} + </script> + <script> + function g() { + var a; + window.return = 10; + if (a) + return; + } + </script> + </body> +</html> + ------ >8 ====== Running: generatorFormatter
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-inline-assertion-crash-expected.txt b/third_party/WebKit/LayoutTests/media/track/track-cue-inline-assertion-crash-expected.txt deleted file mode 100644 index 8bd5b493..0000000 --- a/third_party/WebKit/LayoutTests/media/track/track-cue-inline-assertion-crash-expected.txt +++ /dev/null
@@ -1,10 +0,0 @@ -Tests that adding a track and changing its mode through JS doesn't crash the browser. - -** Add a text track through JS to the video element ** -** Add cue to the text track ** -** Set the track mode to showing ** - -No crash. PASS. - -END OF TEST -
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-inline-assertion-crash.html b/third_party/WebKit/LayoutTests/media/track/track-cue-inline-assertion-crash.html index bf55577..5c643b0 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-cue-inline-assertion-crash.html +++ b/third_party/WebKit/LayoutTests/media/track/track-cue-inline-assertion-crash.html
@@ -1,42 +1,17 @@ <!DOCTYPE html> -<html> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <script src=../media-file.js></script> - <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956 - (Please avoid writing new tests using video-test.js) --> - <script src=../video-test.js></script> - - <script> - function startTest() - { - findMediaElement(); - - consoleWrite("** Add a text track through JS to the video element **"); - var t = video.addTextTrack('captions', 'English', 'en'); - - consoleWrite("** Add cue to the text track **"); - t.addCue(new VTTCue(0.0, 10.0, 'wow wow')); - - consoleWrite("** Set the track mode to showing **"); - t.mode = "showing"; - - consoleWrite(""); - consoleWrite("No crash. PASS."); - consoleWrite(""); - - endTest(); - } - </script> - </head> - - <body onload="startTest()"> - <p>Tests that adding a track and changing its mode through JS doesn't crash the browser.</p> - <video controls> - <!-- If the src is specified through JS after the body load, the test doesn't crash anymore. --> - <source src="../content/test.mp4" type="video/mp4"> - <source src="../content/test.ogv" type="video/ogg"> - </video> - </body> -</html> +<title>Tests that adding a track and changing its mode through JS doesn't crash the browser.</title> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<video> + <!-- If the src is specified through JS after the body load, the test doesn't crash anymore. --> + <source src="../content/test.mp4" type="video/mp4"> + <source src="../content/test.ogv" type="video/ogg"> +</video> +<script> +test(function() { + var video = document.querySelector('video'); + var track = video.addTextTrack('captions', 'English', 'en'); + track.addCue(new VTTCue(0.0, 10.0, 'wow wow')); + track.mode = 'showing'; +}); +</script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-mutable-expected.txt b/third_party/WebKit/LayoutTests/media/track/track-cue-mutable-expected.txt deleted file mode 100644 index 9ec31e8..0000000 --- a/third_party/WebKit/LayoutTests/media/track/track-cue-mutable-expected.txt +++ /dev/null
@@ -1,76 +0,0 @@ -CONSOLE WARNING: The provided value 'RL' is not a valid enum value of type DirectionSetting. -CONSOLE WARNING: The provided value 'End' is not a valid enum value of type AlignSetting. -Tests modifying attributes of a VTTCue - -** Test initial values. -RUN(textCue = cues.getCueById('1')) -EXPECTED (textCue.startTime == '0') OK -EXPECTED (textCue.endTime == '1') OK -EXPECTED (textCue.pauseOnExit == 'false') OK -EXPECTED (textCue.vertical == '') OK -EXPECTED (textCue.snapToLines == 'true') OK -EXPECTED (textCue.line == 'auto') OK -EXPECTED (textCue.position == 'auto') OK -EXPECTED (textCue.size == '100') OK -EXPECTED (textCue.align == 'middle') OK - -** Modify cue values. -RUN(textCue.startTime = 1.1) -EXPECTED (textCue.startTime == '1.1') OK - -RUN(textCue.endTime = 3.9) -EXPECTED (textCue.endTime == '3.9') OK - -RUN(textCue.pauseOnExit = true) -EXPECTED (textCue.pauseOnExit == 'true') OK - -On setting, the text track cue writing direction must be set to the value given in the first cell of the row in the table above whose second cell is a case-sensitive match for the new value. -http://dev.w3.org/html5/webvtt/#dfn-dom-vttcue-vertical -RUN(textCue.vertical = 'RL') -EXPECTED (textCue.vertical == '') OK -RUN(textCue.vertical = 'rl') -EXPECTED (textCue.vertical == 'rl') OK - -RUN(textCue.snapToLines = false) -EXPECTED (textCue.snapToLines == 'false') OK - -On setting, the text track cue line position must be set to the new value; if the new value is the string 'auto', then it must be interpreted as the special value auto. -http://dev.w3.org/html5/webvtt/#dfn-vttcue-line -EXPECTED (textCue.line == 'auto') OK -TEST(textCue.line = 'gazonk') THROWS("TypeError: Failed to set the 'line' property on 'VTTCue': 'gazonk' is not a valid enum value.") FAIL -EXPECTED (textCue.line == 'auto') OK -RUN(textCue.line = 42) -EXPECTED (textCue.line == '42') OK -RUN(textCue.line = -2) -EXPECTED (textCue.line == '-2') OK -RUN(textCue.line = 102) -EXPECTED (textCue.line == '102') OK -RUN(textCue.snapToLines = true) -RUN(textCue.line = -2) -EXPECTED (textCue.line == '-2') OK -RUN(textCue.line = 102) -EXPECTED (textCue.line == '102') OK - -On setting, if the new value is negative or greater than 100, then throw an IndexSizeError exception. Otherwise, set the text track cue text position to the new value. -http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#dom-texttrackcue-line -TEST(textCue.position = -200) THROWS(DOMException.INDEX_SIZE_ERR: Failed to set the 'position' property on 'VTTCue': The value provided (-200) is outside the range [0, 100].) OK -TEST(textCue.position = 110) THROWS(DOMException.INDEX_SIZE_ERR: Failed to set the 'position' property on 'VTTCue': The value provided (110) is outside the range [0, 100].) OK -RUN(textCue.position = 11) -EXPECTED (textCue.position == '11') OK - -On setting, if the new value is negative or greater than 100, then throw an IndexSizeError exception. Otherwise, set the text track cue size to the new value. -http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#dom-texttrackcue-size -TEST(textCue.size = -200) THROWS(DOMException.INDEX_SIZE_ERR: Failed to set the 'size' property on 'VTTCue': The value provided (-200) is outside the range [0, 100].) OK -TEST(textCue.size = 110) THROWS(DOMException.INDEX_SIZE_ERR: Failed to set the 'size' property on 'VTTCue': The value provided (110) is outside the range [0, 100].) OK -RUN(textCue.size = 57) -EXPECTED (textCue.size == '57') OK - -On setting, the text track cue text alignment must be set to the value given in the first cell of the row in the table above whose second cell is a case-sensitive match for the new value. -http://dev.w3.org/html5/webvtt/#dfn-dom-vttcue-align -RUN(textCue.align = 'End') -EXPECTED (textCue.align == 'middle') OK -RUN(textCue.align = 'end') -EXPECTED (textCue.align == 'end') OK - -END OF TEST -
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-mutable-fragment-expected.txt b/third_party/WebKit/LayoutTests/media/track/track-cue-mutable-fragment-expected.txt deleted file mode 100644 index da08178..0000000 --- a/third_party/WebKit/LayoutTests/media/track/track-cue-mutable-fragment-expected.txt +++ /dev/null
@@ -1,32 +0,0 @@ -Test that cue text is mutable. - -Fragment 1 - -Different text ipsum dolor sit amet, -Fragment 2 - -Lorem ipsum dolor sit amet, -RUN(testCue = testTrack.track.cues[0]) - -** Test initial cue contents -EXPECTED (testCue.text == 'Lorem ipsum dolor sit amet,') OK - -** Cue getCueAsHTML() should return a correct fragment -EXPECTED (fragment.isEqualNode(testCue.getCueAsHTML()) == 'true') OK - -** Appending getCuesAsHTML() twice to the DOM should be succesful -RUN(document.getElementsByTagName('div')[0].appendChild(testCue.getCueAsHTML())) -RUN(document.getElementsByTagName('div')[1].appendChild(testCue.getCueAsHTML())) -EXPECTED (fragment.isEqualNode(document.getElementsByTagName('div')[0]) == 'true') OK -EXPECTED (fragment.isEqualNode(document.getElementsByTagName('div')[1]) == 'true') OK - -** The fragment returned by getCuesAsHTML() should be independently mutable -RUN(document.getElementsByTagName('div')[0].firstChild.textContent = 'Different text ') -EXPECTED (fragment.isEqualNode(document.getElementsByTagName('div')[0]) == 'false') OK -EXPECTED (fragment.isEqualNode(document.getElementsByTagName('div')[1]) == 'true') OK - -** Calling twice getCueAsHTML() should not return the same fragment -EXPECTED (testCue.getCueAsHTML() == testCue.getCueAsHTML() == 'false') OK - -END OF TEST -
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-mutable-fragment.html b/third_party/WebKit/LayoutTests/media/track/track-cue-mutable-fragment.html index ab2255f..e872421d4 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-cue-mutable-fragment.html +++ b/third_party/WebKit/LayoutTests/media/track/track-cue-mutable-fragment.html
@@ -1,98 +1,86 @@ <!DOCTYPE html> -<html> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>Test that cue fragment is mutable.</title> +<script src="../media-file.js"></script> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<style> +p, div { display: none; } +</style> +<video> + <track src="captions-webvtt/captions-html.vtt" kind="captions" default > +</video> +<p>Fragment 1</p> +<div></div> - <script src=../media-file.js></script> - <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956 - (Please avoid writing new tests using video-test.js) --> - <script src=../video-test.js></script> - <script src=../media-controls.js></script> +<p>Fragment 2</p> +<div></div> +<script> +async_test(function(t) { + var video = document.querySelector("video"); + var testTrack = document.querySelector("track"); - <script> + video.oncanplaythrough = t.step_func(testMutability); + testTrack.onload = t.step_func(testMutability); - var testTrack; - var testCue; - var fragment; + var fragment; + var eventCount = 0; + function testMutability() { + eventCount++; + if (eventCount != 2) + return; - function createExpectedFragment(rootNode) - { - fragment = rootNode; - fragment.appendChild(document.createTextNode("Lorem ")); + var testCue = testTrack.track.cues[0]; - var bold = document.createElement("b"); - bold.appendChild(document.createTextNode("ipsum")); - fragment.appendChild(bold); + // Test initial cue contents. + assert_equals(testCue.text, "Lorem <b>ipsum</b> <u>dolor</u> <i.sit>sit</i> amet,"); - fragment.appendChild(document.createTextNode(" ")); + // Cue getCueAsHTML() should return a correct fragment. + createExpectedFragment(document.createDocumentFragment()); + assert_true(fragment.isEqualNode(testCue.getCueAsHTML())); - var underline = document.createElement("u"); - underline.appendChild(document.createTextNode("dolor")); - fragment.appendChild(underline); + // Appending getCuesAsHTML() twice to the DOM should be succesful. + document.getElementsByTagName("div")[0].appendChild(testCue.getCueAsHTML()); + document.getElementsByTagName("div")[1].appendChild(testCue.getCueAsHTML()); - fragment.appendChild(document.createTextNode(" ")); + createExpectedFragment(document.createElement("div")); + assert_true(fragment.isEqualNode(document.getElementsByTagName("div")[0])); + assert_true(fragment.isEqualNode(document.getElementsByTagName("div")[1])); - var italics = document.createElement("i"); - italics.className = "sit"; - italics.appendChild(document.createTextNode("sit")); - fragment.appendChild(italics); + // The fragment returned by getCuesAsHTML() should be independently mutable. + document.getElementsByTagName("div")[0].firstChild.textContent = "Different text "; + assert_false(fragment.isEqualNode(document.getElementsByTagName("div")[0])); + assert_true(fragment.isEqualNode(document.getElementsByTagName("div")[1])); - fragment.appendChild(document.createTextNode(" amet,")); - } + // Calling twice getCueAsHTML() should not return the same fragment. + assert_not_equals(testCue.getCueAsHTML(), testCue.getCueAsHTML()); - function testMutability() - { - run("testCue = testTrack.track.cues[0]"); + t.done(); + } - consoleWrite("<br>** Test initial cue contents"); - testExpected("testCue.text", "Lorem <b>ipsum</b> <u>dolor</u> <i.sit>sit</i> amet,"); + function createExpectedFragment(rootNode) { + fragment = rootNode; + fragment.appendChild(document.createTextNode("Lorem ")); - consoleWrite("<br>** Cue getCueAsHTML() should return a correct fragment"); - createExpectedFragment(document.createDocumentFragment()); - testExpected("fragment.isEqualNode(testCue.getCueAsHTML())", true); + var bold = document.createElement("b"); + bold.appendChild(document.createTextNode("ipsum")); + fragment.appendChild(bold); - consoleWrite("<br>** Appending getCuesAsHTML() twice to the DOM should be succesful"); - run("document.getElementsByTagName('div')[0].appendChild(testCue.getCueAsHTML())"); - run("document.getElementsByTagName('div')[1].appendChild(testCue.getCueAsHTML())"); + fragment.appendChild(document.createTextNode(" ")); - createExpectedFragment(document.createElement('div')); - testExpected("fragment.isEqualNode(document.getElementsByTagName('div')[0])", true); - testExpected("fragment.isEqualNode(document.getElementsByTagName('div')[1])", true); + var underline = document.createElement("u"); + underline.appendChild(document.createTextNode("dolor")); + fragment.appendChild(underline); - consoleWrite("<br>** The fragment returned by getCuesAsHTML() should be independently mutable"); - run("document.getElementsByTagName('div')[0].firstChild.textContent = 'Different text '"); - testExpected("fragment.isEqualNode(document.getElementsByTagName('div')[0])", false); - testExpected("fragment.isEqualNode(document.getElementsByTagName('div')[1])", true); + fragment.appendChild(document.createTextNode(" ")); - consoleWrite("<br>** Calling twice getCueAsHTML() should not return the same fragment"); - testExpected("testCue.getCueAsHTML() == testCue.getCueAsHTML()", false); + var italics = document.createElement("i"); + italics.className = "sit"; + italics.appendChild(document.createTextNode("sit")); + fragment.appendChild(italics); - consoleWrite(""); - endTest(); - } + fragment.appendChild(document.createTextNode(" amet,")); + } - function loaded() - { - findMediaElement(); - testTrack = document.querySelector('track'); - - waitForEventsAndCall([[video, 'canplaythrough'], [testTrack, 'load']], testMutability); - - video.src = findMediaFile('video', '../content/counting'); - } - - </script> - </head> - <body onload="loaded()"> - <video controls > - <track src="captions-webvtt/captions-html.vtt" kind="captions" default > - </video> - <p>Test that cue text is mutable.</p> - - <p>Fragment 1</p> - <div></div> - - <p>Fragment 2</p> - <div></div> - </body> -</html> + video.src = findMediaFile("video", "../content/counting"); +}); +</script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-mutable-text-expected.txt b/third_party/WebKit/LayoutTests/media/track/track-cue-mutable-text-expected.txt deleted file mode 100644 index 895ff05a..0000000 --- a/third_party/WebKit/LayoutTests/media/track/track-cue-mutable-text-expected.txt +++ /dev/null
@@ -1,23 +0,0 @@ -Test that cue text is mutable. - - -** Test initial cue info -EXPECTED (testTrack.track.activeCues.length == '0') OK -No text track cue with display id '-webkit-media-text-track-display' is currently visible -EXPECTED (testTrack.track.cues[0].startTime == '1') OK -EXPECTED (testTrack.track.cues[1].startTime == '3') OK -EXPECTED (testTrack.track.cues[0].text == 'Lorem ipsum dolor sit amet,') OK -EXPECTED (fragment.isEqualNode(testTrack.track.cues[0].getCueAsHTML()) == 'true') OK - -** Change the start time of cue #1, it should become visible. -RUN(testTrack.track.cues[0].startTime = 0) -EXPECTED (testTrack.track.cues[0].startTime == '0') OK -EXPECTED (textTrackDisplayElement(video, 'display').innerText == 'Lorem ipsum dolor sit amet,') OK - -** Change the cue text, getCueAsHTML() should return a new, correct fragment. -RUN(testTrack.track.cues[0].text = 'Lorem ipsum dolor sit amet,') -EXPECTED (testTrack.track.cues[0].text == 'Lorem ipsum dolor sit amet,') OK -EXPECTED (fragment.isEqualNode(testTrack.track.cues[0].getCueAsHTML()) == 'true') OK - -END OF TEST -
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-mutable-text.html b/third_party/WebKit/LayoutTests/media/track/track-cue-mutable-text.html index d7088c8..054968c 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-cue-mutable-text.html +++ b/third_party/WebKit/LayoutTests/media/track/track-cue-mutable-text.html
@@ -1,87 +1,73 @@ <!DOCTYPE html> -<html> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>Test that cue text is mutable.</title> +<script src="../media-file.js"></script> +<script src="../media-controls.js"></script> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<video> + <track src="captions-webvtt/captions-gaps.vtt" kind="captions" default > +</video> +<script> +async_test(function(t) { + var video = document.querySelector("video"); + var testTrack = document.querySelector("track"); - <script src=../media-file.js></script> - <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956 - (Please avoid writing new tests using video-test.js) --> - <script src=../video-test.js></script> - <script src=../media-controls.js></script> + video.oncanplaythrough = t.step_func(testMutability); + testTrack.onload = t.step_func(testMutability); - <script> + var eventCount = 0; + function testMutability() { + eventCount++; + if (eventCount != 2) + return; - var testTrack; - var fragment; + // Test initial cue info. + assert_equals(testTrack.track.activeCues.length, 0); - function testMutability() - { - consoleWrite("<br>** Test initial cue info"); + assert_equals(testTrack.track.cues[0].startTime, 1.0); + assert_equals(testTrack.track.cues[1].startTime, 3.0); - testExpected("testTrack.track.activeCues.length", 0); - testExpected("textTrackDisplayElement(video, 'display').innerText", ""); + assert_equals(testTrack.track.cues[0].text, "Lorem ipsum dolor sit amet,"); + var fragment = document.createDocumentFragment(); + fragment.appendChild(document.createTextNode("Lorem ipsum dolor sit amet,")); + assert_true(fragment.isEqualNode(testTrack.track.cues[0].getCueAsHTML())); - testExpected("testTrack.track.cues[0].startTime", 1.0); - testExpected("testTrack.track.cues[1].startTime", 3.0); + // Change the start time of cue #1, it should become visible. + testTrack.track.cues[0].startTime = 0; + assert_equals(testTrack.track.cues[0].startTime, 0); + assert_equals(textTrackDisplayElement(video, "display").innerText, "Lorem ipsum dolor sit amet,"); - testExpected("testTrack.track.cues[0].text", "Lorem ipsum dolor sit amet,"); - fragment = document.createDocumentFragment(); - fragment.appendChild(document.createTextNode("Lorem ipsum dolor sit amet,")); - testExpected("fragment.isEqualNode(testTrack.track.cues[0].getCueAsHTML())", true); + // Change the cue text, getCueAsHTML() should return a new, correct fragment. + testTrack.track.cues[0].text = "Lorem <b>ipsum</b> <u>dolor</u> <i.sit>sit</i> amet,"; + assert_equals(testTrack.track.cues[0].text, "Lorem <b>ipsum</b> <u>dolor</u> <i.sit>sit</i> amet,"); - consoleWrite("<br>** Change the start time of cue #1, it should become visible."); - run("testTrack.track.cues[0].startTime = 0"); - testExpected("testTrack.track.cues[0].startTime", 0); - testExpected("textTrackDisplayElement(video, 'display').innerText", "Lorem ipsum dolor sit amet,"); + fragment = document.createDocumentFragment(); + fragment.appendChild(document.createTextNode("Lorem ")); - consoleWrite("<br>** Change the cue text, getCueAsHTML() should return a new, correct fragment."); - run("testTrack.track.cues[0].text = 'Lorem <b>ipsum</b> <u>dolor</u> <i.sit>sit</i> amet,'"); - testExpected("testTrack.track.cues[0].text", "Lorem <b>ipsum</b> <u>dolor</u> <i.sit>sit</i> amet,"); + var bold = document.createElement("b"); + bold.appendChild(document.createTextNode("ipsum")); + fragment.appendChild(bold); - fragment = document.createDocumentFragment(); - fragment.appendChild(document.createTextNode("Lorem ")); + fragment.appendChild(document.createTextNode(" ")); - var bold = document.createElement("b"); - bold.appendChild(document.createTextNode("ipsum")); - fragment.appendChild(bold); + var underline = document.createElement("u"); + underline.appendChild(document.createTextNode("dolor")); + fragment.appendChild(underline); - fragment.appendChild(document.createTextNode(" ")); + fragment.appendChild(document.createTextNode(" ")); - var underline = document.createElement("u"); - underline.appendChild(document.createTextNode("dolor")); - fragment.appendChild(underline); + var italics = document.createElement("i"); + italics.className = "sit"; + italics.appendChild(document.createTextNode("sit")); + fragment.appendChild(italics); - fragment.appendChild(document.createTextNode(" ")); + fragment.appendChild(document.createTextNode(" amet,")); - var italics = document.createElement("i"); - italics.className = "sit"; - italics.appendChild(document.createTextNode("sit")); - fragment.appendChild(italics); + assert_true(fragment.isEqualNode(testTrack.track.cues[0].getCueAsHTML())); - fragment.appendChild(document.createTextNode(" amet,")); + t.done(); + } - testExpected("fragment.isEqualNode(testTrack.track.cues[0].getCueAsHTML())", true); - - consoleWrite(""); - endTest(); - } - - function loaded() - { - findMediaElement(); - testTrack = document.querySelector('track'); - - waitForEventsAndCall([[video, 'canplaythrough'], [testTrack, 'load']], testMutability); - - video.src = findMediaFile('video', '../content/counting'); - } - - </script> - </head> - <body onload="loaded()"> - <video controls > - <track src="captions-webvtt/captions-gaps.vtt" kind="captions" default > - </video> - <p>Test that cue text is mutable.</p> - </body> -</html> + video.src = findMediaFile("video", "../content/counting"); +}); +</script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-mutable.html b/third_party/WebKit/LayoutTests/media/track/track-cue-mutable.html index 4e9e387..ea6a126 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-cue-mutable.html +++ b/third_party/WebKit/LayoutTests/media/track/track-cue-mutable.html
@@ -1,112 +1,92 @@ <!DOCTYPE html> -<html> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>Tests modifying attributes of a VTTCue</title> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<video> + <track id="captions" src="captions-webvtt/captions.vtt" kind="captions" default> +</video> +<script> +async_test(function(t) { + var track = document.querySelector("track"); - <script src=../media-file.js></script> - <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956 - (Please avoid writing new tests using video-test.js) --> - <script src=../video-test.js></script> - <script> + track.onload = t.step_func_done(function() { + var cues = track.track.cues; - var cues; + // Test initial values. + textCue = cues.getCueById("1"); - function logSpecURL(url, description) - { - consoleWrite("<br><i>" + description + "</i>"); - consoleWrite("<a href=" + url + ">" + url + "<" + "/a>"); - } + assert_equals(textCue.startTime, 0); + assert_equals(textCue.endTime, 1.0); + assert_equals(textCue.pauseOnExit, false); + assert_equals(textCue.vertical, ""); + assert_equals(textCue.snapToLines, true); + assert_equals(textCue.line, "auto"); + assert_equals(textCue.position, "auto"); + assert_equals(textCue.size, 100); + assert_equals(textCue.align, "middle"); - function trackLoaded() - { - track = document.getElementById('captions'); - cues = track.track.cues; + // Modify cue values. + textCue.startTime = 1.1; + assert_equals(textCue.startTime, 1.1); - consoleWrite("** Test initial values."); - run("textCue = cues.getCueById('1')"); + textCue.endTime = 3.9; + assert_equals(textCue.endTime, 3.9); - testExpected("textCue.startTime", 0); - testExpected("textCue.endTime", 1.0); - testExpected("textCue.pauseOnExit", false); - testExpected("textCue.vertical", ""); - testExpected("textCue.snapToLines", true); - testExpected("textCue.line", "auto"); - testExpected("textCue.position", "auto"); - testExpected("textCue.size", 100); - testExpected("textCue.align", "middle"); + textCue.pauseOnExit = true; + assert_equals(textCue.pauseOnExit, true); - consoleWrite("<br>** Modify cue values."); + // http://dev.w3.org/html5/webvtt/#dfn-dom-vttcue-vertical + // On setting, the text track cue writing direction must be set to the value given in the first cell + // of the row in the table above whose second cell is a case-sensitive match for the new value. + textCue.vertical = "RL"; + assert_equals(textCue.vertical, ""); + textCue.vertical = "rl"; + assert_equals(textCue.vertical, "rl"); - run("textCue.startTime = 1.1"); - testExpected("textCue.startTime", 1.1); + textCue.snapToLines = false; + assert_equals(textCue.snapToLines, false); - consoleWrite(""); - run("textCue.endTime = 3.9"); - testExpected("textCue.endTime", 3.9); + // http://dev.w3.org/html5/webvtt/#dfn-vttcue-line + // On setting, the text track cue line position must be set to the new value; + // if the new value is the string "auto", then it must be interpreted as the special value auto. + assert_equals(textCue.line, "auto"); + assert_throws(new TypeError, function() { textCue.line = "gazonk"; }); + assert_equals(textCue.line, "auto"); + textCue.line = 42; + assert_equals(textCue.line, 42); + textCue.line = -2; + assert_equals(textCue.line, -2); + textCue.line = 102; + assert_equals(textCue.line, 102); + textCue.snapToLines = true; + textCue.line = -2; + assert_equals(textCue.line, -2); + textCue.line = 102; + assert_equals(textCue.line, 102); - consoleWrite(""); - run("textCue.pauseOnExit = true"); - testExpected("textCue.pauseOnExit", true); + // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#dom-texttrackcue-line + // On setting, if the new value is negative or greater than 100, then throw an IndexSizeError exception. + // Otherwise, set the text track cue text position to the new value. + assert_throws("IndexSizeError", function() { textCue.position = -200; }); + assert_throws("IndexSizeError", function() { textCue.position = 110; }); + textCue.position = 11; + assert_equals(textCue.position, 11); - logSpecURL("http://dev.w3.org/html5/webvtt/#dfn-dom-vttcue-vertical", - "On setting, the text track cue writing direction must be set to the value given in the first cell of the row in the table above whose second cell is a case-sensitive match for the new value."); - run("textCue.vertical = 'RL'"); - testExpected("textCue.vertical", ""); - run("textCue.vertical = 'rl'"); - testExpected("textCue.vertical", "rl"); + // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#dom-texttrackcue-size + // On setting, if the new value is negative or greater than 100, then throw an IndexSizeError exception. + // Otherwise, set the text track cue size to the new value. + assert_throws("IndexSizeError", function() { textCue.size = -200 }); + assert_throws("IndexSizeError", function() { textCue.size = 110 }); + textCue.size = 57; + assert_equals(textCue.size, 57); - consoleWrite(""); - run("textCue.snapToLines = false"); - testExpected("textCue.snapToLines", false); - - logSpecURL("http://dev.w3.org/html5/webvtt/#dfn-vttcue-line", - "On setting, the text track cue line position must be set to the new value; if the new value is the string 'auto', then it must be interpreted as the special value auto."); - testExpected("textCue.line", "auto"); - testException("textCue.line = 'gazonk'", '"TypeError: Failed to set the \'line\' property on \'VTTCue\': \'gazonk\' is not a valid enum value."'); - testExpected("textCue.line", "auto"); - run("textCue.line = 42"); - testExpected("textCue.line", 42); - run("textCue.line = -2"); - testExpected("textCue.line", -2); - run("textCue.line = 102"); - testExpected("textCue.line", 102); - run("textCue.snapToLines = true"); - run("textCue.line = -2"); - testExpected("textCue.line", -2); - run("textCue.line = 102"); - testExpected("textCue.line", 102); - - logSpecURL("http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#dom-texttrackcue-line", - "On setting, if the new value is negative or greater than 100, then throw an IndexSizeError exception. Otherwise, set the text track cue text position to the new value."); - testDOMException("textCue.position = -200", "DOMException.INDEX_SIZE_ERR"); - testDOMException("textCue.position = 110", "DOMException.INDEX_SIZE_ERR"); - run("textCue.position = 11"); - testExpected("textCue.position", 11); - - logSpecURL("http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#dom-texttrackcue-size", - "On setting, if the new value is negative or greater than 100, then throw an IndexSizeError exception. Otherwise, set the text track cue size to the new value."); - testDOMException("textCue.size = -200", "DOMException.INDEX_SIZE_ERR"); - testDOMException("textCue.size = 110", "DOMException.INDEX_SIZE_ERR"); - run("textCue.size = 57"); - testExpected("textCue.size", 57); - - logSpecURL("http://dev.w3.org/html5/webvtt/#dfn-dom-vttcue-align", - "On setting, the text track cue text alignment must be set to the value given in the first cell of the row in the table above whose second cell is a case-sensitive match for the new value."); - run("textCue.align = 'End'"); - testExpected("textCue.align", "middle"); - run("textCue.align = 'end'"); - testExpected("textCue.align", "end"); - - consoleWrite(""); - endTest(); - } - - </script> - </head> - <body> - <p>Tests modifying attributes of a VTTCue</p> - <video controls> - <track id="captions" src="captions-webvtt/captions.vtt" kind="captions" onload="trackLoaded()" default> - </video> - </body> -</html> + // http://dev.w3.org/html5/webvtt/#dfn-dom-vttcue-align + // On setting, the text track cue text alignment must be set to the value given in the first cell + // of the row in the table above whose second cell is a case-sensitive match for the new value. + textCue.align = "End"; + assert_equals(textCue.align, "middle"); + textCue.align = "end"; + assert_equals(textCue.align, "end"); + }); +}); +</script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-negative-timestamp-expected.txt b/third_party/WebKit/LayoutTests/media/track/track-cue-negative-timestamp-expected.txt deleted file mode 100644 index 4c2d4cd..0000000 --- a/third_party/WebKit/LayoutTests/media/track/track-cue-negative-timestamp-expected.txt +++ /dev/null
@@ -1,23 +0,0 @@ -Tests negative timestamps. - -Test that cues with negative startTime are not added: -EXPECTED (testTrack.track.cues.length == '4') OK -RUN(textCue = new VTTCue(-3439332606, 3.4, 'Sausage?')) -RUN(testTrack.track.addCue(textCue)) -EXPECTED (testTrack.track.cues.length == '4') OK - -Test that cues with negative startTime and negative endTime are not added: -EXPECTED (testTrack.track.cues.length == '4') OK -RUN(textCue = new VTTCue(-110, -3.4, 'Pepperoni?')) -RUN(testTrack.track.addCue(textCue)) -EXPECTED (testTrack.track.cues.length == '4') OK - -Test that setting startTime and endTime to negative values does not affect the value: -EXPECTED (testTrack.track.cues[3].startTime == '121') OK -RUN(testTrack.track.cues[3].startTime = -5) -EXPECTED (testTrack.track.cues[3].startTime == '121') OK -EXPECTED (testTrack.track.cues[3].endTime == '361200.5') OK -RUN(testTrack.track.cues[3].endTime = -3439332606) -EXPECTED (testTrack.track.cues[3].endTime == '361200.5') OK -END OF TEST -
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-negative-timestamp.html b/third_party/WebKit/LayoutTests/media/track/track-cue-negative-timestamp.html index 83d7877..05fa383c 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-cue-negative-timestamp.html +++ b/third_party/WebKit/LayoutTests/media/track/track-cue-negative-timestamp.html
@@ -1,45 +1,34 @@ <!DOCTYPE html> -<html> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>Tests negative timestamps.</title> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<video> + <track id="testTrack" src="captions-webvtt/tc013-settings.vtt" default> +</video> +<script> +async_test(function(t) { + var track = document.querySelector("track"); - <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956 - (Please avoid writing new tests using video-test.js) --> - <script src=../video-test.js></script> - <script> + track.onload = t.step_func_done(function() { + // Test that cues with negative startTime are not added. + assert_equals(testTrack.track.cues.length, 4); + textCue = new VTTCue(-3439332606, 3.4, "Sausage?"); + testTrack.track.addCue(textCue); + assert_equals(testTrack.track.cues.length, 4); - function trackLoaded() - { - consoleWrite("Test that cues with negative startTime are not added:"); - testExpected("testTrack.track.cues.length", 4); - run("textCue = new VTTCue(-3439332606, 3.4, 'Sausage?')"); - run("testTrack.track.addCue(textCue)"); - testExpected("testTrack.track.cues.length", 4); + // Test that cues with negative startTime and negative endTime are not added. + assert_equals(testTrack.track.cues.length, 4); + textCue = new VTTCue(-110, -3.4, "Pepperoni?"); + testTrack.track.addCue(textCue); + assert_equals(testTrack.track.cues.length, 4); - consoleWrite("<br>Test that cues with negative startTime and negative endTime are not added:"); - testExpected("testTrack.track.cues.length", 4); - run("textCue = new VTTCue(-110, -3.4, 'Pepperoni?')"); - run("testTrack.track.addCue(textCue)"); - testExpected("testTrack.track.cues.length", 4); - - consoleWrite("<br>Test that setting startTime and endTime to negative values does not affect the value:"); - testExpected("testTrack.track.cues[3].startTime", 121); - run("testTrack.track.cues[3].startTime = -5"); - testExpected("testTrack.track.cues[3].startTime", 121); - testExpected("testTrack.track.cues[3].endTime", 361200.5); - run("testTrack.track.cues[3].endTime = -3439332606"); - testExpected("testTrack.track.cues[3].endTime", 361200.5); - - endTest(); - } - - </script> - - </head> - <body> - <p>Tests negative timestamps.</p> - <video> - <track id="testTrack" src="captions-webvtt/tc013-settings.vtt" onload="trackLoaded()" default> - </video> - </body> -</html> + // Test that setting startTime and endTime to negative values does not affect the value. + assert_equals(testTrack.track.cues[3].startTime, 121); + testTrack.track.cues[3].startTime = -5; + assert_equals(testTrack.track.cues[3].startTime, 121); + assert_equals(testTrack.track.cues[3].endTime, 361200.5); + testTrack.track.cues[3].endTime = -3439332606; + assert_equals(testTrack.track.cues[3].endTime, 361200.5); + }); +}); +</script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/forms/range/range-appearance-basic-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/forms/range/range-appearance-basic-expected.png new file mode 100644 index 0000000..642bb7bc --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/android/fast/forms/range/range-appearance-basic-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux-precise/fast/repaint/block-layout-inline-children-replaced-expected.txt b/third_party/WebKit/LayoutTests/platform/linux-precise/fast/repaint/block-layout-inline-children-replaced-expected.txt deleted file mode 100644 index 52a51af8..0000000 --- a/third_party/WebKit/LayoutTests/platform/linux-precise/fast/repaint/block-layout-inline-children-replaced-expected.txt +++ /dev/null
@@ -1,20 +0,0 @@ -{ - "bounds": [800, 600], - "children": [ - { - "bounds": [800, 600], - "contentsOpaque": true, - "drawsContent": true, - "repaintRects": [ - [154, 37, 94, 100], - [0, 36, 402, 152] - ], - "paintInvalidationClients": [ - "LayoutBlockFlow DIV id='target' class='target'", - "RootInlineBox", - "LayoutImage IMG" - ] - } - ] -} -
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/range/range-appearance-basic-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/range/range-appearance-basic-expected.png index 642bb7bc..0436896e3 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/range/range-appearance-basic-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/range/range-appearance-basic-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/repaint/block-layout-inline-children-replaced-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/repaint/block-layout-inline-children-replaced-expected.txt index 1e0de6e..ce294c7 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/repaint/block-layout-inline-children-replaced-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/repaint/block-layout-inline-children-replaced-expected.txt
@@ -5,19 +5,21 @@ "bounds": [800, 600], "contentsOpaque": true, "drawsContent": true, - "repaintRects": [ - [154, 37, 94, 100], - [0, 37, 402, 100], - [0, 36, 402, 152] - ], - "paintInvalidationClients": [ - "LayoutBlockFlow DIV id='target' class='target'", - "RootInlineBox", - "LayoutImage IMG", - "InlineBox", - "RootInlineBox", - "LayoutBlockFlow DIV id='target' class='target'", - "LayoutImage IMG" + "paintInvalidations": [ + { + "object": "LayoutBlockFlow DIV id='target' class='target'", + "rect": [0, 36, 402, 152], + "reason": "forced by layout" + }, + { + "object": "LayoutImage IMG", + "rect": [154, 37, 94, 100], + "reason": "location change" + }, + { + "object": "RootInlineBox", + "reason": "full" + } ] } ]
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/spv2/svg/custom/object-sizing-no-width-height-change-content-box-size-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/virtual/spv2/svg/custom/object-sizing-no-width-height-change-content-box-size-expected.txt index 119dfc29..65fcde82 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/virtual/spv2/svg/custom/object-sizing-no-width-height-change-content-box-size-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/spv2/svg/custom/object-sizing-no-width-height-change-content-box-size-expected.txt
@@ -7,31 +7,11 @@ "drawsContent": true, "paintInvalidations": [ { - "object": "InlineBox", - "rect": [0, 0, 0, 0], - "reason": "full" - }, - { "object": "LayoutBlockFlow div id='contentBox'", "rect": [8, 8, 402, 405], "reason": "forced by layout" }, { - "object": "LayoutEmbeddedObject object", - "rect": [209, 9, 200, 400], - "reason": "incremental" - }, - { - "object": "LayoutSVGEllipse circle", - "rect": [89, 189, 40, 40], - "reason": "location change" - }, - { - "object": "LayoutSVGEllipse circle", - "rect": [169, 169, 80, 80], - "reason": "location change" - }, - { "object": "LayoutSVGRect rect", "rect": [9, 9, 400, 400], "reason": "location change" @@ -47,18 +27,35 @@ "reason": "full" }, { + "object": "LayoutEmbeddedObject object", + "rect": [209, 9, 200, 400], + "reason": "incremental" + }, + { "object": "LayoutView #document", "rect": [209, 9, 200, 400], "reason": "incremental" }, { - "object": "RootInlineBox", - "rect": [0, 0, 0, 0], + "object": "LayoutSVGEllipse circle", + "rect": [169, 169, 80, 80], + "reason": "location change" + }, + { + "object": "LayoutSVGEllipse circle", + "rect": [89, 189, 40, 40], + "reason": "location change" + }, + { + "object": "InlineBox", "reason": "full" }, { "object": "RootInlineBox", - "rect": [0, 0, 0, 0], + "reason": "full" + }, + { + "object": "RootInlineBox", "reason": "full" } ]
diff --git a/third_party/WebKit/LayoutTests/platform/mac-retina/fast/repaint/block-layout-inline-children-replaced-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-retina/fast/repaint/block-layout-inline-children-replaced-expected.txt deleted file mode 100644 index 2e64cd9a..0000000 --- a/third_party/WebKit/LayoutTests/platform/mac-retina/fast/repaint/block-layout-inline-children-replaced-expected.txt +++ /dev/null
@@ -1,25 +0,0 @@ -{ - "bounds": [800, 600], - "children": [ - { - "bounds": [800, 600], - "contentsOpaque": true, - "drawsContent": true, - "repaintRects": [ - [154, 35, 94, 100], - [0, 35, 402, 100], - [0, 34, 402, 152] - ], - "paintInvalidationClients": [ - "LayoutBlockFlow DIV id='target' class='target'", - "RootInlineBox", - "LayoutImage IMG", - "InlineBox", - "RootInlineBox", - "LayoutBlockFlow DIV id='target' class='target'", - "LayoutImage IMG" - ] - } - ] -} -
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/repaint/block-layout-inline-children-replaced-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/repaint/block-layout-inline-children-replaced-expected.txt new file mode 100644 index 0000000..0e3670f --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/repaint/block-layout-inline-children-replaced-expected.txt
@@ -0,0 +1,27 @@ +{ + "bounds": [800, 600], + "children": [ + { + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutBlockFlow DIV id='target' class='target'", + "rect": [0, 34, 402, 152], + "reason": "forced by layout" + }, + { + "object": "LayoutImage IMG", + "rect": [154, 35, 94, 100], + "reason": "location change" + }, + { + "object": "RootInlineBox", + "reason": "full" + } + ] + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/transforms/animated-path-inside-transformed-html-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/transforms/animated-path-inside-transformed-html-expected.png index 7ae39ce..c57891c 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/svg/transforms/animated-path-inside-transformed-html-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/svg/transforms/animated-path-inside-transformed-html-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/spv2/svg/custom/object-sizing-no-width-height-change-content-box-size-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/spv2/svg/custom/object-sizing-no-width-height-change-content-box-size-expected.txt index 119dfc29..65fcde82 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/virtual/spv2/svg/custom/object-sizing-no-width-height-change-content-box-size-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/spv2/svg/custom/object-sizing-no-width-height-change-content-box-size-expected.txt
@@ -7,31 +7,11 @@ "drawsContent": true, "paintInvalidations": [ { - "object": "InlineBox", - "rect": [0, 0, 0, 0], - "reason": "full" - }, - { "object": "LayoutBlockFlow div id='contentBox'", "rect": [8, 8, 402, 405], "reason": "forced by layout" }, { - "object": "LayoutEmbeddedObject object", - "rect": [209, 9, 200, 400], - "reason": "incremental" - }, - { - "object": "LayoutSVGEllipse circle", - "rect": [89, 189, 40, 40], - "reason": "location change" - }, - { - "object": "LayoutSVGEllipse circle", - "rect": [169, 169, 80, 80], - "reason": "location change" - }, - { "object": "LayoutSVGRect rect", "rect": [9, 9, 400, 400], "reason": "location change" @@ -47,18 +27,35 @@ "reason": "full" }, { + "object": "LayoutEmbeddedObject object", + "rect": [209, 9, 200, 400], + "reason": "incremental" + }, + { "object": "LayoutView #document", "rect": [209, 9, 200, 400], "reason": "incremental" }, { - "object": "RootInlineBox", - "rect": [0, 0, 0, 0], + "object": "LayoutSVGEllipse circle", + "rect": [169, 169, 80, 80], + "reason": "location change" + }, + { + "object": "LayoutSVGEllipse circle", + "rect": [89, 189, 40, 40], + "reason": "location change" + }, + { + "object": "InlineBox", "reason": "full" }, { "object": "RootInlineBox", - "rect": [0, 0, 0, 0], + "reason": "full" + }, + { + "object": "RootInlineBox", "reason": "full" } ]
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/range/range-appearance-basic-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/forms/range/range-appearance-basic-expected.png index 0ae54cd..a094426 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/range/range-appearance-basic-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/range/range-appearance-basic-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/repaint/block-layout-inline-children-replaced-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/repaint/block-layout-inline-children-replaced-expected.txt new file mode 100644 index 0000000..7035e3b9 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/win/fast/repaint/block-layout-inline-children-replaced-expected.txt
@@ -0,0 +1,44 @@ +{ + "bounds": [800, 600], + "children": [ + { + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "paintInvalidations": [ + { + "object": "LayoutBlockFlow DIV id='target' class='target'", + "rect": [0, 34, 402, 152], + "reason": "forced by layout" + }, + { + "object": "LayoutBlockFlow DIV id='target' class='target'", + "rect": [0, 35, 402, 100], + "reason": "invalidate paint rectangle" + }, + { + "object": "LayoutImage IMG", + "rect": [154, 35, 94, 100], + "reason": "location change" + }, + { + "object": "InlineBox", + "reason": "full" + }, + { + "object": "LayoutImage IMG", + "reason": "location change" + }, + { + "object": "RootInlineBox", + "reason": "full" + }, + { + "object": "RootInlineBox", + "reason": "full" + } + ] + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/spv2/svg/custom/object-sizing-no-width-height-change-content-box-size-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/spv2/svg/custom/object-sizing-no-width-height-change-content-box-size-expected.txt index 1606c354..0a5c120 100644 --- a/third_party/WebKit/LayoutTests/platform/win/virtual/spv2/svg/custom/object-sizing-no-width-height-change-content-box-size-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/virtual/spv2/svg/custom/object-sizing-no-width-height-change-content-box-size-expected.txt
@@ -7,31 +7,11 @@ "drawsContent": true, "paintInvalidations": [ { - "object": "InlineBox", - "rect": [0, 0, 0, 0], - "reason": "full" - }, - { "object": "LayoutBlockFlow div id='contentBox'", "rect": [8, 8, 402, 404], "reason": "forced by layout" }, { - "object": "LayoutEmbeddedObject object", - "rect": [209, 9, 200, 400], - "reason": "incremental" - }, - { - "object": "LayoutSVGEllipse circle", - "rect": [89, 189, 40, 40], - "reason": "location change" - }, - { - "object": "LayoutSVGEllipse circle", - "rect": [169, 169, 80, 80], - "reason": "location change" - }, - { "object": "LayoutSVGRect rect", "rect": [9, 9, 400, 400], "reason": "location change" @@ -47,18 +27,35 @@ "reason": "full" }, { + "object": "LayoutEmbeddedObject object", + "rect": [209, 9, 200, 400], + "reason": "incremental" + }, + { "object": "LayoutView #document", "rect": [209, 9, 200, 400], "reason": "incremental" }, { - "object": "RootInlineBox", - "rect": [0, 0, 0, 0], + "object": "LayoutSVGEllipse circle", + "rect": [169, 169, 80, 80], + "reason": "location change" + }, + { + "object": "LayoutSVGEllipse circle", + "rect": [89, 189, 40, 40], + "reason": "location change" + }, + { + "object": "InlineBox", "reason": "full" }, { "object": "RootInlineBox", - "rect": [0, 0, 0, 0], + "reason": "full" + }, + { + "object": "RootInlineBox", "reason": "full" } ]
diff --git a/third_party/WebKit/LayoutTests/svg/custom/attribute-default-value-after-removal-expected.html b/third_party/WebKit/LayoutTests/svg/custom/attribute-default-value-after-removal-expected.html new file mode 100644 index 0000000..f718ea6 --- /dev/null +++ b/third_party/WebKit/LayoutTests/svg/custom/attribute-default-value-after-removal-expected.html
@@ -0,0 +1,2 @@ +<!DOCTYPE html> +<div style="width: 100px; height: 100px; background-color: green"></div>
diff --git a/third_party/WebKit/LayoutTests/svg/custom/attribute-default-value-after-removal.html b/third_party/WebKit/LayoutTests/svg/custom/attribute-default-value-after-removal.html new file mode 100644 index 0000000..d803a08 --- /dev/null +++ b/third_party/WebKit/LayoutTests/svg/custom/attribute-default-value-after-removal.html
@@ -0,0 +1,10 @@ +<!DOCTYPE html> +<div style="width: 100px"> + <svg viewBox="0 0 100 100"> + <rect width="100" height="100" fill="green"/> + </svg> +</div> +<script> +document.querySelector('svg').setAttribute('width', 200); +document.querySelector('svg').removeAttribute('width'); +</script>
diff --git a/third_party/WebKit/LayoutTests/svg/custom/disallow-non-lengths-in-attrs-expected.txt b/third_party/WebKit/LayoutTests/svg/custom/disallow-non-lengths-in-attrs-expected.txt index a36696c..f36b2b8 100644 --- a/third_party/WebKit/LayoutTests/svg/custom/disallow-non-lengths-in-attrs-expected.txt +++ b/third_party/WebKit/LayoutTests/svg/custom/disallow-non-lengths-in-attrs-expected.txt
@@ -6,7 +6,6 @@ CONSOLE ERROR: Error: <foreignObject> attribute width: Expected length, "inherit". CONSOLE ERROR: Error: <svg> attribute width: Expected length, "foo". CONSOLE ERROR: Error: <foreignObject> attribute width: Expected length, "foo". - This is a testharness.js-based test. PASS Test width 'auto' on SVGSVGElement PASS Test width 'auto' on SVGForeignObject
diff --git a/third_party/WebKit/LayoutTests/svg/custom/disallow-non-lengths-in-attrs.html b/third_party/WebKit/LayoutTests/svg/custom/disallow-non-lengths-in-attrs.html index 6342b5cc..0615823 100644 --- a/third_party/WebKit/LayoutTests/svg/custom/disallow-non-lengths-in-attrs.html +++ b/third_party/WebKit/LayoutTests/svg/custom/disallow-non-lengths-in-attrs.html
@@ -28,7 +28,7 @@ invalid_widths.forEach(function(invalid_width) { setWidth('#svg', invalid_width); test(function() { - assert_equals(getWidth('#svg'), 0); + assert_equals(getWidth('#svg'), document.body.clientWidth); }, "Test width '" + invalid_width + "' on SVGSVGElement"); setWidth('#fO', invalid_width);
diff --git a/third_party/WebKit/LayoutTests/virtual/pointerevent/fast/events/pointerevents/touch-pointercancel-expected.txt b/third_party/WebKit/LayoutTests/virtual/pointerevent/fast/events/pointerevents/touch-pointercancel-expected.txt index 635f019..8bf0e2d 100644 --- a/third_party/WebKit/LayoutTests/virtual/pointerevent/fast/events/pointerevents/touch-pointercancel-expected.txt +++ b/third_party/WebKit/LayoutTests/virtual/pointerevent/fast/events/pointerevents/touch-pointercancel-expected.txt
@@ -5,7 +5,7 @@ --- single drag tests --- --- preventDefault on none, without uncanceledMoveCausesScroll -- +-- preventDefault on none, without notifyStartOfTouchScroll -- Received pointerover, pointerId=2 Received pointerenter, pointerId=2 Received pointerdown, pointerId=2 @@ -21,7 +21,7 @@ Received pointerleave, pointerId=2 Received touchend, touchIds=0 --- preventDefault on pointermove, without uncanceledMoveCausesScroll -- +-- preventDefault on pointermove, without notifyStartOfTouchScroll -- Received pointerover, pointerId=3 Received pointerenter, pointerId=3 Received pointerdown, pointerId=3 @@ -34,167 +34,134 @@ Received pointerleave, pointerId=3 Received touchend, touchIds=0 --- preventDefault on touchmove, without uncanceledMoveCausesScroll -- +-- preventDefault on none, with notifyStartOfTouchScroll -- Received pointerover, pointerId=4 Received pointerenter, pointerId=4 Received pointerdown, pointerId=4 Received touchstart, touchIds=0 Received pointermove, pointerId=4 -Received touchmove, touchIds=0, prevented default -Received pointermove, pointerId=4 -Received touchmove, touchIds=0, prevented default -Received pointermove, pointerId=4 -Received touchmove, touchIds=0, prevented default -Received pointerup, pointerId=4 +Received touchmove, touchIds=0 +Received pointercancel, pointerId=4 Received pointerout, pointerId=4 Received pointerleave, pointerId=4 +Received touchmove, touchIds=0 +Received touchmove, touchIds=0 Received touchend, touchIds=0 --- preventDefault on none, with uncanceledMoveCausesScroll -- +-- preventDefault on pointermove, with notifyStartOfTouchScroll -- Received pointerover, pointerId=5 Received pointerenter, pointerId=5 Received pointerdown, pointerId=5 Received touchstart, touchIds=0 -Received pointermove, pointerId=5 -Received touchmove, touchIds=0 -Received pointermove, pointerId=5 -Received touchmove, touchIds=0 +Received pointermove, pointerId=5, prevented default Received pointercancel, pointerId=5 Received pointerout, pointerId=5 Received pointerleave, pointerId=5 Received touchmove, touchIds=0 -Received touchend, touchIds=0 - --- preventDefault on pointermove, with uncanceledMoveCausesScroll -- -Received pointerover, pointerId=6 -Received pointerenter, pointerId=6 -Received pointerdown, pointerId=6 -Received touchstart, touchIds=0 -Received pointermove, pointerId=6, prevented default -Received pointermove, pointerId=6, prevented default -Received pointercancel, pointerId=6 -Received pointerout, pointerId=6 -Received pointerleave, pointerId=6 Received touchmove, touchIds=0 Received touchend, touchIds=0 --- preventDefault on touchmove, with uncanceledMoveCausesScroll -- -Received pointerover, pointerId=7 -Received pointerenter, pointerId=7 -Received pointerdown, pointerId=7 -Received touchstart, touchIds=0 -Received pointermove, pointerId=7 -Received touchmove, touchIds=0, prevented default -Received pointermove, pointerId=7 -Received touchmove, touchIds=0, prevented default -Received pointermove, pointerId=7 -Received touchmove, touchIds=0, prevented default -Received pointerup, pointerId=7 -Received pointerout, pointerId=7 -Received pointerleave, pointerId=7 -Received touchend, touchIds=0 - --- multi drag tests --- --- preventDefault on none, without uncanceledMoveCausesScroll -- +-- preventDefault on none, without notifyStartOfTouchScroll -- +Received pointerover, pointerId=6 +Received pointerenter, pointerId=6 +Received pointerdown, pointerId=6 +Received pointerover, pointerId=7 +Received pointerenter, pointerId=7 +Received pointerdown, pointerId=7 Received pointerover, pointerId=8 Received pointerenter, pointerId=8 Received pointerdown, pointerId=8 +Received touchstart, touchIds=012 +Received pointermove, pointerId=6 +Received pointermove, pointerId=7 +Received pointermove, pointerId=8 +Received touchmove, touchIds=012 +Received pointermove, pointerId=6 +Received pointermove, pointerId=7 +Received pointermove, pointerId=8 +Received touchmove, touchIds=012 Received pointerover, pointerId=9 Received pointerenter, pointerId=9 Received pointerdown, pointerId=9 -Received pointerover, pointerId=10 -Received pointerenter, pointerId=10 -Received pointerdown, pointerId=10 -Received touchstart, touchIds=012 -Received pointermove, pointerId=8 -Received pointermove, pointerId=9 -Received pointermove, pointerId=10 -Received touchmove, touchIds=012 -Received pointermove, pointerId=8 -Received pointermove, pointerId=9 -Received pointermove, pointerId=10 -Received touchmove, touchIds=012 -Received pointerover, pointerId=11 -Received pointerenter, pointerId=11 -Received pointerdown, pointerId=11 Received touchstart, touchIds=3 +Received pointermove, pointerId=6 +Received pointermove, pointerId=7 Received pointermove, pointerId=8 Received pointermove, pointerId=9 -Received pointermove, pointerId=10 -Received pointermove, pointerId=11 Received touchmove, touchIds=0123 +Received pointerup, pointerId=6 +Received pointerout, pointerId=6 +Received pointerleave, pointerId=6 +Received pointerup, pointerId=7 +Received pointerout, pointerId=7 +Received pointerleave, pointerId=7 Received pointerup, pointerId=8 Received pointerout, pointerId=8 Received pointerleave, pointerId=8 Received pointerup, pointerId=9 Received pointerout, pointerId=9 Received pointerleave, pointerId=9 -Received pointerup, pointerId=10 -Received pointerout, pointerId=10 -Received pointerleave, pointerId=10 -Received pointerup, pointerId=11 -Received pointerout, pointerId=11 -Received pointerleave, pointerId=11 Received touchend, touchIds=0123 --- preventDefault on none, with uncanceledMoveCausesScroll -- +-- preventDefault on none, with notifyStartOfTouchScroll -- +Received pointerover, pointerId=10 +Received pointerenter, pointerId=10 +Received pointerdown, pointerId=10 +Received pointerover, pointerId=11 +Received pointerenter, pointerId=11 +Received pointerdown, pointerId=11 Received pointerover, pointerId=12 Received pointerenter, pointerId=12 Received pointerdown, pointerId=12 -Received pointerover, pointerId=13 -Received pointerenter, pointerId=13 -Received pointerdown, pointerId=13 -Received pointerover, pointerId=14 -Received pointerenter, pointerId=14 -Received pointerdown, pointerId=14 Received touchstart, touchIds=012 +Received pointermove, pointerId=10 +Received pointermove, pointerId=11 Received pointermove, pointerId=12 -Received pointermove, pointerId=13 -Received pointermove, pointerId=14 Received touchmove, touchIds=012 +Received pointermove, pointerId=10 +Received pointermove, pointerId=11 Received pointermove, pointerId=12 -Received pointermove, pointerId=13 -Received pointermove, pointerId=14 Received touchmove, touchIds=012 +Received pointercancel, pointerId=10 +Received pointerout, pointerId=10 +Received pointerleave, pointerId=10 +Received pointercancel, pointerId=11 +Received pointerout, pointerId=11 +Received pointerleave, pointerId=11 Received pointercancel, pointerId=12 Received pointerout, pointerId=12 Received pointerleave, pointerId=12 -Received pointercancel, pointerId=13 -Received pointerout, pointerId=13 -Received pointerleave, pointerId=13 -Received pointercancel, pointerId=14 -Received pointerout, pointerId=14 -Received pointerleave, pointerId=14 Received touchstart, touchIds=3 Received touchmove, touchIds=0123 Received touchend, touchIds=0123 --- multi cancel tests --- +Received pointerover, pointerId=13 +Received pointerenter, pointerId=13 +Received pointerdown, pointerId=13 +Received pointerover, pointerId=14 +Received pointerenter, pointerId=14 +Received pointerdown, pointerId=14 Received pointerover, pointerId=15 Received pointerenter, pointerId=15 Received pointerdown, pointerId=15 -Received pointerover, pointerId=16 -Received pointerenter, pointerId=16 -Received pointerdown, pointerId=16 -Received pointerover, pointerId=17 -Received pointerenter, pointerId=17 -Received pointerdown, pointerId=17 Received touchstart, touchIds=012 -Received pointercancel, pointerId=17 -Received pointerout, pointerId=17 -Received pointerleave, pointerId=17 -Received touchcancel, touchIds=2 -Received pointermove, pointerId=15 -Received pointermove, pointerId=16 -Received touchmove, touchIds=01 Received pointercancel, pointerId=15 Received pointerout, pointerId=15 Received pointerleave, pointerId=15 -Received pointercancel, pointerId=16 -Received pointerout, pointerId=16 -Received pointerleave, pointerId=16 +Received touchcancel, touchIds=2 +Received pointermove, pointerId=13 +Received pointermove, pointerId=14 +Received touchmove, touchIds=01 +Received pointercancel, pointerId=13 +Received pointerout, pointerId=13 +Received pointerleave, pointerId=13 +Received pointercancel, pointerId=14 +Received pointerout, pointerId=14 +Received pointerleave, pointerId=14 Received touchcancel, touchIds=01 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/webaudio/audioparam-initial-event-expected.txt b/third_party/WebKit/LayoutTests/webaudio/audioparam-initial-event-expected.txt new file mode 100644 index 0000000..94e05e06 --- /dev/null +++ b/third_party/WebKit/LayoutTests/webaudio/audioparam-initial-event-expected.txt
@@ -0,0 +1,13 @@ +Test Automation Ramps without Initial Event + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS Linear ramp equals [0.5,0.4998958333333333,0.4997916666666667,0.4996875,0.4995833333333333,0.49947916666666664,0.499375,0.49927083333333333,0.49916666666666665,0.4990625,0.49895833333333334,0.49885416666666665,0.49875,0.49864583333333334,0.49854166666666666,0.4984375,...] with an element-wise tolerance of 6.0003e-8. +PASS Exponential ramp equals [0.5,0.5001444220542908,0.5002889037132263,0.5004333853721619,0.5005779266357422,0.5007225275039673,0.5008671879768372,0.501011848449707,0.5011565685272217,0.5013013482093811,0.5014461278915405,0.5015909671783447,0.5017358660697937,0.5018808245658875,0.5020257830619812,0.5021708011627197,...] with an element-wise tolerance of 0.0000023842. +PASS Delayed linear ramp equals [0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,...] with an element-wise tolerance of 9.87968e-8. +PASS Delayed exponential ramp equals [0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,...] with an element-wise tolerance of 0.000013948. +PASS successfullyParsed is true + +TEST COMPLETE +
diff --git a/third_party/WebKit/LayoutTests/webaudio/audioparam-initial-event.html b/third_party/WebKit/LayoutTests/webaudio/audioparam-initial-event.html new file mode 100644 index 0000000..1db0827 --- /dev/null +++ b/third_party/WebKit/LayoutTests/webaudio/audioparam-initial-event.html
@@ -0,0 +1,175 @@ +<!doctype html> +<html> + +<head> + <script src="../resources/js-test.js"></script> + <script src="resources/compatibility.js"></script> + <script src="resources/audio-testing.js"></script> + <script src="resources/audioparam-testing.js"></script> + <title>AudioParam Initial Events </title> +</head> + +<body> + <script> + description("Test Automation Ramps without Initial Event"); + window.jsTestIsAsync = true; + + var sampleRate = 48000; + // Number of frames in a rendering quantum. + var quantumFrames = 128; + // Test doesn't need to run for very long. + var renderDuration = 0.2; + var renderFrames = renderDuration * sampleRate; + var automationEndTime = 0.1; + + var audit = Audit.createTaskRunner(); + + // The following tests start a ramp automation without an initial event. This should cause an + // initial event to be added implicitly to give a starting point. + audit.defineTask("linear-ramp", function (done) { + runTest("Linear ramp", { + automationFunction: function (node, value, time) { + node.gain.linearRampToValueAtTime(value, time); + }, + referenceFunction: linearRamp, + // Experimentally determined threshold + threshold: 6.0003e-8, + // The starting value of the gain node + v0: 0.5, + // The target value of the automation + v1: 0, + }) + .then(done); + }); + + audit.defineTask("exponential-ramp", function (done) { + runTest("Exponential ramp", { + automationFunction: function (node, value, time) { + node.gain.exponentialRampToValueAtTime(value, time); + }, + referenceFunction: exponentialRamp, + threshold: 2.3842e-6, + v0: 0.5, + v1: 2, + }) + .then(done); + }); + + // Same tests as above, but we delay the call to the automation function. This is to verify that + // the we still do the right thing after the context has started. + audit.defineTask("delayed-linear-ramp", function (done) { + runTest("Delayed linear ramp", { + automationFunction: function (node, value, time) { + node.gain.linearRampToValueAtTime(value, time); + }, + referenceFunction: linearRamp, + // Experimentally determined threshold + threshold: 9.87968e-8, + // The starting value of the gain node + v0: 0.5, + // The target value of the automation + v1: 0, + delay: quantumFrames / sampleRate + }) + .then(done); + }); + + audit.defineTask("delayed-exponential-ramp", function (done) { + runTest("Delayed exponential ramp", { + automationFunction: function (node, value, time) { + node.gain.exponentialRampToValueAtTime(value, time); + }, + referenceFunction: exponentialRamp, + // Experimentally determined threshold + threshold: 1.3948e-5, + // The starting value of the gain node + v0: 0.5, + // The target value of the automation + v1: 2, + delay: quantumFrames / sampleRate + }) + .then(done); + }); + + audit.defineTask("finish", function (done) { + finishJSTest(); + done(); + }); + + audit.runTasks(); + + // Generate the expected waveform for a linear ramp starting from the value |v0|, ramping to + // |v1| at time |endTime|. The time of |v0| is assumed to be 0. |nFrames| is how many frames + // to generate. + function linearRamp(v0, v1, startTime, endTime, nFrames) { + var expected = createLinearRampArray(startTime, endTime, v0, v1, sampleRate); + var preFiller = new Array(Math.floor(startTime * sampleRate)); + var postFiller = new Array(nFrames - Math.ceil(endTime * sampleRate)); + preFiller.fill(v0); + return preFiller.concat(expected.concat(postFiller.fill(v1))); + } + + // Generate the expected waveform for an exponential ramp starting from the value |v0|, + // ramping to |v1| at time |endTime|. The time of |v0| is assumed to be 0. |nFrames| is how + // many frames to generate. + function exponentialRamp(v0, v1, startTime, endTime, nFrames) { + var expected = createExponentialRampArray(startTime, endTime, v0, v1, sampleRate); + var preFiller = new Array(Math.floor(startTime * sampleRate)); + preFiller.fill(v0); + var postFiller = new Array(nFrames - Math.ceil(endTime * sampleRate)); + return preFiller.concat(expected.concat(postFiller.fill(v1))); + } + + // Run an automation test. |message| is the message to use for printing the results. |options| + // is a property bag containing the configuration of the test including the following: + // + // automationFunction - automation function to use, + // referenceFunction - function generating the expected result + // threshold - comparison threshold + // v0 - starting value + // v1 - end value for automation + function runTest(message, options) { + var automationFunction = options.automationFunction; + var referenceFunction = options.referenceFunction; + var threshold = options.threshold; + var v0 = options.v0; + var v1 = options.v1; + var delay = options.delay; + + var context = new OfflineAudioContext(1, renderFrames, sampleRate); + + // A constant source of amplitude 1. + var source = context.createBufferSource(); + source.buffer = createConstantBuffer(context, 1, 1); + source.loop = true; + + // Automation is applied to a gain node + var gain = context.createGain(); + gain.gain.value = v0; + + // Delay start of automation, if requested + if (delay) { + context.suspend(options.delay).then(function () { + automationFunction(gain, v1, automationEndTime); + context.resume(); + }); + } else { + automationFunction(gain, v1, automationEndTime); + } + + source.connect(gain); + gain.connect(context.destination); + + source.start(); + + return context.startRendering() + .then(function (resultBuffer) { + var result = resultBuffer.getChannelData(0); + var expected = referenceFunction(v0, v1, delay ? delay : 0, automationEndTime, renderFrames); + Should(message, result).beCloseToArray(expected, threshold); + }); + } + </script> +</body> + +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-dedicated-worker-expected.txt b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-dedicated-worker-expected.txt index e88a9378..3582a9f9 100644 --- a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-dedicated-worker-expected.txt +++ b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-dedicated-worker-expected.txt
@@ -808,8 +808,6 @@ [Worker] getter product [Worker] getter storage [Worker] getter userAgent -[Worker] getter webkitPersistentStorage -[Worker] getter webkitTemporaryStorage [Worker] method constructor [Worker] interface XMLHttpRequest : XMLHttpRequestEventTarget [Worker] attribute @@toStringTag
diff --git a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-shared-worker-expected.txt b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-shared-worker-expected.txt index 2acb3f4..3d34abd 100644 --- a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-shared-worker-expected.txt +++ b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-shared-worker-expected.txt
@@ -800,8 +800,6 @@ [Worker] getter product [Worker] getter storage [Worker] getter userAgent -[Worker] getter webkitPersistentStorage -[Worker] getter webkitTemporaryStorage [Worker] method constructor [Worker] interface XMLHttpRequest : XMLHttpRequestEventTarget [Worker] attribute @@toStringTag
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8PerIsolateData.cpp b/third_party/WebKit/Source/bindings/core/v8/V8PerIsolateData.cpp index 69683686..ba7f6884 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V8PerIsolateData.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/V8PerIsolateData.cpp
@@ -52,8 +52,53 @@ V8PerIsolateData::from(isolate)->runEndOfScopeTasks(); } -static void useCounterCallback(v8::Isolate* isolate, v8::Isolate::UseCounterFeature feature) +V8PerIsolateData::V8PerIsolateData() + : m_isolateHolder(adoptPtr(new gin::IsolateHolder())) + , m_stringCache(adoptPtr(new StringCache(isolate()))) + , m_hiddenValue(V8HiddenValue::create()) + , m_constructorMode(ConstructorMode::CreateNewObject) + , m_useCounterDisabled(false) + , m_isHandlingRecursionLevelError(false) + , m_isReportingException(false) { + // FIXME: Remove once all v8::Isolate::GetCurrent() calls are gone. + isolate()->Enter(); + isolate()->AddBeforeCallEnteredCallback(&beforeCallEnteredCallback); + isolate()->AddMicrotasksCompletedCallback(µtasksCompletedCallback); + if (isMainThread()) + mainThreadPerIsolateData = this; + isolate()->SetUseCounterCallback(&useCounterCallback); +} + +V8PerIsolateData::~V8PerIsolateData() +{ +} + +v8::Isolate* V8PerIsolateData::mainThreadIsolate() +{ + ASSERT(isMainThread()); + ASSERT(mainThreadPerIsolateData); + return mainThreadPerIsolateData->isolate(); +} + +v8::Isolate* V8PerIsolateData::initialize() +{ + V8PerIsolateData* data = new V8PerIsolateData(); + v8::Isolate* isolate = data->isolate(); + isolate->SetData(gin::kEmbedderBlink, data); + return isolate; +} + +void V8PerIsolateData::enableIdleTasks(v8::Isolate* isolate, PassOwnPtr<gin::V8IdleTaskRunner> taskRunner) +{ + from(isolate)->m_isolateHolder->EnableIdleTasks(std::unique_ptr<gin::V8IdleTaskRunner>(taskRunner.leakPtr())); +} + +void V8PerIsolateData::useCounterCallback(v8::Isolate* isolate, v8::Isolate::UseCounterFeature feature) +{ + if (V8PerIsolateData::from(isolate)->m_useCounterDisabled) + return; + UseCounter::Feature blinkFeature; bool deprecated = false; switch (feature) { @@ -129,47 +174,6 @@ UseCounter::count(currentExecutionContext(isolate), blinkFeature); } -V8PerIsolateData::V8PerIsolateData() - : m_isolateHolder(adoptPtr(new gin::IsolateHolder())) - , m_stringCache(adoptPtr(new StringCache(isolate()))) - , m_hiddenValue(V8HiddenValue::create()) - , m_constructorMode(ConstructorMode::CreateNewObject) - , m_isHandlingRecursionLevelError(false) - , m_isReportingException(false) -{ - // FIXME: Remove once all v8::Isolate::GetCurrent() calls are gone. - isolate()->Enter(); - isolate()->AddBeforeCallEnteredCallback(&beforeCallEnteredCallback); - isolate()->AddMicrotasksCompletedCallback(µtasksCompletedCallback); - if (isMainThread()) - mainThreadPerIsolateData = this; - isolate()->SetUseCounterCallback(&useCounterCallback); -} - -V8PerIsolateData::~V8PerIsolateData() -{ -} - -v8::Isolate* V8PerIsolateData::mainThreadIsolate() -{ - ASSERT(isMainThread()); - ASSERT(mainThreadPerIsolateData); - return mainThreadPerIsolateData->isolate(); -} - -v8::Isolate* V8PerIsolateData::initialize() -{ - V8PerIsolateData* data = new V8PerIsolateData(); - v8::Isolate* isolate = data->isolate(); - isolate->SetData(gin::kEmbedderBlink, data); - return isolate; -} - -void V8PerIsolateData::enableIdleTasks(v8::Isolate* isolate, PassOwnPtr<gin::V8IdleTaskRunner> taskRunner) -{ - from(isolate)->m_isolateHolder->EnableIdleTasks(std::unique_ptr<gin::V8IdleTaskRunner>(taskRunner.leakPtr())); -} - v8::Persistent<v8::Value>& V8PerIsolateData::ensureLiveRoot() { if (m_liveRoot.isEmpty())
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8PerIsolateData.h b/third_party/WebKit/Source/bindings/core/v8/V8PerIsolateData.h index ad41c13..58230d9 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V8PerIsolateData.h +++ b/third_party/WebKit/Source/bindings/core/v8/V8PerIsolateData.h
@@ -59,6 +59,31 @@ virtual void run() = 0; }; + // Disables the UseCounter. + // UseCounter depends on the current context, but it's not available during + // the initialization of v8::Context and the global object. So we need to + // disable the UseCounter while the initialization of the context and global + // object. + // TODO(yukishiino): Come up with an idea to remove this hack. + class UseCounterDisabledScope { + STACK_ALLOCATED(); + public: + explicit UseCounterDisabledScope(V8PerIsolateData* perIsolateData) + : m_perIsolateData(perIsolateData) + , m_originalUseCounterDisabled(m_perIsolateData->m_useCounterDisabled) + { + m_perIsolateData->m_useCounterDisabled = true; + } + ~UseCounterDisabledScope() + { + m_perIsolateData->m_useCounterDisabled = m_originalUseCounterDisabled; + } + + private: + V8PerIsolateData* m_perIsolateData; + const bool m_originalUseCounterDisabled; + }; + static v8::Isolate* initialize(); static V8PerIsolateData* from(v8::Isolate* isolate) @@ -117,6 +142,8 @@ V8PerIsolateData(); ~V8PerIsolateData(); + static void useCounterCallback(v8::Isolate*, v8::Isolate::UseCounterFeature); + typedef HashMap<const void*, v8::Eternal<v8::FunctionTemplate>> V8FunctionTemplateMap; V8FunctionTemplateMap& selectInterfaceTemplateMap(const DOMWrapperWorld&); V8FunctionTemplateMap& selectOperationTemplateMap(const DOMWrapperWorld&); @@ -142,6 +169,9 @@ bool m_constructorMode; friend class ConstructorMode; + bool m_useCounterDisabled; + friend class UseCounterDisabledScope; + bool m_isHandlingRecursionLevelError; bool m_isReportingException;
diff --git a/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp b/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp index 66ce71ac..2d89e2b 100644 --- a/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp
@@ -245,7 +245,7 @@ } } - if (!installDOMWindow()) { + if (!setupWindowPrototypeChain()) { disposeContext(DoNotDetachGlobal); return false; } @@ -272,32 +272,6 @@ return true; } -namespace { - -void configureInnerGlobalObjectTemplate(v8::Local<v8::ObjectTemplate> templ, v8::Isolate* isolate) -{ - // Install a security handler with V8. - templ->SetAccessCheckCallback(V8Window::securityCheckCustom, v8::External::New(isolate, const_cast<WrapperTypeInfo*>(&V8Window::wrapperTypeInfo))); - templ->SetInternalFieldCount(V8Window::internalFieldCount); -} - -v8::Local<v8::ObjectTemplate> getInnerGlobalObjectTemplate(v8::Isolate* isolate) -{ - // It is OK to share the same object template between the main world and - // non-main worlds because the inner global object doesn't install any - // DOM attributes/methods. - DEFINE_STATIC_LOCAL(v8::Persistent<v8::ObjectTemplate>, innerGlobalObjectTemplate, ()); - if (innerGlobalObjectTemplate.IsEmpty()) { - TRACE_EVENT_SCOPED_SAMPLING_STATE("blink", "BuildDOMTemplate"); - v8::Local<v8::ObjectTemplate> templ = v8::ObjectTemplate::New(isolate); - configureInnerGlobalObjectTemplate(templ, isolate); - innerGlobalObjectTemplate.Reset(isolate, templ); - } - return v8::Local<v8::ObjectTemplate>::New(isolate, innerGlobalObjectTemplate); -} - -} // namespace - void WindowProxy::createContext() { // FIXME: This should be a null check of m_frame->client(), but there are still some edge cases @@ -305,9 +279,12 @@ if (m_frame->isLocalFrame() && !toLocalFrame(m_frame)->loader().documentLoader()) return; - // Create a new environment using an empty template for the shadow - // object. Reuse the global object if one has been created earlier. - v8::Local<v8::ObjectTemplate> globalTemplate = getInnerGlobalObjectTemplate(m_isolate); + // Create a new v8::Context with the window object as the global object + // (aka the inner global). Reuse the global proxy object (aka the outer + // global) if it already exists. See the comments in + // setupWindowPrototypeChain for the structure of the prototype chain of + // the global object. + v8::Local<v8::ObjectTemplate> globalTemplate = V8Window::domTemplate(m_isolate, *m_world)->InstanceTemplate(); if (globalTemplate.IsEmpty()) return; @@ -331,55 +308,63 @@ } v8::ExtensionConfiguration extensionConfiguration(extensionNames.size(), extensionNames.data()); - v8::Local<v8::Context> context = v8::Context::New(m_isolate, &extensionConfiguration, globalTemplate, m_global.newLocal(m_isolate)); + v8::Local<v8::Context> context; + { + V8PerIsolateData::UseCounterDisabledScope useCounterDisabled(V8PerIsolateData::from(m_isolate)); + context = v8::Context::New(m_isolate, &extensionConfiguration, globalTemplate, m_global.newLocal(m_isolate)); + } if (context.IsEmpty()) return; m_scriptState = ScriptState::create(context, m_world); } -static v8::Local<v8::Object> toInnerGlobalObject(v8::Local<v8::Context> context) +bool WindowProxy::setupWindowPrototypeChain() { - return v8::Local<v8::Object>::Cast(context->Global()->GetPrototype()); -} - -bool WindowProxy::installDOMWindow() -{ - DOMWindow* window = m_frame->domWindow(); - const WrapperTypeInfo* wrapperTypeInfo = window->wrapperTypeInfo(); - v8::Local<v8::Object> windowWrapper; - v8::Local<v8::Function> constructor = m_scriptState->perContextData()->constructorForType(wrapperTypeInfo); - if (constructor.IsEmpty()) - return false; - if (!V8ObjectConstructor::newInstance(m_isolate, constructor).ToLocal(&windowWrapper)) - return false; - windowWrapper = V8DOMWrapper::associateObjectWithWrapper(m_isolate, window, wrapperTypeInfo, windowWrapper); - - v8::Local<v8::Object> windowPrototype = v8::Local<v8::Object>::Cast(windowWrapper->GetPrototype()); - RELEASE_ASSERT(!windowPrototype.IsEmpty()); - V8DOMWrapper::setNativeInfo(windowPrototype, wrapperTypeInfo, window); - v8::Local<v8::Object> windowProperties = v8::Local<v8::Object>::Cast(windowPrototype->GetPrototype()); - RELEASE_ASSERT(!windowProperties.IsEmpty()); - V8DOMWrapper::setNativeInfo(windowProperties, wrapperTypeInfo, window); - - // Install the windowWrapper as the prototype of the innerGlobalObject. - // The full structure of the global object is as follows: + // Associate the window wrapper object and its prototype chain with the + // corresponding native DOMWindow object. + // The full structure of the global object's prototype chain is as follows: // - // outerGlobalObject (Empty object, remains after navigation) - // -- has prototype --> innerGlobalObject (Holds global variables, changes during navigation) - // -- has prototype --> DOMWindow instance + // global proxy object [1] + // -- has prototype --> global object (window wrapper object) [2] // -- has prototype --> Window.prototype - // -- has prototype --> WindowProperties (named properties object) + // -- has prototype --> WindowProperties [3] // -- has prototype --> EventTarget.prototype // -- has prototype --> Object.prototype + // -- has prototype --> null // - // Note: Much of this prototype structure is hidden from web content. The - // outer, inner, and DOMWindow instance all appear to be the same - // JavaScript object. + // [1] Global proxy object is as known as "outer global object". It's an + // empty object and remains after navigation. When navigated, points to + // a different global object as the prototype object. + // [2] Global object is as known as "inner global object" or "window wrapper + // object". The prototype chain between global proxy object and global + // object is NOT observable from user JavaScript code. All other + // prototype chains are observable. Global proxy object and global object + // together appear to be the same single JavaScript object. See also: + // https://wiki.mozilla.org/Gecko:SplitWindow + // global object (= window wrapper object) provides most of Window's DOM + // attributes and operations. Also global variables defined by user + // JavaScript are placed on this object. When navigated, a new global + // object is created together with a new v8::Context, but the global proxy + // object doesn't change. + // [3] WindowProperties is a named properties object of Window interface. + + DOMWindow* window = m_frame->domWindow(); + const WrapperTypeInfo* wrapperTypeInfo = window->wrapperTypeInfo(); + v8::Local<v8::Context> context = m_scriptState->context(); - v8::Local<v8::Object> innerGlobalObject = toInnerGlobalObject(m_scriptState->context()); - V8DOMWrapper::setNativeInfo(innerGlobalObject, wrapperTypeInfo, window); - if (!v8CallBoolean(innerGlobalObject->SetPrototype(context, windowWrapper))) - return false; + // The global proxy object. Note this is not the global object. + v8::Local<v8::Object> globalProxy = context->Global(); + // The global object, aka window wrapper object. + v8::Local<v8::Object> windowWrapper = globalProxy->GetPrototype().As<v8::Object>(); + windowWrapper = V8DOMWrapper::associateObjectWithWrapper(m_isolate, window, wrapperTypeInfo, windowWrapper); + // The prototype object of Window interface. + v8::Local<v8::Object> windowPrototype = windowWrapper->GetPrototype().As<v8::Object>(); + RELEASE_ASSERT(!windowPrototype.IsEmpty()); + V8DOMWrapper::setNativeInfo(windowPrototype, wrapperTypeInfo, window); + // The named properties object of Window interface. + v8::Local<v8::Object> windowProperties = windowPrototype->GetPrototype().As<v8::Object>(); + RELEASE_ASSERT(!windowProperties.IsEmpty()); + V8DOMWrapper::setNativeInfo(windowProperties, wrapperTypeInfo, window); // TODO(keishi): Remove installPagePopupController and implement // PagePopupController in another way.
diff --git a/third_party/WebKit/Source/bindings/core/v8/WindowProxy.h b/third_party/WebKit/Source/bindings/core/v8/WindowProxy.h index 3c59be55..0765d02 100644 --- a/third_party/WebKit/Source/bindings/core/v8/WindowProxy.h +++ b/third_party/WebKit/Source/bindings/core/v8/WindowProxy.h
@@ -105,8 +105,15 @@ // Updates Activity Logger for the current context. void updateActivityLogger(); + // Creates a new v8::Context with the window wrapper object as the global + // object (aka the inner global). Note that the window wrapper and its + // prototype chain do not get fully initialized yet, e.g. the window + // wrapper is not yet associated with the native DOMWindow object. void createContext(); - bool installDOMWindow(); + + // Associates the window wrapper and its prototype chain with the native + // DOMWindow object. Also does some more Window-specific initialization. + bool setupWindowPrototypeChain(); Member<Frame> m_frame; v8::Isolate* m_isolate;
diff --git a/third_party/WebKit/Source/bindings/core/v8/WorkerOrWorkletScriptController.cpp b/third_party/WebKit/Source/bindings/core/v8/WorkerOrWorkletScriptController.cpp index 43079ab..5d73eba 100644 --- a/third_party/WebKit/Source/bindings/core/v8/WorkerOrWorkletScriptController.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/WorkerOrWorkletScriptController.cpp
@@ -46,7 +46,6 @@ #include "core/inspector/MainThreadDebugger.h" #include "core/inspector/WorkerThreadDebugger.h" #include "core/workers/MainThreadWorkletGlobalScope.h" -#include "core/workers/WorkerObjectProxy.h" #include "core/workers/WorkerOrWorkletGlobalScope.h" #include "core/workers/WorkerThread.h" #include "platform/heap/ThreadState.h" @@ -156,7 +155,19 @@ if (isContextInitialized()) return true; - v8::Local<v8::Context> context = v8::Context::New(m_isolate); + // Create a new v8::Context with the worker/worklet as the global object + // (aka the inner global). + ScriptWrappable* scriptWrappable = m_globalScope->getScriptWrappable(); + const WrapperTypeInfo* wrapperTypeInfo = scriptWrappable->wrapperTypeInfo(); + v8::Local<v8::FunctionTemplate> globalInterfaceTemplate = wrapperTypeInfo->domTemplate(m_isolate, *m_world); + if (globalInterfaceTemplate.IsEmpty()) + return false; + v8::Local<v8::ObjectTemplate> globalTemplate = globalInterfaceTemplate->InstanceTemplate(); + v8::Local<v8::Context> context; + { + V8PerIsolateData::UseCounterDisabledScope useCounterDisabled(V8PerIsolateData::from(m_isolate)); + context = v8::Context::New(m_isolate, nullptr, globalTemplate); + } if (context.IsEmpty()) return false; @@ -172,24 +183,13 @@ debugger->contextCreated(context); } - // Create a new JS object and use it as the prototype for the shadow global object. - const WrapperTypeInfo* wrapperTypeInfo = m_globalScope->getScriptWrappable()->wrapperTypeInfo(); + // The global proxy object. Note this is not the global object. + v8::Local<v8::Object> globalProxy = context->Global(); + // The global object, aka worker/worklet wrapper object. + v8::Local<v8::Object> globalObject = globalProxy->GetPrototype().As<v8::Object>(); + globalObject = V8DOMWrapper::associateObjectWithWrapper(m_isolate, scriptWrappable, wrapperTypeInfo, globalObject); - v8::Local<v8::Function> globalScopeConstructor = m_scriptState->perContextData()->constructorForType(wrapperTypeInfo); - if (globalScopeConstructor.IsEmpty()) - return false; - - v8::Local<v8::Object> jsGlobalScope; - if (!V8ObjectConstructor::newInstance(m_isolate, globalScopeConstructor).ToLocal(&jsGlobalScope)) { - disposeContextIfNeeded(); - return false; - } - - jsGlobalScope = V8DOMWrapper::associateObjectWithWrapper(m_isolate, m_globalScope->getScriptWrappable(), wrapperTypeInfo, jsGlobalScope); - - // Insert the object instance as the prototype of the shadow object. - v8::Local<v8::Object> globalObject = v8::Local<v8::Object>::Cast(m_scriptState->context()->Global()->GetPrototype()); - return v8CallBoolean(globalObject->SetPrototype(context, jsGlobalScope)); + return true; } ScriptValue WorkerOrWorkletScriptController::evaluate(const CompressibleString& script, const String& fileName, const TextPosition& scriptStartPosition, CachedMetadataHandler* cacheHandler, V8CacheOptions v8CacheOptions)
diff --git a/third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp b/third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp index 4bcb14e5..f50154f 100644 --- a/third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp
@@ -344,33 +344,4 @@ } } -static bool securityCheck(v8::Local<v8::Object> host) -{ - v8::Isolate* isolate = v8::Isolate::GetCurrent(); - v8::Local<v8::Object> window = V8Window::findInstanceInPrototypeChain(host, isolate); - if (window.IsEmpty()) - return false; // the frame is gone. - - DOMWindow* targetWindow = V8Window::toImpl(window); - ASSERT(targetWindow); - if (!targetWindow->isLocalDOMWindow()) - return false; - - LocalFrame* target = toLocalDOMWindow(targetWindow)->frame(); - if (!target) - return false; - - // Notify the loader's client if the initial document has been accessed. - if (target->loader().stateMachine()->isDisplayingInitialEmptyDocument()) - target->loader().didAccessInitialDocument(); - - return BindingSecurity::shouldAllowAccessTo(isolate, callingDOMWindow(isolate), targetWindow, DoNotReportSecurityError); -} - -bool V8Window::securityCheckCustom(v8::Local<v8::Context> accessingContext, v8::Local<v8::Object> accessedObject, v8::Local<v8::Value> data) -{ - // TODO(jochen): Take accessingContext into account. - return securityCheck(accessedObject); -} - } // namespace blink
diff --git a/third_party/WebKit/Source/bindings/scripts/idl_definitions.py b/third_party/WebKit/Source/bindings/scripts/idl_definitions.py index d42069e3..c66920b 100644 --- a/third_party/WebKit/Source/bindings/scripts/idl_definitions.py +++ b/third_party/WebKit/Source/bindings/scripts/idl_definitions.py
@@ -387,6 +387,10 @@ self.attributes.extend(other.attributes) self.constants.extend(other.constants) self.operations.extend(other.operations) + if self.serializer is None: + self.serializer = other.serializer + if self.stringifier is None: + self.stringifier = other.stringifier class IdlException(IdlInterface):
diff --git a/third_party/WebKit/Source/bindings/scripts/v8_interface.py b/third_party/WebKit/Source/bindings/scripts/v8_interface.py index bcfa35c..f82a0579 100644 --- a/third_party/WebKit/Source/bindings/scripts/v8_interface.py +++ b/third_party/WebKit/Source/bindings/scripts/v8_interface.py
@@ -164,7 +164,6 @@ 'is_gc_type': True, # FIXME: Remove 'EventTarget' special handling, http://crbug.com/383699 'has_access_check_callbacks': (is_check_security and - interface.name != 'Window' and interface.name != 'EventTarget'), 'has_custom_legacy_call_as_function': has_extended_attribute_value(interface, 'Custom', 'LegacyCallAsFunction'), # [Custom=LegacyCallAsFunction] 'has_partial_interface': len(interface.partial_interfaces) > 0,
diff --git a/third_party/WebKit/Source/bindings/scripts/v8_methods.py b/third_party/WebKit/Source/bindings/scripts/v8_methods.py index 4952049..d4af3b59 100644 --- a/third_party/WebKit/Source/bindings/scripts/v8_methods.py +++ b/third_party/WebKit/Source/bindings/scripts/v8_methods.py
@@ -111,9 +111,6 @@ if is_post_message: includes.add('bindings/core/v8/SerializedScriptValueFactory.h') includes.add('bindings/core/v8/Transferables.h') - includes.add('core/dom/DOMArrayBuffer.h') - includes.add('core/dom/MessagePort.h') - includes.add('core/frame/ImageBitmap.h') if 'LenientThis' in extended_attributes: raise Exception('[LenientThis] is not supported for operations.')
diff --git a/third_party/WebKit/Source/bindings/templates/interface.h b/third_party/WebKit/Source/bindings/templates/interface.h index 8a26b8a..eb82f589 100644 --- a/third_party/WebKit/Source/bindings/templates/interface.h +++ b/third_party/WebKit/Source/bindings/templates/interface.h
@@ -148,9 +148,6 @@ * a C++ pointer to the DOM object (if the object is not in oilpan) #} static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + {{custom_internal_field_counter}}; {# End custom internal fields #} - {% if interface_name == 'Window' %} - static bool securityCheckCustom(v8::Local<v8::Context> accessingContext, v8::Local<v8::Object> accessedObject, v8::Local<v8::Value> value); - {% endif %} static void installConditionallyEnabledProperties(v8::Local<v8::Object>, v8::Isolate*){% if has_conditional_attributes %}; {% else %} { } {% endif %}
diff --git a/third_party/WebKit/Source/bindings/templates/interface_base.cpp b/third_party/WebKit/Source/bindings/templates/interface_base.cpp index 6d1d9948..ceda80d 100644 --- a/third_party/WebKit/Source/bindings/templates/interface_base.cpp +++ b/third_party/WebKit/Source/bindings/templates/interface_base.cpp
@@ -94,9 +94,33 @@ {% if has_access_check_callbacks and not is_partial %} bool securityCheck(v8::Local<v8::Context> accessingContext, v8::Local<v8::Object> accessedObject, v8::Local<v8::Value> data) { + {% if interface_name == 'Window' %} + // TODO(jochen): Take accessingContext into account. + v8::Isolate* isolate = v8::Isolate::GetCurrent(); + v8::Local<v8::Object> window = V8Window::findInstanceInPrototypeChain(accessedObject, isolate); + if (window.IsEmpty()) + return false; // the frame is gone. + + DOMWindow* targetWindow = V8Window::toImpl(window); + ASSERT(targetWindow); + if (!targetWindow->isLocalDOMWindow()) + return false; + + LocalFrame* targetFrame = toLocalDOMWindow(targetWindow)->frame(); + if (!targetFrame) + return false; + + // Notify the loader's client if the initial document has been accessed. + if (targetFrame->loader().stateMachine()->isDisplayingInitialEmptyDocument()) + targetFrame->loader().didAccessInitialDocument(); + + return BindingSecurity::shouldAllowAccessTo(isolate, callingDOMWindow(isolate), targetWindow, DoNotReportSecurityError); + {% else %}{# if interface_name == 'Window' #} + {# Not 'Window' means it\'s Location. #} // TODO(jochen): Take accessingContext into account. {{cpp_class}}* impl = {{v8_class}}::toImpl(accessedObject); return BindingSecurity::shouldAllowAccessTo(v8::Isolate::GetCurrent(), callingDOMWindow(v8::Isolate::GetCurrent()), impl, DoNotReportSecurityError); + {% endif %}{# if interface_name == 'Window' #} } {% endif %} @@ -267,14 +291,9 @@ v8::Local<v8::ObjectTemplate> prototypeTemplate = interfaceTemplate->PrototypeTemplate(); ALLOW_UNUSED_LOCAL(prototypeTemplate); - {%- if not is_partial %} - {% if interface_name == 'Window' %}{{newline}} + {%- if interface_name == 'Window' and not is_partial %}{{newline}} prototypeTemplate->SetInternalFieldCount(V8Window::internalFieldCount); {% endif %} - {% if is_global %}{{newline}} - interfaceTemplate->SetHiddenPrototype(true); - {% endif %} - {% endif %} // Register DOM constants, attributes and operations. {% if runtime_enabled_function %}
diff --git a/third_party/WebKit/Source/bindings/tests/idls/core/TestImplements.idl b/third_party/WebKit/Source/bindings/tests/idls/core/TestImplements.idl index ffe8372..e054269 100644 --- a/third_party/WebKit/Source/bindings/tests/idls/core/TestImplements.idl +++ b/third_party/WebKit/Source/bindings/tests/idls/core/TestImplements.idl
@@ -45,4 +45,7 @@ [Reflect=IMPLEMENTS_REFLECT_CONSTANT] const unsigned short IMPLEMENTS_CONSTANT_2 = 2; [RuntimeEnabled=ImplementsFeatureName] attribute Node implementsRuntimeEnabledNodeAttribute; + + [NotEnumerable] stringifier; + [NotEnumerable, RaisesException] serializer; };
diff --git a/third_party/WebKit/Source/bindings/tests/idls/core/TestInterface.idl b/third_party/WebKit/Source/bindings/tests/idls/core/TestInterface.idl index cbb0a8b..a5ccf532 100644 --- a/third_party/WebKit/Source/bindings/tests/idls/core/TestInterface.idl +++ b/third_party/WebKit/Source/bindings/tests/idls/core/TestInterface.idl
@@ -82,9 +82,6 @@ setter DOMString (DOMString name, DOMString value); deleter boolean (DOMString name); - [NotEnumerable] stringifier; - [NotEnumerable, RaisesException] serializer; - // Per-method [Exposed] annotation support. void alwaysExposedMethod(); [Exposed=Worker] void workerExposedMethod();
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexedGlobal.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexedGlobal.cpp index ec46625..48839da 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexedGlobal.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexedGlobal.cpp
@@ -147,8 +147,6 @@ ALLOW_UNUSED_LOCAL(instanceTemplate); v8::Local<v8::ObjectTemplate> prototypeTemplate = interfaceTemplate->PrototypeTemplate(); ALLOW_UNUSED_LOCAL(prototypeTemplate); - interfaceTemplate->SetHiddenPrototype(true); - // Register DOM constants, attributes and operations. V8DOMConfiguration::installAccessors(isolate, world, instanceTemplate, prototypeTemplate, interfaceTemplate, signature, V8TestIntegerIndexedGlobalAccessors, WTF_ARRAY_LENGTH(V8TestIntegerIndexedGlobalAccessors)); V8DOMConfiguration::installMethods(isolate, world, instanceTemplate, prototypeTemplate, interfaceTemplate, signature, V8TestIntegerIndexedGlobalMethods, WTF_ARRAY_LENGTH(V8TestIntegerIndexedGlobalMethods));
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexedPrimaryGlobal.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexedPrimaryGlobal.cpp index e3919f1..3d2563d 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexedPrimaryGlobal.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexedPrimaryGlobal.cpp
@@ -147,8 +147,6 @@ ALLOW_UNUSED_LOCAL(instanceTemplate); v8::Local<v8::ObjectTemplate> prototypeTemplate = interfaceTemplate->PrototypeTemplate(); ALLOW_UNUSED_LOCAL(prototypeTemplate); - interfaceTemplate->SetHiddenPrototype(true); - // Register DOM constants, attributes and operations. V8DOMConfiguration::installAccessors(isolate, world, instanceTemplate, prototypeTemplate, interfaceTemplate, signature, V8TestIntegerIndexedPrimaryGlobalAccessors, WTF_ARRAY_LENGTH(V8TestIntegerIndexedPrimaryGlobalAccessors)); V8DOMConfiguration::installMethods(isolate, world, instanceTemplate, prototypeTemplate, interfaceTemplate, signature, V8TestIntegerIndexedPrimaryGlobalMethods, WTF_ARRAY_LENGTH(V8TestIntegerIndexedPrimaryGlobalMethods));
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCheckSecurity.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCheckSecurity.cpp index 935808ba..9ced920 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCheckSecurity.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCheckSecurity.cpp
@@ -455,8 +455,6 @@ ALLOW_UNUSED_LOCAL(instanceTemplate); v8::Local<v8::ObjectTemplate> prototypeTemplate = interfaceTemplate->PrototypeTemplate(); ALLOW_UNUSED_LOCAL(prototypeTemplate); - interfaceTemplate->SetHiddenPrototype(true); - // Register DOM constants, attributes and operations. V8DOMConfiguration::installAccessors(isolate, world, instanceTemplate, prototypeTemplate, interfaceTemplate, signature, V8TestInterfaceCheckSecurityAccessors, WTF_ARRAY_LENGTH(V8TestInterfaceCheckSecurityAccessors)); V8DOMConfiguration::installMethods(isolate, world, instanceTemplate, prototypeTemplate, interfaceTemplate, signature, V8TestInterfaceCheckSecurityMethods, WTF_ARRAY_LENGTH(V8TestInterfaceCheckSecurityMethods));
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp index 1b62e08..90f4042 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp
@@ -53,14 +53,11 @@ #include "bindings/core/v8/V8XPathNSResolver.h" #include "core/HTMLNames.h" #include "core/dom/ClassCollection.h" -#include "core/dom/DOMArrayBuffer.h" #include "core/dom/Document.h" #include "core/dom/FlexibleArrayBufferView.h" -#include "core/dom/MessagePort.h" #include "core/dom/TagCollection.h" #include "core/dom/custom/CustomElementProcessingStack.h" #include "core/frame/Deprecation.h" -#include "core/frame/ImageBitmap.h" #include "core/frame/LocalFrame.h" #include "core/frame/UseCounter.h" #include "core/html/HTMLCollection.h"
diff --git a/third_party/WebKit/Source/core/animation/AnimationEffect.cpp b/third_party/WebKit/Source/core/animation/AnimationEffect.cpp index 6d30f77..2354300 100644 --- a/third_party/WebKit/Source/core/animation/AnimationEffect.cpp +++ b/third_party/WebKit/Source/core/animation/AnimationEffect.cpp
@@ -158,7 +158,16 @@ const double iterationTime = calculateIterationTime(iterationDuration, repeatedDuration(), scaledActiveTime, startOffset, m_timing); currentIteration = calculateCurrentIteration(iterationDuration, iterationTime, scaledActiveTime, m_timing); - timeFraction = calculateTransformedTime(currentIteration, iterationDuration, iterationTime, m_timing) / iterationDuration; + const double transformedTime = calculateTransformedTime(currentIteration, iterationDuration, iterationTime, m_timing); + + // The infinite iterationDuration case here is a workaround because + // the specified behaviour does not handle infinite durations well. + // There is an open issue against the spec to fix this: + // https://github.com/w3c/web-animations/issues/142 + if (!std::isfinite(iterationDuration)) + timeFraction = fmod(m_timing.iterationStart, 1.0); + else + timeFraction = transformedTime / iterationDuration; if (!isNull(iterationTime)) { timeToNextIteration = (iterationDuration - iterationTime) / std::abs(m_timing.playbackRate);
diff --git a/third_party/WebKit/Source/core/animation/CompositorAnimations.cpp b/third_party/WebKit/Source/core/animation/CompositorAnimations.cpp index ba39698..fd3f332 100644 --- a/third_party/WebKit/Source/core/animation/CompositorAnimations.cpp +++ b/third_party/WebKit/Source/core/animation/CompositorAnimations.cpp
@@ -654,7 +654,14 @@ ASSERT(!properties.isEmpty()); for (const auto& property : properties) { PropertySpecificKeyframeVector values; - getKeyframeValuesForProperty(&effect, property, compositorTiming.scaledDuration, values); + // If the animation duration is infinite, it doesn't make sense to scale + // the keyframe offset, so use a scale of 1.0. This is connected to + // the known issue of how the Web Animations spec handles infinite + // durations. See https://github.com/w3c/web-animations/issues/142 + double scale = compositorTiming.scaledDuration; + if (!std::isfinite(scale)) + scale = 1.0; + getKeyframeValuesForProperty(&effect, property, scale, values); CompositorTargetProperty::Type targetProperty; OwnPtr<CompositorAnimationCurve> curve;
diff --git a/third_party/WebKit/Source/core/core.gypi b/third_party/WebKit/Source/core/core.gypi index c99940b..3121507d 100644 --- a/third_party/WebKit/Source/core/core.gypi +++ b/third_party/WebKit/Source/core/core.gypi
@@ -430,7 +430,6 @@ 'dom/NonDocumentTypeChildNode.idl', 'dom/NonElementParentNode.idl', 'dom/ParentNode.idl', - 'dom/URLUtils.idl', 'dom/URLUtilsReadOnly.idl', 'events/EventListener.idl', 'events/NavigatorEvents.idl', @@ -442,6 +441,7 @@ 'frame/WindowBase64.idl', 'frame/WindowEventHandlers.idl', 'frame/WindowTimers.idl', + 'html/HTMLHyperlinkElementUtils.idl', 'imagebitmap/ImageBitmapFactories.idl', 'svg/SVGDocument.idl', 'svg/SVGFilterPrimitiveStandardAttributes.idl', @@ -2227,12 +2227,19 @@ 'workers/AbstractWorker.h', 'workers/DedicatedWorkerGlobalScope.cpp', 'workers/DedicatedWorkerGlobalScope.h', + 'workers/DedicatedWorkerGlobalScopeProxyProvider.cpp', + 'workers/DedicatedWorkerGlobalScopeProxyProvider.h', 'workers/DedicatedWorkerMessagingProxy.cpp', 'workers/DedicatedWorkerMessagingProxy.h', 'workers/DedicatedWorkerThread.cpp', 'workers/DedicatedWorkerThread.h', 'workers/InProcessWorkerBase.cpp', 'workers/InProcessWorkerBase.h', + 'workers/InProcessWorkerGlobalScopeProxy.h', + 'workers/InProcessWorkerMessagingProxy.cpp', + 'workers/InProcessWorkerMessagingProxy.h', + 'workers/InProcessWorkerObjectProxy.cpp', + 'workers/InProcessWorkerObjectProxy.h', 'workers/MainThreadWorkletGlobalScope.h', 'workers/SharedWorker.cpp', 'workers/SharedWorker.h', @@ -2252,20 +2259,13 @@ 'workers/WorkerEventQueue.h', 'workers/WorkerGlobalScope.cpp', 'workers/WorkerGlobalScope.h', - 'workers/WorkerGlobalScopeProxy.h', - 'workers/WorkerGlobalScopeProxyProvider.cpp', - 'workers/WorkerGlobalScopeProxyProvider.h', 'workers/WorkerInspectorProxy.cpp', 'workers/WorkerInspectorProxy.h', 'workers/WorkerLoaderProxy.cpp', 'workers/WorkerLoaderProxy.h', 'workers/WorkerLocation.h', - 'workers/WorkerMessagingProxy.cpp', - 'workers/WorkerMessagingProxy.h', 'workers/WorkerNavigator.cpp', 'workers/WorkerNavigator.h', - 'workers/WorkerObjectProxy.cpp', - 'workers/WorkerObjectProxy.h', 'workers/WorkerOrWorkletGlobalScope.h', 'workers/WorkerReportingProxy.h', 'workers/WorkerScriptLoader.cpp',
diff --git a/third_party/WebKit/Source/core/css/LocalFontFaceSource.cpp b/third_party/WebKit/Source/core/css/LocalFontFaceSource.cpp index 4ea73e26..cb56dd1 100644 --- a/third_party/WebKit/Source/core/css/LocalFontFaceSource.cpp +++ b/third_party/WebKit/Source/core/css/LocalFontFaceSource.cpp
@@ -20,7 +20,7 @@ { // We don't want to check alternate font family names here, so pass true as the checkingAlternateName parameter. RefPtr<SimpleFontData> fontData = FontCache::fontCache()->getFontData(fontDescription, m_fontName, true); - m_histograms.record(fontData); + m_histograms.record(fontData.get()); return fontData.release(); }
diff --git a/third_party/WebKit/Source/core/css/RemoteFontFaceSource.cpp b/third_party/WebKit/Source/core/css/RemoteFontFaceSource.cpp index 7f87e40..5897f06 100644 --- a/third_party/WebKit/Source/core/css/RemoteFontFaceSource.cpp +++ b/third_party/WebKit/Source/core/css/RemoteFontFaceSource.cpp
@@ -79,7 +79,7 @@ return !m_font->errorOccurred(); } -void RemoteFontFaceSource::fontLoaded(FontResource*) +void RemoteFontFaceSource::notifyFinished(Resource*) { m_histograms.recordRemoteFont(m_font.get()); m_histograms.fontLoaded(m_isInterventionTriggered);
diff --git a/third_party/WebKit/Source/core/css/RemoteFontFaceSource.h b/third_party/WebKit/Source/core/css/RemoteFontFaceSource.h index 952b2d8..45c2fc8 100644 --- a/third_party/WebKit/Source/core/css/RemoteFontFaceSource.h +++ b/third_party/WebKit/Source/core/css/RemoteFontFaceSource.h
@@ -38,7 +38,7 @@ void beginLoadIfNeeded() override; - void fontLoaded(FontResource*) override; + void notifyFinished(Resource*) override; void fontLoadShortLimitExceeded(FontResource*) override; void fontLoadLongLimitExceeded(FontResource*) override; String debugName() const override { return "RemoteFontFaceSource"; }
diff --git a/third_party/WebKit/Source/core/dom/ContainerNode.cpp b/third_party/WebKit/Source/core/dom/ContainerNode.cpp index b52be5b..8099f73 100644 --- a/third_party/WebKit/Source/core/dom/ContainerNode.cpp +++ b/third_party/WebKit/Source/core/dom/ContainerNode.cpp
@@ -952,7 +952,11 @@ upperLeft = lowerRight; } - return enclosingLayoutRect(FloatRect(upperLeft, lowerRight.expandedTo(upperLeft) - upperLeft)); + FloatSize size = lowerRight.expandedTo(upperLeft) - upperLeft; + if (std::isnan(size.width()) || std::isnan(size.height())) + return LayoutRect(); + + return enclosingLayoutRect(FloatRect(upperLeft, size)); } // This is used by FrameSelection to denote when the active-state of the page has changed
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp index 5ba449d..5183381 100644 --- a/third_party/WebKit/Source/core/dom/Document.cpp +++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -248,6 +248,31 @@ // for dual G5s. :) static const int cLayoutScheduleThreshold = 250; +namespace { + +void updateViewportApplyScroll(Element* documentElement) +{ + if (!documentElement + || !documentElement->isHTMLElement() + || documentElement->document().ownerElement()) + return; + + if (documentElement->getApplyScroll()) + return; + + ScrollStateCallback* applyScroll = + new ViewportScrollCallback(documentElement->document()); + + // Use disable-native-scroll since the ViewportScrollCallback needs to + // apply scroll actions before (TopControls) and after (overscroll) + // scrolling the element so it applies scroll to the element itself. + documentElement->setApplyScroll( + applyScroll, + "disable-native-scroll"); +} + +} // namespace + // DOM Level 2 says (letters added): // // a) Name start characters must have one of the categories Ll, Lu, Lo, Lt, Nl. @@ -584,47 +609,13 @@ { ContainerNode::childrenChanged(change); m_documentElement = ElementTraversal::firstWithin(*this); -} -void Document::updateViewportApplyScroll() -{ - if (!m_documentElement - || !m_documentElement->isHTMLElement() - || ownerElement()) - return; - - Element* newScrollingElement = scrollingElement(); - - // If there is no scrolling element (in QuirksMode and body is scrollable), - // install the viewport scroll callback on the <HTML> element. - if (!newScrollingElement) - newScrollingElement = m_documentElement; - - if (newScrollingElement == m_oldScrollingElement) - return; - - ScrollStateCallback* applyScroll = nullptr; - - // If the scrolling element changed, remove the apply scroll from the - // old one and keep it to put on the new scrolling element. - if (m_oldScrollingElement) { - applyScroll = m_oldScrollingElement->getApplyScroll(); - m_oldScrollingElement->removeApplyScroll(); - } - - if (newScrollingElement) { - if (!applyScroll) - applyScroll = new ViewportScrollCallback(*this, *frameHost()); - - // Use disable-native-scroll since the ViewportScrollCallback needs to - // apply scroll actions before (TopControls) and after (overscroll) - // scrolling the element so it applies scroll to the element itself. - newScrollingElement->setApplyScroll( - applyScroll, - "disable-native-scroll"); - } - - m_oldScrollingElement = newScrollingElement; + // Installs the viewport scrolling callback (the "applyScroll" in Scroll + // Customization lingo) on the documentElement. This callback is + // responsible for viewport related scroll actions like top controls + // movement and overscroll glow as well as actually scrolling the root + // viewport. + updateViewportApplyScroll(m_documentElement); } AtomicString Document::convertLocalName(const AtomicString& name) @@ -1805,7 +1796,6 @@ } view()->recalcOverflowAfterStyleChange(); - view()->setFrameTimingRequestsDirty(true); clearChildNeedsStyleRecalc(); @@ -1905,8 +1895,6 @@ void Document::layoutUpdated() { - updateViewportApplyScroll(); - // Plugins can run script inside layout which can detach the page. // TODO(esprehn): Can this still happen now that all plugins are out of // process? @@ -5825,12 +5813,17 @@ if (order == m_shadowCascadeOrder) return; - if (order == ShadowCascadeOrder::ShadowCascadeV0) + if (order == ShadowCascadeOrder::ShadowCascadeV0) { m_mayContainV0Shadow = true; + if (m_shadowCascadeOrder == ShadowCascadeOrder::ShadowCascadeV1) + UseCounter::count(*this, UseCounter::MixedShadowRootV0AndV1); + } // For V0 -> V1 upgrade, we need style recalculation for the whole document. - if (m_shadowCascadeOrder == ShadowCascadeOrder::ShadowCascadeV0 && order == ShadowCascadeOrder::ShadowCascadeV1) + if (m_shadowCascadeOrder == ShadowCascadeOrder::ShadowCascadeV0 && order == ShadowCascadeOrder::ShadowCascadeV1) { this->setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::Shadow)); + UseCounter::count(*this, UseCounter::MixedShadowRootV0AndV1); + } if (order > m_shadowCascadeOrder) m_shadowCascadeOrder = order; @@ -5875,7 +5868,6 @@ visitor->trace(m_contextFeatures); visitor->trace(m_styleSheetList); visitor->trace(m_documentTiming); - visitor->trace(m_oldScrollingElement); visitor->trace(m_mediaQueryMatcher); visitor->trace(m_scriptedAnimationController); visitor->trace(m_scriptedIdleTaskController);
diff --git a/third_party/WebKit/Source/core/dom/Document.h b/third_party/WebKit/Source/core/dom/Document.h index 0cb3924f..6a7f6d6c 100644 --- a/third_party/WebKit/Source/core/dom/Document.h +++ b/third_party/WebKit/Source/core/dom/Document.h
@@ -1158,13 +1158,6 @@ const OriginAccessEntry& accessEntryFromURL(); - // Installs the viewport scrolling callback (the "applyScroll" in Scroll - // Customization lingo) on the root scrollingElement. This callback is - // responsible for viewport related scroll actions like top controls - // movement and overscroll glow as well as actually scrolling the root - // viewport. - void updateViewportApplyScroll(); - DocumentLifecycle m_lifecycle; bool m_hasNodesWithPlaceholderStyle; @@ -1271,10 +1264,6 @@ Member<Element> m_cssTarget; - // Not a WeakMember since we want to keep the scrollingElement around until - // we move its ApplyScroll onto the new scrollingElement. - Member<Element> m_oldScrollingElement; - LoadEventProgress m_loadEventProgress; double m_startTime;
diff --git a/third_party/WebKit/Source/core/dom/DocumentTest.cpp b/third_party/WebKit/Source/core/dom/DocumentTest.cpp index 22ccdcc6..b3129b9f 100644 --- a/third_party/WebKit/Source/core/dom/DocumentTest.cpp +++ b/third_party/WebKit/Source/core/dom/DocumentTest.cpp
@@ -284,31 +284,6 @@ } } -// This tests that we mark Frame Timing requests as dirty correctly when we -// update style. -TEST_F(DocumentTest, FrameTimingRelayout) -{ - setHtmlInnerHTML( - "<style>" - " #div1 {" - " width: 100px;" - " height: 100px;" - " }" - "</style>" - "<p><div id='div1'><span>test</span></div></p>"); - - EXPECT_FALSE(document().view()->frameTimingRequestsDirty()); - - // Just calling update should have no effect. - document().updateLayoutTree(); - EXPECT_FALSE(document().view()->frameTimingRequestsDirty()); - - // Calling update with a style change should flag Frame Timing as dirty. - document().setChildNeedsStyleRecalc(); - document().updateLayoutTree(); - EXPECT_TRUE(document().view()->frameTimingRequestsDirty()); -} - TEST_F(DocumentTest, OutgoingReferrer) { document().setURL(KURL(KURL(), "https://www.example.com/hoge#fuga?piyo"));
diff --git a/third_party/WebKit/Source/core/dom/Element.cpp b/third_party/WebKit/Source/core/dom/Element.cpp index fe8f945..427788b9 100644 --- a/third_party/WebKit/Source/core/dom/Element.cpp +++ b/third_party/WebKit/Source/core/dom/Element.cpp
@@ -1955,8 +1955,10 @@ ShadowRoot* shadowRoot = createShadowRootInternal(type, exceptionState); - if (shadowRootInitDict.hasDelegatesFocus()) + if (shadowRootInitDict.hasDelegatesFocus()) { shadowRoot->setDelegatesFocus(shadowRootInitDict.delegatesFocus()); + UseCounter::count(document(), UseCounter::ShadowRootDelegatesFocus); + } return shadowRoot; }
diff --git a/third_party/WebKit/Source/core/dom/Node.idl b/third_party/WebKit/Source/core/dom/Node.idl index de0bfaef..2dab0ce 100644 --- a/third_party/WebKit/Source/core/dom/Node.idl +++ b/third_party/WebKit/Source/core/dom/Node.idl
@@ -42,7 +42,7 @@ readonly attribute DOMString? baseURI; - [ImplementedAs=inShadowIncludingDocument] readonly attribute boolean isConnected; + [ImplementedAs=inShadowIncludingDocument, Measure] readonly attribute boolean isConnected; [PerWorldBindings] readonly attribute Document? ownerDocument; [PerWorldBindings] readonly attribute Node? parentNode; [PerWorldBindings] readonly attribute Element? parentElement;
diff --git a/third_party/WebKit/Source/core/dom/NodeTest.cpp b/third_party/WebKit/Source/core/dom/NodeTest.cpp index d04ea15..b1603d55 100644 --- a/third_party/WebKit/Source/core/dom/NodeTest.cpp +++ b/third_party/WebKit/Source/core/dom/NodeTest.cpp
@@ -15,7 +15,6 @@ { const char* bodyContent = "<a id=one href='http://www.msn.com'>one</a><b id=two>two</b>"; setBodyContent(bodyContent); - updateLayoutAndStyleForPainting(); Node* one = document().getElementById("one"); Node* two = document().getElementById("two"); @@ -31,7 +30,6 @@ const char* shadowContent = "<a href='http://www.msn.com'><content></content></a>"; setBodyContent(bodyContent); setShadowContent(shadowContent, "host"); - updateLayoutAndStyleForPainting(); Node* one = document().getElementById("one"); EXPECT_FALSE(one->canStartSelection());
diff --git a/third_party/WebKit/Source/core/dom/TextTest.cpp b/third_party/WebKit/Source/core/dom/TextTest.cpp index 5de29a4..edf48d76f 100644 --- a/third_party/WebKit/Source/core/dom/TextTest.cpp +++ b/third_party/WebKit/Source/core/dom/TextTest.cpp
@@ -17,15 +17,14 @@ TEST_F(TextTest, RemoveFirstLetterPseudoElementWhenNoLetter) { - document().documentElement()->setInnerHTML("<style>*::first-letter{font:icon;}</style><pre>AB\n</pre>", ASSERT_NO_EXCEPTION); - updateLayoutAndStyleForPainting(); + setBodyContent("<style>*::first-letter{font:icon;}</style><pre>AB\n</pre>"); Element* pre = document().querySelector("pre", ASSERT_NO_EXCEPTION); Text* text = toText(pre->firstChild()); Range* range = Range::create(document(), text, 0, text, 2); range->deleteContents(ASSERT_NO_EXCEPTION); - updateLayoutAndStyleForPainting(); + updateAllLifecyclePhases(); EXPECT_FALSE(text->layoutObject()->isTextFragment()); }
diff --git a/third_party/WebKit/Source/core/dom/URL.idl b/third_party/WebKit/Source/core/dom/URL.idl index 449b13b..35f6f7fe 100644 --- a/third_party/WebKit/Source/core/dom/URL.idl +++ b/third_party/WebKit/Source/core/dom/URL.idl
@@ -43,7 +43,28 @@ // TODO(philipj): The return type should not be nullable. [RaisesException, CallWith=ExecutionContext] static DOMString? createObjectURL(Blob blob); [CallWith=ExecutionContext] static void revokeObjectURL(DOMString url); + + // TODO(sof): 'stringifier' entails an enumerable toString(), + // http://heycam.github.io/webidl/#es-stringifier + // something URL currently doesn't provide. Switch it over to being + // enumerable (http://crbug.com/306606). + // + // Until that time, do not use 'stringifier'. + // stringifier attribute USVString href; + attribute USVString href; + [NotEnumerable, ImplementedAs=href] USVString toString(); + + readonly attribute USVString origin; + + attribute USVString protocol; + attribute USVString username; + attribute USVString password; + attribute USVString host; + attribute USVString hostname; + attribute USVString port; + attribute USVString pathname; + attribute USVString search; readonly attribute URLSearchParams searchParams; + attribute USVString hash; }; -URL implements URLUtils;
diff --git a/third_party/WebKit/Source/core/dom/URLUtils.idl b/third_party/WebKit/Source/core/dom/URLUtils.idl deleted file mode 100644 index e38f421..0000000 --- a/third_party/WebKit/Source/core/dom/URLUtils.idl +++ /dev/null
@@ -1,47 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -// https://url.spec.whatwg.org/#urlutils - -[ - NoInterfaceObject, // Always used on target of 'implements' - Exposed=(Window,Worker), -] interface URLUtils { - // FIXME: should be stringifier: http://crbug.com/306606 - // stringifier attribute USVString href; - attribute USVString href; - [NotEnumerable, ImplementedAs=href] USVString toString(); - readonly attribute USVString origin; - - attribute USVString protocol; - attribute USVString username; - attribute USVString password; - attribute USVString host; - attribute USVString hostname; - attribute USVString port; - attribute USVString pathname; - attribute USVString search; - attribute USVString hash; -};
diff --git a/third_party/WebKit/Source/core/editing/CaretBase.cpp b/third_party/WebKit/Source/core/editing/CaretBase.cpp index 7c8ecbb..2c04c3b 100644 --- a/third_party/WebKit/Source/core/editing/CaretBase.cpp +++ b/third_party/WebKit/Source/core/editing/CaretBase.cpp
@@ -73,7 +73,7 @@ // FIXME: This should probably just use mapLocalToAncestor. // Compute an offset between the caretLayoutItem and the caretPainterItem. - ASSERT(caretLayoutItem.isDescendantOf(caretPainterItem)); + DCHECK(caretLayoutItem.isDescendantOf(caretPainterItem)); bool unrooted = false; while (caretLayoutItem != caretPainterItem) { @@ -97,7 +97,7 @@ if (caretPosition.position().isNull()) return false; - ASSERT(caretPosition.position().anchorNode()->layoutObject()); + DCHECK(caretPosition.position().anchorNode()->layoutObject()); // First compute a rect local to the layoutObject at the selection start. LayoutObject* layoutObject; @@ -157,7 +157,7 @@ bool CaretBase::shouldRepaintCaret(const LayoutView* view) const { - ASSERT(view); + DCHECK(view); if (FrameView* frameView = view->frameView()) { LocalFrame& frame = frameView->frame(); // The frame where the selection started return frame.settings() && frame.settings()->caretBrowsingEnabled();
diff --git a/third_party/WebKit/Source/core/editing/DOMSelection.cpp b/third_party/WebKit/Source/core/editing/DOMSelection.cpp index 342e161..7155e70 100644 --- a/third_party/WebKit/Source/core/editing/DOMSelection.cpp +++ b/third_party/WebKit/Source/core/editing/DOMSelection.cpp
@@ -50,7 +50,7 @@ static Position createPosition(Node* node, int offset) { - ASSERT(offset >= 0); + DCHECK_GE(offset, 0); if (!node) return Position(); return Position(node, offset); @@ -81,7 +81,7 @@ const VisibleSelection& DOMSelection::visibleSelection() const { - ASSERT(m_frame); + DCHECK(m_frame); return m_frame->selection().selection(); } @@ -346,7 +346,7 @@ void DOMSelection::extend(Node* node, int offset, ExceptionState& exceptionState) { - ASSERT(node); + DCHECK(node); if (!m_frame) return; @@ -377,7 +377,7 @@ } // If you're hitting this, you've added broken multi-range selection support - ASSERT(rangeCount() == 1); + DCHECK_EQ(rangeCount(), 1); Position anchor = anchorPosition(visibleSelection()); if (!anchor.anchorNode()->isInShadowTree()) @@ -400,7 +400,7 @@ void DOMSelection::addRange(Range* newRange) { - ASSERT(newRange); + DCHECK(newRange); if (!m_frame) return; @@ -467,7 +467,7 @@ bool DOMSelection::containsNode(const Node* n, bool allowPartial) const { - ASSERT(n); + DCHECK(n); if (!m_frame) return false; @@ -496,7 +496,7 @@ bool nodeFullyUnselected = (Range::compareBoundaryPoints(parentNode, nodeIndex, endPosition.computeContainerNode(), endPosition.offsetInContainerNode(), exceptionState) > 0 && !exceptionState.hadException()) || (Range::compareBoundaryPoints(parentNode, nodeIndex + 1, startPosition.computeContainerNode(), startPosition.offsetInContainerNode(), exceptionState) < 0 && !exceptionState.hadException()); - ASSERT(!exceptionState.hadException()); + DCHECK(!exceptionState.hadException()); if (nodeFullyUnselected) return false; @@ -505,7 +505,7 @@ void DOMSelection::selectAllChildren(Node* n, ExceptionState& exceptionState) { - ASSERT(n); + DCHECK(n); // This doesn't (and shouldn't) select text node characters. setBaseAndExtent(n, 0, n, n->countChildren(), exceptionState); @@ -534,7 +534,7 @@ if (containerNode == adjustedNode) return containerNode; - ASSERT(!adjustedNode->isShadowRoot()); + DCHECK(!adjustedNode->isShadowRoot()) << adjustedNode; return adjustedNode->parentOrShadowHostNode(); } @@ -557,7 +557,7 @@ bool DOMSelection::isValidForPosition(Node* node) const { - ASSERT(m_frame); + DCHECK(m_frame); if (!node) return true; return node->document() == m_frame->document();
diff --git a/third_party/WebKit/Source/core/editing/EditingStrategy.cpp b/third_party/WebKit/Source/core/editing/EditingStrategy.cpp index 742fbb4..181778c 100644 --- a/third_party/WebKit/Source/core/editing/EditingStrategy.cpp +++ b/third_party/WebKit/Source/core/editing/EditingStrategy.cpp
@@ -45,7 +45,7 @@ template <typename Traversal> int EditingAlgorithm<Traversal>::lastOffsetForEditing(const Node* node) { - ASSERT(node); + DCHECK(node); if (!node) return 0; if (node->offsetInCharacters())
diff --git a/third_party/WebKit/Source/core/editing/EditingStyle.cpp b/third_party/WebKit/Source/core/editing/EditingStyle.cpp index 20e6a7c..8e31503 100644 --- a/third_party/WebKit/Source/core/editing/EditingStyle.cpp +++ b/third_party/WebKit/Source/core/editing/EditingStyle.cpp
@@ -204,7 +204,7 @@ , m_primitiveValue(CSSPrimitiveValue::createIdentifier(primitiveValue)) , m_tagName(&tagName) { - ASSERT(primitiveValue != CSSValueInvalid); + DCHECK_NE(primitiveValue, CSSValueInvalid); } bool HTMLElementEquivalent::valueIsPresentInStyle(HTMLElement* element, StylePropertySet* style) const @@ -307,7 +307,7 @@ CSSValue* HTMLAttributeEquivalent::attributeValueAsCSSValue(Element* element) const { - ASSERT(element); + DCHECK(element); const AtomicString& value = element->getAttribute(m_attrName); if (value.isNull()) return nullptr; @@ -339,7 +339,7 @@ CSSValue* HTMLFontSizeEquivalent::attributeValueAsCSSValue(Element* element) const { - ASSERT(element); + DCHECK(element); const AtomicString& value = element->getAttribute(m_attrName); if (value.isNull()) return nullptr; @@ -506,7 +506,7 @@ void EditingStyle::replaceFontSizeByKeywordIfPossible(const ComputedStyle* computedStyle, CSSComputedStyleDeclaration* cssComputedStyle) { - ASSERT(computedStyle); + DCHECK(computedStyle); if (computedStyle->getFontDescription().keywordSize()) m_mutableStyle->setProperty(CSSPropertyFontSize, cssComputedStyle->getFontSizeCSSValuePreferringKeyword()->cssText()); } @@ -773,8 +773,8 @@ bool EditingStyle::conflictsWithInlineStyleOfElement(HTMLElement* element, EditingStyle* extractedStyle, Vector<CSSPropertyID>* conflictingProperties) const { - ASSERT(element); - ASSERT(!conflictingProperties || conflictingProperties->isEmpty()); + DCHECK(element); + DCHECK(!conflictingProperties || conflictingProperties->isEmpty()); const StylePropertySet* inlineStyle = element->inlineStyle(); if (!m_mutableStyle || !inlineStyle) @@ -881,7 +881,7 @@ bool EditingStyle::conflictsWithImplicitStyleOfAttributes(HTMLElement* element) const { - ASSERT(element); + DCHECK(element); if (!m_mutableStyle) return false; @@ -898,9 +898,10 @@ bool EditingStyle::extractConflictingImplicitStyleOfAttributes(HTMLElement* element, ShouldPreserveWritingDirection shouldPreserveWritingDirection, EditingStyle* extractedStyle, Vector<QualifiedName>& conflictingAttributes, ShouldExtractMatchingStyle shouldExtractMatchingStyle) const { - ASSERT(element); + DCHECK(element); // HTMLAttributeEquivalent::addToStyle doesn't support unicode-bidi and direction properties - ASSERT(!extractedStyle || shouldPreserveWritingDirection == PreserveWritingDirection); + if (extractedStyle) + DCHECK_EQ(shouldPreserveWritingDirection, PreserveWritingDirection); if (!m_mutableStyle) return false; @@ -933,7 +934,7 @@ bool EditingStyle::elementIsStyledSpanOrHTMLEquivalent(const HTMLElement* element) { - ASSERT(element); + DCHECK(element); bool elementIsSpanOrElementEquivalent = false; if (isHTMLSpanElement(*element)) { elementIsSpanOrElementEquivalent = true; @@ -977,7 +978,7 @@ } // font with color attribute, span with style attribute, etc... - ASSERT(matchedAttributes <= attributes.size()); + DCHECK_LE(matchedAttributes, attributes.size()); return matchedAttributes >= attributes.size(); } @@ -1020,7 +1021,7 @@ void EditingStyle::mergeTypingStyle(Document* document) { - ASSERT(document); + DCHECK(document); EditingStyle* typingStyle = document->frame()->selection().typingStyle(); if (!typingStyle || typingStyle == this) @@ -1031,7 +1032,7 @@ void EditingStyle::mergeInlineStyleOfElement(HTMLElement* element, CSSPropertyOverrideMode mode, PropertiesToInclude propertiesToInclude) { - ASSERT(element); + DCHECK(element); if (!element->inlineStyle()) return; @@ -1230,7 +1231,7 @@ void EditingStyle::removeStyleFromRulesAndContext(Element* element, ContainerNode* context) { - ASSERT(element); + DCHECK(element); if (!m_mutableStyle) return; @@ -1369,7 +1370,7 @@ if (selection.isRange()) { end = mostBackwardCaretPosition(selection.end()); - ASSERT(end.document()); + DCHECK(end.document()); Node* pastLast = Range::create(*end.document(), position.parentAnchoredEquivalent(), end.parentAnchoredEquivalent())->pastLastNode(); for (Node* n = node; n && n != pastLast; n = NodeTraversal::next(*n)) { if (!n->isStyledElement()) @@ -1417,7 +1418,7 @@ if (unicodeBidiValue == CSSValueBidiOverride) return NaturalWritingDirection; - ASSERT(isEmbedOrIsolate(unicodeBidiValue)); + DCHECK(isEmbedOrIsolate(unicodeBidiValue)) << unicodeBidiValue; CSSValue* direction = style->getPropertyCSSValue(CSSPropertyDirection); if (!direction || !direction->isPrimitiveValue()) continue; @@ -1449,7 +1450,7 @@ CSSValue* textDecorationsInEffect = style->getPropertyCSSValue(CSSPropertyWebkitTextDecorationsInEffect); CSSValue* textDecoration = style->getPropertyCSSValue(textDecorationPropertyForEditing()); // We shouldn't have both text-decoration and -webkit-text-decorations-in-effect because that wouldn't make sense. - ASSERT(!textDecorationsInEffect || !textDecoration); + DCHECK(!textDecorationsInEffect || !textDecoration); if (textDecorationsInEffect) { style->setProperty(textDecorationPropertyForEditing(), textDecorationsInEffect->cssText()); style->removeProperty(CSSPropertyWebkitTextDecorationsInEffect); @@ -1476,7 +1477,7 @@ CSSComputedStyleDeclaration* computedStyle = ensureComputedStyle(position); // FIXME: take care of background-color in effect MutableStylePropertySet* mutableStyle = getPropertiesNotIn(style->style(), computedStyle); - ASSERT(mutableStyle); + DCHECK(mutableStyle); reconcileTextDecorationProperties(mutableStyle); if (!document->frame()->editor().shouldStyleWithCSS()) @@ -1508,7 +1509,7 @@ void StyleChange::extractTextStyles(Document* document, MutableStylePropertySet* style, bool isMonospaceFont) { - ASSERT(style); + DCHECK(style); if (getIdentifierValue(style, CSSPropertyFontWeight) == CSSValueBold) { style->removeProperty(CSSPropertyFontWeight); @@ -1624,8 +1625,8 @@ MutableStylePropertySet* getPropertiesNotIn(StylePropertySet* styleWithRedundantProperties, CSSStyleDeclaration* baseStyle) { - ASSERT(styleWithRedundantProperties); - ASSERT(baseStyle); + DCHECK(styleWithRedundantProperties); + DCHECK(baseStyle); MutableStylePropertySet* result = styleWithRedundantProperties->mutableCopy(); result->removeEquivalentProperties(baseStyle);
diff --git a/third_party/WebKit/Source/core/editing/EditingTestBase.cpp b/third_party/WebKit/Source/core/editing/EditingTestBase.cpp index 4276d55..64649b4 100644 --- a/third_party/WebKit/Source/core/editing/EditingTestBase.cpp +++ b/third_party/WebKit/Source/core/editing/EditingTestBase.cpp
@@ -35,22 +35,23 @@ { ShadowRoot* shadowRoot = scope.getElementById(AtomicString::fromUTF8(hostElementID))->createShadowRootInternal(ShadowRootType::V0, ASSERT_NO_EXCEPTION); shadowRoot->setInnerHTML(String::fromUTF8(shadowRootContent), ASSERT_NO_EXCEPTION); + scope.document().view()->updateAllLifecyclePhases(); return shadowRoot; } void EditingTestBase::setBodyContent(const std::string& bodyContent) { document().body()->setInnerHTML(String::fromUTF8(bodyContent.c_str()), ASSERT_NO_EXCEPTION); + updateAllLifecyclePhases(); } ShadowRoot* EditingTestBase::setShadowContent(const char* shadowContent, const char* host) { ShadowRoot* shadowRoot = createShadowRootForElementWithIDAndSetInnerHTML(document(), host, shadowContent); - document().updateDistribution(); return shadowRoot; } -void EditingTestBase::updateLayoutAndStyleForPainting() +void EditingTestBase::updateAllLifecyclePhases() { document().view()->updateAllLifecyclePhases(); }
diff --git a/third_party/WebKit/Source/core/editing/EditingTestBase.h b/third_party/WebKit/Source/core/editing/EditingTestBase.h index bbd6351..1f30bac 100644 --- a/third_party/WebKit/Source/core/editing/EditingTestBase.h +++ b/third_party/WebKit/Source/core/editing/EditingTestBase.h
@@ -29,7 +29,7 @@ void setBodyContent(const std::string&); ShadowRoot* setShadowContent(const char* shadowContent, const char* shadowHostId); - void updateLayoutAndStyleForPainting(); + void updateAllLifecyclePhases(); private: OwnPtr<DummyPageHolder> m_dummyPageHolder;
diff --git a/third_party/WebKit/Source/core/editing/EditingUtilities.cpp b/third_party/WebKit/Source/core/editing/EditingUtilities.cpp index b196928..1009d71 100644 --- a/third_party/WebKit/Source/core/editing/EditingUtilities.cpp +++ b/third_party/WebKit/Source/core/editing/EditingUtilities.cpp
@@ -87,8 +87,8 @@ template <typename Traversal> static int comparePositions(Node* containerA, int offsetA, Node* containerB, int offsetB, bool* disconnected) { - ASSERT(containerA); - ASSERT(containerB); + DCHECK(containerA); + DCHECK(containerB); if (disconnected) *disconnected = false; @@ -193,21 +193,21 @@ // could be inside a shadow tree. Only works for non-null values. int comparePositions(const Position& a, const Position& b) { - ASSERT(a.isNotNull()); - ASSERT(b.isNotNull()); + DCHECK(a.isNotNull()); + DCHECK(b.isNotNull()); const TreeScope* commonScope = Position::commonAncestorTreeScope(a, b); - ASSERT(commonScope); + DCHECK(commonScope); if (!commonScope) return 0; Node* nodeA = commonScope->ancestorInThisScope(a.computeContainerNode()); - ASSERT(nodeA); + DCHECK(nodeA); bool hasDescendentA = nodeA != a.computeContainerNode(); int offsetA = hasDescendentA ? 0 : a.computeOffsetInContainerNode(); Node* nodeB = commonScope->ancestorInThisScope(b.computeContainerNode()); - ASSERT(nodeB); + DCHECK(nodeB); bool hasDescendentB = nodeB != b.computeContainerNode(); int offsetB = hasDescendentB ? 0 : b.computeOffsetInContainerNode(); @@ -270,7 +270,7 @@ if (updateStyle == UpdateStyle) node->document().updateLayoutIgnorePendingStylesheets(); else - ASSERT(updateStyle == DoNotUpdateStyle); + DCHECK_EQ(updateStyle, DoNotUpdateStyle); if (isDisplayInsideTable(node)) node = node->parentNode(); @@ -679,7 +679,8 @@ template <typename Strategy> PositionTemplate<Strategy> nextPositionOfAlgorithm(const PositionTemplate<Strategy>& position, PositionMoveType moveType) { - ASSERT(moveType != PositionMoveType::BackwardDeletion); + // TODO(yosin): We should have printer for PositionMoveType. + DCHECK(moveType != PositionMoveType::BackwardDeletion); Node* node = position.anchorNode(); if (!node) @@ -843,7 +844,7 @@ } } - ASSERT(rebalancedString.length() == length); + DCHECK_EQ(rebalancedString.length(), length); return rebalancedString.toString(); } @@ -1023,8 +1024,8 @@ { if (node.hasChildren()) return createVisiblePosition(firstPositionInOrBeforeNode(&node)); - ASSERT(node.parentNode()); - ASSERT(!node.parentNode()->isShadowRoot()); + DCHECK(node.parentNode()) << node; + DCHECK(!node.parentNode()->isShadowRoot()) << node.parentNode(); return createVisiblePosition(positionInParentBeforeNode(node)); } @@ -1033,8 +1034,8 @@ { if (node.hasChildren()) return createVisiblePosition(lastPositionInOrAfterNode(&node)); - ASSERT(node.parentNode()); - ASSERT(!node.parentNode()->isShadowRoot()); + DCHECK(node.parentNode()) << node.parentNode(); + DCHECK(!node.parentNode()->isShadowRoot()) << node.parentNode(); return createVisiblePosition(positionInParentAfterNode(node)); } @@ -1080,7 +1081,7 @@ static Node* enclosingNodeOfTypeAlgorithm(const PositionTemplate<Strategy>& p, bool (*nodeIsOfType)(const Node*), EditingBoundaryCrossingRule rule) { // TODO(yosin) support CanSkipCrossEditingBoundary - ASSERT(rule == CanCrossEditingBoundary || rule == CannotCrossEditingBoundary); + DCHECK(rule == CanCrossEditingBoundary || rule == CannotCrossEditingBoundary) << rule; if (p.isNull()) return nullptr; @@ -1268,7 +1269,7 @@ bool isTableCell(const Node* node) { - ASSERT(node); + DCHECK(node); LayoutObject* r = node->layoutObject(); return r ? r->isTableCell() : isHTMLTableCellElement(*node); } @@ -1412,7 +1413,7 @@ // This assumes that it starts in editable content. Position leadingWhitespacePosition(const Position& position, TextAffinity affinity, WhitespacePositionOption option) { - ASSERT(isEditablePosition(position, ContentIsEditable, DoNotUpdateStyle)); + DCHECK(isEditablePosition(position, ContentIsEditable, DoNotUpdateStyle)) << position; if (position.isNull()) return Position(); @@ -1440,7 +1441,7 @@ // This assumes that it starts in editable content. Position trailingWhitespacePosition(const Position& position, TextAffinity, WhitespacePositionOption option) { - ASSERT(isEditablePosition(position, ContentIsEditable, DoNotUpdateStyle)); + DCHECK(isEditablePosition(position, ContentIsEditable, DoNotUpdateStyle)) << position; if (position.isNull()) return Position(); @@ -1597,7 +1598,7 @@ template <typename Strategy> static EphemeralRangeTemplate<Strategy> normalizeRangeAlgorithm(const EphemeralRangeTemplate<Strategy>& range) { - ASSERT(range.isNotNull()); + DCHECK(range.isNotNull()); range.document().updateLayoutIgnorePendingStylesheets(); // TODO(yosin) We should not call |parentAnchoredEquivalent()|, it is
diff --git a/third_party/WebKit/Source/core/editing/EditingUtilitiesTest.cpp b/third_party/WebKit/Source/core/editing/EditingUtilitiesTest.cpp index 0317945..e16b67f 100644 --- a/third_party/WebKit/Source/core/editing/EditingUtilitiesTest.cpp +++ b/third_party/WebKit/Source/core/editing/EditingUtilitiesTest.cpp
@@ -18,7 +18,6 @@ const char* shadowContent = "<content select=#two></content><p dir=rtl><content select=#one></content><p>"; setBodyContent(bodyContent); setShadowContent(shadowContent, "host"); - updateLayoutAndStyleForPainting(); Node* one = document().getElementById("one"); EXPECT_EQ(LTR, directionOfEnclosingBlock(Position(one, 0))); @@ -31,7 +30,6 @@ const char* shadowContent = "<content select=#two></content><content select=#one></content><b id='three'>333</b>"; setBodyContent(bodyContent); ShadowRoot* shadowRoot = setShadowContent(shadowContent, "host"); - updateLayoutAndStyleForPainting(); Element* host = document().getElementById("host"); Node* one = document().getElementById("one"); Node* two = document().getElementById("two"); @@ -55,7 +53,6 @@ const char* shadowContent = "<content select=#two></content><div id='three'><content select=#one></content></div>"; setBodyContent(bodyContent); ShadowRoot* shadowRoot = setShadowContent(shadowContent, "host"); - updateLayoutAndStyleForPainting(); Node* host = document().getElementById("host"); Node* one = document().getElementById("one"); Node* three = shadowRoot->getElementById("three"); @@ -70,7 +67,6 @@ const char* shadowContent = "<content select=#two></content><div id='three'><content select=#one></div></content>"; setBodyContent(bodyContent); ShadowRoot* shadowRoot = setShadowContent(shadowContent, "host"); - updateLayoutAndStyleForPainting(); Node* host = document().getElementById("host"); Node* one = document().getElementById("one"); Node* three = shadowRoot->getElementById("three"); @@ -92,7 +88,7 @@ document().firstChild()->remove(); document().appendChild(table); document().setDesignMode("on"); - updateLayoutAndStyleForPainting(); + updateAllLifecyclePhases(); EXPECT_FALSE(isEditablePosition(Position(table, 0))); } @@ -103,7 +99,6 @@ const char* shadowContent = "<content select=#two></content><content select=#table></content>"; setBodyContent(bodyContent); setShadowContent(shadowContent, "host"); - updateLayoutAndStyleForPainting(); Node* host = document().getElementById("host"); Node* table = document().getElementById("table"); @@ -129,7 +124,6 @@ const char* shadowContent = "<content select=#two></content><content select=#one></content><b id='three'>333</b>"; setBodyContent(bodyContent); ShadowRoot* shadowRoot = setShadowContent(shadowContent, "host"); - updateLayoutAndStyleForPainting(); Element* host = document().getElementById("host"); Node* one = document().getElementById("one"); Node* two = document().getElementById("two"); @@ -166,7 +160,6 @@ const char* shadowContent = "<content select=#two></content><content select=#one></content><content select=#three></content>"; setBodyContent(bodyContent); setShadowContent(shadowContent, "host"); - updateLayoutAndStyleForPainting(); Node* one = document().getElementById("one"); Node* two = document().getElementById("two"); Node* three = document().getElementById("three"); @@ -178,9 +171,8 @@ TEST_F(EditingUtilitiesTest, AreaIdenticalElements) { setBodyContent("<style>li:nth-child(even) { -webkit-user-modify: read-write; }</style><ul><li>first item</li><li>second item</li><li class=foo>third</li><li>fourth</li></ul>"); - updateLayoutAndStyleForPainting(); StaticElementList* items = document().querySelectorAll("li", ASSERT_NO_EXCEPTION); - ASSERT(items->length() == 4); + DCHECK_EQ(items->length(), 4u); EXPECT_FALSE(areIdenticalElements(*items->item(0)->firstChild(), *items->item(1)->firstChild())) << "Can't merge non-elements. e.g. Text nodes"; @@ -211,7 +203,7 @@ EXPECT_EQ(2, nextGraphemeBoundaryOf(node, 1)); EXPECT_EQ(3, nextGraphemeBoundaryOf(node, 2)); - updateLayoutAndStyleForPainting(); + updateAllLifecyclePhases(); EXPECT_NE(nullptr, node->layoutObject()); EXPECT_EQ(2, previousGraphemeBoundaryOf(node, 3)); EXPECT_EQ(1, previousGraphemeBoundaryOf(node, 2)); @@ -232,7 +224,7 @@ EXPECT_EQ(2, nextGraphemeBoundaryOf(node, 1)); EXPECT_EQ(3, nextGraphemeBoundaryOf(node, 2)); - updateLayoutAndStyleForPainting(); + updateAllLifecyclePhases(); EXPECT_NE(nullptr, node->layoutObject()); EXPECT_EQ(2, previousGraphemeBoundaryOf(node, 3)); EXPECT_EQ(1, previousGraphemeBoundaryOf(node, 2));
diff --git a/third_party/WebKit/Source/core/editing/Editor.cpp b/third_party/WebKit/Source/core/editing/Editor.cpp index 34478f2..55c7ddb7 100644 --- a/third_party/WebKit/Source/core/editing/Editor.cpp +++ b/third_party/WebKit/Source/core/editing/Editor.cpp
@@ -103,7 +103,7 @@ Editor::RevealSelectionScope::~RevealSelectionScope() { - ASSERT(m_editor->m_preventRevealSelection); + DCHECK(m_editor->m_preventRevealSelection); --m_editor->m_preventRevealSelection; if (!m_editor->m_preventRevealSelection) m_editor->frame().selection().revealSelection(ScrollAlignment::alignToEdgeIfNeeded, RevealExtent); @@ -295,7 +295,7 @@ EditingState editingState; if (frame().selection().isRange()) { if (isTypingAction) { - ASSERT(frame().document()); + DCHECK(frame().document()); TypingCommand::deleteKeyPressed(*frame().document(), canSmartCopyOrDelete() ? TypingCommand::SmartDelete : 0, granularity); revealSelectionAfterEditingOperation(); } else { @@ -313,14 +313,14 @@ switch (direction) { case DirectionForward: case DirectionRight: - ASSERT(frame().document()); + DCHECK(frame().document()); TypingCommand::forwardDeleteKeyPressed(*frame().document(), &editingState, options, granularity); if (editingState.isAborted()) return false; break; case DirectionBackward: case DirectionLeft: - ASSERT(frame().document()); + DCHECK(frame().document()); TypingCommand::deleteKeyPressed(*frame().document(), options, granularity); break; } @@ -341,7 +341,7 @@ if (frame().selection().isNone()) return; - ASSERT(frame().document()); + DCHECK(frame().document()); DeleteSelectionCommand::create(*frame().document(), smartDelete)->apply(); } @@ -399,7 +399,7 @@ KURL url; String markup = pasteboard->readHTML(url, fragmentStart, fragmentEnd); if (!markup.isEmpty()) { - ASSERT(frame().document()); + DCHECK(frame().document()); fragment = createFragmentFromMarkupWithContext(*frame().document(), markup, fragmentStart, fragmentEnd, url, DisallowScriptingAndPluginContent); } } @@ -450,8 +450,8 @@ static void writeImageNodeToPasteboard(Pasteboard* pasteboard, Node* node, const String& title) { - ASSERT(pasteboard); - ASSERT(node); + DCHECK(pasteboard); + DCHECK(node); RefPtr<Image> image = imageFromNode(*node); if (!image.get()) @@ -514,7 +514,7 @@ options |= ReplaceSelectionCommand::SmartReplace; if (matchStyle) options |= ReplaceSelectionCommand::MatchStyle; - ASSERT(frame().document()); + DCHECK(frame().document()); ReplaceSelectionCommand::create(*frame().document(), fragment, options, EditActionPaste)->apply(); revealSelectionAfterEditingOperation(); } @@ -532,7 +532,7 @@ options |= ReplaceSelectionCommand::SmartReplace; if (plainText) options |= ReplaceSelectionCommand::MatchStyle; - ASSERT(frame().document()); + DCHECK(frame().document()); ReplaceSelectionCommand::create(*frame().document(), fragment, options, EditActionDrag)->apply(); } @@ -574,7 +574,7 @@ void Editor::removeFormattingAndStyle() { - ASSERT(frame().document()); + DCHECK(frame().document()); RemoveFormatCommand::create(*frame().document())->apply(); } @@ -608,7 +608,7 @@ break; case RangeSelection: if (style) { - ASSERT(frame().document()); + DCHECK(frame().document()); ApplyStyleCommand::create(*frame().document(), EditingStyle::create(style), editingAction)->apply(); } break; @@ -619,7 +619,7 @@ { if (frame().selection().isNone() || !style) return; - ASSERT(frame().document()); + DCHECK(frame().document()); ApplyStyleCommand::create(*frame().document(), EditingStyle::create(style), editingAction, ApplyStyleCommand::ForceBlockProperties)->apply(); } @@ -681,7 +681,7 @@ return; if (!SpellChecker::isSpellCheckingEnabledFor(cmd->endingSelection())) return; - ASSERT(cmd->isReplaceSelectionCommand()); + DCHECK(cmd->isReplaceSelectionCommand()); const EphemeralRange& insertedRange = toReplaceSelectionCommand(cmd)->insertedRange(); if (insertedRange.isNull()) return; @@ -697,7 +697,7 @@ requestSpellcheckingAfterApplyingCommand(cmd); EditCommandComposition* composition = cmd->composition(); - ASSERT(composition); + DCHECK(composition); dispatchEditableContentChangedEvents(composition->startingRootEditableElement(), composition->endingRootEditableElement()); VisibleSelection newSelection(cmd->endingSelection()); @@ -709,7 +709,7 @@ // Command will be equal to last edit command only in the case of typing if (m_lastEditCommand.get() == cmd) { - ASSERT(cmd->isTypingCommand()); + DCHECK(cmd->isTypingCommand()); } else { // Only register a new undo command if the command passed in is // different from the last command @@ -821,7 +821,7 @@ VisiblePosition caret = frame().selection().selection().visibleStart(); bool alignToEdge = isEndOfEditableOrNonEditableContent(caret); - ASSERT(frame().document()); + DCHECK(frame().document()); if (!TypingCommand::insertLineBreak(*frame().document())) return false; revealSelectionAfterEditingOperation(alignToEdge ? ScrollAlignment::alignToEdgeIfNeeded : ScrollAlignment::alignCenterIfNeeded); @@ -839,7 +839,7 @@ VisiblePosition caret = frame().selection().selection().visibleStart(); bool alignToEdge = isEndOfEditableOrNonEditableContent(caret); - ASSERT(frame().document()); + DCHECK(frame().document()); EditingState editingState; if (!TypingCommand::insertParagraphSeparator(*frame().document())) return false; @@ -888,7 +888,7 @@ void Editor::paste() { - ASSERT(frame().document()); + DCHECK(frame().document()); if (tryDHTMLPaste(AllMimeTypes)) return; // DHTML did the whole operation if (!canPaste()) @@ -1116,7 +1116,7 @@ IntRect Editor::firstRectForRange(const EphemeralRange& range) const { LayoutUnit extraWidthToEndOfLine; - ASSERT(range.isNotNull()); + DCHECK(range.isNotNull()); IntRect startCaretRect = RenderedPosition(createVisiblePosition(range.startPosition()).deepEquivalent(), TextAffinity::Downstream).absoluteRect(&extraWidthToEndOfLine); if (startCaretRect.isEmpty()) @@ -1143,7 +1143,7 @@ IntRect Editor::firstRectForRange(const Range* range) const { - ASSERT(range); + DCHECK(range); return firstRectForRange(EphemeralRange(range)); } @@ -1168,7 +1168,7 @@ // Handle block styles, substracting these from the typing style. EditingStyle* blockStyle = typingStyle->extractAndRemoveBlockProperties(); if (!blockStyle->isEmpty()) { - ASSERT(frame().document()); + DCHECK(frame().document()); ApplyStyleCommand::create(*frame().document(), blockStyle, editingAction)->apply(); } @@ -1360,7 +1360,7 @@ if (document.documentElement() && body != document.documentElement()) body->appendChild(document.documentElement()); root->appendChild(body); - ASSERT(!document.documentElement()); + DCHECK(!document.documentElement()); document.appendChild(root); // TODO(tkent): Should we check and move Text node children of <html>?
diff --git a/third_party/WebKit/Source/core/editing/Editor.h b/third_party/WebKit/Source/core/editing/Editor.h index 2441db9..2622bb8 100644 --- a/third_party/WebKit/Source/core/editing/Editor.h +++ b/third_party/WebKit/Source/core/editing/Editor.h
@@ -142,7 +142,7 @@ private: LocalFrame& frame() const { - ASSERT(m_frame); + DCHECK(m_frame); return *m_frame; } @@ -261,7 +261,7 @@ LocalFrame& frame() const { - ASSERT(m_frame); + DCHECK(m_frame); return *m_frame; }
diff --git a/third_party/WebKit/Source/core/editing/EphemeralRange.cpp b/third_party/WebKit/Source/core/editing/EphemeralRange.cpp index 30f0304..b4aefe4 100644 --- a/third_party/WebKit/Source/core/editing/EphemeralRange.cpp +++ b/third_party/WebKit/Source/core/editing/EphemeralRange.cpp
@@ -20,20 +20,20 @@ #endif { if (m_startPosition.isNull()) { - ASSERT(m_endPosition.isNull()); + DCHECK(m_endPosition.isNull()); return; } - ASSERT(m_endPosition.isNotNull()); - ASSERT(m_startPosition.document() == m_endPosition.document()); - ASSERT(m_startPosition.inShadowIncludingDocument()); - ASSERT(m_endPosition.inShadowIncludingDocument()); + DCHECK(m_endPosition.isNotNull()); + DCHECK_EQ(m_startPosition.document(), m_endPosition.document()); + DCHECK(m_startPosition.inShadowIncludingDocument()); + DCHECK(m_endPosition.inShadowIncludingDocument()); } template <typename Strategy> EphemeralRangeTemplate<Strategy>::EphemeralRangeTemplate(const EphemeralRangeTemplate<Strategy>& other) : EphemeralRangeTemplate(other.m_startPosition, other.m_endPosition) { - ASSERT(other.isValid()); + DCHECK(other.isValid()); } template <typename Strategy> @@ -47,7 +47,7 @@ { if (!range) return; - ASSERT(range->inShadowIncludingDocument()); + DCHECK(range->inShadowIncludingDocument()); m_startPosition = fromPositionInDOMTree<Strategy>(range->startPosition()); m_endPosition = fromPositionInDOMTree<Strategy>(range->endPosition()); #if ENABLE(ASSERT) @@ -68,7 +68,7 @@ template <typename Strategy> EphemeralRangeTemplate<Strategy>& EphemeralRangeTemplate<Strategy>::operator=(const EphemeralRangeTemplate<Strategy>& other) { - ASSERT(other.isValid()); + DCHECK(other.isValid()); m_startPosition = other.m_startPosition; m_endPosition = other.m_endPosition; #if ENABLE(ASSERT) @@ -92,28 +92,28 @@ template <typename Strategy> Document& EphemeralRangeTemplate<Strategy>::document() const { - ASSERT(isNotNull()); + DCHECK(isNotNull()); return *m_startPosition.document(); } template <typename Strategy> PositionTemplate<Strategy> EphemeralRangeTemplate<Strategy>::startPosition() const { - ASSERT(isValid()); + DCHECK(isValid()); return m_startPosition; } template <typename Strategy> PositionTemplate<Strategy> EphemeralRangeTemplate<Strategy>::endPosition() const { - ASSERT(isValid()); + DCHECK(isValid()); return m_endPosition; } template <typename Strategy> bool EphemeralRangeTemplate<Strategy>::isCollapsed() const { - ASSERT(isValid()); + DCHECK(isValid()); return m_startPosition == m_endPosition; }
diff --git a/third_party/WebKit/Source/core/editing/EphemeralRange.h b/third_party/WebKit/Source/core/editing/EphemeralRange.h index 945f0e3..ad357fb8 100644 --- a/third_party/WebKit/Source/core/editing/EphemeralRange.h +++ b/third_party/WebKit/Source/core/editing/EphemeralRange.h
@@ -60,7 +60,7 @@ bool isCollapsed() const; bool isNull() const { - ASSERT(isValid()); + DCHECK(isValid()); return m_startPosition.isNull(); } bool isNotNull() const { return !isNull(); }
diff --git a/third_party/WebKit/Source/core/editing/FrameSelection.cpp b/third_party/WebKit/Source/core/editing/FrameSelection.cpp index e4e28e2..5c00026 100644 --- a/third_party/WebKit/Source/core/editing/FrameSelection.cpp +++ b/third_party/WebKit/Source/core/editing/FrameSelection.cpp
@@ -429,7 +429,7 @@ void FrameSelection::respondToNodeModification(Node& node, bool baseRemoved, bool extentRemoved, bool startRemoved, bool endRemoved) { - ASSERT(node.document().isActive()); + DCHECK(node.document().isActive()) << node; bool clearLayoutTreeSelection = false; bool clearDOMTreeSelection = false; @@ -487,7 +487,7 @@ return position; // See: http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level-2-Range-Mutation - ASSERT(position.offsetInContainerNode() >= 0); + DCHECK_GE(position.offsetInContainerNode(), 0); unsigned positionOffset = static_cast<unsigned>(position.offsetInContainerNode()); // Replacing text can be viewed as a deletion followed by insertion. if (positionOffset >= offset && positionOffset <= offset + oldLength) @@ -528,7 +528,7 @@ if (!position.anchorNode() || !position.isOffsetInAnchor()) return position; - ASSERT(position.offsetInContainerNode() >= 0); + DCHECK_GE(position.offsetInContainerNode(), 0); unsigned positionOffset = static_cast<unsigned>(position.offsetInContainerNode()); if (position.anchorNode() == &oldNode) @@ -556,7 +556,7 @@ if (!position.anchorNode() || position.anchorNode() != &oldNode || !position.isOffsetInAnchor()) return position; // See: http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level-2-Range-Mutation - ASSERT(position.offsetInContainerNode() >= 0); + DCHECK_GE(position.offsetInContainerNode(), 0); unsigned positionOffset = static_cast<unsigned>(position.offsetInContainerNode()); unsigned oldLength = oldNode.length(); if (positionOffset <= oldLength) @@ -680,7 +680,7 @@ LayoutBlock* FrameSelection::caretLayoutObject() const { - ASSERT(selection().isValidFor(*m_frame->document())); + DCHECK(selection().isValidFor(*m_frame->document())); if (!isCaret()) return nullptr; return CaretBase::caretLayoutObject(selection().start().anchorNode()); @@ -688,8 +688,8 @@ IntRect FrameSelection::absoluteCaretBounds() { - ASSERT(selection().isValidFor(*m_frame->document())); - ASSERT(m_frame->document()->lifecycle().state() != DocumentLifecycle::InPaintInvalidation); + DCHECK(selection().isValidFor(*m_frame->document())); + DCHECK_NE(m_frame->document()->lifecycle().state(), DocumentLifecycle::InPaintInvalidation); m_frame->document()->updateLayoutIgnorePendingStylesheets(); if (!isCaret()) { m_caretBase->clearCaretRect(); @@ -708,7 +708,7 @@ return; m_caretRectDirty = false; - ASSERT(selection().isValidFor(*m_frame->document())); + DCHECK(selection().isValidFor(*m_frame->document())); LayoutObject* layoutObject = nullptr; LayoutRect newRect; if (selection().isCaret()) @@ -876,7 +876,7 @@ { if (!range || !range->inShadowIncludingDocument()) return false; - ASSERT(range->startContainer()->document() == range->endContainer()->document()); + DCHECK_EQ(range->startContainer()->document(), range->endContainer()->document()); return setSelectedRange(EphemeralRange(range), affinity, directional, options); } @@ -1058,8 +1058,8 @@ void FrameSelection::caretBlinkTimerFired(Timer<FrameSelection>*) { - ASSERT(m_caretBase->caretIsVisible()); - ASSERT(isCaret()); + DCHECK(m_caretBase->caretIsVisible()); + DCHECK(isCaret()); if (isCaretBlinkingSuspended() && m_shouldPaintCaret) return; m_shouldPaintCaret = !m_shouldPaintCaret; @@ -1236,7 +1236,7 @@ } Position start = this->start(); - ASSERT(start.anchorNode()); + DCHECK(start.anchorNode()); if (start.anchorNode() && start.anchorNode()->layoutObject()) { // FIXME: This code only handles scrolling the startContainer's layer, but // the selection rect could intersect more than just that.
diff --git a/third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp b/third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp index 9f66f041..683000de 100644 --- a/third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp +++ b/third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp
@@ -211,7 +211,6 @@ { setBodyContent("<span id=host></span>one"); setShadowContent("two<content></content>", "host"); - updateLayoutAndStyleForPainting(); Element* host = document().getElementById("host"); Node* const two = FlatTreeTraversal::firstChild(*host); // Select "two" for selection in DOM tree @@ -252,7 +251,6 @@ const char* shadowContent = "<span id=bottom>bottom</span>"; setBodyContent(bodyContent); ShadowRoot* shadowRoot = setShadowContent(shadowContent, "host"); - updateLayoutAndStyleForPainting(); Node* top = document().getElementById("top")->firstChild(); Node* bottom = shadowRoot->getElementById("bottom")->firstChild();
diff --git a/third_party/WebKit/Source/core/editing/GranularityStrategyTest.cpp b/third_party/WebKit/Source/core/editing/GranularityStrategyTest.cpp index 96caeb50..36ac9fb 100644 --- a/third_party/WebKit/Source/core/editing/GranularityStrategyTest.cpp +++ b/third_party/WebKit/Source/core/editing/GranularityStrategyTest.cpp
@@ -77,7 +77,7 @@ { m_dummyPageHolder = DummyPageHolder::create(IntSize(800, 600)); m_document = toHTMLDocument(&m_dummyPageHolder->document()); - ASSERT(m_document); + DCHECK(m_document); dummyPageHolder().frame().settings()->setDefaultFontSize(12); dummyPageHolder().frame().settings()->setSelectionStrategy(SelectionStrategy::Direction); }
diff --git a/third_party/WebKit/Source/core/editing/InputMethodController.cpp b/third_party/WebKit/Source/core/editing/InputMethodController.cpp index e1d2f0f..e0bec0d 100644 --- a/third_party/WebKit/Source/core/editing/InputMethodController.cpp +++ b/third_party/WebKit/Source/core/editing/InputMethodController.cpp
@@ -285,7 +285,7 @@ // If text is empty, then delete the old composition here. If text is non-empty, InsertTextCommand::input // will delete the old composition with an optimized replace operation. if (text.isEmpty()) { - ASSERT(frame().document()); + DCHECK(frame().document()); TypingCommand::deleteSelection(*frame().document(), TypingCommand::PreventSpellChecking); } @@ -293,7 +293,7 @@ if (text.isEmpty()) return; - ASSERT(frame().document()); + DCHECK(frame().document()); TypingCommand::insertText(*frame().document(), text, TypingCommand::SelectInsertedText | TypingCommand::PreventSpellChecking, TypingCommand::TextCompositionUpdate); // Find out what node has the composition now. @@ -400,7 +400,7 @@ if (range.isNull()) return PlainTextRange(); ContainerNode* editable = frame().selection().rootEditableElementOrTreeScopeRootNode(); - ASSERT(editable); + DCHECK(editable); return PlainTextRange::create(*editable, range); }
diff --git a/third_party/WebKit/Source/core/editing/InputMethodController.h b/third_party/WebKit/Source/core/editing/InputMethodController.h index c605caf2..6fa0f53 100644 --- a/third_party/WebKit/Source/core/editing/InputMethodController.h +++ b/third_party/WebKit/Source/core/editing/InputMethodController.h
@@ -103,7 +103,7 @@ Editor& editor() const; LocalFrame& frame() const { - ASSERT(m_frame); + DCHECK(m_frame); return *m_frame; }
diff --git a/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp b/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp index f84d230..b7558279 100644 --- a/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp +++ b/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp
@@ -33,7 +33,7 @@ { m_dummyPageHolder = DummyPageHolder::create(IntSize(800, 600)); m_document = toHTMLDocument(&m_dummyPageHolder->document()); - ASSERT(m_document); + DCHECK(m_document); } Element* InputMethodControllerTest::insertHTMLElement(
diff --git a/third_party/WebKit/Source/core/editing/PendingSelection.cpp b/third_party/WebKit/Source/core/editing/PendingSelection.cpp index 02afe9e..a3a4215 100644 --- a/third_party/WebKit/Source/core/editing/PendingSelection.cpp +++ b/third_party/WebKit/Source/core/editing/PendingSelection.cpp
@@ -86,7 +86,7 @@ { if (!hasPendingSelection()) return; - ASSERT(!layoutView.needsLayout()); + DCHECK(!layoutView.needsLayout()); m_hasPendingSelection = false; const VisibleSelectionInFlatTree& originalSelection = m_frameSelection->visibleSelection<EditingInFlatTreeStrategy>(); @@ -130,7 +130,8 @@ LayoutObject* endLayoutObject = endPos.anchorNode()->layoutObject(); if (!startLayoutObject || !endLayoutObject) return; - ASSERT(layoutView == startLayoutObject->view() && layoutView == endLayoutObject->view()); + DCHECK(layoutView == startLayoutObject->view()); + DCHECK(layoutView == endLayoutObject->view()); layoutView.setSelection(startLayoutObject, startPos.computeEditingOffset(), endLayoutObject, endPos.computeEditingOffset()); }
diff --git a/third_party/WebKit/Source/core/editing/PlainTextRange.cpp b/third_party/WebKit/Source/core/editing/PlainTextRange.cpp index 7cfb84d..163d3e7 100644 --- a/third_party/WebKit/Source/core/editing/PlainTextRange.cpp +++ b/third_party/WebKit/Source/core/editing/PlainTextRange.cpp
@@ -46,16 +46,16 @@ : m_start(location) , m_end(location) { - ASSERT(location >= 0); + DCHECK_GE(location, 0); } PlainTextRange::PlainTextRange(int start, int end) : m_start(start) , m_end(end) { - ASSERT(start >= 0); - ASSERT(end >= 0); - ASSERT(start <= end); + DCHECK_GE(start, 0); + DCHECK_GE(end, 0); + DCHECK_LE(start, end); } EphemeralRange PlainTextRange::createRange(const ContainerNode& scope) const @@ -70,7 +70,7 @@ EphemeralRange PlainTextRange::createRangeFor(const ContainerNode& scope, GetRangeFor getRangeFor) const { - ASSERT(isNotNull()); + DCHECK(isNotNull()); size_t docTextPosition = 0; bool startRangeFound = false;
diff --git a/third_party/WebKit/Source/core/editing/PlainTextRange.h b/third_party/WebKit/Source/core/editing/PlainTextRange.h index eacfe4a4..0988510 100644 --- a/third_party/WebKit/Source/core/editing/PlainTextRange.h +++ b/third_party/WebKit/Source/core/editing/PlainTextRange.h
@@ -46,11 +46,11 @@ explicit PlainTextRange(int location); PlainTextRange(int start, int end); - size_t end() const { ASSERT(!isNull()); return m_end; } - size_t start() const { ASSERT(!isNull()); return m_start; } + size_t end() const { DCHECK(isNotNull()); return m_end; } + size_t start() const { DCHECK(isNotNull()); return m_start; } bool isNull() const { return m_start == kNotFound; } bool isNotNull() const { return m_start != kNotFound; } - size_t length() const { ASSERT(!isNull()); return m_end - m_start; } + size_t length() const { DCHECK(isNotNull()); return m_end - m_start; } EphemeralRange createRange(const ContainerNode& scope) const; EphemeralRange createRangeForSelection(const ContainerNode& scope) const;
diff --git a/third_party/WebKit/Source/core/editing/Position.cpp b/third_party/WebKit/Source/core/editing/Position.cpp index d024f8ed..2f2f9d59 100644 --- a/third_party/WebKit/Source/core/editing/Position.cpp +++ b/third_party/WebKit/Source/core/editing/Position.cpp
@@ -34,7 +34,7 @@ namespace blink { -#if ENABLE(ASSERT) +#if DCHECK_IS_ON() static bool canBeAnchorNode(Node* node) { return !node || !node->isPseudoElement(); @@ -64,7 +64,7 @@ // Note: |offset| can be >= 1, if |anchorNode| have child nodes, e.g. // using Node.appendChild() to add a child node TEXTAREA. - ASSERT(offset >= 1); + DCHECK_GE(offset, 1); return PositionTemplate<Strategy>(anchorNode, PositionAnchorType::AfterAnchor); } @@ -79,7 +79,7 @@ return; } if (m_anchorNode->isTextNode()) { - ASSERT(m_anchorType == PositionAnchorType::BeforeAnchor || m_anchorType == PositionAnchorType::AfterAnchor); + DCHECK(m_anchorType == PositionAnchorType::BeforeAnchor || m_anchorType == PositionAnchorType::AfterAnchor); return; } if (m_anchorNode->isDocumentNode()) { @@ -88,8 +88,10 @@ DCHECK(isBeforeChildren() || isAfterChildren()) << m_anchorType; return; } - ASSERT(canBeAnchorNode(m_anchorNode.get())); - ASSERT(m_anchorType != PositionAnchorType::OffsetInAnchor); +#if DCHECK_IS_ON() + DCHECK(canBeAnchorNode(m_anchorNode.get())); +#endif + DCHECK_NE(m_anchorType, PositionAnchorType::OffsetInAnchor); } template <typename Strategy> @@ -99,10 +101,12 @@ , m_anchorType(PositionAnchorType::OffsetInAnchor) { if (m_anchorNode) - ASSERT(offset >= 0); + DCHECK_GE(offset, 0); else - ASSERT(offset == 0); - ASSERT(canBeAnchorNode(m_anchorNode.get())); + DCHECK_EQ(offset, 0); +#if DCHECK_IS_ON() + DCHECK(canBeAnchorNode(m_anchorNode.get())); +#endif } template <typename Strategy> @@ -290,8 +294,8 @@ int comparePositions(const PositionInFlatTree& positionA, const PositionInFlatTree& positionB) { - ASSERT(positionA.isNotNull()); - ASSERT(positionB.isNotNull()); + DCHECK(positionA.isNotNull()); + DCHECK(positionB.isNotNull()); positionA.anchorNode()->updateDistribution(); Node* containerA = positionA.computeContainerNode(); @@ -421,7 +425,7 @@ Node* anchor = pos.anchorNode(); if (anchor->offsetInCharacters()) return PositionInFlatTree(anchor, pos.computeOffsetInContainerNode()); - ASSERT(!anchor->isSlotOrActiveInsertionPoint()); + DCHECK(!anchor->isSlotOrActiveInsertionPoint()); int offset = pos.computeOffsetInContainerNode(); Node* child = NodeTraversal::childAt(*anchor, offset); if (!child) {
diff --git a/third_party/WebKit/Source/core/editing/Position.h b/third_party/WebKit/Source/core/editing/Position.h index 8c6d909..a00d20b 100644 --- a/third_party/WebKit/Source/core/editing/Position.h +++ b/third_party/WebKit/Source/core/editing/Position.h
@@ -100,7 +100,7 @@ // Inline O(1) access for Positions which callers know to be parent-anchored int offsetInContainerNode() const { - ASSERT(isOffsetInAnchor()); + DCHECK(isOffsetInAnchor()); return m_offset; } @@ -240,10 +240,10 @@ template <typename Strategy> PositionTemplate<Strategy> PositionTemplate<Strategy>::inParentBeforeNode(const Node& node) { - // FIXME: This should ASSERT(node.parentNode()) + // FIXME: This should DCHECK(node.parentNode()) // At least one caller currently hits this ASSERT though, which indicates // that the caller is trying to make a position relative to a disconnected node (which is likely an error) - // Specifically, editing/deleting/delete-ligature-001.html crashes with ASSERT(node->parentNode()) + // Specifically, editing/deleting/delete-ligature-001.html crashes with DCHECK(node->parentNode()) return PositionTemplate<Strategy>(Strategy::parent(node), Strategy::index(node)); } @@ -255,7 +255,7 @@ template <typename Strategy> PositionTemplate<Strategy> PositionTemplate<Strategy>::inParentAfterNode(const Node& node) { - ASSERT(node.parentNode()); + DCHECK(node.parentNode()) << node; return PositionTemplate<Strategy>(Strategy::parent(node), Strategy::index(node) + 1); } @@ -268,7 +268,7 @@ template <typename Strategy> PositionTemplate<Strategy> PositionTemplate<Strategy>::beforeNode(Node* anchorNode) { - ASSERT(anchorNode); + DCHECK(anchorNode); return PositionTemplate<Strategy>(anchorNode, PositionAnchorType::BeforeAnchor); } @@ -280,7 +280,7 @@ template <typename Strategy> PositionTemplate<Strategy> PositionTemplate<Strategy>::afterNode(Node* anchorNode) { - ASSERT(anchorNode); + DCHECK(anchorNode); return PositionTemplate<Strategy>(anchorNode, PositionAnchorType::AfterAnchor); }
diff --git a/third_party/WebKit/Source/core/editing/PositionIterator.cpp b/third_party/WebKit/Source/core/editing/PositionIterator.cpp index bd2d654..8244862b 100644 --- a/third_party/WebKit/Source/core/editing/PositionIterator.cpp +++ b/third_party/WebKit/Source/core/editing/PositionIterator.cpp
@@ -67,10 +67,10 @@ PositionTemplate<Strategy> PositionIteratorAlgorithm<Strategy>::deprecatedComputePosition() const { // TODO(yoichio): Share code to check domTreeVersion with EphemeralRange. - ASSERT(isValid()); + DCHECK(isValid()); if (m_nodeAfterPositionInAnchor) { - ASSERT(Strategy::parent(*m_nodeAfterPositionInAnchor) == m_anchorNode); - ASSERT(m_offsetsInAnchorNode[m_depthToAnchorNode] != kInvalidOffset); + DCHECK_EQ(Strategy::parent(*m_nodeAfterPositionInAnchor), m_anchorNode); + DCHECK_NE(m_offsetsInAnchorNode[m_depthToAnchorNode], kInvalidOffset); // FIXME: This check is inadaquete because any ancestor could be ignored by editing if (Strategy::editingIgnoresContent(Strategy::parent(*m_nodeAfterPositionInAnchor))) return PositionTemplate<Strategy>::beforeNode(m_anchorNode); @@ -84,7 +84,7 @@ template <typename Strategy> PositionTemplate<Strategy> PositionIteratorAlgorithm<Strategy>::computePosition() const { - ASSERT(isValid()); + DCHECK(isValid()); // Assume that we have the following DOM tree: // A // |-B @@ -97,8 +97,8 @@ // +-H if (m_nodeAfterPositionInAnchor) { // For example, position is before E, F. - ASSERT(Strategy::parent(*m_nodeAfterPositionInAnchor) == m_anchorNode); - ASSERT(m_offsetsInAnchorNode[m_depthToAnchorNode] != kInvalidOffset); + DCHECK_EQ(Strategy::parent(*m_nodeAfterPositionInAnchor), m_anchorNode); + DCHECK_NE(m_offsetsInAnchorNode[m_depthToAnchorNode], kInvalidOffset); // TODO(yoichio): This should be equivalent to // PositionTemplate<Strategy>(m_anchorNode, PositionAnchorType::BeforeAnchor); return PositionTemplate<Strategy>(m_anchorNode, m_offsetsInAnchorNode[m_depthToAnchorNode]); @@ -118,7 +118,7 @@ template <typename Strategy> void PositionIteratorAlgorithm<Strategy>::increment() { - ASSERT(isValid()); + DCHECK(isValid()); if (!m_anchorNode) return; @@ -170,7 +170,7 @@ m_anchorNode = Strategy::parent(*m_nodeAfterPositionInAnchor); if (!m_anchorNode) return; - ASSERT(m_depthToAnchorNode > 0); + DCHECK_GT(m_depthToAnchorNode, 0u); --m_depthToAnchorNode; // Increment offset of |child| or initialize if it have never been // used. @@ -186,7 +186,7 @@ template <typename Strategy> void PositionIteratorAlgorithm<Strategy>::decrement() { - ASSERT(isValid()); + DCHECK(isValid()); if (!m_anchorNode) return; @@ -218,7 +218,7 @@ m_offsetsInAnchorNode[m_depthToAnchorNode] = Strategy::index(*m_nodeAfterPositionInAnchor); else --m_offsetsInAnchorNode[m_depthToAnchorNode]; - ASSERT(m_offsetsInAnchorNode[m_depthToAnchorNode] >= 0); + DCHECK_GE(m_offsetsInAnchorNode[m_depthToAnchorNode], 0); // Increment depth intializing with last offset. ++m_depthToAnchorNode; if (m_depthToAnchorNode >= m_offsetsInAnchorNode.size()) @@ -237,7 +237,7 @@ return; m_offsetInAnchor = 0; // Decrement depth and intialize if needs. - ASSERT(m_depthToAnchorNode > 0); + DCHECK_GT(m_depthToAnchorNode, 0u); --m_depthToAnchorNode; if (m_offsetsInAnchorNode[m_depthToAnchorNode] == kInvalidOffset) m_offsetsInAnchorNode[m_depthToAnchorNode] = Strategy::index(*m_nodeAfterPositionInAnchor); @@ -276,7 +276,7 @@ m_anchorNode = Strategy::parent(*m_anchorNode); if (!m_anchorNode) return; - ASSERT(m_depthToAnchorNode > 0); + DCHECK_GT(m_depthToAnchorNode, 0u); --m_depthToAnchorNode; if (m_offsetsInAnchorNode[m_depthToAnchorNode] == kInvalidOffset) m_offsetsInAnchorNode[m_depthToAnchorNode] = Strategy::index(*m_nodeAfterPositionInAnchor); @@ -287,7 +287,7 @@ template <typename Strategy> bool PositionIteratorAlgorithm<Strategy>::atStart() const { - ASSERT(isValid()); + DCHECK(isValid()); if (!m_anchorNode) return true; if (Strategy::parent(*m_anchorNode)) @@ -298,7 +298,7 @@ template <typename Strategy> bool PositionIteratorAlgorithm<Strategy>::atEnd() const { - ASSERT(isValid()); + DCHECK(isValid()); if (!m_anchorNode) return true; if (m_nodeAfterPositionInAnchor) @@ -309,7 +309,7 @@ template <typename Strategy> bool PositionIteratorAlgorithm<Strategy>::atStartOfNode() const { - ASSERT(isValid()); + DCHECK(isValid()); if (!m_anchorNode) return true; if (!m_nodeAfterPositionInAnchor) @@ -320,7 +320,7 @@ template <typename Strategy> bool PositionIteratorAlgorithm<Strategy>::atEndOfNode() const { - ASSERT(isValid()); + DCHECK(isValid()); if (!m_anchorNode) return true; if (m_nodeAfterPositionInAnchor)
diff --git a/third_party/WebKit/Source/core/editing/RenderedPosition.cpp b/third_party/WebKit/Source/core/editing/RenderedPosition.cpp index eb4be7302..951cddc 100644 --- a/third_party/WebKit/Source/core/editing/RenderedPosition.cpp +++ b/third_party/WebKit/Source/core/editing/RenderedPosition.cpp
@@ -41,7 +41,7 @@ static inline LayoutObject* layoutObjectFromPosition(const Position& position) { - ASSERT(position.isNotNull()); + DCHECK(position.isNotNull()); Node* layoutObjectNode = nullptr; switch (position.anchorType()) { case PositionAnchorType::OffsetInAnchor: @@ -208,7 +208,7 @@ Position RenderedPosition::positionAtLeftBoundaryOfBiDiRun() const { - ASSERT(atLeftBoundaryOfBidiRun()); + DCHECK(atLeftBoundaryOfBidiRun()); if (atLeftmostOffsetInBox()) return Position::editingPositionOf(m_layoutObject->node(), m_offset); @@ -218,7 +218,7 @@ Position RenderedPosition::positionAtRightBoundaryOfBiDiRun() const { - ASSERT(atRightBoundaryOfBidiRun()); + DCHECK(atRightBoundaryOfBidiRun()); if (atRightmostOffsetInBox()) return Position::editingPositionOf(m_layoutObject->node(), m_offset);
diff --git a/third_party/WebKit/Source/core/editing/SelectionAdjuster.cpp b/third_party/WebKit/Source/core/editing/SelectionAdjuster.cpp index 9d9ea95f..51af3d9 100644 --- a/third_party/WebKit/Source/core/editing/SelectionAdjuster.cpp +++ b/third_party/WebKit/Source/core/editing/SelectionAdjuster.cpp
@@ -42,7 +42,7 @@ bool isEnclosedBy(const PositionInFlatTree& position, const Node& node) { - ASSERT(position.isNotNull()); + DCHECK(position.isNotNull()); Node* anchorNode = position.anchorNode(); if (anchorNode == node) return !position.isAfterAnchor() && !position.isBeforeAnchor(); @@ -101,7 +101,7 @@ { TreeScope& treeScope = startContainerNode->treeScope(); - ASSERT(currentPosition.computeContainerNode()->treeScope() != treeScope); + DCHECK(currentPosition.computeContainerNode()->treeScope() != treeScope); if (Node* ancestor = treeScope.ancestorInThisScope(currentPosition.computeContainerNode())) { if (ancestor->contains(startContainerNode)) @@ -135,7 +135,7 @@ { TreeScope& treeScope = endContainerNode->treeScope(); - ASSERT(currentPosition.computeContainerNode()->treeScope() != treeScope); + DCHECK(currentPosition.computeContainerNode()->treeScope() != treeScope); if (Node* ancestor = treeScope.ancestorInThisScope(currentPosition.computeContainerNode())) { if (ancestor->contains(endContainerNode)) @@ -231,10 +231,10 @@ void SelectionAdjuster::adjustSelectionToAvoidCrossingShadowBoundaries(VisibleSelection* selection) { // Note: |m_selectionType| isn't computed yet. - ASSERT(selection->base().isNotNull()); - ASSERT(selection->extent().isNotNull()); - ASSERT(selection->start().isNotNull()); - ASSERT(selection->end().isNotNull()); + DCHECK(selection->base().isNotNull()); + DCHECK(selection->extent().isNotNull()); + DCHECK(selection->start().isNotNull()); + DCHECK(selection->end().isNotNull()); // TODO(hajimehoshi): Checking treeScope is wrong when a node is // distributed, but we leave it as it is for backward compatibility.
diff --git a/third_party/WebKit/Source/core/editing/SelectionEditor.cpp b/third_party/WebKit/Source/core/editing/SelectionEditor.cpp index 93189a04..a90e2b8 100644 --- a/third_party/WebKit/Source/core/editing/SelectionEditor.cpp +++ b/third_party/WebKit/Source/core/editing/SelectionEditor.cpp
@@ -97,7 +97,7 @@ void SelectionEditor::setVisibleSelection(const VisibleSelectionInFlatTree& newSelection, FrameSelection::SetSelectionOptions options) { - ASSERT(!(options & FrameSelection::DoNotAdjustInFlatTree)); + DCHECK(!(options & FrameSelection::DoNotAdjustInFlatTree)); m_selectionInFlatTree = newSelection; SelectionAdjuster::adjustSelectionInDOMTree(&m_selection, m_selectionInFlatTree); } @@ -863,7 +863,7 @@ void SelectionEditor::didChangeVisibleSelection() { - ASSERT(m_observingVisibleSelection); + DCHECK(m_observingVisibleSelection); // Invalidate the logical range when the underlying VisibleSelection has changed. if (m_logicalRange) { m_logicalRange->dispose(); @@ -875,7 +875,7 @@ void SelectionEditor::startObservingVisibleSelectionChange() { - ASSERT(!m_observingVisibleSelection); + DCHECK(!m_observingVisibleSelection); m_selection.setChangeObserver(*this); m_observingVisibleSelection = true; }
diff --git a/third_party/WebKit/Source/core/editing/SurroundingText.cpp b/third_party/WebKit/Source/core/editing/SurroundingText.cpp index 0db8545..d22f472 100644 --- a/third_party/WebKit/Source/core/editing/SurroundingText.cpp +++ b/third_party/WebKit/Source/core/editing/SurroundingText.cpp
@@ -55,7 +55,7 @@ void SurroundingText::initialize(const Position& startPosition, const Position& endPosition, unsigned maxLength) { - ASSERT(startPosition.document() == endPosition.document()); + DCHECK_EQ(startPosition.document(), endPosition.document()); const unsigned halfMaxLength = maxLength / 2; @@ -86,7 +86,7 @@ m_startOffsetInContent = Range::create(*document, backwardsIterator.endPosition(), startPosition)->text().length(); m_endOffsetInContent = Range::create(*document, backwardsIterator.endPosition(), endPosition)->text().length(); m_contentRange = Range::create(*document, backwardsIterator.endPosition(), forwardRange.startPosition()); - ASSERT(m_contentRange); + DCHECK(m_contentRange); } Range* SurroundingText::rangeFromContentOffsets(unsigned startOffsetInContent, unsigned endOffsetInContent) @@ -96,17 +96,17 @@ CharacterIterator iterator(m_contentRange->startPosition(), m_contentRange->endPosition()); - ASSERT(!iterator.atEnd()); + DCHECK(!iterator.atEnd()); iterator.advance(startOffsetInContent); Position start = iterator.startPosition(); - ASSERT(!iterator.atEnd()); + DCHECK(!iterator.atEnd()); iterator.advance(endOffsetInContent - startOffsetInContent); Position end = iterator.startPosition(); - ASSERT(start.document()); + DCHECK(start.document()); return Range::create(*start.document(), start, end); }
diff --git a/third_party/WebKit/Source/core/editing/VisibleSelection.cpp b/third_party/WebKit/Source/core/editing/VisibleSelection.cpp index c05f1cb..a63e17b 100644 --- a/third_party/WebKit/Source/core/editing/VisibleSelection.cpp +++ b/third_party/WebKit/Source/core/editing/VisibleSelection.cpp
@@ -100,7 +100,7 @@ static SelectionType computeSelectionType(const PositionTemplate<Strategy>& start, const PositionTemplate<Strategy>& end) { if (start.isNull()) { - ASSERT(end.isNull()); + DCHECK(end.isNull()); return NoSelection; } if (start == end) @@ -153,7 +153,7 @@ template <typename Strategy> VisibleSelectionTemplate<Strategy> VisibleSelectionTemplate<Strategy>::selectionFromContentsOfNode(Node* node) { - ASSERT(!Strategy::editingIgnoresContent(node)); + DCHECK(!Strategy::editingIgnoresContent(node)); return VisibleSelectionTemplate(PositionTemplate<Strategy>::firstPositionInNode(node), PositionTemplate<Strategy>::lastPositionInNode(node)); } @@ -245,7 +245,7 @@ // On a treasure map, <b>X</b> marks the spot. // ^ selected // - ASSERT(isRange()); + DCHECK(isRange()); return normalizeRange(EphemeralRangeTemplate<Strategy>(m_start, m_end)); } @@ -285,7 +285,7 @@ template <typename Strategy> void VisibleSelectionTemplate<Strategy>::appendTrailingWhitespace() { - ASSERT(m_granularity == WordGranularity); + DCHECK_EQ(m_granularity, WordGranularity); const EphemeralRangeTemplate<Strategy> searchRange = makeSearchRange(end()); if (searchRange.isNull()) return; @@ -336,8 +336,8 @@ template <typename Strategy> void VisibleSelectionTemplate<Strategy>::setStartRespectingGranularity(TextGranularity granularity, EWordSide wordSide) { - ASSERT(m_base.isNotNull()); - ASSERT(m_extent.isNotNull()); + DCHECK(m_base.isNotNull()); + DCHECK(m_extent.isNotNull()); m_start = m_baseIsFirst ? m_base : m_extent; @@ -396,8 +396,8 @@ template <typename Strategy> void VisibleSelectionTemplate<Strategy>::setEndRespectingGranularity(TextGranularity granularity, EWordSide wordSide) { - ASSERT(m_base.isNotNull()); - ASSERT(m_extent.isNotNull()); + DCHECK(m_base.isNotNull()); + DCHECK(m_extent.isNotNull()); m_end = m_baseIsFirst ? m_extent : m_base; @@ -532,9 +532,9 @@ m_start = m_baseIsFirst ? m_base : m_extent; m_end = m_baseIsFirst ? m_extent : m_base; setStartRespectingGranularity(granularity); - ASSERT(m_start.isNotNull()); + DCHECK(m_start.isNotNull()); setEndRespectingGranularity(granularity); - ASSERT(m_end.isNotNull()); + DCHECK(m_end.isNotNull()); adjustSelectionToAvoidCrossingShadowBoundaries(); adjustSelectionToAvoidCrossingEditingBoundaries(); updateSelectionType(); @@ -798,14 +798,14 @@ template <typename Strategy> void VisibleSelectionTemplate<Strategy>::setChangeObserver(VisibleSelectionChangeObserver& observer) { - ASSERT(!m_changeObserver); + DCHECK(!m_changeObserver); m_changeObserver = &observer; } template <typename Strategy> void VisibleSelectionTemplate<Strategy>::clearChangeObserver() { - ASSERT(m_changeObserver); + DCHECK(m_changeObserver); m_changeObserver = nullptr; }
diff --git a/third_party/WebKit/Source/core/editing/VisibleSelectionTest.cpp b/third_party/WebKit/Source/core/editing/VisibleSelectionTest.cpp index 6e01dc5..8203615 100644 --- a/third_party/WebKit/Source/core/editing/VisibleSelectionTest.cpp +++ b/third_party/WebKit/Source/core/editing/VisibleSelectionTest.cpp
@@ -53,7 +53,6 @@ const char* shadowContent = "<p><b id=three>333</b><content select=#two></content><b id=four>4444</b><span id=space> </span><content select=#one></content><b id=five>55555</b></p>"; setBodyContent(bodyContent); ShadowRoot* shadowRoot = setShadowContent(shadowContent, "host"); - updateLayoutAndStyleForPainting(); Node* one = document().getElementById("one")->firstChild(); Node* two = document().getElementById("two")->firstChild();
diff --git a/third_party/WebKit/Source/core/editing/VisibleUnits.cpp b/third_party/WebKit/Source/core/editing/VisibleUnits.cpp index 55153214..4e43fb1 100644 --- a/third_party/WebKit/Source/core/editing/VisibleUnits.cpp +++ b/third_party/WebKit/Source/core/editing/VisibleUnits.cpp
@@ -74,7 +74,7 @@ { if (candidate.isNull()) return PositionType(); - ASSERT(isVisuallyEquivalentCandidate(candidate)); + DCHECK(isVisuallyEquivalentCandidate(candidate)); PositionType upstream = mostBackwardCaretPosition(candidate); if (isVisuallyEquivalentCandidate(upstream)) return upstream; @@ -104,7 +104,7 @@ if (position.isNull()) return PositionType(); - ASSERT(position.document()); + DCHECK(position.document()); position.document()->updateLayoutIgnorePendingStylesheets(); Node* node = position.computeContainerNode(); @@ -726,7 +726,7 @@ // what's available. // TODO(xiaochengh): Do we have to search the whole string? next = searchFunction(string.data(), string.size(), string.size() - suffixLength, DontHaveMoreContext, needMoreContext); - ASSERT(!needMoreContext); + DCHECK(!needMoreContext); } if (!next) @@ -820,7 +820,7 @@ // available. // TODO(xiaochengh): Do we still have to search the whole string? next = searchFunction(string.data(), string.size(), prefixLength, DontHaveMoreContext, needMoreContext); - ASSERT(!needMoreContext); + DCHECK(!needMoreContext); } if (it.atEnd() && next == string.size()) { @@ -853,7 +853,7 @@ static unsigned startWordBoundary(const UChar* characters, unsigned length, unsigned offset, BoundarySearchContextAvailability mayHaveMoreContext, bool& needMoreContext) { TRACE_EVENT0("blink", "startWordBoundary"); - ASSERT(offset); + DCHECK(offset); if (mayHaveMoreContext && !startOfLastWordBoundaryContext(characters, offset)) { needMoreContext = true; return 0; @@ -895,7 +895,7 @@ static unsigned endWordBoundary(const UChar* characters, unsigned length, unsigned offset, BoundarySearchContextAvailability mayHaveMoreContext, bool& needMoreContext) { - ASSERT(offset <= length); + DCHECK_LE(offset, length); if (mayHaveMoreContext && endOfFirstWordBoundaryContext(characters + offset, length - offset) == static_cast<int>(length - offset)) { needMoreContext = true; return length; @@ -1283,7 +1283,7 @@ static inline LayoutPoint absoluteLineDirectionPointToLocalPointInBlock(RootInlineBox* root, LayoutUnit lineDirectionPoint) { - ASSERT(root); + DCHECK(root); LineLayoutBlockFlow containingBlock = root->block(); FloatPoint absoluteBlockPoint = containingBlock.localToAbsolute(FloatPoint()); if (containingBlock.hasOverflowClip()) @@ -2217,13 +2217,13 @@ // "(1)" are first-letter part and "ab" are remaining part. LayoutObject* associatedLayoutObjectOf(const Node& node, int offsetInNode) { - ASSERT(offsetInNode >= 0); + DCHECK_GE(offsetInNode, 0); LayoutObject* layoutObject = node.layoutObject(); if (!node.isTextNode() || !layoutObject || !toLayoutText(layoutObject)->isTextFragment()) return layoutObject; LayoutTextFragment* layoutTextFragment = toLayoutTextFragment(layoutObject); if (!layoutTextFragment->isRemainingTextLayoutObject()) { - ASSERT(static_cast<unsigned>(offsetInNode) <= layoutTextFragment->start() + layoutTextFragment->fragmentLength()); + DCHECK_LE(static_cast<unsigned>(offsetInNode), layoutTextFragment->start() + layoutTextFragment->fragmentLength()); return layoutTextFragment; } if (layoutTextFragment->fragmentLength() && static_cast<unsigned>(offsetInNode) >= layoutTextFragment->start()) @@ -2231,7 +2231,7 @@ LayoutObject* firstLetterLayoutObject = layoutTextFragment->firstLetterPseudoElement()->layoutObject(); // TODO(yosin): We're not sure when |firstLetterLayoutObject| has // multiple child layout object. - ASSERT(firstLetterLayoutObject->slowFirstChild() == firstLetterLayoutObject->slowLastChild()); + DCHECK_EQ(firstLetterLayoutObject->slowFirstChild(), firstLetterLayoutObject->slowLastChild()); return firstLetterLayoutObject->slowFirstChild(); } @@ -2426,12 +2426,12 @@ // of a mix-up between offsets in the text in the DOM tree with text in the // layout tree which can have a different length due to case transformation. // Until we resolve that, disable this so we can run the layout tests! - // ASSERT(currentOffset >= layoutObject->caretMaxOffset()); + // DCHECK_GE(currentOffset, layoutObject->caretMaxOffset()); return PositionTemplate<Strategy>(currentNode, layoutObject->caretMaxOffset() + textStartOffset); } // Map offset in DOM node to offset in InlineBox. - ASSERT(currentPos.offsetInLeafNode() >= static_cast<int>(textStartOffset)); + DCHECK_GE(currentPos.offsetInLeafNode(), static_cast<int>(textStartOffset)); const unsigned textOffset = currentPos.offsetInLeafNode() - textStartOffset; InlineTextBox* lastTextBox = textLayoutObject->lastTextBox(); for (InlineTextBox* box = textLayoutObject->firstTextBox(); box; box = box->nextTextBox()) { @@ -2439,7 +2439,7 @@ if (textLayoutObject->isTextFragment() && toLayoutTextFragment(layoutObject)->isRemainingTextLayoutObject()) { // |currentPos| is at start of remaining text of // |Text| node with :first-letter. - ASSERT(currentPos.offsetInLeafNode() >= 1); + DCHECK_GE(currentPos.offsetInLeafNode(), 1); LayoutObject* firstLetterLayoutObject = toLayoutTextFragment(layoutObject)->firstLetterPseudoElement()->layoutObject(); if (firstLetterLayoutObject && firstLetterLayoutObject->style()->visibility() == VISIBLE) return currentPos.computePosition(); @@ -2568,12 +2568,12 @@ LayoutText* const textLayoutObject = toLayoutText(layoutObject); const unsigned textStartOffset = textLayoutObject->textStartOffset(); if (currentNode != startNode) { - ASSERT(currentPos.atStartOfNode()); + DCHECK(currentPos.atStartOfNode()); return PositionTemplate<Strategy>(currentNode, layoutObject->caretMinOffset() + textStartOffset); } // Map offset in DOM node to offset in InlineBox. - ASSERT(currentPos.offsetInLeafNode() >= static_cast<int>(textStartOffset)); + DCHECK_GE(currentPos.offsetInLeafNode(), static_cast<int>(textStartOffset)); const unsigned textOffset = currentPos.offsetInLeafNode() - textStartOffset; InlineTextBox* lastTextBox = textLayoutObject->lastTextBox(); for (InlineTextBox* box = textLayoutObject->firstTextBox(); box; box = box->nextTextBox()) { @@ -2766,7 +2766,7 @@ // That must mean that |pos| is not editable. Return the next position after // |pos| that is in the same editable region as this position - ASSERT(highestRoot); + DCHECK(highestRoot); return firstEditableVisiblePositionAfterPositionInRoot(pos.deepEquivalent(), *highestRoot); } @@ -2882,7 +2882,7 @@ continue; } - ASSERT(offset == box->caretLeftmostOffset()); + DCHECK_EQ(offset, box->caretLeftmostOffset()); unsigned char level = box->bidiLevel(); InlineBox* prevBox = box->prevLeafChild(); @@ -2965,7 +2965,7 @@ if ((isVisuallyEquivalentCandidate(p) && mostForwardCaretPosition(p) != downstreamStart) || p.atStartOfTree() || p.atEndOfTree()) return p; - ASSERT(p != deepPosition); + DCHECK_NE(p, deepPosition); } } @@ -2978,7 +2978,7 @@ return VisiblePositionTemplate<Strategy>(); const VisiblePositionTemplate<Strategy> left = createVisiblePosition(pos); - ASSERT(left.deepEquivalent() != visiblePosition.deepEquivalent()); + DCHECK_NE(left.deepEquivalent(), visiblePosition.deepEquivalent()); return directionOfEnclosingBlock(left.deepEquivalent()) == LTR ? honorEditingBoundaryAtOrBefore(left, visiblePosition.deepEquivalent()) : honorEditingBoundaryAtOrAfter(left, visiblePosition.deepEquivalent()); } @@ -3057,7 +3057,7 @@ continue; } - ASSERT(offset == box->caretRightmostOffset()); + DCHECK_EQ(offset, box->caretRightmostOffset()); unsigned char level = box->bidiLevel(); InlineBox* nextBox = box->nextLeafChild(); @@ -3143,7 +3143,7 @@ if ((isVisuallyEquivalentCandidate(p) && mostForwardCaretPosition(p) != downstreamStart) || p.atStartOfTree() || p.atEndOfTree()) return p; - ASSERT(p != deepPosition); + DCHECK_NE(p, deepPosition); } } @@ -3156,7 +3156,7 @@ return VisiblePositionTemplate<Strategy>(); const VisiblePositionTemplate<Strategy> right = createVisiblePosition(pos); - ASSERT(right.deepEquivalent() != visiblePosition.deepEquivalent()); + DCHECK_NE(right.deepEquivalent(), visiblePosition.deepEquivalent()); return directionOfEnclosingBlock(right.deepEquivalent()) == LTR ? honorEditingBoundaryAtOrAfter(right, visiblePosition.deepEquivalent()) : honorEditingBoundaryAtOrBefore(right, visiblePosition.deepEquivalent()); } @@ -3218,7 +3218,7 @@ // That must mean that |pos| is not editable. Return the last position // before |pos| that is in the same editable region as this position - ASSERT(highestRoot); + DCHECK(highestRoot); return lastEditableVisiblePositionBeforePositionInRoot(pos.deepEquivalent(), *highestRoot); } @@ -3236,7 +3236,7 @@ // never yield another |TextAffinity::Upstream position| (unless line wrap // length is 0!). const VisiblePositionTemplate<Strategy> prev = createVisiblePosition(pos); - ASSERT(prev.deepEquivalent() != visiblePosition.deepEquivalent()); + DCHECK_NE(prev.deepEquivalent(), visiblePosition.deepEquivalent()); switch (rule) { case CanCrossEditingBoundary:
diff --git a/third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp b/third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp index 670be8ed..4c5d4321 100644 --- a/third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp +++ b/third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp
@@ -53,9 +53,7 @@ const char* bodyContent = "<p id='host'><b id='one'>11</b><b id='two'>22</b></p>"; const char* shadowContent = "<div><content select=#two></content><content select=#one></content></div>"; setBodyContent(bodyContent); - ShadowRoot* shadowRoot = setShadowContent(shadowContent, "host"); - ASSERT_UNUSED(shadowRoot, shadowRoot); - updateLayoutAndStyleForPainting(); + setShadowContent(shadowContent, "host"); Element* body = document().body(); Element* one = body->querySelector("#one", ASSERT_NO_EXCEPTION); @@ -71,7 +69,6 @@ { const char* bodyContent = "<style>p:first-letter {color:red;}</style><p id=sample>(a)bc</p>"; setBodyContent(bodyContent); - updateLayoutAndStyleForPainting(); Node* sample = document().getElementById("sample"); Node* text = sample->firstChild(); @@ -93,13 +90,12 @@ { const char* bodyContent = "<style>p:first-letter {color:red;}</style><p id=sample>abc</p>"; setBodyContent(bodyContent); - updateLayoutAndStyleForPainting(); Node* sample = document().getElementById("sample"); Node* firstLetter = sample->firstChild(); // Split "abc" into "a" "bc" toText(firstLetter)->splitText(1, ASSERT_NO_EXCEPTION); - updateLayoutAndStyleForPainting(); + updateAllLifecyclePhases(); LayoutTextFragment* layoutObject0 = toLayoutTextFragment(associatedLayoutObjectOf(*firstLetter, 0)); EXPECT_FALSE(layoutObject0->isRemainingTextLayoutObject()); @@ -112,7 +108,6 @@ { const char* bodyContent = "<style>div:first-letter {color:red;}</style><div id=sample>a\n <div></div></div>"; setBodyContent(bodyContent); - updateLayoutAndStyleForPainting(); Node* sample = document().getElementById("sample"); Node* text = sample->firstChild(); @@ -153,7 +148,6 @@ const char* shadowContent = "<b id='four'>4444</b><content select=#two></content><content select=#one></content><b id='five'>5555</b>"; setBodyContent(bodyContent); setShadowContent(shadowContent, "host"); - updateLayoutAndStyleForPainting(); Element* one = document().getElementById("one"); Element* two = document().getElementById("two"); @@ -180,7 +174,7 @@ html->appendChild(three); html->appendChild(four); one->appendChild(html); - updateLayoutAndStyleForPainting(); + updateAllLifecyclePhases(); EXPECT_EQ(Position(), canonicalPositionOf(Position(document().documentElement(), 0))); @@ -204,7 +198,6 @@ const char* shadowContent = "<b id=four>4444</b><content select=#two></content><content select=#one></content><b id=five>5555</b>"; setBodyContent(bodyContent); ShadowRoot* shadowRoot = setShadowContent(shadowContent, "host"); - updateLayoutAndStyleForPainting(); Node* one = document().getElementById("one")->firstChild(); Node* two = document().getElementById("two")->firstChild(); @@ -229,7 +222,6 @@ const char* shadowContent = "<b id=four>4444</b><content select=#two></content><content select=#one></content><b id=five>5555</b>"; setBodyContent(bodyContent); ShadowRoot* shadowRoot = setShadowContent(shadowContent, "host"); - updateLayoutAndStyleForPainting(); Node* one = document().getElementById("one")->firstChild(); Node* two = document().getElementById("two")->firstChild(); @@ -260,7 +252,6 @@ const char* shadowContent = "<p><content select=#two></content></p><p><content select=#one></content></p>"; setBodyContent(bodyContent); setShadowContent(shadowContent, "host"); - updateLayoutAndStyleForPainting(); Element* one = document().getElementById("one"); Element* two = document().getElementById("two"); @@ -278,7 +269,6 @@ const char* shadowContent = "<div><u id=five>55555</u><content select=#two></content><br><u id=six>666666</u><br><content select=#one></content><u id=seven>7777777</u></div>"; setBodyContent(bodyContent); ShadowRoot* shadowRoot = setShadowContent(shadowContent, "host"); - updateLayoutAndStyleForPainting(); Node* one = document().getElementById("one")->firstChild(); Node* two = document().getElementById("two")->firstChild(); @@ -321,7 +311,6 @@ TEST_F(VisibleUnitsTest, endOfParagraphFirstLetter) { setBodyContent("<style>div::first-letter { color: red }</style><div id=sample>1ab\nde</div>"); - updateLayoutAndStyleForPainting(); Node* sample = document().getElementById("sample"); Node* text = sample->firstChild(); @@ -338,7 +327,6 @@ TEST_F(VisibleUnitsTest, endOfParagraphFirstLetterPre) { setBodyContent("<style>pre::first-letter { color: red }</style><pre id=sample>1ab\nde</pre>"); - updateLayoutAndStyleForPainting(); Node* sample = document().getElementById("sample"); Node* text = sample->firstChild(); @@ -358,7 +346,6 @@ const char* shadowContent = "<p><content select=#two></content></p><p><content select=#one></content></p>"; setBodyContent(bodyContent); setShadowContent(shadowContent, "host"); - updateLayoutAndStyleForPainting(); Element* one = document().getElementById("one"); Element* two = document().getElementById("two"); @@ -374,7 +361,6 @@ TEST_F(VisibleUnitsTest, endOfParagraphSimple) { setBodyContent("<div id=sample>1ab\nde</div>"); - updateLayoutAndStyleForPainting(); Node* sample = document().getElementById("sample"); Node* text = sample->firstChild(); @@ -391,7 +377,6 @@ TEST_F(VisibleUnitsTest, endOfParagraphSimplePre) { setBodyContent("<pre id=sample>1ab\nde</pre>"); - updateLayoutAndStyleForPainting(); Node* sample = document().getElementById("sample"); Node* text = sample->firstChild(); @@ -412,7 +397,6 @@ setBodyContent(bodyContent); setShadowContent(shadowContent, "host"); ShadowRoot* shadowRoot = setShadowContent(shadowContent, "host"); - updateLayoutAndStyleForPainting(); Node* one = document().getElementById("one")->firstChild(); Node* two = document().getElementById("two")->firstChild(); @@ -444,7 +428,6 @@ const char* shadowContent = "<p><u id=four>44444</u><content select=#two></content><span id=space> </span><content select=#one></content><u id=five>55555</u></p>"; setBodyContent(bodyContent); ShadowRoot* shadowRoot = setShadowContent(shadowContent, "host"); - updateLayoutAndStyleForPainting(); Node* one = document().getElementById("one")->firstChild(); Node* two = document().getElementById("two")->firstChild(); @@ -480,7 +463,6 @@ const char* shadowContent = "<content select=#two></content></p><p><content select=#one></content>"; setBodyContent(bodyContent); setShadowContent(shadowContent, "host"); - updateLayoutAndStyleForPainting(); Element* one = document().getElementById("one"); Element* two = document().getElementById("two"); @@ -496,7 +478,6 @@ { const char* bodyContent = "<input id=sample value=ab>cde"; setBodyContent(bodyContent); - updateLayoutAndStyleForPainting(); Node* text = toHTMLTextFormControlElement(document().getElementById("sample"))->innerEditorElement()->firstChild(); @@ -516,7 +497,6 @@ const char* shadowContent = "<div><u id=five>55555</u><content select=#two></content><br><u id=six>666666</u><br><content select=#one></content><u id=seven>7777777</u></div>"; setBodyContent(bodyContent); ShadowRoot* shadowRoot = setShadowContent(shadowContent, "host"); - updateLayoutAndStyleForPainting(); Node* one = document().getElementById("one")->firstChild(); Node* two = document().getElementById("two")->firstChild(); @@ -557,7 +537,6 @@ const char* shadowContent = "<div><u id=five>55555</u><content select=#two></content><br><u id=six>666666</u><br><content select=#one></content><u id=seven>7777777</u></div>"; setBodyContent(bodyContent); ShadowRoot* shadowRoot = setShadowContent(shadowContent, "host"); - updateLayoutAndStyleForPainting(); Node* one = document().getElementById("one")->firstChild(); Node* two = document().getElementById("two")->firstChild(); @@ -598,7 +577,6 @@ const char* shadowContent = "<div><span id='s4'>44</span><content select=#two></content><br><span id='s5'>55</span><br><content select=#one></content><span id='s6'>66</span></div>"; setBodyContent(bodyContent); ShadowRoot* shadowRoot = setShadowContent(shadowContent, "host"); - updateLayoutAndStyleForPainting(); Element* body = document().body(); Element* one = body->querySelector("#one", ASSERT_NO_EXCEPTION); @@ -633,7 +611,6 @@ const char* shadowContent = "<p><content select=#two></content></p><p><content select=#one></content></p>"; setBodyContent(bodyContent); setShadowContent(shadowContent, "host"); - updateLayoutAndStyleForPainting(); Node* one = document().getElementById("one")->firstChild(); Node* two = document().getElementById("two")->firstChild(); @@ -661,7 +638,6 @@ const char* shadowContent = "<div><u id=five>55555</u><content select=#two></content><br><u id=six>666666</u><br><content select=#one></content><u id=seven>7777777</u></div>"; setBodyContent(bodyContent); ShadowRoot* shadowRoot = setShadowContent(shadowContent, "host"); - updateLayoutAndStyleForPainting(); Node* one = document().getElementById("one")->firstChild(); Node* two = document().getElementById("two")->firstChild(); @@ -702,7 +678,6 @@ const char* shadowContent = "<p><content select=#two></content></p><p><content select=#one></content></p>"; setBodyContent(bodyContent); setShadowContent(shadowContent, "host"); - updateLayoutAndStyleForPainting(); Node* zero = document().getElementById("zero")->firstChild(); Node* one = document().getElementById("one")->firstChild(); @@ -740,7 +715,7 @@ html->appendChild(three); html->appendChild(four); one->appendChild(html); - updateLayoutAndStyleForPainting(); + updateAllLifecyclePhases(); EXPECT_FALSE(isVisuallyEquivalentCandidate(Position(document().documentElement(), 0))); @@ -760,7 +735,7 @@ TEST_F(VisibleUnitsTest, isVisuallyEquivalentCandidateWithDocument) { - updateLayoutAndStyleForPainting(); + updateAllLifecyclePhases(); EXPECT_FALSE(isVisuallyEquivalentCandidate(Position(&document(), 0))); } @@ -771,7 +746,6 @@ const char* shadowContent = "<b id=four>4444</b><content select=#two></content><content select=#one></content><b id=five>55555</b>"; setBodyContent(bodyContent); ShadowRoot* shadowRoot = setShadowContent(shadowContent, "host"); - updateLayoutAndStyleForPainting(); Element* one = document().getElementById("one"); Element* two = document().getElementById("two"); @@ -795,7 +769,6 @@ const char* shadowContent = "<b id='two'>22</b><content select=#one></content><b id='three'>333</b>"; setBodyContent(bodyContent); setShadowContent(shadowContent, "host"); - updateLayoutAndStyleForPainting(); Element* one = document().getElementById("one"); @@ -817,7 +790,6 @@ const char* shadowContent = "<div><u id=five>55555</u><content select=#two></content><br><u id=six>666666</u><br><content select=#one></content><u id=seven>7777777</u></div>"; setBodyContent(bodyContent); ShadowRoot* shadowRoot = setShadowContent(shadowContent, "host"); - updateLayoutAndStyleForPainting(); Node* one = document().getElementById("one")->firstChild(); Node* two = document().getElementById("two")->firstChild(); @@ -863,7 +835,6 @@ const char* shadowContent = "<div><u id=five>55555</u><content select=#two></content><br><u id=six>666666</u><br><content select=#one></content><u id=seven>7777777</u></div>"; setBodyContent(bodyContent); ShadowRoot* shadowRoot = setShadowContent(shadowContent, "host"); - updateLayoutAndStyleForPainting(); Node* one = document().getElementById("one")->firstChild(); Node* two = document().getElementById("two")->firstChild(); @@ -909,7 +880,6 @@ const char* shadowContent = "<b id='two'>22</b><content select=#one></content><b id='three'>333</b>"; setBodyContent(bodyContent); setShadowContent(shadowContent, "host"); - updateLayoutAndStyleForPainting(); Element* host = document().getElementById("host"); @@ -922,7 +892,6 @@ // Note: first-letter pseudo element contains letter and punctuations. const char* bodyContent = "<style>p:first-letter {color:red;}</style><p id=sample> (2)45 </p>"; setBodyContent(bodyContent); - updateLayoutAndStyleForPainting(); Node* sample = document().getElementById("sample")->firstChild(); @@ -943,13 +912,12 @@ { const char* bodyContent = "<style>p:first-letter {color:red;}</style><p id=sample>abc</p>"; setBodyContent(bodyContent); - updateLayoutAndStyleForPainting(); Node* sample = document().getElementById("sample"); Node* firstLetter = sample->firstChild(); // Split "abc" into "a" "bc" Text* remaining = toText(firstLetter)->splitText(1, ASSERT_NO_EXCEPTION); - updateLayoutAndStyleForPainting(); + updateAllLifecyclePhases(); EXPECT_EQ(Position(sample, 0), mostBackwardCaretPosition(Position(firstLetter, 0))); EXPECT_EQ(Position(firstLetter, 1), mostBackwardCaretPosition(Position(firstLetter, 1))); @@ -966,7 +934,7 @@ const char* shadowContent = "<b id='two'>22</b><content select=#one></content><b id='three'>333</b>"; setBodyContent(bodyContent); ShadowRoot* shadowRoot = setShadowContent(shadowContent, "host"); - updateLayoutAndStyleForPainting(); + updateAllLifecyclePhases(); Element* host = document().getElementById("host"); Element* one = document().getElementById("one"); @@ -981,7 +949,6 @@ // Note: first-letter pseudo element contains letter and punctuations. const char* bodyContent = "<style>p:first-letter {color:red;}</style><p id=sample> (2)45 </p>"; setBodyContent(bodyContent); - updateLayoutAndStyleForPainting(); Node* sample = document().getElementById("sample")->firstChild(); @@ -1004,7 +971,6 @@ const char* shadowContent = "<b id=four>4444</b><content select=#two></content><content select=#one></content><b id=five>55555</b>"; setBodyContent(bodyContent); ShadowRoot* shadowRoot = setShadowContent(shadowContent, "host"); - updateLayoutAndStyleForPainting(); Element* zero = document().getElementById("zero"); Element* one = document().getElementById("one"); @@ -1032,7 +998,6 @@ const char* shadowContent = "<b id=four>4444</b><content select=#two></content><content select=#one></content><b id=five>55555</b>"; setBodyContent(bodyContent); ShadowRoot* shadowRoot = setShadowContent(shadowContent, "host"); - updateLayoutAndStyleForPainting(); Node* zero = document().getElementById("zero")->firstChild(); Node* one = document().getElementById("one")->firstChild(); @@ -1087,7 +1052,6 @@ { const char* bodyContent = "<p id='sample'>00</p>"; setBodyContent(bodyContent); - updateLayoutAndStyleForPainting(); Element* sample = document().getElementById("sample"); EXPECT_FALSE(rendersInDifferentPosition(Position(), Position())); @@ -1101,7 +1065,6 @@ { const char* bodyContent = "<p><span id=one>11</span><span id=two style='display:none'> </span></p>"; setBodyContent(bodyContent); - updateLayoutAndStyleForPainting(); Element* one = document().getElementById("one"); Element* two = document().getElementById("two"); @@ -1113,7 +1076,6 @@ { const char* bodyContent = "<p><span id=one>11</span><span id=two> </span></p>"; setBodyContent(bodyContent); - updateLayoutAndStyleForPainting(); Element* one = document().getElementById("one"); Element* two = document().getElementById("two"); @@ -1126,7 +1088,6 @@ { const char* bodyContent = "<div contenteditable><span id='sample1'>1</span><span id='sample2'>22</span></div>"; setBodyContent(bodyContent); - updateLayoutAndStyleForPainting(); Element* sample1 = document().getElementById("sample1"); Element* sample2 = document().getElementById("sample2"); @@ -1140,7 +1101,6 @@ const char* shadowContent = "<p id=four>4444</p><content select=#two></content><content select=#one></content><p id=five>55555</p>"; setBodyContent(bodyContent); ShadowRoot* shadowRoot = setShadowContent(shadowContent, "host"); - updateLayoutAndStyleForPainting(); Node* one = document().getElementById("one")->firstChild(); Node* two = document().getElementById("two")->firstChild(); @@ -1167,7 +1127,6 @@ const char* shadowContent = "<p><content select=#two></content></p><p><content select=#one></content></p>"; setBodyContent(bodyContent); setShadowContent(shadowContent, "host"); - updateLayoutAndStyleForPainting(); Node* one = document().getElementById("one")->firstChild(); Node* two = document().getElementById("two")->firstChild(); @@ -1185,7 +1144,6 @@ const char* shadowContent = "<div><u id=five>55555</u><content select=#two></content><br><u id=six>666666</u><br><content select=#one></content><u id=seven>7777777</u></div>"; setBodyContent(bodyContent); ShadowRoot* shadowRoot = setShadowContent(shadowContent, "host"); - updateLayoutAndStyleForPainting(); Node* one = document().getElementById("one")->firstChild(); Node* two = document().getElementById("two")->firstChild(); @@ -1231,7 +1189,6 @@ const char* shadowContent = "<p><content select=#two></content></p><p><content select=#one></content></p>"; setBodyContent(bodyContent); setShadowContent(shadowContent, "host"); - updateLayoutAndStyleForPainting(); Node* zero = document().getElementById("zero")->firstChild(); Node* one = document().getElementById("one")->firstChild(); @@ -1255,12 +1212,12 @@ root->setInnerHTML("<style>* { display:inline-table; }</style><body contenteditable=true><svg><svg><foreignObject>abc<svg></svg></foreignObject></svg></svg></body>", ASSERT_NO_EXCEPTION); Element* oldBody = document().body(); root->setInnerHTML("<body contenteditable=true><svg><foreignObject><style>def</style>", ASSERT_NO_EXCEPTION); - ASSERT(oldBody != document().body()); + DCHECK_NE(oldBody, document().body()); Node* foreignObject = document().body()->firstChild()->firstChild(); foreignObject->insertBefore(oldBody, foreignObject->firstChild()); Node* styleText = foreignObject->lastChild()->firstChild(); - ASSERT(styleText->isTextNode()); - updateLayoutAndStyleForPainting(); + DCHECK(styleText->isTextNode()) << styleText; + updateAllLifecyclePhases(); EXPECT_FALSE(startOfParagraph(createVisiblePosition(Position(styleText, 0))).isNull()); } @@ -1271,7 +1228,6 @@ const char* shadowContent = "<p><i id=three>333</i> <content select=#two></content> <content select=#one></content> <i id=four>4444</i></p>"; setBodyContent(bodyContent); ShadowRoot* shadowRoot = setShadowContent(shadowContent, "host"); - updateLayoutAndStyleForPainting(); Node* one = document().getElementById("one")->firstChild(); Node* two = document().getElementById("two")->firstChild(); @@ -1303,7 +1259,6 @@ const char* shadowContent = "<p><u id=four>44444</u><content select=#two></content><span id=space> </span><content select=#one></content><u id=five>55555</u></p>"; setBodyContent(bodyContent); ShadowRoot* shadowRoot = setShadowContent(shadowContent, "host"); - updateLayoutAndStyleForPainting(); Node* one = document().getElementById("one")->firstChild(); Node* two = document().getElementById("two")->firstChild(); @@ -1339,7 +1294,6 @@ // Repro case of crbug.com/582247 const char* bodyContent = "<button> </button><script>document.designMode = 'on'</script>"; setBodyContent(bodyContent); - updateLayoutAndStyleForPainting(); Node* button = document().querySelector("button", ASSERT_NO_EXCEPTION); EXPECT_TRUE(endsOfNodeAreVisuallyDistinctPositions(button)); @@ -1350,7 +1304,6 @@ // Repro case of crbug.com/584030 const char* bodyContent = "<button><rt><script>document.designMode = 'on'</script></rt></button>"; setBodyContent(bodyContent); - updateLayoutAndStyleForPainting(); Node* button = document().querySelector("button", ASSERT_NO_EXCEPTION); EXPECT_TRUE(endsOfNodeAreVisuallyDistinctPositions(button));
diff --git a/third_party/WebKit/Source/core/editing/commands/AppendNodeCommand.cpp b/third_party/WebKit/Source/core/editing/commands/AppendNodeCommand.cpp index ebcab4b..5750eb6 100644 --- a/third_party/WebKit/Source/core/editing/commands/AppendNodeCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/AppendNodeCommand.cpp
@@ -34,11 +34,11 @@ , m_parent(parent) , m_node(node) { - ASSERT(m_parent); - ASSERT(m_node); - ASSERT(!m_node->parentNode()); + DCHECK(m_parent); + DCHECK(m_node); + DCHECK(!m_node->parentNode()) << m_node; - ASSERT(m_parent->hasEditableStyle() || !m_parent->inActiveDocument()); + DCHECK(m_parent->hasEditableStyle() || !m_parent->inActiveDocument()) << m_parent; } void AppendNodeCommand::doApply(EditingState*)
diff --git a/third_party/WebKit/Source/core/editing/commands/ApplyBlockElementCommand.cpp b/third_party/WebKit/Source/core/editing/commands/ApplyBlockElementCommand.cpp index 994072e5..1d459559 100644 --- a/third_party/WebKit/Source/core/editing/commands/ApplyBlockElementCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/ApplyBlockElementCommand.cpp
@@ -83,8 +83,8 @@ VisibleSelection selection = selectionForParagraphIteration(endingSelection()); VisiblePosition startOfSelection = selection.visibleStart(); VisiblePosition endOfSelection = selection.visibleEnd(); - ASSERT(!startOfSelection.isNull()); - ASSERT(!endOfSelection.isNull()); + DCHECK(!startOfSelection.isNull()); + DCHECK(!endOfSelection.isNull()); ContainerNode* startScope = nullptr; int startIndex = indexForVisiblePosition(startOfSelection, startScope); ContainerNode* endScope = nullptr; @@ -96,9 +96,9 @@ document().updateLayoutIgnorePendingStylesheets(); - ASSERT(startScope == endScope); - ASSERT(startIndex >= 0); - ASSERT(startIndex <= endIndex); + DCHECK_EQ(startScope, endScope); + DCHECK_GE(startIndex, 0); + DCHECK_LE(startIndex, endIndex); if (startScope == endScope && startIndex >= 0 && startIndex <= endIndex) { VisiblePosition start(visiblePositionForIndex(startIndex, startScope)); VisiblePosition end(visiblePositionForIndex(endIndex, endScope)); @@ -212,11 +212,11 @@ splitTextNode(startText, startOffset); start = firstPositionInNode(startText); if (isStartAndEndOnSameNode) { - ASSERT(end.offsetInContainerNode() >= startOffset); + DCHECK_GE(end.offsetInContainerNode(), startOffset); end = Position(startText, end.offsetInContainerNode() - startOffset); } if (isStartAndEndOfLastParagraphOnSameNode) { - ASSERT(m_endOfLastParagraph.offsetInContainerNode() >= startOffset); + DCHECK_GE(m_endOfLastParagraph.offsetInContainerNode(), startOffset); m_endOfLastParagraph = Position(startText, m_endOfLastParagraph.offsetInContainerNode() - startOffset); } } @@ -272,11 +272,11 @@ splitTextNode(text, 1); if (text == start.computeContainerNode() && text->previousSibling() && text->previousSibling()->isTextNode()) { - ASSERT(start.offsetInContainerNode() < position.offsetInContainerNode()); + DCHECK_LT(start.offsetInContainerNode(), position.offsetInContainerNode()); start = Position(toText(text->previousSibling()), start.offsetInContainerNode()); } if (text == end.computeContainerNode() && text->previousSibling() && text->previousSibling()->isTextNode()) { - ASSERT(end.offsetInContainerNode() < position.offsetInContainerNode()); + DCHECK_LT(end.offsetInContainerNode(), position.offsetInContainerNode()); end = Position(toText(text->previousSibling()), end.offsetInContainerNode()); } if (text == m_endOfLastParagraph.computeContainerNode()) {
diff --git a/third_party/WebKit/Source/core/editing/commands/ApplyStyleCommand.cpp b/third_party/WebKit/Source/core/editing/commands/ApplyStyleCommand.cpp index fd87f70b..a6d76811 100644 --- a/third_party/WebKit/Source/core/editing/commands/ApplyStyleCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/ApplyStyleCommand.cpp
@@ -86,7 +86,7 @@ || !element->inlineStyle() || element->inlineStyle()->isEmpty())) matchedAttributes++; - ASSERT(matchedAttributes <= attributes.size()); + DCHECK_LE(matchedAttributes, attributes.size()); return matchedAttributes == attributes.size(); } @@ -170,7 +170,7 @@ void ApplyStyleCommand::updateStartEnd(const Position& newStart, const Position& newEnd) { - ASSERT(comparePositions(newEnd, newStart) >= 0); + DCHECK_GE(comparePositions(newEnd, newStart), 0); if (!m_useEndingSelection && (newStart != m_start || newEnd != m_end)) m_useEndingSelection = true; @@ -359,8 +359,8 @@ // If the end node is before the start node (can only happen if the end node is // an ancestor of the start node), we gather nodes up to the next sibling of the end node Node* beyondEnd; - ASSERT(start.anchorNode()); - ASSERT(end.anchorNode()); + DCHECK(start.anchorNode()); + DCHECK(end.anchorNode()); if (start.anchorNode()->isDescendantOf(end.anchorNode())) beyondEnd = NodeTraversal::nextSkippingChildren(*end.anchorNode()); else @@ -368,7 +368,7 @@ start = mostBackwardCaretPosition(start); // Move upstream to ensure we do not add redundant spans. Node* startNode = start.anchorNode(); - ASSERT(startNode); + DCHECK(startNode); // Make sure we're not already at the end or the next NodeTraversal::next() will traverse // past it. @@ -386,7 +386,7 @@ // This ensures that changes to one node won't effect another. HeapHashMap<Member<Node>, float> startingFontSizes; for (Node* node = startNode; node != beyondEnd; node = NodeTraversal::next(*node)) { - ASSERT(node); + DCHECK(node); startingFontSizes.set(node, computedFontSize(node)); } @@ -395,7 +395,7 @@ Node* lastStyledNode = nullptr; for (Node* node = startNode; node != beyondEnd; node = NodeTraversal::next(*node)) { - ASSERT(node); + DCHECK(node); HTMLElement* element = nullptr; if (node->isHTMLElement()) { // Only work on fully selected nodes. @@ -703,7 +703,8 @@ if (embeddingStartElement || embeddingEndElement) { Position embeddingApplyStart = embeddingStartElement ? positionInParentAfterNode(*embeddingStartElement) : start; Position embeddingApplyEnd = embeddingEndElement ? positionInParentBeforeNode(*embeddingEndElement) : end; - ASSERT(embeddingApplyStart.isNotNull() && embeddingApplyEnd.isNotNull()); + DCHECK(embeddingApplyStart.isNotNull()); + DCHECK(embeddingApplyEnd.isNotNull()); if (!embeddingStyle) { styleWithoutEmbedding = style->copy(); @@ -732,7 +733,7 @@ void ApplyStyleCommand::fixRangeAndApplyInlineStyle(EditingStyle* style, const Position& start, const Position& end, EditingState* editingState) { Node* startNode = start.anchorNode(); - ASSERT(startNode); + DCHECK(startNode); if (start.computeEditingOffset() >= caretMaxOffset(start.anchorNode())) { startNode = NodeTraversal::next(*startNode); @@ -784,7 +785,7 @@ , end(end) , pastEndNode(pastEndNode) { - ASSERT(start->parentNode() == end->parentNode()); + DCHECK_EQ(start->parentNode(), end->parentNode()); } bool startAndEndAreStillInDocument() @@ -868,7 +869,7 @@ runEnd = sibling; sibling = runEnd->nextSibling(); } - ASSERT(runEnd); + DCHECK(runEnd); next = NodeTraversal::nextSkippingChildren(*runEnd); Node* pastEndNode = NodeTraversal::nextSkippingChildren(*runEnd); @@ -918,7 +919,8 @@ bool ApplyStyleCommand::shouldApplyInlineStyleToRun(EditingStyle* style, Node* runStart, Node* pastEndNode) { - ASSERT(style && runStart); + DCHECK(style); + DCHECK(runStart); for (Node* node = runStart; node && node != pastEndNode; node = NodeTraversal::next(*node)) { if (node->hasChildren()) @@ -934,11 +936,12 @@ void ApplyStyleCommand::removeConflictingInlineStyleFromRun(EditingStyle* style, Member<Node>& runStart, Member<Node>& runEnd, Node* pastEndNode, EditingState* editingState) { - ASSERT(runStart && runEnd); + DCHECK(runStart); + DCHECK(runEnd); Node* next = runStart; for (Node* node = next; node && node->inShadowIncludingDocument() && node != pastEndNode; node = next) { if (editingIgnoresContent(node)) { - ASSERT(!node->contains(pastEndNode)); + DCHECK(!node->contains(pastEndNode)) << node << " " << pastEndNode; next = NodeTraversal::nextSkippingChildren(*node); } else { next = NodeTraversal::next(*node); @@ -965,7 +968,7 @@ bool ApplyStyleCommand::removeInlineStyleFromElement(EditingStyle* style, HTMLElement* element, EditingState* editingState, InlineStyleRemovalMode mode, EditingStyle* extractedStyle) { - ASSERT(element); + DCHECK(element); if (!element->parentNode() || !element->parentNode()->isContentEditable(Node::UserSelectAllIsAlwaysNonEditable)) return false; @@ -1008,13 +1011,13 @@ bool ApplyStyleCommand::removeImplicitlyStyledElement(EditingStyle* style, HTMLElement* element, InlineStyleRemovalMode mode, EditingStyle* extractedStyle, EditingState* editingState) { - ASSERT(style); + DCHECK(style); if (mode == RemoveNone) { - ASSERT(!extractedStyle); + DCHECK(!extractedStyle); return style->conflictsWithImplicitStyleOfElement(element) || style->conflictsWithImplicitStyleOfAttributes(element); } - ASSERT(mode == RemoveIfNeeded || mode == RemoveAlways); + DCHECK(mode == RemoveIfNeeded || mode == RemoveAlways); if (style->conflictsWithImplicitStyleOfElement(element, extractedStyle, mode == RemoveAlways ? EditingStyle::ExtractMatchingStyle : EditingStyle::DoNotExtractMatchingStyle)) { replaceWithSpanOrRemoveIfWithoutAttributes(element, editingState); if (editingState->isAborted()) @@ -1042,8 +1045,8 @@ bool ApplyStyleCommand::removeCSSStyle(EditingStyle* style, HTMLElement* element, EditingState* editingState, InlineStyleRemovalMode mode, EditingStyle* extractedStyle) { - ASSERT(style); - ASSERT(element); + DCHECK(style); + DCHECK(element); if (mode == RemoveNone) return style->conflictsWithInlineStyleOfElement(element); @@ -1084,7 +1087,7 @@ void ApplyStyleCommand::applyInlineStyleToPushDown(Node* node, EditingStyle* style, EditingState* editingState) { - ASSERT(node); + DCHECK(node); node->document().updateLayoutTree(); @@ -1178,11 +1181,11 @@ void ApplyStyleCommand::removeInlineStyle(EditingStyle* style, const Position &start, const Position &end, EditingState* editingState) { - ASSERT(start.isNotNull()); - ASSERT(end.isNotNull()); - ASSERT(start.inShadowIncludingDocument()); - ASSERT(end.inShadowIncludingDocument()); - ASSERT(Position::commonAncestorTreeScope(start, end)); + DCHECK(start.isNotNull()); + DCHECK(end.isNotNull()); + DCHECK(start.inShadowIncludingDocument()) << start; + DCHECK(end.inShadowIncludingDocument()) << end; + DCHECK(Position::commonAncestorTreeScope(start, end)) << start << " " << end; DCHECK_LE(start, end); // FIXME: We should assert that start/end are not in the middle of a text node. @@ -1225,7 +1228,7 @@ while (node) { Node* next = nullptr; if (editingIgnoresContent(node)) { - ASSERT(node == end.anchorNode() || !node->contains(end.anchorNode())); + DCHECK(node == end.anchorNode() || !node->contains(end.anchorNode())) << node << " " << end; next = NodeTraversal::nextSkippingChildren(*node); } else { next = NodeTraversal::next(*node); @@ -1248,14 +1251,14 @@ if (s.anchorNode() == elem) { // Since elem must have been fully selected, and it is at the start // of the selection, it is clear we can set the new s offset to 0. - ASSERT(s.isBeforeAnchor() || s.isBeforeChildren() || s.offsetInContainerNode() <= 0); + DCHECK(s.isBeforeAnchor() || s.isBeforeChildren() || s.offsetInContainerNode() <= 0) << s; s = firstPositionInOrBeforeNode(next); } if (e.anchorNode() == elem) { // Since elem must have been fully selected, and it is at the end // of the selection, it is clear we can set the new e offset to // the max range offset of prev. - ASSERT(s.isAfterAnchor() || !offsetIsBeforeLastNodeOffset(s.offsetInContainerNode(), s.computeContainerNode())); + DCHECK(s.isAfterAnchor() || !offsetIsBeforeLastNodeOffset(s.offsetInContainerNode(), s.computeContainerNode())) << s; e = lastPositionInOrAfterNode(prev); } } @@ -1287,7 +1290,7 @@ void ApplyStyleCommand::splitTextAtStart(const Position& start, const Position& end) { - ASSERT(start.computeContainerNode()->isTextNode()); + DCHECK(start.computeContainerNode()->isTextNode()) << start; Position newEnd; if (end.isOffsetInAnchor() && start.computeContainerNode() == end.computeContainerNode()) @@ -1302,7 +1305,7 @@ void ApplyStyleCommand::splitTextAtEnd(const Position& start, const Position& end) { - ASSERT(end.computeContainerNode()->isTextNode()); + DCHECK(end.computeContainerNode()->isTextNode()) << end; bool shouldUpdateStart = start.isOffsetInAnchor() && start.computeContainerNode() == end.computeContainerNode(); Text* text = toText(end.anchorNode()); @@ -1318,7 +1321,7 @@ void ApplyStyleCommand::splitTextElementAtStart(const Position& start, const Position& end) { - ASSERT(start.computeContainerNode()->isTextNode()); + DCHECK(start.computeContainerNode()->isTextNode()) << start; Position newEnd; if (start.computeContainerNode() == end.computeContainerNode()) @@ -1332,7 +1335,7 @@ void ApplyStyleCommand::splitTextElementAtEnd(const Position& start, const Position& end) { - ASSERT(end.computeContainerNode()->isTextNode()); + DCHECK(end.computeContainerNode()->isTextNode()) << end; bool shouldUpdateStart = start.computeContainerNode() == end.computeContainerNode(); splitTextNodeContainingElement(toText(end.computeContainerNode()), end.offsetInContainerNode()); @@ -1358,7 +1361,7 @@ bool ApplyStyleCommand::isValidCaretPositionInTextNode(const Position& position) { - ASSERT(position.isNotNull()); + DCHECK(position.isNotNull()); Node* node = position.computeContainerNode(); if (!position.isOffsetInAnchor() || !node->isTextNode()) @@ -1392,7 +1395,7 @@ Element* previousElement = toElement(previousSibling); Element* element = toElement(startNode); Node* startChild = element->firstChild(); - ASSERT(startChild); + DCHECK(startChild); mergeIdenticalElements(previousElement, element, editingState); if (editingState->isAborted()) return false; @@ -1447,9 +1450,9 @@ void ApplyStyleCommand::surroundNodeRangeWithElement(Node* passedStartNode, Node* endNode, Element* elementToInsert, EditingState* editingState) { - ASSERT(passedStartNode); - ASSERT(endNode); - ASSERT(elementToInsert); + DCHECK(passedStartNode); + DCHECK(endNode); + DCHECK(elementToInsert); Node* node = passedStartNode; Element* element = elementToInsert; @@ -1552,8 +1555,8 @@ { Node* startNode = passedStart; Node* endNode = passedEnd; - ASSERT(startNode->inShadowIncludingDocument()); - ASSERT(endNode->inShadowIncludingDocument()); + DCHECK(startNode->inShadowIncludingDocument()) << startNode; + DCHECK(endNode->inShadowIncludingDocument()) << endNode; // Find appropriate font and span elements top-down. HTMLFontElement* fontContainer = nullptr; @@ -1669,7 +1672,8 @@ if (!value) return 0; - ASSERT(value->typeWithCalcResolved() == CSSPrimitiveValue::UnitType::Pixels); + // TODO(yosin): We should have printer for |CSSPrimitiveValue::UnitType|. + DCHECK(value->typeWithCalcResolved() == CSSPrimitiveValue::UnitType::Pixels); return value->getFloatValue(); }
diff --git a/third_party/WebKit/Source/core/editing/commands/BreakBlockquoteCommand.cpp b/third_party/WebKit/Source/core/editing/commands/BreakBlockquoteCommand.cpp index 12684a22..cdd4fbd 100644 --- a/third_party/WebKit/Source/core/editing/commands/BreakBlockquoteCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/BreakBlockquoteCommand.cpp
@@ -87,7 +87,7 @@ // This is a scenario that should never happen, but we want to // make sure we don't dereference a null pointer below. - ASSERT(!endingSelection().isNone()); + DCHECK(!endingSelection().isNone()); if (endingSelection().isNone()) return; @@ -143,7 +143,7 @@ // startNode is the first node that we need to move to the new blockquote. Node* startNode = pos.anchorNode(); - ASSERT(startNode); + DCHECK(startNode); // Split at pos if in the middle of a text node. if (startNode->isTextNode()) { @@ -151,14 +151,14 @@ int textOffset = pos.computeOffsetInContainerNode(); if ((unsigned)textOffset >= textNode->length()) { startNode = NodeTraversal::next(*startNode); - ASSERT(startNode); + DCHECK(startNode); } else if (textOffset > 0) { splitTextNode(textNode, textOffset); } } else if (pos.computeEditingOffset() > 0) { Node* childAtOffset = NodeTraversal::childAt(*startNode, pos.computeEditingOffset()); startNode = childAtOffset ? childAtOffset : NodeTraversal::next(*startNode); - ASSERT(startNode); + DCHECK(startNode); } // If there's nothing inside topBlockquote to move, we're finished.
diff --git a/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp b/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp index 85e6a046..b255918 100644 --- a/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp
@@ -96,15 +96,15 @@ bool EditCommandComposition::belongsTo(const LocalFrame& frame) const { - ASSERT(m_document); + DCHECK(m_document); return m_document->frame() == &frame; } void EditCommandComposition::unapply() { - ASSERT(m_document); + DCHECK(m_document); LocalFrame* frame = m_document->frame(); - ASSERT(frame); + DCHECK(frame); // Changes to the document may have been made since the last editing operation that require a layout, as in <rdar://problem/5658603>. // Low level operations, like RemoveNodeCommand, don't require a layout because the high level operations that use them perform one @@ -122,9 +122,9 @@ void EditCommandComposition::reapply() { - ASSERT(m_document); + DCHECK(m_document); LocalFrame* frame = m_document->frame(); - ASSERT(frame); + DCHECK(frame); // Changes to the document may have been made since the last editing operation that require a layout, as in <rdar://problem/5658603>. // Low level operations, like RemoveNodeCommand, don't require a layout because the high level operations that use them perform one @@ -174,7 +174,7 @@ CompositeEditCommand::~CompositeEditCommand() { - ASSERT(isTopLevelCommand() || !m_composition); + DCHECK(isTopLevelCommand() || !m_composition); } bool CompositeEditCommand::apply() @@ -201,7 +201,7 @@ document().updateLayoutIgnorePendingStylesheets(); LocalFrame* frame = document().frame(); - ASSERT(frame); + DCHECK(frame); EditingState editingState; { EventQueueScope eventQueueScope; @@ -302,7 +302,7 @@ bool CompositeEditCommand::isRemovableBlock(const Node* node) { - ASSERT(node); + DCHECK(node); if (!isHTMLDivElement(*node)) return false; @@ -319,23 +319,23 @@ void CompositeEditCommand::insertNodeBefore(Node* insertChild, Node* refChild, EditingState* editingState, ShouldAssumeContentIsAlwaysEditable shouldAssumeContentIsAlwaysEditable) { - ASSERT(document().body() != refChild); + DCHECK_NE(document().body(), refChild); ABORT_EDITING_COMMAND_IF(!refChild->parentNode()->hasEditableStyle() && refChild->parentNode()->inActiveDocument()); applyCommandToComposite(InsertNodeBeforeCommand::create(insertChild, refChild, shouldAssumeContentIsAlwaysEditable), editingState); } void CompositeEditCommand::insertNodeAfter(Node* insertChild, Node* refChild, EditingState* editingState) { - ASSERT(insertChild); - ASSERT(refChild); - ASSERT(document().body() != refChild); + DCHECK(insertChild); + DCHECK(refChild); + DCHECK_NE(document().body(), refChild); ContainerNode* parent = refChild->parentNode(); - ASSERT(parent); - ASSERT(!parent->isShadowRoot()); + DCHECK(parent); + DCHECK(!parent->isShadowRoot()) << parent; if (parent->lastChild() == refChild) { appendNode(insertChild, parent, editingState); } else { - ASSERT(refChild->nextSibling()); + DCHECK(refChild->nextSibling()) << refChild; insertNodeBefore(insertChild, refChild->nextSibling(), editingState); } } @@ -419,7 +419,7 @@ void CompositeEditCommand::removeNodeAndPruneAncestors(Node* node, EditingState* editingState, Node* excludeNode) { - ASSERT(node != excludeNode); + DCHECK_NE(node, excludeNode); ContainerNode* parent = node->parentNode(); removeNode(node, editingState); if (editingState->isAborted()) @@ -464,7 +464,7 @@ // Returning a raw pointer here is OK because the command is retained by // applyCommandToComposite (thus retaining the span), and the span is also // in the DOM tree, and thus alive whie it has a parent. - ASSERT(command->spanElement()->inShadowIncludingDocument()); + DCHECK(command->spanElement()->inShadowIncludingDocument()) << command->spanElement(); return command->spanElement(); } @@ -488,7 +488,8 @@ void CompositeEditCommand::mergeIdenticalElements(Element* first, Element* second, EditingState* editingState) { - ASSERT(!first->isDescendantOf(second) && second != first); + DCHECK(!first->isDescendantOf(second)) << first << " " << second; + DCHECK_NE(second, first); if (first->nextSibling() != second) { removeNode(second, editingState); if (editingState->isAborted()) @@ -567,7 +568,7 @@ replaceTextInNode(node, offset, count, replacementText); Position startPosition(node, offset); Position endPosition(node, offset + replacementText.length()); - ASSERT(types.size() == descriptions.size()); + DCHECK_EQ(types.size(), descriptions.size()); for (size_t i = 0; i < types.size(); ++i) markerController.addMarker(startPosition, endPosition, types[i], descriptions[i]); } @@ -591,7 +592,7 @@ } HTMLSpanElement* tabSpan = tabSpanElement(pos.computeContainerNode()); - ASSERT(tabSpan); + DCHECK(tabSpan); if (pos.offsetInContainerNode() <= caretMinOffset(pos.computeContainerNode())) return positionInParentBeforeNode(*tabSpan); @@ -692,7 +693,7 @@ void CompositeEditCommand::rebalanceWhitespaceOnTextSubstring(Text* textNode, int startOffset, int endOffset) { String text = textNode->data(); - ASSERT(!text.isEmpty()); + DCHECK(!text.isEmpty()); // Set upstream and downstream to define the extent of the whitespace surrounding text[offset]. int upstream = startOffset; @@ -846,7 +847,7 @@ // Assert that we are not going to delete all of the text in the node. // If we were, that should have been done above with the call to // removeNode and return. - ASSERT(start > 0 || end - start < textNode->length()); + DCHECK(start > 0 || end - start < textNode->length()); deleteTextFromNode(textNode, start, end - start); } } @@ -890,7 +891,7 @@ document().updateLayoutIgnorePendingStylesheets(); // Should assert isLayoutBlockFlow || isInlineFlow when deletion improves. See 4244964. - ASSERT(container->layoutObject()); + DCHECK(container->layoutObject()) << container; HTMLBRElement* placeholder = HTMLBRElement::create(document()); appendNode(placeholder, container, editingState); @@ -905,7 +906,7 @@ return nullptr; // Should assert isLayoutBlockFlow || isInlineFlow when deletion improves. See 4244964. - ASSERT(pos.anchorNode()->layoutObject()); + DCHECK(pos.anchorNode()->layoutObject()) << pos; HTMLBRElement* placeholder = HTMLBRElement::create(document()); insertNodeAt(placeholder, pos, editingState); @@ -937,7 +938,7 @@ // Assumes that the position is at a placeholder and does the removal without much checking. void CompositeEditCommand::removePlaceholderAt(const Position& p) { - ASSERT(lineBreakExistsAtPosition(p)); + DCHECK(lineBreakExistsAtPosition(p)) << p; // We are certain that the position is at a line break, but it may be a br or a preserved newline. if (isHTMLBRElement(*p.anchorNode())) { @@ -963,7 +964,7 @@ // it, and return that block. Otherwise return 0. HTMLElement* CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary(const Position& pos, EditingState* editingState) { - ASSERT(isEditablePosition(pos, ContentIsEditable, DoNotUpdateStyle)); + DCHECK(isEditablePosition(pos, ContentIsEditable, DoNotUpdateStyle)) << pos; // It's strange that this function is responsible for verifying that pos has not been invalidated // by an earlier call to this function. The caller, applyBlockStyle, should do this. @@ -1038,7 +1039,7 @@ if (!anchorNode) return; - ASSERT(anchorNode->isLink()); + DCHECK(anchorNode->isLink()) << anchorNode; setEndingSelection(VisibleSelection::selectionFromContentsOfNode(anchorNode)); applyStyledElement(anchorNode, editingState); @@ -1055,8 +1056,8 @@ void CompositeEditCommand::cloneParagraphUnderNewElement(const Position& start, const Position& end, Node* passedOuterNode, Element* blockElement, EditingState* editingState) { DCHECK_LE(start, end); - ASSERT(passedOuterNode); - ASSERT(blockElement); + DCHECK(passedOuterNode); + DCHECK(blockElement); // First we clone the outerNode Node* lastNode = nullptr; @@ -1189,8 +1190,8 @@ void CompositeEditCommand::moveParagraphWithClones(const VisiblePosition& startOfParagraphToMove, const VisiblePosition& endOfParagraphToMove, HTMLElement* blockElement, Node* outerNode, EditingState* editingState) { - ASSERT(outerNode); - ASSERT(blockElement); + DCHECK(outerNode); + DCHECK(blockElement); VisiblePosition beforeParagraph = previousPositionOf(startOfParagraphToMove); VisiblePosition afterParagraph = nextPositionOf(endOfParagraphToMove); @@ -1236,8 +1237,8 @@ void CompositeEditCommand::moveParagraph(const VisiblePosition& startOfParagraphToMove, const VisiblePosition& endOfParagraphToMove, const VisiblePosition& destination, EditingState* editingState, bool preserveSelection, bool preserveStyle, Node* constrainingAncestor) { - ASSERT(isStartOfParagraph(startOfParagraphToMove)); - ASSERT(isEndOfParagraph(endOfParagraphToMove)); + DCHECK(isStartOfParagraph(startOfParagraphToMove)) << startOfParagraphToMove; + DCHECK(isEndOfParagraph(endOfParagraphToMove)) << endOfParagraphToMove; moveParagraphs(startOfParagraphToMove, endOfParagraphToMove, destination, editingState, preserveSelection, preserveStyle, constrainingAncestor); } @@ -1303,11 +1304,11 @@ if (editingState->isAborted()) return; - ASSERT(destination.deepEquivalent().inShadowIncludingDocument()); + DCHECK(destination.deepEquivalent().inShadowIncludingDocument()) << destination; cleanupAfterDeletion(editingState, destination); if (editingState->isAborted()) return; - ASSERT(destination.deepEquivalent().inShadowIncludingDocument()); + DCHECK(destination.deepEquivalent().inShadowIncludingDocument()) << destination; // Add a br if pruning an empty block level element caused a collapse. For example: // foo^ @@ -1330,7 +1331,7 @@ destinationIndex = TextIterator::rangeLength(firstPositionInNode(document().documentElement()), destination.toParentAnchoredPosition(), true); setEndingSelection(VisibleSelection(destination, originalIsDirectional)); - ASSERT(endingSelection().isCaretOrRange()); + DCHECK(endingSelection().isCaretOrRange()); ReplaceSelectionCommand::CommandOptions options = ReplaceSelectionCommand::SelectReplacement | ReplaceSelectionCommand::MovingParagraph; if (!preserveStyle) options |= ReplaceSelectionCommand::MatchStyle; @@ -1491,14 +1492,14 @@ Position caretPos(mostForwardCaretPosition(caret.deepEquivalent())); // A line break is either a br or a preserved newline. - ASSERT(isHTMLBRElement(caretPos.anchorNode()) || (caretPos.anchorNode()->isTextNode() && caretPos.anchorNode()->layoutObject()->style()->preserveNewline())); + DCHECK(isHTMLBRElement(caretPos.anchorNode()) || (caretPos.anchorNode()->isTextNode() && caretPos.anchorNode()->layoutObject()->style()->preserveNewline())) << caretPos; if (isHTMLBRElement(*caretPos.anchorNode())) { removeNodeAndPruneAncestors(caretPos.anchorNode(), editingState); if (editingState->isAborted()) return false; } else if (caretPos.anchorNode()->isTextNode()) { - ASSERT(caretPos.computeOffsetInContainerNode() == 0); + DCHECK_EQ(caretPos.computeOffsetInContainerNode(), 0); Text* textNode = toText(caretPos.anchorNode()); ContainerNode* parentNode = textNode->parentNode(); // The preserved newline must be the first thing in the node, since otherwise the previous @@ -1581,9 +1582,9 @@ // to determine if the split is necessary. Returns the last split node. Node* CompositeEditCommand::splitTreeToNode(Node* start, Node* end, bool shouldSplitAncestor) { - ASSERT(start); - ASSERT(end); - ASSERT(start != end); + DCHECK(start); + DCHECK(end); + DCHECK_NE(start, end); if (shouldSplitAncestor && end->parentNode()) end = end->parentNode();
diff --git a/third_party/WebKit/Source/core/editing/commands/DeleteFromTextNodeCommand.cpp b/third_party/WebKit/Source/core/editing/commands/DeleteFromTextNodeCommand.cpp index e3576d69..712740f0 100644 --- a/third_party/WebKit/Source/core/editing/commands/DeleteFromTextNodeCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/DeleteFromTextNodeCommand.cpp
@@ -37,14 +37,14 @@ , m_offset(offset) , m_count(count) { - ASSERT(m_node); - ASSERT(m_offset <= m_node->length()); - ASSERT(m_offset + m_count <= m_node->length()); + DCHECK(m_node); + DCHECK_LE(m_offset, m_node->length()); + DCHECK_LE(m_offset + m_count, m_node->length()); } void DeleteFromTextNodeCommand::doApply(EditingState*) { - ASSERT(m_node); + DCHECK(m_node); if (!m_node->isContentEditable(Node::UserSelectAllIsAlwaysNonEditable)) return; @@ -59,7 +59,7 @@ void DeleteFromTextNodeCommand::doUnapply() { - ASSERT(m_node); + DCHECK(m_node); if (!m_node->hasEditableStyle()) return;
diff --git a/third_party/WebKit/Source/core/editing/commands/DeleteSelectionCommand.cpp b/third_party/WebKit/Source/core/editing/commands/DeleteSelectionCommand.cpp index 536684e..4ac8280 100644 --- a/third_party/WebKit/Source/core/editing/commands/DeleteSelectionCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/DeleteSelectionCommand.cpp
@@ -48,7 +48,7 @@ static bool isTableCellEmpty(Node* cell) { - ASSERT(isTableCell(cell)); + DCHECK(isTableCell(cell)) << cell; return createVisiblePosition(firstPositionInNode(cell)).deepEquivalent() == createVisiblePosition(lastPositionInNode(cell)).deepEquivalent(); } @@ -166,15 +166,15 @@ { Position start, end; initializeStartEnd(start, end); - ASSERT(start.isNotNull()); - ASSERT(end.isNotNull()); + DCHECK(start.isNotNull()); + DCHECK(end.isNotNull()); if (!isEditablePosition(start, ContentIsEditable, DoNotUpdateStyle)) { editingState->abort(); return; } if (!isEditablePosition(end, ContentIsEditable, DoNotUpdateStyle)) { Node* highestRoot = highestEditableRoot(start); - ASSERT(highestRoot); + DCHECK(highestRoot); end = lastEditablePositionBeforePositionInRoot(end, *highestRoot); } @@ -334,7 +334,7 @@ static Position firstEditablePositionInNode(Node* node) { - ASSERT(node); + DCHECK(node); Node* next = node; while (next && !next->hasEditableStyle()) next = NodeTraversal::next(*next, node); @@ -463,7 +463,7 @@ int startOffset = m_upstreamStart.computeEditingOffset(); Node* startNode = m_upstreamStart.anchorNode(); - ASSERT(startNode); + DCHECK(startNode); makeStylingElementsDirectChildrenOfEditableRootToPreventStyleLoss(editingState); if (editingState->isAborted()) @@ -602,12 +602,12 @@ // |VisiblePosition::characterBefore()| if (m_leadingWhitespace.isNotNull() && !isRenderedCharacter(m_leadingWhitespace) && m_leadingWhitespace.anchorNode()->isTextNode()) { Text* textNode = toText(m_leadingWhitespace.anchorNode()); - ASSERT(!textNode->layoutObject() || textNode->layoutObject()->style()->collapseWhiteSpace()); + DCHECK(!textNode->layoutObject() || textNode->layoutObject()->style()->collapseWhiteSpace()) << textNode; replaceTextInNodePreservingMarkers(textNode, m_leadingWhitespace.computeOffsetInContainerNode(), 1, nonBreakingSpaceString()); } if (m_trailingWhitespace.isNotNull() && !isRenderedCharacter(m_trailingWhitespace) && m_trailingWhitespace.anchorNode()->isTextNode()) { Text* textNode = toText(m_trailingWhitespace.anchorNode()); - ASSERT(!textNode->layoutObject() || textNode->layoutObject()->style()->collapseWhiteSpace()); + DCHECK(!textNode->layoutObject() || textNode->layoutObject()->style()->collapseWhiteSpace()) << textNode; replaceTextInNodePreservingMarkers(textNode, m_trailingWhitespace.computeOffsetInContainerNode(), 1, nonBreakingSpaceString()); } } @@ -630,7 +630,7 @@ } // It shouldn't have been asked to both try and merge content into the start block and prune it. - ASSERT(!m_pruneStartBlockIfNecessary); + DCHECK(!m_pruneStartBlockIfNecessary); // FIXME: Deletion should adjust selection endpoints as it removes nodes so that we never get into this state (4099839). if (!m_downstreamEnd.inShadowIncludingDocument() || !m_upstreamStart.inShadowIncludingDocument())
diff --git a/third_party/WebKit/Source/core/editing/commands/EditCommand.cpp b/third_party/WebKit/Source/core/editing/commands/EditCommand.cpp index 0581ae6d..3450391 100644 --- a/third_party/WebKit/Source/core/editing/commands/EditCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/EditCommand.cpp
@@ -38,8 +38,8 @@ : m_document(&document) , m_parent(nullptr) { - ASSERT(m_document); - ASSERT(m_document->frame()); + DCHECK(m_document); + DCHECK(m_document->frame()); setStartingSelection(m_document->frame()->selection().selection()); setEndingSelection(m_startingSelection); } @@ -64,7 +64,7 @@ { for (EditCommand* command = this; ; command = command->m_parent) { if (EditCommandComposition* composition = compositionIfPossible(command)) { - ASSERT(command->isTopLevelCommand()); + DCHECK(command->isTopLevelCommand()); composition->setStartingSelection(selection); } command->m_startingSelection = selection; @@ -77,7 +77,7 @@ { for (EditCommand* command = this; command; command = command->m_parent) { if (EditCommandComposition* composition = compositionIfPossible(command)) { - ASSERT(command->isTopLevelCommand()); + DCHECK(command->isTopLevelCommand()); composition->setEndingSelection(selection); } command->m_endingSelection = selection; @@ -93,7 +93,7 @@ { if (position.isNull()) return false; - ASSERT(position.isOffsetInAnchor()); + DCHECK(position.isOffsetInAnchor()) << position; if (!position.anchorNode()->isTextNode()) return false; @@ -106,8 +106,8 @@ void EditCommand::setParent(CompositeEditCommand* parent) { - ASSERT((parent && !m_parent) || (!parent && m_parent)); - ASSERT(!parent || !isCompositeEditCommand() || !toCompositeEditCommand(this)->composition()); + DCHECK((parent && !m_parent) || (!parent && m_parent)); + DCHECK(!parent || !isCompositeEditCommand() || !toCompositeEditCommand(this)->composition()); m_parent = parent; if (parent) { m_startingSelection = parent->m_endingSelection;
diff --git a/third_party/WebKit/Source/core/editing/commands/EditingState.cpp b/third_party/WebKit/Source/core/editing/commands/EditingState.cpp index f734bee..bb5215b 100644 --- a/third_party/WebKit/Source/core/editing/commands/EditingState.cpp +++ b/third_party/WebKit/Source/core/editing/commands/EditingState.cpp
@@ -16,7 +16,7 @@ void EditingState::abort() { - ASSERT(!m_isAborted); + DCHECK(!m_isAborted); m_isAborted = true; }
diff --git a/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp b/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp index a9c9fd3..82083270 100644 --- a/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp
@@ -231,13 +231,13 @@ static bool executeInsertFragment(LocalFrame& frame, DocumentFragment* fragment) { - ASSERT(frame.document()); + DCHECK(frame.document()); return ReplaceSelectionCommand::create(*frame.document(), fragment, ReplaceSelectionCommand::PreventNesting, EditActionUnspecified)->apply(); } static bool executeInsertElement(LocalFrame& frame, HTMLElement* content) { - ASSERT(frame.document()); + DCHECK(frame.document()); DocumentFragment* fragment = DocumentFragment::create(*frame.document()); TrackExceptionState exceptionState; fragment->appendChild(content, exceptionState); @@ -356,7 +356,7 @@ { if (value.isEmpty()) return false; - ASSERT(frame.document()); + DCHECK(frame.document()); return CreateLinkCommand::create(*frame.document(), value)->apply(); } @@ -394,7 +394,7 @@ case CommandFromDOM: // If the current selection is a caret, delete the preceding character. IE performs forwardDelete, but we currently side with Firefox. // Doesn't scroll to make the selection visible, or modify the kill ring (this time, siding with IE, not Firefox). - ASSERT(frame.document()); + DCHECK(frame.document()); TypingCommand::deleteKeyPressed(*frame.document(), frame.selection().granularity() == WordGranularity ? TypingCommand::SmartDelete : 0); return true; } @@ -454,7 +454,7 @@ const EphemeralRange mark = frame.editor().mark().toNormalizedEphemeralRange(); if (mark.isNotNull()) { bool selected = frame.selection().setSelectedRange(unionEphemeralRanges(mark, frame.editor().selectedRange()), TextAffinity::Downstream, SelectionDirectionalMode::NonDirectional, FrameSelection::CloseTyping); - ASSERT(selected); + DCHECK(selected); if (!selected) return false; } @@ -514,7 +514,7 @@ return false; QualifiedName qualifiedTagName(prefix, localName, xhtmlNamespaceURI); - ASSERT(frame.document()); + DCHECK(frame.document()); FormatBlockCommand* command = FormatBlockCommand::create(*frame.document(), qualifiedTagName); command->apply(); return command->didApply(); @@ -531,7 +531,7 @@ // Doesn't scroll to make the selection visible, or modify the kill ring. // ForwardDelete is not implemented in IE or Firefox, so this behavior is only needed for // backward compatibility with ourselves, and for consistency with Delete. - ASSERT(frame.document()); + DCHECK(frame.document()); TypingCommand::forwardDeleteKeyPressed(*frame.document(), &editingState); if (editingState.isAborted()) return false; @@ -549,7 +549,7 @@ static bool executeIndent(LocalFrame& frame, Event*, EditorCommandSource, const String&) { - ASSERT(frame.document()); + DCHECK(frame.document()); return IndentOutdentCommand::create(*frame.document(), IndentOutdentCommand::Indent)->apply(); } @@ -560,7 +560,7 @@ static bool executeInsertHorizontalRule(LocalFrame& frame, Event*, EditorCommandSource, const String& value) { - ASSERT(frame.document()); + DCHECK(frame.document()); HTMLHRElement* rule = HTMLHRElement::create(*frame.document()); if (!value.isEmpty()) rule->setIdAttribute(AtomicString(value)); @@ -569,13 +569,13 @@ static bool executeInsertHTML(LocalFrame& frame, Event*, EditorCommandSource, const String& value) { - ASSERT(frame.document()); + DCHECK(frame.document()); return executeInsertFragment(frame, createFragmentFromMarkup(*frame.document(), value, "")); } static bool executeInsertImage(LocalFrame& frame, Event*, EditorCommandSource, const String& value) { - ASSERT(frame.document()); + DCHECK(frame.document()); HTMLImageElement* image = HTMLImageElement::create(*frame.document()); if (!value.isEmpty()) image->setSrc(value); @@ -591,7 +591,7 @@ // Doesn't scroll to make the selection visible, or modify the kill ring. // InsertLineBreak is not implemented in IE or Firefox, so this behavior is only needed for // backward compatibility with ourselves, and for consistency with other commands. - ASSERT(frame.document()); + DCHECK(frame.document()); return TypingCommand::insertLineBreak(*frame.document()); } ASSERT_NOT_REACHED(); @@ -606,19 +606,19 @@ static bool executeInsertNewlineInQuotedContent(LocalFrame& frame, Event*, EditorCommandSource, const String&) { - ASSERT(frame.document()); + DCHECK(frame.document()); return TypingCommand::insertParagraphSeparatorInQuotedContent(*frame.document()); } static bool executeInsertOrderedList(LocalFrame& frame, Event*, EditorCommandSource, const String&) { - ASSERT(frame.document()); + DCHECK(frame.document()); return InsertListCommand::create(*frame.document(), InsertListCommand::OrderedList)->apply(); } static bool executeInsertParagraph(LocalFrame& frame, Event*, EditorCommandSource, const String&) { - ASSERT(frame.document()); + DCHECK(frame.document()); return TypingCommand::insertParagraphSeparator(*frame.document()); } @@ -629,14 +629,14 @@ static bool executeInsertText(LocalFrame& frame, Event*, EditorCommandSource, const String& value) { - ASSERT(frame.document()); + DCHECK(frame.document()); TypingCommand::insertText(*frame.document(), value, 0); return true; } static bool executeInsertUnorderedList(LocalFrame& frame, Event*, EditorCommandSource, const String&) { - ASSERT(frame.document()); + DCHECK(frame.document()); return InsertListCommand::create(*frame.document(), InsertListCommand::UnorderedList)->apply(); } @@ -984,7 +984,7 @@ static bool executeOutdent(LocalFrame& frame, Event*, EditorCommandSource, const String&) { - ASSERT(frame.document()); + DCHECK(frame.document()); return IndentOutdentCommand::create(*frame.document(), IndentOutdentCommand::Outdent)->apply(); } @@ -1204,7 +1204,7 @@ static bool executeUnlink(LocalFrame& frame, Event*, EditorCommandSource, const String&) { - ASSERT(frame.document()); + DCHECK(frame.document()); return UnlinkCommand::create(*frame.document())->apply(); } @@ -1735,9 +1735,9 @@ { // Use separate assertions so we can tell which bad thing happened. if (!command) - ASSERT(!m_frame); + DCHECK(!m_frame); else - ASSERT(m_frame); + DCHECK(m_frame); } bool Editor::Command::execute(const String& parameter, Event* triggeringEvent) const
diff --git a/third_party/WebKit/Source/core/editing/commands/InsertIntoTextNodeCommand.cpp b/third_party/WebKit/Source/core/editing/commands/InsertIntoTextNodeCommand.cpp index 0d919d1..fd29c5f 100644 --- a/third_party/WebKit/Source/core/editing/commands/InsertIntoTextNodeCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/InsertIntoTextNodeCommand.cpp
@@ -39,9 +39,9 @@ , m_offset(offset) , m_text(text) { - ASSERT(m_node); - ASSERT(m_offset <= m_node->length()); - ASSERT(!m_text.isEmpty()); + DCHECK(m_node); + DCHECK_LE(m_offset, m_node->length()); + DCHECK(!m_text.isEmpty()); } void InsertIntoTextNodeCommand::doApply(EditingState*)
diff --git a/third_party/WebKit/Source/core/editing/commands/InsertLineBreakCommand.cpp b/third_party/WebKit/Source/core/editing/commands/InsertLineBreakCommand.cpp index 68e035b..5c0f925 100644 --- a/third_party/WebKit/Source/core/editing/commands/InsertLineBreakCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/InsertLineBreakCommand.cpp
@@ -154,7 +154,7 @@ Position positionBeforeTextNode(positionInParentBeforeNode(*textNode)); // Clear out all whitespace and insert one non-breaking space deleteInsignificantTextDownstream(endingPosition); - ASSERT(!textNode->layoutObject() || textNode->layoutObject()->style()->collapseWhiteSpace()); + DCHECK(!textNode->layoutObject() || textNode->layoutObject()->style()->collapseWhiteSpace()); // Deleting insignificant whitespace will remove textNode if it contains nothing but insignificant whitespace. if (textNode->inShadowIncludingDocument()) { insertTextIntoNode(textNode, 0, nonBreakingSpaceString());
diff --git a/third_party/WebKit/Source/core/editing/commands/InsertListCommand.cpp b/third_party/WebKit/Source/core/editing/commands/InsertListCommand.cpp index 528d91b..0fadbda 100644 --- a/third_party/WebKit/Source/core/editing/commands/InsertListCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/InsertListCommand.cpp
@@ -150,7 +150,7 @@ if (endingSelection().isRange()) { bool forceListCreation = false; VisibleSelection selection = selectionForParagraphIteration(endingSelection()); - ASSERT(selection.isRange()); + DCHECK(selection.isRange()); VisiblePosition startOfSelection = selection.visibleStart(); VisiblePosition endOfSelection = selection.visibleEnd(); VisiblePosition startOfLastParagraph = startOfParagraph(endOfSelection, CanSkipOverEditingBoundary); @@ -190,7 +190,7 @@ endOfSelection = visiblePositionForIndex(indexForEndOfSelection, scopeForEndOfSelection); // If endOfSelection is null, then some contents have been deleted from the document. // This should never happen and if it did, exit early immediately because we've lost the loop invariant. - ASSERT(endOfSelection.isNotNull()); + DCHECK(endOfSelection.isNotNull()); if (endOfSelection.isNull() || !rootEditableElementOf(endOfSelection)) return; startOfLastParagraph = startOfParagraph(endOfSelection, CanSkipOverEditingBoundary); @@ -218,7 +218,7 @@ return; } - ASSERT(firstRangeOf(endingSelection())); + DCHECK(firstRangeOf(endingSelection())); doApplyForSingleParagraph(false, listTag, *firstRangeOf(endingSelection()), editingState); } @@ -255,8 +255,8 @@ if (editingState->isAborted()) return false; } - ASSERT(listElement->hasEditableStyle()); - ASSERT(listElement->parentNode()->hasEditableStyle()); + DCHECK(listElement->hasEditableStyle()); + DCHECK(listElement->parentNode()->hasEditableStyle()); if (!listElement->hasTagName(listTag)) { // |listChildNode| will be removed from the list and a list of type // |m_type| will be created. @@ -325,12 +325,12 @@ { // Since, unlistify paragraph inserts nodes into parent and removes node // from parent, if parent of |listElement| should be editable. - ASSERT(listElement->parentNode()->hasEditableStyle()); + DCHECK(listElement->parentNode()->hasEditableStyle()); Node* nextListChild; Node* previousListChild; VisiblePosition start; VisiblePosition end; - ASSERT(listChildNode); + DCHECK(listChildNode); if (isHTMLLIElement(*listChildNode)) { start = createVisiblePosition(firstPositionInNode(listChildNode)); end = createVisiblePosition(lastPositionInNode(listChildNode)); @@ -341,9 +341,9 @@ start = startOfParagraph(originalStart, CanSkipOverEditingBoundary); end = endOfParagraph(start, CanSkipOverEditingBoundary); nextListChild = enclosingListChild(nextPositionOf(end).deepEquivalent().anchorNode(), listElement); - ASSERT(nextListChild != listChildNode); + DCHECK_NE(nextListChild, listChildNode); previousListChild = enclosingListChild(previousPositionOf(start).deepEquivalent().anchorNode(), listElement); - ASSERT(previousListChild != listChildNode); + DCHECK_NE(previousListChild, listChildNode); } // When removing a list, we must always create a placeholder to act as a point of insertion // for the list content being removed. @@ -485,7 +485,7 @@ void InsertListCommand::moveParagraphOverPositionIntoEmptyListItem(const VisiblePosition& pos, HTMLLIElement* listItemElement, EditingState* editingState) { - ASSERT(!listItemElement->hasChildren()); + DCHECK(!listItemElement->hasChildren()); HTMLBRElement* placeholder = HTMLBRElement::create(document()); appendNode(placeholder, listItemElement, editingState); if (editingState->isAborted())
diff --git a/third_party/WebKit/Source/core/editing/commands/InsertNodeBeforeCommand.cpp b/third_party/WebKit/Source/core/editing/commands/InsertNodeBeforeCommand.cpp index 3870688..fda1d19 100644 --- a/third_party/WebKit/Source/core/editing/commands/InsertNodeBeforeCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/InsertNodeBeforeCommand.cpp
@@ -36,12 +36,12 @@ , m_refChild(refChild) , m_shouldAssumeContentIsAlwaysEditable(shouldAssumeContentIsAlwaysEditable) { - ASSERT(m_insertChild); - ASSERT(!m_insertChild->parentNode()); - ASSERT(m_refChild); - ASSERT(m_refChild->parentNode()); + DCHECK(m_insertChild); + DCHECK(!m_insertChild->parentNode()) << m_insertChild; + DCHECK(m_refChild); + DCHECK(m_refChild->parentNode()) << m_refChild; - ASSERT(m_refChild->parentNode()->hasEditableStyle() || !m_refChild->parentNode()->inActiveDocument()); + DCHECK(m_refChild->parentNode()->hasEditableStyle() || !m_refChild->parentNode()->inActiveDocument()) << m_refChild->parentNode(); } void InsertNodeBeforeCommand::doApply(EditingState*) @@ -49,7 +49,7 @@ ContainerNode* parent = m_refChild->parentNode(); if (!parent || (m_shouldAssumeContentIsAlwaysEditable == DoNotAssumeContentIsAlwaysEditable && !parent->isContentEditable(Node::UserSelectAllIsAlwaysNonEditable))) return; - ASSERT(parent->isContentEditable(Node::UserSelectAllIsAlwaysNonEditable)); + DCHECK(parent->isContentEditable(Node::UserSelectAllIsAlwaysNonEditable)) << parent; parent->insertBefore(m_insertChild.get(), m_refChild.get(), IGNORE_EXCEPTION); }
diff --git a/third_party/WebKit/Source/core/editing/commands/InsertParagraphSeparatorCommand.cpp b/third_party/WebKit/Source/core/editing/commands/InsertParagraphSeparatorCommand.cpp index 69eb25c..2862fab 100644 --- a/third_party/WebKit/Source/core/editing/commands/InsertParagraphSeparatorCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/InsertParagraphSeparatorCommand.cpp
@@ -81,7 +81,7 @@ if (!isStartOfParagraph(visiblePos) && !isEndOfParagraph(visiblePos)) return; - ASSERT(pos.isNotNull()); + DCHECK(pos.isNotNull()); m_style = EditingStyle::create(pos); m_style->mergeTypingStyle(pos.document()); } @@ -310,11 +310,11 @@ } } else if (isFirstInBlock && nestNewBlock) { // startBlock should always have children, otherwise isLastInBlock would be true and it's handled above. - ASSERT(startBlock->hasChildren()); + DCHECK(startBlock->hasChildren()); refNode = startBlock->firstChild(); } else if (insertionPosition.anchorNode() == startBlock && nestNewBlock) { refNode = NodeTraversal::childAt(*startBlock, insertionPosition.computeEditingOffset()); - ASSERT(refNode); // must be true or we'd be in the end of block case + DCHECK(refNode); // must be true or we'd be in the end of block case } else { refNode = insertionPosition.anchorNode(); } @@ -394,7 +394,7 @@ // after the preserved newline, causing the newline to be turned into a nbsp. if (leadingWhitespace.isNotNull() && leadingWhitespace.anchorNode()->isTextNode()) { Text* textNode = toText(leadingWhitespace.anchorNode()); - ASSERT(!textNode->layoutObject() || textNode->layoutObject()->style()->collapseWhiteSpace()); + DCHECK(!textNode->layoutObject() || textNode->layoutObject()->style()->collapseWhiteSpace()); replaceTextInNodePreservingMarkers(textNode, leadingWhitespace.computeOffsetInContainerNode(), 1, nonBreakingSpaceString()); } @@ -473,7 +473,7 @@ // use |VisiblePosition::characterAfter()|. if (!isRenderedCharacter(positionAfterSplit)) { // Clear out all whitespace and insert one non-breaking space - ASSERT(!positionAfterSplit.computeContainerNode()->layoutObject() || positionAfterSplit.computeContainerNode()->layoutObject()->style()->collapseWhiteSpace()); + DCHECK(!positionAfterSplit.computeContainerNode()->layoutObject() || positionAfterSplit.computeContainerNode()->layoutObject()->style()->collapseWhiteSpace()); deleteInsignificantTextDownstream(positionAfterSplit); if (positionAfterSplit.anchorNode()->isTextNode()) insertTextIntoNode(toText(positionAfterSplit.computeContainerNode()), 0, nonBreakingSpaceString());
diff --git a/third_party/WebKit/Source/core/editing/commands/InsertTextCommand.cpp b/third_party/WebKit/Source/core/editing/commands/InsertTextCommand.cpp index 513f006..2a80519 100644 --- a/third_party/WebKit/Source/core/editing/commands/InsertTextCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/InsertTextCommand.cpp
@@ -126,7 +126,7 @@ void InsertTextCommand::doApply(EditingState* editingState) { - ASSERT(m_text.find('\n') == kNotFound); + DCHECK_EQ(m_text.find('\n'), kNotFound); if (!endingSelection().isNonOrphanedCaretOrRange()) return; @@ -177,7 +177,7 @@ // It is possible for the node that contains startPosition to contain only unrendered whitespace, // and so deleteInsignificantText could remove it. Save the position before the node in case that happens. - ASSERT(startPosition.computeContainerNode()); + DCHECK(startPosition.computeContainerNode()) << startPosition; Position positionBeforeStartNode(positionInParentBeforeNode(*startPosition.computeContainerNode())); deleteInsignificantText(startPosition, mostForwardCaretPosition(startPosition)); if (!startPosition.inShadowIncludingDocument()) @@ -203,9 +203,9 @@ startPosition = positionInsideTextNode(startPosition, editingState); if (editingState->isAborted()) return; - ASSERT(startPosition.isOffsetInAnchor()); - ASSERT(startPosition.computeContainerNode()); - ASSERT(startPosition.computeContainerNode()->isTextNode()); + DCHECK(startPosition.isOffsetInAnchor()) << startPosition; + DCHECK(startPosition.computeContainerNode()) << startPosition; + DCHECK(startPosition.computeContainerNode()->isTextNode()) << startPosition; if (placeholder.isNotNull()) removePlaceholderAt(placeholder); Text* textNode = toText(startPosition.computeContainerNode()); @@ -221,7 +221,7 @@ if (!shouldRebalanceLeadingWhitespaceFor(m_text)) rebalanceWhitespaceAt(startPosition); } else { - ASSERT(m_rebalanceType == RebalanceAllWhitespaces); + DCHECK_EQ(m_rebalanceType, RebalanceAllWhitespaces); if (canRebalance(startPosition) && canRebalance(endPosition)) rebalanceWhitespaceOnTextSubstring(textNode, startPosition.offsetInContainerNode(), endPosition.offsetInContainerNode()); }
diff --git a/third_party/WebKit/Source/core/editing/commands/MergeIdenticalElementsCommand.cpp b/third_party/WebKit/Source/core/editing/commands/MergeIdenticalElementsCommand.cpp index 0650534..809f89a 100644 --- a/third_party/WebKit/Source/core/editing/commands/MergeIdenticalElementsCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/MergeIdenticalElementsCommand.cpp
@@ -36,9 +36,9 @@ , m_element1(first) , m_element2(second) { - ASSERT(m_element1); - ASSERT(m_element2); - ASSERT(m_element1->nextSibling() == m_element2); + DCHECK(m_element1); + DCHECK(m_element2); + DCHECK_EQ(m_element1->nextSibling(), m_element2); } void MergeIdenticalElementsCommand::doApply(EditingState*) @@ -59,8 +59,8 @@ void MergeIdenticalElementsCommand::doUnapply() { - ASSERT(m_element1); - ASSERT(m_element2); + DCHECK(m_element1); + DCHECK(m_element2); Node* atChild = m_atChild.release();
diff --git a/third_party/WebKit/Source/core/editing/commands/MoveSelectionCommand.cpp b/third_party/WebKit/Source/core/editing/commands/MoveSelectionCommand.cpp index 81b3f3e3..221127c 100644 --- a/third_party/WebKit/Source/core/editing/commands/MoveSelectionCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/MoveSelectionCommand.cpp
@@ -33,12 +33,12 @@ MoveSelectionCommand::MoveSelectionCommand(DocumentFragment* fragment, const Position& position, bool smartInsert, bool smartDelete) : CompositeEditCommand(*position.document()), m_fragment(fragment), m_position(position), m_smartInsert(smartInsert), m_smartDelete(smartDelete) { - ASSERT(m_fragment); + DCHECK(m_fragment); } void MoveSelectionCommand::doApply(EditingState* editingState) { - ASSERT(endingSelection().isNonOrphanedRange()); + DCHECK(endingSelection().isNonOrphanedRange()); Position pos = m_position; if (pos.isNull())
diff --git a/third_party/WebKit/Source/core/editing/commands/RemoveCSSPropertyCommand.cpp b/third_party/WebKit/Source/core/editing/commands/RemoveCSSPropertyCommand.cpp index 0411711..1039d23 100644 --- a/third_party/WebKit/Source/core/editing/commands/RemoveCSSPropertyCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/RemoveCSSPropertyCommand.cpp
@@ -39,7 +39,7 @@ , m_property(property) , m_important(false) { - ASSERT(m_element); + DCHECK(m_element); } RemoveCSSPropertyCommand::~RemoveCSSPropertyCommand()
diff --git a/third_party/WebKit/Source/core/editing/commands/RemoveNodeCommand.cpp b/third_party/WebKit/Source/core/editing/commands/RemoveNodeCommand.cpp index 8e76051..5c8775ad 100644 --- a/third_party/WebKit/Source/core/editing/commands/RemoveNodeCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/RemoveNodeCommand.cpp
@@ -37,8 +37,8 @@ , m_node(node) , m_shouldAssumeContentIsAlwaysEditable(shouldAssumeContentIsAlwaysEditable) { - ASSERT(m_node); - ASSERT(m_node->parentNode()); + DCHECK(m_node); + DCHECK(m_node->parentNode()); } void RemoveNodeCommand::doApply(EditingState* editingState) @@ -47,7 +47,7 @@ if (!parent || (m_shouldAssumeContentIsAlwaysEditable == DoNotAssumeContentIsAlwaysEditable && !parent->isContentEditable(Node::UserSelectAllIsAlwaysNonEditable) && parent->inActiveDocument())) return; - ASSERT(parent->isContentEditable(Node::UserSelectAllIsAlwaysNonEditable) || !parent->inActiveDocument()); + DCHECK(parent->isContentEditable(Node::UserSelectAllIsAlwaysNonEditable) || !parent->inActiveDocument()) << parent; m_parent = parent; m_refChild = m_node->nextSibling();
diff --git a/third_party/WebKit/Source/core/editing/commands/RemoveNodePreservingChildrenCommand.cpp b/third_party/WebKit/Source/core/editing/commands/RemoveNodePreservingChildrenCommand.cpp index 45a50750..a78e7f3 100644 --- a/third_party/WebKit/Source/core/editing/commands/RemoveNodePreservingChildrenCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/RemoveNodePreservingChildrenCommand.cpp
@@ -35,7 +35,7 @@ , m_node(node) , m_shouldAssumeContentIsAlwaysEditable(shouldAssumeContentIsAlwaysEditable) { - ASSERT(m_node); + DCHECK(m_node); } void RemoveNodePreservingChildrenCommand::doApply(EditingState* editingState)
diff --git a/third_party/WebKit/Source/core/editing/commands/ReplaceNodeWithSpanCommand.cpp b/third_party/WebKit/Source/core/editing/commands/ReplaceNodeWithSpanCommand.cpp index a03ef62..8a945b5 100644 --- a/third_party/WebKit/Source/core/editing/commands/ReplaceNodeWithSpanCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/ReplaceNodeWithSpanCommand.cpp
@@ -45,12 +45,12 @@ : SimpleEditCommand(element->document()) , m_elementToReplace(element) { - ASSERT(m_elementToReplace); + DCHECK(m_elementToReplace); } static void swapInNodePreservingAttributesAndChildren(HTMLElement* newElement, HTMLElement& elementToReplace) { - ASSERT(elementToReplace.inShadowIncludingDocument()); + DCHECK(elementToReplace.inShadowIncludingDocument()) << elementToReplace; ContainerNode* parentNode = elementToReplace.parentNode(); parentNode->insertBefore(newElement, &elementToReplace);
diff --git a/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp b/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp index a4d52c5..f15fdc4a 100644 --- a/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp
@@ -158,7 +158,7 @@ TRACE_EVENT0("blink", "ReplacementFragment constructor"); Element* editableRoot = selection.rootEditableElement(); - ASSERT(editableRoot); + DCHECK(editableRoot); if (!editableRoot) return; @@ -284,7 +284,7 @@ HTMLElement* ReplacementFragment::insertFragmentForTestRendering(Element* rootEditableElement) { TRACE_EVENT0("blink", "ReplacementFragment::insertFragmentForTestRendering"); - ASSERT(m_document); + DCHECK(m_document); HTMLElement* holder = createDefaultParagraphElement(*m_document.get()); holder->appendChild(m_fragment); @@ -528,7 +528,7 @@ if (element->isHTMLElement()) { Vector<QualifiedName> attributes; HTMLElement* htmlElement = toHTMLElement(element); - ASSERT(htmlElement); + DCHECK(htmlElement); if (newInlineStyle->conflictsWithImplicitStyleOfElement(htmlElement)) { // e.g. <b style="font-weight: normal;"> is converted to <span style="font-weight: normal;"> @@ -974,8 +974,8 @@ { TRACE_EVENT0("blink", "ReplaceSelectionCommand::doApply"); const VisibleSelection selection = endingSelection(); - ASSERT(selection.isCaretOrRange()); - ASSERT(selection.start().anchorNode()); + DCHECK(selection.isCaretOrRange()); + DCHECK(selection.start().anchorNode()); if (!selection.isNonOrphanedCaretOrRange() || !selection.start().anchorNode()) return; @@ -1041,7 +1041,7 @@ return; } } else { - ASSERT(selection.isCaret()); + DCHECK(selection.isCaret()); if (fragment.hasInterchangeNewlineAtStart()) { const VisiblePosition next = nextPositionOf(visibleStart, CannotCrossEditingBoundary); if (isEndOfParagraph(visibleStart) && !isStartOfParagraph(visibleStart) && next.isNotNull()) @@ -1074,7 +1074,7 @@ return; // This will leave a br between the split. Node* br = endingSelection().start().anchorNode(); - ASSERT(isHTMLBRElement(br)); + DCHECK(isHTMLBRElement(br)) << br; // Insert content between the two blockquotes, but remove the br (since it was just a placeholder). insertionPos = positionInParentBeforeNode(*br); removeNode(br, editingState); @@ -1102,7 +1102,7 @@ // Adjust insertionPos to prevent nesting. // If the start was in a Mail blockquote, we will have already handled adjusting insertionPos above. if (m_preventNesting && enclosingBlockOfInsertionPos && !isTableCell(enclosingBlockOfInsertionPos) && !startIsInsideMailBlockquote) { - ASSERT(enclosingBlockOfInsertionPos != currentRoot); + DCHECK_NE(enclosingBlockOfInsertionPos, currentRoot); VisiblePosition visibleInsertionPos = createVisiblePosition(insertionPos); if (isEndOfBlock(visibleInsertionPos) && !(isStartOfBlock(visibleInsertionPos) && fragment.hasInterchangeNewlineAtEnd())) insertionPos = positionInParentAfterNode(*enclosingBlockOfInsertionPos); @@ -1174,7 +1174,7 @@ InsertedNodes insertedNodes; Node* refNode = fragment.firstChild(); - ASSERT(refNode); + DCHECK(refNode); Node* node = refNode->nextSibling(); fragment.removeNode(refNode); @@ -1491,7 +1491,7 @@ rebalanceWhitespaceAt(end); if (m_matchStyle) { - ASSERT(m_insertionStyle); + DCHECK(m_insertionStyle); applyStyle(m_insertionStyle.get(), start, end, editingState); if (editingState->isAborted()) return;
diff --git a/third_party/WebKit/Source/core/editing/commands/SetNodeAttributeCommand.cpp b/third_party/WebKit/Source/core/editing/commands/SetNodeAttributeCommand.cpp index f907bf2..10994938 100644 --- a/third_party/WebKit/Source/core/editing/commands/SetNodeAttributeCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/SetNodeAttributeCommand.cpp
@@ -37,7 +37,7 @@ , m_attribute(attribute) , m_value(value) { - ASSERT(m_element); + DCHECK(m_element); } void SetNodeAttributeCommand::doApply(EditingState*)
diff --git a/third_party/WebKit/Source/core/editing/commands/SimplifyMarkupCommand.cpp b/third_party/WebKit/Source/core/editing/commands/SimplifyMarkupCommand.cpp index dbe84cb..7dcce8f6 100644 --- a/third_party/WebKit/Source/core/editing/commands/SimplifyMarkupCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/SimplifyMarkupCommand.cpp
@@ -106,7 +106,7 @@ for (; pastLastNodeToRemove < nodesToRemove.size(); ++pastLastNodeToRemove) { if (nodesToRemove[pastLastNodeToRemove - 1]->parentNode() != nodesToRemove[pastLastNodeToRemove]) break; - ASSERT(nodesToRemove[pastLastNodeToRemove]->firstChild() == nodesToRemove[pastLastNodeToRemove]->lastChild()); + DCHECK_EQ(nodesToRemove[pastLastNodeToRemove]->firstChild(), nodesToRemove[pastLastNodeToRemove]->lastChild()); } ContainerNode* highestAncestorToRemove = nodesToRemove[pastLastNodeToRemove - 1].get();
diff --git a/third_party/WebKit/Source/core/editing/commands/SmartReplaceICU.cpp b/third_party/WebKit/Source/core/editing/commands/SmartReplaceICU.cpp index ad144a9..316e2122 100644 --- a/third_party/WebKit/Source/core/editing/commands/SmartReplaceICU.cpp +++ b/third_party/WebKit/Source/core/editing/commands/SmartReplaceICU.cpp
@@ -54,7 +54,7 @@ UErrorCode ec = U_ZERO_ERROR; String whitespaceAndNewline("[[:WSpace:] [\\u000A\\u000B\\u000C\\u000D\\u0085]]"); smartSet = uset_openPattern(whitespaceAndNewline.charactersWithNullTermination().data(), whitespaceAndNewline.length(), &ec); - ASSERT(U_SUCCESS(ec)); + DCHECK(U_SUCCESS(ec)) << ec; // CJK ranges uset_addRange(smartSet, 0x1100, 0x1100 + 256); // Hangul Jamo (0x1100 - 0x11FF) @@ -78,7 +78,7 @@ UErrorCode ec = U_ZERO_ERROR; String punctuationClass("[:P:]"); USet* icuPunct = uset_openPattern(punctuationClass.charactersWithNullTermination().data(), punctuationClass.length(), &ec); - ASSERT(U_SUCCESS(ec)); + DCHECK(U_SUCCESS(ec)) << ec; uset_addAll(smartSet, icuPunct); uset_close(icuPunct);
diff --git a/third_party/WebKit/Source/core/editing/commands/SplitElementCommand.cpp b/third_party/WebKit/Source/core/editing/commands/SplitElementCommand.cpp index 8a71022d..8181f84 100644 --- a/third_party/WebKit/Source/core/editing/commands/SplitElementCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/SplitElementCommand.cpp
@@ -38,9 +38,9 @@ , m_element2(element) , m_atChild(atChild) { - ASSERT(m_element2); - ASSERT(m_atChild); - ASSERT(m_atChild->parentNode() == m_element2); + DCHECK(m_element2); + DCHECK(m_atChild); + DCHECK_EQ(m_atChild->parentNode(), m_element2); } void SplitElementCommand::executeApply()
diff --git a/third_party/WebKit/Source/core/editing/commands/SplitTextNodeCommand.cpp b/third_party/WebKit/Source/core/editing/commands/SplitTextNodeCommand.cpp index 0d95952a..337da60 100644 --- a/third_party/WebKit/Source/core/editing/commands/SplitTextNodeCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/SplitTextNodeCommand.cpp
@@ -43,10 +43,10 @@ // the second node (i.e. the new node is inserted before the existing one). // That is not a fundamental dependency (i.e. it could be re-coded), but // rather is based on how this code happens to work. - ASSERT(m_text2); - ASSERT(m_text2->length() > 0); - ASSERT(m_offset > 0); - ASSERT(m_offset < m_text2->length()); + DCHECK(m_text2); + DCHECK_GT(m_text2->length(), 0u); + DCHECK_GT(m_offset, 0u); + DCHECK_LT(m_offset, m_text2->length()); } void SplitTextNodeCommand::doApply(EditingState*) @@ -60,7 +60,7 @@ return; m_text1 = Text::create(document(), prefixText); - ASSERT(m_text1); + DCHECK(m_text1); document().markers().copyMarkers(m_text2.get(), 0, m_offset, m_text1.get(), 0); insertText1AndTrimText2(); @@ -71,7 +71,7 @@ if (!m_text1 || !m_text1->hasEditableStyle()) return; - ASSERT(m_text1->document() == document()); + DCHECK_EQ(m_text1->document(), document()); String prefixText = m_text1->data();
diff --git a/third_party/WebKit/Source/core/editing/commands/SplitTextNodeContainingElementCommand.cpp b/third_party/WebKit/Source/core/editing/commands/SplitTextNodeContainingElementCommand.cpp index f896196..6bfa3012 100644 --- a/third_party/WebKit/Source/core/editing/commands/SplitTextNodeContainingElementCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/SplitTextNodeContainingElementCommand.cpp
@@ -35,14 +35,14 @@ SplitTextNodeContainingElementCommand::SplitTextNodeContainingElementCommand(Text* text, int offset) : CompositeEditCommand(text->document()), m_text(text), m_offset(offset) { - ASSERT(m_text); - ASSERT(m_text->length() > 0); + DCHECK(m_text); + DCHECK_GT(m_text->length(), 0u); } void SplitTextNodeContainingElementCommand::doApply(EditingState*) { - ASSERT(m_text); - ASSERT(m_offset > 0); + DCHECK(m_text); + DCHECK_GT(m_offset, 0); splitTextNode(m_text.get(), m_offset);
diff --git a/third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp b/third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp index 23da9ae..620c9ce8 100644 --- a/third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp
@@ -68,7 +68,7 @@ void TypingCommand::deleteSelection(Document& document, Options options) { LocalFrame* frame = document.frame(); - ASSERT(frame); + DCHECK(frame); if (!frame->selection().isRange()) return; @@ -124,7 +124,7 @@ void TypingCommand::updateSelectionIfDifferentFromCurrentSelection(TypingCommand* typingCommand, LocalFrame* frame) { - ASSERT(frame); + DCHECK(frame); VisibleSelection currentSelection = frame->selection().selection(); if (equalSelectionsInDOMTree(currentSelection, typingCommand->endingSelection())) return; @@ -153,7 +153,7 @@ void TypingCommand::insertText(Document& document, const String& text, Options options, TextCompositionType composition) { LocalFrame* frame = document.frame(); - ASSERT(frame); + DCHECK(frame); if (!text.isEmpty()) document.frame()->spellChecker().updateMarkersForWordsAffectedByEditing(isSpaceOrNewline(text[0])); @@ -165,7 +165,7 @@ void TypingCommand::insertText(Document& document, const String& text, const VisibleSelection& selectionForInsertion, Options options, TextCompositionType compositionType) { LocalFrame* frame = document.frame(); - ASSERT(frame); + DCHECK(frame); VisibleSelection currentSelection = frame->selection().selection(); @@ -239,7 +239,7 @@ TypingCommand* TypingCommand::lastTypingCommandIfStillOpenForTyping(LocalFrame* frame) { - ASSERT(frame); + DCHECK(frame); CompositeEditCommand* lastEditCommand = frame->editor().lastEditCommand(); if (!lastEditCommand || !lastEditCommand->isTypingCommand() || !static_cast<TypingCommand*>(lastEditCommand)->isOpenForMoreTyping()) @@ -562,7 +562,7 @@ break; } - ASSERT(!selectionToDelete.isNone()); + DCHECK(!selectionToDelete.isNone()); if (selectionToDelete.isNone()) return; @@ -656,7 +656,7 @@ break; } - ASSERT(!selectionToDelete.isNone()); + DCHECK(!selectionToDelete.isNone()); if (selectionToDelete.isNone()) return;
diff --git a/third_party/WebKit/Source/core/editing/commands/UndoStack.cpp b/third_party/WebKit/Source/core/editing/commands/UndoStack.cpp index 61dd173..778e50f 100644 --- a/third_party/WebKit/Source/core/editing/commands/UndoStack.cpp +++ b/third_party/WebKit/Source/core/editing/commands/UndoStack.cpp
@@ -110,7 +110,7 @@ UndoStep* step(back->get()); m_redoStack.remove(back); - ASSERT(!m_inRedo); + DCHECK(!m_inRedo); TemporaryChange<bool> redoScope(m_inRedo, true); step->reapply(); // reapply will call us back to push this command onto the undo stack.
diff --git a/third_party/WebKit/Source/core/editing/commands/WrapContentsInDummySpanCommand.cpp b/third_party/WebKit/Source/core/editing/commands/WrapContentsInDummySpanCommand.cpp index 29a0c805..fabe7d7 100644 --- a/third_party/WebKit/Source/core/editing/commands/WrapContentsInDummySpanCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/WrapContentsInDummySpanCommand.cpp
@@ -35,7 +35,7 @@ : SimpleEditCommand(element->document()) , m_element(element) { - ASSERT(m_element); + DCHECK(m_element); } void WrapContentsInDummySpanCommand::executeApply() @@ -58,7 +58,7 @@ void WrapContentsInDummySpanCommand::doUnapply() { - ASSERT(m_element); + DCHECK(m_element); if (!m_dummySpan || !m_element->hasEditableStyle()) return; @@ -74,7 +74,7 @@ void WrapContentsInDummySpanCommand::doReapply() { - ASSERT(m_element); + DCHECK(m_element); if (!m_dummySpan || !m_element->hasEditableStyle()) return;
diff --git a/third_party/WebKit/Source/core/editing/iterators/BackwardsCharacterIterator.cpp b/third_party/WebKit/Source/core/editing/iterators/BackwardsCharacterIterator.cpp index 338de62..2d6f8bb 100644 --- a/third_party/WebKit/Source/core/editing/iterators/BackwardsCharacterIterator.cpp +++ b/third_party/WebKit/Source/core/editing/iterators/BackwardsCharacterIterator.cpp
@@ -47,7 +47,7 @@ Node* n = m_textIterator.startContainer(); return PositionTemplate<Strategy>::editingPositionOf(n, m_textIterator.endOffset() - m_runOffset); } - ASSERT(!m_runOffset); + DCHECK(!m_runOffset); } return m_textIterator.endPosition(); } @@ -56,7 +56,7 @@ void BackwardsCharacterIteratorAlgorithm<Strategy>::advance(int count) { if (count <= 0) { - ASSERT(!count); + DCHECK(!count); return; }
diff --git a/third_party/WebKit/Source/core/editing/iterators/BackwardsTextBuffer.cpp b/third_party/WebKit/Source/core/editing/iterators/BackwardsTextBuffer.cpp index 9d3cc06..3eaec084 100644 --- a/third_party/WebKit/Source/core/editing/iterators/BackwardsTextBuffer.cpp +++ b/third_party/WebKit/Source/core/editing/iterators/BackwardsTextBuffer.cpp
@@ -13,14 +13,14 @@ UChar* BackwardsTextBuffer::calcDestination(size_t length) { - ASSERT(size() + length <= capacity()); + DCHECK_LE(size() + length, capacity()); return bufferEnd() - size() - length; } void BackwardsTextBuffer::shiftData(size_t oldCapacity) { - ASSERT(oldCapacity <= capacity()); - ASSERT(size() <= oldCapacity); + DCHECK_LE(oldCapacity, capacity()); + DCHECK_LE(size(), oldCapacity); std::copy_backward(bufferBegin() + oldCapacity - size(), bufferBegin() + oldCapacity, bufferEnd()); }
diff --git a/third_party/WebKit/Source/core/editing/iterators/CharacterIterator.cpp b/third_party/WebKit/Source/core/editing/iterators/CharacterIterator.cpp index 4f73fce..aca5379 100644 --- a/third_party/WebKit/Source/core/editing/iterators/CharacterIterator.cpp +++ b/third_party/WebKit/Source/core/editing/iterators/CharacterIterator.cpp
@@ -83,7 +83,7 @@ if (!m_textIterator.atEnd()) { if (m_textIterator.length() > 1) return m_textIterator.startOffsetInCurrentContainer() + m_runOffset; - ASSERT(!m_runOffset); + DCHECK(!m_runOffset); } return m_textIterator.startOffsetInCurrentContainer(); } @@ -94,7 +94,7 @@ if (!m_textIterator.atEnd()) { if (m_textIterator.length() > 1) return m_textIterator.startOffsetInCurrentContainer() + m_runOffset + 1; - ASSERT(!m_runOffset); + DCHECK(!m_runOffset); } return m_textIterator.endOffsetInCurrentContainer(); } @@ -108,7 +108,7 @@ int offset = m_textIterator.startOffsetInCurrentContainer() + m_runOffset; return PositionTemplate<Strategy>::editingPositionOf(n, offset); } - ASSERT(!m_runOffset); + DCHECK(!m_runOffset); } return m_textIterator.startPositionInCurrentContainer(); } @@ -122,7 +122,7 @@ int offset = m_textIterator.startOffsetInCurrentContainer() + m_runOffset; return PositionTemplate<Strategy>::editingPositionOf(n, offset + 1); } - ASSERT(!m_runOffset); + DCHECK(!m_runOffset); } return m_textIterator.endPositionInCurrentContainer(); } @@ -131,7 +131,7 @@ void CharacterIteratorAlgorithm<Strategy>::advance(int count) { if (count <= 0) { - ASSERT(!count); + DCHECK(!count); return; }
diff --git a/third_party/WebKit/Source/core/editing/iterators/ForwardsTextBuffer.cpp b/third_party/WebKit/Source/core/editing/iterators/ForwardsTextBuffer.cpp index 9bc4268..707706c 100644 --- a/third_party/WebKit/Source/core/editing/iterators/ForwardsTextBuffer.cpp +++ b/third_party/WebKit/Source/core/editing/iterators/ForwardsTextBuffer.cpp
@@ -13,7 +13,7 @@ UChar* ForwardsTextBuffer::calcDestination(size_t length) { - ASSERT(size() + length <= capacity()); + DCHECK_LE(size() + length, capacity()); return bufferBegin() + size(); }
diff --git a/third_party/WebKit/Source/core/editing/iterators/FullyClippedStateStack.cpp b/third_party/WebKit/Source/core/editing/iterators/FullyClippedStateStack.cpp index 17cc709..3595027 100644 --- a/third_party/WebKit/Source/core/editing/iterators/FullyClippedStateStack.cpp +++ b/third_party/WebKit/Source/core/editing/iterators/FullyClippedStateStack.cpp
@@ -54,7 +54,7 @@ template<typename Strategy> void FullyClippedStateStackAlgorithm<Strategy>::pushFullyClippedState(Node* node) { - ASSERT(size() == depthCrossingShadowBoundaries<Strategy>(*node)); + DCHECK_EQ(size(), depthCrossingShadowBoundaries<Strategy>(*node)); // FIXME: m_fullyClippedStack was added in response to <https://bugs.webkit.org/show_bug.cgi?id=26364> // ("Search can find text that's hidden by overflow:hidden"), but the logic here will not work correctly if @@ -84,7 +84,7 @@ pushFullyClippedState(ancestry[ancestrySize - i - 1]); pushFullyClippedState(node); - ASSERT(size() == 1 + depthCrossingShadowBoundaries<Strategy>(*node)); + DCHECK_EQ(size(), 1 + depthCrossingShadowBoundaries<Strategy>(*node)); } template class CORE_TEMPLATE_EXPORT FullyClippedStateStackAlgorithm<EditingStrategy>;
diff --git a/third_party/WebKit/Source/core/editing/iterators/SearchBuffer.cpp b/third_party/WebKit/Source/core/editing/iterators/SearchBuffer.cpp index d278e4f..8037c1a 100644 --- a/third_party/WebKit/Source/core/editing/iterators/SearchBuffer.cpp +++ b/third_party/WebKit/Source/core/editing/iterators/SearchBuffer.cpp
@@ -52,7 +52,7 @@ UErrorCode status = U_ZERO_ERROR; String searchCollatorName = currentSearchLocaleID() + String("@collation=search"); UStringSearch* searcher = usearch_open(&newlineCharacter, 1, &newlineCharacter, 1, searchCollatorName.utf8().data(), 0, &status); - ASSERT(status == U_ZERO_ERROR || status == U_USING_FALLBACK_WARNING || status == U_USING_DEFAULT_WARNING); + DCHECK(status == U_ZERO_ERROR || status == U_USING_FALLBACK_WARNING || status == U_USING_DEFAULT_WARNING) << status; return searcher; } @@ -65,7 +65,7 @@ static inline void lockSearcher() { #if ENABLE(ASSERT) - ASSERT(!searcherInUse); + DCHECK(!searcherInUse); searcherInUse = true; #endif } @@ -73,7 +73,7 @@ static inline void unlockSearcher() { #if ENABLE(ASSERT) - ASSERT(searcherInUse); + DCHECK(searcherInUse); searcherInUse = false; #endif } @@ -86,7 +86,7 @@ , m_needsMoreContext(options & AtWordStarts) , m_targetRequiresKanaWorkaround(containsKanaLetters(target)) { - ASSERT(!target.isEmpty()); + DCHECK(!target.isEmpty()) << target; target.appendTo(m_target); // FIXME: We'd like to tailor the searcher to fold quote marks for us instead @@ -125,7 +125,7 @@ UErrorCode status = U_ZERO_ERROR; usearch_setPattern(searcher, m_target.data(), targetLength, &status); - ASSERT(status == U_ZERO_ERROR); + DCHECK_EQ(status, U_ZERO_ERROR); // The kana workaround requires a normalized copy of the target string. if (m_targetRequiresKanaWorkaround) @@ -140,7 +140,7 @@ UErrorCode status = U_ZERO_ERROR; usearch_setPattern(blink::searcher(), &newlineCharacter, 1, &status); usearch_setText(blink::searcher(), &newlineCharacter, 1, &status); - ASSERT(status == U_ZERO_ERROR); + DCHECK_EQ(status, U_ZERO_ERROR); unlockSearcher(); } @@ -148,7 +148,7 @@ template<typename CharType> inline void SearchBuffer::append(const CharType* characters, size_t length) { - ASSERT(length); + DCHECK(length); if (m_atBreak) { m_buffer.shrink(0); @@ -162,7 +162,7 @@ size_t oldLength = m_buffer.size(); size_t usableLength = std::min(m_buffer.capacity() - oldLength, length); - ASSERT(usableLength); + DCHECK(usableLength); m_buffer.resize(oldLength + usableLength); UChar* destination = m_buffer.data() + oldLength; StringImpl::copyChars(destination, characters, usableLength); @@ -177,8 +177,8 @@ inline void SearchBuffer::prependContext(const UChar* characters, size_t length) { - ASSERT(m_needsMoreContext); - ASSERT(m_prefixLength == m_buffer.size()); + DCHECK(m_needsMoreContext); + DCHECK_EQ(m_prefixLength, m_buffer.size()); if (!length) return; @@ -225,7 +225,7 @@ inline bool SearchBuffer::isWordStartMatch(size_t start, size_t length) const { - ASSERT(m_options & AtWordStarts); + DCHECK(m_options & AtWordStarts); if (!start) return true; @@ -297,17 +297,17 @@ UErrorCode status = U_ZERO_ERROR; usearch_setText(searcher, m_buffer.data(), size, &status); - ASSERT(status == U_ZERO_ERROR); + DCHECK_EQ(status, U_ZERO_ERROR); usearch_setOffset(searcher, m_prefixLength, &status); - ASSERT(status == U_ZERO_ERROR); + DCHECK_EQ(status, U_ZERO_ERROR); int matchStart = usearch_next(searcher, &status); - ASSERT(status == U_ZERO_ERROR); + DCHECK_EQ(status, U_ZERO_ERROR); nextMatch: if (!(matchStart >= 0 && static_cast<size_t>(matchStart) < size)) { - ASSERT(matchStart == USEARCH_DONE); + DCHECK_EQ(matchStart, USEARCH_DONE); return 0; } @@ -336,7 +336,7 @@ // If this match is "bad", move on to the next match. if (isBadMatch(m_buffer.data() + matchStart, matchedLength) || ((m_options & AtWordStarts) && !isWordStartMatch(matchStart, matchedLength))) { matchStart = usearch_next(searcher, &status); - ASSERT(status == U_ZERO_ERROR); + DCHECK_EQ(status, U_ZERO_ERROR); goto nextMatch; } @@ -399,7 +399,7 @@ if (size_t newMatchLength = buffer.search(matchStartOffset)) { // Note that we found a match, and where we found it. size_t lastCharacterInBufferOffset = it.characterOffset(); - ASSERT(lastCharacterInBufferOffset >= matchStartOffset); + DCHECK_GE(lastCharacterInBufferOffset, matchStartOffset); matchStart = lastCharacterInBufferOffset - matchStartOffset; matchLength = newMatchLength; // If searching forward, stop on the first match. @@ -425,7 +425,7 @@ // CharacterIterator requires layoutObjects to be up-to-date. if (!inputRange.startPosition().inShadowIncludingDocument()) return EphemeralRangeTemplate<Strategy>(); - ASSERT(inputRange.startPosition().document() == inputRange.endPosition().document()); + DCHECK_EQ(inputRange.startPosition().document(), inputRange.endPosition().document()); // FIXME: Reduce the code duplication with above (but how?). size_t matchStart;
diff --git a/third_party/WebKit/Source/core/editing/iterators/SimplifiedBackwardsTextIterator.cpp b/third_party/WebKit/Source/core/editing/iterators/SimplifiedBackwardsTextIterator.cpp index 4fe31d2..c3c8fad 100644 --- a/third_party/WebKit/Source/core/editing/iterators/SimplifiedBackwardsTextIterator.cpp +++ b/third_party/WebKit/Source/core/editing/iterators/SimplifiedBackwardsTextIterator.cpp
@@ -79,7 +79,7 @@ , m_shouldStop(false) , m_emitsOriginalText(false) { - ASSERT(behavior == TextIteratorDefaultBehavior || behavior == TextIteratorStopsOnFormControls); + DCHECK(behavior == TextIteratorDefaultBehavior || behavior == TextIteratorStopsOnFormControls) << behavior; Node* startNode = start.anchorNode(); if (!startNode) @@ -137,7 +137,7 @@ template <typename Strategy> void SimplifiedBackwardsTextIteratorAlgorithm<Strategy>::advance() { - ASSERT(m_positionNode); + DCHECK(m_positionNode); if (m_shouldStop) return; @@ -235,9 +235,11 @@ m_positionNode = m_node; m_positionStartOffset = m_offset; - ASSERT(0 <= m_positionStartOffset - offsetInNode && m_positionStartOffset - offsetInNode <= static_cast<int>(text.length())); - ASSERT(1 <= m_positionEndOffset - offsetInNode && m_positionEndOffset - offsetInNode <= static_cast<int>(text.length())); - ASSERT(m_positionStartOffset <= m_positionEndOffset); + DCHECK_LE(0, m_positionStartOffset - offsetInNode); + DCHECK_LE(m_positionStartOffset - offsetInNode, static_cast<int>(text.length())); + DCHECK_LE(1, m_positionEndOffset - offsetInNode); + DCHECK_LE(m_positionEndOffset - offsetInNode, static_cast<int>(text.length())); + DCHECK_LE(m_positionStartOffset, m_positionEndOffset); m_textLength = m_positionEndOffset - m_positionStartOffset; m_textOffset = m_positionStartOffset - offsetInNode; @@ -262,7 +264,7 @@ LayoutTextFragment* fragment = toLayoutTextFragment(layoutObject); int offsetAfterFirstLetter = fragment->start(); if (startOffset >= offsetAfterFirstLetter) { - ASSERT(!m_shouldHandleFirstLetter); + DCHECK(!m_shouldHandleFirstLetter); offsetInNode = offsetAfterFirstLetter; return layoutObject; } @@ -276,12 +278,12 @@ m_shouldHandleFirstLetter = false; offsetInNode = 0; - ASSERT(fragment->isRemainingTextLayoutObject()); - ASSERT(fragment->firstLetterPseudoElement()); + DCHECK(fragment->isRemainingTextLayoutObject()); + DCHECK(fragment->firstLetterPseudoElement()); LayoutObject* pseudoElementLayoutObject = fragment->firstLetterPseudoElement()->layoutObject(); - ASSERT(pseudoElementLayoutObject); - ASSERT(pseudoElementLayoutObject->slowFirstChild()); + DCHECK(pseudoElementLayoutObject); + DCHECK(pseudoElementLayoutObject->slowFirstChild()); LayoutText* firstLetterLayoutObject = toLayoutText(pseudoElementLayoutObject->slowFirstChild()); m_offset = firstLetterLayoutObject->caretMaxOffset(); @@ -396,8 +398,8 @@ if (!(index < static_cast<unsigned>(length()))) return 0; if (m_singleCharacterBuffer) { - ASSERT(index == 0); - ASSERT(length() == 1); + DCHECK_EQ(index, 0u); + DCHECK_EQ(length(), 1); return m_singleCharacterBuffer; } return m_textContainer[m_textOffset + m_textLength - 1 - index]; @@ -406,7 +408,7 @@ template <typename Strategy> bool SimplifiedBackwardsTextIteratorAlgorithm<Strategy>::isBetweenSurrogatePair(int position) const { - ASSERT(position >= 0); + DCHECK_GE(position, 0); return position > 0 && position < length() && U16_IS_TRAIL(characterAt(position - 1)) && U16_IS_LEAD(characterAt(position)); } @@ -430,14 +432,14 @@ template <typename Strategy> void SimplifiedBackwardsTextIteratorAlgorithm<Strategy>::copyCodeUnitsTo(BackwardsTextBuffer* output, int position, int copyLength) const { - ASSERT(position >= 0); - ASSERT(copyLength >= 0); - ASSERT(position + copyLength <= m_textLength); + DCHECK_GE(position, 0); + DCHECK_GE(copyLength, 0); + DCHECK_LE(position + copyLength, m_textLength); // Make sure there's no integer overflow. - ASSERT(position + copyLength >= position); + DCHECK_GE(position + copyLength, position); if (m_textLength == 0 || copyLength == 0) return; - ASSERT(output); + DCHECK(output); if (m_singleCharacterBuffer) { output->pushCharacters(m_singleCharacterBuffer, 1); return;
diff --git a/third_party/WebKit/Source/core/editing/iterators/SimplifiedBackwardsTextIteratorTest.cpp b/third_party/WebKit/Source/core/editing/iterators/SimplifiedBackwardsTextIteratorTest.cpp index bed28cd..17fca10 100644 --- a/third_party/WebKit/Source/core/editing/iterators/SimplifiedBackwardsTextIteratorTest.cpp +++ b/third_party/WebKit/Source/core/editing/iterators/SimplifiedBackwardsTextIteratorTest.cpp
@@ -31,7 +31,6 @@ const char* shadowContent = "three <content select=#two></content> <content select=#one></content> zero"; setBodyContent(bodyContent); setShadowContent(shadowContent, "host"); - updateLayoutAndStyleForPainting(); Element* host = document().getElementById("host"); @@ -48,7 +47,6 @@ const char* shadowContent = "three <content select=#two></content> <content select=#one></content> zero"; setBodyContent(bodyContent); setShadowContent(shadowContent, "host"); - updateLayoutAndStyleForPainting(); Element* host = document().getElementById("host"); @@ -96,7 +94,6 @@ const char* shadowContent = "three <content select=#two></content> <content select=#one></content> zero"; setBodyContent(bodyContent); setShadowContent(shadowContent, "host"); - updateLayoutAndStyleForPainting(); Element* host = document().getElementById("host"); const char* message = "|backIter%d| should have emitted '%s' in reverse order."; @@ -145,7 +142,6 @@ { const char* bodyContent = "𓀀𓀁𓀂 𓅀𓅁."; setBodyContent(bodyContent); - updateLayoutAndStyleForPainting(); const UChar expected[] = {0xD80C, 0xDC00, 0xD80C, 0xDC01, 0xD80C, 0xDC02, ' ', 0xD80C, 0xDD40, 0xD80C, 0xDD41, '.'};
diff --git a/third_party/WebKit/Source/core/editing/iterators/TextBufferBase.h b/third_party/WebKit/Source/core/editing/iterators/TextBufferBase.h index 28d0a6a..95a0624 100644 --- a/third_party/WebKit/Source/core/editing/iterators/TextBufferBase.h +++ b/third_party/WebKit/Source/core/editing/iterators/TextBufferBase.h
@@ -19,7 +19,7 @@ size_t size() const { return m_size; } bool isEmpty() const { return m_size == 0; } size_t capacity() const { return m_buffer.capacity(); } - const UChar& operator[](size_t index) const { ASSERT(index < m_size); return data()[index]; } + const UChar& operator[](size_t index) const { DCHECK_LT(index, m_size); return data()[index]; } virtual const UChar* data() const = 0; void pushCharacters(UChar, size_t length);
diff --git a/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp b/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp index cd88eb76..a924e23 100644 --- a/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp +++ b/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp
@@ -108,7 +108,7 @@ int shadowDepthOf<EditingStrategy>(const Node& startContainer, const Node& endContainer) { const TreeScope* commonAncestorTreeScope = startContainer.treeScope().commonAncestorTreeScope(endContainer.treeScope()); - ASSERT(commonAncestorTreeScope); + DCHECK(commonAncestorTreeScope); int shadowDepth = 0; for (const TreeScope* treeScope = &startContainer.treeScope(); treeScope != commonAncestorTreeScope; treeScope = treeScope->parentTreeScope()) ++shadowDepth; @@ -144,8 +144,8 @@ // The call to emitsOriginalText() must occur after m_behavior is initialized. , m_textState(emitsOriginalText()) { - ASSERT(start.isNotNull()); - ASSERT(end.isNotNull()); + DCHECK(start.isNotNull()); + DCHECK(end.isNotNull()); // Updates layout here since, |Position.compareTo()| and |initialize()| // assume layout tree is up-to-date. start.document()->updateLayoutIgnorePendingStylesheets(); @@ -159,8 +159,8 @@ template<typename Strategy> void TextIteratorAlgorithm<Strategy>::initialize(Node* startContainer, int startOffset, Node* endContainer, int endOffset) { - ASSERT(startContainer); - ASSERT(endContainer); + DCHECK(startContainer); + DCHECK(endContainer); // Remember the range - this does not change. m_startContainer = startContainer; @@ -226,7 +226,8 @@ if (m_shouldStop) return; - ASSERT(!m_node || !m_node->document().needsLayoutTreeUpdate()); + if (m_node) + DCHECK(!m_node->document().needsLayoutTreeUpdate()) << m_node; m_textState.resetRunInformation(); @@ -286,7 +287,7 @@ if (m_iterationProgress < HandledOpenShadowRoots) { if (entersOpenShadowRoots() && m_node->isElementNode() && toElement(m_node)->openShadowRoot()) { ShadowRoot* youngestShadowRoot = toElement(m_node)->openShadowRoot(); - ASSERT(youngestShadowRoot->type() == ShadowRootType::V0 || youngestShadowRoot->type() == ShadowRootType::Open); + DCHECK(youngestShadowRoot->type() == ShadowRootType::V0 || youngestShadowRoot->type() == ShadowRootType::Open); m_node = youngestShadowRoot; m_iterationProgress = HandledNone; ++m_shadowDepth; @@ -301,7 +302,7 @@ if (m_iterationProgress < HandledUserAgentShadowRoot) { if (entersTextControls() && layoutObject->isTextControl()) { ShadowRoot* userAgentShadowRoot = toElement(m_node)->userAgentShadowRoot(); - ASSERT(userAgentShadowRoot->type() == ShadowRootType::UserAgent); + DCHECK(userAgentShadowRoot->type() == ShadowRootType::UserAgent); m_node = userAgentShadowRoot; m_iterationProgress = HandledNone; ++m_shadowDepth; @@ -393,7 +394,7 @@ } else { // If we are in a closed or user-agent shadow root, then go back to the host. // TODO(kochi): Make sure we treat closed shadow as user agent shadow here. - ASSERT(shadowRoot->type() == ShadowRootType::Closed || shadowRoot->type() == ShadowRootType::UserAgent); + DCHECK(shadowRoot->type() == ShadowRootType::Closed || shadowRoot->type() == ShadowRootType::UserAgent); m_node = shadowRoot->host(); m_iterationProgress = HandledUserAgentShadowRoot; --m_shadowDepth; @@ -433,7 +434,7 @@ if (!fragment->isRemainingTextLayoutObject()) return false; - ASSERT(fragment->firstLetterPseudoElement()); + DCHECK(fragment->firstLetterPseudoElement()); LayoutObject* pseudoElementLayoutObject = fragment->firstLetterPseudoElement()->layoutObject(); return pseudoElementLayoutObject && pseudoElementLayoutObject->style()->visibility() == VISIBLE; } @@ -575,7 +576,7 @@ m_textBox = 0; return; } - ASSERT(!nextTextBox || nextTextBox->getLineLayoutItem().isEqual(layoutObject)); + DCHECK(!nextTextBox || nextTextBox->getLineLayoutItem().isEqual(layoutObject)); if (runStart < runEnd) { // Handle either a single newline character (which becomes a space), @@ -641,7 +642,7 @@ return; LayoutObject* firstLetter = pseudoLayoutObject->slowFirstChild(); - ASSERT(firstLetter); + DCHECK(firstLetter); m_remainingTextBox = m_textBox; m_textBox = toLayoutText(firstLetter)->firstTextBox(); @@ -972,7 +973,7 @@ // insert a newline with a position following this block's contents. spliceBuffer(newlineCharacter, Strategy::parent(*baseNode), baseNode, 1, 1); // remember whether to later add a newline for the current node - ASSERT(!m_needsAnotherNewline); + DCHECK(!m_needsAnotherNewline); m_needsAnotherNewline = addNewline; } else if (addNewline) { // insert a newline with a position following this block's contents. @@ -1050,7 +1051,7 @@ m_textState.flushPositionOffsets(); return m_textState.positionStartOffset(); } - ASSERT(m_endContainer); + DCHECK(m_endContainer); return m_endOffset; } @@ -1061,7 +1062,7 @@ m_textState.flushPositionOffsets(); return m_textState.positionEndOffset(); } - ASSERT(m_endContainer); + DCHECK(m_endContainer); return m_endOffset; } @@ -1071,7 +1072,7 @@ if (m_textState.positionNode()) { return m_textState.positionNode(); } - ASSERT(m_endContainer); + DCHECK(m_endContainer); return m_endContainer; } @@ -1109,7 +1110,7 @@ template <typename Strategy> bool TextIteratorAlgorithm<Strategy>::isBetweenSurrogatePair(int position) const { - ASSERT(position >= 0); + DCHECK_GE(position, 0); return position > 0 && position < length() && U16_IS_LEAD(characterAt(position - 1)) && U16_IS_TRAIL(characterAt(position)); }
diff --git a/third_party/WebKit/Source/core/editing/iterators/TextIteratorTest.cpp b/third_party/WebKit/Source/core/editing/iterators/TextIteratorTest.cpp index a2725be..19345b6c 100644 --- a/third_party/WebKit/Source/core/editing/iterators/TextIteratorTest.cpp +++ b/third_party/WebKit/Source/core/editing/iterators/TextIteratorTest.cpp
@@ -400,7 +400,6 @@ const char* shadowContent = "three <content select=#two></content> <content select=#one></content> zero"; setBodyContent(bodyContent); setShadowContent(shadowContent, "host"); - updateLayoutAndStyleForPainting(); Element* host = document().getElementById("host"); const char* message = "|iter%d| should have emitted '%s'."; @@ -451,7 +450,6 @@ const char* shadowContent = "three <content select=#two></content> <content select=#one></content> zero"; setBodyContent(bodyContent); setShadowContent(shadowContent, "host"); - updateLayoutAndStyleForPainting(); Element* host = document().getElementById("host"); @@ -497,7 +495,6 @@ { const char* bodyContent = "𓀀𓀁𓀂 𓅀𓅁."; setBodyContent(bodyContent); - updateLayoutAndStyleForPainting(); const UChar expected[] = {0xD80C, 0xDC00, 0xD80C, 0xDC01, 0xD80C, 0xDC02, ' ', 0xD80C, 0xDD40, 0xD80C, 0xDD41, '.'};
diff --git a/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextState.cpp b/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextState.cpp index ecfab530..e5ff33e 100644 --- a/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextState.cpp +++ b/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextState.cpp
@@ -46,8 +46,8 @@ return 0; if (m_singleCharacterBuffer) { - ASSERT(!index); - ASSERT(length() == 1); + DCHECK_EQ(index, 0u); + DCHECK_EQ(length(), 1); return m_singleCharacterBuffer; } @@ -61,8 +61,8 @@ if (!length) return emptyString(); if (m_singleCharacterBuffer) { - ASSERT(!position); - ASSERT(length == 1); + DCHECK_EQ(position, 0u); + DCHECK_EQ(length, 1u); return String(&m_singleCharacterBuffer, 1); } return string().substring(positionStartOffset() + position, length); @@ -74,7 +74,7 @@ if (!lengthToAppend) return; if (m_singleCharacterBuffer) { - ASSERT(!position); + DCHECK_EQ(position, 0u); builder.append(m_singleCharacterBuffer); } else { builder.append(string(), positionStartOffset() + position, lengthToAppend); @@ -113,7 +113,7 @@ void TextIteratorTextState::spliceBuffer(UChar c, Node* textNode, Node* offsetBaseNode, int textStartOffset, int textEndOffset) { - ASSERT(textNode); + DCHECK(textNode); m_hasEmitted = true; // Remember information with which to construct the TextIterator::range(). @@ -125,7 +125,7 @@ // remember information with which to construct the TextIterator::characters() and length() m_singleCharacterBuffer = c; - ASSERT(m_singleCharacterBuffer); + DCHECK(m_singleCharacterBuffer); m_textLength = 1; // remember some iteration state @@ -134,12 +134,14 @@ void TextIteratorTextState::emitText(Node* textNode, LayoutText* layoutObject, int textStartOffset, int textEndOffset) { - ASSERT(textNode); + DCHECK(textNode); m_text = m_emitsOriginalText ? layoutObject->originalText() : layoutObject->text(); - ASSERT(!m_text.isEmpty()); - ASSERT(0 <= textStartOffset && textStartOffset < static_cast<int>(m_text.length())); - ASSERT(0 <= textEndOffset && textEndOffset <= static_cast<int>(m_text.length())); - ASSERT(textStartOffset <= textEndOffset); + DCHECK(!m_text.isEmpty()); + DCHECK_LE(0, textStartOffset); + DCHECK_LT(textStartOffset, static_cast<int>(m_text.length())); + DCHECK_LE(0, textEndOffset); + DCHECK_LE(textEndOffset, static_cast<int>(m_text.length())); + DCHECK_LE(textStartOffset, textEndOffset); m_positionNode = textNode; m_positionOffsetBaseNode = nullptr; @@ -159,10 +161,10 @@ ASSERT_WITH_SECURITY_IMPLICATION(position + lengthToAppend >= position); if (!lengthToAppend) return; - ASSERT(output); + DCHECK(output); if (m_singleCharacterBuffer) { - ASSERT(!position); - ASSERT(length() == 1); + DCHECK_EQ(position, 0u); + DCHECK_EQ(length(), 1); output->pushCharacters(m_singleCharacterBuffer, 1); return; }
diff --git a/third_party/WebKit/Source/core/editing/iterators/WordAwareIterator.cpp b/third_party/WebKit/Source/core/editing/iterators/WordAwareIterator.cpp index c2c9ed95..8c272b14 100644 --- a/third_party/WebKit/Source/core/editing/iterators/WordAwareIterator.cpp +++ b/third_party/WebKit/Source/core/editing/iterators/WordAwareIterator.cpp
@@ -47,7 +47,7 @@ // If last time we did a look-ahead, start with that looked-ahead chunk now if (!m_didLookAhead) { - ASSERT(!m_textIterator.atEnd()); + DCHECK(!m_textIterator.atEnd()); m_textIterator.advance(); } m_didLookAhead = false;
diff --git a/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp index 9294e4b9..0668350 100644 --- a/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp +++ b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp
@@ -127,7 +127,7 @@ for (; !markedText.atEnd(); markedText.advance()) { if (!possiblyHasMarkers(markerTypes)) return; - ASSERT(!m_markers.isEmpty()); + DCHECK(!m_markers.isEmpty()); int startOffset = markedText.startOffsetInCurrentContainer(); int endOffset = markedText.endOffsetInCurrentContainer(); @@ -189,7 +189,7 @@ void DocumentMarkerController::addMarker(Node* node, const DocumentMarker& newMarker) { - ASSERT(newMarker.endOffset() >= newMarker.startOffset()); + DCHECK_GE(newMarker.endOffset(), newMarker.startOffset()); if (newMarker.endOffset() == newMarker.startOffset()) return; @@ -248,7 +248,7 @@ if (!possiblyHasMarkers(DocumentMarker::AllMarkers())) return; - ASSERT(!m_markers.isEmpty()); + DCHECK(!m_markers.isEmpty()); MarkerLists* markers = m_markers.get(srcNode); if (!markers) @@ -293,7 +293,7 @@ if (!possiblyHasMarkers(markerTypes)) return; - ASSERT(!(m_markers.isEmpty())); + DCHECK(!(m_markers.isEmpty())); MarkerLists* markers = m_markers.get(node); if (!markers) @@ -371,7 +371,7 @@ { if (!possiblyHasMarkers(markerType)) return 0; - ASSERT(!(m_markers.isEmpty())); + DCHECK(!(m_markers.isEmpty())); // outer loop: process each node that contains any markers MarkerMap::iterator end = m_markers.end(); @@ -434,10 +434,10 @@ DocumentMarkerVector foundMarkers; Node* startContainer = range.startPosition().computeContainerNode(); - ASSERT(startContainer); + DCHECK(startContainer); unsigned startOffset = static_cast<unsigned>(range.startPosition().computeOffsetInContainerNode()); Node* endContainer = range.endPosition().computeContainerNode(); - ASSERT(endContainer); + DCHECK(endContainer); unsigned endOffset = static_cast<unsigned>(range.endPosition().computeOffsetInContainerNode()); Node* pastLastNode = range.endPosition().nodeAsRangePastLastNode(); @@ -461,7 +461,7 @@ if (!possiblyHasMarkers(markerType)) return result; - ASSERT(!(m_markers.isEmpty())); + DCHECK(!(m_markers.isEmpty())); // outer loop: process each node MarkerMap::iterator end = m_markers.end(); @@ -516,7 +516,7 @@ { if (!possiblyHasMarkers(markerTypes)) return; - ASSERT(!m_markers.isEmpty()); + DCHECK(!m_markers.isEmpty()); MarkerMap::iterator iterator = m_markers.find(node); if (iterator != m_markers.end()) @@ -551,7 +551,7 @@ { if (!possiblyHasMarkers(markerTypes)) return; - ASSERT(!m_markers.isEmpty()); + DCHECK(!m_markers.isEmpty()); HeapVector<Member<const Node>> nodesWithMarkers; copyKeysToVector(m_markers, nodesWithMarkers); @@ -614,7 +614,7 @@ { if (!possiblyHasMarkers(markerTypes)) return; - ASSERT(!m_markers.isEmpty()); + DCHECK(!m_markers.isEmpty()); // outer loop: process each markered node in the document MarkerMap::iterator end = m_markers.end(); @@ -641,7 +641,7 @@ { if (!possiblyHasMarkers(DocumentMarker::AllMarkers())) return; - ASSERT(!m_markers.isEmpty()); + DCHECK(!m_markers.isEmpty()); MarkerLists* markers = m_markers.get(node); if (!markers) @@ -656,7 +656,7 @@ for (MarkerList::iterator marker = startPos; marker != list->end(); ++marker) { #if ENABLE(ASSERT) int startOffset = (*marker)->startOffset(); - ASSERT(startOffset + delta >= 0); + DCHECK_GE(startOffset + delta, 0); #endif (*marker)->shiftOffsets(delta); docDirty = true; @@ -675,7 +675,7 @@ if (!possiblyHasMarkers(DocumentMarker::AllMarkers())) return false; - ASSERT(!m_markers.isEmpty()); + DCHECK(!m_markers.isEmpty()); Node* startContainer = range->startContainer(); Node* endContainer = range->endContainer();
diff --git a/third_party/WebKit/Source/core/editing/serializers/MarkupFormatter.cpp b/third_party/WebKit/Source/core/editing/serializers/MarkupFormatter.cpp index a16bdc05..70eed4b 100644 --- a/third_party/WebKit/Source/core/editing/serializers/MarkupFormatter.cpp +++ b/third_party/WebKit/Source/core/editing/serializers/MarkupFormatter.cpp
@@ -95,7 +95,7 @@ if (!(offset + length)) return; - ASSERT(offset + length <= source.length()); + DCHECK_LE(offset + length, source.length()); if (source.is8Bit()) appendCharactersReplacingEntitiesInternal(result, source.characters8() + offset, length, entityMaps, WTF_ARRAY_LENGTH(entityMaps), entityMask); else @@ -191,7 +191,7 @@ void MarkupFormatter::appendQuotedURLAttributeValue(StringBuilder& result, const Element& element, const Attribute& attribute) { - ASSERT(element.isURLAttribute(attribute)); + DCHECK(element.isURLAttribute(attribute)) << element; const String resolvedURLString = resolveURLIfNeeded(element, attribute.value()); UChar quoteChar = '"'; String strippedURLString = resolvedURLString.stripWhiteSpace(); @@ -375,7 +375,7 @@ } } } - ASSERT(prefixedName.prefix()); + DCHECK(prefixedName.prefix()); appendNamespace(result, prefixedName.prefix(), attribute.namespaceURI(), *namespaces); } } @@ -420,7 +420,7 @@ bool MarkupFormatter::shouldAddNamespaceAttribute(const Attribute& attribute, const Element& element) const { // xmlns and xmlns:prefix attributes should be handled by another branch in appendAttribute. - ASSERT(attribute.namespaceURI() != XMLNSNames::xmlnsNamespaceURI); + DCHECK_NE(attribute.namespaceURI(), XMLNSNames::xmlnsNamespaceURI); // Attributes are in the null namespace by default. if (!attribute.namespaceURI())
diff --git a/third_party/WebKit/Source/core/editing/serializers/Serialization.cpp b/third_party/WebKit/Source/core/editing/serializers/Serialization.cpp index 4e748dbb..80e0694 100644 --- a/third_party/WebKit/Source/core/editing/serializers/Serialization.cpp +++ b/third_party/WebKit/Source/core/editing/serializers/Serialization.cpp
@@ -127,7 +127,7 @@ static bool isHTMLBlockElement(const Node* node) { - ASSERT(node); + DCHECK(node); return isHTMLTableCellElement(*node) || isNonTableCellHTMLBlockElement(node); } @@ -186,7 +186,7 @@ // For compatibility reason, we use container node of start and end // positions rather than first node and last node in selection. Node* commonAncestor = Strategy::commonAncestor(*startPosition.computeContainerNode(), *endPosition.computeContainerNode()); - ASSERT(commonAncestor); + DCHECK(commonAncestor); HTMLElement* specialCommonAncestor = nullptr; if (shouldAnnotate == AnnotateForInterchange) { // Include ancestors that aren't completely inside the range but are required to retain @@ -312,13 +312,13 @@ continue; } next = NodeTraversal::nextSkippingChildren(*node); - ASSERT(!node->contains(nodeAfterContext)); + DCHECK(!node->contains(nodeAfterContext)) << node << " " << nodeAfterContext; node->parentNode()->removeChild(node, ASSERT_NO_EXCEPTION); if (nodeBeforeContext == node) break; } - ASSERT(nodeAfterContext->parentNode()); + DCHECK(nodeAfterContext->parentNode()) << nodeAfterContext; for (Node* node = nodeAfterContext; node; node = next) { next = NodeTraversal::nextSkippingChildren(*node); node->parentNode()->removeChild(node, ASSERT_NO_EXCEPTION); @@ -390,7 +390,7 @@ return; } - ASSERT(string.find('\n') == kNotFound); + DCHECK_EQ(string.find('\n'), kNotFound) << string; Vector<String> tabList; string.split('\t', true, tabList); @@ -423,7 +423,7 @@ bool isPlainTextMarkup(Node* node) { - ASSERT(node); + DCHECK(node); if (!isHTMLDivElement(*node)) return false; @@ -515,7 +515,7 @@ DocumentFragment* createFragmentForInnerOuterHTML(const String& markup, Element* contextElement, ParserContentPolicy parserContentPolicy, const char* method, ExceptionState& exceptionState) { - ASSERT(contextElement); + DCHECK(contextElement); Document& document = isHTMLTemplateElement(*contextElement) ? contextElement->document().ensureTemplateDocument() : contextElement->document(); DocumentFragment* fragment = DocumentFragment::create(document); @@ -569,7 +569,7 @@ static inline bool isSupportedContainer(Element* element) { - ASSERT(element); + DCHECK(element); if (!element->isHTMLElement()) return true; @@ -583,7 +583,7 @@ DocumentFragment* createContextualFragment(const String& markup, Element* element, ParserContentPolicy parserContentPolicy, ExceptionState& exceptionState) { - ASSERT(element); + DCHECK(element); if (!isSupportedContainer(element)) { exceptionState.throwDOMException(NotSupportedError, "The range's container is '" + element->localName() + "', which is not supported."); return nullptr; @@ -612,7 +612,7 @@ void replaceChildrenWithFragment(ContainerNode* container, DocumentFragment* fragment, ExceptionState& exceptionState) { - ASSERT(container); + DCHECK(container); ContainerNode* containerNode(container); ChildListMutationScope mutation(*containerNode); @@ -640,7 +640,7 @@ void replaceChildrenWithText(ContainerNode* container, const String& text, ExceptionState& exceptionState) { - ASSERT(container); + DCHECK(container); ContainerNode* containerNode(container); ChildListMutationScope mutation(*containerNode); @@ -675,7 +675,7 @@ void mergeWithNextTextNode(Text* textNode, ExceptionState& exceptionState) { - ASSERT(textNode); + DCHECK(textNode); Node* next = textNode->nextSibling(); if (!next || !next->isTextNode()) return;
diff --git a/third_party/WebKit/Source/core/editing/serializers/StyledMarkupAccumulator.cpp b/third_party/WebKit/Source/core/editing/serializers/StyledMarkupAccumulator.cpp index 6216b46..10bc148 100644 --- a/third_party/WebKit/Source/core/editing/serializers/StyledMarkupAccumulator.cpp +++ b/third_party/WebKit/Source/core/editing/serializers/StyledMarkupAccumulator.cpp
@@ -97,8 +97,8 @@ { if (inlineStyle) { // wrappingStyleForAnnotatedSerialization should have removed -webkit-text-decorations-in-effect - ASSERT(!shouldAnnotate() || propertyMissingOrEqualToNone(inlineStyle->style(), CSSPropertyWebkitTextDecorationsInEffect)); - ASSERT(m_document); + DCHECK(!shouldAnnotate() || propertyMissingOrEqualToNone(inlineStyle->style(), CSSPropertyWebkitTextDecorationsInEffect)); + DCHECK(m_document); m_result.appendLiteral("<span style=\""); MarkupFormatter::appendAttributeValue(m_result, inlineStyle->style()->asText(), m_document->isHTMLDocument()); @@ -158,8 +158,8 @@ void StyledMarkupAccumulator::wrapWithStyleNode(StylePropertySet* style) { // wrappingStyleForSerialization should have removed -webkit-text-decorations-in-effect - ASSERT(propertyMissingOrEqualToNone(style, CSSPropertyWebkitTextDecorationsInEffect)); - ASSERT(m_document); + DCHECK(propertyMissingOrEqualToNone(style, CSSPropertyWebkitTextDecorationsInEffect)); + DCHECK(m_document); StringBuilder openTag; openTag.appendLiteral("<div style=\"");
diff --git a/third_party/WebKit/Source/core/editing/serializers/StyledMarkupSerializer.cpp b/third_party/WebKit/Source/core/editing/serializers/StyledMarkupSerializer.cpp index 76df939d..87a0de6 100644 --- a/third_party/WebKit/Source/core/editing/serializers/StyledMarkupSerializer.cpp +++ b/third_party/WebKit/Source/core/editing/serializers/StyledMarkupSerializer.cpp
@@ -152,7 +152,7 @@ template<typename Strategy> static bool areSameRanges(Node* node, const PositionTemplate<Strategy>& startPosition, const PositionTemplate<Strategy>& endPosition) { - ASSERT(node); + DCHECK(node); const EphemeralRange range = VisibleSelection::selectionFromContentsOfNode(node).toNormalizedEphemeralRange(); return toPositionInDOMTree(startPosition) == range.startPosition() && toPositionInDOMTree(endPosition) == range.endPosition(); } @@ -197,7 +197,7 @@ if (m_highestNodeToBeSerialized && lastClosed) { // TODO(hajimehoshi): This is calculated at createMarkupInternal too. Node* commonAncestor = Strategy::commonAncestor(*m_start.computeContainerNode(), *m_end.computeContainerNode()); - ASSERT(commonAncestor); + DCHECK(commonAncestor); HTMLBodyElement* body = toHTMLBodyElement(enclosingElementWithTag(firstPositionInNode(commonAncestor), bodyTag)); HTMLBodyElement* fullySelectedRoot = nullptr; // FIXME: Do this for all fully selected blocks, not just the body. @@ -262,7 +262,7 @@ , m_wrappingStyle(nullptr) { if (!m_accumulator) { - ASSERT(!m_lastClosed); + DCHECK_EQ(m_lastClosed, static_cast<decltype(m_lastClosed)>(nullptr)); return; } if (!m_lastClosed) @@ -323,7 +323,7 @@ // Close up the ancestors. while (!ancestorsToClose.isEmpty()) { ContainerNode* ancestor = ancestorsToClose.last(); - ASSERT(ancestor); + DCHECK(ancestor); if (next && next != pastEnd && Strategy::isDescendantOf(*next, *ancestor)) break; // Not at the end of the range, close ancestors up to sibling of next node. @@ -337,15 +337,15 @@ if (next == pastEnd || n == nextParent) continue; - ASSERT(n); + DCHECK(n); Node* lastAncestorClosedOrSelf = (lastClosed && Strategy::isDescendantOf(*n, *lastClosed)) ? lastClosed : n; for (ContainerNode* parent = Strategy::parent(*lastAncestorClosedOrSelf); parent && parent != nextParent; parent = Strategy::parent(*parent)) { // All ancestors that aren't in the ancestorsToClose list should either be a) unrendered: if (!parent->layoutObject()) continue; // or b) ancestors that we never encountered during a pre-order traversal starting at startNode: - ASSERT(startNode); - ASSERT(Strategy::isDescendantOf(*startNode, *parent)); + DCHECK(startNode); + DCHECK(Strategy::isDescendantOf(*startNode, *parent)); EditingStyle* style = createInlineStyleIfNeeded(*parent); wrapWithNode(*parent, style); lastClosed = parent;
diff --git a/third_party/WebKit/Source/core/editing/spellcheck/SpellCheckRequester.cpp b/third_party/WebKit/Source/core/editing/spellcheck/SpellCheckRequester.cpp index 7764305..0efee04 100644 --- a/third_party/WebKit/Source/core/editing/spellcheck/SpellCheckRequester.cpp +++ b/third_party/WebKit/Source/core/editing/spellcheck/SpellCheckRequester.cpp
@@ -51,11 +51,11 @@ , m_requestData(unrequestedTextCheckingSequence, text, mask, processType, documentMarkersInRange, documentMarkerOffsets) , m_requestNumber(requestNumber) { - ASSERT(m_checkingRange); - ASSERT(m_checkingRange->inShadowIncludingDocument()); - ASSERT(m_paragraphRange); - ASSERT(m_paragraphRange->inShadowIncludingDocument()); - ASSERT(m_rootEditableElement); + DCHECK(m_checkingRange); + DCHECK(m_checkingRange->inShadowIncludingDocument()); + DCHECK(m_paragraphRange); + DCHECK(m_paragraphRange->inShadowIncludingDocument()); + DCHECK(m_rootEditableElement); } SpellCheckRequest::~SpellCheckRequest() @@ -140,8 +140,8 @@ void SpellCheckRequest::setCheckerAndSequence(SpellCheckRequester* requester, int sequence) { - ASSERT(!m_requester); - ASSERT(m_requestData.sequence() == unrequestedTextCheckingSequence); + DCHECK(!m_requester); + DCHECK_EQ(m_requestData.sequence(), unrequestedTextCheckingSequence); m_requester = requester; m_requestData.m_sequence = sequence; } @@ -165,7 +165,7 @@ void SpellCheckRequester::timerFiredToProcessQueuedRequest(Timer<SpellCheckRequester>*) { - ASSERT(!m_requestQueue.isEmpty()); + DCHECK(!m_requestQueue.isEmpty()); if (m_requestQueue.isEmpty()) return; @@ -192,7 +192,7 @@ if (!request || !canCheckAsynchronously(request->paragraphRange())) return; - ASSERT(request->data().sequence() == unrequestedTextCheckingSequence); + DCHECK_EQ(request->data().sequence(), unrequestedTextCheckingSequence); int sequence = ++m_lastRequestSequence; if (sequence == unrequestedTextCheckingSequence) sequence = ++m_lastRequestSequence; @@ -228,7 +228,7 @@ void SpellCheckRequester::invokeRequest(SpellCheckRequest* request) { - ASSERT(!m_processingRequest); + DCHECK(!m_processingRequest); m_processingRequest = request; client().requestCheckingOfString(m_processingRequest); } @@ -244,7 +244,7 @@ void SpellCheckRequester::enqueueRequest(SpellCheckRequest* request) { - ASSERT(request); + DCHECK(request); bool continuation = false; if (!m_requestQueue.isEmpty()) { SpellCheckRequest* lastRequest = m_requestQueue.last(); @@ -270,8 +270,8 @@ void SpellCheckRequester::didCheck(int sequence, const Vector<TextCheckingResult>& results) { - ASSERT(m_processingRequest); - ASSERT(m_processingRequest->data().sequence() == sequence); + DCHECK(m_processingRequest); + DCHECK_EQ(m_processingRequest->data().sequence(), sequence); if (m_processingRequest->data().sequence() != sequence) { m_requestQueue.clear(); return;
diff --git a/third_party/WebKit/Source/core/editing/spellcheck/SpellCheckRequester.h b/third_party/WebKit/Source/core/editing/spellcheck/SpellCheckRequester.h index aea8a250..52ea7d7 100644 --- a/third_party/WebKit/Source/core/editing/spellcheck/SpellCheckRequester.h +++ b/third_party/WebKit/Source/core/editing/spellcheck/SpellCheckRequester.h
@@ -125,7 +125,7 @@ Member<LocalFrame> m_frame; LocalFrame& frame() const { - ASSERT(m_frame); + DCHECK(m_frame); return *m_frame; }
diff --git a/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp b/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp index 1774aad..a7e89a3 100644 --- a/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp +++ b/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
@@ -298,8 +298,9 @@ // takes precedence and we ignore any potential misspelled word. Select the grammar detail, update the spelling // panel, and store a marker so we draw the green squiggle later. - ASSERT(badGrammarPhrase.length() > 0); - ASSERT(grammarDetail.location != -1 && grammarDetail.length > 0); + DCHECK_GT(badGrammarPhrase.length(), 0u); + DCHECK_NE(grammarDetail.location, -1); + DCHECK_GT(grammarDetail.length, 0); // FIXME 4859190: This gets confused with doubled punctuation at the end of a paragraph const EphemeralRange badGrammarRange = calculateCharacterSubrange(EphemeralRange(grammarSearchStart, grammarSearchEnd), grammarPhraseOffset + grammarDetail.location, grammarDetail.length); @@ -478,7 +479,7 @@ void SpellChecker::markAllMisspellingsAndBadGrammarInRanges(TextCheckingTypeMask textCheckingOptions, const EphemeralRange& spellingRange, const EphemeralRange& grammarRange) { - ASSERT(unifiedTextCheckerEnabled()); + DCHECK(unifiedTextCheckerEnabled()); bool shouldMarkGrammar = textCheckingOptions & TextCheckingTypeGrammar; @@ -500,18 +501,18 @@ static EphemeralRange expandEndToSentenceBoundary(const EphemeralRange& range) { - ASSERT(range.isNotNull()); + DCHECK(range.isNotNull()); const VisiblePosition& visibleEnd = createVisiblePosition(range.endPosition()); - ASSERT(visibleEnd.isNotNull()); + DCHECK(visibleEnd.isNotNull()); const Position& sentenceEnd = endOfSentence(visibleEnd).deepEquivalent(); return EphemeralRange(range.startPosition(), sentenceEnd.isNotNull() ? sentenceEnd : range.endPosition()); } static EphemeralRange expandRangeToSentenceBoundary(const EphemeralRange& range) { - ASSERT(range.isNotNull()); + DCHECK(range.isNotNull()); const VisiblePosition& visibleStart = createVisiblePosition(range.startPosition()); - ASSERT(visibleStart.isNotNull()); + DCHECK(visibleStart.isNotNull()); const Position& sentenceStart = startOfSentence(visibleStart).deepEquivalent(); return expandEndToSentenceBoundary(EphemeralRange(sentenceStart.isNull() ? range.startPosition() : sentenceStart, range.endPosition())); } @@ -566,7 +567,7 @@ void SpellChecker::markAndReplaceFor(SpellCheckRequest* request, const Vector<TextCheckingResult>& results) { TRACE_EVENT0("blink", "SpellChecker::markAndReplaceFor"); - ASSERT(request); + DCHECK(request); if (!request->isValid()) return; @@ -609,21 +610,25 @@ // 3. The word in question doesn't end at an ambiguous boundary. For instance, we would not mark // "wouldn'" as misspelled right after apostrophe is typed. if (shouldMarkSpelling && result->decoration == TextDecorationTypeSpelling && resultLocation >= paragraph.checkingStart() && resultLocation + resultLength <= spellingRangeEndOffset && !resultEndsAtAmbiguousBoundary) { - ASSERT(resultLength > 0 && resultLocation >= 0); + DCHECK_GT(resultLength, 0); + DCHECK_GE(resultLocation, 0); const EphemeralRange misspellingRange = calculateCharacterSubrange(paragraph.paragraphRange(), resultLocation, resultLength); frame().document()->markers().addMarker(misspellingRange.startPosition(), misspellingRange.endPosition(), DocumentMarker::Spelling, result->replacement, result->hash); } else if (shouldMarkGrammar && result->decoration == TextDecorationTypeGrammar && paragraph.checkingRangeCovers(resultLocation, resultLength)) { - ASSERT(resultLength > 0 && resultLocation >= 0); + DCHECK_GT(resultLength, 0); + DCHECK_GE(resultLocation, 0); for (unsigned j = 0; j < result->details.size(); j++) { const GrammarDetail* detail = &result->details[j]; - ASSERT(detail->length > 0 && detail->location >= 0); + DCHECK_GT(detail->length, 0); + DCHECK_GE(detail->location, 0); if (paragraph.checkingRangeCovers(resultLocation + detail->location, detail->length)) { const EphemeralRange badGrammarRange = calculateCharacterSubrange(paragraph.paragraphRange(), resultLocation + detail->location, detail->length); frame().document()->markers().addMarker(badGrammarRange.startPosition(), badGrammarRange.endPosition(), DocumentMarker::Grammar, detail->userDescription, result->hash); } } } else if (result->decoration == TextDecorationTypeInvisibleSpellcheck && resultLocation >= paragraph.checkingStart() && resultLocation + resultLength <= spellingRangeEndOffset) { - ASSERT(resultLength > 0 && resultLocation >= 0); + DCHECK_GT(resultLength, 0); + DCHECK_GE(resultLocation, 0); const EphemeralRange invisibleSpellcheckRange = calculateCharacterSubrange(paragraph.paragraphRange(), resultLocation, resultLength); frame().document()->markers().addMarker(invisibleSpellcheckRange.startPosition(), invisibleSpellcheckRange.endPosition(), DocumentMarker::InvisibleSpellcheck, result->replacement, result->hash); } @@ -730,7 +735,7 @@ // we would like to remove the marker from word "avant" and whitespace as well. So we need to get the continous range of // of marker that contains the word in question, and remove marker on that whole range. Document* document = frame().document(); - ASSERT(document); + DCHECK(document); const EphemeralRange wordRange(startOfFirstWord.deepEquivalent(), endOfLastWord.deepEquivalent()); document->markers().removeMarkers(wordRange, DocumentMarker::MisspellingMarkers(), DocumentMarkerController::RemovePartiallyOverlappingMarker); }
diff --git a/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.h b/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.h index bd26b7c..ceb8614a 100644 --- a/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.h +++ b/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.h
@@ -103,7 +103,7 @@ LocalFrame& frame() const { - ASSERT(m_frame); + DCHECK(m_frame); return *m_frame; }
diff --git a/third_party/WebKit/Source/core/editing/spellcheck/SpellCheckerTest.cpp b/third_party/WebKit/Source/core/editing/spellcheck/SpellCheckerTest.cpp index afeef1d..9aba281 100644 --- a/third_party/WebKit/Source/core/editing/spellcheck/SpellCheckerTest.cpp +++ b/third_party/WebKit/Source/core/editing/spellcheck/SpellCheckerTest.cpp
@@ -16,7 +16,7 @@ TEST_F(SpellCheckerTest, AdvanceToNextMisspellingWithEmptyInputNoCrash) { setBodyContent("<input placeholder='placeholder'>abc"); - updateLayoutAndStyleForPainting(); + updateAllLifecyclePhases(); Element* input = document().querySelector("input", ASSERT_NO_EXCEPTION); input->focus(); document().settings()->setUnifiedTextCheckerEnabled(true);
diff --git a/third_party/WebKit/Source/core/editing/spellcheck/TextCheckingHelper.cpp b/third_party/WebKit/Source/core/editing/spellcheck/TextCheckingHelper.cpp index e43b8f17..6528f7e 100644 --- a/third_party/WebKit/Source/core/editing/spellcheck/TextCheckingHelper.cpp +++ b/third_party/WebKit/Source/core/editing/spellcheck/TextCheckingHelper.cpp
@@ -53,8 +53,10 @@ client.checkGrammarOfString(String(text + checkLocation, checkLength), badGrammarDetails, &badGrammarLocation, &badGrammarLength); if (!badGrammarLength) break; - ASSERT(0 <= badGrammarLocation && badGrammarLocation <= checkLength); - ASSERT(0 < badGrammarLength && badGrammarLocation + badGrammarLength <= checkLength); + DCHECK_LE(0, badGrammarLocation); + DCHECK_LE(badGrammarLocation, checkLength); + DCHECK_LT(0, badGrammarLength); + DCHECK_LE(badGrammarLocation + badGrammarLength, checkLength); TextCheckingResult badGrammar; badGrammar.decoration = TextDecorationTypeGrammar; badGrammar.location = checkLocation + badGrammarLocation; @@ -82,8 +84,10 @@ int misspellingLength = 0; client.checkSpellingOfString(String(text + start + wordStart, wordLength), &misspellingLocation, &misspellingLength); if (0 < misspellingLength) { - ASSERT(0 <= misspellingLocation && misspellingLocation <= wordLength); - ASSERT(0 < misspellingLength && misspellingLocation + misspellingLength <= wordLength); + DCHECK_LE(0, misspellingLocation); + DCHECK_LE(misspellingLocation, wordLength); + DCHECK_LT(0, misspellingLength); + DCHECK_LE(misspellingLocation + misspellingLength, wordLength); TextCheckingResult misspelling; misspelling.decoration = TextDecorationTypeSpelling; misspelling.location = start + wordStart + misspellingLocation; @@ -142,7 +146,7 @@ void TextCheckingParagraph::expandRangeToNextEnd() { - ASSERT(m_checkingRange.isNotNull()); + DCHECK(m_checkingRange.isNotNull()); setParagraphRange(EphemeralRange(paragraphRange().startPosition(), endOfParagraph(startOfNextParagraph(createVisiblePosition(paragraphRange().startPosition()))).deepEquivalent())); invalidateParagraphRangeValues(); } @@ -156,13 +160,13 @@ int TextCheckingParagraph::rangeLength() const { - ASSERT(m_checkingRange.isNotNull()); + DCHECK(m_checkingRange.isNotNull()); return TextIterator::rangeLength(paragraphRange().startPosition(), paragraphRange().endPosition()); } EphemeralRange TextCheckingParagraph::paragraphRange() const { - ASSERT(m_checkingRange.isNotNull()); + DCHECK(m_checkingRange.isNotNull()); if (m_paragraphRange.isNull()) m_paragraphRange = expandToParagraphBoundary(checkingRange()); return m_paragraphRange; @@ -175,13 +179,13 @@ EphemeralRange TextCheckingParagraph::subrange(int characterOffset, int characterCount) const { - ASSERT(m_checkingRange.isNotNull()); + DCHECK(m_checkingRange.isNotNull()); return calculateCharacterSubrange(paragraphRange(), characterOffset, characterCount); } int TextCheckingParagraph::offsetTo(const Position& position) const { - ASSERT(m_checkingRange.isNotNull()); + DCHECK(m_checkingRange.isNotNull()); return TextIterator::rangeLength(offsetAsRange().startPosition(), position); } @@ -194,7 +198,7 @@ EphemeralRange TextCheckingParagraph::offsetAsRange() const { - ASSERT(m_checkingRange.isNotNull()); + DCHECK(m_checkingRange.isNotNull()); if (m_offsetAsRange.isNull()) m_offsetAsRange = EphemeralRange(paragraphRange().startPosition(), checkingRange().startPosition()); @@ -203,7 +207,7 @@ const String& TextCheckingParagraph::text() const { - ASSERT(m_checkingRange.isNotNull()); + DCHECK(m_checkingRange.isNotNull()); if (m_text.isEmpty()) m_text = plainText(paragraphRange()); return m_text; @@ -211,7 +215,7 @@ int TextCheckingParagraph::checkingStart() const { - ASSERT(m_checkingRange.isNotNull()); + DCHECK(m_checkingRange.isNotNull()); if (m_checkingStart == -1) m_checkingStart = TextIterator::rangeLength(offsetAsRange().startPosition(), offsetAsRange().endPosition()); return m_checkingStart; @@ -219,7 +223,7 @@ int TextCheckingParagraph::checkingEnd() const { - ASSERT(m_checkingRange.isNotNull()); + DCHECK(m_checkingRange.isNotNull()); if (m_checkingEnd == -1) m_checkingEnd = checkingStart() + TextIterator::rangeLength(checkingRange().startPosition(), checkingRange().endPosition()); return m_checkingEnd; @@ -227,7 +231,7 @@ int TextCheckingParagraph::checkingLength() const { - ASSERT(m_checkingRange.isNotNull()); + DCHECK(m_checkingRange.isNotNull()); if (-1 == m_checkingLength) m_checkingLength = TextIterator::rangeLength(checkingRange().startPosition(), checkingRange().endPosition()); return m_checkingLength; @@ -265,12 +269,12 @@ // 5490627 shows that there was some code path here where the String constructor below crashes. // We don't know exactly what combination of bad input caused this, so we're making this much // more robust against bad input on release builds. - ASSERT(misspellingLength >= 0); - ASSERT(misspellingLocation >= -1); - ASSERT(!misspellingLength || misspellingLocation >= 0); - ASSERT(misspellingLocation < length); - ASSERT(misspellingLength <= length); - ASSERT(misspellingLocation + misspellingLength <= length); + DCHECK_GE(misspellingLength, 0); + DCHECK_GE(misspellingLocation, -1); + DCHECK(!misspellingLength || misspellingLocation >= 0); + DCHECK_LT(misspellingLocation, length); + DCHECK_LE(misspellingLength, length); + DCHECK_LE(misspellingLocation + misspellingLength, length); if (misspellingLocation >= 0 && misspellingLength > 0 && misspellingLocation < length && misspellingLength <= length && misspellingLocation + misspellingLength <= length) { @@ -356,21 +360,24 @@ for (unsigned i = 0; i < results.size(); i++) { const TextCheckingResult* result = &results[i]; if (result->decoration == TextDecorationTypeSpelling && result->location >= currentStartOffset && result->location + result->length <= currentEndOffset) { - ASSERT(result->length > 0 && result->location >= 0); + DCHECK_GT(result->length, 0); + DCHECK_GE(result->location, 0); spellingLocation = result->location; misspelledWord = paragraphString.substring(result->location, result->length); - ASSERT(misspelledWord.length()); + DCHECK(misspelledWord.length()); break; } if (result->decoration == TextDecorationTypeGrammar && result->location < currentEndOffset && result->location + result->length > currentStartOffset) { - ASSERT(result->length > 0 && result->location >= 0); + DCHECK_GT(result->length, 0); + DCHECK_GE(result->location, 0); // We can't stop after the first grammar result, since there might still be a spelling result after // it begins but before the first detail in it, but we can stop if we find a second grammar result. if (foundGrammar) break; for (unsigned j = 0; j < result->details.size(); j++) { const GrammarDetail* detail = &result->details[j]; - ASSERT(detail->length > 0 && detail->location >= 0); + DCHECK_GT(detail->length, 0); + DCHECK_GE(detail->location, 0); if (result->location + detail->location >= currentStartOffset && result->location + detail->location + detail->length <= currentEndOffset && (!foundGrammar || result->location + detail->location < grammarDetailLocation)) { grammarDetailIndex = j; grammarDetailLocation = result->location + detail->location; @@ -381,7 +388,7 @@ grammarPhraseLocation = result->location; outGrammarDetail = result->details[grammarDetailIndex]; badGrammarPhrase = paragraphString.substring(result->location, result->length); - ASSERT(badGrammarPhrase.length()); + DCHECK(badGrammarPhrase.length()); } } } @@ -425,7 +432,8 @@ int earliestDetailIndex = -1; for (unsigned i = 0; i < grammarDetails.size(); i++) { const GrammarDetail* detail = &grammarDetails[i]; - ASSERT(detail->length > 0 && detail->location >= 0); + DCHECK_GT(detail->length, 0); + DCHECK_GE(detail->location, 0); int detailStartOffsetInParagraph = badGrammarPhraseLocation + detail->location; @@ -477,18 +485,18 @@ m_client->textChecker().checkGrammarOfString(paragraph.textSubstring(startOffset), grammarDetails, &badGrammarPhraseLocation, &badGrammarPhraseLength); if (!badGrammarPhraseLength) { - ASSERT(badGrammarPhraseLocation == -1); + DCHECK_EQ(badGrammarPhraseLocation, -1); return String(); } - ASSERT(badGrammarPhraseLocation >= 0); + DCHECK_GE(badGrammarPhraseLocation, 0); badGrammarPhraseLocation += startOffset; // Found some bad grammar. Find the earliest detail range that starts in our search range (if any). int badGrammarIndex = findFirstGrammarDetail(grammarDetails, badGrammarPhraseLocation, paragraph.checkingStart(), paragraph.checkingEnd(), markAll); if (badGrammarIndex >= 0) { - ASSERT(static_cast<unsigned>(badGrammarIndex) < grammarDetails.size()); + DCHECK_LT(static_cast<unsigned>(badGrammarIndex), grammarDetails.size()); outGrammarDetail = grammarDetails[badGrammarIndex]; } @@ -530,7 +538,7 @@ bool TextCheckingHelper::unifiedTextCheckerEnabled() const { - ASSERT(m_start.isNotNull()); + DCHECK(m_start.isNotNull()); Document& doc = m_start.computeContainerNode()->document(); return blink::unifiedTextCheckerEnabled(doc.frame()); }
diff --git a/third_party/WebKit/Source/core/events/Event.cpp b/third_party/WebKit/Source/core/events/Event.cpp index 9177b507d..9966366 100644 --- a/third_party/WebKit/Source/core/events/Event.cpp +++ b/third_party/WebKit/Source/core/events/Event.cpp
@@ -231,7 +231,7 @@ void Event::preventDefault() { if (m_handlingPassive) { - const LocalDOMWindow* window = m_currentTarget ? m_currentTarget->toDOMWindow() : 0; + const LocalDOMWindow* window = m_eventPath ? m_eventPath->windowEventContext().window() : 0; if (window) window->printErrorMessage("Unable to preventDefault inside passive event listener invocation."); return;
diff --git a/third_party/WebKit/Source/core/events/PointerEventFactory.cpp b/third_party/WebKit/Source/core/events/PointerEventFactory.cpp index ce7f70d..a11cc1c7 100644 --- a/third_party/WebKit/Source/core/events/PointerEventFactory.cpp +++ b/third_party/WebKit/Source/core/events/PointerEventFactory.cpp
@@ -62,8 +62,8 @@ return force; } -void PointerEventFactory::setIdTypeButtons(PointerEventInit &pointerEventInit, - const WebPointerProperties &pointerProperties, unsigned buttons) +void PointerEventFactory::setIdTypeButtons(PointerEventInit& pointerEventInit, + const WebPointerProperties& pointerProperties, unsigned buttons) { const WebPointerProperties::PointerType pointerType = pointerProperties.pointerType; const IncomingId incomingId(pointerType, pointerProperties.id); @@ -75,6 +75,15 @@ pointerEventInit.setIsPrimary(isPrimary(pointerId)); } +void PointerEventFactory::setBubblesAndCancelable(PointerEventInit& pointerEventInit, + const AtomicString& type) +{ + pointerEventInit.setBubbles(type != EventTypeNames::pointerenter + && type != EventTypeNames::pointerleave); + pointerEventInit.setCancelable(type != EventTypeNames::pointerenter + && type != EventTypeNames::pointerleave && type != EventTypeNames::pointercancel); +} + PointerEvent* PointerEventFactory::create( const AtomicString& mouseEventName, const PlatformMouseEvent& mouseEvent, EventTarget* relatedTarget, @@ -85,6 +94,7 @@ PointerEventInit pointerEventInit; setIdTypeButtons(pointerEventInit, mouseEvent.pointerProperties(), buttons); + setBubblesAndCancelable(pointerEventInit, pointerEventName); pointerEventInit.setScreenX(mouseEvent.globalPosition().x()); pointerEventInit.setScreenY(mouseEvent.globalPosition().y()); @@ -110,13 +120,6 @@ || (pointerEventName == EventTypeNames::pointerup && buttons != 0)) pointerEventName = EventTypeNames::pointermove; - pointerEventInit.setBubbles( - pointerEventName != EventTypeNames::pointerenter - && pointerEventName != EventTypeNames::pointerleave); - pointerEventInit.setCancelable( - pointerEventName != EventTypeNames::pointerenter - && pointerEventName != EventTypeNames::pointerleave - && pointerEventName != EventTypeNames::pointercancel); pointerEventInit.setView(view); if (relatedTarget) @@ -166,13 +169,17 @@ return PointerEvent::create(type, pointerEventInit); } - -PointerEvent* PointerEventFactory::createPointerCancelEvent(const PlatformTouchPoint& touchPoint) +PointerEvent* PointerEventFactory::createPointerCancelEvent( + const int pointerId, const WebPointerProperties::PointerType pointerType) { + ASSERT(m_pointerIdMapping.contains(pointerId)); + m_pointerIdMapping.set(pointerId, PointerAttributes(m_pointerIdMapping.get(pointerId).incomingId, false)); + PointerEventInit pointerEventInit; - setIdTypeButtons(pointerEventInit, touchPoint.pointerProperties(), 0); - + pointerEventInit.setPointerId(pointerId); + pointerEventInit.setPointerType(pointerTypeNameForWebPointPointerType(pointerType)); + pointerEventInit.setIsPrimary(isPrimary(pointerId)); pointerEventInit.setBubbles(true); pointerEventInit.setCancelable(false); @@ -223,11 +230,8 @@ pointerEventInit.setButtons(pointerEvent->buttons()); pointerEventInit.setPressure(pointerEvent->pressure()); - pointerEventInit.setBubbles(type != EventTypeNames::pointerenter - && type != EventTypeNames::pointerleave); - pointerEventInit.setCancelable(type != EventTypeNames::pointerenter - && type != EventTypeNames::pointerleave - && type != EventTypeNames::pointercancel); + setBubblesAndCancelable(pointerEventInit, type); + if (relatedTarget) pointerEventInit.setRelatedTarget(relatedTarget); @@ -289,10 +293,8 @@ return mappedId; } -bool PointerEventFactory::remove( - const PointerEvent* pointerEvent) +bool PointerEventFactory::remove(const int mappedId) { - int mappedId = pointerEvent->pointerId(); // Do not remove mouse pointer id as it should always be there if (mappedId == s_mouseId || !m_pointerIdMapping.contains(mappedId)) return false; @@ -307,6 +309,21 @@ return true; } +HeapVector<int> PointerEventFactory::getPointerIdsOfType(WebPointerProperties::PointerType pointerType) +{ + HeapVector<int> mappedIds; + + for (auto iter = m_pointerIdMapping.begin(); iter != m_pointerIdMapping.end(); ++iter) { + int mappedId = iter->key; + if (iter->value.incomingId.pointerType() == static_cast<int>(pointerType)) + mappedIds.append(mappedId); + } + + // Sorting for a predictable ordering. + std::sort(mappedIds.begin(), mappedIds.end()); + return mappedIds; +} + bool PointerEventFactory::isPrimary(int mappedId) const { if (!m_pointerIdMapping.contains(mappedId))
diff --git a/third_party/WebKit/Source/core/events/PointerEventFactory.h b/third_party/WebKit/Source/core/events/PointerEventFactory.h index bcb332f..70d3afe 100644 --- a/third_party/WebKit/Source/core/events/PointerEventFactory.h +++ b/third_party/WebKit/Source/core/events/PointerEventFactory.h
@@ -40,7 +40,7 @@ const double clientX, const double clientY); PointerEvent* createPointerCancelEvent( - const PlatformTouchPoint&); + const int pointerId, const WebPointerProperties::PointerType); // For creating capture events (i.e got/lostpointercapture) PointerEvent* createPointerCaptureEvent( @@ -56,11 +56,13 @@ // Clear all the existing ids. void clear(); - // Returns true if pointerEvent is removed. When a pointerEvent with a - // particular id is removed that id is considered free even though there - // might have been other PointerEvents that were generated with the same id - // before. - bool remove(const PointerEvent*); + // When a particular pointerId is removed, the id is considered free even + // though there might have been other PointerEvents that were generated with + // the same id before. + bool remove(const int); + + // Returns all ids of the given pointerType. + HeapVector<int> getPointerIdsOfType(WebPointerProperties::PointerType); // Returns whether a pointer id exists and active bool isActive(const int); @@ -92,8 +94,9 @@ int addIdAndActiveButtons(const IncomingId, bool isActiveButtons); bool isPrimary(const int) const; - void setIdTypeButtons(PointerEventInit &, const WebPointerProperties &, + void setIdTypeButtons(PointerEventInit&, const WebPointerProperties&, unsigned buttons); + void setBubblesAndCancelable(PointerEventInit&, const AtomicString& type); static const int s_invalidId; static const int s_mouseId;
diff --git a/third_party/WebKit/Source/core/events/PointerEventFactoryTest.cpp b/third_party/WebKit/Source/core/events/PointerEventFactoryTest.cpp index 286b5d83..b0ed7c91 100644 --- a/third_party/WebKit/Source/core/events/PointerEventFactoryTest.cpp +++ b/third_party/WebKit/Source/core/events/PointerEventFactoryTest.cpp
@@ -17,8 +17,7 @@ void SetUp() override; PointerEvent* createAndCheckTouchCancel( WebPointerProperties::PointerType, int rawId, - int uniqueId, bool isPrimary, - PlatformTouchPoint::TouchState = PlatformTouchPoint::TouchReleased); + int uniqueId, bool isPrimary); PointerEvent* createAndCheckTouchEvent( WebPointerProperties::PointerType, int rawId, int uniqueId, bool isPrimary, @@ -75,11 +74,10 @@ PointerEvent* PointerEventFactoryTest::createAndCheckTouchCancel( WebPointerProperties::PointerType pointerType, int rawId, - int uniqueId, bool isPrimary, - PlatformTouchPoint::TouchState state) + int uniqueId, bool isPrimary) { PointerEvent* pointerEvent = m_pointerEventFactory.createPointerCancelEvent( - PointerEventFactoryTest::PlatformTouchPointBuilder(pointerType, rawId, state)); + uniqueId, pointerType); EXPECT_EQ(uniqueId, pointerEvent->pointerId()); EXPECT_EQ(isPrimary, pointerEvent->isPrimary()); return pointerEvent; @@ -134,7 +132,7 @@ EXPECT_TRUE(m_pointerEventFactory.isActive(m_expectedMouseId)); EXPECT_TRUE(m_pointerEventFactory.isActiveButtonsState(m_expectedMouseId)); - m_pointerEventFactory.remove(pointerEvent1); + m_pointerEventFactory.remove(pointerEvent1->pointerId()); EXPECT_TRUE(m_pointerEventFactory.isActive(m_expectedMouseId)); EXPECT_TRUE(m_pointerEventFactory.isActiveButtonsState(m_expectedMouseId)); @@ -144,8 +142,8 @@ EXPECT_TRUE(m_pointerEventFactory.isActive(m_expectedMouseId)); EXPECT_FALSE(m_pointerEventFactory.isActiveButtonsState(m_expectedMouseId)); - m_pointerEventFactory.remove(pointerEvent1); - m_pointerEventFactory.remove(pointerEvent2); + m_pointerEventFactory.remove(pointerEvent1->pointerId()); + m_pointerEventFactory.remove(pointerEvent2->pointerId()); createAndCheckMouseEvent(WebPointerProperties::PointerType::Mouse, 1, m_expectedMouseId, true); createAndCheckMouseEvent(WebPointerProperties::PointerType::Mouse, 20, m_expectedMouseId, true); @@ -157,7 +155,7 @@ PointerEvent* pointerEvent1 = createAndCheckTouchEvent(WebPointerProperties::PointerType::Touch, 0, m_mappedIdStart, true); createAndCheckTouchEvent(WebPointerProperties::PointerType::Touch, 1, m_mappedIdStart+1, false); - m_pointerEventFactory.remove(pointerEvent1); + m_pointerEventFactory.remove(pointerEvent1->pointerId()); createAndCheckTouchEvent(WebPointerProperties::PointerType::Touch, 2, m_mappedIdStart+2, false); createAndCheckTouchEvent(WebPointerProperties::PointerType::Touch, 1, m_mappedIdStart+1, false); @@ -181,8 +179,8 @@ EXPECT_TRUE(m_pointerEventFactory.isActiveButtonsState(m_mappedIdStart)); EXPECT_TRUE(m_pointerEventFactory.isActiveButtonsState(m_mappedIdStart+1)); - m_pointerEventFactory.remove(pointerEvent1); - m_pointerEventFactory.remove(pointerEvent2); + m_pointerEventFactory.remove(pointerEvent1->pointerId()); + m_pointerEventFactory.remove(pointerEvent2->pointerId()); EXPECT_FALSE(m_pointerEventFactory.isActive(m_mappedIdStart)); EXPECT_FALSE(m_pointerEventFactory.isActive(m_mappedIdStart+1)); @@ -213,8 +211,8 @@ EXPECT_TRUE(m_pointerEventFactory.isActive(m_mappedIdStart)); EXPECT_FALSE(m_pointerEventFactory.isActiveButtonsState(m_mappedIdStart)); - m_pointerEventFactory.remove(pointerEvent1); - m_pointerEventFactory.remove(pointerEvent2); + m_pointerEventFactory.remove(pointerEvent1->pointerId()); + m_pointerEventFactory.remove(pointerEvent2->pointerId()); EXPECT_FALSE(m_pointerEventFactory.isActive(m_mappedIdStart)); EXPECT_FALSE(m_pointerEventFactory.isActiveButtonsState(m_mappedIdStart)); @@ -227,7 +225,7 @@ createAndCheckTouchEvent(WebPointerProperties::PointerType::Touch, 0, m_mappedIdStart+1, true); // Remove an obsolete (i.e. already removed) pointer event which should have no effect - m_pointerEventFactory.remove(pointerEvent1); + m_pointerEventFactory.remove(pointerEvent1->pointerId()); EXPECT_TRUE(m_pointerEventFactory.isActive(m_mappedIdStart+1)); EXPECT_TRUE(m_pointerEventFactory.isActiveButtonsState(m_mappedIdStart+1)); @@ -255,9 +253,9 @@ createAndCheckTouchEvent(WebPointerProperties::PointerType::Pen, 0, m_mappedIdStart+1, true); createAndCheckTouchEvent(WebPointerProperties::PointerType::Pen, 47213, m_mappedIdStart+4, false); - m_pointerEventFactory.remove(pointerEvent1); - m_pointerEventFactory.remove(pointerEvent2); - m_pointerEventFactory.remove(pointerEvent3); + m_pointerEventFactory.remove(pointerEvent1->pointerId()); + m_pointerEventFactory.remove(pointerEvent2->pointerId()); + m_pointerEventFactory.remove(pointerEvent3->pointerId()); createAndCheckTouchEvent(WebPointerProperties::PointerType::Touch, 100, m_mappedIdStart+5, true); @@ -278,7 +276,7 @@ createAndCheckTouchEvent(WebPointerProperties::PointerType::Pen, 0, m_mappedIdStart, true); createAndCheckTouchEvent(WebPointerProperties::PointerType::Pen, 1, m_mappedIdStart+1, false); - m_pointerEventFactory.remove(pointerEvent1); + m_pointerEventFactory.remove(pointerEvent1->pointerId()); createAndCheckTouchEvent(WebPointerProperties::PointerType::Pen, 0, m_mappedIdStart+3, false); createAndCheckMouseEvent(WebPointerProperties::PointerType::Pen, 0, m_mappedIdStart+3, false); @@ -305,7 +303,7 @@ createAndCheckMouseEvent(WebPointerProperties::PointerType::Unknown, 2, m_mappedIdStart+2, false); createAndCheckTouchCancel(WebPointerProperties::PointerType::Unknown, 3, m_mappedIdStart+3, false); - m_pointerEventFactory.remove(pointerEvent1); + m_pointerEventFactory.remove(pointerEvent1->pointerId()); createAndCheckTouchEvent(WebPointerProperties::PointerType::Unknown, 0, m_mappedIdStart+4, false); createAndCheckTouchEvent(WebPointerProperties::PointerType::Unknown, INT_MAX, m_mappedIdStart+5, false);
diff --git a/third_party/WebKit/Source/core/fetch/FontResource.cpp b/third_party/WebKit/Source/core/fetch/FontResource.cpp index eb9da1f4..6c2d95a 100644 --- a/third_party/WebKit/Source/core/fetch/FontResource.cpp +++ b/third_party/WebKit/Source/core/fetch/FontResource.cpp
@@ -97,8 +97,6 @@ { ASSERT(FontResourceClient::isExpectedType(c)); Resource::didAddClient(c); - if (isLoaded()) - static_cast<FontResourceClient*>(c)->fontLoaded(this); if (m_loadLimitState == ShortLimitExceeded || m_loadLimitState == LongLimitExceeded) static_cast<FontResourceClient*>(c)->fontLoadShortLimitExceeded(this); if (m_loadLimitState == LongLimitExceeded) @@ -173,9 +171,8 @@ { m_fontLoadShortLimitTimer.stop(); m_fontLoadLongLimitTimer.stop(); - ResourceClientWalker<FontResourceClient> w(m_clients); - while (FontResourceClient* c = w.next()) - c->fontLoaded(this); + + Resource::checkNotify(); } } // namespace blink
diff --git a/third_party/WebKit/Source/core/fetch/FontResource.h b/third_party/WebKit/Source/core/fetch/FontResource.h index b3852f73c..5b8907f 100644 --- a/third_party/WebKit/Source/core/fetch/FontResource.h +++ b/third_party/WebKit/Source/core/fetch/FontResource.h
@@ -98,7 +98,6 @@ ~FontResourceClient() override {} static bool isExpectedType(ResourceClient* client) { return client->getResourceClientType() == FontType; } ResourceClientType getResourceClientType() const final { return FontType; } - virtual void fontLoaded(FontResource*) {} virtual void fontLoadShortLimitExceeded(FontResource*) {} virtual void fontLoadLongLimitExceeded(FontResource*) {} };
diff --git a/third_party/WebKit/Source/core/fetch/ImageResource.cpp b/third_party/WebKit/Source/core/fetch/ImageResource.cpp index e8462ed..d76dadb 100644 --- a/third_party/WebKit/Source/core/fetch/ImageResource.cpp +++ b/third_party/WebKit/Source/core/fetch/ImageResource.cpp
@@ -37,7 +37,6 @@ #include "platform/graphics/BitmapImage.h" #include "public/platform/Platform.h" #include "public/platform/WebCachePolicy.h" -#include "wtf/CheckedNumeric.h" #include "wtf/CurrentTime.h" #include "wtf/StdLibExtras.h" @@ -343,7 +342,7 @@ // If our Image has an observer, it's always us so we need to clear the back pointer // before dropping our reference. - m_image->setImageObserver(nullptr); + m_image->clearImageObserver(); m_image.clear(); } @@ -422,14 +421,12 @@ } } -void ImageResource::decodedSizeChanged(const blink::Image* image, int delta) +void ImageResource::decodedSizeChangedTo(const blink::Image* image, size_t newSize) { if (!image || image != m_image) return; - CheckedNumeric<intptr_t> signedDecodedSize(decodedSize()); - signedDecodedSize += delta; - setDecodedSize(safeCast<size_t>(signedDecodedSize.ValueOrDie())); + setDecodedSize(newSize); } void ImageResource::didDraw(const blink::Image* image)
diff --git a/third_party/WebKit/Source/core/fetch/ImageResource.h b/third_party/WebKit/Source/core/fetch/ImageResource.h index 6895690..7fab6470 100644 --- a/third_party/WebKit/Source/core/fetch/ImageResource.h +++ b/third_party/WebKit/Source/core/fetch/ImageResource.h
@@ -110,7 +110,7 @@ bool isImage() const override { return true; } // ImageObserver - void decodedSizeChanged(const blink::Image*, int delta) override; + void decodedSizeChangedTo(const blink::Image*, size_t newSize) override; void didDraw(const blink::Image*) override; bool shouldPauseAnimation(const blink::Image*) override;
diff --git a/third_party/WebKit/Source/core/fetch/SubstituteData.h b/third_party/WebKit/Source/core/fetch/SubstituteData.h index f9ffa369..87410f1 100644 --- a/third_party/WebKit/Source/core/fetch/SubstituteData.h +++ b/third_party/WebKit/Source/core/fetch/SubstituteData.h
@@ -56,7 +56,7 @@ { } - bool isValid() const { return m_content; } + bool isValid() const { return m_content.get(); } SharedBuffer* content() const { return m_content.get(); } const AtomicString& mimeType() const { return m_mimeType; }
diff --git a/third_party/WebKit/Source/core/frame/DOMWindow.cpp b/third_party/WebKit/Source/core/frame/DOMWindow.cpp index bf9669f..b2c0e024 100644 --- a/third_party/WebKit/Source/core/frame/DOMWindow.cpp +++ b/third_party/WebKit/Source/core/frame/DOMWindow.cpp
@@ -44,7 +44,7 @@ v8::Local<v8::Object> DOMWindow::wrap(v8::Isolate*, v8::Local<v8::Object> creationContext) { // DOMWindow must never be wrapped with wrap method. The wrappers must be - // created at WindowProxy::installDOMWindow(). + // created at WindowProxy::createContext() and setupWindowPrototypeChain(). RELEASE_NOTREACHED(); return v8::Local<v8::Object>(); }
diff --git a/third_party/WebKit/Source/core/frame/Frame.cpp b/third_party/WebKit/Source/core/frame/Frame.cpp index bf5ad89..ab7a501 100644 --- a/third_party/WebKit/Source/core/frame/Frame.cpp +++ b/third_party/WebKit/Source/core/frame/Frame.cpp
@@ -51,18 +51,6 @@ using namespace HTMLNames; -namespace { - -int64_t generateFrameID() -{ - // Initialize to the current time to reduce the likelihood of generating - // identifiers that overlap with those from past/future browser sessions. - static int64_t next = static_cast<int64_t>(currentTime() * 1000000.0); - return ++next; -} - -} // namespace - Frame::~Frame() { InstanceCounters::decrementCounter(InstanceCounters::FrameCounter); @@ -305,7 +293,6 @@ , m_host(host) , m_owner(owner) , m_client(client) - , m_frameID(generateFrameID()) , m_isLoading(false) { InstanceCounters::incrementCounter(InstanceCounters::FrameCounter);
diff --git a/third_party/WebKit/Source/core/frame/Frame.h b/third_party/WebKit/Source/core/frame/Frame.h index 6a78800..8554f00 100644 --- a/third_party/WebKit/Source/core/frame/Frame.h +++ b/third_party/WebKit/Source/core/frame/Frame.h
@@ -119,8 +119,6 @@ LayoutPart* ownerLayoutObject() const; // LayoutObject for the element that contains this frame. - int64_t frameID() const { return m_frameID; } - Settings* settings() const; // can be null // isLoading() is true when the embedder should think a load is in progress. @@ -144,8 +142,6 @@ bool canNavigateWithoutFramebusting(const Frame&, String& errorReason); Member<FrameClient> m_client; - // Needed to identify Frame Timing requests. - int64_t m_frameID; bool m_isLoading; };
diff --git a/third_party/WebKit/Source/core/frame/FrameConsole.cpp b/third_party/WebKit/Source/core/frame/FrameConsole.cpp index 6229144e..892316d 100644 --- a/third_party/WebKit/Source/core/frame/FrameConsole.cpp +++ b/third_party/WebKit/Source/core/frame/FrameConsole.cpp
@@ -36,7 +36,6 @@ #include "core/inspector/InspectorConsoleInstrumentation.h" #include "core/page/ChromeClient.h" #include "core/page/Page.h" -#include "core/workers/WorkerGlobalScopeProxy.h" #include "platform/network/ResourceError.h" #include "platform/network/ResourceResponse.h" #include "wtf/text/StringBuilder.h"
diff --git a/third_party/WebKit/Source/core/frame/FrameView.cpp b/third_party/WebKit/Source/core/frame/FrameView.cpp index 4db3dbc..864a48a 100644 --- a/third_party/WebKit/Source/core/frame/FrameView.cpp +++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
@@ -2449,9 +2449,6 @@ if (!m_frame->document()->printing()) synchronizedPaint(); - if (RuntimeEnabledFeatures::frameTimingSupportEnabled()) - updateFrameTimingRequestsIfNeeded(); - if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) pushPaintArtifactToCompositor(); @@ -2552,18 +2549,6 @@ page->chromeClient().didPaint(paintArtifact); } -void FrameView::updateFrameTimingRequestsIfNeeded() -{ - GraphicsLayerFrameTimingRequests graphicsLayerTimingRequests; - // TODO(mpb) use a 'dirty' bit to not call this every time. - collectFrameTimingRequestsRecursive(graphicsLayerTimingRequests); - - for (const auto& iter : graphicsLayerTimingRequests) { - const GraphicsLayer* graphicsLayer = iter.key; - graphicsLayer->platformLayer()->setFrameTimingRequests(iter.value); - } -} - void FrameView::updateStyleAndLayoutIfNeededRecursive() { SCOPED_BLINK_UMA_HISTOGRAM_TIMER("Blink.StyleAndLayout.UpdateTime"); @@ -3948,43 +3933,6 @@ collectAnnotatedRegions(*curr, regions); } -void FrameView::collectFrameTimingRequestsRecursive(GraphicsLayerFrameTimingRequests& graphicsLayerTimingRequests) -{ - if (!m_frameTimingRequestsDirty) - return; - - collectFrameTimingRequests(graphicsLayerTimingRequests); - - for (Frame* child = m_frame->tree().firstChild(); child; child = child->tree().nextSibling()) { - if (!child->isLocalFrame()) - continue; - - toLocalFrame(child)->view()->collectFrameTimingRequestsRecursive(graphicsLayerTimingRequests); - } - m_frameTimingRequestsDirty = false; -} - -void FrameView::collectFrameTimingRequests(GraphicsLayerFrameTimingRequests& graphicsLayerTimingRequests) -{ - if (!m_frame->isLocalFrame()) - return; - Frame* frame = m_frame.get(); - LocalFrame* localFrame = toLocalFrame(frame); - LayoutRect viewRect = localFrame->contentLayoutItem().viewRect(); - const LayoutBoxModelObject& paintInvalidationContainer = localFrame->contentLayoutObject()->containerForPaintInvalidation(); - // If the frame is being throttled, its compositing state may not be up to date. - if (!paintInvalidationContainer.enclosingLayer()->isAllowedToQueryCompositingState()) - return; - const GraphicsLayer* graphicsLayer = paintInvalidationContainer.enclosingLayer()->graphicsLayerBacking(); - - if (!graphicsLayer) - return; - - PaintLayer::mapRectToPaintInvalidationBacking(*localFrame->contentLayoutObject(), paintInvalidationContainer, viewRect); - - graphicsLayerTimingRequests.add(graphicsLayer, Vector<std::pair<int64_t, WebRect>>()).storedValue->value.append(std::make_pair(m_frame->frameID(), enclosingIntRect(viewRect))); -} - void FrameView::setNeedsUpdateViewportIntersection() { m_needsUpdateViewportIntersection = true;
diff --git a/third_party/WebKit/Source/core/frame/FrameView.h b/third_party/WebKit/Source/core/frame/FrameView.h index 676fcc8..59019c5a 100644 --- a/third_party/WebKit/Source/core/frame/FrameView.h +++ b/third_party/WebKit/Source/core/frame/FrameView.h
@@ -564,9 +564,6 @@ LayoutAnalyzer* layoutAnalyzer() { return m_analyzer.get(); } - void setFrameTimingRequestsDirty(bool isDirty) { m_frameTimingRequestsDirty = isDirty; } - bool frameTimingRequestsDirty() { return m_frameTimingRequestsDirty; } - // Returns true if this frame should not render or schedule visual updates. bool shouldThrottleRendering() const; @@ -747,11 +744,6 @@ void collectAnnotatedRegions(LayoutObject&, Vector<AnnotatedRegionValue>&) const; - typedef WTF::HashMap <const GraphicsLayer*, Vector<std::pair<int64_t, WebRect>>> GraphicsLayerFrameTimingRequests; - void updateFrameTimingRequestsIfNeeded(); - void collectFrameTimingRequests(GraphicsLayerFrameTimingRequests&); - void collectFrameTimingRequestsRecursive(GraphicsLayerFrameTimingRequests&); - template <typename Function> void forAllNonThrottledFrameViews(const Function&); void setNeedsUpdateViewportIntersection();
diff --git a/third_party/WebKit/Source/core/frame/UseCounter.h b/third_party/WebKit/Source/core/frame/UseCounter.h index b8075399..83e6019d 100644 --- a/third_party/WebKit/Source/core/frame/UseCounter.h +++ b/third_party/WebKit/Source/core/frame/UseCounter.h
@@ -1122,6 +1122,10 @@ V8Document_Anchors_AttributeGetter = 1303, V8Document_Applets_AttributeGetter = 1304, XMLHttpRequestCrossOriginWithCredentials = 1305, + MediaStreamTrackRemote = 1306, + V8Node_IsConnected_AttributeGetter = 1307, + ShadowRootDelegatesFocus = 1308, + MixedShadowRootV0AndV1 = 1309, // Add new features immediately above this line. Don't change assigned // numbers of any item, and don't reuse removed slots.
diff --git a/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp b/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp index acc9756..8f74b66 100644 --- a/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp +++ b/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp
@@ -132,8 +132,6 @@ bool CSPDirectiveList::checkDynamic(SourceListDirective* directive) const { - if (!m_policy->experimentalFeaturesEnabled()) - return false; return !directive || directive->allowDynamic(); }
diff --git a/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp b/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp index 38cfacd..36cb3c4 100644 --- a/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp +++ b/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp
@@ -468,8 +468,6 @@ bool ContentSecurityPolicy::allowDynamic() const { - if (!experimentalFeaturesEnabled()) - return false; for (const auto& policy : m_policies) { if (!policy->allowDynamic()) return false;
diff --git a/third_party/WebKit/Source/core/html/HTMLAnchorElement.idl b/third_party/WebKit/Source/core/html/HTMLAnchorElement.idl index eac6638..7cfbe23d 100644 --- a/third_party/WebKit/Source/core/html/HTMLAnchorElement.idl +++ b/third_party/WebKit/Source/core/html/HTMLAnchorElement.idl
@@ -42,4 +42,4 @@ [Reflect] attribute DOMString shape; }; -HTMLAnchorElement implements URLUtils; +HTMLAnchorElement implements HTMLHyperlinkElementUtils;
diff --git a/third_party/WebKit/Source/core/html/HTMLAreaElement.idl b/third_party/WebKit/Source/core/html/HTMLAreaElement.idl index e5fde1c..7d8faf02 100644 --- a/third_party/WebKit/Source/core/html/HTMLAreaElement.idl +++ b/third_party/WebKit/Source/core/html/HTMLAreaElement.idl
@@ -35,4 +35,4 @@ [Reflect] attribute boolean noHref; }; -HTMLAreaElement implements URLUtils; +HTMLAreaElement implements HTMLHyperlinkElementUtils;
diff --git a/third_party/WebKit/Source/core/html/HTMLHyperlinkElementUtils.idl b/third_party/WebKit/Source/core/html/HTMLHyperlinkElementUtils.idl new file mode 100644 index 0000000..f30281e --- /dev/null +++ b/third_party/WebKit/Source/core/html/HTMLHyperlinkElementUtils.idl
@@ -0,0 +1,30 @@ +// 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. + +// https://html.spec.whatwg.org/#htmlhyperlinkelementutils + +[ + NoInterfaceObject, // Always used on target of 'implements' +] interface HTMLHyperlinkElementUtils { + // TODO(sof): 'stringifier' entails an enumerable toString(), + // http://heycam.github.io/webidl/#es-stringifier + // something implementations of HTMLHyperlinkElementUtils currently + // provide. Make them to comply with the spec (http://crbug.com/306606). + // + // Until that time, do not use 'stringifier'. + // stringifier attribute USVString href; + attribute USVString href; + [NotEnumerable, ImplementedAs=href] USVString toString(); + readonly attribute USVString origin; + + attribute USVString protocol; + attribute USVString username; + attribute USVString password; + attribute USVString host; + attribute USVString hostname; + attribute USVString port; + attribute USVString pathname; + attribute USVString search; + attribute USVString hash; +};
diff --git a/third_party/WebKit/Source/core/html/HTMLInputElement.cpp b/third_party/WebKit/Source/core/html/HTMLInputElement.cpp index 01432ce..93524f6f 100644 --- a/third_party/WebKit/Source/core/html/HTMLInputElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLInputElement.cpp
@@ -475,7 +475,7 @@ if (openShadowRoot()) m_inputTypeView = InputTypeView::create(*this); else - m_inputTypeView = m_inputType; + m_inputTypeView = m_inputType->createView(); m_inputTypeView->createShadowSubtree(); updateTouchEventHandlerRegistry(); @@ -1077,6 +1077,7 @@ m_suggestedValue = String(); // Prevent TextFieldInputType::setValue from using the suggested value. m_inputType->setValue(sanitizedValue, valueChanged, eventBehavior); + m_inputTypeView->didSetValue(sanitizedValue, valueChanged); if (valueChanged && eventBehavior == DispatchNoEvent) setTextAsOfLastFormControlChangeEvent(sanitizedValue.isNull() ? defaultValue() : sanitizedValue);
diff --git a/third_party/WebKit/Source/core/html/forms/BaseChooserOnlyDateAndTimeInputType.cpp b/third_party/WebKit/Source/core/html/forms/BaseChooserOnlyDateAndTimeInputType.cpp index 376d0ad..15a058d 100644 --- a/third_party/WebKit/Source/core/html/forms/BaseChooserOnlyDateAndTimeInputType.cpp +++ b/third_party/WebKit/Source/core/html/forms/BaseChooserOnlyDateAndTimeInputType.cpp
@@ -25,7 +25,6 @@ #include "core/html/forms/BaseChooserOnlyDateAndTimeInputType.h" -#if !ENABLE(INPUT_MULTIPLE_FIELDS_UI) #include "bindings/core/v8/ExceptionStatePlaceholder.h" #include "core/dom/Document.h" #include "core/dom/shadow/ShadowRoot.h" @@ -37,12 +36,18 @@ namespace blink { -BaseChooserOnlyDateAndTimeInputType::BaseChooserOnlyDateAndTimeInputType(HTMLInputElement& element) - : BaseDateAndTimeInputType(element) +BaseChooserOnlyDateAndTimeInputType::BaseChooserOnlyDateAndTimeInputType(HTMLInputElement& element, BaseDateAndTimeInputType& inputType) + : InputTypeView(element) + , m_inputType(inputType) { ThreadState::current()->registerPreFinalizer(this); } +BaseChooserOnlyDateAndTimeInputType* BaseChooserOnlyDateAndTimeInputType::create(HTMLInputElement& element, BaseDateAndTimeInputType& inputType) +{ + return new BaseChooserOnlyDateAndTimeInputType(element, inputType); +} + BaseChooserOnlyDateAndTimeInputType::~BaseChooserOnlyDateAndTimeInputType() { ASSERT(!m_dateTimeChooser); @@ -50,8 +55,9 @@ DEFINE_TRACE(BaseChooserOnlyDateAndTimeInputType) { + visitor->trace(m_inputType); visitor->trace(m_dateTimeChooser); - BaseDateAndTimeInputType::trace(visitor); + InputTypeView::trace(visitor); DateTimeChooserClient::trace(visitor); } @@ -89,7 +95,7 @@ if (!element().suggestedValue().isNull()) displayValue = element().suggestedValue(); else - displayValue = visibleValue(); + displayValue = m_inputType->visibleValue(); if (displayValue.isEmpty()) { // Need to put something to keep text baseline. displayValue = " "; @@ -97,9 +103,8 @@ toHTMLElement(node)->setTextContent(displayValue); } -void BaseChooserOnlyDateAndTimeInputType::setValue(const String& value, bool valueChanged, TextFieldEventBehavior eventBehavior) +void BaseChooserOnlyDateAndTimeInputType::didSetValue(const String& value, bool valueChanged) { - BaseDateAndTimeInputType::setValue(value, valueChanged, eventBehavior); if (valueChanged) updateView(); } @@ -156,9 +161,8 @@ void BaseChooserOnlyDateAndTimeInputType::accessKeyAction(bool sendMouseEvents) { - BaseDateAndTimeInputType::accessKeyAction(sendMouseEvents); + InputTypeView::accessKeyAction(sendMouseEvents); BaseClickableWithKeyInputType::accessKeyAction(element(), sendMouseEvents); } -} -#endif +} // namespace blink
diff --git a/third_party/WebKit/Source/core/html/forms/BaseChooserOnlyDateAndTimeInputType.h b/third_party/WebKit/Source/core/html/forms/BaseChooserOnlyDateAndTimeInputType.h index 822f781..cffe4523 100644 --- a/third_party/WebKit/Source/core/html/forms/BaseChooserOnlyDateAndTimeInputType.h +++ b/third_party/WebKit/Source/core/html/forms/BaseChooserOnlyDateAndTimeInputType.h
@@ -26,9 +26,6 @@ #ifndef BaseChooserOnlyDateAndTimeInputType_h #define BaseChooserOnlyDateAndTimeInputType_h -#include "wtf/build_config.h" - -#if !ENABLE(INPUT_MULTIPLE_FIELDS_UI) #include "core/html/forms/BaseClickableWithKeyInputType.h" #include "core/html/forms/BaseDateAndTimeInputType.h" #include "core/html/forms/DateTimeChooser.h" @@ -37,22 +34,23 @@ namespace blink { -class BaseChooserOnlyDateAndTimeInputType : public BaseDateAndTimeInputType, public DateTimeChooserClient { +// TODO(tkent): Rename this to ChooserOnlyDateAndTimeInputTypeView. +class BaseChooserOnlyDateAndTimeInputType final : public InputTypeView, public DateTimeChooserClient { USING_GARBAGE_COLLECTED_MIXIN(BaseChooserOnlyDateAndTimeInputType); USING_PRE_FINALIZER(BaseChooserOnlyDateAndTimeInputType, closeDateTimeChooser); -protected: - BaseChooserOnlyDateAndTimeInputType(HTMLInputElement&); +public: + static BaseChooserOnlyDateAndTimeInputType* create(HTMLInputElement&, BaseDateAndTimeInputType&); ~BaseChooserOnlyDateAndTimeInputType() override; - DECLARE_VIRTUAL_TRACE(); private: + BaseChooserOnlyDateAndTimeInputType(HTMLInputElement&, BaseDateAndTimeInputType&); void closeDateTimeChooser(); - // InputType functions: + // InputTypeView functions: void createShadowSubtree() override; void closePopupView() override; - void setValue(const String&, bool valueChanged, TextFieldEventBehavior) override; + void didSetValue(const String&, bool valueChanged) override; void handleDOMActivateEvent(Event*) override; void handleKeydownEvent(KeyboardEvent*) override; void handleKeypressEvent(KeyboardEvent*) override; @@ -66,10 +64,10 @@ void didChooseValue(double) override; void didEndChooser() override; + Member<BaseDateAndTimeInputType> m_inputType; Member<DateTimeChooser> m_dateTimeChooser; }; } // namespace blink -#endif // ENABLE(INPUT_MULTIPLE_FIELDS_UI) #endif // BaseChooserOnlyDateAndTimeInputType_h
diff --git a/third_party/WebKit/Source/core/html/forms/BaseClickableWithKeyInputType.cpp b/third_party/WebKit/Source/core/html/forms/BaseClickableWithKeyInputType.cpp index dd26b17..207e4419 100644 --- a/third_party/WebKit/Source/core/html/forms/BaseClickableWithKeyInputType.cpp +++ b/third_party/WebKit/Source/core/html/forms/BaseClickableWithKeyInputType.cpp
@@ -62,13 +62,13 @@ } } -void BaseClickableWithKeyInputType::handleKeyupEvent(InputType& inputType, KeyboardEvent* event) +void BaseClickableWithKeyInputType::handleKeyupEvent(InputTypeView& inputTypeView, KeyboardEvent* event) { const String& key = event->keyIdentifier(); if (key != "U+0020") return; // Simulate mouse click for spacebar for button types. - inputType.dispatchSimulatedClickIfActive(event); + inputTypeView.dispatchSimulatedClickIfActive(event); } // FIXME: Could share this with BaseCheckableInputType and RangeInputType if we had a common base class.
diff --git a/third_party/WebKit/Source/core/html/forms/BaseClickableWithKeyInputType.h b/third_party/WebKit/Source/core/html/forms/BaseClickableWithKeyInputType.h index cf5ad4f1..5fd31a9 100644 --- a/third_party/WebKit/Source/core/html/forms/BaseClickableWithKeyInputType.h +++ b/third_party/WebKit/Source/core/html/forms/BaseClickableWithKeyInputType.h
@@ -41,7 +41,7 @@ public: static void handleKeydownEvent(HTMLInputElement&, KeyboardEvent*); static void handleKeypressEvent(HTMLInputElement&, KeyboardEvent*); - static void handleKeyupEvent(InputType&, KeyboardEvent*); + static void handleKeyupEvent(InputTypeView&, KeyboardEvent*); static void accessKeyAction(HTMLInputElement&, bool sendMouseEvents); protected:
diff --git a/third_party/WebKit/Source/core/html/forms/BaseDateAndTimeInputType.cpp b/third_party/WebKit/Source/core/html/forms/BaseDateAndTimeInputType.cpp index 1e199efa..136f2de1 100644 --- a/third_party/WebKit/Source/core/html/forms/BaseDateAndTimeInputType.cpp +++ b/third_party/WebKit/Source/core/html/forms/BaseDateAndTimeInputType.cpp
@@ -31,6 +31,7 @@ #include "core/html/forms/BaseDateAndTimeInputType.h" #include "core/html/HTMLInputElement.h" +#include "core/html/forms/BaseChooserOnlyDateAndTimeInputType.h" #include "platform/text/PlatformLocale.h" #include "wtf/CurrentTime.h" #include "wtf/DateMath.h" @@ -46,6 +47,15 @@ static const int msecPerMinute = 60 * 1000; static const int msecPerSecond = 1000; +InputTypeView* BaseDateAndTimeInputType::createView() +{ + if (!RuntimeEnabledFeatures::inputMultipleFieldsUIEnabled()) + return BaseChooserOnlyDateAndTimeInputType::create(element(), *this); + // TODO(tkent): Returns MultipleFieldsDateAndTimeInputTypeView. + // crbug.com/243714 + return this; +} + double BaseDateAndTimeInputType::valueAsDate() const { return valueAsDouble();
diff --git a/third_party/WebKit/Source/core/html/forms/BaseDateAndTimeInputType.h b/third_party/WebKit/Source/core/html/forms/BaseDateAndTimeInputType.h index b1ca0dce..3910137 100644 --- a/third_party/WebKit/Source/core/html/forms/BaseDateAndTimeInputType.h +++ b/third_party/WebKit/Source/core/html/forms/BaseDateAndTimeInputType.h
@@ -40,6 +40,9 @@ // A super class of date, datetime, datetime-local, month, time, and week types. class BaseDateAndTimeInputType : public InputType { +public: + String visibleValue() const override; + protected: BaseDateAndTimeInputType(HTMLInputElement& element) : InputType(element) { } Decimal parseToNumber(const String&, const Decimal&) const override; @@ -52,11 +55,12 @@ String serialize(const Decimal&) const override; String serializeWithComponents(const DateComponents&) const; virtual bool setMillisecondToDateComponents(double, DateComponents*) const = 0; - String visibleValue() const override; bool shouldHaveSecondField(const DateComponents&) const; private: virtual bool parseToDateComponentsInternal(const String&, DateComponents*) const = 0; + + InputTypeView* createView() override; double valueAsDate() const override; void setValueAsDate(double, ExceptionState&) const override; double valueAsDouble() const override;
diff --git a/third_party/WebKit/Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.cpp b/third_party/WebKit/Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.cpp index 3d764a5..9807bf3 100644 --- a/third_party/WebKit/Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.cpp +++ b/third_party/WebKit/Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.cpp
@@ -479,9 +479,8 @@ return FormControlState(); } -void BaseMultipleFieldsDateAndTimeInputType::setValue(const String& sanitizedValue, bool valueChanged, TextFieldEventBehavior eventBehavior) +void BaseMultipleFieldsDateAndTimeInputType::didSetValue(const String& sanitizedValue, bool valueChanged) { - InputType::setValue(sanitizedValue, valueChanged, eventBehavior); DateTimeEditElement* edit = dateTimeEditElement(); if (valueChanged || (sanitizedValue.isEmpty() && edit && edit->anyEditableFieldsHaveValues())) { element().updateView();
diff --git a/third_party/WebKit/Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.h b/third_party/WebKit/Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.h index a392adc..f29f528 100644 --- a/third_party/WebKit/Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.h +++ b/third_party/WebKit/Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.h
@@ -111,7 +111,7 @@ void requiredAttributeChanged() final; void restoreFormControlState(const FormControlState&) final; FormControlState saveFormControlState() const final; - void setValue(const String&, bool valueChanged, TextFieldEventBehavior) final; + void didSetValue(const String&, bool valueChanged) final; void stepAttributeChanged() final; void updateView() final; void valueAttributeChanged() override;
diff --git a/third_party/WebKit/Source/core/html/forms/DateInputType.h b/third_party/WebKit/Source/core/html/forms/DateInputType.h index ef42fad..0afb7f38 100644 --- a/third_party/WebKit/Source/core/html/forms/DateInputType.h +++ b/third_party/WebKit/Source/core/html/forms/DateInputType.h
@@ -31,7 +31,7 @@ #ifndef DateInputType_h #define DateInputType_h -#include "core/html/forms/BaseChooserOnlyDateAndTimeInputType.h" +#include "core/html/forms/BaseDateAndTimeInputType.h" #include "core/html/forms/BaseMultipleFieldsDateAndTimeInputType.h" namespace blink { @@ -39,7 +39,7 @@ #if ENABLE(INPUT_MULTIPLE_FIELDS_UI) using BaseDateInputType = BaseMultipleFieldsDateAndTimeInputType; #else -using BaseDateInputType = BaseChooserOnlyDateAndTimeInputType; +using BaseDateInputType = BaseDateAndTimeInputType; #endif class DateInputType final : public BaseDateInputType {
diff --git a/third_party/WebKit/Source/core/html/forms/DateTimeLocalInputType.h b/third_party/WebKit/Source/core/html/forms/DateTimeLocalInputType.h index 9651e748..b57a167 100644 --- a/third_party/WebKit/Source/core/html/forms/DateTimeLocalInputType.h +++ b/third_party/WebKit/Source/core/html/forms/DateTimeLocalInputType.h
@@ -31,7 +31,7 @@ #ifndef DateTimeLocalInputType_h #define DateTimeLocalInputType_h -#include "core/html/forms/BaseChooserOnlyDateAndTimeInputType.h" +#include "core/html/forms/BaseDateAndTimeInputType.h" #include "core/html/forms/BaseMultipleFieldsDateAndTimeInputType.h" namespace blink { @@ -41,7 +41,7 @@ #if ENABLE(INPUT_MULTIPLE_FIELDS_UI) using BaseDateTimeLocalInputType = BaseMultipleFieldsDateAndTimeInputType; #else -using BaseDateTimeLocalInputType = BaseChooserOnlyDateAndTimeInputType; +using BaseDateTimeLocalInputType = BaseDateAndTimeInputType; #endif class DateTimeLocalInputType final : public BaseDateTimeLocalInputType {
diff --git a/third_party/WebKit/Source/core/html/forms/InputType.cpp b/third_party/WebKit/Source/core/html/forms/InputType.cpp index d7dd1fd..5a84612 100644 --- a/third_party/WebKit/Source/core/html/forms/InputType.cpp +++ b/third_party/WebKit/Source/core/html/forms/InputType.cpp
@@ -49,7 +49,6 @@ #include "core/html/forms/DateTimeLocalInputType.h" #include "core/html/forms/EmailInputType.h" #include "core/html/forms/FileInputType.h" -#include "core/html/forms/FormController.h" #include "core/html/forms/HiddenInputType.h" #include "core/html/forms/ImageInputType.h" #include "core/html/forms/MonthInputType.h" @@ -140,6 +139,11 @@ { } +InputTypeView* InputType::createView() +{ + return this; +} + bool InputType::isTextField() const { return false; @@ -150,19 +154,6 @@ return true; } -FormControlState InputType::saveFormControlState() const -{ - String currentValue = element().value(); - if (currentValue == element().defaultValue()) - return FormControlState(); - return FormControlState(currentValue); -} - -void InputType::restoreFormControlState(const FormControlState& state) -{ - element().setValue(state[0]); -} - bool InputType::isFormDataAppendable() const { // There is no form data unless there's a name for non-image types. @@ -234,11 +225,6 @@ return false; } -bool InputType::hasBadInput() const -{ - return false; -} - bool InputType::tooLong(const String&, HTMLTextFormControlElement::NeedsToCheckDirtyFlag) const { return false; @@ -448,13 +434,6 @@ return String(); } -void InputType::dispatchSimulatedClickIfActive(KeyboardEvent* event) const -{ - if (element().active()) - element().dispatchSimulatedClick(event); - event->setDefaultHandled(); -} - ChromeClient* InputType::chromeClient() const { if (FrameHost* host = element().document().frameHost()) @@ -495,11 +474,6 @@ { } -void InputType::accessKeyAction(bool) -{ - element().focus(FocusParams(SelectionBehaviorOnFocus::Reset, WebFocusTypeNone, nullptr)); -} - void InputType::countUsage() { } @@ -711,10 +685,6 @@ return Decimal::nan(); } -void InputType::handleDOMActivateEvent(Event*) -{ -} - bool InputType::hasLegalLinkAttribute(const QualifiedName&) const { return false; @@ -761,11 +731,6 @@ return 0; } -TextDirection InputType::computedTextDirection() -{ - return element().ensureComputedStyle()->direction(); -} - ColorChooserClient* InputType::colorChooserClient() { return nullptr;
diff --git a/third_party/WebKit/Source/core/html/forms/InputType.h b/third_party/WebKit/Source/core/html/forms/InputType.h index 47485df9..9d731b66 100644 --- a/third_party/WebKit/Source/core/html/forms/InputType.h +++ b/third_party/WebKit/Source/core/html/forms/InputType.h
@@ -60,6 +60,7 @@ static const AtomicString& normalizeTypeName(const AtomicString&); ~InputType() override; + virtual InputTypeView* createView(); virtual const AtomicString& formControlType() const = 0; // Type query functions @@ -78,8 +79,6 @@ // Form value functions virtual bool shouldSaveAndRestoreFormControlState() const; - virtual FormControlState saveFormControlState() const; - virtual void restoreFormControlState(const FormControlState&); virtual bool isFormDataAppendable() const; virtual void appendToFormData(FormData&) const; virtual String resultForDialogSubmit() const; @@ -109,7 +108,6 @@ virtual bool typeMismatch() const; virtual bool supportsRequired() const; virtual bool valueMissing(const String&) const; - virtual bool hasBadInput() const; virtual bool patternMismatch(const String&) const; virtual bool tooLong(const String&, HTMLTextFormControlElement::NeedsToCheckDirtyFlag) const; virtual bool tooShort(const String&, HTMLTextFormControlElement::NeedsToCheckDirtyFlag) const; @@ -144,7 +142,6 @@ virtual bool shouldShowFocusRingOnMouseFocus() const; virtual void enableSecureTextInput(); virtual void disableSecureTextInput(); - virtual void accessKeyAction(bool sendMouseEvents); virtual bool canBeSuccessfulSubmitButton(); virtual bool matchesDefaultPseudoClass(); @@ -176,7 +173,6 @@ virtual bool supportsReadOnly() const; virtual String defaultToolTip() const; virtual Decimal findClosestTickMarkValue(const Decimal&); - virtual void handleDOMActivateEvent(Event*); virtual bool hasLegalLinkAttribute(const QualifiedName&) const; virtual const QualifiedName& subResourceAttributeName() const; virtual bool supportsAutocapitalize() const; @@ -204,10 +200,6 @@ virtual unsigned height() const; virtual unsigned width() const; - virtual TextDirection computedTextDirection(); - - void dispatchSimulatedClickIfActive(KeyboardEvent*) const; - // InputTypeView override bool shouldSubmitImplicitly(Event*) override; bool hasCustomFocusLogic() const override;
diff --git a/third_party/WebKit/Source/core/html/forms/InputTypeView.cpp b/third_party/WebKit/Source/core/html/forms/InputTypeView.cpp index 00fe77a8..6f43996 100644 --- a/third_party/WebKit/Source/core/html/forms/InputTypeView.cpp +++ b/third_party/WebKit/Source/core/html/forms/InputTypeView.cpp
@@ -28,8 +28,10 @@ #include "core/html/forms/InputTypeView.h" #include "core/dom/shadow/ShadowRoot.h" +#include "core/events/KeyboardEvent.h" #include "core/html/HTMLFormElement.h" #include "core/html/HTMLInputElement.h" +#include "core/html/forms/FormController.h" #include "core/layout/LayoutObject.h" namespace blink { @@ -82,10 +84,26 @@ { } +void InputTypeView::handleDOMActivateEvent(Event*) +{ +} + void InputTypeView::forwardEvent(Event*) { } +void InputTypeView::dispatchSimulatedClickIfActive(KeyboardEvent* event) const +{ + if (element().active()) + element().dispatchSimulatedClick(event); + event->setDefaultHandled(); +} + +void InputTypeView::accessKeyAction(bool) +{ + element().focus(FocusParams(SelectionBehaviorOnFocus::Reset, WebFocusTypeNone, nullptr)); +} + bool InputTypeView::shouldSubmitImplicitly(Event* event) { return false; @@ -106,6 +124,11 @@ return originalStyle; } +TextDirection InputTypeView::computedTextDirection() +{ + return element().ensureComputedStyle()->direction(); +} + void InputTypeView::blur() { element().defaultBlur(); @@ -199,6 +222,10 @@ { } +void InputTypeView::didSetValue(const String&, bool) +{ +} + void InputTypeView::subtreeHasChanged() { ASSERT_NOT_REACHED(); @@ -226,6 +253,24 @@ return nullptr; } +FormControlState InputTypeView::saveFormControlState() const +{ + String currentValue = element().value(); + if (currentValue == element().defaultValue()) + return FormControlState(); + return FormControlState(currentValue); +} + +void InputTypeView::restoreFormControlState(const FormControlState& state) +{ + element().setValue(state[0]); +} + +bool InputTypeView::hasBadInput() const +{ + return false; +} + DEFINE_TRACE(ClickHandlingState) { visitor->trace(checkedRadioButton);
diff --git a/third_party/WebKit/Source/core/html/forms/InputTypeView.h b/third_party/WebKit/Source/core/html/forms/InputTypeView.h index 51dbd87..8e3ac38 100644 --- a/third_party/WebKit/Source/core/html/forms/InputTypeView.h +++ b/third_party/WebKit/Source/core/html/forms/InputTypeView.h
@@ -36,6 +36,7 @@ #include "core/CoreExport.h" #include "core/events/EventDispatcher.h" #include "platform/heap/Handle.h" +#include "platform/text/TextDirection.h" #include "public/platform/WebFocusType.h" #include "wtf/Allocator.h" #include "wtf/Forward.h" @@ -47,6 +48,7 @@ class BeforeTextInsertedEvent; class Element; class Event; +class FormControlState; class HTMLFormElement; class HTMLInputElement; class KeyboardEvent; @@ -75,6 +77,9 @@ DECLARE_VIRTUAL_TRACE(); virtual bool sizeShouldIncludeDecoration(int defaultSize, int& preferredSize) const; + + // Event handling functions + virtual void handleClickEvent(MouseEvent*); virtual void handleMouseDownEvent(MouseEvent*); virtual ClickHandlingState* willDispatchClick(); @@ -91,11 +96,16 @@ virtual void handleFocusEvent(Element* oldFocusedElement, WebFocusType); virtual void handleFocusInEvent(Element* oldFocusedElement, WebFocusType); virtual void handleBlurEvent(); - virtual void subtreeHasChanged(); + virtual void handleDOMActivateEvent(Event*); + virtual void accessKeyAction(bool sendMouseEvents); virtual bool hasTouchEventHandler() const; virtual void blur(); + void dispatchSimulatedClickIfActive(KeyboardEvent*) const; + + virtual void subtreeHasChanged(); virtual LayoutObject* createLayoutObject(const ComputedStyle&) const; virtual PassRefPtr<ComputedStyle> customStyleForLayoutObject(PassRefPtr<ComputedStyle>); + virtual TextDirection computedTextDirection(); virtual void startResourceLoading(); virtual void closePopupView(); virtual void createShadowSubtree(); @@ -111,6 +121,7 @@ virtual void readonlyAttributeChanged(); virtual void requiredAttributeChanged(); virtual void valueAttributeChanged(); + virtual void didSetValue(const String&, bool valueChanged); virtual void listAttributeTargetChanged(); virtual void updateClearButtonVisibility(); virtual void updatePlaceholderText(); @@ -118,6 +129,11 @@ virtual void ensureFallbackContent() { } virtual void ensurePrimaryContent() { } virtual bool hasFallbackContent() const { return false; } + virtual FormControlState saveFormControlState() const; + virtual void restoreFormControlState(const FormControlState&); + + // Validation functions + virtual bool hasBadInput() const; protected: InputTypeView(HTMLInputElement& element) : m_element(&element) { }
diff --git a/third_party/WebKit/Source/core/html/forms/MonthInputType.h b/third_party/WebKit/Source/core/html/forms/MonthInputType.h index 4a6e3f3..2ec6dd5 100644 --- a/third_party/WebKit/Source/core/html/forms/MonthInputType.h +++ b/third_party/WebKit/Source/core/html/forms/MonthInputType.h
@@ -31,7 +31,7 @@ #ifndef MonthInputType_h #define MonthInputType_h -#include "core/html/forms/BaseChooserOnlyDateAndTimeInputType.h" +#include "core/html/forms/BaseDateAndTimeInputType.h" #include "core/html/forms/BaseMultipleFieldsDateAndTimeInputType.h" namespace blink { @@ -39,7 +39,7 @@ #if ENABLE(INPUT_MULTIPLE_FIELDS_UI) using BaseMonthInputType = BaseMultipleFieldsDateAndTimeInputType; #else -using BaseMonthInputType = BaseChooserOnlyDateAndTimeInputType; +using BaseMonthInputType = BaseDateAndTimeInputType; #endif class MonthInputType final : public BaseMonthInputType {
diff --git a/third_party/WebKit/Source/core/html/forms/TimeInputType.h b/third_party/WebKit/Source/core/html/forms/TimeInputType.h index e86ec4d..bd2074d 100644 --- a/third_party/WebKit/Source/core/html/forms/TimeInputType.h +++ b/third_party/WebKit/Source/core/html/forms/TimeInputType.h
@@ -31,7 +31,7 @@ #ifndef TimeInputType_h #define TimeInputType_h -#include "core/html/forms/BaseChooserOnlyDateAndTimeInputType.h" +#include "core/html/forms/BaseDateAndTimeInputType.h" #include "core/html/forms/BaseMultipleFieldsDateAndTimeInputType.h" namespace blink { @@ -39,7 +39,7 @@ #if ENABLE(INPUT_MULTIPLE_FIELDS_UI) using BaseTimeInputType = BaseMultipleFieldsDateAndTimeInputType; #else -using BaseTimeInputType = BaseChooserOnlyDateAndTimeInputType; +using BaseTimeInputType = BaseDateAndTimeInputType; #endif class TimeInputType final : public BaseTimeInputType {
diff --git a/third_party/WebKit/Source/core/html/forms/WeekInputType.h b/third_party/WebKit/Source/core/html/forms/WeekInputType.h index ca401ec..09a2ebb1 100644 --- a/third_party/WebKit/Source/core/html/forms/WeekInputType.h +++ b/third_party/WebKit/Source/core/html/forms/WeekInputType.h
@@ -31,7 +31,7 @@ #ifndef WeekInputType_h #define WeekInputType_h -#include "core/html/forms/BaseChooserOnlyDateAndTimeInputType.h" +#include "core/html/forms/BaseDateAndTimeInputType.h" #include "core/html/forms/BaseMultipleFieldsDateAndTimeInputType.h" namespace blink { @@ -39,7 +39,7 @@ #if ENABLE(INPUT_MULTIPLE_FIELDS_UI) using BaseWeekInputType = BaseMultipleFieldsDateAndTimeInputType; #else -using BaseWeekInputType = BaseChooserOnlyDateAndTimeInputType; +using BaseWeekInputType = BaseDateAndTimeInputType; #endif class WeekInputType final : public BaseWeekInputType {
diff --git a/third_party/WebKit/Source/core/input/EventHandler.cpp b/third_party/WebKit/Source/core/input/EventHandler.cpp index ee7ebc7f7..2d6734f 100644 --- a/third_party/WebKit/Source/core/input/EventHandler.cpp +++ b/third_party/WebKit/Source/core/input/EventHandler.cpp
@@ -285,7 +285,6 @@ , m_mousePositionIsUnknown(true) , m_mouseDownTimestamp(0) , m_touchPressed(false) - , m_inPointerCanceledState(false) , m_scrollGestureHandlingNode(nullptr) , m_lastGestureScrollOverWidget(false) , m_longTapShouldInvokeContextMenu(false) @@ -360,7 +359,6 @@ m_scrollbarHandlingScrollGesture = nullptr; m_touchPressed = false; m_pointerEventManager.clear(); - m_inPointerCanceledState = false; m_mouseDownMayStartDrag = false; m_lastShowPressTimestamp = 0; m_lastDeferredTapElement = nullptr; @@ -633,34 +631,17 @@ { ASSERT(box); Node* node = box->node(); - Document* document = m_frame->document(); - Element* scrollingElement = document->scrollingElement(); - - bool isRootFrame = !document->ownerElement(); - - // TODO(bokan): If the ViewportScrollCallback is installed on the body, we - // can still hit the HTML element for scrolling in which case it'll bubble - // up to the document node and try to scroll the LayoutView directly. Make - // sure we never scroll the LayoutView like this by manually resetting the - // scroll to happen on the scrolling element. This can also happen in - // QuirksMode when the body is scrollable and scrollingElement == nullptr. - if (node && node->isDocumentNode() && isRootFrame) { - node = scrollingElement - ? scrollingElement - : document->documentElement(); - } // If there's no ApplyScroll callback on the element, scroll as usuall in // the non-scroll-customization case. if (!node || !node->isElementNode() || !toElement(node)->getApplyScroll()) { - ASSERT(!isRootFrame - || node != scrollingElement - || (!scrollingElement && node != document->documentElement())); *wasRootScroller = false; return box->scroll(granularity, delta); } - ASSERT(isRootFrame); + // Viewport actions should only happen when scrolling an element in the + // main frame. + ASSERT(m_frame->isMainFrame()); // If there is an ApplyScroll callback, its because we placed one on the // root scroller to control top controls and overscroll. Invoke a scroll @@ -3735,26 +3716,6 @@ } } -void EventHandler::sendPointerCancels(HeapVector<TouchInfo>& touchInfos) -{ - if (!RuntimeEnabledFeatures::pointerEventEnabled()) - return; - - for (unsigned i = 0; i < touchInfos.size(); ++i) { - TouchInfo& touchInfo = touchInfos[i]; - const PlatformTouchPoint& point = touchInfo.point; - const PlatformTouchPoint::TouchState pointState = point.state(); - - if (pointState == PlatformTouchPoint::TouchReleased - || pointState == PlatformTouchPoint::TouchCancelled) - continue; - - m_pointerEventManager.sendTouchCancelPointerEvent( - touchInfo.touchTarget, - point); - } -} - namespace { // Defining this class type local to dispatchTouchEvents() and annotating @@ -3779,7 +3740,7 @@ } // namespace WebInputEventResult EventHandler::dispatchTouchEvents(const PlatformTouchEvent& event, - HeapVector<TouchInfo>& touchInfos, bool freshTouchEvents, bool allTouchReleased) + HeapVector<TouchInfo>& touchInfos, bool allTouchReleased) { // Build up the lists to use for the 'touches', 'targetTouches' and // 'changedTouches' attributes in the JS event. See @@ -3878,19 +3839,25 @@ { TRACE_EVENT0("blink", "EventHandler::handleTouchEvent"); + if (event.type() == PlatformEvent::TouchScrollStarted) { + m_pointerEventManager.blockTouchPointers(); + return WebInputEventResult::HandledSystem; + } + const Vector<PlatformTouchPoint>& points = event.touchPoints(); - bool freshTouchEvents = true; + bool newTouchSequence = true; bool allTouchReleased = true; for (unsigned i = 0; i < points.size(); ++i) { const PlatformTouchPoint& point = points[i]; if (point.state() != PlatformTouchPoint::TouchPressed) - freshTouchEvents = false; + newTouchSequence = false; if (point.state() != PlatformTouchPoint::TouchReleased && point.state() != PlatformTouchPoint::TouchCancelled) allTouchReleased = false; } - if (freshTouchEvents) { + + if (newTouchSequence) { // Ideally we'd ASSERT !m_touchSequenceDocument here since we should // have cleared the active document when we saw the last release. But we // have some tests that violate this, ClusterFuzz could trigger it, and @@ -3898,6 +3865,7 @@ // touches. http://crbug.com/345372 tracks this. m_touchSequenceDocument.clear(); m_touchSequenceUserGestureToken.clear(); + m_pointerEventManager.unblockTouchPointers(); } ASSERT(m_frame->view()); @@ -4065,33 +4033,17 @@ touchInfo.region = regionID; } - if (!m_inPointerCanceledState) { - dispatchPointerEvents(event, touchInfos); - // Note that the disposition of any pointer events affects only the generation of touch - // events. If all pointer events were handled (and hence no touch events were fired), that - // is still equivalent to the touch events going unhandled because pointer event handler - // don't block scroll gesture generation. - } + dispatchPointerEvents(event, touchInfos); + // Note that the disposition of any pointer events affects only the generation of touch + // events. If all pointer events were handled (and hence no touch events were fired), that + // is still equivalent to the touch events going unhandled because pointer event handler + // don't block scroll gesture generation. // TODO(crbug.com/507408): If PE handlers always call preventDefault, we won't see TEs until after // scrolling starts because the scrolling would suppress upcoming PEs. This sudden "break" in TE // suppression can make the visible TEs inconsistent (e.g. touchmove without a touchstart). - WebInputEventResult eventResult = dispatchTouchEvents(event, touchInfos, freshTouchEvents, - allTouchReleased); - - if (!m_inPointerCanceledState) { - // Check if we need to stop firing pointer events because of a touch action. - // See: www.w3.org/TR/pointerevents/#declaring-candidate-regions-for-default-touch-behaviors - if (event.causesScrollingIfUncanceled() && eventResult == WebInputEventResult::NotHandled) { - m_inPointerCanceledState = true; - sendPointerCancels(touchInfos); - } - } else if (allTouchReleased) { - m_inPointerCanceledState = false; - } - - return eventResult; + return dispatchTouchEvents(event, touchInfos, allTouchReleased); } void EventHandler::userGestureUtilized()
diff --git a/third_party/WebKit/Source/core/input/EventHandler.h b/third_party/WebKit/Source/core/input/EventHandler.h index e609398..e69ebc2 100644 --- a/third_party/WebKit/Source/core/input/EventHandler.h +++ b/third_party/WebKit/Source/core/input/EventHandler.h
@@ -399,9 +399,8 @@ bool slideFocusOnShadowHostIfNecessary(const Element&); void dispatchPointerEvents(const PlatformTouchEvent&, HeapVector<TouchInfo>&); - void sendPointerCancels(HeapVector<TouchInfo>&); - WebInputEventResult dispatchTouchEvents(const PlatformTouchEvent&, HeapVector<TouchInfo>&, bool, bool); + WebInputEventResult dispatchTouchEvents(const PlatformTouchEvent&, HeapVector<TouchInfo>&, bool); // NOTE: If adding a new field to this class please ensure that it is // cleared in |EventHandler::clear()|. @@ -478,11 +477,6 @@ PointerEventManager m_pointerEventManager; - // This is set upon sending a pointercancel for touch, prevents PE dispatches for touches until - // all touch-points become inactive. - // TODO(mustaq): Consider a state per pointerType, as in PointerIdManager? Exclude mouse? - bool m_inPointerCanceledState; - Member<Node> m_scrollGestureHandlingNode; bool m_lastGestureScrollOverWidget; // The most recent element to scroll natively during this scroll
diff --git a/third_party/WebKit/Source/core/input/PointerEventManager.cpp b/third_party/WebKit/Source/core/input/PointerEventManager.cpp index 07dbc48..9f855697 100644 --- a/third_party/WebKit/Source/core/input/PointerEventManager.cpp +++ b/third_party/WebKit/Source/core/input/PointerEventManager.cpp
@@ -311,26 +311,46 @@ } } -void PointerEventManager::sendTouchCancelPointerEvent(EventTarget* target, const PlatformTouchPoint& point) +void PointerEventManager::blockTouchPointers() { - PointerEvent* pointerEvent = m_pointerEventFactory.createPointerCancelEvent(point); + if (m_inCanceledStateForPointerTypeTouch) + return; + m_inCanceledStateForPointerTypeTouch = true; + HeapVector<int> touchPointerIds + = m_pointerEventFactory.getPointerIdsOfType(WebPointerProperties::PointerType::Touch); - processCaptureAndPositionOfPointerEvent(pointerEvent, target); + for (int pointerId : touchPointerIds) { + PointerEvent* pointerEvent + = m_pointerEventFactory.createPointerCancelEvent( + pointerId, WebPointerProperties::PointerType::Touch); - // TODO(nzolghadr): crbug.com/579553 dealing with implicit touch capturing vs pointer event capturing - dispatchPointerEvent( - getEffectiveTargetForPointerEvent(target, pointerEvent->pointerId()), - pointerEvent); + ASSERT(m_nodeUnderPointer.contains(pointerId)); + EventTarget* target = m_nodeUnderPointer.get(pointerId).target; - releasePointerCapture(pointerEvent->pointerId()); + processCaptureAndPositionOfPointerEvent(pointerEvent, target); - // Sending the leave/out events and lostpointercapture - // because the next touch event will have a different id. So delayed - // sending of lostpointercapture won't work here. - processCaptureAndPositionOfPointerEvent(pointerEvent, nullptr); + // TODO(nzolghadr): This event follows implicit TE capture. The actual target + // would depend on PE capturing. Perhaps need to split TE/PE event path upstream? + // crbug.com/579553. + dispatchPointerEvent( + getEffectiveTargetForPointerEvent(target, pointerEvent->pointerId()), + pointerEvent); - removePointer(pointerEvent); + releasePointerCapture(pointerEvent->pointerId()); + + // Sending the leave/out events and lostpointercapture + // because the next touch event will have a different id. So delayed + // sending of lostpointercapture won't work here. + processCaptureAndPositionOfPointerEvent(pointerEvent, nullptr); + + removePointer(pointerEvent); + } +} + +void PointerEventManager::unblockTouchPointers() +{ + m_inCanceledStateForPointerTypeTouch = false; } WebInputEventResult PointerEventManager::sendTouchPointerEvent( @@ -339,6 +359,9 @@ const double width, const double height, const double clientX, const double clientY) { + if (m_inCanceledStateForPointerTypeTouch) + return WebInputEventResult::NotHandled; + PointerEvent* pointerEvent = m_pointerEventFactory.create( pointerEventNameForTouchPointState(touchPoint.state()), @@ -436,6 +459,7 @@ { for (auto& entry : m_preventMouseEventForPointerType) entry = false; + m_inCanceledStateForPointerTypeTouch = false; m_pointerEventFactory.clear(); m_nodeUnderPointer.clear(); m_pointerCaptureTarget.clear(); @@ -565,8 +589,8 @@ void PointerEventManager::removePointer( PointerEvent* pointerEvent) { - if (m_pointerEventFactory.remove(pointerEvent)) { - int pointerId = pointerEvent->pointerId(); + int pointerId = pointerEvent->pointerId(); + if (m_pointerEventFactory.remove(pointerId)) { m_pendingPointerCaptureTarget.remove(pointerId); m_pointerCaptureTarget.remove(pointerId); m_nodeUnderPointer.remove(pointerId);
diff --git a/third_party/WebKit/Source/core/input/PointerEventManager.h b/third_party/WebKit/Source/core/input/PointerEventManager.h index 635113cd..b158c868 100644 --- a/third_party/WebKit/Source/core/input/PointerEventManager.h +++ b/third_party/WebKit/Source/core/input/PointerEventManager.h
@@ -39,8 +39,13 @@ const double width, const double height, const double clientX, const double clientY); - void sendTouchCancelPointerEvent(EventTarget*, - const PlatformTouchPoint&); + // Inhibits firing of touch-type PointerEvents until unblocked by unblockTouchPointers(). Also + // sends pointercancels for existing touch-type PointerEvents. + // See: www.w3.org/TR/pointerevents/#declaring-candidate-regions-for-default-touch-behaviors + void blockTouchPointers(); + + // Enables firing of touch-type PointerEvents after they were inhibited by blockTouchPointers(). + void unblockTouchPointers(); // Sends node transition events mouseout/leave/over/enter to the // corresponding targets. This function sends pointerout/leave/over/enter @@ -135,6 +140,10 @@ // https://w3c.github.io/pointerevents/#compatibility-mapping-with-mouse-events bool m_preventMouseEventForPointerType[static_cast<size_t>(WebPointerProperties::PointerType::LastEntry) + 1]; + // Set upon sending a pointercancel for touch, prevents PE dispatches for touches until + // all touch-points become inactive. + bool m_inCanceledStateForPointerTypeTouch; + // Note that this map keeps track of node under pointer with id=1 as well // which might be different than m_nodeUnderMouse in EventHandler. That one // keeps track of any compatibility mouse event positions but this map for
diff --git a/third_party/WebKit/Source/core/inspector/InspectorBaseAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorBaseAgent.cpp index e8c9d075c..9e5d94b 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorBaseAgent.cpp +++ b/third_party/WebKit/Source/core/inspector/InspectorBaseAgent.cpp
@@ -125,6 +125,8 @@ { for (size_t i = m_agents.size(); i > 0; i--) m_agents[i - 1]->discardAgent(); + m_agents.clear(); + m_state = protocol::DictionaryValue::create(); } void InspectorAgentRegistry::flushPendingProtocolNotifications()
diff --git a/third_party/WebKit/Source/core/inspector/InspectorResourceAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorResourceAgent.cpp index 8e8380cf..cb0096d 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorResourceAgent.cpp +++ b/third_party/WebKit/Source/core/inspector/InspectorResourceAgent.cpp
@@ -85,6 +85,7 @@ static const char resourceAgentEnabled[] = "resourceAgentEnabled"; static const char extraRequestHeaders[] = "extraRequestHeaders"; static const char cacheDisabled[] = "cacheDisabled"; +static const char bypassServiceWorker[] = "bypassServiceWorker"; static const char userAgentOverride[] = "userAgentOverride"; static const char monitoringXHR[] = "monitoringXHR"; static const char blockedURLs[] = "blockedURLs"; @@ -280,6 +281,8 @@ .setSendStart(timing.calculateMillisecondDelta(timing.sendStart())) .setSendEnd(timing.calculateMillisecondDelta(timing.sendEnd())) .setReceiveHeadersEnd(timing.calculateMillisecondDelta(timing.receiveHeadersEnd())) + .setPushStart(timing.pushStart()) + .setPushEnd(timing.pushEnd()) .build(); } @@ -524,6 +527,8 @@ request.setCachePolicy(WebCachePolicy::BypassingCache); request.setShouldResetAppCache(true); } + if (m_state->booleanProperty(ResourceAgentState::bypassServiceWorker, false)) + request.setSkipServiceWorker(true); willSendRequestInternal(frame, identifier, loader, request, redirectResponse, initiatorInfo); @@ -1057,6 +1062,11 @@ memoryCache()->evictResources(); } +void InspectorResourceAgent::setBypassServiceWorker(ErrorString*, bool bypass) +{ + m_state->setBoolean(ResourceAgentState::bypassServiceWorker, bypass); +} + void InspectorResourceAgent::emulateNetworkConditions(ErrorString*, bool, double, double, double) { }
diff --git a/third_party/WebKit/Source/core/inspector/InspectorResourceAgent.h b/third_party/WebKit/Source/core/inspector/InspectorResourceAgent.h index 6964588c..ee127e3 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorResourceAgent.h +++ b/third_party/WebKit/Source/core/inspector/InspectorResourceAgent.h
@@ -144,6 +144,7 @@ void canClearBrowserCookies(ErrorString*, bool* result) override; void emulateNetworkConditions(ErrorString*, bool offline, double latency, double downloadThroughput, double uploadThroughput) override; void setCacheDisabled(ErrorString*, bool cacheDisabled) override; + void setBypassServiceWorker(ErrorString*, bool bypass) override; void setDataSizeLimitsForTest(ErrorString*, int maxTotalSize, int maxResourceSize) override; // Called from other agents.
diff --git a/third_party/WebKit/Source/core/inspector/NetworkResourcesData.h b/third_party/WebKit/Source/core/inspector/NetworkResourcesData.h index d7f0193..1265ff1 100644 --- a/third_party/WebKit/Source/core/inspector/NetworkResourcesData.h +++ b/third_party/WebKit/Source/core/inspector/NetworkResourcesData.h
@@ -131,7 +131,7 @@ DECLARE_TRACE(); private: - bool hasData() const { return m_dataBuffer; } + bool hasData() const { return m_dataBuffer.get(); } size_t dataLength() const; void appendData(const char* data, size_t dataLength); size_t decodeDataToContent();
diff --git a/third_party/WebKit/Source/core/inspector/WorkerInspectorController.cpp b/third_party/WebKit/Source/core/inspector/WorkerInspectorController.cpp index 6ce7c81..6a02c5c 100644 --- a/third_party/WebKit/Source/core/inspector/WorkerInspectorController.cpp +++ b/third_party/WebKit/Source/core/inspector/WorkerInspectorController.cpp
@@ -55,41 +55,44 @@ WorkerInspectorController* WorkerInspectorController::create(WorkerGlobalScope* workerGlobalScope) { WorkerThreadDebugger* debugger = WorkerThreadDebugger::from(workerGlobalScope->thread()->isolate()); - if (!debugger) - return nullptr; - OwnPtr<V8InspectorSession> session = debugger->debugger()->connect(debugger->contextGroupId()); - return new WorkerInspectorController(workerGlobalScope, session.release()); + return debugger ? new WorkerInspectorController(workerGlobalScope, debugger) : nullptr; } -WorkerInspectorController::WorkerInspectorController(WorkerGlobalScope* workerGlobalScope, PassOwnPtr<V8InspectorSession> session) - : m_workerGlobalScope(workerGlobalScope) +WorkerInspectorController::WorkerInspectorController(WorkerGlobalScope* workerGlobalScope, WorkerThreadDebugger* debugger) + : m_debugger(debugger) + , m_workerGlobalScope(workerGlobalScope) , m_instrumentingAgents(InstrumentingAgents::create()) , m_agents(m_instrumentingAgents.get()) - , m_v8Session(session) { - WorkerRuntimeAgent* workerRuntimeAgent = WorkerRuntimeAgent::create(m_v8Session->runtimeAgent(), workerGlobalScope, this); - m_workerRuntimeAgent = workerRuntimeAgent; - m_agents.append(workerRuntimeAgent); - - WorkerDebuggerAgent* workerDebuggerAgent = WorkerDebuggerAgent::create(m_v8Session->debuggerAgent(), workerGlobalScope); - m_workerDebuggerAgent = workerDebuggerAgent; - m_agents.append(workerDebuggerAgent); - - m_agents.append(InspectorProfilerAgent::create(m_v8Session->profilerAgent(), nullptr)); - m_agents.append(InspectorHeapProfilerAgent::create(workerGlobalScope->thread()->isolate(), m_v8Session->heapProfilerAgent())); - - WorkerConsoleAgent* workerConsoleAgent = WorkerConsoleAgent::create(m_v8Session->runtimeAgent(), m_v8Session->debuggerAgent(), workerGlobalScope); - m_agents.append(workerConsoleAgent); - - m_v8Session->runtimeAgent()->setClearConsoleCallback(bind<>(&InspectorConsoleAgent::clearAllMessages, workerConsoleAgent)); } WorkerInspectorController::~WorkerInspectorController() { } +void WorkerInspectorController::initializeAgents() +{ + m_v8Session = m_debugger->debugger()->connect(m_debugger->contextGroupId()); + m_agents.append(WorkerRuntimeAgent::create(m_v8Session->runtimeAgent(), m_workerGlobalScope, this)); + m_agents.append(WorkerDebuggerAgent::create(m_v8Session->debuggerAgent(), m_workerGlobalScope)); + m_agents.append(InspectorProfilerAgent::create(m_v8Session->profilerAgent(), nullptr)); + m_agents.append(InspectorHeapProfilerAgent::create(m_workerGlobalScope->thread()->isolate(), m_v8Session->heapProfilerAgent())); + + WorkerConsoleAgent* workerConsoleAgent = WorkerConsoleAgent::create(m_v8Session->runtimeAgent(), m_v8Session->debuggerAgent(), m_workerGlobalScope); + m_agents.append(workerConsoleAgent); + m_v8Session->runtimeAgent()->setClearConsoleCallback(bind<>(&InspectorConsoleAgent::clearAllMessages, workerConsoleAgent)); +} + +void WorkerInspectorController::destroyAgents() +{ + m_agents.discardAgents(); + m_instrumentingAgents->reset(); + m_v8Session.clear(); +} + void WorkerInspectorController::connectFrontend() { + initializeAgents(); ASSERT(!m_frontend); m_frontend = adoptPtr(new protocol::Frontend(this)); m_backendDispatcher = protocol::Dispatcher::create(this); @@ -106,6 +109,7 @@ m_backendDispatcher.clear(); m_agents.clearFrontend(); m_frontend.clear(); + destroyAgents(); InspectorInstrumentation::frontendDeleted(); } @@ -120,9 +124,6 @@ void WorkerInspectorController::dispose() { disconnectFrontend(); - m_instrumentingAgents->reset(); - m_agents.discardAgents(); - m_v8Session.clear(); } void WorkerInspectorController::resumeStartup() @@ -150,8 +151,6 @@ visitor->trace(m_workerGlobalScope); visitor->trace(m_instrumentingAgents); visitor->trace(m_agents); - visitor->trace(m_workerDebuggerAgent); - visitor->trace(m_workerRuntimeAgent); } } // namespace blink
diff --git a/third_party/WebKit/Source/core/inspector/WorkerInspectorController.h b/third_party/WebKit/Source/core/inspector/WorkerInspectorController.h index 6f6325a..f498682 100644 --- a/third_party/WebKit/Source/core/inspector/WorkerInspectorController.h +++ b/third_party/WebKit/Source/core/inspector/WorkerInspectorController.h
@@ -46,9 +46,8 @@ class InstrumentingAgents; class V8Debugger; class V8InspectorSession; -class WorkerDebuggerAgent; class WorkerGlobalScope; -class WorkerRuntimeAgent; +class WorkerThreadDebugger; namespace protocol { class Dispatcher; @@ -71,7 +70,10 @@ void dispose(); private: - WorkerInspectorController(WorkerGlobalScope*, PassOwnPtr<V8InspectorSession>); + WorkerInspectorController(WorkerGlobalScope*, WorkerThreadDebugger*); + + void initializeAgents(); + void destroyAgents(); // InspectorRuntimeAgent::Client implementation. void resumeStartup() override; @@ -81,14 +83,13 @@ void sendProtocolNotification(PassOwnPtr<protocol::DictionaryValue> message) override; void flush() override; + WorkerThreadDebugger* m_debugger; Member<WorkerGlobalScope> m_workerGlobalScope; Member<InstrumentingAgents> m_instrumentingAgents; InspectorAgentRegistry m_agents; OwnPtr<V8InspectorSession> m_v8Session; OwnPtr<protocol::Frontend> m_frontend; OwnPtr<protocol::Dispatcher> m_backendDispatcher; - Member<WorkerDebuggerAgent> m_workerDebuggerAgent; - Member<WorkerRuntimeAgent> m_workerRuntimeAgent; }; } // namespace blink
diff --git a/third_party/WebKit/Source/core/layout/LayoutCounter.cpp b/third_party/WebKit/Source/core/layout/LayoutCounter.cpp index 8086a94..8f48f65 100644 --- a/third_party/WebKit/Source/core/layout/LayoutCounter.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutCounter.cpp
@@ -227,7 +227,7 @@ // we are a root node if that reset is a root. parent = currentCounter->parent(); previousSibling = parent ? currentCounter : nullptr; - return parent; + return parent.get(); } // We are not a reset node or the previous reset must be on an ancestor of our owner layoutObject // hence we must be a child of that reset counter. @@ -261,7 +261,7 @@ if (isReset && areLayoutObjectsElementsSiblings(*currentLayoutObject, counterOwner)) { parent = currentCounter->parent(); previousSibling = currentCounter; - return parent; + return parent.get(); } parent = currentCounter; previousSibling = previousSiblingProtector.get();
diff --git a/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp b/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp index a781e688..865c52edd 100644 --- a/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp
@@ -269,6 +269,8 @@ if (!relayoutChildren && simplifiedLayout()) return; + m_relaidOutChildren.clear(); + if (updateLogicalWidthAndColumnWidth()) relayoutChildren = true; @@ -736,6 +738,7 @@ mainSize = child.maxPreferredLogicalWidth() + child.scrollbarLogicalWidth() - child.intrinsicScrollbarLogicalWidth(); } m_intrinsicSizeAlongMainAxis.set(&child, mainSize); + m_relaidOutChildren.add(&child); } void LayoutFlexibleBox::clearCachedMainSizeForChild(const LayoutBox& child) @@ -787,6 +790,8 @@ Vector<LayoutUnit, 16> childSizes; + dirtyForLayoutFromPercentageHeightDescendants(layoutScope); + m_orderIterator.first(); LayoutUnit crossAxisOffset = flowAwareBorderBefore() + flowAwarePaddingBefore(); while (computeNextFlexLine(orderedChildren, sumFlexBaseSize, totalFlexGrow, totalFlexShrink, totalWeightedFlexShrink, sumHypotheticalMainSize, relayoutChildren)) { @@ -1077,37 +1082,20 @@ LayoutUnit LayoutFlexibleBox::crossSizeForPercentageResolution(const LayoutBox& child) { - // This function implements section 9.8. Definite and Indefinite Sizes, case - // 1) of the flexbox spec. - // We need to check for multiline and a definite cross size of the flexbox - // per https://drafts.csswg.org/css-flexbox/#definite-sizes, and for - // stretch, auto margins, and an indefinite cross size of the flex item per - // https://drafts.csswg.org/css-flexbox/#stretched (linked from that - // section) - if (isMultiline() || alignmentForChild(child) != ItemPositionStretch || hasAutoMarginsInCrossAxis(child)) + if (alignmentForChild(child) != ItemPositionStretch) return LayoutUnit(-1); - const Length& childCrossLength = isHorizontalFlow() ? child.styleRef().height() : child.styleRef().width(); - if (crossAxisLengthIsDefinite(child, childCrossLength)) - return LayoutUnit(-1); + // Here we implement https://drafts.csswg.org/css-flexbox/#algo-stretch + if (hasOrthogonalFlow(child) && child.hasOverrideLogicalContentWidth()) + return child.overrideLogicalContentWidth(); + if (!hasOrthogonalFlow(child) && child.hasOverrideLogicalContentHeight()) + return child.overrideLogicalContentHeight(); - LayoutUnit childCrossSize; - - if (isColumnFlow()) { - LayoutUnit definiteWidth = computeDefiniteLogicalWidth(); - if (definiteWidth == LayoutUnit(-1)) - return definiteWidth; - childCrossSize = definiteWidth - borderAndPaddingLogicalWidth() - scrollbarLogicalWidth(); - childCrossSize = child.constrainLogicalWidthByMinMax(childCrossSize, childCrossSize, this) - child.scrollbarLogicalWidth() - child.borderAndPaddingLogicalWidth(); - } else { - LayoutUnit definiteHeight = computeDefiniteLogicalHeight(); - if (definiteHeight == LayoutUnit(-1)) - return definiteHeight; - - childCrossSize = definiteHeight - borderAndPaddingLogicalHeight() - scrollbarLogicalHeight(); - childCrossSize = child.constrainLogicalHeightByMinMax(childCrossSize, LayoutUnit(-1)) - child.scrollbarLogicalHeight() - child.borderAndPaddingLogicalHeight(); - } - return childCrossSize; + // We don't currently implement the optimization from https://drafts.csswg.org/css-flexbox/#definite-sizes + // case 1. While that could speed up a specialized case, it requires determining if we have a definite + // size, which itself is not cheap. We can consider implementing it at a later time. + // (The correctness is ensured by redoing layout in applyStretchAlignmentToChild) + return LayoutUnit(-1); } LayoutUnit LayoutFlexibleBox::mainSizeForPercentageResolution(const LayoutBox& child) @@ -1468,11 +1456,6 @@ LayoutUnit childPreferredSize = childSizes[i] + mainAxisBorderAndPaddingExtentForChild(*child); setOverrideMainAxisSizeForChild(*child, childPreferredSize); if (childPreferredSize != mainAxisExtentForChild(*child)) { - // We will correctly handle percentage sizing even without re-laying out here, because - // if our size was already correct, then percentage resolution was also correct due - // to the way percentage sizing is defined by flexbox (ie. it requires a definite flex basis) - // TODO(cbiesinger): When flex-basis is used instead of width/height, this is not the case. That - // problem is not limited to percentages. See http://crbug.com/531656#c11 child->setChildNeedsLayout(MarkOnlyThis); } else { // To avoid double applying margin changes in updateAutoMarginsInCrossAxis, we reset the margins here. @@ -1480,9 +1463,17 @@ } // We may have already forced relayout for orthogonal flowing children in computeInnerFlexBaseSizeForChild. bool forceChildRelayout = relayoutChildren && !childFlexBaseSizeRequiresLayout(*child); + if (child->isLayoutBlock() && toLayoutBlock(*child).hasPercentHeightDescendants() && m_relaidOutChildren.contains(child)) { + // Have to force another relayout even though the child is sized correctly, because + // its descendants are not sized correctly yet. Our previous layout of the child was + // done without an override height set. So, redo it here. + forceChildRelayout = true; + } updateBlockChildDirtyBitsBeforeLayout(forceChildRelayout, *child); if (!child->needsLayout()) child->markForPaginationRelayoutIfNeeded(layoutScope); + if (child->needsLayout()) + m_relaidOutChildren.add(child); child->layoutIfNeeded(); updateAutoMarginsInMainAxis(*child, autoMarginOffset); @@ -1740,6 +1731,12 @@ // FIXME: Can avoid laying out here in some cases. See https://webkit.org/b/87905. bool childNeedsRelayout = desiredLogicalHeight != child.logicalHeight(); + if (child.isLayoutBlock() && toLayoutBlock(child).hasPercentHeightDescendants() && m_relaidOutChildren.contains(&child)) { + // Have to force another relayout even though the child is sized correctly, because + // its descendants are not sized correctly yet. Our previous layout of the child was + // done without an override height set. So, redo it here. + childNeedsRelayout = true; + } if (childNeedsRelayout || !child.hasOverrideLogicalContentHeight()) child.setOverrideLogicalContentHeight(desiredLogicalHeight - child.borderAndPaddingLogicalHeight()); if (childNeedsRelayout) {
diff --git a/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.h b/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.h index 84b00869..96b647f5 100644 --- a/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.h +++ b/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.h
@@ -192,6 +192,11 @@ // This is used to cache the preferred size for orthogonal flow children so we don't have to relayout to get it HashMap<const LayoutObject*, LayoutUnit> m_intrinsicSizeAlongMainAxis; + // This set is used to keep track of which children we laid out in this current layout iteration. + // We need it because the ones in this set may need an additional layout pass for correct stretch alignment + // handling, as the first layout likely did not use the correct value for percentage sizing of children. + HashSet<const LayoutObject*> m_relaidOutChildren; + mutable OrderIterator m_orderIterator; int m_numberOfInFlowChildrenOnFirstLine; };
diff --git a/third_party/WebKit/Source/core/layout/LayoutMultiColumnSet.cpp b/third_party/WebKit/Source/core/layout/LayoutMultiColumnSet.cpp index 1ad819f..9c40e3d 100644 --- a/third_party/WebKit/Source/core/layout/LayoutMultiColumnSet.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutMultiColumnSet.cpp
@@ -313,7 +313,7 @@ bool changed = false; for (auto& group : m_fragmentainerGroups) - changed = group.recalculateColumnHeight() || changed; + changed = group.recalculateColumnHeight(*this) || changed; m_initialHeightCalculated = true; return changed; }
diff --git a/third_party/WebKit/Source/core/layout/LayoutTable.cpp b/third_party/WebKit/Source/core/layout/LayoutTable.cpp index a9babf6..7c9b6d6 100644 --- a/third_party/WebKit/Source/core/layout/LayoutTable.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutTable.cpp
@@ -418,6 +418,12 @@ { ASSERT(childNeedsOverflowRecalcAfterStyleChange()); clearChildNeedsOverflowRecalcAfterStyleChange(); + + // If the table needs layout the sections we keep pointers to may have gone away and + // overflow will get recalculated anyway so return early. + if (needsLayout()) + return false; + bool childrenOverflowChanged = false; for (LayoutTableSection* section = topSection(); section; section = sectionBelow(section)) { if (!section->childNeedsOverflowRecalcAfterStyleChange())
diff --git a/third_party/WebKit/Source/core/layout/MultiColumnFragmentainerGroup.cpp b/third_party/WebKit/Source/core/layout/MultiColumnFragmentainerGroup.cpp index e2fae00..855466f5 100644 --- a/third_party/WebKit/Source/core/layout/MultiColumnFragmentainerGroup.cpp +++ b/third_party/WebKit/Source/core/layout/MultiColumnFragmentainerGroup.cpp
@@ -10,7 +10,7 @@ namespace blink { -MultiColumnFragmentainerGroup::MultiColumnFragmentainerGroup(LayoutMultiColumnSet& columnSet) +MultiColumnFragmentainerGroup::MultiColumnFragmentainerGroup(const LayoutMultiColumnSet& columnSet) : m_columnSet(columnSet) { } @@ -57,7 +57,7 @@ } } -bool MultiColumnFragmentainerGroup::recalculateColumnHeight() +bool MultiColumnFragmentainerGroup::recalculateColumnHeight(LayoutMultiColumnSet& columnSet) { LayoutUnit oldColumnHeight = m_columnHeight; @@ -66,18 +66,18 @@ // Only the last row may have auto height, and thus be balanced. There are no good reasons to // balance the preceding rows, and that could potentially lead to an insane number of layout // passes as well. - if (isLastGroup() && m_columnSet.heightIsAuto()) { + if (isLastGroup() && columnSet.heightIsAuto()) { LayoutUnit newColumnHeight; - if (!m_columnSet.isInitialHeightCalculated()) { + if (!columnSet.isInitialHeightCalculated()) { // Initial balancing: Start with the lowest imaginable column height. Also calculate the // height of the tallest piece of unbreakable content. Columns should never get any // shorter than that (unless constrained by max-height). Propagate this to our // containing column set, in case there is an outer multicol container that also needs // to balance. After having calculated the initial column height, the multicol container // needs another layout pass with the column height that we just calculated. - InitialColumnHeightFinder initialHeightFinder(columnSet(), logicalTopInFlowThread(), logicalBottomInFlowThread()); + InitialColumnHeightFinder initialHeightFinder(columnSet, logicalTopInFlowThread(), logicalBottomInFlowThread()); LayoutUnit tallestUnbreakableLogicalHeight = initialHeightFinder.tallestUnbreakableLogicalHeight(); - m_columnSet.propagateTallestUnbreakableLogicalHeight(tallestUnbreakableLogicalHeight); + columnSet.propagateTallestUnbreakableLogicalHeight(tallestUnbreakableLogicalHeight); newColumnHeight = std::max(initialHeightFinder.initialMinimalBalancedHeight(), tallestUnbreakableLogicalHeight); } else { // Rebalancing: After having laid out again, we'll need to rebalance if the height
diff --git a/third_party/WebKit/Source/core/layout/MultiColumnFragmentainerGroup.h b/third_party/WebKit/Source/core/layout/MultiColumnFragmentainerGroup.h index e1ca9abfb..4f7df29 100644 --- a/third_party/WebKit/Source/core/layout/MultiColumnFragmentainerGroup.h +++ b/third_party/WebKit/Source/core/layout/MultiColumnFragmentainerGroup.h
@@ -29,7 +29,7 @@ class MultiColumnFragmentainerGroup { DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); public: - MultiColumnFragmentainerGroup(LayoutMultiColumnSet&); + MultiColumnFragmentainerGroup(const LayoutMultiColumnSet&); const LayoutMultiColumnSet& columnSet() const { return m_columnSet; } @@ -60,7 +60,7 @@ LayoutUnit logicalHeightInFlowThread() const { return m_logicalBottomInFlowThread - m_logicalTopInFlowThread; } void resetColumnHeight(); - bool recalculateColumnHeight(); + bool recalculateColumnHeight(LayoutMultiColumnSet&); LayoutSize flowThreadTranslationAtOffset(LayoutUnit offsetInFlowThread) const; LayoutUnit columnLogicalTopForOffset(LayoutUnit offsetInFlowThread) const; @@ -103,7 +103,7 @@ // Get the first and the last column intersecting the specified visual rectangle. void columnIntervalForVisualRect(const LayoutRect&, unsigned& firstColumn, unsigned& lastColumn) const; - LayoutMultiColumnSet& m_columnSet; + const LayoutMultiColumnSet& m_columnSet; LayoutUnit m_logicalTop; LayoutUnit m_logicalTopInFlowThread;
diff --git a/third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp b/third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp index 1adf1d0..d702f4d7 100644 --- a/third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp +++ b/third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp
@@ -450,8 +450,6 @@ for (unsigned i = 0; i < layersNeedingPaintInvalidation.size(); i++) forceRecomputePaintInvalidationRectsIncludingNonCompositingDescendants(layersNeedingPaintInvalidation[i]->layoutObject()); - m_layoutView.frameView()->setFrameTimingRequestsDirty(true); - // Inform the inspector that the layer tree has changed. if (m_layoutView.frame()->isMainFrame()) InspectorInstrumentation::layerTreeDidChange(m_layoutView.frame());
diff --git a/third_party/WebKit/Source/core/layout/line/InlineTextBox.cpp b/third_party/WebKit/Source/core/layout/line/InlineTextBox.cpp index f21e69a..6d48d9f 100644 --- a/third_party/WebKit/Source/core/layout/line/InlineTextBox.cpp +++ b/third_party/WebKit/Source/core/layout/line/InlineTextBox.cpp
@@ -30,6 +30,7 @@ #include "core/layout/line/AbstractInlineTextBox.h" #include "core/layout/line/EllipsisBox.h" #include "core/paint/InlineTextBoxPainter.h" +#include "platform/fonts/CharacterRange.h" #include "platform/fonts/FontCache.h" #include "platform/fonts/shaping/SimpleShaper.h" #include "wtf/Vector.h" @@ -544,15 +545,13 @@ const ComputedStyle& styleToUse = getLineLayoutItem().styleRef(isFirstLineStyle()); const Font& font = styleToUse.font(); - float lastWidth = 0; - widths.resize(m_len); - for (unsigned i = 0; i < m_len; i++) { - StringView substringView = getLineLayoutItem().text().createView(); - substringView.narrow(start(), 1 + i); - TextRun textRun = constructTextRun(styleToUse, font, substringView, m_len); - widths[i] = font.width(textRun, nullptr, nullptr) - lastWidth; - lastWidth = font.width(textRun, nullptr, nullptr); - } + TextRun textRun = constructTextRun(styleToUse, font); + Vector<CharacterRange> ranges = font.individualCharacterRanges(textRun); + DCHECK_EQ(ranges.size(), m_len); + + widths.resize(ranges.size()); + for (unsigned i = 0; i < ranges.size(); i++) + widths[i] = ranges[i].width(); } TextRun InlineTextBox::constructTextRun(const ComputedStyle& style, const Font& font, StringBuilder* charactersWithHyphen) const
diff --git a/third_party/WebKit/Source/core/layout/svg/LayoutSVGContainer.cpp b/third_party/WebKit/Source/core/layout/svg/LayoutSVGContainer.cpp index 4b7e9e3d..85d5adb 100644 --- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGContainer.cpp +++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGContainer.cpp
@@ -59,7 +59,19 @@ // LayoutSVGViewportContainer needs to set the 'layout size changed' flag. determineIfLayoutSizeChanged(); - SVGLayoutSupport::layoutChildren(this, selfNeedsLayout() || SVGLayoutSupport::filtersForceContainerLayout(this)); + bool transformChanged = SVGLayoutSupport::transformToRootChanged(this); + + // When hasRelativeLengths() is false, no descendants have relative lengths + // (hence no one is interested in viewport size changes). + bool layoutSizeChanged = element()->hasRelativeLengths() + && SVGLayoutSupport::layoutSizeOfNearestViewportChanged(this); + + // If any of this container's children need to be laid out, and a filter is + // applied to the container, we need to issue paint invalidations for all + // the descendants. + bool forceLayoutOfChildren = selfNeedsLayout() + || (normalChildNeedsLayout() && SVGLayoutSupport::hasFilterResource(*this)); + SVGLayoutSupport::layoutChildren(firstChild(), forceLayoutOfChildren, transformChanged, layoutSizeChanged); // Invalidate all resources of this client if our layout changed. if (everHadLayout() && needsLayout()) @@ -98,8 +110,7 @@ bool LayoutSVGContainer::selfWillPaint() const { - SVGResources* resources = SVGResourcesCache::cachedResourcesForLayoutObject(this); - return resources && resources->filter(); + return SVGLayoutSupport::hasFilterResource(*this); } void LayoutSVGContainer::styleDidChange(StyleDifference diff, const ComputedStyle* oldStyle)
diff --git a/third_party/WebKit/Source/core/layout/svg/LayoutSVGContainer.h b/third_party/WebKit/Source/core/layout/svg/LayoutSVGContainer.h index 7250283..49caa18 100644 --- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGContainer.h +++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGContainer.h
@@ -44,7 +44,7 @@ void paint(const PaintInfo&, const LayoutPoint&) const override; void styleDidChange(StyleDifference, const ComputedStyle* oldStyle) override; void setNeedsBoundariesUpdate() final { m_needsBoundariesUpdate = true; } - virtual bool didTransformToRootUpdate() { return false; } + virtual bool didTransformToRootUpdate() const { return false; } bool isObjectBoundingBoxValid() const { return m_objectBoundingBoxValid; } bool selfWillPaint() const;
diff --git a/third_party/WebKit/Source/core/layout/svg/LayoutSVGHiddenContainer.cpp b/third_party/WebKit/Source/core/layout/svg/LayoutSVGHiddenContainer.cpp index 329a8b5..2ef125d 100644 --- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGHiddenContainer.cpp +++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGHiddenContainer.cpp
@@ -33,7 +33,15 @@ { ASSERT(needsLayout()); LayoutAnalyzer::Scope analyzer(*this); - SVGLayoutSupport::layoutChildren(this, selfNeedsLayout()); + // TODO(fs): In what cases do we need this? + bool transformChanged = SVGLayoutSupport::transformToRootChanged(this); + + // When hasRelativeLengths() is false, no descendants have relative lengths + // (hence no one is interested in viewport size changes). + bool layoutSizeChanged = element()->hasRelativeLengths() + && SVGLayoutSupport::layoutSizeOfNearestViewportChanged(this); + + SVGLayoutSupport::layoutChildren(firstChild(), selfNeedsLayout(), transformChanged, layoutSizeChanged); updateCachedBoundaries(); clearNeedsLayout(); }
diff --git a/third_party/WebKit/Source/core/layout/svg/LayoutSVGRoot.cpp b/third_party/WebKit/Source/core/layout/svg/LayoutSVGRoot.cpp index 7e6a83c8..6ed9f212 100644 --- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGRoot.cpp +++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGRoot.cpp
@@ -151,7 +151,17 @@ SVGSVGElement* svg = toSVGSVGElement(node()); ASSERT(svg); m_isLayoutSizeChanged = needsLayout || (svg->hasRelativeLengths() && oldSize != size()); - SVGLayoutSupport::layoutChildren(this, needsLayout || SVGLayoutSupport::filtersForceContainerLayout(this)); + // When hasRelativeLengths() is false, no descendants have relative lengths + // (hence no one is interested in viewport size changes). + bool layoutSizeChanged = m_isLayoutSizeChanged && svg->hasRelativeLengths(); + + // If any of this root's children need to be laid out, and a filter is + // applied to it, we need to issue paint invalidations for all descendants. + bool forceLayoutOfChildren = needsLayout + || (normalChildNeedsLayout() && SVGLayoutSupport::hasFilterResource(*this)); + + const bool transformToRootChanged = false; + SVGLayoutSupport::layoutChildren(firstChild(), forceLayoutOfChildren, transformToRootChanged, layoutSizeChanged); if (m_needsBoundariesOrTransformUpdate) { updateCachedBoundaries();
diff --git a/third_party/WebKit/Source/core/layout/svg/LayoutSVGTransformableContainer.h b/third_party/WebKit/Source/core/layout/svg/LayoutSVGTransformableContainer.h index dff925d..6abe13a 100644 --- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGTransformableContainer.h +++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGTransformableContainer.h
@@ -26,6 +26,7 @@ namespace blink { class SVGGraphicsElement; + class LayoutSVGTransformableContainer final : public LayoutSVGContainer { public: explicit LayoutSVGTransformableContainer(SVGGraphicsElement*); @@ -37,7 +38,7 @@ const FloatSize& additionalTranslation() const { return m_additionalTranslation; } void setNeedsTransformUpdate() override { m_needsTransformUpdate = true; } - bool didTransformToRootUpdate() override { return m_didTransformToRootUpdate; } + bool didTransformToRootUpdate() const override { return m_didTransformToRootUpdate; } private: bool calculateLocalTransform() override;
diff --git a/third_party/WebKit/Source/core/layout/svg/LayoutSVGViewportContainer.h b/third_party/WebKit/Source/core/layout/svg/LayoutSVGViewportContainer.h index 62bbb9a9..f223704 100644 --- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGViewportContainer.h +++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGViewportContainer.h
@@ -35,7 +35,7 @@ FloatRect viewport() const { return m_viewport; } bool isLayoutSizeChanged() const { return m_isLayoutSizeChanged; } - bool didTransformToRootUpdate() override { return m_didTransformToRootUpdate; } + bool didTransformToRootUpdate() const override { return m_didTransformToRootUpdate; } void determineIfLayoutSizeChanged() override; void setNeedsTransformUpdate() override { m_needsTransformUpdate = true; }
diff --git a/third_party/WebKit/Source/core/layout/svg/SVGLayoutSupport.cpp b/third_party/WebKit/Source/core/layout/svg/SVGLayoutSupport.cpp index 646a3f4..08b15556 100644 --- a/third_party/WebKit/Source/core/layout/svg/SVGLayoutSupport.cpp +++ b/third_party/WebKit/Source/core/layout/svg/SVGLayoutSupport.cpp
@@ -34,6 +34,7 @@ #include "core/layout/svg/LayoutSVGRoot.h" #include "core/layout/svg/LayoutSVGShape.h" #include "core/layout/svg/LayoutSVGText.h" +#include "core/layout/svg/LayoutSVGTransformableContainer.h" #include "core/layout/svg/LayoutSVGViewportContainer.h" #include "core/layout/svg/SVGResources.h" #include "core/layout/svg/SVGResourcesCache.h" @@ -246,48 +247,40 @@ return toLayoutSVGRoot(start); } -inline bool SVGLayoutSupport::layoutSizeOfNearestViewportChanged(const LayoutObject* start) +bool SVGLayoutSupport::layoutSizeOfNearestViewportChanged(const LayoutObject* start) { - while (start && !start->isSVGRoot() && !start->isSVGViewportContainer()) - start = start->parent(); - - ASSERT(start); - ASSERT(start->isSVGRoot() || start->isSVGViewportContainer()); - if (start->isSVGViewportContainer()) - return toLayoutSVGViewportContainer(start)->isLayoutSizeChanged(); - - return toLayoutSVGRoot(start)->isLayoutSizeChanged(); + for (; start; start = start->parent()) { + if (start->isSVGRoot()) + return toLayoutSVGRoot(start)->isLayoutSizeChanged(); + if (start->isSVGViewportContainer()) + return toLayoutSVGViewportContainer(start)->isLayoutSizeChanged(); + } + ASSERT_NOT_REACHED(); + return false; } -bool SVGLayoutSupport::transformToRootChanged(LayoutObject* ancestor) +bool SVGLayoutSupport::transformToRootChanged(const LayoutObject* ancestor) { while (ancestor && !ancestor->isSVGRoot()) { if (ancestor->isSVGTransformableContainer()) - return toLayoutSVGContainer(ancestor)->didTransformToRootUpdate(); + return toLayoutSVGTransformableContainer(ancestor)->didTransformToRootUpdate(); if (ancestor->isSVGViewportContainer()) return toLayoutSVGViewportContainer(ancestor)->didTransformToRootUpdate(); ancestor = ancestor->parent(); } - return false; } -void SVGLayoutSupport::layoutChildren(LayoutObject* start, bool selfNeedsLayout) +void SVGLayoutSupport::layoutChildren(LayoutObject* firstChild, bool forceLayout, bool transformChanged, bool layoutSizeChanged) { - // When hasRelativeLengths() is false, no descendants have relative lengths - // (hence no one is interested in viewport size changes). - bool layoutSizeChanged = toSVGElement(start->node())->hasRelativeLengths() - && layoutSizeOfNearestViewportChanged(start); - bool transformChanged = transformToRootChanged(start); - - for (LayoutObject* child = start->slowFirstChild(); child; child = child->nextSibling()) { - bool forceLayout = selfNeedsLayout; + for (LayoutObject* child = firstChild; child; child = child->nextSibling()) { + bool forceChildLayout = forceLayout; if (transformChanged) { // If the transform changed we need to update the text metrics (note: this also happens for layoutSizeChanged=true). if (child->isSVGText()) toLayoutSVGText(child)->setNeedsTextMetricsUpdate(); - forceLayout = true; + forceChildLayout = true; } if (layoutSizeChanged) { @@ -303,7 +296,7 @@ toLayoutSVGText(child)->setNeedsPositioningValuesUpdate(); } - forceLayout = true; + forceChildLayout = true; } } } @@ -321,7 +314,7 @@ child->layoutIfNeeded(); } else { SubtreeLayoutScope layoutScope(*child); - if (forceLayout) + if (forceChildLayout) layoutScope.setNeedsLayout(child, LayoutInvalidationReason::SvgChanged); // Lay out any referenced resources before the child. @@ -366,18 +359,10 @@ paintInvalidationRect.intersect(masker->resourceBoundingBox(layoutObject)); } -bool SVGLayoutSupport::filtersForceContainerLayout(LayoutObject* object) +bool SVGLayoutSupport::hasFilterResource(const LayoutObject& object) { - // If any of this container's children need to be laid out, and a filter is applied - // to the container, we need to issue paint invalidations the entire container. - if (!object->normalChildNeedsLayout()) - return false; - - SVGResources* resources = SVGResourcesCache::cachedResourcesForLayoutObject(object); - if (!resources || !resources->filter()) - return false; - - return true; + SVGResources* resources = SVGResourcesCache::cachedResourcesForLayoutObject(&object); + return resources && resources->filter(); } bool SVGLayoutSupport::pointInClippingArea(const LayoutObject* object, const FloatPoint& point)
diff --git a/third_party/WebKit/Source/core/layout/svg/SVGLayoutSupport.h b/third_party/WebKit/Source/core/layout/svg/SVGLayoutSupport.h index 5690fa1..a43dc05 100644 --- a/third_party/WebKit/Source/core/layout/svg/SVGLayoutSupport.h +++ b/third_party/WebKit/Source/core/layout/svg/SVGLayoutSupport.h
@@ -50,7 +50,7 @@ STATIC_ONLY(SVGLayoutSupport); public: // Shares child layouting code between LayoutSVGRoot/LayoutSVG(Hidden)Container - static void layoutChildren(LayoutObject*, bool selfNeedsLayout); + static void layoutChildren(LayoutObject*, bool forceLayout, bool transformChanged, bool layoutSizeChanged); // Layout resources used by this node. static void layoutResourcesIfNeeded(const LayoutObject*); @@ -61,8 +61,8 @@ // Calculates the paintInvalidationRect in combination with filter, clipper and masker in local coordinates. static void intersectPaintInvalidationRectWithResources(const LayoutObject*, FloatRect&); - // Determines whether a container needs to be laid out because it's filtered and a child is being laid out. - static bool filtersForceContainerLayout(LayoutObject*); + // Determine if the LayoutObject references a filter resource object. + static bool hasFilterResource(const LayoutObject&); // Determines whether the passed point lies in a clipping area static bool pointInClippingArea(const LayoutObject*, const FloatPoint&); @@ -89,7 +89,10 @@ static DashArray resolveSVGDashArray(const SVGDashArray&, const ComputedStyle&, const SVGLengthContext&); // Determines if any ancestor's transform has changed. - static bool transformToRootChanged(LayoutObject*); + static bool transformToRootChanged(const LayoutObject*); + + // Determines if any ancestor's layout size has changed. + static bool layoutSizeOfNearestViewportChanged(const LayoutObject*); // FIXME: These methods do not belong here. static const LayoutSVGRoot* findTreeRootObject(const LayoutObject*); @@ -112,7 +115,6 @@ private: static void updateObjectBoundingBox(FloatRect& objectBoundingBox, bool& objectBoundingBoxValid, LayoutObject* other, FloatRect otherBoundingBox); - static bool layoutSizeOfNearestViewportChanged(const LayoutObject* start); }; class SubtreeContentTransformScope {
diff --git a/third_party/WebKit/Source/core/loader/LinkPreloadResourceClients.h b/third_party/WebKit/Source/core/loader/LinkPreloadResourceClients.h index 63dbecb..5d916e58 100644 --- a/third_party/WebKit/Source/core/loader/LinkPreloadResourceClients.h +++ b/third_party/WebKit/Source/core/loader/LinkPreloadResourceClients.h
@@ -153,9 +153,9 @@ void clear() override { clearResource(); } - void fontLoaded(FontResource* resource) override + void notifyFinished(Resource* resource) override { - ASSERT(this->resource() == resource); + ASSERT(this->resource() == toFontResource(resource)); triggerEvents(resource); }
diff --git a/third_party/WebKit/Source/core/page/scrolling/ViewportScrollCallback.cpp b/third_party/WebKit/Source/core/page/scrolling/ViewportScrollCallback.cpp index f6a6902..c9b130f 100644 --- a/third_party/WebKit/Source/core/page/scrolling/ViewportScrollCallback.cpp +++ b/third_party/WebKit/Source/core/page/scrolling/ViewportScrollCallback.cpp
@@ -18,10 +18,8 @@ namespace blink { -ViewportScrollCallback::ViewportScrollCallback(Document& document, - FrameHost& frameHost) +ViewportScrollCallback::ViewportScrollCallback(Document& document) : m_document(&document) - , m_frameHost(&frameHost) { // Only the root document can have a viewport scroll callback for now. ASSERT(!document.ownerElement()); @@ -33,7 +31,6 @@ DEFINE_TRACE(ViewportScrollCallback) { - visitor->trace(m_frameHost); visitor->trace(m_document); ScrollStateCallback::trace(visitor); } @@ -60,10 +57,10 @@ void ViewportScrollCallback::handleEvent(ScrollState* state) { - if (!m_frameHost || !m_document) + if (!m_document || !m_document->frameHost()) return; - TopControls& topControls = m_frameHost->topControls(); + TopControls& topControls = m_document->frameHost()->topControls(); // Scroll top controls. if (state->isBeginning())
diff --git a/third_party/WebKit/Source/core/page/scrolling/ViewportScrollCallback.h b/third_party/WebKit/Source/core/page/scrolling/ViewportScrollCallback.h index 979da5f..e2bd270c 100644 --- a/third_party/WebKit/Source/core/page/scrolling/ViewportScrollCallback.h +++ b/third_party/WebKit/Source/core/page/scrolling/ViewportScrollCallback.h
@@ -20,7 +20,7 @@ class ViewportScrollCallback : public ScrollStateCallback { public: - ViewportScrollCallback(Document&, FrameHost&); + ViewportScrollCallback(Document&); ~ViewportScrollCallback(); void handleEvent(ScrollState*) override; @@ -32,8 +32,6 @@ ScrollableArea* getRootFrameViewport() const; WeakMember<Document> m_document; - WeakMember<FrameHost> m_frameHost; - }; } // namespace blink
diff --git a/third_party/WebKit/Source/core/paint/FilterPainter.cpp b/third_party/WebKit/Source/core/paint/FilterPainter.cpp index 9e399bb7..cfc6cd8 100644 --- a/third_party/WebKit/Source/core/paint/FilterPainter.cpp +++ b/third_party/WebKit/Source/core/paint/FilterPainter.cpp
@@ -36,9 +36,8 @@ ASSERT(layer.filterInfo()); - SkiaImageFilterBuilder builder; lastEffect->determineFilterPrimitiveSubregion(MapRectForward); - sk_sp<SkImageFilter> imageFilter = builder.build(lastEffect, ColorSpaceDeviceRGB); + sk_sp<SkImageFilter> imageFilter = SkiaImageFilterBuilder::build(lastEffect, ColorSpaceDeviceRGB); if (!imageFilter) return; @@ -63,7 +62,7 @@ if (!context.getPaintController().displayItemConstructionIsDisabled()) { FilterOperations filterOperations(layer.computeFilterOperations(m_layoutObject->styleRef())); OwnPtr<CompositorFilterOperations> compositorFilterOperations = adoptPtr(CompositorFactory::current().createFilterOperations()); - builder.buildFilterOperations(filterOperations, compositorFilterOperations.get()); + SkiaImageFilterBuilder::buildFilterOperations(filterOperations, compositorFilterOperations.get()); // FIXME: It's possible to have empty CompositorFilterOperations here even // though the SkImageFilter produced above is non-null, since the // layer's FilterEffectBuilder can have a stale representation of
diff --git a/third_party/WebKit/Source/core/paint/PaintLayer.cpp b/third_party/WebKit/Source/core/paint/PaintLayer.cpp index 8f60634..204b32b 100644 --- a/third_party/WebKit/Source/core/paint/PaintLayer.cpp +++ b/third_party/WebKit/Source/core/paint/PaintLayer.cpp
@@ -1336,7 +1336,7 @@ } } - if (!didSetPaintInvalidation && isSelfPaintingLayer()) { + if (!didSetPaintInvalidation && isSelfPaintingLayer() && m_parent) { if (PaintLayer* enclosingSelfPaintingLayer = m_parent->enclosingSelfPaintingLayer()) mergeNeedsPaintPhaseFlagsFrom(*enclosingSelfPaintingLayer); }
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp index d30b32f1..bd60030 100644 --- a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp +++ b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
@@ -394,7 +394,6 @@ // FIXME: This invalidation will be unnecessary in slimming paint phase 2. if (requiresPaintInvalidation) { box().setShouldDoFullPaintInvalidationIncludingNonCompositingDescendants(); - frameView->setFrameTimingRequestsDirty(true); } // Schedule the scroll DOM event.
diff --git a/third_party/WebKit/Source/core/paint/SVGFilterPainter.cpp b/third_party/WebKit/Source/core/paint/SVGFilterPainter.cpp index 69fb472..c091c74 100644 --- a/third_party/WebKit/Source/core/paint/SVGFilterPainter.cpp +++ b/third_party/WebKit/Source/core/paint/SVGFilterPainter.cpp
@@ -66,8 +66,7 @@ filterData->m_state = FilterData::PaintingFilter; - SkiaImageFilterBuilder builder; - sk_sp<SkImageFilter> imageFilter = builder.build(filterData->filter->lastEffect(), ColorSpaceDeviceRGB); + sk_sp<SkImageFilter> imageFilter = SkiaImageFilterBuilder::build(filterData->filter->lastEffect(), ColorSpaceDeviceRGB); FloatRect boundaries = filterData->filter->filterRegion(); context.save(); @@ -90,7 +89,7 @@ AffineTransform shearAndRotate = scaleAndTranslate.inverse(); shearAndRotate.multiply(ctm); context.concatCTM(shearAndRotate.inverse()); - imageFilter = builder.buildTransform(shearAndRotate, std::move(imageFilter)); + imageFilter = SkiaImageFilterBuilder::buildTransform(shearAndRotate, std::move(imageFilter)); } #endif
diff --git a/third_party/WebKit/Source/core/paint/SVGRootPainter.cpp b/third_party/WebKit/Source/core/paint/SVGRootPainter.cpp index 619179f..2ad1e41e 100644 --- a/third_party/WebKit/Source/core/paint/SVGRootPainter.cpp +++ b/third_party/WebKit/Source/core/paint/SVGRootPainter.cpp
@@ -5,8 +5,7 @@ #include "core/paint/SVGRootPainter.h" #include "core/layout/svg/LayoutSVGRoot.h" -#include "core/layout/svg/SVGResources.h" -#include "core/layout/svg/SVGResourcesCache.h" +#include "core/layout/svg/SVGLayoutSupport.h" #include "core/paint/BoxPainter.h" #include "core/paint/ObjectPaintProperties.h" #include "core/paint/PaintInfo.h" @@ -41,11 +40,8 @@ return; // Don't paint if we don't have kids, except if we have filters we should paint those. - if (!m_layoutSVGRoot.firstChild()) { - SVGResources* resources = SVGResourcesCache::cachedResourcesForLayoutObject(&m_layoutSVGRoot); - if (!resources || !resources->filter()) - return; - } + if (!m_layoutSVGRoot.firstChild() && !SVGLayoutSupport::hasFilterResource(m_layoutSVGRoot)) + return; PaintInfo paintInfoBeforeFiltering(paintInfo);
diff --git a/third_party/WebKit/Source/core/style/ComputedStyle.h b/third_party/WebKit/Source/core/style/ComputedStyle.h index 8c273afb..06c70e08 100644 --- a/third_party/WebKit/Source/core/style/ComputedStyle.h +++ b/third_party/WebKit/Source/core/style/ComputedStyle.h
@@ -913,7 +913,7 @@ bool transformDataEquivalent(const ComputedStyle& otherStyle) const { return rareNonInheritedData->m_transform == otherStyle.rareNonInheritedData->m_transform; } StylePath* motionPath() const { return rareNonInheritedData->m_transform->m_motion.m_path.get(); } - bool hasMotionPath() const { return rareNonInheritedData->m_transform->m_motion.m_path; } + bool hasMotionPath() const { return motionPath(); } const Length& motionOffset() const { return rareNonInheritedData->m_transform->m_motion.m_offset; } const StyleMotionRotation& motionRotation() const { return rareNonInheritedData->m_transform->m_motion.m_rotation; }
diff --git a/third_party/WebKit/Source/core/svg/SVGSVGElement.cpp b/third_party/WebKit/Source/core/svg/SVGSVGElement.cpp index 02cf93023..ae6b0e1 100644 --- a/third_party/WebKit/Source/core/svg/SVGSVGElement.cpp +++ b/third_party/WebKit/Source/core/svg/SVGSVGElement.cpp
@@ -193,6 +193,14 @@ } else if (name == HTMLNames::onerrorAttr) { document().setWindowAttributeEventListener(EventTypeNames::error, createAttributeEventListener(document().frame(), name, value, eventParameterName())); } else if (SVGZoomAndPan::parseAttribute(name, value)) { + } else if (name == SVGNames::widthAttr || name == SVGNames::heightAttr) { + SVGAnimatedLength* property = name == SVGNames::widthAttr ? m_width : m_height; + SVGParsingError parseError; + if (!value.isNull()) + parseError = property->setBaseValueAsString(value); + if (parseError != SVGParseStatus::NoError || value.isNull()) + property->setDefaultValueAsString("100%"); + reportAttributeParsingError(parseError, name, value); } else { SVGElement::parseAttribute(name, oldValue, value); }
diff --git a/third_party/WebKit/Source/core/svg/graphics/SVGImage.h b/third_party/WebKit/Source/core/svg/graphics/SVGImage.h index 5a719b76..bc718d09 100644 --- a/third_party/WebKit/Source/core/svg/graphics/SVGImage.h +++ b/third_party/WebKit/Source/core/svg/graphics/SVGImage.h
@@ -139,17 +139,15 @@ ImageObserverDisabler(Image* image) : m_image(image) { - m_observer = m_image->getImageObserver(); - m_image->setImageObserver(0); + m_image->setImageObserverDisabled(true); } ~ImageObserverDisabler() { - m_image->setImageObserver(m_observer); + m_image->setImageObserverDisabled(false); } private: Image* m_image; - Member<ImageObserver> m_observer; }; } // namespace blink
diff --git a/third_party/WebKit/Source/core/svg/graphics/filters/SVGFEImage.cpp b/third_party/WebKit/Source/core/svg/graphics/filters/SVGFEImage.cpp index eba6e2b..4775153 100644 --- a/third_party/WebKit/Source/core/svg/graphics/filters/SVGFEImage.cpp +++ b/third_party/WebKit/Source/core/svg/graphics/filters/SVGFEImage.cpp
@@ -181,7 +181,7 @@ return SkPictureImageFilter::Make(toSkSp(filterPicture.endRecording()), dstRect); } -sk_sp<SkImageFilter> FEImage::createImageFilter(SkiaImageFilterBuilder& builder) +sk_sp<SkImageFilter> FEImage::createImageFilter() { if (auto* layoutObject = referencedLayoutObject()) return createImageFilterForLayoutObject(*layoutObject); @@ -192,7 +192,7 @@ // to download, is non-existent, or that cannot be displayed (e.g. because it is // not in a supported image format) fills the filter primitive subregion with // transparent black." - return createTransparentBlack(builder); + return createTransparentBlack(); } FloatRect srcRect = FloatRect(FloatPoint(), FloatSize(m_image->size()));
diff --git a/third_party/WebKit/Source/core/svg/graphics/filters/SVGFEImage.h b/third_party/WebKit/Source/core/svg/graphics/filters/SVGFEImage.h index 3b81d1d..ca8da97 100644 --- a/third_party/WebKit/Source/core/svg/graphics/filters/SVGFEImage.h +++ b/third_party/WebKit/Source/core/svg/graphics/filters/SVGFEImage.h
@@ -47,7 +47,7 @@ void setOperatingColorSpace(ColorSpace) override { } TextStream& externalRepresentation(TextStream&, int indention) const override; - sk_sp<SkImageFilter> createImageFilter(SkiaImageFilterBuilder&) override; + sk_sp<SkImageFilter> createImageFilter() override; DECLARE_VIRTUAL_TRACE();
diff --git a/third_party/WebKit/Source/core/workers/DedicatedWorkerGlobalScope.cpp b/third_party/WebKit/Source/core/workers/DedicatedWorkerGlobalScope.cpp index ceaf184d..637cefd 100644 --- a/third_party/WebKit/Source/core/workers/DedicatedWorkerGlobalScope.cpp +++ b/third_party/WebKit/Source/core/workers/DedicatedWorkerGlobalScope.cpp
@@ -34,10 +34,11 @@ #include "bindings/core/v8/SerializedScriptValue.h" #include "core/dom/CrossThreadTask.h" #include "core/frame/Deprecation.h" -#include "core/frame/LocalDOMWindow.h" +#include "core/frame/UseCounter.h" +#include "core/frame/csp/ContentSecurityPolicy.h" #include "core/workers/DedicatedWorkerThread.h" +#include "core/workers/InProcessWorkerObjectProxy.h" #include "core/workers/WorkerClients.h" -#include "core/workers/WorkerObjectProxy.h" #include "core/workers/WorkerThreadStartupData.h" namespace blink { @@ -77,7 +78,7 @@ DedicatedWorkerThread* DedicatedWorkerGlobalScope::thread() const { - return static_cast<DedicatedWorkerThread*>(Base::thread()); + return static_cast<DedicatedWorkerThread*>(WorkerGlobalScope::thread()); } static void countOnDocument(UseCounter::Feature feature, ExecutionContext* context)
diff --git a/third_party/WebKit/Source/core/workers/DedicatedWorkerGlobalScope.h b/third_party/WebKit/Source/core/workers/DedicatedWorkerGlobalScope.h index a4e0780..a933cd50 100644 --- a/third_party/WebKit/Source/core/workers/DedicatedWorkerGlobalScope.h +++ b/third_party/WebKit/Source/core/workers/DedicatedWorkerGlobalScope.h
@@ -33,9 +33,8 @@ #include "core/CoreExport.h" #include "core/dom/MessagePort.h" -#include "core/frame/csp/ContentSecurityPolicy.h" #include "core/workers/WorkerGlobalScope.h" -#include "platform/heap/Handle.h" +#include "platform/heap/Visitor.h" namespace blink { @@ -45,7 +44,6 @@ class CORE_EXPORT DedicatedWorkerGlobalScope final : public WorkerGlobalScope { DEFINE_WRAPPERTYPEINFO(); public: - typedef WorkerGlobalScope Base; static DedicatedWorkerGlobalScope* create(DedicatedWorkerThread*, PassOwnPtr<WorkerThreadStartupData>, double timeOrigin); ~DedicatedWorkerGlobalScope() override;
diff --git a/third_party/WebKit/Source/core/workers/WorkerGlobalScopeProxyProvider.cpp b/third_party/WebKit/Source/core/workers/DedicatedWorkerGlobalScopeProxyProvider.cpp similarity index 72% rename from third_party/WebKit/Source/core/workers/WorkerGlobalScopeProxyProvider.cpp rename to third_party/WebKit/Source/core/workers/DedicatedWorkerGlobalScopeProxyProvider.cpp index 6a28ca8f..0e23be9 100644 --- a/third_party/WebKit/Source/core/workers/WorkerGlobalScopeProxyProvider.cpp +++ b/third_party/WebKit/Source/core/workers/DedicatedWorkerGlobalScopeProxyProvider.cpp
@@ -28,25 +28,25 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "core/workers/WorkerGlobalScopeProxyProvider.h" +#include "core/workers/DedicatedWorkerGlobalScopeProxyProvider.h" #include "core/page/Page.h" namespace blink { -WorkerGlobalScopeProxyProvider* WorkerGlobalScopeProxyProvider::from(Page& page) +DedicatedWorkerGlobalScopeProxyProvider* DedicatedWorkerGlobalScopeProxyProvider::from(Page& page) { - return static_cast<WorkerGlobalScopeProxyProvider*>(Supplement<Page>::from(page, supplementName())); + return static_cast<DedicatedWorkerGlobalScopeProxyProvider*>(Supplement<Page>::from(page, supplementName())); } -const char* WorkerGlobalScopeProxyProvider::supplementName() +const char* DedicatedWorkerGlobalScopeProxyProvider::supplementName() { - return "WorkerGlobalScopeProxyProvider"; + return "DedicatedWorkerGlobalScopeProxyProvider"; } -void provideWorkerGlobalScopeProxyProviderTo(Page& page, WorkerGlobalScopeProxyProvider* provider) +void provideDedicatedWorkerGlobalScopeProxyProviderTo(Page& page, DedicatedWorkerGlobalScopeProxyProvider* provider) { - Supplement<Page>::provideTo(page, WorkerGlobalScopeProxyProvider::supplementName(), provider); + Supplement<Page>::provideTo(page, DedicatedWorkerGlobalScopeProxyProvider::supplementName(), provider); } } // namespace blink
diff --git a/third_party/WebKit/Source/core/workers/WorkerGlobalScopeProxyProvider.h b/third_party/WebKit/Source/core/workers/DedicatedWorkerGlobalScopeProxyProvider.h similarity index 72% rename from third_party/WebKit/Source/core/workers/WorkerGlobalScopeProxyProvider.h rename to third_party/WebKit/Source/core/workers/DedicatedWorkerGlobalScopeProxyProvider.h index a31cdb3..ad943bd 100644 --- a/third_party/WebKit/Source/core/workers/WorkerGlobalScopeProxyProvider.h +++ b/third_party/WebKit/Source/core/workers/DedicatedWorkerGlobalScopeProxyProvider.h
@@ -28,8 +28,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef WorkerGlobalScopeProxyProvider_h -#define WorkerGlobalScopeProxyProvider_h +#ifndef DedicatedWorkerGlobalScopeProxyProvider_h +#define DedicatedWorkerGlobalScopeProxyProvider_h #include "core/CoreExport.h" #include "core/page/Page.h" @@ -39,24 +39,24 @@ namespace blink { +class InProcessWorkerGlobalScopeProxy; class Page; -class WorkerGlobalScopeProxy; class Worker; -class WorkerGlobalScopeProxyProvider : public Supplement<Page> { - WTF_MAKE_NONCOPYABLE(WorkerGlobalScopeProxyProvider); +class DedicatedWorkerGlobalScopeProxyProvider : public Supplement<Page> { + WTF_MAKE_NONCOPYABLE(DedicatedWorkerGlobalScopeProxyProvider); public: - WorkerGlobalScopeProxyProvider() { } - virtual ~WorkerGlobalScopeProxyProvider() { } + DedicatedWorkerGlobalScopeProxyProvider() { } + virtual ~DedicatedWorkerGlobalScopeProxyProvider() { } - virtual WorkerGlobalScopeProxy* createWorkerGlobalScopeProxy(Worker*) = 0; + virtual InProcessWorkerGlobalScopeProxy* createWorkerGlobalScopeProxy(Worker*) = 0; - static WorkerGlobalScopeProxyProvider* from(Page&); + static DedicatedWorkerGlobalScopeProxyProvider* from(Page&); static const char* supplementName(); }; -CORE_EXPORT void provideWorkerGlobalScopeProxyProviderTo(Page&, WorkerGlobalScopeProxyProvider*); +CORE_EXPORT void provideDedicatedWorkerGlobalScopeProxyProviderTo(Page&, DedicatedWorkerGlobalScopeProxyProvider*); } // namespace blink -#endif // WorkerGlobalScopeProxyProvider_h +#endif // DedicatedWorkerGlobalScopeProxyProvider_h
diff --git a/third_party/WebKit/Source/core/workers/DedicatedWorkerMessagingProxy.cpp b/third_party/WebKit/Source/core/workers/DedicatedWorkerMessagingProxy.cpp index 37457c7..8df33e8f 100644 --- a/third_party/WebKit/Source/core/workers/DedicatedWorkerMessagingProxy.cpp +++ b/third_party/WebKit/Source/core/workers/DedicatedWorkerMessagingProxy.cpp
@@ -10,7 +10,7 @@ namespace blink { DedicatedWorkerMessagingProxy::DedicatedWorkerMessagingProxy(InProcessWorkerBase* workerObject, WorkerClients* workerClients) - : WorkerMessagingProxy(workerObject, workerClients) + : InProcessWorkerMessagingProxy(workerObject, workerClients) { }
diff --git a/third_party/WebKit/Source/core/workers/DedicatedWorkerMessagingProxy.h b/third_party/WebKit/Source/core/workers/DedicatedWorkerMessagingProxy.h index ff081a8..941e069 100644 --- a/third_party/WebKit/Source/core/workers/DedicatedWorkerMessagingProxy.h +++ b/third_party/WebKit/Source/core/workers/DedicatedWorkerMessagingProxy.h
@@ -6,13 +6,13 @@ #define DedicatedWorkerMessagingProxy_h #include "core/CoreExport.h" -#include "core/workers/WorkerMessagingProxy.h" +#include "core/workers/InProcessWorkerMessagingProxy.h" namespace blink { -class CORE_EXPORT DedicatedWorkerMessagingProxy final : public WorkerMessagingProxy { +class CORE_EXPORT DedicatedWorkerMessagingProxy final : public InProcessWorkerMessagingProxy { WTF_MAKE_NONCOPYABLE(DedicatedWorkerMessagingProxy); - USING_FAST_MALLOC(WorkerMessagingProxy); + USING_FAST_MALLOC(DedicatedWorkerMessagingProxy); public: DedicatedWorkerMessagingProxy(InProcessWorkerBase*, WorkerClients*); ~DedicatedWorkerMessagingProxy() override;
diff --git a/third_party/WebKit/Source/core/workers/DedicatedWorkerThread.cpp b/third_party/WebKit/Source/core/workers/DedicatedWorkerThread.cpp index bc45783..9a9ff85 100644 --- a/third_party/WebKit/Source/core/workers/DedicatedWorkerThread.cpp +++ b/third_party/WebKit/Source/core/workers/DedicatedWorkerThread.cpp
@@ -31,18 +31,18 @@ #include "core/workers/DedicatedWorkerThread.h" #include "core/workers/DedicatedWorkerGlobalScope.h" +#include "core/workers/InProcessWorkerObjectProxy.h" #include "core/workers/WorkerBackingThread.h" -#include "core/workers/WorkerObjectProxy.h" #include "core/workers/WorkerThreadStartupData.h" namespace blink { -PassOwnPtr<DedicatedWorkerThread> DedicatedWorkerThread::create(PassRefPtr<WorkerLoaderProxy> workerLoaderProxy, WorkerObjectProxy& workerObjectProxy, double timeOrigin) +PassOwnPtr<DedicatedWorkerThread> DedicatedWorkerThread::create(PassRefPtr<WorkerLoaderProxy> workerLoaderProxy, InProcessWorkerObjectProxy& workerObjectProxy, double timeOrigin) { return adoptPtr(new DedicatedWorkerThread(workerLoaderProxy, workerObjectProxy, timeOrigin)); } -DedicatedWorkerThread::DedicatedWorkerThread(PassRefPtr<WorkerLoaderProxy> workerLoaderProxy, WorkerObjectProxy& workerObjectProxy, double timeOrigin) +DedicatedWorkerThread::DedicatedWorkerThread(PassRefPtr<WorkerLoaderProxy> workerLoaderProxy, InProcessWorkerObjectProxy& workerObjectProxy, double timeOrigin) : WorkerThread(workerLoaderProxy, workerObjectProxy) , m_workerBackingThread(WorkerBackingThread::create("DedicatedWorker Thread")) , m_workerObjectProxy(workerObjectProxy)
diff --git a/third_party/WebKit/Source/core/workers/DedicatedWorkerThread.h b/third_party/WebKit/Source/core/workers/DedicatedWorkerThread.h index 3d1f9edf..a6fa87d 100644 --- a/third_party/WebKit/Source/core/workers/DedicatedWorkerThread.h +++ b/third_party/WebKit/Source/core/workers/DedicatedWorkerThread.h
@@ -30,31 +30,30 @@ #ifndef DedicatedWorkerThread_h #define DedicatedWorkerThread_h -#include "core/frame/csp/ContentSecurityPolicy.h" #include "core/workers/WorkerThread.h" namespace blink { -class WorkerObjectProxy; +class InProcessWorkerObjectProxy; class WorkerThreadStartupData; class DedicatedWorkerThread final : public WorkerThread { public: - static PassOwnPtr<DedicatedWorkerThread> create(PassRefPtr<WorkerLoaderProxy>, WorkerObjectProxy&, double timeOrigin); + static PassOwnPtr<DedicatedWorkerThread> create(PassRefPtr<WorkerLoaderProxy>, InProcessWorkerObjectProxy&, double timeOrigin); ~DedicatedWorkerThread() override; WorkerBackingThread& workerBackingThread() override { return *m_workerBackingThread; } - WorkerObjectProxy& workerObjectProxy() const { return m_workerObjectProxy; } + InProcessWorkerObjectProxy& workerObjectProxy() const { return m_workerObjectProxy; } protected: WorkerGlobalScope* createWorkerGlobalScope(PassOwnPtr<WorkerThreadStartupData>) override; void postInitialize() override; private: - DedicatedWorkerThread(PassRefPtr<WorkerLoaderProxy>, WorkerObjectProxy&, double timeOrigin); + DedicatedWorkerThread(PassRefPtr<WorkerLoaderProxy>, InProcessWorkerObjectProxy&, double timeOrigin); OwnPtr<WorkerBackingThread> m_workerBackingThread; - WorkerObjectProxy& m_workerObjectProxy; + InProcessWorkerObjectProxy& m_workerObjectProxy; double m_timeOrigin; };
diff --git a/third_party/WebKit/Source/core/workers/InProcessWorkerBase.cpp b/third_party/WebKit/Source/core/workers/InProcessWorkerBase.cpp index 51c02e75..8ac1d7ad 100644 --- a/third_party/WebKit/Source/core/workers/InProcessWorkerBase.cpp +++ b/third_party/WebKit/Source/core/workers/InProcessWorkerBase.cpp
@@ -10,7 +10,7 @@ #include "core/frame/LocalDOMWindow.h" #include "core/frame/csp/ContentSecurityPolicy.h" #include "core/inspector/InspectorInstrumentation.h" -#include "core/workers/WorkerGlobalScopeProxy.h" +#include "core/workers/InProcessWorkerGlobalScopeProxy.h" #include "core/workers/WorkerScriptLoader.h" #include "core/workers/WorkerThread.h" #include "platform/network/ContentSecurityPolicyResponseHeaders.h" @@ -59,7 +59,7 @@ bind(&InProcessWorkerBase::onResponse, this), bind(&InProcessWorkerBase::onFinished, this)); - m_contextProxy = createWorkerGlobalScopeProxy(context); + m_contextProxy = createInProcessWorkerGlobalScopeProxy(context); return true; }
diff --git a/third_party/WebKit/Source/core/workers/InProcessWorkerBase.h b/third_party/WebKit/Source/core/workers/InProcessWorkerBase.h index 96e29ad..a7dc13ad 100644 --- a/third_party/WebKit/Source/core/workers/InProcessWorkerBase.h +++ b/third_party/WebKit/Source/core/workers/InProcessWorkerBase.h
@@ -22,7 +22,7 @@ class ExceptionState; class ExecutionContext; -class WorkerGlobalScopeProxy; +class InProcessWorkerGlobalScopeProxy; class WorkerScriptLoader; // Base class for workers that operate in the same process as the document that @@ -52,7 +52,7 @@ // Creates a proxy to allow communicating with the worker's global scope. InProcessWorkerBase does not take ownership of the // created proxy. The proxy is expected to manage its own lifetime, and delete itself in response to terminateWorkerGlobalScope(). - virtual WorkerGlobalScopeProxy* createWorkerGlobalScopeProxy(ExecutionContext*) = 0; + virtual InProcessWorkerGlobalScopeProxy* createInProcessWorkerGlobalScopeProxy(ExecutionContext*) = 0; private: // Callbacks for m_scriptLoader. @@ -61,7 +61,7 @@ RefPtr<WorkerScriptLoader> m_scriptLoader; Member<ContentSecurityPolicy> m_contentSecurityPolicy; - WorkerGlobalScopeProxy* m_contextProxy; // The proxy outlives the worker to perform thread shutdown. + InProcessWorkerGlobalScopeProxy* m_contextProxy; // The proxy outlives the worker to perform thread shutdown. }; } // namespace blink
diff --git a/third_party/WebKit/Source/core/workers/WorkerGlobalScopeProxy.h b/third_party/WebKit/Source/core/workers/InProcessWorkerGlobalScopeProxy.h similarity index 86% rename from third_party/WebKit/Source/core/workers/WorkerGlobalScopeProxy.h rename to third_party/WebKit/Source/core/workers/InProcessWorkerGlobalScopeProxy.h index 078a95b..419ae2d 100644 --- a/third_party/WebKit/Source/core/workers/WorkerGlobalScopeProxy.h +++ b/third_party/WebKit/Source/core/workers/InProcessWorkerGlobalScopeProxy.h
@@ -28,8 +28,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef WorkerGlobalScopeProxy_h -#define WorkerGlobalScopeProxy_h +#ifndef InProcessWorkerGlobalScopeProxy_h +#define InProcessWorkerGlobalScopeProxy_h #include "core/CoreExport.h" #include "core/dom/MessagePort.h" @@ -41,11 +41,11 @@ class KURL; -// A proxy to talk to the worker global scope. -class CORE_EXPORT WorkerGlobalScopeProxy { - USING_FAST_MALLOC(WorkerGlobalScopeProxy); +// A proxy to talk to the in-process worker global scope. +class CORE_EXPORT InProcessWorkerGlobalScopeProxy { + USING_FAST_MALLOC(InProcessWorkerGlobalScopeProxy); public: - virtual ~WorkerGlobalScopeProxy() { } + virtual ~InProcessWorkerGlobalScopeProxy() { } virtual void startWorkerGlobalScope(const KURL& scriptURL, const String& userAgent, const String& sourceCode) = 0; @@ -60,4 +60,4 @@ } // namespace blink -#endif // WorkerGlobalScopeProxy_h +#endif // InProcessWorkerGlobalScopeProxy_h
diff --git a/third_party/WebKit/Source/core/workers/WorkerMessagingProxy.cpp b/third_party/WebKit/Source/core/workers/InProcessWorkerMessagingProxy.cpp similarity index 81% rename from third_party/WebKit/Source/core/workers/WorkerMessagingProxy.cpp rename to third_party/WebKit/Source/core/workers/InProcessWorkerMessagingProxy.cpp index 2cb6690..ca6bf4c1 100644 --- a/third_party/WebKit/Source/core/workers/WorkerMessagingProxy.cpp +++ b/third_party/WebKit/Source/core/workers/InProcessWorkerMessagingProxy.cpp
@@ -26,7 +26,7 @@ */ -#include "core/workers/WorkerMessagingProxy.h" +#include "core/workers/InProcessWorkerMessagingProxy.h" #include "bindings/core/v8/V8GCController.h" #include "core/dom/CrossThreadTask.h" @@ -36,20 +36,16 @@ #include "core/events/MessageEvent.h" #include "core/frame/Console.h" #include "core/frame/FrameConsole.h" -#include "core/frame/LocalDOMWindow.h" #include "core/frame/LocalFrame.h" #include "core/frame/csp/ContentSecurityPolicy.h" #include "core/inspector/ConsoleMessage.h" -#include "core/inspector/WorkerDebuggerAgent.h" #include "core/loader/DocumentLoadTiming.h" #include "core/loader/DocumentLoader.h" #include "core/workers/InProcessWorkerBase.h" +#include "core/workers/InProcessWorkerObjectProxy.h" #include "core/workers/WorkerClients.h" #include "core/workers/WorkerInspectorProxy.h" -#include "core/workers/WorkerObjectProxy.h" #include "core/workers/WorkerThreadStartupData.h" -#include "platform/heap/Handle.h" -#include "wtf/Functional.h" namespace blink { @@ -61,7 +57,7 @@ globalScope->exceptionHandled(exceptionId, handled); } -void processMessageOnWorkerGlobalScope(PassRefPtr<SerializedScriptValue> message, PassOwnPtr<MessagePortChannelArray> channels, WorkerObjectProxy* workerObjectProxy, ExecutionContext* scriptContext) +void processMessageOnWorkerGlobalScope(PassRefPtr<SerializedScriptValue> message, PassOwnPtr<MessagePortChannelArray> channels, InProcessWorkerObjectProxy* workerObjectProxy, ExecutionContext* scriptContext) { WorkerGlobalScope* globalScope = toWorkerGlobalScope(scriptContext); MessagePortArray* ports = MessagePort::entanglePorts(*scriptContext, channels); @@ -71,9 +67,9 @@ } // namespace -WorkerMessagingProxy::WorkerMessagingProxy(InProcessWorkerBase* workerObject, WorkerClients* workerClients) +InProcessWorkerMessagingProxy::InProcessWorkerMessagingProxy(InProcessWorkerBase* workerObject, WorkerClients* workerClients) : m_executionContext(workerObject->getExecutionContext()) - , m_workerObjectProxy(WorkerObjectProxy::create(this)) + , m_workerObjectProxy(InProcessWorkerObjectProxy::create(this)) , m_workerObject(workerObject) , m_mayBeDestroyed(false) , m_unconfirmedMessageCount(0) @@ -87,7 +83,7 @@ || (m_executionContext->isWorkerGlobalScope() && toWorkerGlobalScope(m_executionContext.get())->thread()->isCurrentThread())); } -WorkerMessagingProxy::~WorkerMessagingProxy() +InProcessWorkerMessagingProxy::~InProcessWorkerMessagingProxy() { ASSERT(!m_workerObject); ASSERT((m_executionContext->isDocument() && isMainThread()) @@ -96,7 +92,7 @@ m_loaderProxy->detachProvider(this); } -void WorkerMessagingProxy::startWorkerGlobalScope(const KURL& scriptURL, const String& userAgent, const String& sourceCode) +void InProcessWorkerMessagingProxy::startWorkerGlobalScope(const KURL& scriptURL, const String& userAgent, const String& sourceCode) { // FIXME: This need to be revisited when we support nested worker one day ASSERT(m_executionContext->isDocument()); @@ -121,7 +117,7 @@ m_workerInspectorProxy->workerThreadCreated(document, m_workerThread.get(), scriptURL); } -void WorkerMessagingProxy::postMessageToWorkerObject(PassRefPtr<SerializedScriptValue> message, PassOwnPtr<MessagePortChannelArray> channels) +void InProcessWorkerMessagingProxy::postMessageToWorkerObject(PassRefPtr<SerializedScriptValue> message, PassOwnPtr<MessagePortChannelArray> channels) { if (!m_workerObject || m_askedToTerminate) return; @@ -130,7 +126,7 @@ m_workerObject->dispatchEvent(MessageEvent::create(ports, message)); } -void WorkerMessagingProxy::postMessageToWorkerGlobalScope(PassRefPtr<SerializedScriptValue> message, PassOwnPtr<MessagePortChannelArray> channels) +void InProcessWorkerMessagingProxy::postMessageToWorkerGlobalScope(PassRefPtr<SerializedScriptValue> message, PassOwnPtr<MessagePortChannelArray> channels) { if (m_askedToTerminate) return; @@ -144,7 +140,7 @@ } } -bool WorkerMessagingProxy::postTaskToWorkerGlobalScope(PassOwnPtr<ExecutionContextTask> task) +bool InProcessWorkerMessagingProxy::postTaskToWorkerGlobalScope(PassOwnPtr<ExecutionContextTask> task) { if (m_askedToTerminate) return false; @@ -154,14 +150,14 @@ return true; } -void WorkerMessagingProxy::postTaskToLoader(PassOwnPtr<ExecutionContextTask> task) +void InProcessWorkerMessagingProxy::postTaskToLoader(PassOwnPtr<ExecutionContextTask> task) { // FIXME: In case of nested workers, this should go directly to the root Document context. ASSERT(m_executionContext->isDocument()); m_executionContext->postTask(BLINK_FROM_HERE, task); } -void WorkerMessagingProxy::reportException(const String& errorMessage, int lineNumber, int columnNumber, const String& sourceURL, int exceptionId) +void InProcessWorkerMessagingProxy::reportException(const String& errorMessage, int lineNumber, int columnNumber, const String& sourceURL, int exceptionId) { if (!m_workerObject) return; @@ -174,7 +170,7 @@ postTaskToWorkerGlobalScope(createCrossThreadTask(&processExceptionOnWorkerGlobalScope, exceptionId, dispatchResult != DispatchEventResult::NotCanceled)); } -void WorkerMessagingProxy::reportConsoleMessage(MessageSource source, MessageLevel level, const String& message, int lineNumber, const String& sourceURL) +void InProcessWorkerMessagingProxy::reportConsoleMessage(MessageSource source, MessageLevel level, const String& message, int lineNumber, const String& sourceURL) { if (m_askedToTerminate) return; @@ -190,7 +186,7 @@ frame->console().addMessage(consoleMessage); } -void WorkerMessagingProxy::workerThreadCreated() +void InProcessWorkerMessagingProxy::workerThreadCreated() { ASSERT(!m_askedToTerminate); ASSERT(m_workerThread); @@ -204,17 +200,17 @@ m_queuedEarlyTasks.clear(); } -void WorkerMessagingProxy::workerObjectDestroyed() +void InProcessWorkerMessagingProxy::workerObjectDestroyed() { // workerObjectDestroyed() is called in InProcessWorkerBase's destructor. // Thus it should be guaranteed that a weak pointer m_workerObject has been cleared // before this method gets called. ASSERT(!m_workerObject); - m_executionContext->postTask(BLINK_FROM_HERE, createCrossThreadTask(&WorkerMessagingProxy::workerObjectDestroyedInternal, this)); + m_executionContext->postTask(BLINK_FROM_HERE, createCrossThreadTask(&InProcessWorkerMessagingProxy::workerObjectDestroyedInternal, this)); } -void WorkerMessagingProxy::workerObjectDestroyedInternal() +void InProcessWorkerMessagingProxy::workerObjectDestroyedInternal() { m_mayBeDestroyed = true; if (m_workerThread) @@ -223,7 +219,7 @@ workerThreadTerminated(); } -void WorkerMessagingProxy::workerThreadTerminated() +void InProcessWorkerMessagingProxy::workerThreadTerminated() { // This method is always the last to be performed, so the proxy is not needed for communication // in either side any more. However, the Worker object may still exist, and it assumes that the proxy exists, too. @@ -234,7 +230,7 @@ delete this; } -void WorkerMessagingProxy::terminateWorkerGlobalScope() +void InProcessWorkerMessagingProxy::terminateWorkerGlobalScope() { if (m_askedToTerminate) return; @@ -246,19 +242,19 @@ terminateInternally(); } -void WorkerMessagingProxy::postMessageToPageInspector(const String& message) +void InProcessWorkerMessagingProxy::postMessageToPageInspector(const String& message) { if (m_workerInspectorProxy) m_workerInspectorProxy->dispatchMessageFromWorker(message); } -void WorkerMessagingProxy::postWorkerConsoleAgentEnabled() +void InProcessWorkerMessagingProxy::postWorkerConsoleAgentEnabled() { if (m_workerInspectorProxy) m_workerInspectorProxy->workerConsoleAgentEnabled(); } -void WorkerMessagingProxy::confirmMessageFromWorkerObject(bool hasPendingActivity) +void InProcessWorkerMessagingProxy::confirmMessageFromWorkerObject(bool hasPendingActivity) { if (!m_askedToTerminate) { ASSERT(m_unconfirmedMessageCount); @@ -267,17 +263,17 @@ reportPendingActivity(hasPendingActivity); } -void WorkerMessagingProxy::reportPendingActivity(bool hasPendingActivity) +void InProcessWorkerMessagingProxy::reportPendingActivity(bool hasPendingActivity) { m_workerThreadHadPendingActivity = hasPendingActivity; } -bool WorkerMessagingProxy::hasPendingActivity() const +bool InProcessWorkerMessagingProxy::hasPendingActivity() const { return (m_unconfirmedMessageCount || m_workerThreadHadPendingActivity) && !m_askedToTerminate; } -void WorkerMessagingProxy::terminateInternally() +void InProcessWorkerMessagingProxy::terminateInternally() { m_workerInspectorProxy->workerThreadTerminated();
diff --git a/third_party/WebKit/Source/core/workers/WorkerMessagingProxy.h b/third_party/WebKit/Source/core/workers/InProcessWorkerMessagingProxy.h similarity index 80% rename from third_party/WebKit/Source/core/workers/WorkerMessagingProxy.h rename to third_party/WebKit/Source/core/workers/InProcessWorkerMessagingProxy.h index 1810ccd..c80aeaaf 100644 --- a/third_party/WebKit/Source/core/workers/WorkerMessagingProxy.h +++ b/third_party/WebKit/Source/core/workers/InProcessWorkerMessagingProxy.h
@@ -24,13 +24,14 @@ * */ -#ifndef WorkerMessagingProxy_h -#define WorkerMessagingProxy_h +#ifndef InProcessWorkerMessagingProxy_h +#define InProcessWorkerMessagingProxy_h #include "core/CoreExport.h" #include "core/dom/ExecutionContext.h" -#include "core/workers/WorkerGlobalScopeProxy.h" +#include "core/workers/InProcessWorkerGlobalScopeProxy.h" #include "core/workers/WorkerLoaderProxy.h" +#include "platform/heap/Handle.h" #include "wtf/Forward.h" #include "wtf/Noncopyable.h" #include "wtf/PassOwnPtr.h" @@ -40,19 +41,22 @@ namespace blink { -class WorkerObjectProxy; +class InProcessWorkerObjectProxy; class WorkerThread; class ExecutionContext; class InProcessWorkerBase; class WorkerClients; class WorkerInspectorProxy; -class CORE_EXPORT WorkerMessagingProxy - : public WorkerGlobalScopeProxy +// TODO(nhiroki): "MessagingProxy" is not well-defined term among worker +// components. Probably we should rename this to something more suitable. +// (http://crbug.com/603785) +class CORE_EXPORT InProcessWorkerMessagingProxy + : public InProcessWorkerGlobalScopeProxy , private WorkerLoaderProxyProvider { - WTF_MAKE_NONCOPYABLE(WorkerMessagingProxy); + WTF_MAKE_NONCOPYABLE(InProcessWorkerMessagingProxy); public: - // Implementations of WorkerGlobalScopeProxy. + // Implementations of InProcessWorkerGlobalScopeProxy. // (Only use these methods in the worker object thread.) void startWorkerGlobalScope(const KURL& scriptURL, const String& userAgent, const String& sourceCode) override; void terminateWorkerGlobalScope() override; @@ -60,8 +64,9 @@ bool hasPendingActivity() const final; void workerObjectDestroyed() override; - // These methods come from worker context thread via WorkerObjectProxy - // and are called on the worker object thread (e.g. main thread). + // These methods come from worker context thread via + // InProcessWorkerObjectProxy and are called on the worker object thread + // (e.g. main thread). void postMessageToWorkerObject(PassRefPtr<SerializedScriptValue>, PassOwnPtr<MessagePortChannelArray>); void reportException(const String& errorMessage, int lineNumber, int columnNumber, const String& sourceURL, int exceptionId); void reportConsoleMessage(MessageSource, MessageLevel, const String& message, int lineNumber, const String& sourceURL); @@ -76,13 +81,13 @@ ExecutionContext* getExecutionContext() const { return m_executionContext.get(); } protected: - WorkerMessagingProxy(InProcessWorkerBase*, WorkerClients*); - ~WorkerMessagingProxy() override; + InProcessWorkerMessagingProxy(InProcessWorkerBase*, WorkerClients*); + ~InProcessWorkerMessagingProxy() override; virtual PassOwnPtr<WorkerThread> createWorkerThread(double originTime) = 0; PassRefPtr<WorkerLoaderProxy> loaderProxy() { return m_loaderProxy; } - WorkerObjectProxy& workerObjectProxy() { return *m_workerObjectProxy.get(); } + InProcessWorkerObjectProxy& workerObjectProxy() { return *m_workerObjectProxy.get(); } private: void workerObjectDestroyedInternal(); @@ -95,7 +100,7 @@ bool postTaskToWorkerGlobalScope(PassOwnPtr<ExecutionContextTask>) override; Persistent<ExecutionContext> m_executionContext; - OwnPtr<WorkerObjectProxy> m_workerObjectProxy; + OwnPtr<InProcessWorkerObjectProxy> m_workerObjectProxy; WeakPersistent<InProcessWorkerBase> m_workerObject; bool m_mayBeDestroyed; OwnPtr<WorkerThread> m_workerThread; @@ -115,4 +120,4 @@ } // namespace blink -#endif // WorkerMessagingProxy_h +#endif // InProcessWorkerMessagingProxy_h
diff --git a/third_party/WebKit/Source/core/workers/InProcessWorkerObjectProxy.cpp b/third_party/WebKit/Source/core/workers/InProcessWorkerObjectProxy.cpp new file mode 100644 index 0000000..b3a86fc --- /dev/null +++ b/third_party/WebKit/Source/core/workers/InProcessWorkerObjectProxy.cpp
@@ -0,0 +1,115 @@ +/* + * Copyright (C) 2013 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "core/workers/InProcessWorkerObjectProxy.h" + +#include "bindings/core/v8/SerializedScriptValue.h" +#include "core/dom/CrossThreadTask.h" +#include "core/dom/Document.h" +#include "core/dom/ExecutionContext.h" +#include "core/inspector/ConsoleMessage.h" +#include "core/workers/InProcessWorkerMessagingProxy.h" +#include "wtf/Functional.h" + +namespace blink { + +PassOwnPtr<InProcessWorkerObjectProxy> InProcessWorkerObjectProxy::create(InProcessWorkerMessagingProxy* messagingProxy) +{ + ASSERT(messagingProxy); + return adoptPtr(new InProcessWorkerObjectProxy(messagingProxy)); +} + +void InProcessWorkerObjectProxy::postMessageToWorkerObject(PassRefPtr<SerializedScriptValue> message, PassOwnPtr<MessagePortChannelArray> channels) +{ + getExecutionContext()->postTask(BLINK_FROM_HERE, createCrossThreadTask(&InProcessWorkerMessagingProxy::postMessageToWorkerObject, m_messagingProxy, message, channels)); +} + +void InProcessWorkerObjectProxy::postTaskToMainExecutionContext(PassOwnPtr<ExecutionContextTask> task) +{ + getExecutionContext()->postTask(BLINK_FROM_HERE, task); +} + +void InProcessWorkerObjectProxy::confirmMessageFromWorkerObject(bool hasPendingActivity) +{ + getExecutionContext()->postTask(BLINK_FROM_HERE, createCrossThreadTask(&InProcessWorkerMessagingProxy::confirmMessageFromWorkerObject, m_messagingProxy, hasPendingActivity)); +} + +void InProcessWorkerObjectProxy::reportPendingActivity(bool hasPendingActivity) +{ + getExecutionContext()->postTask(BLINK_FROM_HERE, createCrossThreadTask(&InProcessWorkerMessagingProxy::reportPendingActivity, m_messagingProxy, hasPendingActivity)); +} + +void InProcessWorkerObjectProxy::reportException(const String& errorMessage, int lineNumber, int columnNumber, const String& sourceURL, int exceptionId) +{ + getExecutionContext()->postTask(BLINK_FROM_HERE, createCrossThreadTask(&InProcessWorkerMessagingProxy::reportException, m_messagingProxy, errorMessage, lineNumber, columnNumber, sourceURL, exceptionId)); +} + +void InProcessWorkerObjectProxy::reportConsoleMessage(ConsoleMessage* consoleMessage) +{ + getExecutionContext()->postTask(BLINK_FROM_HERE, createCrossThreadTask(&InProcessWorkerMessagingProxy::reportConsoleMessage, m_messagingProxy, consoleMessage->source(), consoleMessage->level(), consoleMessage->message(), consoleMessage->lineNumber(), consoleMessage->url())); +} + +void InProcessWorkerObjectProxy::postMessageToPageInspector(const String& message) +{ + ExecutionContext* context = getExecutionContext(); + if (context->isDocument()) + toDocument(context)->postInspectorTask(BLINK_FROM_HERE, createCrossThreadTask(&InProcessWorkerMessagingProxy::postMessageToPageInspector, m_messagingProxy, message)); +} + +void InProcessWorkerObjectProxy::postWorkerConsoleAgentEnabled() +{ + ExecutionContext* context = getExecutionContext(); + if (context->isDocument()) + toDocument(context)->postInspectorTask(BLINK_FROM_HERE, createCrossThreadTask(&InProcessWorkerMessagingProxy::postWorkerConsoleAgentEnabled, m_messagingProxy)); +} + +void InProcessWorkerObjectProxy::workerGlobalScopeClosed() +{ + getExecutionContext()->postTask(BLINK_FROM_HERE, createCrossThreadTask(&InProcessWorkerMessagingProxy::terminateWorkerGlobalScope, m_messagingProxy)); +} + +void InProcessWorkerObjectProxy::workerThreadTerminated() +{ + // This will terminate the MessagingProxy. + getExecutionContext()->postTask(BLINK_FROM_HERE, createCrossThreadTask(&InProcessWorkerMessagingProxy::workerThreadTerminated, m_messagingProxy)); +} + +InProcessWorkerObjectProxy::InProcessWorkerObjectProxy(InProcessWorkerMessagingProxy* messagingProxy) + : m_messagingProxy(messagingProxy) +{ +} + +ExecutionContext* InProcessWorkerObjectProxy::getExecutionContext() +{ + ASSERT(m_messagingProxy); + return m_messagingProxy->getExecutionContext(); +} + +} // namespace blink
diff --git a/third_party/WebKit/Source/core/workers/WorkerObjectProxy.h b/third_party/WebKit/Source/core/workers/InProcessWorkerObjectProxy.h similarity index 83% rename from third_party/WebKit/Source/core/workers/WorkerObjectProxy.h rename to third_party/WebKit/Source/core/workers/InProcessWorkerObjectProxy.h index eb888d84..6271a84 100644 --- a/third_party/WebKit/Source/core/workers/WorkerObjectProxy.h +++ b/third_party/WebKit/Source/core/workers/InProcessWorkerObjectProxy.h
@@ -28,8 +28,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef WorkerObjectProxy_h -#define WorkerObjectProxy_h +#ifndef InProcessWorkerObjectProxy_h +#define InProcessWorkerObjectProxy_h #include "core/CoreExport.h" #include "core/dom/MessagePort.h" @@ -43,20 +43,20 @@ class ConsoleMessage; class ExecutionContext; class ExecutionContextTask; -class WorkerMessagingProxy; +class InProcessWorkerMessagingProxy; // A proxy to talk to the worker object. This object is created on the // worker object thread (i.e. usually the main thread), passed on to // the worker thread, and used just to proxy messages to the -// WorkerMessagingProxy on the worker object thread. +// InProcessWorkerMessagingProxy on the worker object thread. // // Used only by in-process workers (DedicatedWorker and CompositorWorker.) -class CORE_EXPORT WorkerObjectProxy : public WorkerReportingProxy { - USING_FAST_MALLOC(WorkerObjectProxy); - WTF_MAKE_NONCOPYABLE(WorkerObjectProxy); +class CORE_EXPORT InProcessWorkerObjectProxy : public WorkerReportingProxy { + USING_FAST_MALLOC(InProcessWorkerObjectProxy); + WTF_MAKE_NONCOPYABLE(InProcessWorkerObjectProxy); public: - static PassOwnPtr<WorkerObjectProxy> create(WorkerMessagingProxy*); - ~WorkerObjectProxy() override { } + static PassOwnPtr<InProcessWorkerObjectProxy> create(InProcessWorkerMessagingProxy*); + ~InProcessWorkerObjectProxy() override { } void postMessageToWorkerObject(PassRefPtr<SerializedScriptValue>, PassOwnPtr<MessagePortChannelArray>); void postTaskToMainExecutionContext(PassOwnPtr<ExecutionContextTask>); @@ -75,14 +75,14 @@ void willDestroyWorkerGlobalScope() override { } protected: - WorkerObjectProxy(WorkerMessagingProxy*); + InProcessWorkerObjectProxy(InProcessWorkerMessagingProxy*); virtual ExecutionContext* getExecutionContext(); private: // This object always outlives this proxy. - WorkerMessagingProxy* m_messagingProxy; + InProcessWorkerMessagingProxy* m_messagingProxy; }; } // namespace blink -#endif // WorkerObjectProxy_h +#endif // InProcessWorkerObjectProxy_h
diff --git a/third_party/WebKit/Source/core/workers/Worker.cpp b/third_party/WebKit/Source/core/workers/Worker.cpp index 30f034d..a407d094 100644 --- a/third_party/WebKit/Source/core/workers/Worker.cpp +++ b/third_party/WebKit/Source/core/workers/Worker.cpp
@@ -8,8 +8,8 @@ #include "core/dom/Document.h" #include "core/dom/ExceptionCode.h" #include "core/frame/UseCounter.h" -#include "core/workers/WorkerGlobalScopeProxy.h" -#include "core/workers/WorkerGlobalScopeProxyProvider.h" +#include "core/workers/DedicatedWorkerGlobalScopeProxyProvider.h" +#include "core/workers/InProcessWorkerGlobalScopeProxy.h" namespace blink { @@ -43,10 +43,10 @@ return EventTargetNames::Worker; } -WorkerGlobalScopeProxy* Worker::createWorkerGlobalScopeProxy(ExecutionContext* context) +InProcessWorkerGlobalScopeProxy* Worker::createInProcessWorkerGlobalScopeProxy(ExecutionContext* context) { Document* document = toDocument(context); - WorkerGlobalScopeProxyProvider* proxyProvider = WorkerGlobalScopeProxyProvider::from(*document->page()); + DedicatedWorkerGlobalScopeProxyProvider* proxyProvider = DedicatedWorkerGlobalScopeProxyProvider::from(*document->page()); ASSERT(proxyProvider); return proxyProvider->createWorkerGlobalScopeProxy(this); }
diff --git a/third_party/WebKit/Source/core/workers/Worker.h b/third_party/WebKit/Source/core/workers/Worker.h index 2dbf303b..f593886c 100644 --- a/third_party/WebKit/Source/core/workers/Worker.h +++ b/third_party/WebKit/Source/core/workers/Worker.h
@@ -11,7 +11,7 @@ class ExceptionState; class ExecutionContext; -class WorkerGlobalScopeProxy; +class InProcessWorkerGlobalScopeProxy; class CORE_EXPORT Worker final : public InProcessWorkerBase { DEFINE_WRAPPERTYPEINFO(); @@ -22,7 +22,7 @@ protected: explicit Worker(ExecutionContext*); - WorkerGlobalScopeProxy* createWorkerGlobalScopeProxy(ExecutionContext*) override; + InProcessWorkerGlobalScopeProxy* createInProcessWorkerGlobalScopeProxy(ExecutionContext*) override; const AtomicString& interfaceName() const override; };
diff --git a/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp b/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp index ee7ae4c7..ffbced6 100644 --- a/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp +++ b/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp
@@ -343,12 +343,14 @@ void WorkerGlobalScope::countFeature(UseCounter::Feature) const { - // FIXME: How should we count features for shared/service workers? + // TODO(nhiroki): How should we count features for shared/service workers? + // (http://crbug.com/376039) } void WorkerGlobalScope::countDeprecation(UseCounter::Feature feature) const { - // FIXME: How should we count features for shared/service workers? + // TODO(nhiroki): How should we count features for shared/service workers? + // (http://crbug.com/376039) ASSERT(isSharedWorkerGlobalScope() || isServiceWorkerGlobalScope() || isCompositorWorkerGlobalScope()); // For each deprecated feature, send console message at most once
diff --git a/third_party/WebKit/Source/core/workers/WorkerObjectProxy.cpp b/third_party/WebKit/Source/core/workers/WorkerObjectProxy.cpp deleted file mode 100644 index b25788c..0000000 --- a/third_party/WebKit/Source/core/workers/WorkerObjectProxy.cpp +++ /dev/null
@@ -1,115 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "core/workers/WorkerObjectProxy.h" - -#include "bindings/core/v8/SerializedScriptValue.h" -#include "core/dom/CrossThreadTask.h" -#include "core/dom/Document.h" -#include "core/dom/ExecutionContext.h" -#include "core/inspector/ConsoleMessage.h" -#include "core/workers/WorkerMessagingProxy.h" -#include "wtf/Functional.h" - -namespace blink { - -PassOwnPtr<WorkerObjectProxy> WorkerObjectProxy::create(WorkerMessagingProxy* messagingProxy) -{ - ASSERT(messagingProxy); - return adoptPtr(new WorkerObjectProxy(messagingProxy)); -} - -void WorkerObjectProxy::postMessageToWorkerObject(PassRefPtr<SerializedScriptValue> message, PassOwnPtr<MessagePortChannelArray> channels) -{ - getExecutionContext()->postTask(BLINK_FROM_HERE, createCrossThreadTask(&WorkerMessagingProxy::postMessageToWorkerObject, m_messagingProxy, message, channels)); -} - -void WorkerObjectProxy::postTaskToMainExecutionContext(PassOwnPtr<ExecutionContextTask> task) -{ - getExecutionContext()->postTask(BLINK_FROM_HERE, task); -} - -void WorkerObjectProxy::confirmMessageFromWorkerObject(bool hasPendingActivity) -{ - getExecutionContext()->postTask(BLINK_FROM_HERE, createCrossThreadTask(&WorkerMessagingProxy::confirmMessageFromWorkerObject, m_messagingProxy, hasPendingActivity)); -} - -void WorkerObjectProxy::reportPendingActivity(bool hasPendingActivity) -{ - getExecutionContext()->postTask(BLINK_FROM_HERE, createCrossThreadTask(&WorkerMessagingProxy::reportPendingActivity, m_messagingProxy, hasPendingActivity)); -} - -void WorkerObjectProxy::reportException(const String& errorMessage, int lineNumber, int columnNumber, const String& sourceURL, int exceptionId) -{ - getExecutionContext()->postTask(BLINK_FROM_HERE, createCrossThreadTask(&WorkerMessagingProxy::reportException, m_messagingProxy, errorMessage, lineNumber, columnNumber, sourceURL, exceptionId)); -} - -void WorkerObjectProxy::reportConsoleMessage(ConsoleMessage* consoleMessage) -{ - getExecutionContext()->postTask(BLINK_FROM_HERE, createCrossThreadTask(&WorkerMessagingProxy::reportConsoleMessage, m_messagingProxy, consoleMessage->source(), consoleMessage->level(), consoleMessage->message(), consoleMessage->lineNumber(), consoleMessage->url())); -} - -void WorkerObjectProxy::postMessageToPageInspector(const String& message) -{ - ExecutionContext* context = getExecutionContext(); - if (context->isDocument()) - toDocument(context)->postInspectorTask(BLINK_FROM_HERE, createCrossThreadTask(&WorkerMessagingProxy::postMessageToPageInspector, m_messagingProxy, message)); -} - -void WorkerObjectProxy::postWorkerConsoleAgentEnabled() -{ - ExecutionContext* context = getExecutionContext(); - if (context->isDocument()) - toDocument(context)->postInspectorTask(BLINK_FROM_HERE, createCrossThreadTask(&WorkerMessagingProxy::postWorkerConsoleAgentEnabled, m_messagingProxy)); -} - -void WorkerObjectProxy::workerGlobalScopeClosed() -{ - getExecutionContext()->postTask(BLINK_FROM_HERE, createCrossThreadTask(&WorkerMessagingProxy::terminateWorkerGlobalScope, m_messagingProxy)); -} - -void WorkerObjectProxy::workerThreadTerminated() -{ - // This will terminate the MessagingProxy. - getExecutionContext()->postTask(BLINK_FROM_HERE, createCrossThreadTask(&WorkerMessagingProxy::workerThreadTerminated, m_messagingProxy)); -} - -WorkerObjectProxy::WorkerObjectProxy(WorkerMessagingProxy* messagingProxy) - : m_messagingProxy(messagingProxy) -{ -} - -ExecutionContext* WorkerObjectProxy::getExecutionContext() -{ - ASSERT(m_messagingProxy); - return m_messagingProxy->getExecutionContext(); -} - -} // namespace blink
diff --git a/third_party/WebKit/Source/core/workers/WorkerThread.cpp b/third_party/WebKit/Source/core/workers/WorkerThread.cpp index f4e3d99..280d084 100644 --- a/third_party/WebKit/Source/core/workers/WorkerThread.cpp +++ b/third_party/WebKit/Source/core/workers/WorkerThread.cpp
@@ -34,7 +34,6 @@ #include "core/inspector/InspectorInstrumentation.h" #include "core/inspector/InspectorTaskRunner.h" #include "core/inspector/WorkerThreadDebugger.h" -#include "core/workers/DedicatedWorkerGlobalScope.h" #include "core/workers/WorkerBackingThread.h" #include "core/workers/WorkerClients.h" #include "core/workers/WorkerReportingProxy.h"
diff --git a/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp b/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp index 4f9b93a..51313fd 100644 --- a/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp +++ b/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp
@@ -880,7 +880,7 @@ request.setHTTPMethod(m_method); request.setRequestContext(WebURLRequest::RequestContextXMLHttpRequest); request.setFetchCredentialsMode(m_includeCredentials ? WebURLRequest::FetchCredentialsModeInclude : WebURLRequest::FetchCredentialsModeSameOrigin); - request.setSkipServiceWorker(m_isolatedWorldSecurityOrigin); + request.setSkipServiceWorker(m_isolatedWorldSecurityOrigin.get()); request.setExternalRequestStateFromRequestorAddressSpace(executionContext.securityContext().addressSpace()); InspectorInstrumentation::willLoadXHR(&executionContext, this, this, m_method, m_url, m_async, httpBody ? httpBody->deepCopy() : nullptr, m_requestHeaders, m_includeCredentials);
diff --git a/third_party/WebKit/Source/devtools/devtools.gypi b/third_party/WebKit/Source/devtools/devtools.gypi index cd6a22c..6dc78d6 100644 --- a/third_party/WebKit/Source/devtools/devtools.gypi +++ b/third_party/WebKit/Source/devtools/devtools.gypi
@@ -156,6 +156,7 @@ 'front_end/sdk/NetworkManager.js', 'front_end/sdk/NetworkRequest.js', 'front_end/sdk/PaintProfiler.js', + 'front_end/sdk/ProfileTreeModel.js', 'front_end/sdk/RemoteObject.js', 'front_end/sdk/Resource.js', 'front_end/sdk/ResourceTreeModel.js',
diff --git a/third_party/WebKit/Source/devtools/front_end/Tests.js b/third_party/WebKit/Source/devtools/front_end/Tests.js index c2bddb4..c8f0d7cf 100644 --- a/third_party/WebKit/Source/devtools/front_end/Tests.js +++ b/third_party/WebKit/Source/devtools/front_end/Tests.js
@@ -526,6 +526,36 @@ }; +TestSuite.prototype.testPushTimes = function(url) +{ + var test = this; + var pendingResourceCount = 2; + + function finishResource(resource, finishTime) + { + test.assertTrue(typeof resource.timing.pushStart === "number" && resource.timing.pushStart > 0, `pushStart is invalid: ${resource.timing.pushStart}`); + test.assertTrue(typeof resource.timing.pushEnd === "number", `pushEnd is invalid: ${resource.timing.pushEnd}`); + test.assertTrue(resource.timing.pushStart < resource.startTime, "pushStart should be before startTime"); + if (resource.url.endsWith("?pushUseNullEndTime")) { + test.assertTrue(resource.timing.pushEnd === 0, `pushEnd should be 0 but is ${resource.timing.pushEnd}`); + } else { + test.assertTrue(resource.timing.pushStart < resource.timing.pushEnd, `pushStart should be before pushEnd (${resource.timing.pushStart} >= ${resource.timing.pushEnd})`); + // The below assertion is just due to the way we generate times in the moch URLRequestJob and is not generally an invariant. + test.assertTrue(resource.timing.pushEnd < resource.endTime, "pushEnd should be before endTime"); + test.assertTrue(resource.startTime < resource.timing.pushEnd, "pushEnd should be after startTime"); + } + if (!--pendingResourceCount) + test.releaseControl(); + } + + this.addSniffer(WebInspector.NetworkDispatcher.prototype, "_finishNetworkRequest", finishResource, true); + + test.evaluateInConsole_("addImage('" + url + "')", function(resultText) {}); + test.evaluateInConsole_("addImage('" + url + "?pushUseNullEndTime')", function(resultText) {}); + this.takeControl(); +}; + + TestSuite.prototype.testConsoleOnNavigateBack = function() { if (WebInspector.multitargetConsoleModel.messages().length === 1)
diff --git a/third_party/WebKit/Source/devtools/front_end/elements/spectrum.css b/third_party/WebKit/Source/devtools/front_end/elements/spectrum.css index 6036c7b..47db1a5 100644 --- a/third_party/WebKit/Source/devtools/front_end/elements/spectrum.css +++ b/third_party/WebKit/Source/devtools/front_end/elements/spectrum.css
@@ -3,8 +3,6 @@ width: 232px; height: 240px; -webkit-user-select: none; - /* Prevents the popover from jumping when focus() is called */ - display: block !important; } :host(.palettes-enabled) {
diff --git a/third_party/WebKit/Source/devtools/front_end/emulated_devices/Nexus5X-landscape.svg b/third_party/WebKit/Source/devtools/front_end/emulated_devices/Nexus5X-landscape.svg new file mode 100644 index 0000000..85634c6 --- /dev/null +++ b/third_party/WebKit/Source/devtools/front_end/emulated_devices/Nexus5X-landscape.svg
@@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg width="917px" height="455px" viewBox="0 0 917 455" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> + <title>Nexus 5X</title> + <defs></defs> + <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> + <g id="Nexus5X" transform="translate(458.500000, 227.500000) rotate(-90.000000) translate(-458.500000, -227.500000) translate(231.000000, -231.000000)"> + <rect id="Rectangle-path" fill="#656565" opacity="0.7" x="0" y="0" width="451.2" height="916.9" rx="59"></rect> + <path d="M3.8,62.4 C3.8,29.8 30.2,3.4 62.8,3.4 L388.8,3.4 C421.3,3.4 447.8,29.9 447.8,62.4 L447.8,853 C447.8,885.5 421.3,912 388.8,912 L62.8,912 C30.2,912 3.8,885.5 3.8,853 L3.8,62.3 L3.8,62.4 Z" id="Shape" fill="#000000" opacity="0.7"></path> + <rect id="Rectangle-path" fill="#2B292B" x="6.9" y="7.2" width="438.2" height="905.4" rx="59"></rect> + <path d="M451.2,238.2 L455,238.2 L455,300.7 L451.2,300.7 L451.2,238.2 Z M451.2,363.2 L453.9,363.2 L453.9,500.4 L451,500.4 L451.2,363.2 Z" id="Shape" fill="#656364"></path> + <g id="Group" transform="translate(76.000000, 30.000000)"> + <path d="M9.2,18 C14.2,18 18,14.2 18,9.3 C18,4.5 14,0.6 9.2,0.6 C4.4,0.6 0.5,4.6 0.5,9.3 C0.5,14.3 4.5,18.1 9.2,18.1 L9.2,18 Z" id="Shape" fill="#373737" opacity="0.6"></path> + <circle id="Oval" fill="#160F26" cx="9.2" cy="9.3" r="5"></circle> + </g> + <path d="M19.4,87.6 L430.4,87.6 L430.4,818.6 L19.4,818.6 L19.4,87.6 Z" id="Shape" fill="#171717" opacity="0.5"></path> + <rect id="Rectangle-path" stroke="#393939" stroke-width="2" fill="#0D0B0B" opacity="0.3" x="143.3" y="871.3" width="164.2" height="14.5" rx="7"></rect> + <rect id="Rectangle-path" stroke="#393939" stroke-width="2" fill="#0D0B0B" opacity="0.3" x="143.3" y="32.5" width="164.2" height="14.5" rx="7"></rect> + </g> + </g> +</svg>
diff --git a/third_party/WebKit/Source/devtools/front_end/emulated_devices/Nexus5X-portrait.svg b/third_party/WebKit/Source/devtools/front_end/emulated_devices/Nexus5X-portrait.svg new file mode 100644 index 0000000..29c4e641 --- /dev/null +++ b/third_party/WebKit/Source/devtools/front_end/emulated_devices/Nexus5X-portrait.svg
@@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg width="455px" height="917px" viewBox="0 0 455 917" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> + <title>Nexus 5X</title> + <defs></defs> + <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> + <g id="Nexus5X"> + <rect id="Rectangle-path" fill="#656565" opacity="0.7" x="0" y="0" width="451.2" height="916.9" rx="59"></rect> + <path d="M3.8,62.4 C3.8,29.8 30.2,3.4 62.8,3.4 L388.8,3.4 C421.3,3.4 447.8,29.9 447.8,62.4 L447.8,853 C447.8,885.5 421.3,912 388.8,912 L62.8,912 C30.2,912 3.8,885.5 3.8,853 L3.8,62.3 L3.8,62.4 Z" id="Shape" fill="#000000" opacity="0.7"></path> + <rect id="Rectangle-path" fill="#2B292B" x="6.9" y="7.2" width="438.2" height="905.4" rx="59"></rect> + <path d="M451.2,238.2 L455,238.2 L455,300.7 L451.2,300.7 L451.2,238.2 Z M451.2,363.2 L453.9,363.2 L453.9,500.4 L451,500.4 L451.2,363.2 Z" id="Shape" fill="#656364"></path> + <g id="Group" transform="translate(76.000000, 30.000000)"> + <path d="M9.2,18 C14.2,18 18,14.2 18,9.3 C18,4.5 14,0.6 9.2,0.6 C4.4,0.6 0.5,4.6 0.5,9.3 C0.5,14.3 4.5,18.1 9.2,18.1 L9.2,18 Z" id="Shape" fill="#373737" opacity="0.6"></path> + <circle id="Oval" fill="#160F26" cx="9.2" cy="9.3" r="5"></circle> + </g> + <path d="M19.4,87.6 L430.4,87.6 L430.4,818.6 L19.4,818.6 L19.4,87.6 Z" id="Shape" fill="#171717" opacity="0.5"></path> + <rect id="Rectangle-path" stroke="#393939" stroke-width="2" fill="#0D0B0B" opacity="0.3" x="143.3" y="871.3" width="164.2" height="14.5" rx="7"></rect> + <rect id="Rectangle-path" stroke="#393939" stroke-width="2" fill="#0D0B0B" opacity="0.3" x="143.3" y="32.5" width="164.2" height="14.5" rx="7"></rect> + </g> + </g> +</svg>
diff --git a/third_party/WebKit/Source/devtools/front_end/emulated_devices/Nexus6P-landscape.svg b/third_party/WebKit/Source/devtools/front_end/emulated_devices/Nexus6P-landscape.svg new file mode 100644 index 0000000..a46532c --- /dev/null +++ b/third_party/WebKit/Source/devtools/front_end/emulated_devices/Nexus6P-landscape.svg
@@ -0,0 +1,53 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg width="976px" height="480px" viewBox="0 0 976 480" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> + <title>Nexus 6P</title> + <defs> + <linearGradient x1="4.2%" y1="2.1%" x2="96.6%" y2="100%" id="linearGradient-1"> + <stop stop-color="#3A3A3A" offset="0%"></stop> + <stop stop-color="#181818" offset="100%"></stop> + </linearGradient> + <linearGradient x1="4.2%" y1="38.6349341%" x2="96.6%" y2="61.8633255%" id="linearGradient-2"> + <stop stop-color="#3A3A3A" offset="0%"></stop> + <stop stop-color="#181818" offset="100%"></stop> + </linearGradient> + </defs> + <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> + <g id="Nexus6P" transform="translate(488.000000, 238.500000) rotate(-90.000000) translate(-488.000000, -238.500000) translate(250.000000, -246.000000)"> + <g id="b-link" fill="url(#linearGradient-2)"> + <rect id="b" x="0" y="0" width="472" height="969" rx="60"></rect> + </g> + <g id="b-link"> + <rect id="b" x="0" y="0" width="472" height="969" rx="60"></rect> + </g> + <g id="b-link"> + <rect id="b" x="0" y="0" width="472" height="969" rx="60"></rect> + </g> + <g id="b-link" stroke="#1E1E1E" stroke-width="7"> + <rect id="b" x="0" y="0" width="472" height="969" rx="60"></rect> + </g> + <g id="b-link" stroke="#616161" stroke-width="5"> + <rect id="b" x="0" y="0" width="472" height="969" rx="60"></rect> + </g> + <g id="b-link" stroke="#1E1E1E" stroke-width="3"> + <rect id="b" x="0" y="0" width="472" height="969" rx="60"></rect> + </g> + <g id="b-link" stroke="#B4B4B4" stroke-width="2"> + <rect id="b" x="0" y="0" width="472" height="969" rx="60"></rect> + </g> + <g id="b-link" stroke="#8A8A8A"> + <rect id="b" x="0" y="0" width="472" height="969" rx="60"></rect> + </g> + <g id="Group" transform="translate(472.000000, 319.000000)" fill="#444445"> + <path d="M0,0 L2,0 C3,0 4,1 4,2 L4,58 C4,59 3,60 2,60 L0,60 L0,0 L0,0 Z" id="Shape"></path> + <path d="M0,97 L2,97 C3,97 4,98 4,99 L4,215 C4,216 3,217 2,217 L0,217 L0,97 L0,97 Z" id="Shape"></path> + </g> + <path d="M18,100 L453,100 L453,873 L18,873 L18,100 Z" id="Shape" fill="#171717"></path> + <rect id="Rectangle-path" stroke="#141414" stroke-width="3" fill="#1E1E1E" opacity="0.4" x="150" y="40" width="169" height="14" rx="8"></rect> + <rect id="Rectangle-path" stroke="#141414" stroke-width="3" fill="#101010" x="150" y="921" width="169" height="14" rx="8"></rect> + <g id="Group" transform="translate(85.000000, 37.000000)"> + <path d="M9.2,18 C14.2,18 18,14.2 18,9.3 C18,4.5 14,0.6 9.2,0.6 C4.4,0.6 0.5,4.6 0.5,9.3 C0.5,14.3 4.5,18.1 9.2,18.1 L9.2,18 Z" id="Shape" stroke="#2F2F2F" fill="#323232" opacity="0.6"></path> + <circle id="Oval" fill="#160F26" cx="9.2" cy="9.3" r="5"></circle> + </g> + </g> + </g> +</svg>
diff --git a/third_party/WebKit/Source/devtools/front_end/emulated_devices/Nexus6P-portrait.svg b/third_party/WebKit/Source/devtools/front_end/emulated_devices/Nexus6P-portrait.svg new file mode 100644 index 0000000..92e1832c --- /dev/null +++ b/third_party/WebKit/Source/devtools/front_end/emulated_devices/Nexus6P-portrait.svg
@@ -0,0 +1,53 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg width="480px" height="977px" viewBox="0 0 480 977" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> + <title>Nexus 6P</title> + <defs> + <linearGradient x1="4.2%" y1="2.1%" x2="96.6%" y2="100%" id="linearGradient-1"> + <stop stop-color="#3A3A3A" offset="0%"></stop> + <stop stop-color="#181818" offset="100%"></stop> + </linearGradient> + <linearGradient x1="4.2%" y1="38.6349341%" x2="96.6%" y2="61.8633255%" id="linearGradient-2"> + <stop stop-color="#3A3A3A" offset="0%"></stop> + <stop stop-color="#181818" offset="100%"></stop> + </linearGradient> + </defs> + <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> + <g id="Nexus6P" transform="translate(4.000000, 4.000000)"> + <g id="b-link" fill="url(#linearGradient-2)"> + <rect id="b" x="0" y="0" width="472" height="969" rx="60"></rect> + </g> + <g id="b-link"> + <rect id="b" x="0" y="0" width="472" height="969" rx="60"></rect> + </g> + <g id="b-link"> + <rect id="b" x="0" y="0" width="472" height="969" rx="60"></rect> + </g> + <g id="b-link" stroke="#1E1E1E" stroke-width="7"> + <rect id="b" x="0" y="0" width="472" height="969" rx="60"></rect> + </g> + <g id="b-link" stroke="#616161" stroke-width="5"> + <rect id="b" x="0" y="0" width="472" height="969" rx="60"></rect> + </g> + <g id="b-link" stroke="#1E1E1E" stroke-width="3"> + <rect id="b" x="0" y="0" width="472" height="969" rx="60"></rect> + </g> + <g id="b-link" stroke="#B4B4B4" stroke-width="2"> + <rect id="b" x="0" y="0" width="472" height="969" rx="60"></rect> + </g> + <g id="b-link" stroke="#8A8A8A"> + <rect id="b" x="0" y="0" width="472" height="969" rx="60"></rect> + </g> + <g id="Group" transform="translate(472.000000, 319.000000)" fill="#444445"> + <path d="M0,0 L2,0 C3,0 4,1 4,2 L4,58 C4,59 3,60 2,60 L0,60 L0,0 L0,0 Z" id="Shape"></path> + <path d="M0,97 L2,97 C3,97 4,98 4,99 L4,215 C4,216 3,217 2,217 L0,217 L0,97 L0,97 Z" id="Shape"></path> + </g> + <path d="M18,100 L453,100 L453,873 L18,873 L18,100 Z" id="Shape" fill="#171717"></path> + <rect id="Rectangle-path" stroke="#141414" stroke-width="3" fill="#1E1E1E" opacity="0.4" x="150" y="40" width="169" height="14" rx="8"></rect> + <rect id="Rectangle-path" stroke="#141414" stroke-width="3" fill="#101010" x="150" y="921" width="169" height="14" rx="8"></rect> + <g id="Group" transform="translate(85.000000, 37.000000)"> + <path d="M9.2,18 C14.2,18 18,14.2 18,9.3 C18,4.5 14,0.6 9.2,0.6 C4.4,0.6 0.5,4.6 0.5,9.3 C0.5,14.3 4.5,18.1 9.2,18.1 L9.2,18 Z" id="Shape" stroke="#2F2F2F" fill="#323232" opacity="0.6"></path> + <circle id="Oval" fill="#160F26" cx="9.2" cy="9.3" r="5"></circle> + </g> + </g> + </g> +</svg>
diff --git a/third_party/WebKit/Source/devtools/front_end/emulated_devices/iPad-landscape.svg b/third_party/WebKit/Source/devtools/front_end/emulated_devices/iPad-landscape.svg new file mode 100644 index 0000000..1158fe4 --- /dev/null +++ b/third_party/WebKit/Source/devtools/front_end/emulated_devices/iPad-landscape.svg
@@ -0,0 +1,73 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg width="1252px" height="876px" viewBox="0 0 1252 876" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> + <title>iPad</title> + <defs> + <linearGradient x1="53.4074186%" y1="42.8551228%" x2="44.5013504%" y2="61.5298471%" id="linearGradient-1"> + <stop stop-color="#3A3E3A" offset="8.86%"></stop> + <stop stop-color="#2E332E" offset="34.31%"></stop> + <stop stop-color="#C0C1C2" offset="36%"></stop> + <stop stop-color="#3C3F3E" offset="51.34%"></stop> + <stop stop-color="#4B4E4B" offset="64.16%"></stop> + </linearGradient> + <radialGradient cx="49.7525149%" cy="45.0260324%" fx="49.7525149%" fy="45.0260324%" r="43.1038484%" id="radialGradient-2"> + <stop stop-color="#FFFFFF" stop-opacity="0.6" offset="82.84%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0" offset="97.66%"></stop> + </radialGradient> + <linearGradient x1="1.85026396%" y1="102.188703%" x2="61.1786193%" y2="37.8836394%" id="linearGradient-3"> + <stop stop-color="#595C64" offset="0%"></stop> + <stop stop-color="#3C414A" offset="64.45%"></stop> + </linearGradient> + <linearGradient x1="86.3892857%" y1="91.8876786%" x2="14.0435714%" y2="8.62178571%" id="linearGradient-4"> + <stop stop-color="#FFFFFF" stop-opacity="0.3" offset="14.7%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0" offset="40.73%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0.00509108" offset="74.45%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0.2" offset="100%"></stop> + </linearGradient> + <radialGradient cx="50.4141972%" cy="57.1536365%" fx="50.4141972%" fy="57.1536365%" r="32.0253807%" id="radialGradient-5"> + <stop stop-color="#000000" stop-opacity="0" offset="0%"></stop> + <stop stop-color="#020202" stop-opacity="0.4119" offset="51.49%"></stop> + <stop stop-color="#090909" stop-opacity="0.5603" offset="70.03%"></stop> + <stop stop-color="#141414" stop-opacity="0.666" offset="83.25%"></stop> + <stop stop-color="#252525" stop-opacity="0.7509" offset="93.87%"></stop> + <stop stop-color="#333333" stop-opacity="0.8" offset="100%"></stop> + </radialGradient> + <radialGradient cx="47.7237505%" cy="96.413995%" fx="47.7237505%" fy="96.413995%" r="61.371517%" id="radialGradient-6"> + <stop stop-color="#FFFFFF" stop-opacity="0.3" offset="0%"></stop> + <stop stop-color="#000000" stop-opacity="0" offset="100%"></stop> + </radialGradient> + <radialGradient cx="50.7767573%" cy="24.0727573%" fx="50.7767573%" fy="24.0727573%" r="36.758427%" id="radialGradient-7"> + <stop stop-color="#FFFFFF" stop-opacity="0.3" offset="0%"></stop> + <stop stop-color="#000000" stop-opacity="0" offset="100%"></stop> + </radialGradient> + <linearGradient x1="49.241206%" y1="6.83%" x2="49.241206%" y2="97.95%" id="linearGradient-8"> + <stop stop-color="#FFFFFF" stop-opacity="0.6" offset="0%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0.1" offset="100%"></stop> + </linearGradient> + </defs> + <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> + <g id="ipad-landscape"> + <g id="Group"> + <g> + <path d="M1251.72,61.92 L1251.72,814.08 C1251.72,847.76 1224.42,875.06 1190.74,875.06 L61.26,875.06 C27.58,875.06 0.28,847.76 0.28,814.08 L0.28,61.92 C0.28,28.24 27.58,0.94 61.26,0.94 L1190.74,0.94 C1224.42,0.94 1251.72,28.24 1251.72,61.92 L1251.72,61.92 Z" id="Shape" fill="url(#linearGradient-1)"></path> + <path d="M1251.72,61.92 L1251.72,814.08 C1251.72,847.76 1224.42,875.06 1190.74,875.06 L61.26,875.06 C27.58,875.06 0.28,847.76 0.28,814.08 L0.28,61.92 C0.28,28.24 27.58,0.94 61.26,0.94 L1190.74,0.94 C1224.42,0.94 1251.72,28.24 1251.72,61.92 L1251.72,61.92 Z" id="Shape" fill="url(#radialGradient-2)"></path> + <path d="M1245.39,814.08 C1245.39,844.22 1220.87,868.73 1190.74,868.73 L61.26,868.73 C31.12,868.73 6.61,844.21 6.61,814.08 L6.61,61.92 C6.61,31.78 31.13,7.27 61.26,7.27 L1190.74,7.27 C1220.88,7.27 1245.39,31.79 1245.39,61.92 L1245.39,814.08 L1245.39,814.08 Z" id="Shape" fill="url(#linearGradient-3)"></path> + <path d="M1242.74,814.08 C1242.74,842.75 1219.41,866.08 1190.74,866.08 L61.26,866.08 C32.59,866.08 9.26,842.75 9.26,814.08 L9.26,61.92 C9.26,33.25 32.59,9.92 61.26,9.92 L1190.74,9.92 C1219.41,9.92 1242.74,33.25 1242.74,61.92 L1242.74,814.08 L1242.74,814.08 Z" id="Shape" fill="#232323"></path> + <path d="M1194.12,409.1 C1178.66,409.1 1166.12,421.64 1166.12,437.1 C1166.12,452.56 1178.66,465.1 1194.12,465.1 C1209.58,465.1 1222.12,452.56 1222.12,437.1 C1222.12,421.64 1209.58,409.1 1194.12,409.1 L1194.12,409.1 Z M1194.12,462.54 C1180.07,462.54 1168.68,451.15 1168.68,437.1 C1168.68,423.05 1180.07,411.66 1194.12,411.66 C1208.17,411.66 1219.56,423.05 1219.56,437.1 C1219.56,451.15 1208.17,462.54 1194.12,462.54 L1194.12,462.54 Z" id="Shape" fill="url(#linearGradient-4)"></path> + <g transform="translate(61.000000, 429.000000)"> + <circle id="Oval" fill="#5D5D5F" cx="8.21" cy="8.29" r="7.88"></circle> + <circle id="Oval" fill="url(#radialGradient-5)" cx="8.21" cy="8.29" r="7.88"></circle> + <circle id="Oval" fill="#1B1A1F" cx="8.21" cy="8.29" r="4.42"></circle> + <circle id="Oval" fill="#36284C" cx="8.21" cy="8.29" r="3.23"></circle> + <circle id="Oval" fill="url(#radialGradient-6)" cx="8.21" cy="8.29" r="3.23"></circle> + <g transform="translate(6.000000, 6.000000)" id="Oval"> + <circle fill="#141414" opacity="0.5" cx="2.21" cy="2.29" r="1.78"></circle> + <circle fill="url(#radialGradient-7)" cx="2.21" cy="2.29" r="1.78"></circle> + </g> + <path d="M8.21,6.96 C7.82,6.96 7.47,7.14 7.23,7.41 L7.65,7.83 C7.79,7.66 7.99,7.55 8.22,7.55 C8.46,7.55 8.66,7.67 8.8,7.84 L9.22,7.42 C8.96,7.15 8.61,6.96 8.21,6.96 L8.21,6.96 Z" id="Shape" fill="url(#linearGradient-8)"></path> + </g> + </g> + <rect id="Rectangle-path" fill="#000000" x="111.65" y="55.54" width="1024" height="768"></rect> + </g> + </g> + </g> +</svg>
diff --git a/third_party/WebKit/Source/devtools/front_end/emulated_devices/iPad-portrait.svg b/third_party/WebKit/Source/devtools/front_end/emulated_devices/iPad-portrait.svg new file mode 100644 index 0000000..8738db5f --- /dev/null +++ b/third_party/WebKit/Source/devtools/front_end/emulated_devices/iPad-portrait.svg
@@ -0,0 +1,76 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg width="875px" height="1253px" viewBox="0 0 875 1253" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> + <title>iPad</title> + <defs> + <linearGradient x1="56.85224%" y1="46.7616506%" x2="38.1241363%" y2="55.612846%" id="linearGradient-1"> + <stop stop-color="#3A3E3A" offset="8.86%"></stop> + <stop stop-color="#2E332E" offset="34.31%"></stop> + <stop stop-color="#C0C1C2" offset="36%"></stop> + <stop stop-color="#3C3F3E" offset="51.34%"></stop> + <stop stop-color="#4B4E4B" offset="64.16%"></stop> + </linearGradient> + <radialGradient cx="50.1721031%" cy="47.1220327%" fx="50.1721031%" fy="47.1220327%" r="68.0316204%" id="radialGradient-2"> + <stop stop-color="#FFFFFF" stop-opacity="0.6" offset="82.84%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0" offset="97.66%"></stop> + </radialGradient> + <linearGradient x1="-2.18858682%" y1="1.85033783%" x2="62.1164651%" y2="61.1782223%" id="linearGradient-3"> + <stop stop-color="#595C64" offset="0%"></stop> + <stop stop-color="#3C414A" offset="64.45%"></stop> + </linearGradient> + <linearGradient x1="86.395%" y1="91.8842857%" x2="14.0494643%" y2="8.61857143%" id="linearGradient-4"> + <stop stop-color="#FFFFFF" stop-opacity="0.3" offset="14.7%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0" offset="40.73%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0.00509108" offset="74.45%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0.2" offset="100%"></stop> + </linearGradient> + <linearGradient x1="-22.8991955%" y1="27.2682893%" x2="39.640603%" y2="46.0089814%" id="linearGradient-5"> + <stop stop-color="#FFFFFF" stop-opacity="0.15" offset="0%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0" offset="100%"></stop> + </linearGradient> + <radialGradient cx="50.4203886%" cy="57.0974914%" fx="50.4203886%" fy="57.0974914%" r="32.0253807%" id="radialGradient-6"> + <stop stop-color="#000000" stop-opacity="0" offset="0%"></stop> + <stop stop-color="#020202" stop-opacity="0.4119" offset="51.49%"></stop> + <stop stop-color="#090909" stop-opacity="0.5603" offset="70.03%"></stop> + <stop stop-color="#141414" stop-opacity="0.666" offset="83.25%"></stop> + <stop stop-color="#252525" stop-opacity="0.7509" offset="93.87%"></stop> + <stop stop-color="#333333" stop-opacity="0.8" offset="100%"></stop> + </radialGradient> + <radialGradient cx="47.731605%" cy="96.2770217%" fx="47.731605%" fy="96.2770217%" r="61.371517%" id="radialGradient-7"> + <stop stop-color="#FFFFFF" stop-opacity="0.3" offset="0%"></stop> + <stop stop-color="#000000" stop-opacity="0" offset="100%"></stop> + </radialGradient> + <radialGradient cx="50.7910101%" cy="23.832973%" fx="50.7910101%" fy="23.832973%" r="36.758427%" id="radialGradient-8"> + <stop stop-color="#FFFFFF" stop-opacity="0.3" offset="0%"></stop> + <stop stop-color="#000000" stop-opacity="0" offset="100%"></stop> + </radialGradient> + <linearGradient x1="49.281407%" y1="6.96%" x2="49.281407%" y2="98.07%" id="linearGradient-9"> + <stop stop-color="#FFFFFF" stop-opacity="0.6" offset="0%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0.1" offset="100%"></stop> + </linearGradient> + </defs> + <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> + <g id="ipad-portrait"> + <g id="Group"> + <path d="M813.32,1252.09 L61.16,1252.09 C27.48,1252.09 0.18,1224.79 0.18,1191.11 L0.18,61.63 C0.18,27.95 27.48,0.65 61.16,0.65 L813.32,0.65 C847,0.65 874.3,27.95 874.3,61.63 L874.3,1191.11 C874.3,1224.79 847,1252.09 813.32,1252.09 L813.32,1252.09 Z" id="Shape" fill="url(#linearGradient-1)"></path> + <path d="M61.16,1252.09 C27.48,1252.09 0.18,1224.79 0.18,1191.11 L0.18,61.63 C0.18,27.95 27.48,0.65 61.16,0.65 L813.32,0.65 C847,0.65 874.3,27.95 874.3,61.63 L874.3,1191.11 C874.3,1224.79 847,1252.09 813.32,1252.09 L61.16,1252.09 Z" id="Shape" fill="url(#radialGradient-2)"></path> + <path d="M61.16,1245.77 C31.02,1245.77 6.51,1221.25 6.51,1191.12 L6.51,61.63 C6.51,31.49 31.03,6.98 61.16,6.98 L813.32,6.98 C843.46,6.98 867.97,31.5 867.97,61.63 L867.97,1191.11 C867.97,1221.25 843.45,1245.76 813.32,1245.76 L61.16,1245.76 L61.16,1245.77 Z" id="Shape" fill="url(#linearGradient-3)"></path> + <path d="M61.16,1243.11 C32.49,1243.11 9.16,1219.78 9.16,1191.11 L9.16,61.63 C9.16,32.96 32.49,9.63 61.16,9.63 L813.32,9.63 C841.99,9.63 865.32,32.96 865.32,61.63 L865.32,1191.11 C865.32,1219.78 841.99,1243.11 813.32,1243.11 L61.16,1243.11 L61.16,1243.11 Z" id="Shape" fill="#232323"></path> + <path d="M438.14,1166.49 C422.68,1166.49 410.14,1179.03 410.14,1194.49 C410.14,1209.95 422.68,1222.49 438.14,1222.49 C453.6,1222.49 466.14,1209.95 466.14,1194.49 C466.14,1179.03 453.6,1166.49 438.14,1166.49 L438.14,1166.49 Z M438.14,1219.93 C424.09,1219.93 412.7,1208.54 412.7,1194.49 C412.7,1180.44 424.09,1169.05 438.14,1169.05 C452.19,1169.05 463.58,1180.44 463.58,1194.49 C463.58,1208.54 452.19,1219.93 438.14,1219.93 L438.14,1219.93 Z" id="Shape" fill="url(#linearGradient-4)"></path> + <path d="M59.24,8.19 C31.62,8.19 9.15,30.66 9.15,58.28 L9.15,1190.65 C9.15,1218.27 31.62,1240.74 59.24,1240.74 L105.77,1240.74 L620.73,8.19 L59.24,8.19 L59.24,8.19 Z" id="Shape" fill="url(#linearGradient-5)"></path> + <g transform="translate(430.000000, 61.000000)"> + <circle id="Oval" fill="#5D5D5F" cx="7.95" cy="8.58" r="7.88"></circle> + <circle id="Oval" fill="url(#radialGradient-6)" cx="7.95" cy="8.58" r="7.88"></circle> + <circle id="Oval" fill="#1B1A1F" cx="7.95" cy="8.58" r="4.42"></circle> + <circle id="Oval" fill="#36284C" cx="7.95" cy="8.58" r="3.23"></circle> + <circle id="Oval" fill="url(#radialGradient-7)" cx="7.95" cy="8.58" r="3.23"></circle> + <g transform="translate(6.000000, 6.000000)" id="Oval"> + <circle fill="#141414" opacity="0.5" cx="1.95" cy="2.58" r="1.78"></circle> + <circle fill="url(#radialGradient-8)" cx="1.95" cy="2.58" r="1.78"></circle> + </g> + <path d="M7.95,7.24 C7.56,7.24 7.21,7.42 6.97,7.69 L7.39,8.11 C7.53,7.94 7.73,7.83 7.96,7.83 C8.2,7.83 8.4,7.95 8.54,8.12 L8.96,7.7 C8.7,7.43 8.35,7.24 7.95,7.24 L7.95,7.24 Z" id="Shape" fill="url(#linearGradient-9)"></path> + </g> + </g> + <rect id="Rectangle-path" fill="#000000" x="52" y="114" width="768" height="1024"></rect> + </g> + </g> +</svg>
diff --git a/third_party/WebKit/Source/devtools/front_end/emulated_devices/iPhone5-landscape.svg b/third_party/WebKit/Source/devtools/front_end/emulated_devices/iPhone5-landscape.svg new file mode 100644 index 0000000..614e37b --- /dev/null +++ b/third_party/WebKit/Source/devtools/front_end/emulated_devices/iPhone5-landscape.svg
@@ -0,0 +1,106 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg width="796px" height="374px" viewBox="0 0 796 374" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> + <title>iPhone 5</title> + <defs> + <linearGradient x1="48.0821303%" y1="41.0365444%" x2="53.4014207%" y2="65.8954597%" id="linearGradient-1"> + <stop stop-color="#3A3E3A" offset="8.86%"></stop> + <stop stop-color="#2E332E" offset="34.31%"></stop> + <stop stop-color="#C0C1C2" offset="36%"></stop> + <stop stop-color="#3C3F3E" offset="51.34%"></stop> + <stop stop-color="#4B4E4B" offset="64.16%"></stop> + </linearGradient> + <linearGradient x1="8.33127764%" y1="117.999363%" x2="59.674224%" y2="34.2134349%" id="linearGradient-2"> + <stop stop-color="#787A81" offset="0%"></stop> + <stop stop-color="#50555D" offset="63.53%"></stop> + </linearGradient> + <linearGradient x1="86.386465%" y1="91.8797771%" x2="14.0433121%" y2="8.61671975%" id="linearGradient-3"> + <stop stop-color="#FFFFFF" stop-opacity="0.3" offset="14.7%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0" offset="40.73%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0.00509108" offset="74.45%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0.2" offset="100%"></stop> + </linearGradient> + <radialGradient cx="50.420845%" cy="57.0979235%" fx="50.420845%" fy="57.0979235%" r="32.026875%" id="radialGradient-4"> + <stop stop-color="#000000" stop-opacity="0" offset="0%"></stop> + <stop stop-color="#020202" stop-opacity="0.4119" offset="51.49%"></stop> + <stop stop-color="#090909" stop-opacity="0.5603" offset="70.03%"></stop> + <stop stop-color="#141414" stop-opacity="0.666" offset="83.25%"></stop> + <stop stop-color="#252525" stop-opacity="0.7509" offset="93.87%"></stop> + <stop stop-color="#333333" stop-opacity="0.8" offset="100%"></stop> + </radialGradient> + <radialGradient cx="47.7374598%" cy="96.2677037%" fx="47.7374598%" fy="96.2677037%" r="61.3597561%" id="radialGradient-5"> + <stop stop-color="#FFFFFF" stop-opacity="0.3" offset="0%"></stop> + <stop stop-color="#000000" stop-opacity="0" offset="100%"></stop> + </radialGradient> + <radialGradient cx="50.7992656%" cy="23.7186867%" fx="50.7992656%" fy="23.7186867%" r="36.9055556%" id="radialGradient-6"> + <stop stop-color="#FFFFFF" stop-opacity="0.3" offset="0%"></stop> + <stop stop-color="#000000" stop-opacity="0" offset="100%"></stop> + </radialGradient> + <linearGradient x1="50.3015075%" y1="7%" x2="50.3015075%" y2="99.53%" id="linearGradient-7"> + <stop stop-color="#FFFFFF" stop-opacity="0.6" offset="0%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0.1" offset="100%"></stop> + </linearGradient> + <path id="path-8" d="M8.84,4.95 L8.84,59.57 C8.84,61.94 6.92,63.86 4.55,63.86 L4.55,63.86 C2.18,63.86 0.26,61.94 0.26,59.57 L0.26,4.95 C0.26,2.58 2.18,0.66 4.55,0.66 L4.55,0.66 C6.92,0.67 8.84,2.59 8.84,4.95 L8.84,4.95 Z"></path> + <linearGradient x1="100.590671%" y1="50.3945599%" x2="0.664279091%" y2="50.3945599%" id="linearGradient-10"> + <stop stop-color="#2E2E31" offset="0%"></stop> + <stop stop-color="#616161" offset="24.48%"></stop> + <stop stop-color="#858585" offset="81.37%"></stop> + <stop stop-color="#2E2E31" offset="100%"></stop> + </linearGradient> + <path id="path-11" d="M8.84,4.95 L8.84,59.57 C8.84,61.94 6.92,63.86 4.55,63.86 L4.55,63.86 C2.18,63.86 0.26,61.94 0.26,59.57 L0.26,4.95 C0.26,2.58 2.18,0.66 4.55,0.66 L4.55,0.66 C6.92,0.67 8.84,2.59 8.84,4.95 L8.84,4.95 Z"></path> + <path id="path-13" d="M8.84,4.95 L8.84,59.57 C8.84,61.94 6.92,63.86 4.55,63.86 L4.55,63.86 C2.18,63.86 0.26,61.94 0.26,59.57 L0.26,4.95 C0.26,2.58 2.18,0.66 4.55,0.66 L4.55,0.66 C6.92,0.67 8.84,2.59 8.84,4.95 L8.84,4.95 Z"></path> + </defs> + <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> + <g id="iphone5-landscape"> + <g id="Group"> + <path d="M141.69,367.74 L141.69,371.47 C141.69,372.49 140.86,373.31 139.85,373.31 L109.29,373.31 C108.27,373.31 107.45,372.48 107.45,371.47 L107.45,367.74 L141.69,367.74 L141.69,367.74 Z" id="Shape" fill="#808086"></path> + <path d="M6.33,129.47 L2.6,129.47 C1.58,129.47 0.76,128.64 0.76,127.63 L0.76,72.05 C0.76,71.03 1.59,70.21 2.6,70.21 L6.33,70.21 L6.33,129.47 L6.33,129.47 Z" id="Shape" fill="#808086"></path> + <path d="M183.02,373.12 C181.99,373.12 181.16,372.29 181.16,371.26 L181.16,367.54 L209.26,367.54 L209.26,371.26 C209.26,372.29 208.43,373.12 207.4,373.12 L183.02,373.12 L183.02,373.12 Z" id="Shape" fill="#808086"></path> + <path d="M249.35,373.12 C248.32,373.12 247.49,372.29 247.49,371.26 L247.49,367.54 L275.59,367.54 L275.59,371.26 C275.59,372.29 274.76,373.12 273.73,373.12 L249.35,373.12 L249.35,373.12 Z" id="Shape" fill="#808086"></path> + <path d="M795.24,313.26 C795.24,344.45 769.86,369.83 738.67,369.83 L62.09,369.83 C30.9,369.83 5.52,344.45 5.52,313.26 L5.52,57.26 C5.52,26.07 30.9,0.69 62.09,0.69 L738.67,0.69 C769.86,0.69 795.24,26.07 795.24,57.26 L795.24,313.26 L795.24,313.26 Z" id="Shape" fill="url(#linearGradient-1)"></path> + <path d="M791.17,313.26 C791.17,342.21 767.62,365.76 738.67,365.76 L62.09,365.76 C33.14,365.76 9.59,342.21 9.59,313.26 L9.59,57.26 C9.59,28.31 33.14,4.76 62.09,4.76 L738.67,4.76 C767.62,4.76 791.17,28.31 791.17,57.26 L791.17,313.26 L791.17,313.26 Z" id="Shape" fill="url(#linearGradient-2)"></path> + <rect id="Rectangle-path" fill="#2E2E2E" x="72.56" y="363.15" width="6" height="6.69"></rect> + <rect id="Rectangle-path" fill="#1F1F1F" x="72.56" y="0.69" width="6" height="6.74"></rect> + <rect id="Rectangle-path" fill="#2E2E2E" x="721.76" y="363.15" width="6" height="6.69"></rect> + <rect id="Rectangle-path" fill="#1F1F1F" x="721.76" y="0.69" width="6" height="6.74"></rect> + <path d="M788.62,313.26 C788.62,340.8 766.21,363.21 738.67,363.21 L62.09,363.21 C34.55,363.21 12.14,340.8 12.14,313.26 L12.14,57.26 C12.14,29.72 34.55,7.31 62.09,7.31 L738.67,7.31 C766.21,7.31 788.62,29.72 788.62,57.26 L788.62,313.26 L788.62,313.26 Z" id="Shape" fill="#232323"></path> + <path d="M739.1,153.87 C721.76,153.87 707.7,167.93 707.7,185.27 C707.7,202.61 721.76,216.67 739.1,216.67 C756.44,216.67 770.5,202.61 770.5,185.27 C770.5,167.93 756.44,153.87 739.1,153.87 L739.1,153.87 Z M739.1,213.79 C723.35,213.79 710.57,201.02 710.57,185.26 C710.57,169.5 723.34,156.73 739.1,156.73 C754.86,156.73 767.63,169.5 767.63,185.26 C767.63,201.02 754.85,213.79 739.1,213.79 L739.1,213.79 Z" id="Shape" fill="url(#linearGradient-3)"></path> + <g transform="translate(37.000000, 177.000000)"> + <circle id="Oval" fill="#5D5D5F" cx="8.04" cy="8.27" r="8"></circle> + <circle id="Oval" fill="url(#radialGradient-4)" cx="8.04" cy="8.27" r="8"></circle> + <circle id="Oval" fill="#1B1A1F" cx="8.04" cy="8.27" r="4.48"></circle> + <circle id="Oval" fill="#36284C" cx="8.04" cy="8.27" r="3.28"></circle> + <circle id="Oval" fill="url(#radialGradient-5)" cx="8.04" cy="8.27" r="3.28"></circle> + <g transform="translate(6.000000, 6.000000)" id="Oval"> + <circle fill="#141414" opacity="0.5" cx="2.04" cy="2.27" r="1.8"></circle> + <circle fill="url(#radialGradient-6)" cx="2.04" cy="2.27" r="1.8"></circle> + </g> + <path d="M8.04,6.91 C7.64,6.91 7.29,7.09 7.04,7.37 L7.46,7.79 C7.6,7.62 7.8,7.51 8.03,7.51 C8.27,7.51 8.47,7.63 8.61,7.81 L9.03,7.39 C8.8,7.1 8.44,6.91 8.04,6.91 L8.04,6.91 Z" id="Shape" fill="url(#linearGradient-7)"></path> + </g> + <g transform="translate(69.000000, 153.000000)" id="Clipped"> + <g> + <mask id="mask-9" fill="white"> + <use xlink:href="#path-8"></use> + </mask> + <g id="SVGID_8_"></g> + <path d="M8.84,2.95 L8.84,61.57 C8.84,63.94 6.92,65.86 4.55,65.86 L4.55,65.86 C2.18,65.86 0.26,63.94 0.26,61.57 L0.26,2.95 C0.26,0.58 2.18,-1.34 4.55,-1.34 L4.55,-1.34 C6.92,-1.34 8.84,0.58 8.84,2.95 L8.84,2.95 Z" id="Shape" fill="url(#linearGradient-10)" opacity="0.8" mask="url(#mask-9)"></path> + </g> + <g> + <mask id="mask-12" fill="white"> + <use xlink:href="#path-11"></use> + </mask> + <g id="SVGID_8_"></g> + <path d="M0.15,64.45 L0.15,65.92 L1.62,65.92 L1.62,64.45 L0.15,64.45 L0.15,64.45 Z M0.15,61.52 L0.15,62.99 L1.62,62.99 L1.62,61.52 L0.15,61.52 L0.15,61.52 Z M0.15,58.58 L0.15,60.05 L1.62,60.05 L1.62,58.58 L0.15,58.58 L0.15,58.58 Z M0.15,55.65 L0.15,57.12 L1.62,57.12 L1.62,55.65 L0.15,55.65 L0.15,55.65 Z M0.15,52.71 L0.15,54.18 L1.62,54.18 L1.62,52.71 L0.15,52.71 L0.15,52.71 Z M0.15,49.78 L0.15,51.25 L1.62,51.25 L1.62,49.78 L0.15,49.78 L0.15,49.78 Z M0.15,46.84 L0.15,48.31 L1.62,48.31 L1.62,46.84 L0.15,46.84 L0.15,46.84 Z M0.15,43.91 L0.15,45.38 L1.62,45.38 L1.62,43.91 L0.15,43.91 L0.15,43.91 Z M0.15,40.97 L0.15,42.44 L1.62,42.44 L1.62,40.97 L0.15,40.97 L0.15,40.97 Z M0.15,38.04 L0.15,39.51 L1.62,39.51 L1.62,38.04 L0.15,38.04 L0.15,38.04 Z M0.15,35.1 L0.15,36.57 L1.62,36.57 L1.62,35.1 L0.15,35.1 L0.15,35.1 Z M0.15,32.17 L0.15,33.64 L1.62,33.64 L1.62,32.17 L0.15,32.17 L0.15,32.17 Z M0.15,29.23 L0.15,30.7 L1.62,30.7 L1.62,29.23 L0.15,29.23 L0.15,29.23 Z M0.15,26.3 L0.15,27.77 L1.62,27.77 L1.62,26.3 L0.15,26.3 L0.15,26.3 Z M0.15,23.36 L0.15,24.83 L1.62,24.83 L1.62,23.36 L0.15,23.36 L0.15,23.36 Z M0.15,20.43 L0.15,21.9 L1.62,21.9 L1.62,20.43 L0.15,20.43 L0.15,20.43 Z M0.15,17.49 L0.15,18.96 L1.62,18.96 L1.62,17.49 L0.15,17.49 L0.15,17.49 Z M0.15,14.56 L0.15,16.03 L1.62,16.03 L1.62,14.56 L0.15,14.56 L0.15,14.56 Z M0.15,11.62 L0.15,13.09 L1.62,13.09 L1.62,11.62 L0.15,11.62 L0.15,11.62 Z M0.15,8.69 L0.15,10.16 L1.62,10.16 L1.62,8.69 L0.15,8.69 L0.15,8.69 Z M0.15,5.75 L0.15,7.22 L1.62,7.22 L1.62,5.75 L0.15,5.75 L0.15,5.75 Z M0.15,2.82 L0.15,4.29 L1.62,4.29 L1.62,2.82 L0.15,2.82 L0.15,2.82 Z M0.15,-0.12 L0.15,1.35 L1.62,1.35 L1.62,-0.12 L0.15,-0.12 L0.15,-0.12 Z M1.62,62.98 L1.62,64.45 L3.09,64.45 L3.09,62.98 L1.62,62.98 L1.62,62.98 Z M1.62,60.05 L1.62,61.52 L3.09,61.52 L3.09,60.05 L1.62,60.05 L1.62,60.05 Z M1.62,57.11 L1.62,58.58 L3.09,58.58 L3.09,57.11 L1.62,57.11 L1.62,57.11 Z M1.62,54.18 L1.62,55.65 L3.09,55.65 L3.09,54.18 L1.62,54.18 L1.62,54.18 Z M1.62,51.24 L1.62,52.71 L3.09,52.71 L3.09,51.24 L1.62,51.24 L1.62,51.24 Z M1.62,48.31 L1.62,49.78 L3.09,49.78 L3.09,48.31 L1.62,48.31 L1.62,48.31 Z M1.62,45.37 L1.62,46.84 L3.09,46.84 L3.09,45.37 L1.62,45.37 L1.62,45.37 Z M1.62,42.44 L1.62,43.91 L3.09,43.91 L3.09,42.44 L1.62,42.44 L1.62,42.44 Z M1.62,39.5 L1.62,40.97 L3.09,40.97 L3.09,39.5 L1.62,39.5 L1.62,39.5 Z M1.62,36.57 L1.62,38.04 L3.09,38.04 L3.09,36.57 L1.62,36.57 L1.62,36.57 Z M1.62,33.63 L1.62,35.1 L3.09,35.1 L3.09,33.63 L1.62,33.63 L1.62,33.63 Z M1.62,30.7 L1.62,32.17 L3.09,32.17 L3.09,30.7 L1.62,30.7 L1.62,30.7 Z M1.62,27.76 L1.62,29.23 L3.09,29.23 L3.09,27.76 L1.62,27.76 L1.62,27.76 Z M1.62,24.83 L1.62,26.3 L3.09,26.3 L3.09,24.83 L1.62,24.83 L1.62,24.83 Z M1.62,21.89 L1.62,23.36 L3.09,23.36 L3.09,21.89 L1.62,21.89 L1.62,21.89 Z M1.62,18.96 L1.62,20.43 L3.09,20.43 L3.09,18.96 L1.62,18.96 L1.62,18.96 Z M1.62,16.02 L1.62,17.49 L3.09,17.49 L3.09,16.02 L1.62,16.02 L1.62,16.02 Z M1.62,13.09 L1.62,14.56 L3.09,14.56 L3.09,13.09 L1.62,13.09 L1.62,13.09 Z M1.62,10.15 L1.62,11.62 L3.09,11.62 L3.09,10.15 L1.62,10.15 L1.62,10.15 Z M1.62,7.22 L1.62,8.69 L3.09,8.69 L3.09,7.22 L1.62,7.22 L1.62,7.22 Z M1.62,4.28 L1.62,5.75 L3.09,5.75 L3.09,4.28 L1.62,4.28 L1.62,4.28 Z M1.62,1.35 L1.62,2.82 L3.09,2.82 L3.09,1.35 L1.62,1.35 L1.62,1.35 Z M1.62,-1.59 L1.62,-0.12 L3.09,-0.12 L3.09,-1.59 L1.62,-1.59 L1.62,-1.59 Z M3.09,64.45 L3.09,65.92 L4.56,65.92 L4.56,64.45 L3.09,64.45 L3.09,64.45 Z M3.09,61.52 L3.09,62.99 L4.56,62.99 L4.56,61.52 L3.09,61.52 L3.09,61.52 Z M3.09,58.58 L3.09,60.05 L4.56,60.05 L4.56,58.58 L3.09,58.58 L3.09,58.58 Z M3.09,55.65 L3.09,57.12 L4.56,57.12 L4.56,55.65 L3.09,55.65 L3.09,55.65 Z M3.09,52.71 L3.09,54.18 L4.56,54.18 L4.56,52.71 L3.09,52.71 L3.09,52.71 Z M3.09,49.78 L3.09,51.25 L4.56,51.25 L4.56,49.78 L3.09,49.78 L3.09,49.78 Z M3.09,46.84 L3.09,48.31 L4.56,48.31 L4.56,46.84 L3.09,46.84 L3.09,46.84 Z M3.09,43.91 L3.09,45.38 L4.56,45.38 L4.56,43.91 L3.09,43.91 L3.09,43.91 Z M3.09,40.97 L3.09,42.44 L4.56,42.44 L4.56,40.97 L3.09,40.97 L3.09,40.97 Z M3.09,38.04 L3.09,39.51 L4.56,39.51 L4.56,38.04 L3.09,38.04 L3.09,38.04 Z M3.09,35.1 L3.09,36.57 L4.56,36.57 L4.56,35.1 L3.09,35.1 L3.09,35.1 Z M3.09,32.17 L3.09,33.64 L4.56,33.64 L4.56,32.17 L3.09,32.17 L3.09,32.17 Z M3.09,29.23 L3.09,30.7 L4.56,30.7 L4.56,29.23 L3.09,29.23 L3.09,29.23 Z M3.09,26.3 L3.09,27.77 L4.56,27.77 L4.56,26.3 L3.09,26.3 L3.09,26.3 Z M3.09,23.36 L3.09,24.83 L4.56,24.83 L4.56,23.36 L3.09,23.36 L3.09,23.36 Z M3.09,20.43 L3.09,21.9 L4.56,21.9 L4.56,20.43 L3.09,20.43 L3.09,20.43 Z M3.09,17.49 L3.09,18.96 L4.56,18.96 L4.56,17.49 L3.09,17.49 L3.09,17.49 Z M3.09,14.56 L3.09,16.03 L4.56,16.03 L4.56,14.56 L3.09,14.56 L3.09,14.56 Z M3.09,11.62 L3.09,13.09 L4.56,13.09 L4.56,11.62 L3.09,11.62 L3.09,11.62 Z M3.09,8.69 L3.09,10.16 L4.56,10.16 L4.56,8.69 L3.09,8.69 L3.09,8.69 Z M3.09,5.75 L3.09,7.22 L4.56,7.22 L4.56,5.75 L3.09,5.75 L3.09,5.75 Z M3.09,2.82 L3.09,4.29 L4.56,4.29 L4.56,2.82 L3.09,2.82 L3.09,2.82 Z M3.09,-0.12 L3.09,1.35 L4.56,1.35 L4.56,-0.12 L3.09,-0.12 L3.09,-0.12 Z M4.56,62.98 L4.56,64.45 L6.03,64.45 L6.03,62.98 L4.56,62.98 L4.56,62.98 Z M4.56,60.05 L4.56,61.52 L6.03,61.52 L6.03,60.05 L4.56,60.05 L4.56,60.05 Z M4.56,57.11 L4.56,58.58 L6.03,58.58 L6.03,57.11 L4.56,57.11 L4.56,57.11 Z M4.56,54.18 L4.56,55.65 L6.03,55.65 L6.03,54.18 L4.56,54.18 L4.56,54.18 Z M4.56,51.24 L4.56,52.71 L6.03,52.71 L6.03,51.24 L4.56,51.24 L4.56,51.24 Z M4.56,48.31 L4.56,49.78 L6.03,49.78 L6.03,48.31 L4.56,48.31 L4.56,48.31 Z M4.56,45.37 L4.56,46.84 L6.03,46.84 L6.03,45.37 L4.56,45.37 L4.56,45.37 Z M4.56,42.44 L4.56,43.91 L6.03,43.91 L6.03,42.44 L4.56,42.44 L4.56,42.44 Z M4.56,39.5 L4.56,40.97 L6.03,40.97 L6.03,39.5 L4.56,39.5 L4.56,39.5 Z M4.56,36.57 L4.56,38.04 L6.03,38.04 L6.03,36.57 L4.56,36.57 L4.56,36.57 Z M4.56,33.63 L4.56,35.1 L6.03,35.1 L6.03,33.63 L4.56,33.63 L4.56,33.63 Z M4.56,30.7 L4.56,32.17 L6.03,32.17 L6.03,30.7 L4.56,30.7 L4.56,30.7 Z M4.56,27.76 L4.56,29.23 L6.03,29.23 L6.03,27.76 L4.56,27.76 L4.56,27.76 Z M4.56,24.83 L4.56,26.3 L6.03,26.3 L6.03,24.83 L4.56,24.83 L4.56,24.83 Z M4.56,21.89 L4.56,23.36 L6.03,23.36 L6.03,21.89 L4.56,21.89 L4.56,21.89 Z M4.56,18.96 L4.56,20.43 L6.03,20.43 L6.03,18.96 L4.56,18.96 L4.56,18.96 Z M4.56,16.02 L4.56,17.49 L6.03,17.49 L6.03,16.02 L4.56,16.02 L4.56,16.02 Z M4.56,13.09 L4.56,14.56 L6.03,14.56 L6.03,13.09 L4.56,13.09 L4.56,13.09 Z M4.56,10.15 L4.56,11.62 L6.03,11.62 L6.03,10.15 L4.56,10.15 L4.56,10.15 Z M4.56,7.22 L4.56,8.69 L6.03,8.69 L6.03,7.22 L4.56,7.22 L4.56,7.22 Z M4.56,4.28 L4.56,5.75 L6.03,5.75 L6.03,4.28 L4.56,4.28 L4.56,4.28 Z M4.56,1.35 L4.56,2.82 L6.03,2.82 L6.03,1.35 L4.56,1.35 L4.56,1.35 Z M4.56,-1.59 L4.56,-0.12 L6.03,-0.12 L6.03,-1.59 L4.56,-1.59 L4.56,-1.59 Z M6.02,64.45 L6.02,65.92 L7.49,65.92 L7.49,64.45 L6.02,64.45 L6.02,64.45 Z M6.02,61.52 L6.02,62.99 L7.49,62.99 L7.49,61.52 L6.02,61.52 L6.02,61.52 Z M6.02,58.58 L6.02,60.05 L7.49,60.05 L7.49,58.58 L6.02,58.58 L6.02,58.58 Z M6.02,55.65 L6.02,57.12 L7.49,57.12 L7.49,55.65 L6.02,55.65 L6.02,55.65 Z M6.02,52.71 L6.02,54.18 L7.49,54.18 L7.49,52.71 L6.02,52.71 L6.02,52.71 Z M6.02,49.78 L6.02,51.25 L7.49,51.25 L7.49,49.78 L6.02,49.78 L6.02,49.78 Z M6.02,46.84 L6.02,48.31 L7.49,48.31 L7.49,46.84 L6.02,46.84 L6.02,46.84 Z M6.02,43.91 L6.02,45.38 L7.49,45.38 L7.49,43.91 L6.02,43.91 L6.02,43.91 Z M6.02,40.97 L6.02,42.44 L7.49,42.44 L7.49,40.97 L6.02,40.97 L6.02,40.97 Z M6.02,38.04 L6.02,39.51 L7.49,39.51 L7.49,38.04 L6.02,38.04 L6.02,38.04 Z M6.02,35.1 L6.02,36.57 L7.49,36.57 L7.49,35.1 L6.02,35.1 L6.02,35.1 Z M6.02,32.17 L6.02,33.64 L7.49,33.64 L7.49,32.17 L6.02,32.17 L6.02,32.17 Z M6.02,29.23 L6.02,30.7 L7.49,30.7 L7.49,29.23 L6.02,29.23 L6.02,29.23 Z M6.02,26.3 L6.02,27.77 L7.49,27.77 L7.49,26.3 L6.02,26.3 L6.02,26.3 Z M6.02,23.36 L6.02,24.83 L7.49,24.83 L7.49,23.36 L6.02,23.36 L6.02,23.36 Z M6.02,20.43 L6.02,21.9 L7.49,21.9 L7.49,20.43 L6.02,20.43 L6.02,20.43 Z M6.02,17.49 L6.02,18.96 L7.49,18.96 L7.49,17.49 L6.02,17.49 L6.02,17.49 Z M6.02,14.56 L6.02,16.03 L7.49,16.03 L7.49,14.56 L6.02,14.56 L6.02,14.56 Z M6.02,11.62 L6.02,13.09 L7.49,13.09 L7.49,11.62 L6.02,11.62 L6.02,11.62 Z M6.02,8.69 L6.02,10.16 L7.49,10.16 L7.49,8.69 L6.02,8.69 L6.02,8.69 Z M6.02,5.75 L6.02,7.22 L7.49,7.22 L7.49,5.75 L6.02,5.75 L6.02,5.75 Z M6.02,2.82 L6.02,4.29 L7.49,4.29 L7.49,2.82 L6.02,2.82 L6.02,2.82 Z M6.02,-0.12 L6.02,1.35 L7.49,1.35 L7.49,-0.12 L6.02,-0.12 L6.02,-0.12 Z M7.49,62.98 L7.49,64.45 L8.96,64.45 L8.96,62.98 L7.49,62.98 L7.49,62.98 Z M7.49,60.05 L7.49,61.52 L8.96,61.52 L8.96,60.05 L7.49,60.05 L7.49,60.05 Z M7.49,57.11 L7.49,58.58 L8.96,58.58 L8.96,57.11 L7.49,57.11 L7.49,57.11 Z M7.49,54.18 L7.49,55.65 L8.96,55.65 L8.96,54.18 L7.49,54.18 L7.49,54.18 Z M7.49,51.24 L7.49,52.71 L8.96,52.71 L8.96,51.24 L7.49,51.24 L7.49,51.24 Z M7.49,48.31 L7.49,49.78 L8.96,49.78 L8.96,48.31 L7.49,48.31 L7.49,48.31 Z M7.49,45.37 L7.49,46.84 L8.96,46.84 L8.96,45.37 L7.49,45.37 L7.49,45.37 Z M7.49,42.44 L7.49,43.91 L8.96,43.91 L8.96,42.44 L7.49,42.44 L7.49,42.44 Z M7.49,39.5 L7.49,40.97 L8.96,40.97 L8.96,39.5 L7.49,39.5 L7.49,39.5 Z M7.49,36.57 L7.49,38.04 L8.96,38.04 L8.96,36.57 L7.49,36.57 L7.49,36.57 Z M7.49,33.63 L7.49,35.1 L8.96,35.1 L8.96,33.63 L7.49,33.63 L7.49,33.63 Z M7.49,30.7 L7.49,32.17 L8.96,32.17 L8.96,30.7 L7.49,30.7 L7.49,30.7 Z M7.49,27.76 L7.49,29.23 L8.96,29.23 L8.96,27.76 L7.49,27.76 L7.49,27.76 Z M7.49,24.83 L7.49,26.3 L8.96,26.3 L8.96,24.83 L7.49,24.83 L7.49,24.83 Z M7.49,21.89 L7.49,23.36 L8.96,23.36 L8.96,21.89 L7.49,21.89 L7.49,21.89 Z M7.49,18.96 L7.49,20.43 L8.96,20.43 L8.96,18.96 L7.49,18.96 L7.49,18.96 Z M7.49,16.02 L7.49,17.49 L8.96,17.49 L8.96,16.02 L7.49,16.02 L7.49,16.02 Z M7.49,13.09 L7.49,14.56 L8.96,14.56 L8.96,13.09 L7.49,13.09 L7.49,13.09 Z M7.49,10.15 L7.49,11.62 L8.96,11.62 L8.96,10.15 L7.49,10.15 L7.49,10.15 Z M7.49,7.22 L7.49,8.69 L8.96,8.69 L8.96,7.22 L7.49,7.22 L7.49,7.22 Z M7.49,4.28 L7.49,5.75 L8.96,5.75 L8.96,4.28 L7.49,4.28 L7.49,4.28 Z M7.49,1.35 L7.49,2.82 L8.96,2.82 L8.96,1.35 L7.49,1.35 L7.49,1.35 Z M7.49,-1.59 L7.49,-0.12 L8.96,-0.12 L8.96,-1.59 L7.49,-1.59 L7.49,-1.59 Z" id="Shape" fill="#2E2E2E" mask="url(#mask-12)"></path> + </g> + <g> + <mask id="mask-14" fill="white"> + <use xlink:href="#path-13"></use> + </mask> + <g id="SVGID_8_"></g> + <path d="M-0.09,2.54 L-0.09,61.98 C-0.09,64.38 1.99,66.33 4.56,66.33 C7.13,66.33 9.21,64.38 9.21,61.98 L9.21,2.54 C9.21,0.14 7.13,-1.81 4.56,-1.81 C1.99,-1.81 -0.09,0.14 -0.09,2.54 L-0.09,2.54 Z M7.75,2.95 L7.75,61.57 C7.75,63.33 6.32,64.77 4.55,64.77 C2.78,64.77 1.35,63.34 1.35,61.57 L1.35,2.95 C1.35,1.19 2.78,-0.25 4.55,-0.25 C6.32,-0.25 7.75,1.19 7.75,2.95 L7.75,2.95 Z" id="Shape" fill="#000000" opacity="0.2" mask="url(#mask-14)"></path> + </g> + </g> + <rect id="Rectangle-path" fill="#000000" x="114.62" y="25.28" width="568" height="320"></rect> + </g> + </g> + </g> +</svg>
diff --git a/third_party/WebKit/Source/devtools/front_end/emulated_devices/iPhone5-portrait.svg b/third_party/WebKit/Source/devtools/front_end/emulated_devices/iPhone5-portrait.svg new file mode 100644 index 0000000..ab22302 --- /dev/null +++ b/third_party/WebKit/Source/devtools/front_end/emulated_devices/iPhone5-portrait.svg
@@ -0,0 +1,90 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg width="374px" height="795px" viewBox="0 0 374 795" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> + <title>iPhone 5</title> + <defs> + <linearGradient x1="58.9659534%" y1="48.080666%" x2="34.111078%" y2="53.3994176%" id="linearGradient-1"> + <stop stop-color="#3A3E3A" offset="8.860001%"></stop> + <stop stop-color="#2E332E" offset="34.31%"></stop> + <stop stop-color="#C0C1C2" offset="36%"></stop> + <stop stop-color="#3C3F3E" offset="51.34%"></stop> + <stop stop-color="#4B4E4B" offset="64.16%"></stop> + </linearGradient> + <linearGradient x1="-17.9960388%" y1="8.33030962%" x2="65.7898338%" y2="59.671955%" id="linearGradient-2"> + <stop stop-color="#787A81" offset="0%"></stop> + <stop stop-color="#50555D" offset="63.53%"></stop> + </linearGradient> + <linearGradient x1="86.4058917%" y1="91.8829618%" x2="14.0627389%" y2="8.61990446%" id="linearGradient-3"> + <stop stop-color="#FFFFFF" stop-opacity="0.3" offset="14.7%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0" offset="40.73%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0.00509108" offset="74.45%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0.2" offset="100%"></stop> + </linearGradient> + <radialGradient cx="50.490424%" cy="57.371957%" fx="50.490424%" fy="57.371957%" r="32.026875%" id="radialGradient-4"> + <stop stop-color="#000000" stop-opacity="0" offset="0%"></stop> + <stop stop-color="#020202" stop-opacity="0.4119" offset="51.49%"></stop> + <stop stop-color="#090909" stop-opacity="0.5603" offset="70.03%"></stop> + <stop stop-color="#141414" stop-opacity="0.666" offset="83.25%"></stop> + <stop stop-color="#252525" stop-opacity="0.7509" offset="93.87%"></stop> + <stop stop-color="#333333" stop-opacity="0.8" offset="100%"></stop> + </radialGradient> + <radialGradient cx="47.9198485%" cy="96.651617%" fx="47.9198485%" fy="96.651617%" r="60.9878788%" id="radialGradient-5"> + <stop stop-color="#FFFFFF" stop-opacity="0.3" offset="0%"></stop> + <stop stop-color="#000000" stop-opacity="0" offset="100%"></stop> + </radialGradient> + <radialGradient cx="51.1128422%" cy="24.9366133%" fx="51.1128422%" fy="24.9366133%" r="36.9055556%" id="radialGradient-6"> + <stop stop-color="#FFFFFF" stop-opacity="0.3" offset="0%"></stop> + <stop stop-color="#000000" stop-opacity="0" offset="100%"></stop> + </radialGradient> + <linearGradient x1="50.25%" y1="5.34%" x2="50.25%" y2="97.86%" id="linearGradient-7"> + <stop stop-color="#FFFFFF" stop-opacity="0.6" offset="0%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0.1" offset="100%"></stop> + </linearGradient> + <linearGradient x1="-13.4283698%" y1="16.8838122%" x2="28.9472124%" y2="39.0002762%" id="linearGradient-8"> + <stop stop-color="#FFFFFF" stop-opacity="0.15" offset="0%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0" offset="100%"></stop> + </linearGradient> + <linearGradient x1="50.0148322%" y1="100.475178%" x2="50.0148322%" y2="0.707893372%" id="linearGradient-9"> + <stop stop-color="#2E2E31" offset="0%"></stop> + <stop stop-color="#616161" offset="24.48%"></stop> + <stop stop-color="#858585" offset="81.37%"></stop> + <stop stop-color="#2E2E31" offset="100%"></stop> + </linearGradient> + </defs> + <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> + <g id="iphone5-portrait"> + <g id="Group"> + <path d="M6.1,141.1 L2.4,141.1 C1.4,141.1 0.6,140.3 0.6,139.3 L0.6,108.7 C0.6,107.7 1.4,106.9 2.4,106.9 L6.1,106.9 L6.1,141.1 L6.1,141.1 L6.1,141.1 Z" id="Shape" fill="#808086"></path> + <path d="M244.4,5.7 L244.4,2 C244.4,1 245.2,0.2 246.2,0.2 L301.8,0.2 C302.8,0.2 303.6,1 303.6,2 L303.6,5.7 L244.4,5.7 L244.4,5.7 Z" id="Shape" fill="#808086"></path> + <path d="M0.8,182.4 C0.8,181.4 1.6,180.5 2.7,180.5 L6.4,180.5 L6.4,208.6 L2.7,208.6 C1.7,208.6 0.8,207.8 0.8,206.7 L0.8,182.4 L0.8,182.4 L0.8,182.4 Z" id="Shape" fill="#808086"></path> + <path d="M0.8,248.8 C0.8,247.8 1.6,246.9 2.7,246.9 L6.4,246.9 L6.4,275 L2.7,275 C1.7,275 0.8,274.2 0.8,273.1 L0.8,248.8 L0.8,248.8 L0.8,248.8 Z" id="Shape" fill="#808086"></path> + <path d="M60.6,794.7 C29.4,794.7 4,769.3 4,738.1 L4,61.5 C4,30.3 29.4,4.9 60.6,4.9 L316.6,4.9 C347.8,4.9 373.2,30.3 373.2,61.5 L373.2,738.1 C373.2,769.3 347.8,794.7 316.6,794.7 L60.6,794.7 L60.6,794.7 Z" id="Shape" fill="url(#linearGradient-1)"></path> + <path d="M60.6,790.6 C31.7,790.6 8.1,767.1 8.1,738.1 L8.1,61.5 C8.1,32.5 31.7,9 60.6,9 L316.6,9 C345.6,9 369.1,32.5 369.1,61.5 L369.1,738.1 C369.1,767.1 345.6,790.6 316.6,790.6 L60.6,790.6 L60.6,790.6 L60.6,790.6 Z" id="Shape" fill="url(#linearGradient-2)"></path> + <rect id="Rectangle-path" fill="#2E2E2E" x="4" y="72" width="6.7" height="6"></rect> + <rect id="Rectangle-path" fill="#1F1F1F" x="366.5" y="72" width="6.7" height="6"></rect> + <rect id="Rectangle-path" fill="#2E2E2E" x="4" y="721.2" width="6.7" height="6"></rect> + <rect id="Rectangle-path" fill="#1F1F1F" x="366.5" y="721.2" width="6.7" height="6"></rect> + <path d="M60.6,788 C33.1,788 10.7,765.6 10.7,738 L10.7,61.5 C10.7,34 33.1,11.5 60.6,11.5 L316.6,11.5 C344.1,11.5 366.6,33.9 366.6,61.5 L366.6,738.1 C366.6,765.6 344.2,788.1 316.6,788.1 L60.6,788 L60.6,788 L60.6,788 Z" id="Shape" fill="#232323"></path> + <path d="M188.6,707.1 C171.3,707.1 157.2,721.2 157.2,738.5 C157.2,755.8 171.3,769.9 188.6,769.9 C205.9,769.9 220,755.8 220,738.5 C220,721.2 205.9,707.1 188.6,707.1 L188.6,707.1 Z M188.6,767 C172.8,767 160.1,754.2 160.1,738.5 C160.1,722.7 172.9,710 188.6,710 C204.3,710 217.1,722.8 217.1,738.5 C217.1,754.2 204.4,767 188.6,767 L188.6,767 Z" id="Shape" fill="url(#linearGradient-3)"></path> + <g transform="translate(180.000000, 36.000000)"> + <circle id="Oval" fill="#5D5D5F" cx="8.6" cy="8.4" r="8"></circle> + <circle id="Oval" fill="url(#radialGradient-4)" cx="8.6" cy="8.4" r="8"></circle> + <circle id="Oval" fill="#1B1A1F" cx="8.6" cy="8.4" r="4.5"></circle> + <circle id="Oval" fill="#36284C" cx="8.6" cy="8.4" r="3.3"></circle> + <circle id="Oval" fill="url(#radialGradient-5)" cx="8.6" cy="8.4" r="3.3"></circle> + <g transform="translate(6.000000, 6.000000)" id="Oval"> + <circle fill="#141414" opacity="0.5" cx="2.6" cy="2.4" r="1.8"></circle> + <circle fill="url(#radialGradient-6)" cx="2.6" cy="2.4" r="1.8"></circle> + </g> + <path d="M8.6,7.1 C8.2,7.1 7.8,7.3 7.6,7.6 L8,8 C8.1,7.8 8.3,7.7 8.6,7.7 C8.8,7.7 9,7.8 9.2,8 L9.6,7.6 C9.4,7.3 9,7.1 8.6,7.1 L8.6,7.1 Z" id="Shape" fill="url(#linearGradient-7)"></path> + </g> + <path d="M60.6,11.6 C33.1,11.6 10.7,34 10.7,61.6 L10.7,554.6 L294.1,11.6 L60.6,11.6 L60.6,11.6 Z" id="Shape" fill="url(#linearGradient-8)"></path> + <g transform="translate(154.000000, 68.000000)" id="Shape"> + <path d="M63.9,9.2 L5.3,9.2 C2.9,9.2 1,7.3 1,4.9 L1,4.9 C1,2.5 2.9,0.6 5.3,0.6 L63.9,0.6 C66.3,0.6 68.2,2.5 68.2,4.9 L68.2,4.9 C68.2,7.3 66.3,9.2 63.9,9.2 L63.9,9.2 Z" fill="url(#linearGradient-9)" opacity="0.8"></path> + <path d="M2.4,0.6 L0.9,0.6 L0.9,2 L2.4,2 L2.4,0.6 L2.4,0.6 Z M5.4,0.6 L3.9,0.6 L3.9,2 L5.4,2 L5.4,0.6 L5.4,0.6 Z M8.3,0.6 L6.8,0.6 L6.8,2 L8.3,2 L8.3,0.6 L8.3,0.6 Z M11.2,0.6 L9.7,0.6 L9.7,2 L11.2,2 L11.2,0.6 L11.2,0.6 Z M14.2,0.6 L12.7,0.6 L12.7,2 L14.2,2 L14.2,0.6 L14.2,0.6 Z M17.1,0.6 L15.6,0.6 L15.6,2 L17.1,2 L17.1,0.6 L17.1,0.6 Z M20,0.6 L18.5,0.6 L18.5,2 L20,2 L20,0.6 L20,0.6 Z M23,0.6 L21.5,0.6 L21.5,2 L23,2 L23,0.6 L23,0.6 Z M25.9,0.6 L24.4,0.6 L24.4,2 L25.9,2 L25.9,0.6 L25.9,0.6 Z M28.8,0.6 L27.3,0.6 L27.3,2 L28.8,2 L28.8,0.6 L28.8,0.6 Z M31.8,0.6 L30.3,0.6 L30.3,2 L31.8,2 L31.8,0.6 L31.8,0.6 Z M34.7,0.6 L33.2,0.6 L33.2,2 L34.7,2 L34.7,0.6 L34.7,0.6 Z M37.6,0.6 L36.1,0.6 L36.1,2 L37.6,2 L37.6,0.6 L37.6,0.6 Z M40.6,0.6 L39.1,0.6 L39.1,2 L40.6,2 L40.6,0.6 L40.6,0.6 Z M43.5,0.6 L42,0.6 L42,2 L43.5,2 L43.5,0.6 L43.5,0.6 Z M46.4,0.6 L45,0.6 L45,2 L46.5,2 L46.5,0.6 L46.4,0.6 Z M49.4,0.6 L47.9,0.6 L47.9,2 L49.4,2 L49.4,0.6 L49.4,0.6 Z M52.3,0.6 L50.8,0.6 L50.8,2 L52.3,2 L52.3,0.6 L52.3,0.6 Z M55.2,0.6 L53.7,0.6 L53.7,2 L55.2,2 L55.2,0.6 L55.2,0.6 Z M58.2,0.6 L56.7,0.6 L56.7,2 L58.2,2 L58.2,0.6 L58.2,0.6 Z M61.1,0.6 L59.6,0.6 L59.6,2 L61.1,2 L61.1,0.6 L61.1,0.6 Z M64.1,0.6 L62.6,0.6 L62.6,2 L64.1,2 L64.1,0.6 L64.1,0.6 Z M67,0.6 L65.5,0.6 L65.5,2 L67,2 L67,0.6 L67,0.6 Z M3.9,2 L2.4,2 L2.4,3.5 L3.9,3.5 L3.9,2 L3.9,2 Z M6.8,2 L5.3,2 L5.3,3.5 L6.8,3.5 L6.8,2 L6.8,2 Z M9.8,2 L8.3,2 L8.3,3.5 L9.8,3.5 L9.8,2 L9.8,2 Z M12.7,2 L11.2,2 L11.2,3.5 L12.7,3.5 L12.7,2 L12.7,2 Z M15.6,2 L14.1,2 L14.1,3.5 L15.6,3.5 L15.6,2 L15.6,2 Z M18.6,2 L17.1,2 L17.1,3.5 L18.6,3.5 L18.6,2 L18.6,2 Z M21.5,2 L20,2 L20,3.5 L21.5,3.5 L21.5,2 L21.5,2 Z M24.4,2 L23,2 L23,3.5 L24.5,3.5 L24.5,2 L24.4,2 Z M27.4,2 L25.9,2 L25.9,3.5 L27.4,3.5 L27.4,2 L27.4,2 Z M30.3,2 L28.8,2 L28.8,3.5 L30.3,3.5 L30.3,2 L30.3,2 Z M33.2,2 L31.7,2 L31.7,3.5 L33.2,3.5 L33.2,2 L33.2,2 Z M36.2,2 L34.7,2 L34.7,3.5 L36.2,3.5 L36.2,2 L36.2,2 Z M39.1,2 L37.6,2 L37.6,3.5 L39.1,3.5 L39.1,2 L39.1,2 Z M42,2 L40.5,2 L40.5,3.5 L42,3.5 L42,2 L42,2 Z M45,2 L43.5,2 L43.5,3.5 L45,3.5 L45,2 L45,2 Z M47.9,2 L46.4,2 L46.4,3.5 L47.9,3.5 L47.9,2 L47.9,2 Z M50.9,2 L49.4,2 L49.4,3.5 L50.9,3.5 L50.9,2 L50.9,2 Z M53.8,2 L52.3,2 L52.3,3.5 L53.8,3.5 L53.8,2 L53.8,2 Z M56.7,2 L55.2,2 L55.2,3.5 L56.7,3.5 L56.7,2 L56.7,2 Z M59.6,2 L58.1,2 L58.1,3.5 L59.6,3.5 L59.6,2 L59.6,2 Z M62.6,2 L61.1,2 L61.1,3.5 L62.6,3.5 L62.6,2 L62.6,2 Z M65.5,2 L64,2 L64,3.5 L65.5,3.5 L65.5,2 L65.5,2 Z M68.5,2 L67,2 L67,3.5 L68.5,3.5 L68.5,2 L68.5,2 Z M2.4,3.5 L0.9,3.5 L0.9,5 L2.4,5 L2.4,3.5 L2.4,3.5 Z M5.4,3.5 L3.9,3.5 L3.9,5 L5.4,5 L5.4,3.5 L5.4,3.5 Z M8.3,3.5 L6.8,3.5 L6.8,5 L8.3,5 L8.3,3.5 L8.3,3.5 Z M11.2,3.5 L9.7,3.5 L9.7,5 L11.2,5 L11.2,3.5 L11.2,3.5 Z M14.2,3.5 L12.7,3.5 L12.7,5 L14.2,5 L14.2,3.5 L14.2,3.5 Z M17.1,3.5 L15.6,3.5 L15.6,5 L17.1,5 L17.1,3.5 L17.1,3.5 Z M20,3.5 L18.5,3.5 L18.5,5 L20,5 L20,3.5 L20,3.5 Z M23,3.5 L21.5,3.5 L21.5,5 L23,5 L23,3.5 L23,3.5 Z M25.9,3.5 L24.4,3.5 L24.4,5 L25.9,5 L25.9,3.5 L25.9,3.5 Z M28.8,3.5 L27.3,3.5 L27.3,5 L28.8,5 L28.8,3.5 L28.8,3.5 Z M31.8,3.5 L30.3,3.5 L30.3,5 L31.8,5 L31.8,3.5 L31.8,3.5 Z M34.7,3.5 L33.2,3.5 L33.2,5 L34.7,5 L34.7,3.5 L34.7,3.5 Z M37.6,3.5 L36.1,3.5 L36.1,5 L37.6,5 L37.6,3.5 L37.6,3.5 Z M40.6,3.5 L39.1,3.5 L39.1,5 L40.6,5 L40.6,3.5 L40.6,3.5 Z M43.5,3.5 L42,3.5 L42,5 L43.5,5 L43.5,3.5 L43.5,3.5 Z M46.4,3.5 L45,3.5 L45,5 L46.5,5 L46.5,3.5 L46.4,3.5 Z M49.4,3.5 L47.9,3.5 L47.9,5 L49.4,5 L49.4,3.5 L49.4,3.5 Z M52.3,3.5 L50.8,3.5 L50.8,5 L52.3,5 L52.3,3.5 L52.3,3.5 Z M55.2,3.5 L53.7,3.5 L53.7,5 L55.2,5 L55.2,3.5 L55.2,3.5 Z M58.2,3.5 L56.7,3.5 L56.7,5 L58.2,5 L58.2,3.5 L58.2,3.5 Z M61.1,3.5 L59.6,3.5 L59.6,5 L61.1,5 L61.1,3.5 L61.1,3.5 Z M64.1,3.5 L62.6,3.5 L62.6,5 L64.1,5 L64.1,3.5 L64.1,3.5 Z M67,3.5 L65.5,3.5 L65.5,5 L67,5 L67,3.5 L67,3.5 Z M3.9,5 L2.4,5 L2.4,6.5 L3.9,6.5 L3.9,5 L3.9,5 Z M6.8,5 L5.3,5 L5.3,6.5 L6.8,6.5 L6.8,5 L6.8,5 Z M9.8,5 L8.3,5 L8.3,6.5 L9.8,6.5 L9.8,5 L9.8,5 Z M12.7,5 L11.2,5 L11.2,6.5 L12.7,6.5 L12.7,5 L12.7,5 Z M15.6,5 L14.1,5 L14.1,6.5 L15.6,6.5 L15.6,5 L15.6,5 Z M18.6,5 L17.1,5 L17.1,6.5 L18.6,6.5 L18.6,5 L18.6,5 Z M21.5,5 L20,5 L20,6.5 L21.5,6.5 L21.5,5 L21.5,5 Z M24.4,5 L23,5 L23,6.5 L24.5,6.5 L24.5,5 L24.4,5 Z M27.4,5 L25.9,5 L25.9,6.5 L27.4,6.5 L27.4,5 L27.4,5 Z M30.3,5 L28.8,5 L28.8,6.5 L30.3,6.5 L30.3,5 L30.3,5 Z M33.2,5 L31.7,5 L31.7,6.5 L33.2,6.5 L33.2,5 L33.2,5 Z M36.2,5 L34.7,5 L34.7,6.5 L36.2,6.5 L36.2,5 L36.2,5 Z M39.1,5 L37.6,5 L37.6,6.5 L39.1,6.5 L39.1,5 L39.1,5 Z M42,5 L40.5,5 L40.5,6.5 L42,6.5 L42,5 L42,5 Z M45,5 L43.5,5 L43.5,6.5 L45,6.5 L45,5 L45,5 Z M47.9,5 L46.4,5 L46.4,6.5 L47.9,6.5 L47.9,5 L47.9,5 Z M50.9,5 L49.4,5 L49.4,6.5 L50.9,6.5 L50.9,5 L50.9,5 Z M53.8,5 L52.3,5 L52.3,6.5 L53.8,6.5 L53.8,5 L53.8,5 Z M56.7,5 L55.2,5 L55.2,6.5 L56.7,6.5 L56.7,5 L56.7,5 Z M59.6,5 L58.1,5 L58.1,6.5 L59.6,6.5 L59.6,5 L59.6,5 Z M62.6,5 L61.1,5 L61.1,6.5 L62.6,6.5 L62.6,5 L62.6,5 Z M65.5,5 L64,5 L64,6.5 L65.5,6.5 L65.5,5 L65.5,5 Z M68.5,5 L67,5 L67,6.5 L68.5,6.5 L68.5,5 L68.5,5 Z M2.4,6.4 L0.9,6.4 L0.9,7.9 L2.4,7.9 L2.4,6.4 L2.4,6.4 Z M5.4,6.4 L3.9,6.4 L3.9,7.9 L5.4,7.9 L5.4,6.4 L5.4,6.4 Z M8.3,6.4 L6.8,6.4 L6.8,7.9 L8.3,7.9 L8.3,6.4 L8.3,6.4 Z M11.2,6.4 L9.7,6.4 L9.7,7.9 L11.2,7.9 L11.2,6.4 L11.2,6.4 Z M14.2,6.4 L12.7,6.4 L12.7,7.9 L14.2,7.9 L14.2,6.4 L14.2,6.4 Z M17.1,6.4 L15.6,6.4 L15.6,7.9 L17.1,7.9 L17.1,6.4 L17.1,6.4 Z M20,6.4 L18.5,6.4 L18.5,7.9 L20,7.9 L20,6.4 L20,6.4 Z M23,6.4 L21.5,6.4 L21.5,7.9 L23,7.9 L23,6.4 L23,6.4 Z M25.9,6.4 L24.4,6.4 L24.4,7.9 L25.9,7.9 L25.9,6.4 L25.9,6.4 Z M28.8,6.4 L27.3,6.4 L27.3,7.9 L28.8,7.9 L28.8,6.4 L28.8,6.4 Z M31.8,6.4 L30.3,6.4 L30.3,7.9 L31.8,7.9 L31.8,6.4 L31.8,6.4 Z M34.7,6.4 L33.2,6.4 L33.2,7.9 L34.7,7.9 L34.7,6.4 L34.7,6.4 Z M37.6,6.4 L36.1,6.4 L36.1,7.9 L37.6,7.9 L37.6,6.4 L37.6,6.4 Z M40.6,6.4 L39.1,6.4 L39.1,7.9 L40.6,7.9 L40.6,6.4 L40.6,6.4 Z M43.5,6.4 L42,6.4 L42,7.9 L43.5,7.9 L43.5,6.4 L43.5,6.4 Z M46.4,6.4 L45,6.4 L45,7.9 L46.5,7.9 L46.5,6.4 L46.4,6.4 Z M49.4,6.4 L47.9,6.4 L47.9,7.9 L49.4,7.9 L49.4,6.4 L49.4,6.4 Z M52.3,6.4 L50.8,6.4 L50.8,7.9 L52.3,7.9 L52.3,6.4 L52.3,6.4 Z M55.2,6.4 L53.7,6.4 L53.7,7.9 L55.2,7.9 L55.2,6.4 L55.2,6.4 Z M58.2,6.4 L56.7,6.4 L56.7,7.9 L58.2,7.9 L58.2,6.4 L58.2,6.4 Z M61.1,6.4 L59.6,6.4 L59.6,7.9 L61.1,7.9 L61.1,6.4 L61.1,6.4 Z M64.1,6.4 L62.6,6.4 L62.6,7.9 L64.1,7.9 L64.1,6.4 L64.1,6.4 Z M67,6.4 L65.5,6.4 L65.5,7.9 L67,7.9 L67,6.4 L67,6.4 Z M3.9,7.9 L2.4,7.9 L2.4,9.4 L3.9,9.4 L3.9,7.9 L3.9,7.9 Z M6.8,7.9 L5.3,7.9 L5.3,9.4 L6.8,9.4 L6.8,7.9 L6.8,7.9 Z M9.8,7.9 L8.3,7.9 L8.3,9.4 L9.8,9.4 L9.8,7.9 L9.8,7.9 Z M12.7,7.9 L11.2,7.9 L11.2,9.4 L12.7,9.4 L12.7,7.9 L12.7,7.9 Z M15.6,7.9 L14.1,7.9 L14.1,9.4 L15.6,9.4 L15.6,7.9 L15.6,7.9 Z M18.6,7.9 L17.1,7.9 L17.1,9.4 L18.6,9.4 L18.6,7.9 L18.6,7.9 Z M21.5,7.9 L20,7.9 L20,9.4 L21.5,9.4 L21.5,7.9 L21.5,7.9 Z M24.4,7.9 L23,7.9 L23,9.4 L24.5,9.4 L24.5,7.9 L24.4,7.9 Z M27.4,7.9 L25.9,7.9 L25.9,9.4 L27.4,9.4 L27.4,7.9 L27.4,7.9 Z M30.3,7.9 L28.8,7.9 L28.8,9.4 L30.3,9.4 L30.3,7.9 L30.3,7.9 Z M33.2,7.9 L31.7,7.9 L31.7,9.4 L33.2,9.4 L33.2,7.9 L33.2,7.9 Z M36.2,7.9 L34.7,7.9 L34.7,9.4 L36.2,9.4 L36.2,7.9 L36.2,7.9 Z M39.1,7.9 L37.6,7.9 L37.6,9.4 L39.1,9.4 L39.1,7.9 L39.1,7.9 Z M42,7.9 L40.5,7.9 L40.5,9.4 L42,9.4 L42,7.9 L42,7.9 Z M45,7.9 L43.5,7.9 L43.5,9.4 L45,9.4 L45,7.9 L45,7.9 Z M47.9,7.9 L46.4,7.9 L46.4,9.4 L47.9,9.4 L47.9,7.9 L47.9,7.9 Z M50.9,7.9 L49.4,7.9 L49.4,9.4 L50.9,9.4 L50.9,7.9 L50.9,7.9 Z M53.8,7.9 L52.3,7.9 L52.3,9.4 L53.8,9.4 L53.8,7.9 L53.8,7.9 Z M56.7,7.9 L55.2,7.9 L55.2,9.4 L56.7,9.4 L56.7,7.9 L56.7,7.9 Z M59.6,7.9 L58.1,7.9 L58.1,9.4 L59.6,9.4 L59.6,7.9 L59.6,7.9 Z M62.6,7.9 L61.1,7.9 L61.1,9.4 L62.6,9.4 L62.6,7.9 L62.6,7.9 Z M65.5,7.9 L64,7.9 L64,9.4 L65.5,9.4 L65.5,7.9 L65.5,7.9 Z M68.5,7.9 L67,7.9 L67,9.4 L68.5,9.4 L68.5,7.9 L68.5,7.9 Z" fill="#2E2E2E"></path> + <path d="M64.3,0.3 L4.9,0.3 C2.5,0.3 0.5,2.4 0.5,5 C0.5,7.6 2.4,9.7 4.9,9.7 L64.3,9.7 C66.7,9.7 68.7,7.6 68.7,5 C68.7,2.4 66.7,0.3 64.3,0.3 L64.3,0.3 Z M63.9,8.2 L5.3,8.2 C3.5,8.2 2.1,6.8 2.1,5 C2.1,3.2 3.5,1.8 5.3,1.8 L63.9,1.8 C65.7,1.8 67.1,3.2 67.1,5 C67.1,6.8 65.7,8.2 63.9,8.2 L63.9,8.2 Z" fill="#000000" opacity="0.2"></path> + </g> + </g> + <rect id="Rectangle-path" x="28.5" y="114.7" width="320" height="568"></rect> + </g> + </g> +</svg>
diff --git a/third_party/WebKit/Source/devtools/front_end/emulated_devices/iPhone6-landscape.svg b/third_party/WebKit/Source/devtools/front_end/emulated_devices/iPhone6-landscape.svg new file mode 100644 index 0000000..e31a3ad --- /dev/null +++ b/third_party/WebKit/Source/devtools/front_end/emulated_devices/iPhone6-landscape.svg
@@ -0,0 +1,111 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg width="877px" height="431px" viewBox="0 0 877 431" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> + <title>iPhone 6</title> + <defs> + <linearGradient x1="0.0488611431%" y1="49.9939431%" x2="100.048698%" y2="49.9939431%" id="linearGradient-1"> + <stop stop-color="#FFFFFF" stop-opacity="0.15" offset="0%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0" offset="11.69%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0.00509108" offset="87.64%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0.15" offset="100%"></stop> + </linearGradient> + <linearGradient x1="4.88777959%" y1="-1.77197921%" x2="92.2732759%" y2="98.5008115%" id="linearGradient-2"> + <stop stop-color="#FFFFFF" stop-opacity="0.15" offset="0%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0.05" offset="13.73%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0.02" offset="88.31%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0.15" offset="100%"></stop> + </linearGradient> + <radialGradient cx="49.8666667%" cy="50.0666667%" fx="49.8666667%" fy="50.0666667%" r="50.3333333%" id="radialGradient-3"> + <stop stop-color="#5D5D5F" offset="0%"></stop> + <stop stop-color="#333333" stop-opacity="0.8" offset="100%"></stop> + </radialGradient> + <radialGradient cx="50.2859018%" cy="57.2416319%" fx="50.2859018%" fy="57.2416319%" r="50.3093333%" id="radialGradient-4"> + <stop stop-color="#000000" stop-opacity="0" offset="0%"></stop> + <stop stop-color="#020202" stop-opacity="0.4119" offset="51.49%"></stop> + <stop stop-color="#090909" stop-opacity="0.5603" offset="70.03%"></stop> + <stop stop-color="#141414" stop-opacity="0.666" offset="83.25%"></stop> + <stop stop-color="#252525" stop-opacity="0.7509" offset="93.87%"></stop> + <stop stop-color="#333333" stop-opacity="0.8" offset="100%"></stop> + </radialGradient> + <radialGradient cx="47.3819749%" cy="96.2966269%" fx="47.3819749%" fy="96.2966269%" r="95.1905405%" id="radialGradient-5"> + <stop stop-color="#FFFFFF" stop-opacity="0.3" offset="0%"></stop> + <stop stop-color="#000000" stop-opacity="0" offset="100%"></stop> + </radialGradient> + <radialGradient cx="50.1335915%" cy="23.9526238%" fx="50.1335915%" fy="23.9526238%" r="58.1475%" id="radialGradient-6"> + <stop stop-color="#FFFFFF" stop-opacity="0.3" offset="0%"></stop> + <stop stop-color="#000000" stop-opacity="0" offset="100%"></stop> + </radialGradient> + <linearGradient x1="46.7389949%" y1="7.21719595%" x2="46.7408363%" y2="111.047196%" id="linearGradient-7"> + <stop stop-color="#FFFFFF" stop-opacity="0.6" offset="0%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0.1" offset="100%"></stop> + </linearGradient> + <path id="path-8" d="M8.7,5.1 L8.7,63.7 C8.7,66.1 6.8,68 4.4,68 L4.4,68 C2,68 0.1,66.1 0.1,63.7 L0.1,5.1 C0.1,2.7 2,0.8 4.4,0.8 L4.4,0.8 C6.8,0.8 8.7,2.7 8.7,5.1 L8.7,5.1 Z"></path> + <linearGradient x1="100.754874%" y1="49.9921131%" x2="0.987588915%" y2="49.9921131%" id="linearGradient-10"> + <stop stop-color="#2E2E31" offset="0%"></stop> + <stop stop-color="#616161" offset="24.48%"></stop> + <stop stop-color="#858585" offset="81.37%"></stop> + <stop stop-color="#2E2E31" offset="100%"></stop> + </linearGradient> + <path id="path-11" d="M8.7,5.1 L8.7,63.7 C8.7,66.1 6.8,68 4.4,68 L4.4,68 C2,68 0.1,66.1 0.1,63.7 L0.1,5.1 C0.1,2.7 2,0.8 4.4,0.8 L4.4,0.8 C6.8,0.8 8.7,2.7 8.7,5.1 L8.7,5.1 Z"></path> + <path id="path-13" d="M8.7,5.1 L8.7,63.7 C8.7,66.1 6.8,68 4.4,68 L4.4,68 C2,68 0.1,66.1 0.1,63.7 L0.1,5.1 C0.1,2.7 2,0.8 4.4,0.8 L4.4,0.8 C6.8,0.8 8.7,2.7 8.7,5.1 L8.7,5.1 Z"></path> + <linearGradient x1="86.3832317%" y1="92.0344512%" x2="13.9727134%" y2="8.69390244%" id="linearGradient-15"> + <stop stop-color="#FFFFFF" stop-opacity="0.3" offset="14.7%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0" offset="40.73%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0.00509108" offset="74.45%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0.2" offset="100%"></stop> + </linearGradient> + </defs> + <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> + <g id="iphone6-landscape"> + <g id="Group"> + <g> + <path d="M145.2,424.8 L145.2,428.5 C145.2,429.5 144.4,430.4 143.3,430.4 L113.3,430.4 C112.3,430.4 111.4,429.6 111.4,428.5 L111.4,424.8 L145.2,424.8 L145.2,424.8 Z" id="Shape" fill="#808086"></path> + <path d="M190.5,430.4 C189.5,430.4 188.6,429.6 188.6,428.5 L188.6,424.8 L249.7,424.8 L249.7,428.5 C249.7,429.5 248.9,430.4 247.8,430.4" id="Shape" fill="#808086"></path> + <path d="M188,6.2 L188,2.5 C188,1.5 188.8,0.6 189.9,0.6 L247.3,0.6 C248.3,0.6 249.2,1.4 249.2,2.5 L249.2,6.2 L188,6.2 L188,6.2 Z" id="Shape" fill="#818187"></path> + <path d="M329.5,424.8 L329.5,428.5 C329.5,429.5 328.7,430.4 327.6,430.4 L270.2,430.4 C269.2,430.4 268.3,429.6 268.3,428.5 L268.3,424.8 L329.5,424.8 L329.5,424.8 Z" id="Shape" fill="#808086"></path> + <path d="M65.7,427.9 C29.9,427.9 0.8,398.8 0.8,363 L0.8,68.5 C0.8,32.7 29.9,3.6 65.7,3.6 L811.4,3.6 C847.2,3.6 876.3,32.7 876.3,68.5 L876.3,363 C876.3,398.8 847.2,427.9 811.4,427.9 L65.7,427.9 L65.7,427.9 Z" id="Shape" stroke="#666666" fill="#B2B2B2"></path> + <path d="M871.1,363.2 C871.1,379.1 864.9,394.1 853.6,405.3 C842.4,416.5 827.4,422.8 811.5,422.8 L65.5,422.8 C49.6,422.8 34.6,416.6 23.4,405.3 C12.2,394.1 5.9,379.1 5.9,363.2 L5.9,68.4 C5.9,52.5 12.1,37.5 23.4,26.3 C34.6,15 49.6,8.8 65.5,8.8 L811.5,8.8 C827.4,8.8 842.4,15 853.6,26.3 C864.8,37.5 871.1,52.5 871.1,68.4 L871.1,363.2 L871.1,363.2 L871.1,363.2 Z" id="Shape" fill="#404040"></path> + <path d="M871.3,68.5 L871.3,363 C871.3,396.1 844.5,422.9 811.4,422.9 L65.7,422.9 C32.6,422.9 5.8,396.1 5.8,363 L5.8,68.5 C5.8,35.4 32.6,8.6 65.7,8.6 L811.4,8.6 C844.4,8.6 871.3,35.4 871.3,68.5 L871.3,68.5 Z" id="Shape" fill="#262626"></path> + <path d="M5.7,68.4 L5.7,363.2 C5.7,396.2 32.5,423 65.5,423 L67.1,423 C34.1,423 7.3,396.2 7.3,363.2 L7.3,68.4 C7.3,35.4 34.1,8.6 67.1,8.6 L65.5,8.6 C32.5,8.6 5.7,35.4 5.7,68.4 L5.7,68.4 Z" id="Shape" fill="url(#linearGradient-1)"></path> + <path d="M9.3,68.4 L9.3,363.2 C9.3,394.2 34.5,419.4 65.5,419.4 L811.5,419.4 C842.5,419.4 867.7,394.2 867.7,363.2 L867.7,68.4 C867.7,37.4 842.5,12.2 811.5,12.2 L65.5,12.2 C34.5,12.1 9.3,37.4 9.3,68.4 L9.3,68.4 Z M811.5,18.2 C839.2,18.2 861.7,40.7 861.7,68.4 L861.7,363.2 C861.7,390.9 839.2,413.4 811.5,413.4 L65.5,413.4 C37.8,413.4 15.3,390.9 15.3,363.2 L15.3,68.4 C15.3,40.7 37.8,18.2 65.5,18.2 L811.5,18.2 L811.5,18.2 Z" id="Shape" fill="url(#linearGradient-2)"></path> + <g transform="translate(47.000000, 276.000000)"> + <circle id="Oval" fill="url(#radialGradient-3)" cx="7.7" cy="7.7" r="7.5"></circle> + <circle id="Oval" fill="url(#radialGradient-4)" opacity="0.8" cx="7.7" cy="7.7" r="7.5"></circle> + <circle id="Oval" fill="#1B1A1F" cx="7.7" cy="7.7" r="5"></circle> + <circle id="Oval" fill="#36284C" cx="7.7" cy="7.7" r="3.7"></circle> + <circle id="Oval" fill="url(#radialGradient-5)" cx="7.7" cy="7.7" r="3.7"></circle> + <g transform="translate(5.000000, 5.000000)" id="Shape"> + <path d="M4.7,2.7 C4.7,3.8 3.8,4.7 2.7,4.7 C1.6,4.7 0.7,3.8 0.7,2.7 C0.7,1.6 1.6,0.7 2.7,0.7 C3.8,0.7 4.7,1.6 4.7,2.7 L4.7,2.7 Z" fill="#141414" opacity="0.5"></path> + <path d="M4.7,2.7 C4.7,3.8 3.8,4.7 2.7,4.7 C1.6,4.7 0.7,3.8 0.7,2.7 C0.7,1.6 1.6,0.7 2.7,0.7 C3.8,0.7 4.7,1.6 4.7,2.7 L4.7,2.7 Z" fill="url(#radialGradient-6)"></path> + </g> + <path d="M7.7,6.2 C7.2,6.2 6.9,6.4 6.6,6.7 L7.1,7.2 C7.3,7 7.5,6.9 7.7,6.9 C8,6.9 8.2,7 8.4,7.2 L8.9,6.7 C8.5,6.4 8.1,6.2 7.7,6.2 L7.7,6.2 Z" id="Shape" fill="url(#linearGradient-7)"></path> + </g> + <g transform="translate(51.000000, 181.000000)" id="Clipped"> + <g> + <mask id="mask-9" fill="white"> + <use xlink:href="#path-8"></use> + </mask> + <g id="SVGID_8_"></g> + <path d="M8.7,5.1 L8.7,63.7 C8.7,66.1 6.8,68 4.4,68 L4.4,68 C2,68 0.1,66.1 0.1,63.7 L0.1,5.1 C0.1,2.7 2,0.8 4.4,0.8 L4.4,0.8 C6.8,0.8 8.7,2.7 8.7,5.1 L8.7,5.1 Z" id="Shape" fill="url(#linearGradient-10)" opacity="0.8" mask="url(#mask-9)"></path> + </g> + <g> + <mask id="mask-12" fill="white"> + <use xlink:href="#path-11"></use> + </mask> + <g id="SVGID_11_"></g> + <path d="M-0.2,4.7 L-0.2,64.1 C-0.2,66.5 1.9,68.5 4.5,68.5 C7.1,68.5 9.1,66.6 9.1,64.1 L9.1,4.7 C9.1,2.3 7,0.3 4.4,0.3 C1.8,0.3 -0.2,2.3 -0.2,4.7 L-0.2,4.7 Z M7.6,5.1 L7.6,63.7 C7.6,65.5 6.2,66.9 4.4,66.9 C2.6,66.9 1.2,65.5 1.2,63.7 L1.2,5.1 C1.2,3.3 2.6,1.9 4.4,1.9 C6.2,1.9 7.6,3.3 7.6,5.1 L7.6,5.1 Z" id="Shape" fill="#000000" opacity="0.2" mask="url(#mask-12)"></path> + </g> + <g> + <mask id="mask-14" fill="white"> + <use xlink:href="#path-13"></use> + </mask> + <g id="SVGID_13_"></g> + <path d="M0,66.7 L0,68.2 L1.5,68.2 L1.5,66.7 L0,66.7 L0,66.7 Z M0,63.8 L0,65.3 L1.5,65.3 L1.5,63.8 L0,63.8 L0,63.8 Z M0,60.8 L0,62.3 L1.5,62.3 L1.5,60.8 L0,60.8 L0,60.8 Z M0,57.9 L0,59.4 L1.5,59.4 L1.5,57.9 L0,57.9 L0,57.9 Z M0,54.9 L0,56.4 L1.5,56.4 L1.5,54.9 L0,54.9 L0,54.9 Z M0,52 L0,53.5 L1.5,53.5 L1.5,52 L0,52 L0,52 Z M0,49.1 L0,50.6 L1.5,50.6 L1.5,49.1 L0,49.1 L0,49.1 Z M0,46.1 L0,47.6 L1.5,47.6 L1.5,46.1 L0,46.1 L0,46.1 Z M0,43.2 L0,44.7 L1.5,44.7 L1.5,43.2 L0,43.2 L0,43.2 Z M0,40.3 L0,41.8 L1.5,41.8 L1.5,40.3 L0,40.3 L0,40.3 Z M0,37.3 L0,38.8 L1.5,38.8 L1.5,37.3 L0,37.3 L0,37.3 Z M0,34.4 L0,35.9 L1.5,35.9 L1.5,34.4 L0,34.4 L0,34.4 Z M0,31.5 L0,33 L1.5,33 L1.5,31.5 L0,31.5 L0,31.5 Z M0,28.5 L0,30 L1.5,30 L1.5,28.5 L0,28.5 L0,28.5 Z M0,25.6 L0,27.1 L1.5,27.1 L1.5,25.6 L0,25.6 L0,25.6 Z M0,22.6 L0,24.1 L1.5,24.1 L1.5,22.6 L0,22.6 L0,22.6 Z M0,19.7 L0,21.2 L1.5,21.2 L1.5,19.7 L0,19.7 L0,19.7 Z M0,16.8 L0,18.3 L1.5,18.3 L1.5,16.8 L0,16.8 L0,16.8 Z M0,13.9 L0,15.4 L1.5,15.4 L1.5,13.9 L0,13.9 L0,13.9 Z M0,10.9 L0,12.4 L1.5,12.4 L1.5,10.9 L0,10.9 L0,10.9 Z M0,8 L0,9.5 L1.5,9.5 L1.5,8 L0,8 L0,8 Z M0,5 L0,6.5 L1.5,6.5 L1.5,5 L0,5 L0,5 Z M0,2.1 L0,3.6 L1.5,3.6 L1.5,2.1 L0,2.1 L0,2.1 Z M1.5,65.2 L1.5,66.7 L3,66.7 L3,65.2 L1.5,65.2 L1.5,65.2 Z M1.5,62.3 L1.5,63.8 L3,63.8 L3,62.3 L1.5,62.3 L1.5,62.3 Z M1.5,59.3 L1.5,60.8 L3,60.8 L3,59.3 L1.5,59.3 L1.5,59.3 Z M1.5,56.4 L1.5,57.9 L3,57.9 L3,56.4 L1.5,56.4 L1.5,56.4 Z M1.5,53.5 L1.5,55 L3,55 L3,53.5 L1.5,53.5 L1.5,53.5 Z M1.5,50.5 L1.5,52 L3,52 L3,50.5 L1.5,50.5 L1.5,50.5 L1.5,50.5 Z M1.5,47.6 L1.5,49.1 L3,49.1 L3,47.6 L1.5,47.6 L1.5,47.6 Z M1.5,44.7 L1.5,46.2 L3,46.2 L3,44.7 L1.5,44.7 L1.5,44.7 Z M1.5,41.7 L1.5,43.2 L3,43.2 L3,41.7 L1.5,41.7 L1.5,41.7 Z M1.5,38.8 L1.5,40.3 L3,40.3 L3,38.8 L1.5,38.8 L1.5,38.8 Z M1.5,35.9 L1.5,37.4 L3,37.4 L3,35.9 L1.5,35.9 L1.5,35.9 Z M1.5,32.9 L1.5,34.4 L3,34.4 L3,32.9 L1.5,32.9 L1.5,32.9 Z M1.5,30 L1.5,31.5 L3,31.5 L3,30 L1.5,30 L1.5,30 Z M1.5,27.1 L1.5,28.6 L3,28.6 L3,27.1 L1.5,27.1 L1.5,27.1 Z M1.5,24.1 L1.5,25.6 L3,25.6 L3,24.1 L1.5,24.1 L1.5,24.1 Z M1.5,21.2 L1.5,22.7 L3,22.7 L3,21.2 L1.5,21.2 L1.5,21.2 Z M1.5,18.2 L1.5,19.7 L3,19.7 L3,18.2 L1.5,18.2 L1.5,18.2 Z M1.5,15.3 L1.5,16.8 L3,16.8 L3,15.3 L1.5,15.3 L1.5,15.3 Z M1.5,12.4 L1.5,13.9 L3,13.9 L3,12.4 L1.5,12.4 L1.5,12.4 Z M1.5,9.4 L1.5,10.9 L3,10.9 L3,9.4 L1.5,9.4 L1.5,9.4 Z M1.5,6.5 L1.5,8 L3,8 L3,6.5 L1.5,6.5 L1.5,6.5 Z M1.5,3.6 L1.5,5.1 L3,5.1 L3,3.6 L1.5,3.6 L1.5,3.6 Z M1.5,0.6 L1.5,2.1 L3,2.1 L3,0.6 L1.5,0.6 L1.5,0.6 Z M3,66.7 L3,68.2 L4.5,68.2 L4.5,66.7 L3,66.7 L3,66.7 Z M3,63.8 L3,65.3 L4.5,65.3 L4.5,63.8 L3,63.8 L3,63.8 Z M3,60.8 L3,62.3 L4.5,62.3 L4.5,60.8 L3,60.8 L3,60.8 Z M3,57.9 L3,59.4 L4.5,59.4 L4.5,57.9 L3,57.9 L3,57.9 Z M3,54.9 L3,56.4 L4.5,56.4 L4.5,54.9 L3,54.9 L3,54.9 Z M3,52 L3,53.5 L4.5,53.5 L4.5,52 L3,52 L3,52 Z M3,49.1 L3,50.6 L4.5,50.6 L4.5,49.1 L3,49.1 L3,49.1 Z M3,46.1 L3,47.6 L4.5,47.6 L4.5,46.1 L3,46.1 L3,46.1 Z M3,43.2 L3,44.7 L4.5,44.7 L4.5,43.2 L3,43.2 L3,43.2 Z M3,40.3 L3,41.8 L4.5,41.8 L4.5,40.3 L3,40.3 L3,40.3 Z M3,37.3 L3,38.8 L4.5,38.8 L4.5,37.3 L3,37.3 L3,37.3 Z M3,34.4 L3,35.9 L4.5,35.9 L4.5,34.4 L3,34.4 L3,34.4 Z M3,31.5 L3,33 L4.5,33 L4.5,31.5 L3,31.5 L3,31.5 Z M3,28.5 L3,30 L4.5,30 L4.5,28.5 L3,28.5 L3,28.5 Z M3,25.6 L3,27.1 L4.5,27.1 L4.5,25.6 L3,25.6 L3,25.6 Z M3,22.6 L3,24.1 L4.5,24.1 L4.5,22.6 L3,22.6 L3,22.6 Z M3,19.7 L3,21.2 L4.5,21.2 L4.5,19.7 L3,19.7 L3,19.7 Z M3,16.8 L3,18.3 L4.5,18.3 L4.5,16.8 L3,16.8 L3,16.8 Z M3,13.9 L3,15.4 L4.5,15.4 L4.5,13.9 L3,13.9 L3,13.9 Z M3,10.9 L3,12.4 L4.5,12.4 L4.5,10.9 L3,10.9 L3,10.9 Z M3,8 L3,9.5 L4.5,9.5 L4.5,8 L3,8 L3,8 Z M3,5 L3,6.5 L4.5,6.5 L4.5,5 L3,5 L3,5 Z M3,2.1 L3,3.6 L4.5,3.6 L4.5,2.1 L3,2.1 L3,2.1 Z M4.4,65.2 L4.4,66.7 L5.9,66.7 L5.9,65.2 L4.4,65.2 L4.4,65.2 Z M4.4,62.3 L4.4,63.8 L5.9,63.8 L5.9,62.3 L4.4,62.3 L4.4,62.3 Z M4.4,59.3 L4.4,60.8 L5.9,60.8 L5.9,59.3 L4.4,59.3 L4.4,59.3 Z M4.4,56.4 L4.4,57.9 L5.9,57.9 L5.9,56.4 L4.4,56.4 L4.4,56.4 Z M4.4,53.5 L4.4,55 L5.9,55 L5.9,53.5 L4.4,53.5 L4.4,53.5 Z M4.4,50.5 L4.4,52 L5.9,52 L5.9,50.5 L4.4,50.5 L4.4,50.5 L4.4,50.5 Z M4.4,47.6 L4.4,49.1 L5.9,49.1 L5.9,47.6 L4.4,47.6 L4.4,47.6 Z M4.4,44.7 L4.4,46.2 L5.9,46.2 L5.9,44.7 L4.4,44.7 L4.4,44.7 Z M4.4,41.7 L4.4,43.2 L5.9,43.2 L5.9,41.7 L4.4,41.7 L4.4,41.7 Z M4.4,38.8 L4.4,40.3 L5.9,40.3 L5.9,38.8 L4.4,38.8 L4.4,38.8 Z M4.4,35.9 L4.4,37.4 L5.9,37.4 L5.9,35.9 L4.4,35.9 L4.4,35.9 Z M4.4,32.9 L4.4,34.4 L5.9,34.4 L5.9,32.9 L4.4,32.9 L4.4,32.9 Z M4.4,30 L4.4,31.5 L5.9,31.5 L5.9,30 L4.4,30 L4.4,30 Z M4.4,27.1 L4.4,28.6 L5.9,28.6 L5.9,27.1 L4.4,27.1 L4.4,27.1 Z M4.4,24.1 L4.4,25.6 L5.9,25.6 L5.9,24.1 L4.4,24.1 L4.4,24.1 Z M4.4,21.2 L4.4,22.7 L5.9,22.7 L5.9,21.2 L4.4,21.2 L4.4,21.2 Z M4.4,18.2 L4.4,19.7 L5.9,19.7 L5.9,18.2 L4.4,18.2 L4.4,18.2 Z M4.4,15.3 L4.4,16.8 L5.9,16.8 L5.9,15.3 L4.4,15.3 L4.4,15.3 Z M4.4,12.4 L4.4,13.9 L5.9,13.9 L5.9,12.4 L4.4,12.4 L4.4,12.4 Z M4.4,9.4 L4.4,10.9 L5.9,10.9 L5.9,9.4 L4.4,9.4 L4.4,9.4 Z M4.4,6.5 L4.4,8 L5.9,8 L5.9,6.5 L4.4,6.5 L4.4,6.5 Z M4.4,3.6 L4.4,5.1 L5.9,5.1 L5.9,3.6 L4.4,3.6 L4.4,3.6 Z M4.4,0.6 L4.4,2.1 L5.9,2.1 L5.9,0.6 L4.4,0.6 L4.4,0.6 Z M5.9,66.7 L5.9,68.2 L7.4,68.2 L7.4,66.7 L5.9,66.7 L5.9,66.7 Z M5.9,63.8 L5.9,65.3 L7.4,65.3 L7.4,63.8 L5.9,63.8 L5.9,63.8 Z M5.9,60.8 L5.9,62.3 L7.4,62.3 L7.4,60.8 L5.9,60.8 L5.9,60.8 Z M5.9,57.9 L5.9,59.4 L7.4,59.4 L7.4,57.9 L5.9,57.9 L5.9,57.9 Z M5.9,54.9 L5.9,56.4 L7.4,56.4 L7.4,54.9 L5.9,54.9 L5.9,54.9 Z M5.9,52 L5.9,53.5 L7.4,53.5 L7.4,52 L5.9,52 L5.9,52 Z M5.9,49.1 L5.9,50.6 L7.4,50.6 L7.4,49.1 L5.9,49.1 L5.9,49.1 Z M5.9,46.1 L5.9,47.6 L7.4,47.6 L7.4,46.1 L5.9,46.1 L5.9,46.1 Z M5.9,43.2 L5.9,44.7 L7.4,44.7 L7.4,43.2 L5.9,43.2 L5.9,43.2 Z M5.9,40.3 L5.9,41.8 L7.4,41.8 L7.4,40.3 L5.9,40.3 L5.9,40.3 Z M5.9,37.3 L5.9,38.8 L7.4,38.8 L7.4,37.3 L5.9,37.3 L5.9,37.3 Z M5.9,34.4 L5.9,35.9 L7.4,35.9 L7.4,34.4 L5.9,34.4 L5.9,34.4 Z M5.9,31.5 L5.9,33 L7.4,33 L7.4,31.5 L5.9,31.5 L5.9,31.5 Z M5.9,28.5 L5.9,30 L7.4,30 L7.4,28.5 L5.9,28.5 L5.9,28.5 Z M5.9,25.6 L5.9,27.1 L7.4,27.1 L7.4,25.6 L5.9,25.6 L5.9,25.6 Z M5.9,22.6 L5.9,24.1 L7.4,24.1 L7.4,22.6 L5.9,22.6 L5.9,22.6 Z M5.9,19.7 L5.9,21.2 L7.4,21.2 L7.4,19.7 L5.9,19.7 L5.9,19.7 Z M5.9,16.8 L5.9,18.3 L7.4,18.3 L7.4,16.8 L5.9,16.8 L5.9,16.8 Z M5.9,13.9 L5.9,15.4 L7.4,15.4 L7.4,13.9 L5.9,13.9 L5.9,13.9 Z M5.9,10.9 L5.9,12.4 L7.4,12.4 L7.4,10.9 L5.9,10.9 L5.9,10.9 Z M5.9,8 L5.9,9.5 L7.4,9.5 L7.4,8 L5.9,8 L5.9,8 Z M5.9,5 L5.9,6.5 L7.4,6.5 L7.4,5 L5.9,5 L5.9,5 Z M5.9,2.1 L5.9,3.6 L7.4,3.6 L7.4,2.1 L5.9,2.1 L5.9,2.1 Z M7.3,65.2 L7.3,66.7 L8.8,66.7 L8.8,65.2 L7.3,65.2 L7.3,65.2 Z M7.3,62.3 L7.3,63.8 L8.8,63.8 L8.8,62.3 L7.3,62.3 L7.3,62.3 Z M7.3,59.3 L7.3,60.8 L8.8,60.8 L8.8,59.3 L7.3,59.3 L7.3,59.3 Z M7.3,56.4 L7.3,57.9 L8.8,57.9 L8.8,56.4 L7.3,56.4 L7.3,56.4 Z M7.3,53.5 L7.3,55 L8.8,55 L8.8,53.5 L7.3,53.5 L7.3,53.5 Z M7.3,50.5 L7.3,52 L8.8,52 L8.8,50.5 L7.3,50.5 L7.3,50.5 L7.3,50.5 Z M7.3,47.6 L7.3,49.1 L8.8,49.1 L8.8,47.6 L7.3,47.6 L7.3,47.6 Z M7.3,44.7 L7.3,46.2 L8.8,46.2 L8.8,44.7 L7.3,44.7 L7.3,44.7 Z M7.3,41.7 L7.3,43.2 L8.8,43.2 L8.8,41.7 L7.3,41.7 L7.3,41.7 Z M7.3,38.8 L7.3,40.3 L8.8,40.3 L8.8,38.8 L7.3,38.8 L7.3,38.8 Z M7.3,35.9 L7.3,37.4 L8.8,37.4 L8.8,35.9 L7.3,35.9 L7.3,35.9 Z M7.3,32.9 L7.3,34.4 L8.8,34.4 L8.8,32.9 L7.3,32.9 L7.3,32.9 Z M7.3,30 L7.3,31.5 L8.8,31.5 L8.8,30 L7.3,30 L7.3,30 Z M7.3,27.1 L7.3,28.6 L8.8,28.6 L8.8,27.1 L7.3,27.1 L7.3,27.1 Z M7.3,24.1 L7.3,25.6 L8.8,25.6 L8.8,24.1 L7.3,24.1 L7.3,24.1 Z M7.3,21.2 L7.3,22.7 L8.8,22.7 L8.8,21.2 L7.3,21.2 L7.3,21.2 Z M7.3,18.2 L7.3,19.7 L8.8,19.7 L8.8,18.2 L7.3,18.2 L7.3,18.2 Z M7.3,15.3 L7.3,16.8 L8.8,16.8 L8.8,15.3 L7.3,15.3 L7.3,15.3 Z M7.3,12.4 L7.3,13.9 L8.8,13.9 L8.8,12.4 L7.3,12.4 L7.3,12.4 Z M7.3,9.4 L7.3,10.9 L8.8,10.9 L8.8,9.4 L7.3,9.4 L7.3,9.4 Z M7.3,6.5 L7.3,8 L8.8,8 L8.8,6.5 L7.3,6.5 L7.3,6.5 Z M7.3,3.6 L7.3,5.1 L8.8,5.1 L8.8,3.6 L7.3,3.6 L7.3,3.6 Z M7.3,0.6 L7.3,2.1 L8.8,2.1 L8.8,0.6 L7.3,0.6 L7.3,0.6 Z" id="Shape" fill="#2E2E2E" mask="url(#mask-14)"></path> + </g> + </g> + <path d="M820.9,182.9 C802.8,182.9 788.1,197.6 788.1,215.7 C788.1,233.8 802.8,248.5 820.9,248.5 C839,248.5 853.7,233.8 853.7,215.7 C853.7,197.6 839,182.9 820.9,182.9 L820.9,182.9 Z M820.9,245.6 C804.4,245.6 791.1,232.2 791.1,215.8 C791.1,199.4 804.4,186 820.9,186 C837.4,186 850.7,199.4 850.7,215.8 C850.7,232.2 837.3,245.6 820.9,245.6 L820.9,245.6 Z" id="Shape" fill="url(#linearGradient-15)"></path> + </g> + <rect id="Rectangle-path" fill="#000000" x="106" y="28" width="667" height="375"></rect> + </g> + </g> + </g> +</svg>
diff --git a/third_party/WebKit/Source/devtools/front_end/emulated_devices/iPhone6-portrait.svg b/third_party/WebKit/Source/devtools/front_end/emulated_devices/iPhone6-portrait.svg new file mode 100644 index 0000000..581c3341 --- /dev/null +++ b/third_party/WebKit/Source/devtools/front_end/emulated_devices/iPhone6-portrait.svg
@@ -0,0 +1,116 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg width="431px" height="877px" viewBox="0 0 431 877" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> + <title>iPhone 6</title> + <defs> + <linearGradient x1="49.9843147%" y1="-0.0652528548%" x2="49.9843147%" y2="100.081566%" id="linearGradient-1"> + <stop stop-color="#FFFFFF" stop-opacity="0.15" offset="0%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0" offset="11.69%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0.00509108" offset="87.64%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0.15" offset="100%"></stop> + </linearGradient> + <linearGradient x1="-28.7505648%" y1="28.4302458%" x2="128.768345%" y2="71.576267%" id="linearGradient-2"> + <stop stop-color="#FFFFFF" stop-opacity="0.15" offset="0%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0.05" offset="13.73%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0.02" offset="88.31%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0.15" offset="100%"></stop> + </linearGradient> + <radialGradient cx="50.0657895%" cy="50%" fx="50.0657895%" fy="50%" r="49.6710526%" id="radialGradient-3"> + <stop stop-color="#5D5D5F" offset="0%"></stop> + <stop stop-color="#333333" stop-opacity="0.8" offset="100%"></stop> + </radialGradient> + <radialGradient cx="50.5113431%" cy="57.0965797%" fx="50.5113431%" fy="57.0965797%" r="49.6414474%" id="radialGradient-4"> + <stop stop-color="#000000" stop-opacity="0" offset="0%"></stop> + <stop stop-color="#020202" stop-opacity="0.4119" offset="51.49%"></stop> + <stop stop-color="#090909" stop-opacity="0.5603" offset="70.03%"></stop> + <stop stop-color="#141414" stop-opacity="0.666" offset="83.25%"></stop> + <stop stop-color="#252525" stop-opacity="0.7509" offset="93.87%"></stop> + <stop stop-color="#333333" stop-opacity="0.8" offset="100%"></stop> + </radialGradient> + <radialGradient cx="47.8584278%" cy="96.1408161%" fx="47.8584278%" fy="96.1408161%" r="95.1797297%" id="radialGradient-5"> + <stop stop-color="#FFFFFF" stop-opacity="0.3" offset="0%"></stop> + <stop stop-color="#000000" stop-opacity="0" offset="100%"></stop> + </radialGradient> + <radialGradient cx="51.01503%" cy="23.676875%" fx="51.01503%" fy="23.676875%" r="58.14%" id="radialGradient-6"> + <stop stop-color="#FFFFFF" stop-opacity="0.3" offset="0%"></stop> + <stop stop-color="#000000" stop-opacity="0" offset="100%"></stop> + </radialGradient> + <linearGradient x1="48.2624993%" y1="6.12081973%" x2="48.2643405%" y2="109.94082%" id="linearGradient-7"> + <stop stop-color="#FFFFFF" stop-opacity="0.6" offset="0%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0.1" offset="100%"></stop> + </linearGradient> + <path id="path-8" d="M63.8,8.9 L5.2,8.9 C2.8,8.9 0.9,7 0.9,4.6 L0.9,4.6 C0.9,2.2 2.8,0.3 5.2,0.3 L63.8,0.3 C66.2,0.3 68.1,2.2 68.1,4.6 L68.1,4.6 C68.1,7 66.2,8.9 63.8,8.9 L63.8,8.9 Z"></path> + <linearGradient x1="50.0297245%" y1="100.349273%" x2="50.0297245%" y2="0.581987558%" id="linearGradient-10"> + <stop stop-color="#2E2E31" offset="0%"></stop> + <stop stop-color="#616161" offset="24.48%"></stop> + <stop stop-color="#858585" offset="81.37%"></stop> + <stop stop-color="#2E2E31" offset="100%"></stop> + </linearGradient> + <path id="path-11" d="M63.8,8.9 L5.2,8.9 C2.8,8.9 0.9,7 0.9,4.6 L0.9,4.6 C0.9,2.2 2.8,0.3 5.2,0.3 L63.8,0.3 C66.2,0.3 68.1,2.2 68.1,4.6 L68.1,4.6 C68.1,7 66.2,8.9 63.8,8.9 L63.8,8.9 Z"></path> + <path id="path-13" d="M63.8,8.9 L5.2,8.9 C2.8,8.9 0.9,7 0.9,4.6 L0.9,4.6 C0.9,2.2 2.8,0.3 5.2,0.3 L63.8,0.3 C66.2,0.3 68.1,2.2 68.1,4.6 L68.1,4.6 C68.1,7 66.2,8.9 63.8,8.9 L63.8,8.9 Z"></path> + <linearGradient x1="86.3503805%" y1="91.9339939%" x2="14.0585997%" y2="8.60320122%" id="linearGradient-15"> + <stop stop-color="#FFFFFF" stop-opacity="0.3" offset="14.7%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0" offset="40.73%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0.00509108" offset="74.45%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0.2" offset="100%"></stop> + </linearGradient> + <linearGradient x1="-34.1719072%" y1="-2.09287997%" x2="28.847616%" y2="36.9142223%" id="linearGradient-16"> + <stop stop-color="#FFFFFF" stop-opacity="0.15" offset="0%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0" offset="100%"></stop> + </linearGradient> + </defs> + <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> + <g id="iphone6-portrait" transform="translate(0.000000, 1.000000)"> + <g id="Group"> + <path d="M6,144.5 L2.2,144.5 C1.2,144.5 0.3,143.7 0.3,142.6 L0.3,112.6 C0.3,111.6 1.1,110.7 2.2,110.7 L6,110.7 L6,144.5 L6,144.5 Z" id="Shape" fill="#808086"></path> + <path d="M0.6,189.7 C0.6,188.7 1.4,187.8 2.5,187.8 L6.2,187.8 L6.2,249 L2.4,249 C1.4,249 0.5,248.2 0.5,247.1" id="Shape" fill="#808086"></path> + <path d="M424.7,187.2 L428.4,187.2 C429.4,187.2 430.3,188 430.3,189.1 L430.3,246.5 C430.3,247.5 429.5,248.4 428.4,248.4 L424.7,248.4 L424.7,187.2 L424.7,187.2 Z" id="Shape" fill="#818187"></path> + <path d="M6.2,328.7 L2.4,328.7 C1.4,328.7 0.5,327.9 0.5,326.8 L0.5,269.4 C0.5,268.4 1.3,267.5 2.4,267.5 L6.1,267.5 L6.1,328.7 L6.2,328.7 Z" id="Shape" fill="#808086"></path> + <path d="M67.7,870.2 C51.8,870.2 36.8,864 25.6,852.7 C14.4,841.4 8.1,826.5 8.1,810.6 L8.1,64.7 C8.1,48.8 14.3,33.8 25.6,22.6 C36.9,11.4 51.8,5.1 67.7,5.1 L362.5,5.1 C378.4,5.1 393.4,11.3 404.6,22.6 C415.8,33.9 422.1,48.8 422.1,64.7 L422.1,810.6 C422.1,826.5 415.9,841.5 404.6,852.7 C393.3,863.9 378.4,870.2 362.5,870.2 L67.7,870.2 L67.7,870.2 L67.7,870.2 Z" id="Shape" fill="#404040"></path> + <g transform="translate(3.000000, 0.000000)" id="Shape"> + <path d="M64.9,875.4 C29.1,875.4 0,846.3 0,810.5 L0,64.9 C0,29.1 29.1,0 64.9,0 L359.3,0 C395.1,0 424.2,29.1 424.2,64.9 L424.2,810.5 C424.2,846.3 395.1,875.4 359.3,875.4 L64.9,875.4 L64.9,875.4 L64.9,875.4 Z" stroke-opacity="0.5" stroke="#666666" fill="#B2B2B2"></path> + <path d="M359.4,870.4 L64.9,870.4 C31.8,870.4 5,843.6 5,810.5 L5,64.9 C5,31.8 31.8,5 64.9,5 L359.3,5 C392.4,5 419.2,31.8 419.2,64.9 L419.2,810.5 C419.3,843.6 392.5,870.4 359.4,870.4 L359.4,870.4 Z" fill="#262626"></path> + </g> + <path d="M362.5,5 L67.7,5 C34.7,5 8,31.7 8,64.7 L8,66.3 C8,33.3 34.8,6.5 67.8,6.5 L362.6,6.5 C395.6,6.5 422.4,33.3 422.4,66.3 L422.4,64.7 C422.3,31.7 395.5,5 362.5,5 L362.5,5 Z" id="Shape" fill="url(#linearGradient-1)"></path> + <path d="M362.5,8.5 L67.7,8.5 C36.7,8.5 11.5,33.7 11.5,64.7 L11.5,810.6 C11.5,841.6 36.7,866.8 67.7,866.8 L362.5,866.8 C393.5,866.8 418.7,841.6 418.7,810.6 L418.7,64.7 C418.7,33.7 393.5,8.5 362.5,8.5 L362.5,8.5 Z M412.7,810.7 C412.7,838.4 390.2,860.9 362.5,860.9 L67.7,860.9 C40,860.9 17.5,838.4 17.5,810.7 L17.5,64.7 C17.5,37 40,14.5 67.7,14.5 L362.5,14.5 C390.2,14.5 412.7,37 412.7,64.7 L412.7,810.7 L412.7,810.7 Z" id="Shape" fill="url(#linearGradient-2)"></path> + <g transform="translate(139.000000, 46.000000)"> + <circle id="Oval" fill="url(#radialGradient-3)" cx="8.2" cy="7.9" r="7.6"></circle> + <circle id="Oval" fill="url(#radialGradient-4)" opacity="0.8" cx="8.2" cy="7.9" r="7.6"></circle> + <circle id="Oval" fill="#1B1A1F" cx="8.2" cy="7.9" r="5"></circle> + <circle id="Oval" fill="#36284C" cx="8.2" cy="7.9" r="3.7"></circle> + <circle id="Oval" fill="url(#radialGradient-5)" cx="8.2" cy="7.9" r="3.7"></circle> + <g transform="translate(6.000000, 5.000000)" id="Shape"> + <path d="M4.2,2.9 C4.2,4 3.3,4.9 2.2,4.9 C1.1,4.9 0.2,4 0.2,2.9 C0.2,1.8 1.1,0.9 2.2,0.9 C3.3,0.9 4.2,1.8 4.2,2.9 L4.2,2.9 Z" fill="#141414" opacity="0.5"></path> + <path d="M4.2,2.9 C4.2,4 3.3,4.9 2.2,4.9 C1.1,4.9 0.2,4 0.2,2.9 C0.2,1.8 1.1,0.9 2.2,0.9 C3.3,0.9 4.2,1.8 4.2,2.9 L4.2,2.9 Z" fill="url(#radialGradient-6)"></path> + </g> + <path d="M8.2,6.4 C7.8,6.4 7.4,6.6 7.1,6.9 L7.6,7.4 C7.8,7.2 8,7.1 8.2,7.1 C8.5,7.1 8.7,7.2 8.9,7.4 L9.4,6.9 C9.1,6.6 8.7,6.4 8.2,6.4 L8.2,6.4 Z" id="Shape" fill="url(#linearGradient-7)"></path> + </g> + <g transform="translate(181.000000, 50.000000)" id="Clipped"> + <g> + <mask id="mask-9" fill="white"> + <use xlink:href="#path-8"></use> + </mask> + <g id="SVGID_8_"></g> + <path d="M63.8,8.9 L5.2,8.9 C2.8,8.9 0.9,7 0.9,4.6 L0.9,4.6 C0.9,2.2 2.8,0.3 5.2,0.3 L63.8,0.3 C66.2,0.3 68.1,2.2 68.1,4.6 L68.1,4.6 C68.1,7 66.2,8.9 63.8,8.9 L63.8,8.9 Z" id="Shape" fill="url(#linearGradient-10)" opacity="0.8" mask="url(#mask-9)"></path> + </g> + <g> + <mask id="mask-12" fill="white"> + <use xlink:href="#path-11"></use> + </mask> + <g id="SVGID_11_"></g> + <path d="M2.3,0.2 L0.8,0.2 L0.8,1.7 L2.3,1.7 L2.3,0.2 L2.3,0.2 Z M5.3,0.2 L3.8,0.2 L3.8,1.7 L5.3,1.7 L5.3,0.2 L5.3,0.2 Z M8.2,0.2 L6.7,0.2 L6.7,1.7 L8.2,1.7 L8.2,0.2 L8.2,0.2 Z M11.1,0.2 L9.6,0.2 L9.6,1.7 L11.1,1.7 L11.1,0.2 L11.1,0.2 Z M14.1,0.2 L12.6,0.2 L12.6,1.7 L14.1,1.7 L14.1,0.2 L14.1,0.2 Z M17,0.2 L15.5,0.2 L15.5,1.7 L17,1.7 L17,0.2 L17,0.2 Z M19.9,0.2 L18.4,0.2 L18.4,1.7 L19.9,1.7 L19.9,0.2 L19.9,0.2 Z M22.9,0.2 L21.4,0.2 L21.4,1.7 L22.9,1.7 L22.9,0.2 L22.9,0.2 Z M25.8,0.2 L24.3,0.2 L24.3,1.7 L25.8,1.7 L25.8,0.2 L25.8,0.2 Z M28.8,0.2 L27.3,0.2 L27.3,1.7 L28.8,1.7 L28.8,0.2 L28.8,0.2 Z M31.7,0.2 L30.2,0.2 L30.2,1.7 L31.7,1.7 L31.7,0.2 L31.7,0.2 Z M34.6,0.2 L33.1,0.2 L33.1,1.7 L34.6,1.7 L34.6,0.2 L34.6,0.2 Z M37.6,0.2 L36.1,0.2 L36.1,1.7 L37.6,1.7 L37.6,0.2 L37.6,0.2 Z M40.5,0.2 L39,0.2 L39,1.7 L40.5,1.7 L40.5,0.2 L40.5,0.2 Z M43.4,0.2 L41.9,0.2 L41.9,1.7 L43.4,1.7 L43.4,0.2 L43.4,0.2 Z M46.4,0.2 L44.9,0.2 L44.9,1.7 L46.4,1.7 L46.4,0.2 L46.4,0.2 Z M49.3,0.2 L47.8,0.2 L47.8,1.7 L49.3,1.7 L49.3,0.2 L49.3,0.2 Z M52.2,0.2 L50.7,0.2 L50.7,1.7 L52.2,1.7 L52.2,0.2 L52.2,0.2 Z M55.2,0.2 L53.7,0.2 L53.7,1.7 L55.2,1.7 L55.2,0.2 L55.2,0.2 Z M58.1,0.2 L56.6,0.2 L56.6,1.7 L58.1,1.7 L58.1,0.2 L58.1,0.2 Z M61,0.2 L59.5,0.2 L59.5,1.7 L61,1.7 L61,0.2 L61,0.2 Z M64,0.2 L62.5,0.2 L62.5,1.7 L64,1.7 L64,0.2 L64,0.2 Z M66.9,0.2 L65.4,0.2 L65.4,1.7 L66.9,1.7 L66.9,0.2 L66.9,0.2 Z M3.8,1.7 L2.3,1.7 L2.3,3.2 L3.8,3.2 L3.8,1.7 L3.8,1.7 Z M6.7,1.7 L5.2,1.7 L5.2,3.2 L6.7,3.2 L6.7,1.7 L6.7,1.7 Z M9.7,1.7 L8.2,1.7 L8.2,3.2 L9.7,3.2 L9.7,1.7 L9.7,1.7 Z M12.6,1.7 L11.1,1.7 L11.1,3.2 L12.6,3.2 L12.6,1.7 L12.6,1.7 Z M15.5,1.7 L14,1.7 L14,3.2 L15.5,3.2 L15.5,1.7 L15.5,1.7 Z M18.5,1.7 L17,1.7 L17,3.2 L18.5,3.2 L18.5,1.7 L18.5,1.7 Z M21.4,1.7 L19.9,1.7 L19.9,3.2 L21.4,3.2 L21.4,1.7 L21.4,1.7 Z M24.3,1.7 L22.8,1.7 L22.8,3.2 L24.3,3.2 L24.3,1.7 L24.3,1.7 Z M27.3,1.7 L25.8,1.7 L25.8,3.2 L27.3,3.2 L27.3,1.7 L27.3,1.7 Z M30.2,1.7 L28.7,1.7 L28.7,3.2 L30.2,3.2 L30.2,1.7 L30.2,1.7 Z M33.1,1.7 L31.6,1.7 L31.6,3.2 L33.1,3.2 L33.1,1.7 L33.1,1.7 Z M36.1,1.7 L34.6,1.7 L34.6,3.2 L36.1,3.2 L36.1,1.7 L36.1,1.7 Z M39,1.7 L37.5,1.7 L37.5,3.2 L39,3.2 L39,1.7 L39,1.7 Z M41.9,1.7 L40.4,1.7 L40.4,3.2 L41.9,3.2 L41.9,1.7 L41.9,1.7 Z M44.9,1.7 L43.4,1.7 L43.4,3.2 L44.9,3.2 L44.9,1.7 L44.9,1.7 Z M47.8,1.7 L46.3,1.7 L46.3,3.2 L47.8,3.2 L47.8,1.7 L47.8,1.7 Z M50.8,1.7 L49.3,1.7 L49.3,3.2 L50.8,3.2 L50.8,1.7 L50.8,1.7 Z M53.7,1.7 L52.2,1.7 L52.2,3.2 L53.7,3.2 L53.7,1.7 L53.7,1.7 Z M56.6,1.7 L55.1,1.7 L55.1,3.2 L56.6,3.2 L56.6,1.7 L56.6,1.7 Z M59.6,1.7 L58.1,1.7 L58.1,3.2 L59.6,3.2 L59.6,1.7 L59.6,1.7 Z M62.5,1.7 L61,1.7 L61,3.2 L62.5,3.2 L62.5,1.7 L62.5,1.7 Z M65.4,1.7 L64,1.7 L64,3.2 L65.5,3.2 L65.5,1.7 L65.4,1.7 Z M68.4,1.7 L66.9,1.7 L66.9,3.2 L68.4,3.2 L68.4,1.7 L68.4,1.7 Z M2.3,3.2 L0.8,3.2 L0.8,4.7 L2.3,4.7 L2.3,3.2 L2.3,3.2 Z M5.3,3.2 L3.8,3.2 L3.8,4.7 L5.3,4.7 L5.3,3.2 L5.3,3.2 Z M8.2,3.2 L6.7,3.2 L6.7,4.7 L8.2,4.7 L8.2,3.2 L8.2,3.2 Z M11.1,3.2 L9.6,3.2 L9.6,4.7 L11.1,4.7 L11.1,3.2 L11.1,3.2 Z M14.1,3.2 L12.6,3.2 L12.6,4.7 L14.1,4.7 L14.1,3.2 L14.1,3.2 Z M17,3.2 L15.5,3.2 L15.5,4.7 L17,4.7 L17,3.2 L17,3.2 Z M19.9,3.2 L18.4,3.2 L18.4,4.7 L19.9,4.7 L19.9,3.2 L19.9,3.2 Z M22.9,3.2 L21.4,3.2 L21.4,4.7 L22.9,4.7 L22.9,3.2 L22.9,3.2 Z M25.8,3.2 L24.3,3.2 L24.3,4.7 L25.8,4.7 L25.8,3.2 L25.8,3.2 Z M28.8,3.2 L27.3,3.2 L27.3,4.7 L28.8,4.7 L28.8,3.2 L28.8,3.2 Z M31.7,3.2 L30.2,3.2 L30.2,4.7 L31.7,4.7 L31.7,3.2 L31.7,3.2 Z M34.6,3.2 L33.1,3.2 L33.1,4.7 L34.6,4.7 L34.6,3.2 L34.6,3.2 Z M37.6,3.2 L36.1,3.2 L36.1,4.7 L37.6,4.7 L37.6,3.2 L37.6,3.2 Z M40.5,3.2 L39,3.2 L39,4.7 L40.5,4.7 L40.5,3.2 L40.5,3.2 Z M43.4,3.2 L41.9,3.2 L41.9,4.7 L43.4,4.7 L43.4,3.2 L43.4,3.2 Z M46.4,3.2 L44.9,3.2 L44.9,4.7 L46.4,4.7 L46.4,3.2 L46.4,3.2 Z M49.3,3.2 L47.8,3.2 L47.8,4.7 L49.3,4.7 L49.3,3.2 L49.3,3.2 Z M52.2,3.2 L50.7,3.2 L50.7,4.7 L52.2,4.7 L52.2,3.2 L52.2,3.2 Z M55.2,3.2 L53.7,3.2 L53.7,4.7 L55.2,4.7 L55.2,3.2 L55.2,3.2 Z M58.1,3.2 L56.6,3.2 L56.6,4.7 L58.1,4.7 L58.1,3.2 L58.1,3.2 Z M61,3.2 L59.5,3.2 L59.5,4.7 L61,4.7 L61,3.2 L61,3.2 Z M64,3.2 L62.5,3.2 L62.5,4.7 L64,4.7 L64,3.2 L64,3.2 Z M66.9,3.2 L65.4,3.2 L65.4,4.7 L66.9,4.7 L66.9,3.2 L66.9,3.2 Z M3.8,4.7 L2.3,4.7 L2.3,6.2 L3.8,6.2 L3.8,4.7 L3.8,4.7 Z M6.7,4.7 L5.2,4.7 L5.2,6.2 L6.7,6.2 L6.7,4.7 L6.7,4.7 Z M9.7,4.7 L8.2,4.7 L8.2,6.2 L9.7,6.2 L9.7,4.7 L9.7,4.7 Z M12.6,4.7 L11.1,4.7 L11.1,6.2 L12.6,6.2 L12.6,4.7 L12.6,4.7 Z M15.5,4.7 L14,4.7 L14,6.2 L15.5,6.2 L15.5,4.7 L15.5,4.7 Z M18.5,4.7 L17,4.7 L17,6.2 L18.5,6.2 L18.5,4.7 L18.5,4.7 Z M21.4,4.7 L19.9,4.7 L19.9,6.2 L21.4,6.2 L21.4,4.7 L21.4,4.7 Z M24.3,4.7 L22.8,4.7 L22.8,6.2 L24.3,6.2 L24.3,4.7 L24.3,4.7 Z M27.3,4.7 L25.8,4.7 L25.8,6.2 L27.3,6.2 L27.3,4.7 L27.3,4.7 Z M30.2,4.7 L28.7,4.7 L28.7,6.2 L30.2,6.2 L30.2,4.7 L30.2,4.7 Z M33.1,4.7 L31.6,4.7 L31.6,6.2 L33.1,6.2 L33.1,4.7 L33.1,4.7 Z M36.1,4.7 L34.6,4.7 L34.6,6.2 L36.1,6.2 L36.1,4.7 L36.1,4.7 Z M39,4.7 L37.5,4.7 L37.5,6.2 L39,6.2 L39,4.7 L39,4.7 Z M41.9,4.7 L40.4,4.7 L40.4,6.2 L41.9,6.2 L41.9,4.7 L41.9,4.7 Z M44.9,4.7 L43.4,4.7 L43.4,6.2 L44.9,6.2 L44.9,4.7 L44.9,4.7 Z M47.8,4.7 L46.3,4.7 L46.3,6.2 L47.8,6.2 L47.8,4.7 L47.8,4.7 Z M50.8,4.7 L49.3,4.7 L49.3,6.2 L50.8,6.2 L50.8,4.7 L50.8,4.7 Z M53.7,4.7 L52.2,4.7 L52.2,6.2 L53.7,6.2 L53.7,4.7 L53.7,4.7 Z M56.6,4.7 L55.1,4.7 L55.1,6.2 L56.6,6.2 L56.6,4.7 L56.6,4.7 Z M59.6,4.7 L58.1,4.7 L58.1,6.2 L59.6,6.2 L59.6,4.7 L59.6,4.7 Z M62.5,4.7 L61,4.7 L61,6.2 L62.5,6.2 L62.5,4.7 L62.5,4.7 Z M65.4,4.7 L64,4.7 L64,6.2 L65.5,6.2 L65.5,4.7 L65.4,4.7 Z M68.4,4.7 L66.9,4.7 L66.9,6.2 L68.4,6.2 L68.4,4.7 L68.4,4.7 Z M2.3,6.1 L0.8,6.1 L0.8,7.6 L2.3,7.6 L2.3,6.1 L2.3,6.1 Z M5.3,6.1 L3.8,6.1 L3.8,7.6 L5.3,7.6 L5.3,6.1 L5.3,6.1 Z M8.2,6.1 L6.7,6.1 L6.7,7.6 L8.2,7.6 L8.2,6.1 L8.2,6.1 Z M11.1,6.1 L9.6,6.1 L9.6,7.6 L11.1,7.6 L11.1,6.1 L11.1,6.1 Z M14.1,6.1 L12.6,6.1 L12.6,7.6 L14.1,7.6 L14.1,6.1 L14.1,6.1 Z M17,6.1 L15.5,6.1 L15.5,7.6 L17,7.6 L17,6.1 L17,6.1 Z M19.9,6.1 L18.4,6.1 L18.4,7.6 L19.9,7.6 L19.9,6.1 L19.9,6.1 Z M22.9,6.1 L21.4,6.1 L21.4,7.6 L22.9,7.6 L22.9,6.1 L22.9,6.1 Z M25.8,6.1 L24.3,6.1 L24.3,7.6 L25.8,7.6 L25.8,6.1 L25.8,6.1 Z M28.8,6.1 L27.3,6.1 L27.3,7.6 L28.8,7.6 L28.8,6.1 L28.8,6.1 Z M31.7,6.1 L30.2,6.1 L30.2,7.6 L31.7,7.6 L31.7,6.1 L31.7,6.1 Z M34.6,6.1 L33.1,6.1 L33.1,7.6 L34.6,7.6 L34.6,6.1 L34.6,6.1 Z M37.6,6.1 L36.1,6.1 L36.1,7.6 L37.6,7.6 L37.6,6.1 L37.6,6.1 Z M40.5,6.1 L39,6.1 L39,7.6 L40.5,7.6 L40.5,6.1 L40.5,6.1 Z M43.4,6.1 L41.9,6.1 L41.9,7.6 L43.4,7.6 L43.4,6.1 L43.4,6.1 Z M46.4,6.1 L44.9,6.1 L44.9,7.6 L46.4,7.6 L46.4,6.1 L46.4,6.1 Z M49.3,6.1 L47.8,6.1 L47.8,7.6 L49.3,7.6 L49.3,6.1 L49.3,6.1 Z M52.2,6.1 L50.7,6.1 L50.7,7.6 L52.2,7.6 L52.2,6.1 L52.2,6.1 Z M55.2,6.1 L53.7,6.1 L53.7,7.6 L55.2,7.6 L55.2,6.1 L55.2,6.1 Z M58.1,6.1 L56.6,6.1 L56.6,7.6 L58.1,7.6 L58.1,6.1 L58.1,6.1 Z M61,6.1 L59.5,6.1 L59.5,7.6 L61,7.6 L61,6.1 L61,6.1 Z M64,6.1 L62.5,6.1 L62.5,7.6 L64,7.6 L64,6.1 L64,6.1 Z M66.9,6.1 L65.4,6.1 L65.4,7.6 L66.9,7.6 L66.9,6.1 L66.9,6.1 Z M3.8,7.6 L2.3,7.6 L2.3,9.1 L3.8,9.1 L3.8,7.6 L3.8,7.6 Z M6.7,7.6 L5.2,7.6 L5.2,9.1 L6.7,9.1 L6.7,7.6 L6.7,7.6 Z M9.7,7.6 L8.2,7.6 L8.2,9.1 L9.7,9.1 L9.7,7.6 L9.7,7.6 Z M12.6,7.6 L11.1,7.6 L11.1,9.1 L12.6,9.1 L12.6,7.6 L12.6,7.6 Z M15.5,7.6 L14,7.6 L14,9.1 L15.5,9.1 L15.5,7.6 L15.5,7.6 Z M18.5,7.6 L17,7.6 L17,9.1 L18.5,9.1 L18.5,7.6 L18.5,7.6 Z M21.4,7.6 L19.9,7.6 L19.9,9.1 L21.4,9.1 L21.4,7.6 L21.4,7.6 Z M24.3,7.6 L22.8,7.6 L22.8,9.1 L24.3,9.1 L24.3,7.6 L24.3,7.6 Z M27.3,7.6 L25.8,7.6 L25.8,9.1 L27.3,9.1 L27.3,7.6 L27.3,7.6 Z M30.2,7.6 L28.7,7.6 L28.7,9.1 L30.2,9.1 L30.2,7.6 L30.2,7.6 Z M33.1,7.6 L31.6,7.6 L31.6,9.1 L33.1,9.1 L33.1,7.6 L33.1,7.6 Z M36.1,7.6 L34.6,7.6 L34.6,9.1 L36.1,9.1 L36.1,7.6 L36.1,7.6 Z M39,7.6 L37.5,7.6 L37.5,9.1 L39,9.1 L39,7.6 L39,7.6 Z M41.9,7.6 L40.4,7.6 L40.4,9.1 L41.9,9.1 L41.9,7.6 L41.9,7.6 Z M44.9,7.6 L43.4,7.6 L43.4,9.1 L44.9,9.1 L44.9,7.6 L44.9,7.6 Z M47.8,7.6 L46.3,7.6 L46.3,9.1 L47.8,9.1 L47.8,7.6 L47.8,7.6 Z M50.8,7.6 L49.3,7.6 L49.3,9.1 L50.8,9.1 L50.8,7.6 L50.8,7.6 Z M53.7,7.6 L52.2,7.6 L52.2,9.1 L53.7,9.1 L53.7,7.6 L53.7,7.6 Z M56.6,7.6 L55.1,7.6 L55.1,9.1 L56.6,9.1 L56.6,7.6 L56.6,7.6 Z M59.6,7.6 L58.1,7.6 L58.1,9.1 L59.6,9.1 L59.6,7.6 L59.6,7.6 Z M62.5,7.6 L61,7.6 L61,9.1 L62.5,9.1 L62.5,7.6 L62.5,7.6 Z M65.4,7.6 L64,7.6 L64,9.1 L65.5,9.1 L65.5,7.6 L65.4,7.6 Z M68.4,7.6 L66.9,7.6 L66.9,9.1 L68.4,9.1 L68.4,7.6 L68.4,7.6 Z" id="Shape" fill="#2E2E2E" mask="url(#mask-12)"></path> + </g> + <g> + <mask id="mask-14" fill="white"> + <use xlink:href="#path-13"></use> + </mask> + <g id="SVGID_13_"></g> + <path d="M64.2,0 L4.8,0 C2.4,0 0.4,2.1 0.4,4.7 C0.4,7.3 2.3,9.4 4.8,9.4 L64.2,9.4 C66.6,9.4 68.5,7.3 68.5,4.7 C68.5,2.1 66.6,0 64.2,0 L64.2,0 Z M63.8,7.8 L5.2,7.8 C3.4,7.8 2,6.4 2,4.6 C2,2.8 3.4,1.4 5.2,1.4 L63.8,1.4 C65.6,1.4 67,2.8 67,4.6 C67,6.4 65.6,7.8 63.8,7.8 L63.8,7.8 Z" id="Shape" fill="#000000" opacity="0.2" mask="url(#mask-14)"></path> + </g> + </g> + <path d="M215.1,787.2 C197,787.2 182.3,801.9 182.3,820 C182.3,838.1 197,852.8 215.1,852.8 C233.2,852.8 248,838.1 248,820 C248,801.9 233.3,787.2 215.1,787.2 L215.1,787.2 Z M215.1,849.8 C198.6,849.8 185.3,836.5 185.3,820 C185.3,803.5 198.7,790.2 215.1,790.2 C231.5,790.2 245,803.5 245,820 C245,836.5 231.6,849.8 215.1,849.8 L215.1,849.8 Z" id="Shape" fill="url(#linearGradient-15)"></path> + <path d="M70.3,8.5 C38.2,8.5 12.2,34.5 12.2,66.6 L12.2,571.7 L322.6,8.5 L70.3,8.5 L70.3,8.5 Z" id="Shape" fill="url(#linearGradient-16)"></path> + </g> + <rect id="Rectangle-path" fill="#000000" x="27" y="105" width="375" height="667"></rect> + </g> + </g> +</svg>
diff --git a/third_party/WebKit/Source/devtools/front_end/emulated_devices/iPhone6Plus-landscape.svg b/third_party/WebKit/Source/devtools/front_end/emulated_devices/iPhone6Plus-landscape.svg new file mode 100644 index 0000000..35de751d --- /dev/null +++ b/third_party/WebKit/Source/devtools/front_end/emulated_devices/iPhone6Plus-landscape.svg
@@ -0,0 +1,118 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg width="956px" height="470px" viewBox="0 0 956 470" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> + <title>iPhone 6 Plus</title> + <defs> + <linearGradient x1="-0.00325805225%" y1="49.9995377%" x2="99.9938099%" y2="49.9995377%" id="linearGradient-1"> + <stop stop-color="#FFFFFF" stop-opacity="0.15" offset="0%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0" offset="11.69%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0.00509108" offset="87.64%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0.15" offset="100%"></stop> + </linearGradient> + <linearGradient x1="28.2585006%" y1="128.845717%" x2="71.7414993%" y2="-28.8467008%" id="linearGradient-2"> + <stop stop-color="#FFFFFF" stop-opacity="0.15" offset="0%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0.05" offset="13.73%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0.02" offset="88.31%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0.15" offset="100%"></stop> + </linearGradient> + <radialGradient cx="49.9966887%" cy="50.018543%" fx="49.9966887%" fy="50.018543%" r="49.9807947%" id="radialGradient-3"> + <stop stop-color="#5D5D5F" offset="0%"></stop> + <stop stop-color="#333333" stop-opacity="0.8" offset="100%"></stop> + </radialGradient> + <radialGradient cx="50.4421581%" cy="57.1386068%" fx="50.4421581%" fy="57.1386068%" r="49.9701987%" id="radialGradient-4"> + <stop stop-color="#000000" stop-opacity="0" offset="0%"></stop> + <stop stop-color="#020202" stop-opacity="0.4119" offset="51.49%"></stop> + <stop stop-color="#090909" stop-opacity="0.5603" offset="70.03%"></stop> + <stop stop-color="#141414" stop-opacity="0.666" offset="83.25%"></stop> + <stop stop-color="#252525" stop-opacity="0.7509" offset="93.87%"></stop> + <stop stop-color="#333333" stop-opacity="0.8" offset="100%"></stop> + </radialGradient> + <radialGradient cx="47.5719202%" cy="96.4177227%" fx="47.5719202%" fy="96.4177227%" r="95.6970109%" id="radialGradient-5"> + <stop stop-color="#FFFFFF" stop-opacity="0.3" offset="0%"></stop> + <stop stop-color="#000000" stop-opacity="0" offset="100%"></stop> + </radialGradient> + <radialGradient cx="50.5042293%" cy="23.9851238%" fx="50.5042293%" fy="23.9851238%" r="57.5643564%" id="radialGradient-6"> + <stop stop-color="#FFFFFF" stop-opacity="0.3" offset="0%"></stop> + <stop stop-color="#000000" stop-opacity="0" offset="100%"></stop> + </radialGradient> + <linearGradient x1="49.5644397%" y1="8.31811466%" x2="49.56633%" y2="112.128115%" id="linearGradient-7"> + <stop stop-color="#FFFFFF" stop-opacity="0.6" offset="0%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0.1" offset="100%"></stop> + </linearGradient> + <path id="path-8" d="M9.22,4.58 L9.22,63.2 C9.22,65.57 7.3,67.49 4.93,67.49 L4.93,67.49 C2.56,67.49 0.64,65.57 0.64,63.2 L0.64,4.58 C0.64,2.21 2.56,0.29 4.93,0.29 L4.93,0.29 C7.3,0.3 9.22,2.22 9.22,4.58 L9.22,4.58 Z"></path> + <linearGradient x1="101.420118%" y1="50.1973043%" x2="1.49257867%" y2="50.1973043%" id="linearGradient-10"> + <stop stop-color="#2E2E31" offset="0%"></stop> + <stop stop-color="#616161" offset="24.48%"></stop> + <stop stop-color="#858585" offset="81.37%"></stop> + <stop stop-color="#2E2E31" offset="100%"></stop> + </linearGradient> + <path id="path-11" d="M9.22,4.58 L9.22,63.2 C9.22,65.57 7.3,67.49 4.93,67.49 L4.93,67.49 C2.56,67.49 0.64,65.57 0.64,63.2 L0.64,4.58 C0.64,2.21 2.56,0.29 4.93,0.29 L4.93,0.29 C7.3,0.3 9.22,2.22 9.22,4.58 L9.22,4.58 Z"></path> + <path id="path-13" d="M9.22,4.58 L9.22,63.2 C9.22,65.57 7.3,67.49 4.93,67.49 L4.93,67.49 C2.56,67.49 0.64,65.57 0.64,63.2 L0.64,4.58 C0.64,2.21 2.56,0.29 4.93,0.29 L4.93,0.29 C7.3,0.3 9.22,2.22 9.22,4.58 L9.22,4.58 Z"></path> + <linearGradient x1="91.876637%" y1="13.615443%" x2="8.6218396%" y2="85.9514161%" id="linearGradient-15"> + <stop stop-color="#FFFFFF" stop-opacity="0.3" offset="14.7%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0" offset="40.73%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0.00509108" offset="74.45%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0.2" offset="100%"></stop> + </linearGradient> + <linearGradient x1="5.94928391%" y1="2.26524773%" x2="44.6162595%" y2="41.2217771%" id="linearGradient-16"> + <stop stop-color="#FFFFFF" stop-opacity="0.15" offset="0%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0" offset="100%"></stop> + </linearGradient> + </defs> + <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> + <g id="iphone6plus-landscape" transform="translate(1.000000, 0.000000)"> + <g id="Group"> + <g> + <g> + <path d="M144.74,464.27 L144.74,467.99 C144.74,469.02 143.91,469.85 142.88,469.85 L112.92,469.85 C111.89,469.85 111.06,469.02 111.06,467.99 L111.06,464.27 L144.74,464.27 L144.74,464.27 Z" id="Shape" fill="#808086"></path> + <path d="M187.97,469.85 C186.94,469.85 186.11,469.02 186.11,467.99 L186.11,464.27 L247.24,464.27 L247.24,467.99 C247.24,469.02 246.41,469.85 245.38,469.85" id="Shape" fill="#808086"></path> + <path d="M262.73,469.85 C261.7,469.85 260.87,469.02 260.87,467.99 L260.87,464.27 L322,464.27 L322,467.99 C322,469.02 321.17,469.85 320.14,469.85" id="Shape" fill="#808086"></path> + <path d="M187.47,5.73 L187.47,2.01 C187.47,0.98 188.3,0.15 189.33,0.15 L246.74,0.15 C247.77,0.15 248.6,0.98 248.6,2.01 L248.6,5.73 L187.47,5.73 L187.47,5.73 Z" id="Shape" fill="#818187"></path> + <path d="M65.18,467.44 C29.37,467.44 0.24,438.31 0.24,402.51 L0.24,68.05 C0.24,32.24 29.37,3.11 65.18,3.11 L888.81,3.11 C924.62,3.11 953.75,32.24 953.75,68.05 L953.75,402.5 C953.75,438.31 924.62,467.43 888.81,467.43 L65.18,467.43 L65.18,467.44 Z" id="Shape" stroke-opacity="0.5" stroke="#666666" fill="#B2B2B2"></path> + <path d="M948.57,402.69 C948.57,418.6 942.37,433.56 931.12,444.81 C919.87,456.06 904.91,462.26 889,462.26 L65,462.26 C49.09,462.26 34.13,456.06 22.88,444.81 C11.63,433.56 5.43,418.6 5.43,402.69 L5.43,67.86 C5.43,51.95 11.63,36.99 22.88,25.74 C34.13,14.49 49.09,8.29 65,8.29 L889,8.29 C904.91,8.29 919.87,14.49 931.12,25.74 C942.37,36.99 948.57,51.95 948.57,67.86 L948.57,402.69 L948.57,402.69 Z" id="Shape" fill="#404040"></path> + <path d="M948.75,68.05 L948.75,402.5 C948.75,435.6 921.92,462.44 888.81,462.44 L65.18,462.44 C32.08,462.44 5.24,435.61 5.24,402.5 L5.24,68.05 C5.24,34.95 32.07,8.11 65.18,8.11 L888.81,8.11 C921.92,8.11 948.75,34.94 948.75,68.05 L948.75,68.05 Z" id="Shape" fill="#262626"></path> + <path d="M5.25,67.86 L5.25,402.69 C5.25,435.69 32,462.44 65,462.44 L66.64,462.44 C33.64,462.44 6.89,435.69 6.89,402.69 L6.89,67.86 C6.89,34.86 33.64,8.11 66.64,8.11 L65,8.11 C32,8.11 5.25,34.86 5.25,67.86 L5.25,67.86 Z" id="Shape" fill="url(#linearGradient-1)"></path> + <path d="M8.8,67.86 L8.8,402.69 C8.8,433.68 34.01,458.89 65,458.89 L889,458.89 C919.99,458.89 945.2,433.68 945.2,402.69 L945.2,67.86 C945.2,36.87 919.99,11.66 889,11.66 L65,11.66 C34.01,11.66 8.8,36.87 8.8,67.86 L8.8,67.86 Z M889,17.66 C916.68,17.66 939.2,40.18 939.2,67.86 L939.2,402.69 C939.2,430.37 916.68,452.89 889,452.89 L65,452.89 C37.32,452.89 14.8,430.37 14.8,402.69 L14.8,67.86 C14.8,40.18 37.32,17.66 65,17.66 L889,17.66 L889,17.66 Z" id="Shape" fill="url(#linearGradient-2)"></path> + <g transform="translate(46.000000, 295.000000)"> + <circle id="Oval" fill="url(#radialGradient-3)" cx="8.19" cy="8.2" r="7.55"></circle> + <circle id="Oval" fill="url(#radialGradient-4)" opacity="0.8" cx="8.19" cy="8.2" r="7.55"></circle> + <circle id="Oval" fill="#1B1A1F" cx="8.19" cy="8.2" r="5.03"></circle> + <circle id="Oval" fill="#36284C" cx="8.19" cy="8.2" r="3.68"></circle> + <circle id="Oval" fill="url(#radialGradient-5)" cx="8.19" cy="8.2" r="3.68"></circle> + <g transform="translate(6.000000, 6.000000)" id="Shape"> + <path d="M4.21,2.2 C4.21,3.32 3.3,4.22 2.19,4.22 C1.07,4.22 0.17,3.31 0.17,2.2 C0.17,1.08 1.08,0.18 2.19,0.18 C3.31,0.18 4.21,1.09 4.21,2.2 L4.21,2.2 Z" fill="#141414" opacity="0.5"></path> + <path d="M4.21,2.2 C4.21,3.32 3.3,4.22 2.19,4.22 C1.07,4.22 0.17,3.31 0.17,2.2 C0.17,1.08 1.08,0.18 2.19,0.18 C3.31,0.18 4.21,1.09 4.21,2.2 L4.21,2.2 Z" fill="url(#radialGradient-6)"></path> + </g> + <path d="M8.19,6.68 C7.74,6.68 7.35,6.88 7.07,7.19 L7.54,7.66 C7.7,7.47 7.92,7.35 8.18,7.35 C8.45,7.35 8.68,7.49 8.84,7.68 L9.31,7.2 C9.04,6.9 8.65,6.68 8.19,6.68 L8.19,6.68 Z" id="Shape" fill="url(#linearGradient-7)"></path> + </g> + <g transform="translate(50.000000, 201.000000)" id="Clipped"> + <g> + <mask id="mask-9" fill="white"> + <use xlink:href="#path-8"></use> + </mask> + <g id="SVGID_8_"></g> + <path d="M9.22,4.58 L9.22,63.2 C9.22,65.57 7.3,67.49 4.93,67.49 L4.93,67.49 C2.56,67.49 0.64,65.57 0.64,63.2 L0.64,4.58 C0.64,2.21 2.56,0.29 4.93,0.29 L4.93,0.29 C7.3,0.3 9.22,2.22 9.22,4.58 L9.22,4.58 Z" id="Shape" fill="url(#linearGradient-10)" opacity="0.8" mask="url(#mask-9)"></path> + </g> + <g> + <mask id="mask-12" fill="white"> + <use xlink:href="#path-11"></use> + </mask> + <g id="SVGID_8_"></g> + <path d="M0.53,66.08 L0.53,67.55 L2,67.55 L2,66.08 L0.53,66.08 L0.53,66.08 Z M0.53,63.15 L0.53,64.62 L2,64.62 L2,63.15 L0.53,63.15 L0.53,63.15 Z M0.53,60.21 L0.53,61.68 L2,61.68 L2,60.21 L0.53,60.21 L0.53,60.21 Z M0.53,57.28 L0.53,58.75 L2,58.75 L2,57.28 L0.53,57.28 L0.53,57.28 Z M0.53,54.34 L0.53,55.81 L2,55.81 L2,54.34 L0.53,54.34 L0.53,54.34 Z M0.53,51.41 L0.53,52.88 L2,52.88 L2,51.41 L0.53,51.41 L0.53,51.41 Z M0.53,48.47 L0.53,49.94 L2,49.94 L2,48.47 L0.53,48.47 L0.53,48.47 Z M0.53,45.54 L0.53,47.01 L2,47.01 L2,45.54 L0.53,45.54 L0.53,45.54 Z M0.53,42.6 L0.53,44.07 L2,44.07 L2,42.6 L0.53,42.6 L0.53,42.6 Z M0.53,39.67 L0.53,41.14 L2,41.14 L2,39.67 L0.53,39.67 L0.53,39.67 Z M0.53,36.73 L0.53,38.2 L2,38.2 L2,36.73 L0.53,36.73 L0.53,36.73 Z M0.53,33.8 L0.53,35.27 L2,35.27 L2,33.8 L0.53,33.8 L0.53,33.8 Z M0.53,30.86 L0.53,32.33 L2,32.33 L2,30.86 L0.53,30.86 L0.53,30.86 Z M0.53,27.93 L0.53,29.4 L2,29.4 L2,27.93 L0.53,27.93 L0.53,27.93 Z M0.53,24.99 L0.53,26.46 L2,26.46 L2,24.99 L0.53,24.99 L0.53,24.99 Z M0.53,22.06 L0.53,23.53 L2,23.53 L2,22.06 L0.53,22.06 L0.53,22.06 Z M0.53,19.12 L0.53,20.59 L2,20.59 L2,19.12 L0.53,19.12 L0.53,19.12 Z M0.53,16.19 L0.53,17.66 L2,17.66 L2,16.19 L0.53,16.19 L0.53,16.19 Z M0.53,13.25 L0.53,14.72 L2,14.72 L2,13.25 L0.53,13.25 L0.53,13.25 Z M0.53,10.32 L0.53,11.79 L2,11.79 L2,10.32 L0.53,10.32 L0.53,10.32 Z M0.53,7.38 L0.53,8.85 L2,8.85 L2,7.38 L0.53,7.38 L0.53,7.38 Z M0.53,4.45 L0.53,5.92 L2,5.92 L2,4.45 L0.53,4.45 L0.53,4.45 Z M0.53,1.51 L0.53,2.98 L2,2.98 L2,1.51 L0.53,1.51 L0.53,1.51 Z M2,64.61 L2,66.08 L3.47,66.08 L3.47,64.61 L2,64.61 L2,64.61 Z M2,61.68 L2,63.15 L3.47,63.15 L3.47,61.68 L2,61.68 L2,61.68 Z M2,58.74 L2,60.21 L3.47,60.21 L3.47,58.74 L2,58.74 L2,58.74 Z M2,55.81 L2,57.28 L3.47,57.28 L3.47,55.81 L2,55.81 L2,55.81 Z M2,52.87 L2,54.34 L3.47,54.34 L3.47,52.87 L2,52.87 L2,52.87 Z M2,49.94 L2,51.41 L3.47,51.41 L3.47,49.94 L2,49.94 L2,49.94 Z M2,47.01 L2,48.48 L3.47,48.48 L3.47,47.01 L2,47.01 L2,47.01 Z M2,44.07 L2,45.54 L3.47,45.54 L3.47,44.07 L2,44.07 L2,44.07 Z M2,41.14 L2,42.61 L3.47,42.61 L3.47,41.14 L2,41.14 L2,41.14 Z M2,38.2 L2,39.67 L3.47,39.67 L3.47,38.2 L2,38.2 L2,38.2 Z M2,35.27 L2,36.74 L3.47,36.74 L3.47,35.27 L2,35.27 L2,35.27 Z M2,32.33 L2,33.8 L3.47,33.8 L3.47,32.33 L2,32.33 L2,32.33 Z M2,29.4 L2,30.87 L3.47,30.87 L3.47,29.4 L2,29.4 L2,29.4 Z M2,26.46 L2,27.93 L3.47,27.93 L3.47,26.46 L2,26.46 L2,26.46 Z M2,23.53 L2,25 L3.47,25 L3.47,23.53 L2,23.53 L2,23.53 Z M2,20.59 L2,22.06 L3.47,22.06 L3.47,20.59 L2,20.59 L2,20.59 Z M2,17.66 L2,19.13 L3.47,19.13 L3.47,17.66 L2,17.66 L2,17.66 Z M2,14.72 L2,16.19 L3.47,16.19 L3.47,14.72 L2,14.72 L2,14.72 Z M2,11.79 L2,13.26 L3.47,13.26 L3.47,11.79 L2,11.79 L2,11.79 Z M2,8.85 L2,10.32 L3.47,10.32 L3.47,8.85 L2,8.85 L2,8.85 Z M2,5.92 L2,7.39 L3.47,7.39 L3.47,5.92 L2,5.92 L2,5.92 Z M2,2.98 L2,4.45 L3.47,4.45 L3.47,2.98 L2,2.98 L2,2.98 Z M2,0.05 L2,1.52 L3.47,1.52 L3.47,0.05 L2,0.05 L2,0.05 Z M3.46,66.08 L3.46,67.55 L4.93,67.55 L4.93,66.08 L3.46,66.08 L3.46,66.08 Z M3.46,63.15 L3.46,64.62 L4.93,64.62 L4.93,63.15 L3.46,63.15 L3.46,63.15 Z M3.46,60.21 L3.46,61.68 L4.93,61.68 L4.93,60.21 L3.46,60.21 L3.46,60.21 Z M3.46,57.28 L3.46,58.75 L4.93,58.75 L4.93,57.28 L3.46,57.28 L3.46,57.28 Z M3.46,54.34 L3.46,55.81 L4.93,55.81 L4.93,54.34 L3.46,54.34 L3.46,54.34 Z M3.46,51.41 L3.46,52.88 L4.93,52.88 L4.93,51.41 L3.46,51.41 L3.46,51.41 Z M3.46,48.47 L3.46,49.94 L4.93,49.94 L4.93,48.47 L3.46,48.47 L3.46,48.47 Z M3.46,45.54 L3.46,47.01 L4.93,47.01 L4.93,45.54 L3.46,45.54 L3.46,45.54 Z M3.46,42.6 L3.46,44.07 L4.93,44.07 L4.93,42.6 L3.46,42.6 L3.46,42.6 Z M3.46,39.67 L3.46,41.14 L4.93,41.14 L4.93,39.67 L3.46,39.67 L3.46,39.67 Z M3.46,36.73 L3.46,38.2 L4.93,38.2 L4.93,36.73 L3.46,36.73 L3.46,36.73 Z M3.46,33.8 L3.46,35.27 L4.93,35.27 L4.93,33.8 L3.46,33.8 L3.46,33.8 Z M3.46,30.86 L3.46,32.33 L4.93,32.33 L4.93,30.86 L3.46,30.86 L3.46,30.86 Z M3.46,27.93 L3.46,29.4 L4.93,29.4 L4.93,27.93 L3.46,27.93 L3.46,27.93 Z M3.46,24.99 L3.46,26.46 L4.93,26.46 L4.93,24.99 L3.46,24.99 L3.46,24.99 Z M3.46,22.06 L3.46,23.53 L4.93,23.53 L4.93,22.06 L3.46,22.06 L3.46,22.06 Z M3.46,19.12 L3.46,20.59 L4.93,20.59 L4.93,19.12 L3.46,19.12 L3.46,19.12 Z M3.46,16.19 L3.46,17.66 L4.93,17.66 L4.93,16.19 L3.46,16.19 L3.46,16.19 Z M3.46,13.25 L3.46,14.72 L4.93,14.72 L4.93,13.25 L3.46,13.25 L3.46,13.25 Z M3.46,10.32 L3.46,11.79 L4.93,11.79 L4.93,10.32 L3.46,10.32 L3.46,10.32 Z M3.46,7.38 L3.46,8.85 L4.93,8.85 L4.93,7.38 L3.46,7.38 L3.46,7.38 Z M3.46,4.45 L3.46,5.92 L4.93,5.92 L4.93,4.45 L3.46,4.45 L3.46,4.45 Z M3.46,1.51 L3.46,2.98 L4.93,2.98 L4.93,1.51 L3.46,1.51 L3.46,1.51 Z M4.93,64.61 L4.93,66.08 L6.4,66.08 L6.4,64.61 L4.93,64.61 L4.93,64.61 Z M4.93,61.68 L4.93,63.15 L6.4,63.15 L6.4,61.68 L4.93,61.68 L4.93,61.68 Z M4.93,58.74 L4.93,60.21 L6.4,60.21 L6.4,58.74 L4.93,58.74 L4.93,58.74 Z M4.93,55.81 L4.93,57.28 L6.4,57.28 L6.4,55.81 L4.93,55.81 L4.93,55.81 Z M4.93,52.87 L4.93,54.34 L6.4,54.34 L6.4,52.87 L4.93,52.87 L4.93,52.87 Z M4.93,49.94 L4.93,51.41 L6.4,51.41 L6.4,49.94 L4.93,49.94 L4.93,49.94 Z M4.93,47.01 L4.93,48.48 L6.4,48.48 L6.4,47.01 L4.93,47.01 L4.93,47.01 Z M4.93,44.07 L4.93,45.54 L6.4,45.54 L6.4,44.07 L4.93,44.07 L4.93,44.07 Z M4.93,41.14 L4.93,42.61 L6.4,42.61 L6.4,41.14 L4.93,41.14 L4.93,41.14 Z M4.93,38.2 L4.93,39.67 L6.4,39.67 L6.4,38.2 L4.93,38.2 L4.93,38.2 Z M4.93,35.27 L4.93,36.74 L6.4,36.74 L6.4,35.27 L4.93,35.27 L4.93,35.27 Z M4.93,32.33 L4.93,33.8 L6.4,33.8 L6.4,32.33 L4.93,32.33 L4.93,32.33 Z M4.93,29.4 L4.93,30.87 L6.4,30.87 L6.4,29.4 L4.93,29.4 L4.93,29.4 Z M4.93,26.46 L4.93,27.93 L6.4,27.93 L6.4,26.46 L4.93,26.46 L4.93,26.46 Z M4.93,23.53 L4.93,25 L6.4,25 L6.4,23.53 L4.93,23.53 L4.93,23.53 Z M4.93,20.59 L4.93,22.06 L6.4,22.06 L6.4,20.59 L4.93,20.59 L4.93,20.59 Z M4.93,17.66 L4.93,19.13 L6.4,19.13 L6.4,17.66 L4.93,17.66 L4.93,17.66 Z M4.93,14.72 L4.93,16.19 L6.4,16.19 L6.4,14.72 L4.93,14.72 L4.93,14.72 Z M4.93,11.79 L4.93,13.26 L6.4,13.26 L6.4,11.79 L4.93,11.79 L4.93,11.79 Z M4.93,8.85 L4.93,10.32 L6.4,10.32 L6.4,8.85 L4.93,8.85 L4.93,8.85 Z M4.93,5.92 L4.93,7.39 L6.4,7.39 L6.4,5.92 L4.93,5.92 L4.93,5.92 Z M4.93,2.98 L4.93,4.45 L6.4,4.45 L6.4,2.98 L4.93,2.98 L4.93,2.98 Z M4.93,0.05 L4.93,1.52 L6.4,1.52 L6.4,0.05 L4.93,0.05 L4.93,0.05 Z M6.4,66.08 L6.4,67.55 L7.87,67.55 L7.87,66.08 L6.4,66.08 L6.4,66.08 Z M6.4,63.15 L6.4,64.62 L7.87,64.62 L7.87,63.15 L6.4,63.15 L6.4,63.15 Z M6.4,60.21 L6.4,61.68 L7.87,61.68 L7.87,60.21 L6.4,60.21 L6.4,60.21 Z M6.4,57.28 L6.4,58.75 L7.87,58.75 L7.87,57.28 L6.4,57.28 L6.4,57.28 Z M6.4,54.34 L6.4,55.81 L7.87,55.81 L7.87,54.34 L6.4,54.34 L6.4,54.34 Z M6.4,51.41 L6.4,52.88 L7.87,52.88 L7.87,51.41 L6.4,51.41 L6.4,51.41 Z M6.4,48.47 L6.4,49.94 L7.87,49.94 L7.87,48.47 L6.4,48.47 L6.4,48.47 Z M6.4,45.54 L6.4,47.01 L7.87,47.01 L7.87,45.54 L6.4,45.54 L6.4,45.54 Z M6.4,42.6 L6.4,44.07 L7.87,44.07 L7.87,42.6 L6.4,42.6 L6.4,42.6 Z M6.4,39.67 L6.4,41.14 L7.87,41.14 L7.87,39.67 L6.4,39.67 L6.4,39.67 Z M6.4,36.73 L6.4,38.2 L7.87,38.2 L7.87,36.73 L6.4,36.73 L6.4,36.73 Z M6.4,33.8 L6.4,35.27 L7.87,35.27 L7.87,33.8 L6.4,33.8 L6.4,33.8 Z M6.4,30.86 L6.4,32.33 L7.87,32.33 L7.87,30.86 L6.4,30.86 L6.4,30.86 Z M6.4,27.93 L6.4,29.4 L7.87,29.4 L7.87,27.93 L6.4,27.93 L6.4,27.93 Z M6.4,24.99 L6.4,26.46 L7.87,26.46 L7.87,24.99 L6.4,24.99 L6.4,24.99 Z M6.4,22.06 L6.4,23.53 L7.87,23.53 L7.87,22.06 L6.4,22.06 L6.4,22.06 Z M6.4,19.12 L6.4,20.59 L7.87,20.59 L7.87,19.12 L6.4,19.12 L6.4,19.12 Z M6.4,16.19 L6.4,17.66 L7.87,17.66 L7.87,16.19 L6.4,16.19 L6.4,16.19 Z M6.4,13.25 L6.4,14.72 L7.87,14.72 L7.87,13.25 L6.4,13.25 L6.4,13.25 Z M6.4,10.32 L6.4,11.79 L7.87,11.79 L7.87,10.32 L6.4,10.32 L6.4,10.32 Z M6.4,7.38 L6.4,8.85 L7.87,8.85 L7.87,7.38 L6.4,7.38 L6.4,7.38 Z M6.4,4.45 L6.4,5.92 L7.87,5.92 L7.87,4.45 L6.4,4.45 L6.4,4.45 Z M6.4,1.51 L6.4,2.98 L7.87,2.98 L7.87,1.51 L6.4,1.51 L6.4,1.51 Z M7.87,64.61 L7.87,66.08 L9.34,66.08 L9.34,64.61 L7.87,64.61 L7.87,64.61 Z M7.87,61.68 L7.87,63.15 L9.34,63.15 L9.34,61.68 L7.87,61.68 L7.87,61.68 Z M7.87,58.74 L7.87,60.21 L9.34,60.21 L9.34,58.74 L7.87,58.74 L7.87,58.74 Z M7.87,55.81 L7.87,57.28 L9.34,57.28 L9.34,55.81 L7.87,55.81 L7.87,55.81 Z M7.87,52.87 L7.87,54.34 L9.34,54.34 L9.34,52.87 L7.87,52.87 L7.87,52.87 Z M7.87,49.94 L7.87,51.41 L9.34,51.41 L9.34,49.94 L7.87,49.94 L7.87,49.94 Z M7.87,47.01 L7.87,48.48 L9.34,48.48 L9.34,47.01 L7.87,47.01 L7.87,47.01 Z M7.87,44.07 L7.87,45.54 L9.34,45.54 L9.34,44.07 L7.87,44.07 L7.87,44.07 Z M7.87,41.14 L7.87,42.61 L9.34,42.61 L9.34,41.14 L7.87,41.14 L7.87,41.14 Z M7.87,38.2 L7.87,39.67 L9.34,39.67 L9.34,38.2 L7.87,38.2 L7.87,38.2 Z M7.87,35.27 L7.87,36.74 L9.34,36.74 L9.34,35.27 L7.87,35.27 L7.87,35.27 Z M7.87,32.33 L7.87,33.8 L9.34,33.8 L9.34,32.33 L7.87,32.33 L7.87,32.33 Z M7.87,29.4 L7.87,30.87 L9.34,30.87 L9.34,29.4 L7.87,29.4 L7.87,29.4 Z M7.87,26.46 L7.87,27.93 L9.34,27.93 L9.34,26.46 L7.87,26.46 L7.87,26.46 Z M7.87,23.53 L7.87,25 L9.34,25 L9.34,23.53 L7.87,23.53 L7.87,23.53 Z M7.87,20.59 L7.87,22.06 L9.34,22.06 L9.34,20.59 L7.87,20.59 L7.87,20.59 Z M7.87,17.66 L7.87,19.13 L9.34,19.13 L9.34,17.66 L7.87,17.66 L7.87,17.66 Z M7.87,14.72 L7.87,16.19 L9.34,16.19 L9.34,14.72 L7.87,14.72 L7.87,14.72 Z M7.87,11.79 L7.87,13.26 L9.34,13.26 L9.34,11.79 L7.87,11.79 L7.87,11.79 Z M7.87,8.85 L7.87,10.32 L9.34,10.32 L9.34,8.85 L7.87,8.85 L7.87,8.85 Z M7.87,5.92 L7.87,7.39 L9.34,7.39 L9.34,5.92 L7.87,5.92 L7.87,5.92 Z M7.87,2.98 L7.87,4.45 L9.34,4.45 L9.34,2.98 L7.87,2.98 L7.87,2.98 Z M7.87,0.05 L7.87,1.52 L9.34,1.52 L9.34,0.05 L7.87,0.05 L7.87,0.05 Z" id="Shape" fill="#2E2E2E" mask="url(#mask-12)"></path> + </g> + <g> + <mask id="mask-14" fill="white"> + <use xlink:href="#path-13"></use> + </mask> + <g id="SVGID_8_"></g> + <path d="M0.29,4.17 L0.29,63.61 C0.29,66.01 2.37,67.96 4.94,67.96 C7.51,67.96 9.59,66.01 9.59,63.61 L9.59,4.17 C9.59,1.77 7.51,-0.18 4.94,-0.18 C2.37,-0.18 0.29,1.77 0.29,4.17 L0.29,4.17 Z M8.13,4.58 L8.13,63.2 C8.13,64.96 6.7,66.4 4.93,66.4 C3.16,66.4 1.73,64.97 1.73,63.2 L1.73,4.58 C1.73,2.82 3.16,1.38 4.93,1.38 C6.7,1.38 8.13,2.82 8.13,4.58 L8.13,4.58 Z" id="Shape" fill="#000000" opacity="0.2" mask="url(#mask-14)"></path> + </g> + </g> + <path d="M865.53,235.27 C865.53,253.4 880.23,268.1 898.36,268.1 C916.49,268.1 931.19,253.4 931.19,235.27 C931.19,217.14 916.49,202.44 898.36,202.44 C880.23,202.45 865.53,217.14 865.53,235.27 L865.53,235.27 Z M928.18,235.27 C928.18,251.74 914.83,265.09 898.36,265.09 C881.89,265.09 868.54,251.74 868.54,235.27 C868.54,218.8 881.89,205.45 898.36,205.45 C914.83,205.45 928.18,218.8 928.18,235.27 L928.18,235.27 Z" id="Shape" fill="url(#linearGradient-15)"></path> + </g> + <path d="M65.18,8.11 C32.08,8.11 5.24,34.94 5.24,68.05 L5.24,402.5 C5.24,435.6 32.07,462.44 65.18,462.44 L334.64,462.44 L598.74,8.11 L65.18,8.11 L65.18,8.11 Z" id="Shape" fill="url(#linearGradient-16)"></path> + </g> + <rect id="Rectangle-path" fill="#000000" x="108.69" y="28.81" width="736" height="414"></rect> + </g> + </g> + </g> +</svg>
diff --git a/third_party/WebKit/Source/devtools/front_end/emulated_devices/iPhone6Plus-portrait.svg b/third_party/WebKit/Source/devtools/front_end/emulated_devices/iPhone6Plus-portrait.svg new file mode 100644 index 0000000..683309f --- /dev/null +++ b/third_party/WebKit/Source/devtools/front_end/emulated_devices/iPhone6Plus-portrait.svg
@@ -0,0 +1,116 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg width="470px" height="954px" viewBox="0 0 470 954" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> + <title>iPhone 6 Plus</title> + <defs> + <linearGradient x1="50.0004402%" y1="-0.00765597003%" x2="50.0004402%" y2="99.9887604%" id="linearGradient-1"> + <stop stop-color="#FFFFFF" stop-opacity="0.15" offset="0%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0" offset="11.69%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0.00509108" offset="87.64%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0.15" offset="100%"></stop> + </linearGradient> + <linearGradient x1="-28.8457617%" y1="28.2592375%" x2="128.846656%" y2="71.7422576%" id="linearGradient-2"> + <stop stop-color="#FFFFFF" stop-opacity="0.15" offset="0%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0.05" offset="13.73%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0.02" offset="88.31%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0.15" offset="100%"></stop> + </linearGradient> + <radialGradient cx="49.981457%" cy="49.9768212%" fx="49.981457%" fy="49.9768212%" r="49.9807947%" id="radialGradient-3"> + <stop stop-color="#5D5D5F" offset="0%"></stop> + <stop stop-color="#333333" stop-opacity="0.8" offset="100%"></stop> + </radialGradient> + <radialGradient cx="50.426664%" cy="57.0966105%" fx="50.426664%" fy="57.0966105%" r="49.9701987%" id="radialGradient-4"> + <stop stop-color="#000000" stop-opacity="0" offset="0%"></stop> + <stop stop-color="#020202" stop-opacity="0.4119" offset="51.49%"></stop> + <stop stop-color="#090909" stop-opacity="0.5603" offset="70.03%"></stop> + <stop stop-color="#141414" stop-opacity="0.666" offset="83.25%"></stop> + <stop stop-color="#252525" stop-opacity="0.7509" offset="93.87%"></stop> + <stop stop-color="#333333" stop-opacity="0.8" offset="100%"></stop> + </radialGradient> + <radialGradient cx="47.6564342%" cy="96.2967075%" fx="47.6564342%" fy="96.2967075%" r="95.6970109%" id="radialGradient-5"> + <stop stop-color="#FFFFFF" stop-opacity="0.3" offset="0%"></stop> + <stop stop-color="#000000" stop-opacity="0" offset="100%"></stop> + </radialGradient> + <radialGradient cx="50.6606714%" cy="23.7662009%" fx="50.6606714%" fy="23.7662009%" r="57.5643564%" id="radialGradient-6"> + <stop stop-color="#FFFFFF" stop-opacity="0.3" offset="0%"></stop> + <stop stop-color="#000000" stop-opacity="0" offset="100%"></stop> + </radialGradient> + <linearGradient x1="49.8466941%" y1="7.41101415%" x2="49.8485846%" y2="111.231014%" id="linearGradient-7"> + <stop stop-color="#FFFFFF" stop-opacity="0.6" offset="0%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0.1" offset="100%"></stop> + </linearGradient> + <path id="path-8" d="M63.42,9.02 L4.8,9.02 C2.43,9.02 0.51,7.1 0.51,4.73 L0.51,4.73 C0.51,2.36 2.43,0.44 4.8,0.44 L63.42,0.44 C65.79,0.44 67.71,2.36 67.71,4.73 L67.71,4.73 C67.7,7.1 65.78,9.02 63.42,9.02 L63.42,9.02 Z"></path> + <linearGradient x1="50.0105141%" y1="99.9084218%" x2="50.0105141%" y2="-0.0179701632%" id="linearGradient-10"> + <stop stop-color="#2E2E31" offset="0%"></stop> + <stop stop-color="#616161" offset="24.48%"></stop> + <stop stop-color="#858585" offset="81.37%"></stop> + <stop stop-color="#2E2E31" offset="100%"></stop> + </linearGradient> + <path id="path-11" d="M63.42,9.02 L4.8,9.02 C2.43,9.02 0.51,7.1 0.51,4.73 L0.51,4.73 C0.51,2.36 2.43,0.44 4.8,0.44 L63.42,0.44 C65.79,0.44 67.71,2.36 67.71,4.73 L67.71,4.73 C67.7,7.1 65.78,9.02 63.42,9.02 L63.42,9.02 Z"></path> + <path id="path-13" d="M63.42,9.02 L4.8,9.02 C2.43,9.02 0.51,7.1 0.51,4.73 L0.51,4.73 C0.51,2.36 2.43,0.44 4.8,0.44 L63.42,0.44 C65.79,0.44 67.71,2.36 67.71,4.73 L67.71,4.73 C67.7,7.1 65.78,9.02 63.42,9.02 L63.42,9.02 Z"></path> + <linearGradient x1="86.3842522%" y1="91.8719159%" x2="14.0484313%" y2="8.61742309%" id="linearGradient-15"> + <stop stop-color="#FFFFFF" stop-opacity="0.3" offset="14.7%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0" offset="40.73%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0.00509108" offset="74.45%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0.2" offset="100%"></stop> + </linearGradient> + <linearGradient x1="-34.1635743%" y1="-2.09409175%" x2="28.8478289%" y2="36.9074705%" id="linearGradient-16"> + <stop stop-color="#FFFFFF" stop-opacity="0.15" offset="0%"></stop> + <stop stop-color="#FFFFFF" stop-opacity="0" offset="100%"></stop> + </linearGradient> + </defs> + <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> + <g id="iphone6plus-portrait"> + <g id="Group"> + <path d="M5.73,144.54 L2.01,144.54 C0.98,144.54 0.15,143.71 0.15,142.68 L0.15,112.72 C0.15,111.69 0.98,110.86 2.01,110.86 L5.73,110.86 L5.73,144.54 L5.73,144.54 Z" id="Shape" fill="#808086"></path> + <path d="M0.15,187.77 C0.15,186.74 0.98,185.91 2.01,185.91 L5.73,185.91 L5.73,247.04 L2.01,247.04 C0.98,247.04 0.15,246.21 0.15,245.18" id="Shape" fill="#808086"></path> + <path d="M0.15,262.53 C0.15,261.5 0.98,260.67 2.01,260.67 L5.73,260.67 L5.73,321.8 L2.01,321.8 C0.98,321.8 0.15,320.97 0.15,319.94" id="Shape" fill="#808086"></path> + <path d="M464.27,187.27 L467.99,187.27 C469.02,187.27 469.85,188.1 469.85,189.13 L469.85,246.54 C469.85,247.57 469.02,248.4 467.99,248.4 L464.27,248.4 L464.27,187.27 L464.27,187.27 Z" id="Shape" fill="#818187"></path> + <g transform="translate(2.000000, 0.000000)" id="Shape"> + <path d="M65.5,953.05 C29.97,953.05 1.06,924.14 1.06,888.61 L1.06,64.98 C1.06,29.45 29.97,0.54 65.5,0.54 L399.96,0.54 C435.49,0.54 464.39,29.45 464.39,64.98 L464.39,888.61 C464.39,924.14 435.48,953.05 399.96,953.05 L65.5,953.05 L65.5,953.05 Z" fill="#B2B2B2"></path> + <path d="M399.96,1.05 C435.21,1.05 463.89,29.73 463.89,64.99 L463.89,888.62 C463.89,923.87 435.21,952.56 399.96,952.56 L65.5,952.56 C30.25,952.56 1.56,923.88 1.56,888.62 L1.56,64.98 C1.56,29.73 30.24,1.04 65.5,1.04 L399.96,1.04 L399.96,1.05 Z M399.96,0.05 L65.5,0.05 C29.69,0.05 0.56,29.18 0.56,64.99 L0.56,888.62 C0.56,924.43 29.69,953.56 65.5,953.56 L399.96,953.56 C435.76,953.56 464.89,924.43 464.89,888.62 L464.89,64.98 C464.89,29.18 435.76,0.05 399.96,0.05 L399.96,0.05 L399.96,0.05 Z" fill="#666666"></path> + </g> + <path d="M401.95,948.55 L67.5,948.55 C34.4,948.55 7.56,921.72 7.56,888.61 L7.56,64.98 C7.56,31.88 34.39,5.04 67.5,5.04 L401.96,5.04 C435.06,5.04 461.9,31.87 461.9,64.98 L461.9,888.61 C461.89,921.71 435.06,948.55 401.95,948.55 L401.95,948.55 Z" id="Shape" fill="#262626"></path> + <path d="M402.14,5.05 L67.31,5.05 C34.31,5.05 7.56,31.8 7.56,64.8 L7.56,66.44 C7.56,33.44 34.31,6.69 67.31,6.69 L402.14,6.69 C435.14,6.69 461.89,33.44 461.89,66.44 L461.89,64.8 C461.89,31.8 435.14,5.05 402.14,5.05 L402.14,5.05 Z" id="Shape" fill="url(#linearGradient-1)"></path> + <path d="M402.14,8.59 L67.31,8.59 C36.32,8.59 11.11,33.8 11.11,64.79 L11.11,888.79 C11.11,919.78 36.32,944.99 67.31,944.99 L402.14,944.99 C433.13,944.99 458.34,919.78 458.34,888.79 L458.34,64.79 C458.34,33.81 433.13,8.59 402.14,8.59 L402.14,8.59 Z M452.34,888.8 C452.34,916.48 429.82,939 402.14,939 L67.31,939 C39.63,939 17.11,916.48 17.11,888.8 L17.11,64.8 C17.11,37.12 39.63,14.6 67.31,14.6 L402.14,14.6 C429.82,14.6 452.34,37.12 452.34,64.8 L452.34,888.8 L452.34,888.8 Z" id="Shape" fill="url(#linearGradient-2)"></path> + <g transform="translate(159.000000, 46.000000)"> + <circle id="Oval" fill="url(#radialGradient-3)" cx="7.8" cy="7.99" r="7.55"></circle> + <circle id="Oval" fill="url(#radialGradient-4)" opacity="0.8" cx="7.8" cy="7.99" r="7.55"></circle> + <circle id="Oval" fill="#1B1A1F" cx="7.8" cy="7.99" r="5.03"></circle> + <circle id="Oval" fill="#36284C" cx="7.8" cy="7.99" r="3.68"></circle> + <circle id="Oval" fill="url(#radialGradient-5)" cx="7.8" cy="7.99" r="3.68"></circle> + <g transform="translate(5.000000, 5.000000)" id="Shape"> + <path d="M4.82,2.99 C4.82,4.11 3.91,5.01 2.8,5.01 C1.68,5.01 0.78,4.1 0.78,2.99 C0.78,1.87 1.69,0.97 2.8,0.97 C3.91,0.96 4.82,1.87 4.82,2.99 L4.82,2.99 Z" fill="#141414" opacity="0.5"></path> + <path d="M4.82,2.99 C4.82,4.11 3.91,5.01 2.8,5.01 C1.68,5.01 0.78,4.1 0.78,2.99 C0.78,1.87 1.69,0.97 2.8,0.97 C3.91,0.96 4.82,1.87 4.82,2.99 L4.82,2.99 Z" fill="url(#radialGradient-6)"></path> + </g> + <path d="M7.8,6.47 C7.35,6.47 6.96,6.67 6.68,6.98 L7.15,7.45 C7.31,7.26 7.53,7.14 7.79,7.14 C8.06,7.14 8.29,7.28 8.45,7.47 L8.92,6.99 C8.65,6.68 8.25,6.47 7.8,6.47 L7.8,6.47 Z" id="Shape" fill="url(#linearGradient-7)"></path> + </g> + <g transform="translate(201.000000, 50.000000)" id="Clipped"> + <g> + <mask id="mask-9" fill="white"> + <use xlink:href="#path-8"></use> + </mask> + <g id="SVGID_9_"></g> + <path d="M63.42,9.02 L4.8,9.02 C2.43,9.02 0.51,7.1 0.51,4.73 L0.51,4.73 C0.51,2.36 2.43,0.44 4.8,0.44 L63.42,0.44 C65.79,0.44 67.71,2.36 67.71,4.73 L67.71,4.73 C67.7,7.1 65.78,9.02 63.42,9.02 L63.42,9.02 Z" id="Shape" fill="url(#linearGradient-10)" opacity="0.8" mask="url(#mask-9)"></path> + </g> + <g> + <mask id="mask-12" fill="white"> + <use xlink:href="#path-11"></use> + </mask> + <g id="SVGID_9_"></g> + <path d="M1.92,0.33 L0.45,0.33 L0.45,1.8 L1.92,1.8 L1.92,0.33 L1.92,0.33 Z M4.85,0.33 L3.38,0.33 L3.38,1.8 L4.85,1.8 L4.85,0.33 L4.85,0.33 Z M7.79,0.33 L6.32,0.33 L6.32,1.8 L7.79,1.8 L7.79,0.33 L7.79,0.33 Z M10.72,0.33 L9.25,0.33 L9.25,1.8 L10.72,1.8 L10.72,0.33 L10.72,0.33 Z M13.66,0.33 L12.19,0.33 L12.19,1.8 L13.66,1.8 L13.66,0.33 L13.66,0.33 Z M16.59,0.33 L15.12,0.33 L15.12,1.8 L16.59,1.8 L16.59,0.33 L16.59,0.33 Z M19.53,0.33 L18.06,0.33 L18.06,1.8 L19.53,1.8 L19.53,0.33 L19.53,0.33 Z M22.46,0.33 L20.99,0.33 L20.99,1.8 L22.46,1.8 L22.46,0.33 L22.46,0.33 Z M25.4,0.33 L23.93,0.33 L23.93,1.8 L25.4,1.8 L25.4,0.33 L25.4,0.33 Z M28.33,0.33 L26.86,0.33 L26.86,1.8 L28.33,1.8 L28.33,0.33 L28.33,0.33 Z M31.27,0.33 L29.8,0.33 L29.8,1.8 L31.27,1.8 L31.27,0.33 L31.27,0.33 Z M34.2,0.33 L32.73,0.33 L32.73,1.8 L34.2,1.8 L34.2,0.33 L34.2,0.33 Z M37.14,0.33 L35.67,0.33 L35.67,1.8 L37.14,1.8 L37.14,0.33 L37.14,0.33 Z M40.07,0.33 L38.6,0.33 L38.6,1.8 L40.07,1.8 L40.07,0.33 L40.07,0.33 Z M43.01,0.33 L41.54,0.33 L41.54,1.8 L43.01,1.8 L43.01,0.33 L43.01,0.33 Z M45.94,0.33 L44.47,0.33 L44.47,1.8 L45.94,1.8 L45.94,0.33 L45.94,0.33 Z M48.88,0.33 L47.41,0.33 L47.41,1.8 L48.88,1.8 L48.88,0.33 L48.88,0.33 Z M51.81,0.33 L50.34,0.33 L50.34,1.8 L51.81,1.8 L51.81,0.33 L51.81,0.33 Z M54.75,0.33 L53.28,0.33 L53.28,1.8 L54.75,1.8 L54.75,0.33 L54.75,0.33 Z M57.68,0.33 L56.21,0.33 L56.21,1.8 L57.68,1.8 L57.68,0.33 L57.68,0.33 Z M60.62,0.33 L59.15,0.33 L59.15,1.8 L60.62,1.8 L60.62,0.33 L60.62,0.33 Z M63.55,0.33 L62.08,0.33 L62.08,1.8 L63.55,1.8 L63.55,0.33 L63.55,0.33 Z M66.49,0.33 L65.02,0.33 L65.02,1.8 L66.49,1.8 L66.49,0.33 L66.49,0.33 Z M3.39,1.79 L1.92,1.79 L1.92,3.26 L3.39,3.26 L3.39,1.79 L3.39,1.79 Z M6.32,1.79 L4.85,1.79 L4.85,3.26 L6.32,3.26 L6.32,1.79 L6.32,1.79 Z M9.26,1.79 L7.79,1.79 L7.79,3.26 L9.26,3.26 L9.26,1.79 L9.26,1.79 Z M12.19,1.79 L10.72,1.79 L10.72,3.26 L12.19,3.26 L12.19,1.79 L12.19,1.79 Z M15.13,1.79 L13.66,1.79 L13.66,3.26 L15.13,3.26 L15.13,1.79 L15.13,1.79 Z M18.06,1.79 L16.59,1.79 L16.59,3.26 L18.06,3.26 L18.06,1.79 L18.06,1.79 Z M20.99,1.79 L19.52,1.79 L19.52,3.26 L20.99,3.26 L20.99,1.79 L20.99,1.79 Z M23.93,1.79 L22.46,1.79 L22.46,3.26 L23.93,3.26 L23.93,1.79 L23.93,1.79 Z M26.86,1.79 L25.39,1.79 L25.39,3.26 L26.86,3.26 L26.86,1.79 L26.86,1.79 Z M29.8,1.79 L28.33,1.79 L28.33,3.26 L29.8,3.26 L29.8,1.79 L29.8,1.79 Z M32.73,1.79 L31.26,1.79 L31.26,3.26 L32.73,3.26 L32.73,1.79 L32.73,1.79 Z M35.67,1.79 L34.2,1.79 L34.2,3.26 L35.67,3.26 L35.67,1.79 L35.67,1.79 Z M38.6,1.79 L37.13,1.79 L37.13,3.26 L38.6,3.26 L38.6,1.79 L38.6,1.79 Z M41.54,1.79 L40.07,1.79 L40.07,3.26 L41.54,3.26 L41.54,1.79 L41.54,1.79 Z M44.47,1.79 L43,1.79 L43,3.26 L44.47,3.26 L44.47,1.79 L44.47,1.79 Z M47.41,1.79 L45.94,1.79 L45.94,3.26 L47.41,3.26 L47.41,1.79 L47.41,1.79 Z M50.34,1.79 L48.87,1.79 L48.87,3.26 L50.34,3.26 L50.34,1.79 L50.34,1.79 Z M53.28,1.79 L51.81,1.79 L51.81,3.26 L53.28,3.26 L53.28,1.79 L53.28,1.79 Z M56.21,1.79 L54.74,1.79 L54.74,3.26 L56.21,3.26 L56.21,1.79 L56.21,1.79 Z M59.15,1.79 L57.68,1.79 L57.68,3.26 L59.15,3.26 L59.15,1.79 L59.15,1.79 Z M62.08,1.79 L60.61,1.79 L60.61,3.26 L62.08,3.26 L62.08,1.79 L62.08,1.79 Z M65.02,1.79 L63.55,1.79 L63.55,3.26 L65.02,3.26 L65.02,1.79 L65.02,1.79 Z M67.95,1.79 L66.48,1.79 L66.48,3.26 L67.95,3.26 L67.95,1.79 L67.95,1.79 Z M1.92,3.26 L0.45,3.26 L0.45,4.73 L1.92,4.73 L1.92,3.26 L1.92,3.26 Z M4.85,3.26 L3.38,3.26 L3.38,4.73 L4.85,4.73 L4.85,3.26 L4.85,3.26 Z M7.79,3.26 L6.32,3.26 L6.32,4.73 L7.79,4.73 L7.79,3.26 L7.79,3.26 Z M10.72,3.26 L9.25,3.26 L9.25,4.73 L10.72,4.73 L10.72,3.26 L10.72,3.26 Z M13.66,3.26 L12.19,3.26 L12.19,4.73 L13.66,4.73 L13.66,3.26 L13.66,3.26 Z M16.59,3.26 L15.12,3.26 L15.12,4.73 L16.59,4.73 L16.59,3.26 L16.59,3.26 Z M19.53,3.26 L18.06,3.26 L18.06,4.73 L19.53,4.73 L19.53,3.26 L19.53,3.26 Z M22.46,3.26 L20.99,3.26 L20.99,4.73 L22.46,4.73 L22.46,3.26 L22.46,3.26 Z M25.4,3.26 L23.93,3.26 L23.93,4.73 L25.4,4.73 L25.4,3.26 L25.4,3.26 Z M28.33,3.26 L26.86,3.26 L26.86,4.73 L28.33,4.73 L28.33,3.26 L28.33,3.26 Z M31.27,3.26 L29.8,3.26 L29.8,4.73 L31.27,4.73 L31.27,3.26 L31.27,3.26 Z M34.2,3.26 L32.73,3.26 L32.73,4.73 L34.2,4.73 L34.2,3.26 L34.2,3.26 Z M37.14,3.26 L35.67,3.26 L35.67,4.73 L37.14,4.73 L37.14,3.26 L37.14,3.26 Z M40.07,3.26 L38.6,3.26 L38.6,4.73 L40.07,4.73 L40.07,3.26 L40.07,3.26 Z M43.01,3.26 L41.54,3.26 L41.54,4.73 L43.01,4.73 L43.01,3.26 L43.01,3.26 Z M45.94,3.26 L44.47,3.26 L44.47,4.73 L45.94,4.73 L45.94,3.26 L45.94,3.26 Z M48.88,3.26 L47.41,3.26 L47.41,4.73 L48.88,4.73 L48.88,3.26 L48.88,3.26 Z M51.81,3.26 L50.34,3.26 L50.34,4.73 L51.81,4.73 L51.81,3.26 L51.81,3.26 Z M54.75,3.26 L53.28,3.26 L53.28,4.73 L54.75,4.73 L54.75,3.26 L54.75,3.26 Z M57.68,3.26 L56.21,3.26 L56.21,4.73 L57.68,4.73 L57.68,3.26 L57.68,3.26 Z M60.62,3.26 L59.15,3.26 L59.15,4.73 L60.62,4.73 L60.62,3.26 L60.62,3.26 Z M63.55,3.26 L62.08,3.26 L62.08,4.73 L63.55,4.73 L63.55,3.26 L63.55,3.26 Z M66.49,3.26 L65.02,3.26 L65.02,4.73 L66.49,4.73 L66.49,3.26 L66.49,3.26 Z M3.39,4.73 L1.92,4.73 L1.92,6.2 L3.39,6.2 L3.39,4.73 L3.39,4.73 Z M6.32,4.73 L4.85,4.73 L4.85,6.2 L6.32,6.2 L6.32,4.73 L6.32,4.73 Z M9.26,4.73 L7.79,4.73 L7.79,6.2 L9.26,6.2 L9.26,4.73 L9.26,4.73 Z M12.19,4.73 L10.72,4.73 L10.72,6.2 L12.19,6.2 L12.19,4.73 L12.19,4.73 Z M15.13,4.73 L13.66,4.73 L13.66,6.2 L15.13,6.2 L15.13,4.73 L15.13,4.73 Z M18.06,4.73 L16.59,4.73 L16.59,6.2 L18.06,6.2 L18.06,4.73 L18.06,4.73 Z M20.99,4.73 L19.52,4.73 L19.52,6.2 L20.99,6.2 L20.99,4.73 L20.99,4.73 Z M23.93,4.73 L22.46,4.73 L22.46,6.2 L23.93,6.2 L23.93,4.73 L23.93,4.73 Z M26.86,4.73 L25.39,4.73 L25.39,6.2 L26.86,6.2 L26.86,4.73 L26.86,4.73 Z M29.8,4.73 L28.33,4.73 L28.33,6.2 L29.8,6.2 L29.8,4.73 L29.8,4.73 Z M32.73,4.73 L31.26,4.73 L31.26,6.2 L32.73,6.2 L32.73,4.73 L32.73,4.73 Z M35.67,4.73 L34.2,4.73 L34.2,6.2 L35.67,6.2 L35.67,4.73 L35.67,4.73 Z M38.6,4.73 L37.13,4.73 L37.13,6.2 L38.6,6.2 L38.6,4.73 L38.6,4.73 Z M41.54,4.73 L40.07,4.73 L40.07,6.2 L41.54,6.2 L41.54,4.73 L41.54,4.73 Z M44.47,4.73 L43,4.73 L43,6.2 L44.47,6.2 L44.47,4.73 L44.47,4.73 Z M47.41,4.73 L45.94,4.73 L45.94,6.2 L47.41,6.2 L47.41,4.73 L47.41,4.73 Z M50.34,4.73 L48.87,4.73 L48.87,6.2 L50.34,6.2 L50.34,4.73 L50.34,4.73 Z M53.28,4.73 L51.81,4.73 L51.81,6.2 L53.28,6.2 L53.28,4.73 L53.28,4.73 Z M56.21,4.73 L54.74,4.73 L54.74,6.2 L56.21,6.2 L56.21,4.73 L56.21,4.73 Z M59.15,4.73 L57.68,4.73 L57.68,6.2 L59.15,6.2 L59.15,4.73 L59.15,4.73 Z M62.08,4.73 L60.61,4.73 L60.61,6.2 L62.08,6.2 L62.08,4.73 L62.08,4.73 Z M65.02,4.73 L63.55,4.73 L63.55,6.2 L65.02,6.2 L65.02,4.73 L65.02,4.73 Z M67.95,4.73 L66.48,4.73 L66.48,6.2 L67.95,6.2 L67.95,4.73 L67.95,4.73 Z M1.92,6.2 L0.45,6.2 L0.45,7.67 L1.92,7.67 L1.92,6.2 L1.92,6.2 Z M4.85,6.2 L3.38,6.2 L3.38,7.67 L4.85,7.67 L4.85,6.2 L4.85,6.2 Z M7.79,6.2 L6.32,6.2 L6.32,7.67 L7.79,7.67 L7.79,6.2 L7.79,6.2 Z M10.72,6.2 L9.25,6.2 L9.25,7.67 L10.72,7.67 L10.72,6.2 L10.72,6.2 Z M13.66,6.2 L12.19,6.2 L12.19,7.67 L13.66,7.67 L13.66,6.2 L13.66,6.2 Z M16.59,6.2 L15.12,6.2 L15.12,7.67 L16.59,7.67 L16.59,6.2 L16.59,6.2 Z M19.53,6.2 L18.06,6.2 L18.06,7.67 L19.53,7.67 L19.53,6.2 L19.53,6.2 Z M22.46,6.2 L20.99,6.2 L20.99,7.67 L22.46,7.67 L22.46,6.2 L22.46,6.2 Z M25.4,6.2 L23.93,6.2 L23.93,7.67 L25.4,7.67 L25.4,6.2 L25.4,6.2 Z M28.33,6.2 L26.86,6.2 L26.86,7.67 L28.33,7.67 L28.33,6.2 L28.33,6.2 Z M31.27,6.2 L29.8,6.2 L29.8,7.67 L31.27,7.67 L31.27,6.2 L31.27,6.2 Z M34.2,6.2 L32.73,6.2 L32.73,7.67 L34.2,7.67 L34.2,6.2 L34.2,6.2 Z M37.14,6.2 L35.67,6.2 L35.67,7.67 L37.14,7.67 L37.14,6.2 L37.14,6.2 Z M40.07,6.2 L38.6,6.2 L38.6,7.67 L40.07,7.67 L40.07,6.2 L40.07,6.2 Z M43.01,6.2 L41.54,6.2 L41.54,7.67 L43.01,7.67 L43.01,6.2 L43.01,6.2 Z M45.94,6.2 L44.47,6.2 L44.47,7.67 L45.94,7.67 L45.94,6.2 L45.94,6.2 Z M48.88,6.2 L47.41,6.2 L47.41,7.67 L48.88,7.67 L48.88,6.2 L48.88,6.2 Z M51.81,6.2 L50.34,6.2 L50.34,7.67 L51.81,7.67 L51.81,6.2 L51.81,6.2 Z M54.75,6.2 L53.28,6.2 L53.28,7.67 L54.75,7.67 L54.75,6.2 L54.75,6.2 Z M57.68,6.2 L56.21,6.2 L56.21,7.67 L57.68,7.67 L57.68,6.2 L57.68,6.2 Z M60.62,6.2 L59.15,6.2 L59.15,7.67 L60.62,7.67 L60.62,6.2 L60.62,6.2 Z M63.55,6.2 L62.08,6.2 L62.08,7.67 L63.55,7.67 L63.55,6.2 L63.55,6.2 Z M66.49,6.2 L65.02,6.2 L65.02,7.67 L66.49,7.67 L66.49,6.2 L66.49,6.2 Z M3.39,7.66 L1.92,7.66 L1.92,9.13 L3.39,9.13 L3.39,7.66 L3.39,7.66 Z M6.32,7.66 L4.85,7.66 L4.85,9.13 L6.32,9.13 L6.32,7.66 L6.32,7.66 Z M9.26,7.66 L7.79,7.66 L7.79,9.13 L9.26,9.13 L9.26,7.66 L9.26,7.66 Z M12.19,7.66 L10.72,7.66 L10.72,9.13 L12.19,9.13 L12.19,7.66 L12.19,7.66 Z M15.13,7.66 L13.66,7.66 L13.66,9.13 L15.13,9.13 L15.13,7.66 L15.13,7.66 Z M18.06,7.66 L16.59,7.66 L16.59,9.13 L18.06,9.13 L18.06,7.66 L18.06,7.66 Z M20.99,7.66 L19.52,7.66 L19.52,9.13 L20.99,9.13 L20.99,7.66 L20.99,7.66 Z M23.93,7.66 L22.46,7.66 L22.46,9.13 L23.93,9.13 L23.93,7.66 L23.93,7.66 Z M26.86,7.66 L25.39,7.66 L25.39,9.13 L26.86,9.13 L26.86,7.66 L26.86,7.66 Z M29.8,7.66 L28.33,7.66 L28.33,9.13 L29.8,9.13 L29.8,7.66 L29.8,7.66 Z M32.73,7.66 L31.26,7.66 L31.26,9.13 L32.73,9.13 L32.73,7.66 L32.73,7.66 Z M35.67,7.66 L34.2,7.66 L34.2,9.13 L35.67,9.13 L35.67,7.66 L35.67,7.66 Z M38.6,7.66 L37.13,7.66 L37.13,9.13 L38.6,9.13 L38.6,7.66 L38.6,7.66 Z M41.54,7.66 L40.07,7.66 L40.07,9.13 L41.54,9.13 L41.54,7.66 L41.54,7.66 Z M44.47,7.66 L43,7.66 L43,9.13 L44.47,9.13 L44.47,7.66 L44.47,7.66 Z M47.41,7.66 L45.94,7.66 L45.94,9.13 L47.41,9.13 L47.41,7.66 L47.41,7.66 Z M50.34,7.66 L48.87,7.66 L48.87,9.13 L50.34,9.13 L50.34,7.66 L50.34,7.66 Z M53.28,7.66 L51.81,7.66 L51.81,9.13 L53.28,9.13 L53.28,7.66 L53.28,7.66 Z M56.21,7.66 L54.74,7.66 L54.74,9.13 L56.21,9.13 L56.21,7.66 L56.21,7.66 Z M59.15,7.66 L57.68,7.66 L57.68,9.13 L59.15,9.13 L59.15,7.66 L59.15,7.66 Z M62.08,7.66 L60.61,7.66 L60.61,9.13 L62.08,9.13 L62.08,7.66 L62.08,7.66 Z M65.02,7.66 L63.55,7.66 L63.55,9.13 L65.02,9.13 L65.02,7.66 L65.02,7.66 Z M67.95,7.66 L66.48,7.66 L66.48,9.13 L67.95,9.13 L67.95,7.66 L67.95,7.66 Z" id="Shape" fill="#2E2E2E" mask="url(#mask-12)"></path> + </g> + <g> + <mask id="mask-14" fill="white"> + <use xlink:href="#path-13"></use> + </mask> + <g id="SVGID_9_"></g> + <path d="M63.83,0.08 L4.39,0.08 C1.99,0.08 0.04,2.16 0.04,4.73 C0.04,7.3 1.99,9.38 4.39,9.38 L63.83,9.38 C66.23,9.38 68.18,7.3 68.18,4.73 C68.18,2.16 66.23,0.08 63.83,0.08 L63.83,0.08 Z M63.42,7.92 L4.8,7.92 C3.04,7.92 1.6,6.49 1.6,4.72 C1.6,2.95 3.03,1.52 4.8,1.52 L63.42,1.52 C65.18,1.52 66.62,2.95 66.62,4.72 C66.62,6.49 65.18,7.92 63.42,7.92 L63.42,7.92 Z" id="Shape" fill="#000000" opacity="0.2" mask="url(#mask-14)"></path> + </g> + </g> + <path d="M234.73,865.33 C216.6,865.33 201.9,880.03 201.9,898.16 C201.9,916.29 216.6,930.99 234.73,930.99 C252.86,930.99 267.56,916.29 267.56,898.16 C267.56,880.03 252.86,865.33 234.73,865.33 L234.73,865.33 Z M234.73,927.98 C218.26,927.98 204.91,914.63 204.91,898.16 C204.91,881.69 218.26,868.34 234.73,868.34 C251.2,868.34 264.55,881.69 264.55,898.16 C264.55,914.62 251.2,927.98 234.73,927.98 L234.73,927.98 Z" id="Shape" fill="url(#linearGradient-15)"></path> + <path d="M69.89,8.59 C37.79,8.59 11.76,34.62 11.76,66.72 L11.76,571.87 L322.2,8.59 L69.89,8.59 L69.89,8.59 Z" id="Shape" fill="url(#linearGradient-16)"></path> + </g> + <rect id="Rectangle-path" fill="#000000" x="26" y="107" width="414" height="736"></rect> + </g> + </g> +</svg>
diff --git a/third_party/WebKit/Source/devtools/front_end/emulated_devices/module.json b/third_party/WebKit/Source/devtools/front_end/emulated_devices/module.json index e9422a7..d8b796e 100644 --- a/third_party/WebKit/Source/devtools/front_end/emulated_devices/module.json +++ b/third_party/WebKit/Source/devtools/front_end/emulated_devices/module.json
@@ -44,11 +44,19 @@ "title": "iPhone 5", "screen": { "horizontal": { + "outline" : { + "image": "@url(iPhone5-landscape.svg)", + "insets" : { "left": 115, "top": 25, "right": 115, "bottom": 28 } + }, "width": 568, "height": 320 }, "device-pixel-ratio": 2, "vertical": { + "outline" : { + "image": "@url(iPhone5-portrait.svg)", + "insets" : { "left": 29, "top": 105, "right": 25, "bottom": 111 } + }, "width": 320, "height": 568 } @@ -81,11 +89,19 @@ "title": "iPhone 6", "screen": { "horizontal": { + "outline" : { + "image": "@url(iPhone6-landscape.svg)", + "insets" : { "left": 106, "top": 28, "right": 106, "bottom": 28 } + }, "width": 667, "height": 375 }, "device-pixel-ratio": 2, "vertical": { + "outline" : { + "image": "@url(iPhone6-portrait.svg)", + "insets" : { "left": 28, "top": 105, "right": 28, "bottom": 105 } + }, "width": 375, "height": 667 } @@ -118,11 +134,19 @@ "title": "iPhone 6 Plus", "screen": { "horizontal": { + "outline" : { + "image": "@url(iPhone6Plus-landscape.svg)", + "insets" : { "left": 109, "top": 29, "right": 109, "bottom": 27 } + }, "width": 736, "height": 414 }, "device-pixel-ratio": 3, "vertical": { + "outline" : { + "image": "@url(iPhone6Plus-portrait.svg)", + "insets" : { "left": 26, "top": 107, "right": 30, "bottom": 111 } + }, "width": 414, "height": 736 } @@ -296,12 +320,20 @@ "screen": { "device-pixel-ratio": 2.625, "vertical": { - "width": 411, - "height": 731 + "outline" : { + "image": "@url(Nexus5X-portrait.svg)", + "insets" : { "left": 20, "top": 92, "right": 22, "bottom": 108 } + }, + "width": 412, + "height": 732 }, "horizontal": { - "width": 731, - "height": 411 + "outline" : { + "image": "@url(Nexus5X-landscape.svg)", + "insets" : { "left": 94, "top": 23, "right": 100, "bottom": 20 } + }, + "width": 732, + "height": 412 } }, "modes": [ @@ -388,13 +420,21 @@ "title": "Nexus 6P", "screen": { "horizontal": { - "width": 773, - "height": 435 + "outline" : { + "image": "@url(Nexus6P-landscape.svg)", + "insets" : { "left": 94, "top": 48, "right": 97, "bottom": 48 } + }, + "width": 732, + "height": 412 }, - "device-pixel-ratio": 3.3, + "device-pixel-ratio": 3.5, "vertical": { - "width": 435, - "height": 773 + "outline" : { + "image": "@url(Nexus6P-portrait.svg)", + "insets" : { "left": 58, "top": 94, "right": 58, "bottom": 97 } + }, + "width": 412, + "height": 732 } }, "capabilities": [ @@ -750,11 +790,19 @@ "title": "iPad", "screen": { "horizontal": { + "outline" : { + "image": "@url(iPad-landscape.svg)", + "insets" : { "left": 112, "top": 56, "right": 116, "bottom": 52 } + }, "width": 1024, "height": 768 }, "device-pixel-ratio": 2, "vertical": { + "outline" : { + "image": "@url(iPad-portrait.svg)", + "insets" : { "left": 52, "top": 114, "right": 55, "bottom": 114 } + }, "width": 768, "height": 1024 }
diff --git a/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeModel.js b/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeModel.js index cc8cf67..a78f565 100644 --- a/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeModel.js +++ b/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeModel.js
@@ -45,6 +45,9 @@ this._deviceScaleFactorSetting = WebInspector.settings.createSetting("emulation.deviceScaleFactor", 0); this._deviceScaleFactorSetting.addChangeListener(this._deviceScaleFactorSettingChanged, this); + this._deviceOutlineSetting = WebInspector.settings.createSetting("emulation.deviceOutline", true); + this._deviceOutlineSetting.addChangeListener(this._deviceOutlineSettingChanged, this); + /** @type {!WebInspector.DeviceModeModel.Type} */ this._type = WebInspector.DeviceModeModel.Type.None; /** @type {?WebInspector.EmulatedDevice} */ @@ -228,6 +231,23 @@ }, /** + * @return {string} + */ + outlineImage: function() + { + return (this._device && this._mode && Runtime.experiments.isEnabled("deviceFrames")) ? + this._device.outlineImage(this._mode) : ""; + }, + + /** + * @return {!WebInspector.Rect} + */ + outlineRect: function() + { + return this._outlineRect; + }, + + /** * @return {!WebInspector.Rect} */ screenRect: function() @@ -315,6 +335,14 @@ return this._deviceScaleFactorSetting; }, + /** + * @return {!WebInspector.Setting} + */ + deviceOutlineSetting: function() + { + return this._deviceOutlineSetting; + }, + reset: function() { this._deviceScaleFactorSetting.set(0); @@ -375,6 +403,11 @@ this._calculateAndEmulate(false); }, + _deviceOutlineSettingChanged: function() + { + this._calculateAndEmulate(false); + }, + /** * @return {number} */ @@ -401,18 +434,19 @@ if (this._type === WebInspector.DeviceModeModel.Type.Device) { var orientation = this._device.orientationByName(this._mode.orientation); + var outline = (this._deviceOutlineSetting.get() && Runtime.experiments.isEnabled("deviceFrames"))? orientation.outlineInsets : new Insets(0,0,0,0); this._fitScale = this._calculateFitScale(orientation.width, orientation.height); if (this._device.mobile()) this._appliedUserAgentType = this._device.touch() ? WebInspector.DeviceModeModel.UA.Mobile : WebInspector.DeviceModeModel.UA.MobileNoTouch; else this._appliedUserAgentType = this._device.touch() ? WebInspector.DeviceModeModel.UA.DesktopTouch : WebInspector.DeviceModeModel.UA.Desktop; - this._applyDeviceMetrics(new Size(orientation.width, orientation.height), this._mode.insets, this._scaleSetting.get(), this._device.deviceScaleFactor, this._device.mobile(), this._mode.orientation == WebInspector.EmulatedDevice.Horizontal ? "landscapePrimary" : "portraitPrimary", resetPageScaleFactor); + this._applyDeviceMetrics(new Size(orientation.width, orientation.height), this._mode.insets, outline, this._scaleSetting.get(), this._device.deviceScaleFactor, this._device.mobile(), this._mode.orientation == WebInspector.EmulatedDevice.Horizontal ? "landscapePrimary" : "portraitPrimary", resetPageScaleFactor); this._applyUserAgent(this._device.userAgent); this._applyTouch(this._device.touch(), this._device.mobile()); } else if (this._type === WebInspector.DeviceModeModel.Type.None) { this._fitScale = this._calculateFitScale(this._availableSize.width, this._availableSize.height); this._appliedUserAgentType = WebInspector.DeviceModeModel.UA.Desktop; - this._applyDeviceMetrics(this._availableSize, new Insets(0, 0, 0, 0), 1, 0, false, "", resetPageScaleFactor); + this._applyDeviceMetrics(this._availableSize, new Insets(0, 0, 0, 0), new Insets(0, 0, 0, 0), 1, 0, false, "", resetPageScaleFactor); this._applyUserAgent(""); this._applyTouch(false, false); } else if (this._type === WebInspector.DeviceModeModel.Type.Responsive) { @@ -426,7 +460,7 @@ var defaultDeviceScaleFactor = mobile ? WebInspector.DeviceModeModel.defaultMobileScaleFactor : 0; this._fitScale = this._calculateFitScale(this._widthSetting.get(), this._heightSetting.get()); this._appliedUserAgentType = this._uaSetting.get(); - this._applyDeviceMetrics(new Size(screenWidth, screenHeight), new Insets(0, 0, 0, 0), this._scaleSetting.get(), this._deviceScaleFactorSetting.get() || defaultDeviceScaleFactor, mobile, screenHeight >= screenWidth ? "portraitPrimary" : "landscapePrimary", resetPageScaleFactor); + this._applyDeviceMetrics(new Size(screenWidth, screenHeight), new Insets(0, 0, 0, 0), new Insets(0, 0, 0, 0), this._scaleSetting.get(), this._deviceScaleFactorSetting.get() || defaultDeviceScaleFactor, mobile, screenHeight >= screenWidth ? "portraitPrimary" : "landscapePrimary", resetPageScaleFactor); this._applyUserAgent(mobile ? WebInspector.DeviceModeModel._defaultMobileUserAgent : ""); this._applyTouch(this._uaSetting.get() === WebInspector.DeviceModeModel.UA.DesktopTouch || this._uaSetting.get() === WebInspector.DeviceModeModel.UA.Mobile, this._uaSetting.get() === WebInspector.DeviceModeModel.UA.Mobile); } @@ -467,19 +501,21 @@ /** * @param {!Size} screenSize * @param {!Insets} insets + * @param {!Insets|null} outline * @param {number} scale * @param {number} deviceScaleFactor * @param {boolean} mobile * @param {string} screenOrientation * @param {boolean} resetPageScaleFactor */ - _applyDeviceMetrics: function(screenSize, insets, scale, deviceScaleFactor, mobile, screenOrientation, resetPageScaleFactor) + _applyDeviceMetrics: function(screenSize, insets, outline, scale, deviceScaleFactor, mobile, screenOrientation, resetPageScaleFactor) { screenSize.width = Math.max(1, Math.floor(screenSize.width)); screenSize.height = Math.max(1, Math.floor(screenSize.height)); var pageWidth = screenSize.width - insets.left - insets.right; var pageHeight = screenSize.height - insets.top - insets.bottom; + var positionX = insets.left; var positionY = insets.top; var screenOrientationAngle = screenOrientation === "landscapePrimary" ? 90 : 0; @@ -488,9 +524,14 @@ this._appliedDeviceScaleFactor = deviceScaleFactor || window.devicePixelRatio; this._screenRect = new WebInspector.Rect( Math.max(0, (this._availableSize.width - screenSize.width * scale) / 2), - 0, + outline.top * scale, screenSize.width * scale, screenSize.height * scale); + this._outlineRect = new WebInspector.Rect( + Math.max(0, this._screenRect.left - outline.left * scale), + 0, + (outline.left + screenSize.width + outline.right) * scale, + (outline.top + screenSize.height + outline.bottom) * scale); this._visiblePageRect = new WebInspector.Rect( positionX * scale, positionY * scale,
diff --git a/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeToolbar.js b/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeToolbar.js index 79c6098..9281ae25 100644 --- a/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeToolbar.js +++ b/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeToolbar.js
@@ -14,6 +14,7 @@ this._showMediaInspectorSetting = showMediaInspectorSetting; this._showRulersSetting = showRulersSetting; + this._deviceOutlineSetting = this._model.deviceOutlineSetting(); this._showDeviceScaleFactorSetting = WebInspector.settings.createSetting("emulation.showDeviceScaleFactor", false); this._showDeviceScaleFactorSetting.addChangeListener(this._updateDeviceScaleFactorVisibility, this); @@ -270,7 +271,9 @@ contextMenu.appendCheckboxItem(WebInspector.UIString("Show throttling"), this._toggleNetworkConditions.bind(this), this._showNetworkConditionsSetting.get(), this._model.type() === WebInspector.DeviceModeModel.Type.None); contextMenu.appendCheckboxItem(WebInspector.UIString("Show media queries"), this._toggleMediaInspector.bind(this), this._showMediaInspectorSetting.get(), this._model.type() === WebInspector.DeviceModeModel.Type.None); contextMenu.appendCheckboxItem(WebInspector.UIString("Show rulers"), this._toggleRulers.bind(this), this._showRulersSetting.get(), this._model.type() === WebInspector.DeviceModeModel.Type.None); - contextMenu.appendSeparator(); + if (Runtime.experiments.isEnabled("deviceFrames")) { + contextMenu.appendCheckboxItem(WebInspector.UIString("Show device frame"), this._toggleDeviceFrames.bind(this), this._deviceOutlineSetting.get() && this._model.outlineImage() !== "", (this._model.type() === WebInspector.DeviceModeModel.Type.None || this._model.outlineImage() === "")); + } contextMenu.appendItemsAtLocation("deviceModeMenu"); contextMenu.appendSeparator(); contextMenu.appendItem(WebInspector.UIString("Reset to defaults"), this._reset.bind(this)); @@ -281,6 +284,11 @@ this._showDeviceScaleFactorSetting.set(!this._showDeviceScaleFactorSetting.get()); }, + _toggleDeviceFrames: function() + { + this._deviceOutlineSetting.set(!this._deviceOutlineSetting.get()); + }, + _toggleUserAgentType: function() { this._showUserAgentTypeSetting.set(!this._showUserAgentTypeSetting.get());
diff --git a/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeView.js b/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeView.js index 4980cc9c..37f2b43 100644 --- a/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeView.js +++ b/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeView.js
@@ -41,10 +41,15 @@ this._mediaInspectorContainer = this._contentClip.createChild("div", "device-mode-media-container"); this._contentArea = this._contentClip.createChild("div", "device-mode-content-area"); + this._outlineImage = this._contentArea.createChild("img", "device-mode-outline-image hidden fill"); + this._outlineImage.addEventListener("load", this._onImageLoaded.bind(this, this._outlineImage, true), false); + this._outlineImage.addEventListener("error", this._onImageLoaded.bind(this, this._outlineImage, false), false); + this._outlineImage.classList.toggle("device-frame-visible", this._model.deviceOutlineSetting().get()); + this._screenArea = this._contentArea.createChild("div", "device-mode-screen-area"); this._screenImage = this._screenArea.createChild("img", "device-mode-screen-image hidden"); - this._screenImage.addEventListener("load", this._onScreenImageLoaded.bind(this, true), false); - this._screenImage.addEventListener("error", this._onScreenImageLoaded.bind(this, false), false); + this._screenImage.addEventListener("load", this._onImageLoaded.bind(this, this._screenImage, true), false); + this._screenImage.addEventListener("error", this._onImageLoaded.bind(this, this._screenImage, false), false); this._bottomRightResizerElement = this._screenArea.createChild("div", "device-mode-resizer device-mode-bottom-right-resizer"); this._bottomRightResizerElement.createChild("div", ""); @@ -188,21 +193,30 @@ _updateUI: function() { + /** + * @param {!Element} element + * @param {!WebInspector.Rect} rect + */ + function applyRect(element, rect) + { + element.style.left = rect.left + "px"; + element.style.top = rect.top + "px"; + element.style.width = rect.width + "px"; + element.style.height = rect.height + "px"; + } + if (!this.isShowing()) return; var zoomFactor = WebInspector.zoomManager.zoomFactor(); var callDoResize = false; - var showRulers = this._showRulersSetting.get() && this._model.type() !== WebInspector.DeviceModeModel.Type.None; + var showRulers = this._showRulersSetting.get() && !this._model.deviceOutlineSetting().get() && this._model.type() !== WebInspector.DeviceModeModel.Type.None; var contentAreaResized = false; var updateRulers = false; var cssScreenRect = this._model.screenRect().scale(1 / zoomFactor); if (!cssScreenRect.isEqual(this._cachedCssScreenRect)) { - this._screenArea.style.left = cssScreenRect.left + "px"; - this._screenArea.style.top = cssScreenRect.top + "px"; - this._screenArea.style.width = cssScreenRect.width + "px"; - this._screenArea.style.height = cssScreenRect.height + "px"; + applyRect(this._screenArea, cssScreenRect); this._leftRuler.element.style.left = cssScreenRect.left + "px"; updateRulers = true; callDoResize = true; @@ -211,14 +225,19 @@ var cssVisiblePageRect = this._model.visiblePageRect().scale(1 / zoomFactor); if (!cssVisiblePageRect.isEqual(this._cachedCssVisiblePageRect)) { - this._pageArea.style.left = cssVisiblePageRect.left + "px"; - this._pageArea.style.top = cssVisiblePageRect.top + "px"; - this._pageArea.style.width = cssVisiblePageRect.width + "px"; - this._pageArea.style.height = cssVisiblePageRect.height + "px"; + applyRect(this._pageArea, cssVisiblePageRect); callDoResize = true; this._cachedCssVisiblePageRect = cssVisiblePageRect; } + var outlineRect = this._model.outlineRect().scale(1 / zoomFactor); + if (!outlineRect.isEqual(this._cachedOutlineRect)) { + applyRect(this._outlineImage, outlineRect); + callDoResize = true; + this._cachedOutlineRect = outlineRect; + } + this._outlineImage.classList.toggle("device-frame-visible", (this._model.deviceOutlineSetting().get() && this._model.outlineImage())); + var resizable = this._model.type() === WebInspector.DeviceModeModel.Type.Responsive; if (resizable !== this._cachedResizable) { this._rightResizerElement.classList.toggle("hidden", !resizable); @@ -243,7 +262,7 @@ if (showRulers !== this._cachedShowRulers) { this._contentClip.classList.toggle("device-mode-rulers-visible", showRulers); if (showRulers) { - this._topRuler.show(this._contentClip, this._contentArea); + this._topRuler.show(this._contentArea); this._leftRuler.show(this._contentArea); } else { this._topRuler.detach(); @@ -263,36 +282,41 @@ } this._toolbar.update(); - this._loadScreenImage(this._model.screenImage()); + this._loadImage(this._screenImage, this._model.screenImage()); + this._loadImage(this._outlineImage, this._model.outlineImage()); this._mediaInspector.setAxisTransform(this._model.scale()); if (callDoResize) this.doResize(); if (updateRulers) { this._topRuler.render(this._cachedCssScreenRect ? this._cachedCssScreenRect.left : 0, this._model.scale()); this._leftRuler.render(0, this._model.scale()); + this._topRuler.element.style.top = this._cachedCssScreenRect ? this._cachedCssScreenRect.top + "px" : 0; + this._leftRuler.element.style.top = this._cachedCssScreenRect ? this._cachedCssScreenRect.top + "px" : 0; } if (contentAreaResized) this._contentAreaResized(); }, /** + * @param {!Element} element * @param {string} srcset */ - _loadScreenImage: function(srcset) + _loadImage: function(element, srcset) { - if (this._screenImage.getAttribute("srcset") === srcset) + if (element.getAttribute("srcset") === srcset) return; - this._screenImage.setAttribute("srcset", srcset); + element.setAttribute("srcset", srcset); if (!srcset) - this._screenImage.classList.toggle("hidden", true); + element.classList.toggle("hidden", true); }, /** + * @param {!Element} element * @param {boolean} success */ - _onScreenImageLoaded: function(success) + _onImageLoaded: function(element, success) { - this._screenImage.classList.toggle("hidden", !success); + element.classList.toggle("hidden", !success); }, _contentAreaResized: function()
diff --git a/third_party/WebKit/Source/devtools/front_end/emulation/EmulatedDevices.js b/third_party/WebKit/Source/devtools/front_end/emulation/EmulatedDevices.js index 80dfa6b..aca67d2 100644 --- a/third_party/WebKit/Source/devtools/front_end/emulation/EmulatedDevices.js +++ b/third_party/WebKit/Source/devtools/front_end/emulation/EmulatedDevices.js
@@ -133,7 +133,6 @@ throw new Error("Emulated device has wrong outline insets"); result.outlineImage = /** @type {string} */ (parseValue(json["outline"], "image", "string")); } - return /** @type {!WebInspector.EmulatedDevice.Orientation} */ (result); } @@ -307,6 +306,20 @@ }, /** + * @param {!WebInspector.EmulatedDevice.Mode} mode + * @return {string} + */ + outlineImage: function(mode) + { + var orientation = this.orientationByName(mode.orientation); + if (!orientation.outlineImage) + return ""; + if (!this._extension) + return orientation.outlineImage; + return this._extension.module().substituteURL(orientation.outlineImage); + }, + + /** * @param {string} name * @return {!WebInspector.EmulatedDevice.Orientation} */
diff --git a/third_party/WebKit/Source/devtools/front_end/emulation/deviceModeView.css b/third_party/WebKit/Source/devtools/front_end/emulation/deviceModeView.css index 7351960a..9613727c 100644 --- a/third_party/WebKit/Source/devtools/front_end/emulation/deviceModeView.css +++ b/third_party/WebKit/Source/devtools/front_end/emulation/deviceModeView.css
@@ -48,10 +48,6 @@ box-shadow: inset 0 -1px #ccc; } -.device-mode-content-clip:not(.device-mode-rulers-visible) .device-mode-media-container { - margin-bottom: 20px; -} - .device-mode-presets-container { flex: 0 0 20px; display: flex; @@ -133,6 +129,10 @@ height: 100%; } +.device-mode-outline-image.device-frame-visible + .device-mode-screen-area { + box-shadow: none; +} + .device-mode-resizer { position: absolute; display: flex;
diff --git a/third_party/WebKit/Source/devtools/front_end/formatter_worker/FormattedContentBuilder.js b/third_party/WebKit/Source/devtools/front_end/formatter_worker/FormattedContentBuilder.js index 3d1d266..109f3ea 100644 --- a/third_party/WebKit/Source/devtools/front_end/formatter_worker/FormattedContentBuilder.js +++ b/third_party/WebKit/Source/devtools/front_end/formatter_worker/FormattedContentBuilder.js
@@ -62,6 +62,9 @@ */ addNewLine: function(noSquash) { + // Avoid leading newlines. + if (!this._formattedContentLength) + return; if (noSquash) ++this._newLines; else
diff --git a/third_party/WebKit/Source/devtools/front_end/formatter_worker/FormatterWorker.js b/third_party/WebKit/Source/devtools/front_end/formatter_worker/FormatterWorker.js index 2c8fd46..7d0c09f 100644 --- a/third_party/WebKit/Source/devtools/front_end/formatter_worker/FormatterWorker.js +++ b/third_party/WebKit/Source/devtools/front_end/formatter_worker/FormatterWorker.js
@@ -193,7 +193,8 @@ try { switch (mimeType) { case "text/html": - formatMixedHTML(builder, text, lineEndings); + var formatter = new WebInspector.HTMLFormatter(builder); + formatter.format(text, lineEndings); break; case "text/css": var formatter = new WebInspector.CSSFormatter(builder); @@ -216,35 +217,3 @@ } postMessage(result); } - -/** - * @param {!WebInspector.FormattedContentBuilder} builder - * @param {string} text - * @param {!Array<number>} lineEndings - */ -function formatMixedHTML(builder, text, lineEndings) -{ - var htmlFormatter = new WebInspector.HTMLFormatter(builder); - var jsFormatter = new WebInspector.JavaScriptFormatter(builder); - var cssFormatter = new WebInspector.CSSFormatter(builder); - var identityFormatter = new WebInspector.IdentityFormatter(builder); - - var offset = 0; - while (offset < text.length) { - var result = htmlFormatter.format(text, lineEndings, offset); - if (result.offset >= text.length) - break; - builder.addNewLine(); - var closeTag = "</" + result.tagName; - offset = text.indexOf(closeTag, result.offset); - if (offset === -1) - offset = text.length; - if (result.tagName === "script") - jsFormatter.format(text, lineEndings, result.offset, offset); - else if (result.tagName === "style") - cssFormatter.format(text, lineEndings, result.offset, offset); - else - identityFormatter.format(text, lineEndings, result.offset, offset); - } -} -
diff --git a/third_party/WebKit/Source/devtools/front_end/formatter_worker/HTMLFormatter.js b/third_party/WebKit/Source/devtools/front_end/formatter_worker/HTMLFormatter.js index 9514125d..0961cdb 100644 --- a/third_party/WebKit/Source/devtools/front_end/formatter_worker/HTMLFormatter.js +++ b/third_party/WebKit/Source/devtools/front_end/formatter_worker/HTMLFormatter.js
@@ -9,69 +9,460 @@ WebInspector.HTMLFormatter = function(builder) { this._builder = builder; + this._jsFormatter = new WebInspector.JavaScriptFormatter(builder); + this._cssFormatter = new WebInspector.CSSFormatter(builder); } -/** - * @constructor - * @param {string} tagName - * @param {number} offset - */ -WebInspector.HTMLFormatter.Result = function(tagName, offset) -{ - this.tagName = tagName; - this.offset = offset; -} +WebInspector.HTMLFormatter.SupportedJavaScriptMimeTypes = new Set([ + "text/javascript", + "text/ecmascript", + "application/javascript", + "application/ecmascript" +]); WebInspector.HTMLFormatter.prototype = { /** * @param {string} text * @param {!Array<number>} lineEndings - * @param {number} fromOffset - * @return {!WebInspector.HTMLFormatter.Result} */ - format: function(text, lineEndings, fromOffset) + format: function(text, lineEndings) { - var content = text.substring(fromOffset); - var tagName = ""; - var accumulatedTokenValue = ""; - var lastOffset = fromOffset; + this._text = text; + this._lineEndings = lineEndings; + this._model = new WebInspector.HTMLModel(text); + this._walk(this._model.document()); + }, + + /** + * @param {!WebInspector.HTMLModel.Element} element + * @param {number} offset + */ + _formatTokensTill: function(element, offset) + { + while (this._model.peekToken() && this._model.peekToken().startOffset < offset) { + var token = this._model.nextToken(); + this._formatToken(element, token); + } + }, + + /** + * @param {!WebInspector.HTMLModel.Element} element + */ + _walk: function(element) + { + if (element.parent) + this._formatTokensTill(element.parent, element.openTag.startOffset); + this._beforeOpenTag(element); + this._formatTokensTill(element, element.openTag.endOffset); + this._afterOpenTag(element); + for (var i = 0; i < element.children.length; ++i) + this._walk(element.children[i]); + + this._formatTokensTill(element, element.closeTag.startOffset); + this._beforeCloseTag(element); + this._formatTokensTill(element, element.closeTag.endOffset); + this._afterCloseTag(element); + }, + + /** + * @param {!WebInspector.HTMLModel.Element} element + */ + _beforeOpenTag: function(element) + { + if (!element.children.length || element === this._model.document()) + return; + this._builder.addNewLine(); + }, + + /** + * @param {!WebInspector.HTMLModel.Element} element + */ + _afterOpenTag: function(element) + { + if (!element.children.length || element === this._model.document()) + return; + this._builder.increaseNestingLevel(); + this._builder.addNewLine(); + }, + + /** + * @param {!WebInspector.HTMLModel.Element} element + */ + _beforeCloseTag: function(element) + { + if (!element.children.length || element === this._model.document()) + return; + this._builder.decreaseNestingLevel(); + this._builder.addNewLine(); + }, + + /** + * @param {!WebInspector.HTMLModel.Element} element + */ + _afterCloseTag: function(element) + { + this._builder.addNewLine(); + }, + + /** + * @param {!WebInspector.HTMLModel.Element} element + * @param {!WebInspector.HTMLModel.Token} token + */ + _formatToken: function(element, token) + { + if (token.value.isWhitespace()) + return; + if (token.type.has("comment") || token.type.has("meta")) { + this._builder.addNewLine(); + this._builder.addToken(token.value.trim(), token.startOffset); + this._builder.addNewLine(); + return; + } + + var isBodyToken = element.openTag.endOffset <= token.startOffset && token.startOffset < element.closeTag.startOffset; + if (isBodyToken && element.name === "style") { + this._builder.addNewLine(); + this._builder.increaseNestingLevel(); + this._cssFormatter.format(this._text, this._lineEndings, token.startOffset, token.endOffset); + this._builder.decreaseNestingLevel(); + return; + } + if (isBodyToken && element.name === "script") { + this._builder.addNewLine(); + this._builder.increaseNestingLevel(); + var mimeType = element.openTag.attributes.has("type") ? element.openTag.attributes.get("type").toLowerCase() : null; + if (!mimeType || WebInspector.HTMLFormatter.SupportedJavaScriptMimeTypes.has(mimeType)) { + this._jsFormatter.format(this._text, this._lineEndings, token.startOffset, token.endOffset); + } else { + this._builder.addToken(token.value, token.startOffset); + this._builder.addNewLine(); + } + this._builder.decreaseNestingLevel(); + return; + } + + if (!isBodyToken && token.type.has("attribute")) + this._builder.addSoftSpace(); + + this._builder.addToken(token.value, token.startOffset); + } +} + +/** + * @constructor + * @param {string} text + */ +WebInspector.HTMLModel = function(text) +{ + this._state = WebInspector.HTMLModel.ParseState.Initial; + this._document = new WebInspector.HTMLModel.Element("document"); + this._document.openTag = new WebInspector.HTMLModel.Tag("document", 0, 0, new Map(), true, false); + this._document.closeTag = new WebInspector.HTMLModel.Tag("document", text.length, text.length, new Map(), false, false); + + this._stack = [this._document]; + + this._tokens = []; + this._tokenIndex = 0; + this._build(text); +} + +WebInspector.HTMLModel.SelfClosingTags = new Set([ + "area", + "base", + "br", + "col", + "command", + "embed", + "hr", + "img", + "input", + "keygen", + "link", + "meta", + "param", + "source", + "track", + "wbr" +]); + +// @see https://www.w3.org/TR/html/syntax.html 8.1.2.4 Optional tags +WebInspector.HTMLModel.AutoClosingTags = { + "head": new Set(["body"]), + "li": new Set(["li"]), + "dt": new Set(["dt", "dd"]), + "dd": new Set(["dt", "dd"]), + "p": new Set(["address", "article", "aside", "blockquote", "div", "dl", "fieldset", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "header", "hgroup", "hr", "main", "nav", "ol", "p", "pre", "section", "table", "ul"]), + "rb": new Set(["rb", "rt", "rtc", "rp"]), + "rt": new Set(["rb", "rt", "rtc", "rp"]), + "rtc": new Set(["rb", "rtc", "rp"]), + "rp": new Set(["rb", "rt", "rtc", "rp"]), + "optgroup": new Set(["optgroup"]), + "option": new Set(["option", "optgroup"]), + "colgroup": new Set(["colgroup"]), + "thead": new Set(["tbody", "tfoot"]), + "tbody": new Set(["tbody", "tfoot"]), + "tfoot": new Set(["tbody"]), + "tr": new Set(["tr"]), + "td": new Set(["td", "th"]), + "th": new Set(["td", "th"]), +}; + +/** @enum {string} */ +WebInspector.HTMLModel.ParseState = { + Initial: "Initial", + Tag: "Tag", + AttributeName: "AttributeName", + AttributeValue: "AttributeValue" +} + +WebInspector.HTMLModel.prototype = { + /** + * @param {string} text + */ + _build: function(text) + { + var tokenizer = WebInspector.createTokenizer("text/html"); + var lastOffset = 0; + var lowerCaseText = text.toLowerCase(); + + while (true) { + tokenizer(text.substring(lastOffset), processToken.bind(this, lastOffset)); + if (lastOffset >= text.length) + break; + var element = this._stack.peekLast(); + lastOffset = lowerCaseText.indexOf("</" + element.name, lastOffset); + if (lastOffset === -1) + lastOffset = text.length; + var tokenStart = element.openTag.endOffset; + var tokenEnd = lastOffset; + var tokenValue = text.substring(tokenStart, tokenEnd); + this._tokens.push(new WebInspector.HTMLModel.Token(tokenValue, new Set(), tokenStart, tokenEnd)); + } + + while (this._stack.length > 1) { + var element = this._stack.peekLast(); + this._popElement(new WebInspector.HTMLModel.Tag(element.name, text.length, text.length, new Map(), false, false)); + } /** + * @param {number} baseOffset * @param {string} tokenValue * @param {?string} type * @param {number} tokenStart * @param {number} tokenEnd * @return {(!Object|undefined)} - * @this {WebInspector.HTMLFormatter} + * @this {WebInspector.HTMLModel} */ - function processToken(tokenValue, type, tokenStart, tokenEnd) + function processToken(baseOffset, tokenValue, type, tokenStart, tokenEnd) { - tokenStart += fromOffset; - tokenEnd += fromOffset; + tokenStart += baseOffset; + tokenEnd += baseOffset; lastOffset = tokenEnd; - this._builder.addToken(tokenValue, tokenStart); - if (!type) - return; - var tokenType = type.split(" ").keySet(); - if (!tokenType["tag"]) - return; + var tokenType = type ? new Set(type.split(" ")) : new Set(); + var token = new WebInspector.HTMLModel.Token(tokenValue, tokenType, tokenStart, tokenEnd); + this._tokens.push(token); + this._updateDOM(token); - if (tokenType["bracket"] && (tokenValue === "<" || tokenValue === "</")) { - accumulatedTokenValue = tokenValue; - return; - } - - if (tagName && tokenValue === ">") + var element = this._stack.peekLast(); + if (element && (element.name === "script" || element.name === "style") && element.openTag.endOffset === lastOffset) return WebInspector.AbortTokenization; - - accumulatedTokenValue = accumulatedTokenValue + tokenValue.toLowerCase(); - if (accumulatedTokenValue === "<script" || accumulatedTokenValue === "<style") - tagName = accumulatedTokenValue.substring(1); - accumulatedTokenValue = ""; } - var tokenizer = WebInspector.createTokenizer("text/html"); - tokenizer(content, processToken.bind(this)); - return new WebInspector.HTMLFormatter.Result(tagName, lastOffset); }, + + /** + * @param {!WebInspector.HTMLModel.Token} token + */ + _updateDOM: function(token) + { + var S = WebInspector.HTMLModel.ParseState; + var value = token.value; + var type = token.type; + switch (this._state) { + case S.Initial: + if (type.has("bracket") && (value === "<" || value === "</")) { + this._onStartTag(token); + this._state = S.Tag; + } + return; + case S.Tag: + if (type.has("tag") && !type.has("bracket")) { + this._tagName = value.trim().toLowerCase(); + } else if (type.has("attribute")) { + this._attributeName = value.trim().toLowerCase(); + this._attributes.set(this._attributeName, ""); + this._state = S.AttributeName; + } else if (type.has("bracket") && (value === ">" || value === "/>")) { + this._onEndTag(token); + this._state = S.Initial; + } + return; + case S.AttributeName: + if (!type.size && value === "=") { + this._state = S.AttributeValue; + } else if (type.has("bracket") && (value === ">" || value === "/>")) { + this._onEndTag(token); + this._state = S.Initial; + } + return; + case S.AttributeValue: + if (type.has("string")) { + this._attributes.set(this._attributeName, value); + this._state = S.Tag; + } else if (type.has("bracket") && (value === ">" || value === "/>")) { + this._onEndTag(token); + this._state = S.Initial; + } + return; + } + }, + + /** + * @param {!WebInspector.HTMLModel.Token} token + */ + _onStartTag: function(token) + { + this._tagName = ""; + this._tagStartOffset = token.startOffset; + this._tagEndOffset = null; + this._attributes = new Map(); + this._attributeName = ""; + this._isOpenTag = token.value === "<"; + }, + + /** + * @param {!WebInspector.HTMLModel.Token} token + */ + _onEndTag: function(token) + { + this._tagEndOffset = token.endOffset; + var selfClosingTag = token.value === "/>" || WebInspector.HTMLModel.SelfClosingTags.has(this._tagName); + var tag = new WebInspector.HTMLModel.Tag(this._tagName, this._tagStartOffset, this._tagEndOffset, this._attributes, this._isOpenTag, selfClosingTag); + this._onTagComplete(tag); + }, + + /** + * @param {!WebInspector.HTMLModel.Tag} tag + */ + _onTagComplete: function(tag) + { + if (tag.isOpenTag) { + var topElement = this._stack.peekLast(); + if (topElement !== this._document && topElement.openTag.selfClosingTag) + this._popElement(autocloseTag(topElement, topElement.openTag.endOffset)); + else if ((topElement.name in WebInspector.HTMLModel.AutoClosingTags) && WebInspector.HTMLModel.AutoClosingTags[topElement.name].has(tag.name)) + this._popElement(autocloseTag(topElement, tag.startOffset)); + this._pushElement(tag); + return; + } + + while (this._stack.length > 1 && this._stack.peekLast().name !== tag.name) + this._popElement(autocloseTag(this._stack.peekLast(), tag.startOffset)); + if (this._stack.length === 1) + return; + this._popElement(tag); + + /** + * @param {!WebInspector.HTMLModel.Element} element + * @param {number} offset + * @return {!WebInspector.HTMLModel.Tag} + */ + function autocloseTag(element, offset) + { + return new WebInspector.HTMLModel.Tag(element.name, offset, offset, new Map(), false, false); + } + }, + + /** + * @param {!WebInspector.HTMLModel.Tag} closeTag + */ + _popElement: function(closeTag) + { + var element = this._stack.pop(); + element.closeTag = closeTag; + }, + + /** + * @param {!WebInspector.HTMLModel.Tag} openTag + */ + _pushElement: function(openTag) + { + var topElement = this._stack.peekLast(); + var newElement = new WebInspector.HTMLModel.Element(openTag.name); + newElement.parent = topElement; + topElement.children.push(newElement); + newElement.openTag = openTag; + this._stack.push(newElement); + }, + + /** + * @return {?WebInspector.HTMLModel.Token} + */ + peekToken: function() + { + return this._tokenIndex < this._tokens.length ? this._tokens[this._tokenIndex] : null; + }, + + /** + * @return {?WebInspector.HTMLModel.Token} + */ + nextToken: function() + { + return this._tokens[this._tokenIndex++]; + }, + + /** + * @return {!WebInspector.HTMLModel.Element} + */ + document: function() + { + return this._document; + } +} + +/** + * @constructor + * @param {string} value + * @param {!Set<string>} type + * @param {number} startOffset + * @param {number} endOffset + */ +WebInspector.HTMLModel.Token = function(value, type, startOffset, endOffset) +{ + this.value = value; + this.type = type; + this.startOffset = startOffset; + this.endOffset = endOffset; +} + +/** + * @constructor + * @param {string} name + * @param {number} startOffset + * @param {number} endOffset + * @param {!Map<string, string>} attributes + * @param {boolean} isOpenTag + * @param {boolean} selfClosingTag + */ +WebInspector.HTMLModel.Tag = function(name, startOffset, endOffset, attributes, isOpenTag, selfClosingTag) +{ + this.name = name; + this.startOffset = startOffset; + this.endOffset = endOffset; + this.attributes = attributes; + this.isOpenTag = isOpenTag; + this.selfClosingTag = selfClosingTag; +} + +/** + * @constructor + * @param {string} name + */ +WebInspector.HTMLModel.Element = function(name) +{ + this.name = name; + this.children = []; + this.parent = null; + this.openTag = null; + this.closeTag = null; }
diff --git a/third_party/WebKit/Source/devtools/front_end/main/Main.js b/third_party/WebKit/Source/devtools/front_end/main/Main.js index 6d6e53e..3a650aa 100644 --- a/third_party/WebKit/Source/devtools/front_end/main/Main.js +++ b/third_party/WebKit/Source/devtools/front_end/main/Main.js
@@ -106,6 +106,7 @@ Runtime.experiments.register("blackboxJSFramesOnTimeline", "Blackbox JavaScript frames on Timeline", true); Runtime.experiments.register("colorContrastRatio", "Contrast ratio line in color picker", true); Runtime.experiments.register("cpuThrottling", "CPU throttling", true); + Runtime.experiments.register("deviceFrames", "Device frames", true); Runtime.experiments.register("emptySourceMapAutoStepping", "Empty sourcemap auto-stepping"); Runtime.experiments.register("inputEventsOnTimelineOverview", "Input events on Timeline overview", true); Runtime.experiments.register("layersPanel", "Layers panel");
diff --git a/third_party/WebKit/Source/devtools/front_end/network/NetworkDataGridNode.js b/third_party/WebKit/Source/devtools/front_end/network/NetworkDataGridNode.js index 816b6c27..1eadb6e 100644 --- a/third_party/WebKit/Source/devtools/front_end/network/NetworkDataGridNode.js +++ b/third_party/WebKit/Source/devtools/front_end/network/NetworkDataGridNode.js
@@ -336,6 +336,8 @@ var request = this._request; var initiator = request.initiatorInfo(); + if (request.timing && request.timing.pushStart) + cell.appendChild(createTextNode(WebInspector.UIString("Push / "))); switch (initiator.type) { case WebInspector.NetworkRequest.InitiatorType.Parser: cell.title = initiator.url + ":" + initiator.lineNumber; @@ -364,9 +366,9 @@ break; default: - cell.title = ""; + cell.title = WebInspector.UIString("Other"); cell.classList.add("network-dim-cell"); - cell.setTextAndTitle(WebInspector.UIString("Other")); + cell.appendChild(createTextNode(WebInspector.UIString("Other"))); } }, @@ -427,7 +429,7 @@ _updateTimingGraph: function() { var calculator = this._parentView.calculator(); - var timeRanges = WebInspector.RequestTimingView.calculateRequestTimeRanges(this._request); + var timeRanges = WebInspector.RequestTimingView.calculateRequestTimeRanges(this._request, calculator.minimumBoundary()); var right = timeRanges[0].end; var container = this._barAreaElement;
diff --git a/third_party/WebKit/Source/devtools/front_end/network/NetworkOverview.js b/third_party/WebKit/Source/devtools/front_end/network/NetworkOverview.js index 4b95f1d..200bfdd 100644 --- a/third_party/WebKit/Source/devtools/front_end/network/NetworkOverview.js +++ b/third_party/WebKit/Source/devtools/front_end/network/NetworkOverview.js
@@ -251,7 +251,7 @@ var request = requests[i]; var band = this._bandId(request.connectionId); var y = (band === -1) ? 0 : (band % this._numBands + 1); - var timeRanges = WebInspector.RequestTimingView.calculateRequestTimeRanges(request); + var timeRanges = WebInspector.RequestTimingView.calculateRequestTimeRanges(request, this._calculator.minimumBoundary()); for (var j = 0; j < timeRanges.length; ++j) { var type = timeRanges[j].name; if (band !== -1 || type === WebInspector.RequestTimeRangeNames.Total) @@ -268,6 +268,7 @@ drawLines(WebInspector.RequestTimeRangeNames.Connecting, "#FF9800"); drawLines(WebInspector.RequestTimeRangeNames.ServiceWorker, "#FF9800"); drawLines(WebInspector.RequestTimeRangeNames.ServiceWorkerPreparation, "#FF9800"); + drawLines(WebInspector.RequestTimeRangeNames.Push, "#8CDBff"); drawLines(WebInspector.RequestTimeRangeNames.Proxy, "#A1887F"); drawLines(WebInspector.RequestTimeRangeNames.DNS, "#009688"); drawLines(WebInspector.RequestTimeRangeNames.SSL, "#9C27B0");
diff --git a/third_party/WebKit/Source/devtools/front_end/network/RequestTimingView.js b/third_party/WebKit/Source/devtools/front_end/network/RequestTimingView.js index c074f32..5cda044 100644 --- a/third_party/WebKit/Source/devtools/front_end/network/RequestTimingView.js +++ b/third_party/WebKit/Source/devtools/front_end/network/RequestTimingView.js
@@ -73,12 +73,14 @@ /** @enum {string} */ WebInspector.RequestTimeRangeNames = { + Push: "push", Queueing: "queueing", Blocking: "blocking", Connecting: "connecting", DNS: "dns", Proxy: "proxy", Receiving: "receiving", + ReceivingPush: "receiving-push", Sending: "sending", ServiceWorker: "serviceworker", ServiceWorkerPreparation: "serviceworker-preparation", @@ -106,11 +108,13 @@ WebInspector.RequestTimingView._timeRangeTitle = function(name) { switch (name) { + case WebInspector.RequestTimeRangeNames.Push: return WebInspector.UIString("Receiving Push"); case WebInspector.RequestTimeRangeNames.Queueing: return WebInspector.UIString("Queueing"); case WebInspector.RequestTimeRangeNames.Blocking: return WebInspector.UIString("Stalled"); case WebInspector.RequestTimeRangeNames.Connecting: return WebInspector.UIString("Initial connection"); case WebInspector.RequestTimeRangeNames.DNS: return WebInspector.UIString("DNS Lookup"); case WebInspector.RequestTimeRangeNames.Proxy: return WebInspector.UIString("Proxy negotiation"); + case WebInspector.RequestTimeRangeNames.ReceivingPush: return WebInspector.UIString("Reading Push"); case WebInspector.RequestTimeRangeNames.Receiving: return WebInspector.UIString("Content Download"); case WebInspector.RequestTimeRangeNames.Sending: return WebInspector.UIString("Request sent"); case WebInspector.RequestTimeRangeNames.ServiceWorker: return WebInspector.UIString("Request to ServiceWorker"); @@ -124,9 +128,10 @@ /** * @param {!WebInspector.NetworkRequest} request + * @param {number} navigationStart * @return {!Array.<!WebInspector.RequestTimeRange>} */ -WebInspector.RequestTimingView.calculateRequestTimeRanges = function(request) +WebInspector.RequestTimingView.calculateRequestTimeRanges = function(request, navigationStart) { var result = []; /** @@ -180,6 +185,13 @@ var endTime = firstPositive([request.endTime, request.responseReceivedTime]) || startTime; addRange(WebInspector.RequestTimeRangeNames.Total, issueTime < startTime ? issueTime : startTime, endTime); + if (timing.pushStart) { + var pushEnd = timing.pushEnd || endTime; + // Only show the part of push that happened after the navigation/reload. + // Pushes that happened on the same connection before we started main request will not be shown. + if (pushEnd > navigationStart) + addRange(WebInspector.RequestTimeRangeNames.Push, Math.max(timing.pushStart, navigationStart), pushEnd); + } if (issueTime < startTime) addRange(WebInspector.RequestTimeRangeNames.Queueing, issueTime, startTime); @@ -188,7 +200,7 @@ addOffsetRange(WebInspector.RequestTimeRangeNames.ServiceWorkerPreparation, timing.workerStart, timing.workerReady); addOffsetRange(WebInspector.RequestTimeRangeNames.ServiceWorker, timing.workerReady, timing.sendEnd); addOffsetRange(WebInspector.RequestTimeRangeNames.Waiting, timing.sendEnd, timing.receiveHeadersEnd); - } else { + } else if (!timing.pushStart) { var blocking = firstPositive([timing.dnsStart, timing.connectStart, timing.sendStart]) || 0; addOffsetRange(WebInspector.RequestTimeRangeNames.Blocking, 0, blocking); addOffsetRange(WebInspector.RequestTimeRangeNames.Proxy, timing.proxyStart, timing.proxyEnd); @@ -200,7 +212,7 @@ } if (request.endTime !== -1) - addRange(WebInspector.RequestTimeRangeNames.Receiving, request.responseReceivedTime, endTime); + addRange(timing.pushStart ? WebInspector.RequestTimeRangeNames.ReceivingPush : WebInspector.RequestTimeRangeNames.Receiving, request.responseReceivedTime, endTime); return result; } @@ -218,9 +230,9 @@ colgroup.createChild("col", "bars"); colgroup.createChild("col", "duration"); - var timeRanges = WebInspector.RequestTimingView.calculateRequestTimeRanges(request); - var startTime = timeRanges[0].start; - var endTime = timeRanges[0].end; + var timeRanges = WebInspector.RequestTimingView.calculateRequestTimeRanges(request, navigationStart); + var startTime = timeRanges.map(r => r.start).reduce((a, b) => Math.min(a, b)); + var endTime = timeRanges.map(r => r.end).reduce((a, b) => Math.max(a, b)); var scale = 100 / (endTime - startTime); var connectionHeader; @@ -234,20 +246,14 @@ totalDuration = range.end - range.start; continue; } - if (WebInspector.RequestTimingView.ConnectionSetupRangeNames[rangeName]) { - if (!connectionHeader) { - connectionHeader = tableElement.createChild("tr", "network-timing-table-header"); - connectionHeader.createChild("td").createTextChild(WebInspector.UIString("Connection Setup")); - connectionHeader.createChild("td").createTextChild(""); - connectionHeader.createChild("td").createTextChild(WebInspector.UIString("TIME")); - } + if (rangeName === WebInspector.RequestTimeRangeNames.Push) { + createHeader(WebInspector.UIString("Server Push")); + } else if (WebInspector.RequestTimingView.ConnectionSetupRangeNames[rangeName]) { + if (!connectionHeader) + connectionHeader = createHeader(WebInspector.UIString("Connection Setup")); } else { - if (!dataHeader) { - dataHeader = tableElement.createChild("tr", "network-timing-table-header"); - dataHeader.createChild("td").createTextChild(WebInspector.UIString("Request/Response")); - dataHeader.createChild("td").createTextChild(""); - dataHeader.createChild("td").createTextChild(WebInspector.UIString("TIME")); - } + if (!dataHeader) + dataHeader = createHeader(WebInspector.UIString("Request/Response")); } var left = (scale * (range.start - startTime)); @@ -279,4 +285,16 @@ footer.createChild("td").createTextChild(Number.secondsToString(totalDuration, true)); return tableElement; + + /** + * param {string} title + */ + function createHeader(title) + { + var dataHeader = tableElement.createChild("tr", "network-timing-table-header"); + dataHeader.createChild("td").createTextChild(title); + dataHeader.createChild("td").createTextChild(""); + dataHeader.createChild("td").createTextChild(WebInspector.UIString("TIME")); + return dataHeader; + } }
diff --git a/third_party/WebKit/Source/devtools/front_end/network/networkLogView.css b/third_party/WebKit/Source/devtools/front_end/network/networkLogView.css index 64c11f5..b626af8 100644 --- a/third_party/WebKit/Source/devtools/front_end/network/networkLogView.css +++ b/third_party/WebKit/Source/devtools/front_end/network/networkLogView.css
@@ -384,7 +384,8 @@ .network-graph-bar.request-timing.dns, .network-graph-bar.request-timing.ssl, .network-graph-bar.request-timing.connecting, -.network-graph-bar.request-timing.blocking { +.network-graph-bar.request-timing.blocking, +.network-graph-bar.request-timing.push { margin: 3px 0; } @@ -393,7 +394,8 @@ border: solid 1px #AAAAAA; } -.network-graph-bar.request-timing.receiving, -theme-preserve { +.network-graph-bar.request-timing.receiving, -theme-preserve, +.network-graph-bar.request-timing.receiving-push, -theme-preserve { background-color: #03A9F4; } @@ -421,6 +423,10 @@ background-color: #AAAAAA; } +.network-graph-bar.request-timing.push, -theme-preserve { + background-color: #8CDBff; +} + .network-graph-bar.cached { background: hsl(0, 0%, 90%); } @@ -642,4 +648,4 @@ font-size: 14px; text-align: center; line-height: 28px; -} \ No newline at end of file +}
diff --git a/third_party/WebKit/Source/devtools/front_end/network/networkPanel.css b/third_party/WebKit/Source/devtools/front_end/network/networkPanel.css index 741ba56..d8dfd184 100644 --- a/third_party/WebKit/Source/devtools/front_end/network/networkPanel.css +++ b/third_party/WebKit/Source/devtools/front_end/network/networkPanel.css
@@ -159,10 +159,15 @@ background-color: #00C853; } -.network-timing-bar.receiving, -theme-preserve { +.network-timing-bar.receiving, -theme-preserve, +.network-timing-bar.receiving-push, -theme-preserve { background-color: #03A9F4; } +.network-timing-bar.push, -theme-preserve { + background-color: #8CDBff; +} + .network-timing-bar.proxy, .network-timing-bar.dns, .network-timing-bar.ssl, @@ -239,4 +244,4 @@ .network-blocked-urls { border-top: 1px solid #dadada; flex: 104px 0 0; -} \ No newline at end of file +}
diff --git a/third_party/WebKit/Source/devtools/front_end/resources/ResourcesPanel.js b/third_party/WebKit/Source/devtools/front_end/resources/ResourcesPanel.js index eba4a9b..0d4f2a6 100644 --- a/third_party/WebKit/Source/devtools/front_end/resources/ResourcesPanel.js +++ b/third_party/WebKit/Source/devtools/front_end/resources/ResourcesPanel.js
@@ -217,7 +217,7 @@ this.cookieListTreeElement.removeChildren(); this.cacheStorageListTreeElement.removeChildren(); - if (this.visibleView && !(this.visibleView instanceof WebInspector.StorageCategoryView)) + if (this.visibleView && !(this.visibleView instanceof WebInspector.StorageCategoryView) && !(this.visibleView instanceof WebInspector.ServiceWorkersView)) this.visibleView.detach(); this._storageViewToolbar.removeToolbarItems(); @@ -1513,29 +1513,37 @@ /** * @constructor - * @extends {WebInspector.StorageCategoryTreeElement} + * @extends {WebInspector.BaseStorageTreeElement} * @param {!WebInspector.ResourcesPanel} storagePanel */ WebInspector.ServiceWorkersTreeElement = function(storagePanel) { - WebInspector.StorageCategoryTreeElement.call(this, storagePanel, WebInspector.UIString("Service Workers"), "Service Workers", ["service-workers-tree-item"]); + WebInspector.BaseStorageTreeElement.call(this, storagePanel, "Service Workers", ["service-workers-tree-item"], false); } WebInspector.ServiceWorkersTreeElement.prototype = { /** + * @return {string} + */ + get itemURL() + { + return "service-workers://"; + }, + + /** * @override * @return {boolean} */ onselect: function(selectedByUser) { - WebInspector.StorageCategoryTreeElement.prototype.onselect.call(this, selectedByUser); + WebInspector.BaseStorageTreeElement.prototype.onselect.call(this, selectedByUser); if (!this._view) this._view = new WebInspector.ServiceWorkersView(); this._storagePanel.showServiceWorkersView(this._view); return false; }, - __proto__: WebInspector.StorageCategoryTreeElement.prototype + __proto__: WebInspector.BaseStorageTreeElement.prototype }
diff --git a/third_party/WebKit/Source/devtools/front_end/resources/ServiceWorkersView.js b/third_party/WebKit/Source/devtools/front_end/resources/ServiceWorkersView.js index 89806df5..b46c2e4 100644 --- a/third_party/WebKit/Source/devtools/front_end/resources/ServiceWorkersView.js +++ b/third_party/WebKit/Source/devtools/front_end/resources/ServiceWorkersView.js
@@ -43,10 +43,12 @@ this._target = target; this._manager = this._target.serviceWorkerManager; - var forceUpdate = new WebInspector.ToolbarCheckbox(WebInspector.UIString("Update on reload"), WebInspector.UIString("Update Service Worker on page reload"), this._manager.forceUpdateOnReloadSetting()); + var forceUpdate = new WebInspector.ToolbarCheckbox(WebInspector.UIString("Update worker on reload"), WebInspector.UIString("Update Service Worker on page reload"), this._manager.forceUpdateOnReloadSetting()); this._toolbar.appendToolbarItem(forceUpdate); - - this._showAllCheckbox = new WebInspector.ToolbarCheckbox(WebInspector.UIString("Show all"), WebInspector.UIString("Show all Service Workers")); + var fallbackToNetwork = new WebInspector.ToolbarCheckbox(WebInspector.UIString("Bypass worker for network"), WebInspector.UIString("Bypass Service Worker and load resources from the network"), target.networkManager.bypassServiceWorkerSetting()); + this._toolbar.appendToolbarItem(fallbackToNetwork); + this._toolbar.appendSpacer(); + this._showAllCheckbox = new WebInspector.ToolbarCheckbox(WebInspector.UIString("Show all"), WebInspector.UIString("Show all Service Workers regardless of the scope")); this._showAllCheckbox.inputElement.addEventListener("change", this._onShowAllCheckboxChanged.bind(this), false); this._toolbar.appendToolbarItem(this._showAllCheckbox);
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/CPUProfileDataModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/CPUProfileDataModel.js index d51f72d5..702ae6c 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/CPUProfileDataModel.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/CPUProfileDataModel.js
@@ -2,72 +2,82 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +/** + * @constructor + * @extends {WebInspector.ProfileNode} + * @param {!ProfilerAgent.CPUProfileNode} sourceNode + * @param {number} sampleTime + */ +WebInspector.CPUProfileNode = function(sourceNode, sampleTime) +{ + WebInspector.ProfileNode.call(this, sourceNode.functionName, sourceNode.scriptId, sourceNode.url, sourceNode.lineNumber, sourceNode.columnNumber); + this.id = sourceNode.id; + this.self = sourceNode.hitCount * sampleTime; + this.callUID = sourceNode.callUID; + this.positionTicks = sourceNode.positionTicks; + this.deoptReason = sourceNode.deoptReason; + // TODO: Remove the following field in favor of this.self + this.selfTime = this.self; +} + +WebInspector.CPUProfileNode.prototype = { + __proto__: WebInspector.ProfileNode.prototype +} /** * @constructor + * @extends {WebInspector.ProfileTreeModel} * @param {!ProfilerAgent.CPUProfile} profile */ WebInspector.CPUProfileDataModel = function(profile) { - this.profileHead = profile.head; this.samples = profile.samples; this.timestamps = profile.timestamps; + // Convert times from sec to msec. this.profileStartTime = profile.startTime * 1000; this.profileEndTime = profile.endTime * 1000; - this._assignParentsInProfile(); + this.totalHitCount = 0; + if (!WebInspector.moduleSetting("showNativeFunctionsInJSProfile").get()) + this._filterNativeFrames(profile.head); + this.profileHead = this._translateProfileTree(profile.head); + WebInspector.ProfileTreeModel.call(this, this.profileHead, this.profileStartTime, this.profileEndTime); + this._extractMetaNodes(); if (this.samples) { + this._buildIdToNodeMap(); this._sortSamples(); this._normalizeTimestamps(); - this._buildIdToNodeMap(); this._fixMissingSamples(); } - if (!WebInspector.moduleSetting("showNativeFunctionsInJSProfile").get()) - this._filterNativeFrames(); - this._assignDepthsInProfile(); - this._calculateTimes(profile); + this._assignTotalTimes(this.profileHead); } WebInspector.CPUProfileDataModel.prototype = { /** - * @param {!ProfilerAgent.CPUProfile} profile + * @param {!ProfilerAgent.CPUProfileNode} root */ - _calculateTimes: function(profile) + _filterNativeFrames: function(root) { - function totalHitCount(node) { - var result = node.hitCount; - for (var i = 0; i < node.children.length; i++) - result += totalHitCount(node.children[i]); - return result; - } - profile.totalHitCount = totalHitCount(profile.head); - this.totalHitCount = profile.totalHitCount; - - var duration = this.profileEndTime - this.profileStartTime; - var samplingInterval = duration / profile.totalHitCount; - this.samplingInterval = samplingInterval; - - function calculateTimesForNode(node) { - node.selfTime = node.hitCount * samplingInterval; - var totalHitCount = node.hitCount; - for (var i = 0; i < node.children.length; i++) - totalHitCount += calculateTimesForNode(node.children[i]); - node.totalTime = totalHitCount * samplingInterval; - return totalHitCount; - } - calculateTimesForNode(profile.head); - }, - - _filterNativeFrames: function() - { + // TODO: get rid of this function and do the filtering while _translateProfileTree if (this.samples) { + /** @type {!Map<number, !ProfilerAgent.CPUProfileNode>} */ + var idToNode = new Map(); + var stack = [root]; + while (stack.length) { + var node = stack.pop(); + idToNode.set(node.id, node); + for (var i = 0; i < node.children.length; i++) { + node.children[i].parent = node; + stack.push(node.children[i]); + } + } for (var i = 0; i < this.samples.length; ++i) { - var node = this.nodeByIndex(i); + var node = idToNode.get(this.samples[i]); while (isNativeNode(node)) node = node.parent; this.samples[i] = node.id; } } - processSubtree(this.profileHead); + processSubtree(root); /** * @param {!ProfilerAgent.CPUProfileNode} node @@ -118,44 +128,43 @@ } }, - _assignParentsInProfile: function() + /** + * @param {!ProfilerAgent.CPUProfileNode} root + * @return {!WebInspector.CPUProfileNode} + */ + _translateProfileTree: function(root) { - var head = this.profileHead; - head.parent = null; - var nodesToTraverse = [ head ]; - while (nodesToTraverse.length) { - var parent = nodesToTraverse.pop(); - var children = parent.children; - var length = children.length; - for (var i = 0; i < length; ++i) { - var child = children[i]; - child.parent = parent; - if (child.children.length) - nodesToTraverse.push(child); - } + /** + * @param {!ProfilerAgent.CPUProfileNode} node + * @return {number} + */ + function computeHitCountForSubtree(node) + { + return node.children.reduce((acc, node) => acc + computeHitCountForSubtree(node), node.hitCount); } + this.totalHitCount = computeHitCountForSubtree(root); + var sampleTime = (this.profileEndTime - this.profileStartTime) / this.totalHitCount; + var resultRoot = new WebInspector.CPUProfileNode(root, sampleTime); + var targetNodeStack = [resultRoot]; + var sourceNodeStack = [root]; + while (sourceNodeStack.length) { + var sourceNode = sourceNodeStack.pop(); + var parentNode = targetNodeStack.pop(); + parentNode.children = sourceNode.children.map(child => new WebInspector.CPUProfileNode(child, sampleTime)); + sourceNodeStack.push.apply(sourceNodeStack, sourceNode.children); + targetNodeStack.push.apply(targetNodeStack, parentNode.children); + } + return resultRoot; }, - _assignDepthsInProfile: function() + /** + * @param {!WebInspector.ProfileNode} node + */ + _assignTotalTimes: function(node) { - var head = this.profileHead; - head.depth = -1; - this.maxDepth = 0; - var nodesToTraverse = [ head ]; - while (nodesToTraverse.length) { - var parent = nodesToTraverse.pop(); - var depth = parent.depth + 1; - if (depth > this.maxDepth) - this.maxDepth = depth; - var children = parent.children; - var length = children.length; - for (var i = 0; i < length; ++i) { - var child = children[i]; - child.depth = depth; - if (child.children.length) - nodesToTraverse.push(child); - } - } + // TODO: get rid of this field in favor of this.total + node.totalTime = node.total; + node.children.forEach(this._assignTotalTimes, this); }, _sortSamples: function() @@ -213,7 +222,7 @@ _buildIdToNodeMap: function() { - /** @type {!Object.<number, !ProfilerAgent.CPUProfileNode>} */ + /** @type {!Object<number, !WebInspector.CPUProfileNode>} */ this._idToNode = {}; var idToNode = this._idToNode; var stack = [this.profileHead]; @@ -223,7 +232,10 @@ for (var i = 0; i < node.children.length; i++) stack.push(node.children[i]); } + }, + _extractMetaNodes: function() + { var topLevelNodes = this.profileHead.children; for (var i = 0; i < topLevelNodes.length && !(this.gcNode && this.programNode && this.idleNode); i++) { var node = topLevelNodes[i]; @@ -265,12 +277,12 @@ } /** - * @param {!ProfilerAgent.CPUProfileNode} node - * @return {!ProfilerAgent.CPUProfileNode} + * @param {!WebInspector.ProfileNode} node + * @return {!WebInspector.ProfileNode} */ function bottomNode(node) { - while (node.parent.parent) + while (node.parent && node.parent.parent) node = node.parent; return node; } @@ -286,8 +298,8 @@ }, /** - * @param {function(number, !ProfilerAgent.CPUProfileNode, number)} openFrameCallback - * @param {function(number, !ProfilerAgent.CPUProfileNode, number, number, number)} closeFrameCallback + * @param {function(number, !WebInspector.CPUProfileNode, number)} openFrameCallback + * @param {function(number, !WebInspector.CPUProfileNode, number, number, number)} closeFrameCallback * @param {number=} startTime * @param {number=} stopTime */ @@ -358,7 +370,7 @@ var start = stackStartTimes[stackTop]; var duration = sampleTime - start; stackChildrenDuration[stackTop - 1] += duration; - closeFrameCallback(prevNode.depth, prevNode, start, duration, duration - stackChildrenDuration[stackTop]); + closeFrameCallback(prevNode.depth, /** @type {!WebInspector.CPUProfileNode} */(prevNode), start, duration, duration - stackChildrenDuration[stackTop]); --stackTop; if (node.depth === prevNode.depth) { stackNodes.push(node); @@ -390,18 +402,19 @@ var start = stackStartTimes[stackTop]; var duration = sampleTime - start; stackChildrenDuration[stackTop - 1] += duration; - closeFrameCallback(node.depth, node, start, duration, duration - stackChildrenDuration[stackTop]); + closeFrameCallback(node.depth, /** @type {!WebInspector.CPUProfileNode} */(node), start, duration, duration - stackChildrenDuration[stackTop]); --stackTop; } }, /** * @param {number} index - * @return {!ProfilerAgent.CPUProfileNode} + * @return {!WebInspector.CPUProfileNode} */ nodeByIndex: function(index) { return this._idToNode[this.samples[index]]; - } + }, + __proto__: WebInspector.ProfileTreeModel.prototype }
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/NetworkManager.js b/third_party/WebKit/Source/devtools/front_end/sdk/NetworkManager.js index 55b3b748..efa1c83 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/NetworkManager.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/NetworkManager.js
@@ -54,6 +54,11 @@ /** @type {!Map<!NetworkAgent.CertificateId, !Promise<!NetworkAgent.CertificateDetails>>} */ this._certificateDetailsCache = new Map(); + this._bypassServiceWorkerSetting = WebInspector.settings.createSetting("bypassServiceWorker", false); + if (this._bypassServiceWorkerSetting.get()) + this._bypassServiceWorkerChanged(); + this._bypassServiceWorkerSetting.addChangeListener(this._bypassServiceWorkerChanged, this); + WebInspector.moduleSetting("cacheDisabled").addChangeListener(this._cacheDisabledSettingChanged, this); } @@ -145,6 +150,19 @@ return promise; }, + /** + * @return {!WebInspector.Setting} + */ + bypassServiceWorkerSetting: function() + { + return this._bypassServiceWorkerSetting; + }, + + _bypassServiceWorkerChanged: function() + { + this._networkAgent.setBypassServiceWorker(this._bypassServiceWorkerSetting.get()); + }, + __proto__: WebInspector.SDKModel.prototype }
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/ProfileTreeModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/ProfileTreeModel.js new file mode 100644 index 0000000..49b4fac --- /dev/null +++ b/third_party/WebKit/Source/devtools/front_end/sdk/ProfileTreeModel.js
@@ -0,0 +1,123 @@ +// 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. + +/** + * @constructor + */ +WebInspector.ProfileNode = function(functionName, scriptId, url, lineNumber, columnNumber) +{ + /** @type {!RuntimeAgent.CallFrame} */ + this.frame = { + functionName: functionName, + scriptId: scriptId, + url: url, + lineNumber: lineNumber, + columnNumber: columnNumber + }; + /** @type {number} */ + this.callUID; + /** @type {number} */ + this.self = 0; + /** @type {number} */ + this.total = 0; + /** @type {number} */ + this.id = 0; + /** @type {?WebInspector.ProfileNode} */ + this.parent = null; + /** @type {!Array<!WebInspector.ProfileNode>} */ + this.children = []; +} + +WebInspector.ProfileNode.prototype = { + /** + * @return {string} + */ + get functionName() + { + return this.frame.functionName; + }, + + /** + * @return {string} + */ + get scriptId() + { + return this.frame.scriptId; + }, + + /** + * @return {string} + */ + get url() + { + return this.frame.url; + }, + + /** + * @return {number} + */ + get lineNumber() + { + return this.frame.lineNumber; + }, + + /** + * @return {number} + */ + get columnNumber() + { + return this.frame.columnNumber; + } +} + +/** + * @constructor + * @param {!WebInspector.ProfileNode} root + * @param {number} begin + * @param {number} end + */ +WebInspector.ProfileTreeModel = function(root, begin, end) +{ + this.root = root; + this.begin = begin; + this.end = end; + this._assignDepthsAndParents(); + this._calculateTotals(this.root); +} + +WebInspector.ProfileTreeModel.prototype = { + _assignDepthsAndParents: function() + { + var root = this.root; + root.depth = -1; + root.parent = null; + this.maxDepth = 0; + var nodesToTraverse = [root]; + while (nodesToTraverse.length) { + var parent = nodesToTraverse.pop(); + var depth = parent.depth + 1; + if (depth > this.maxDepth) + this.maxDepth = depth; + var children = parent.children; + var length = children.length; + for (var i = 0; i < length; ++i) { + var child = children[i]; + child.depth = depth; + child.parent = parent; + if (child.children.length) + nodesToTraverse.push(child); + } + } + }, + + /** + * @param {!WebInspector.ProfileNode} node + * @return {number} + */ + _calculateTotals: function(node) + { + node.total = node.children.reduce((acc, child) => acc + this._calculateTotals(child), node.self); + return node.total; + } +}
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/module.json b/third_party/WebKit/Source/devtools/front_end/sdk/module.json index dd2f07e..cb90918b 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/module.json +++ b/third_party/WebKit/Source/devtools/front_end/sdk/module.json
@@ -68,6 +68,7 @@ "ConsoleModel.js", "ContentProviders.js", "CookieParser.js", + "ProfileTreeModel.js", "CPUProfileDataModel.js", "CPUProfilerModel.js", "CSSMatchedStyles.js",
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/Popover.js b/third_party/WebKit/Source/devtools/front_end/ui/Popover.js index 5b13ba5..c17ef69 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/Popover.js +++ b/third_party/WebKit/Source/devtools/front_end/ui/Popover.js
@@ -243,7 +243,7 @@ } this.element.className = WebInspector.Popover._classNamePrefix + " " + verticalAlignment + "-" + horizontalAlignment + "-arrow"; - this.element.positionAt(newElementPosition.x, Math.max(0, newElementPosition.y - borderWidth), container); + this.element.positionAt(newElementPosition.x, newElementPosition.y - borderWidth, container); this.element.style.width = newElementPosition.width + borderWidth * 2 + "px"; this.element.style.height = newElementPosition.height + borderWidth * 2 + "px"; },
diff --git a/third_party/WebKit/Source/devtools/protocol.json b/third_party/WebKit/Source/devtools/protocol.json index 211e420..00002f8 100644 --- a/third_party/WebKit/Source/devtools/protocol.json +++ b/third_party/WebKit/Source/devtools/protocol.json
@@ -1223,6 +1223,8 @@ { "name": "workerReady", "type": "number", "description": "Finished Starting ServiceWorker.", "hidden": true }, { "name": "sendStart", "type": "number", "description": "Started sending request." }, { "name": "sendEnd", "type": "number", "description": "Finished sending request." }, + { "name": "pushStart", "type": "number", "description": "Time the server started pushing request.", "hidden": true }, + { "name": "pushEnd", "type": "number", "description": "Time the server finished pushing request.", "hidden": true }, { "name": "receiveHeadersEnd", "type": "number", "description": "Finished receiving response headers." } ] }, @@ -1547,6 +1549,14 @@ "description": "Toggles ignoring cache for each request. If <code>true</code>, cache will not be used." }, { + "name": "setBypassServiceWorker", + "parameters": [ + { "name": "bypass", "type": "boolean", "description": "Bypass service worker and load from network." } + ], + "hidden": true, + "description": "Toggles ignoring of service worker for each request." + }, + { "name": "setDataSizeLimitsForTest", "parameters": [ { "name": "maxTotalSize", "type": "integer", "description": "Maximum total buffer size." },
diff --git a/third_party/WebKit/Source/modules/BUILD.gn b/third_party/WebKit/Source/modules/BUILD.gn index d434475..d6f3807 100644 --- a/third_party/WebKit/Source/modules/BUILD.gn +++ b/third_party/WebKit/Source/modules/BUILD.gn
@@ -49,7 +49,7 @@ "//device/battery:mojo_bindings", "//mojo/public/c/system:for_component", "//third_party/WebKit/Source/core", - "//third_party/WebKit/public:mojo_bindings_blink", + "//third_party/WebKit/public:mojo_bindings_wtf", "//third_party/icu", "//third_party/sqlite", "//third_party/zlib",
diff --git a/third_party/WebKit/Source/modules/DEPS b/third_party/WebKit/Source/modules/DEPS index 1800e32..c8e67bd 100644 --- a/third_party/WebKit/Source/modules/DEPS +++ b/third_party/WebKit/Source/modules/DEPS
@@ -5,5 +5,6 @@ "+modules", "+platform", "+public/platform", + "+skia/ext", "-web", ]
diff --git a/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp b/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp index 9f4185d..4c3f5f3 100644 --- a/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp +++ b/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp
@@ -912,19 +912,25 @@ SkPaint imagePaint = *paint; if (paint->getImageFilter()) { + SkMatrix ctm = c->getTotalMatrix(); SkMatrix invCtm; - if (!c->getTotalMatrix().invert(&invCtm)) { + if (!ctm.invert(&invCtm)) { // There is an earlier check for invertibility, but the arithmetic // in AffineTransform is not exactly identical, so it is possible // for SkMatrix to find the transform to be non-invertible at this stage. // crbug.com/504687 return; } + c->save(); + c->concat(invCtm); SkRect bounds = dstRect; + ctm.mapRect(&bounds); SkPaint layerPaint; layerPaint.setXfermode(sk_ref_sp(paint->getXfermode())); - layerPaint.setImageFilter(paint->getImageFilter()->makeWithLocalMatrix(invCtm)); + layerPaint.setImageFilter(paint->getImageFilter()); + c->saveLayer(&bounds, &layerPaint); + c->concat(ctm); imagePaint.setXfermodeMode(SkXfermode::kSrcOver_Mode); imagePaint.setImageFilter(nullptr); }
diff --git a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DState.cpp b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DState.cpp index d7956f30..c76cff5 100644 --- a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DState.cpp +++ b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DState.cpp
@@ -317,12 +317,11 @@ const double effectiveZoom = 1.0; // Deliberately ignore zoom on the canvas element filterEffectBuilder->build(styleResolutionHost, filterStyle->filter(), effectiveZoom, &floatCanvasSize, &fillPaintForFilter, &strokePaintForFilter); - SkiaImageFilterBuilder imageFilterBuilder; FilterEffect* lastEffect = filterEffectBuilder->lastEffect(); if (lastEffect) { lastEffect->determineFilterPrimitiveSubregion(); } - m_resolvedFilter = imageFilterBuilder.build(lastEffect, ColorSpaceDeviceRGB); + m_resolvedFilter = SkiaImageFilterBuilder::build(lastEffect, ColorSpaceDeviceRGB); if (m_resolvedFilter) { updateFilterReferences(toHTMLCanvasElement(styleResolutionHost), context, filterStyle->filter()); if (lastEffect->originTainted())
diff --git a/third_party/WebKit/Source/modules/compositorworker/CompositorWorker.cpp b/third_party/WebKit/Source/modules/compositorworker/CompositorWorker.cpp index 759dc94..3eefc6a 100644 --- a/third_party/WebKit/Source/modules/compositorworker/CompositorWorker.cpp +++ b/third_party/WebKit/Source/modules/compositorworker/CompositorWorker.cpp
@@ -42,7 +42,7 @@ return EventTargetNames::CompositorWorker; } -WorkerGlobalScopeProxy* CompositorWorker::createWorkerGlobalScopeProxy(ExecutionContext* worker) +InProcessWorkerGlobalScopeProxy* CompositorWorker::createInProcessWorkerGlobalScopeProxy(ExecutionContext* worker) { ASSERT(getExecutionContext()->isDocument()); return new CompositorWorkerMessagingProxy(this);
diff --git a/third_party/WebKit/Source/modules/compositorworker/CompositorWorker.h b/third_party/WebKit/Source/modules/compositorworker/CompositorWorker.h index 9a8f05a..32666cc 100644 --- a/third_party/WebKit/Source/modules/compositorworker/CompositorWorker.h +++ b/third_party/WebKit/Source/modules/compositorworker/CompositorWorker.h
@@ -14,7 +14,7 @@ class ExceptionState; class ExecutionContext; -class WorkerGlobalScopeProxy; +class InProcessWorkerGlobalScopeProxy; class MODULES_EXPORT CompositorWorker final : public InProcessWorkerBase { DEFINE_WRAPPERTYPEINFO(); @@ -23,7 +23,7 @@ ~CompositorWorker() override; const AtomicString& interfaceName() const override; - WorkerGlobalScopeProxy* createWorkerGlobalScopeProxy(ExecutionContext*) override; + InProcessWorkerGlobalScopeProxy* createInProcessWorkerGlobalScopeProxy(ExecutionContext*) override; private: explicit CompositorWorker(ExecutionContext*);
diff --git a/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerGlobalScope.cpp b/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerGlobalScope.cpp index 9389cb2..3498359 100644 --- a/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerGlobalScope.cpp +++ b/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerGlobalScope.cpp
@@ -5,7 +5,7 @@ #include "modules/compositorworker/CompositorWorkerGlobalScope.h" #include "bindings/core/v8/SerializedScriptValue.h" -#include "core/workers/WorkerObjectProxy.h" +#include "core/workers/InProcessWorkerObjectProxy.h" #include "core/workers/WorkerThreadStartupData.h" #include "modules/EventTargetModules.h" #include "modules/compositorworker/CompositorWorkerThread.h"
diff --git a/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerMessagingProxy.cpp b/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerMessagingProxy.cpp index 041ba09..676e3849 100644 --- a/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerMessagingProxy.cpp +++ b/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerMessagingProxy.cpp
@@ -10,7 +10,7 @@ namespace blink { CompositorWorkerMessagingProxy::CompositorWorkerMessagingProxy(InProcessWorkerBase* worker) - : WorkerMessagingProxy(worker, nullptr) + : InProcessWorkerMessagingProxy(worker, nullptr) { }
diff --git a/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerMessagingProxy.h b/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerMessagingProxy.h index da72f7f1..4fd262d 100644 --- a/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerMessagingProxy.h +++ b/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerMessagingProxy.h
@@ -5,12 +5,12 @@ #ifndef CompositorWorkerMessagingProxy_h #define CompositorWorkerMessagingProxy_h -#include "core/workers/WorkerMessagingProxy.h" +#include "core/workers/InProcessWorkerMessagingProxy.h" #include "wtf/Allocator.h" namespace blink { -class CompositorWorkerMessagingProxy final : public WorkerMessagingProxy { +class CompositorWorkerMessagingProxy final : public InProcessWorkerMessagingProxy { USING_FAST_MALLOC(CompositorWorkerMessagingProxy); public: explicit CompositorWorkerMessagingProxy(InProcessWorkerBase*);
diff --git a/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThread.cpp b/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThread.cpp index e68c9a31..5fe50aa4 100644 --- a/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThread.cpp +++ b/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThread.cpp
@@ -6,8 +6,8 @@ #include "bindings/core/v8/V8GCController.h" #include "bindings/core/v8/V8Initializer.h" +#include "core/workers/InProcessWorkerObjectProxy.h" #include "core/workers/WorkerBackingThread.h" -#include "core/workers/WorkerObjectProxy.h" #include "core/workers/WorkerThreadStartupData.h" #include "modules/compositorworker/CompositorWorkerGlobalScope.h" #include "platform/ThreadSafeFunctional.h" @@ -42,14 +42,14 @@ } // namespace -PassOwnPtr<CompositorWorkerThread> CompositorWorkerThread::create(PassRefPtr<WorkerLoaderProxy> workerLoaderProxy, WorkerObjectProxy& workerObjectProxy, double timeOrigin) +PassOwnPtr<CompositorWorkerThread> CompositorWorkerThread::create(PassRefPtr<WorkerLoaderProxy> workerLoaderProxy, InProcessWorkerObjectProxy& workerObjectProxy, double timeOrigin) { TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("compositor-worker"), "CompositorWorkerThread::create"); ASSERT(isMainThread()); return adoptPtr(new CompositorWorkerThread(workerLoaderProxy, workerObjectProxy, timeOrigin)); } -CompositorWorkerThread::CompositorWorkerThread(PassRefPtr<WorkerLoaderProxy> workerLoaderProxy, WorkerObjectProxy& workerObjectProxy, double timeOrigin) +CompositorWorkerThread::CompositorWorkerThread(PassRefPtr<WorkerLoaderProxy> workerLoaderProxy, InProcessWorkerObjectProxy& workerObjectProxy, double timeOrigin) : WorkerThread(workerLoaderProxy, workerObjectProxy) , m_workerObjectProxy(workerObjectProxy) , m_timeOrigin(timeOrigin)
diff --git a/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThread.h b/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThread.h index 6c80a73..78614f8 100644 --- a/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThread.h +++ b/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThread.h
@@ -10,15 +10,15 @@ namespace blink { -class WorkerObjectProxy; +class InProcessWorkerObjectProxy; // This class is overridden in unit-tests. class MODULES_EXPORT CompositorWorkerThread final : public WorkerThread { public: - static PassOwnPtr<CompositorWorkerThread> create(PassRefPtr<WorkerLoaderProxy>, WorkerObjectProxy&, double timeOrigin); + static PassOwnPtr<CompositorWorkerThread> create(PassRefPtr<WorkerLoaderProxy>, InProcessWorkerObjectProxy&, double timeOrigin); ~CompositorWorkerThread() override; - WorkerObjectProxy& workerObjectProxy() const { return m_workerObjectProxy; } + InProcessWorkerObjectProxy& workerObjectProxy() const { return m_workerObjectProxy; } WorkerBackingThread& workerBackingThread() override; bool shouldAttachThreadDebugger() const override { return false; } @@ -26,12 +26,12 @@ static void clearSharedBackingThread(); protected: - CompositorWorkerThread(PassRefPtr<WorkerLoaderProxy>, WorkerObjectProxy&, double timeOrigin); + CompositorWorkerThread(PassRefPtr<WorkerLoaderProxy>, InProcessWorkerObjectProxy&, double timeOrigin); WorkerGlobalScope* createWorkerGlobalScope(PassOwnPtr<WorkerThreadStartupData>) override; private: - WorkerObjectProxy& m_workerObjectProxy; + InProcessWorkerObjectProxy& m_workerObjectProxy; double m_timeOrigin; };
diff --git a/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThreadTest.cpp b/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThreadTest.cpp index 534df2f..5ff366c8 100644 --- a/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThreadTest.cpp +++ b/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThreadTest.cpp
@@ -8,9 +8,9 @@ #include "bindings/core/v8/V8GCController.h" #include "core/inspector/ConsoleMessage.h" #include "core/testing/DummyPageHolder.h" +#include "core/workers/InProcessWorkerObjectProxy.h" #include "core/workers/WorkerBackingThread.h" #include "core/workers/WorkerLoaderProxy.h" -#include "core/workers/WorkerObjectProxy.h" #include "core/workers/WorkerThreadStartupData.h" #include "platform/ThreadSafeFunctional.h" #include "platform/WaitableEvent.h" @@ -24,8 +24,8 @@ namespace blink { namespace { -// A null WorkerObjectProxy, supplied when creating CompositorWorkerThreads. -class TestCompositorWorkerObjectProxy : public WorkerObjectProxy { +// A null InProcessWorkerObjectProxy, supplied when creating CompositorWorkerThreads. +class TestCompositorWorkerObjectProxy : public InProcessWorkerObjectProxy { public: static PassOwnPtr<TestCompositorWorkerObjectProxy> create(ExecutionContext* context) { @@ -48,7 +48,7 @@ private: TestCompositorWorkerObjectProxy(ExecutionContext* context) - : WorkerObjectProxy(nullptr) + : InProcessWorkerObjectProxy(nullptr) , m_executionContext(context) { } @@ -132,7 +132,7 @@ OwnPtr<DummyPageHolder> m_page; RefPtr<SecurityOrigin> m_securityOrigin; - OwnPtr<WorkerObjectProxy> m_objectProxy; + OwnPtr<InProcessWorkerObjectProxy> m_objectProxy; CompositorWorkerTestPlatform m_testPlatform; };
diff --git a/third_party/WebKit/Source/modules/fetch/Body.cpp b/third_party/WebKit/Source/modules/fetch/Body.cpp index 834bb69..670ea27b 100644 --- a/third_party/WebKit/Source/modules/fetch/Body.cpp +++ b/third_party/WebKit/Source/modules/fetch/Body.cpp
@@ -270,12 +270,12 @@ bool Body::bodyUsed() { - return body() && body()->isDisturbed(); + return bodyBuffer() && bodyBuffer()->isStreamDisturbed(); } bool Body::isBodyLocked() { - return body() && body()->isLocked(); + return bodyBuffer() && bodyBuffer()->isStreamLocked(); } bool Body::hasPendingActivity() const
diff --git a/third_party/WebKit/Source/modules/fetch/BodyStreamBuffer.cpp b/third_party/WebKit/Source/modules/fetch/BodyStreamBuffer.cpp index 7e21179..0880c42 100644 --- a/third_party/WebKit/Source/modules/fetch/BodyStreamBuffer.cpp +++ b/third_party/WebKit/Source/modules/fetch/BodyStreamBuffer.cpp
@@ -84,9 +84,9 @@ PassRefPtr<BlobDataHandle> BodyStreamBuffer::drainAsBlobDataHandle(FetchDataConsumerHandle::Reader::BlobSizePolicy policy) { - ASSERT(!stream()->isLocked()); + ASSERT(!isStreamLocked()); m_stream->setIsDisturbed(); - if (ReadableStream::Closed == m_stream->stateInternal() || ReadableStream::Errored == m_stream->stateInternal()) + if (isStreamClosed() || isStreamErrored()) return nullptr; RefPtr<BlobDataHandle> blobDataHandle = m_reader->drainAsBlobDataHandle(policy); @@ -99,9 +99,9 @@ PassRefPtr<EncodedFormData> BodyStreamBuffer::drainAsFormData() { - ASSERT(!stream()->isLocked()); + ASSERT(!isStreamLocked()); m_stream->setIsDisturbed(); - if (ReadableStream::Closed == m_stream->stateInternal() || ReadableStream::Errored == m_stream->stateInternal()) + if (isStreamClosed() || isStreamErrored()) return nullptr; RefPtr<EncodedFormData> formData = m_reader->drainAsFormData(); @@ -114,15 +114,15 @@ PassOwnPtr<FetchDataConsumerHandle> BodyStreamBuffer::releaseHandle(ExecutionContext* executionContext) { - ASSERT(!stream()->isLocked()); + ASSERT(!isStreamLocked()); m_reader = nullptr; m_stream->setIsDisturbed(); TrackExceptionState exceptionState; m_stream->getBytesReader(executionContext, exceptionState); - if (ReadableStream::Closed == m_stream->stateInternal()) + if (isStreamClosed()) return createFetchDataConsumerHandleFromWebHandle(createDoneDataConsumerHandle()); - if (ReadableStream::Errored == m_stream->stateInternal()) + if (isStreamErrored()) return createFetchDataConsumerHandleFromWebHandle(createUnexpectedErrorDataConsumerHandle()); ASSERT(m_handle); @@ -141,7 +141,7 @@ bool BodyStreamBuffer::hasPendingActivity() const { - return m_loader || (m_stream->isLocked() && m_stream->stateInternal() == ReadableStream::Readable); + return m_loader || (isStreamLocked() && isStreamReadable()); } void BodyStreamBuffer::stop() @@ -190,6 +190,31 @@ processData(); } +bool BodyStreamBuffer::isStreamReadable() const +{ + return m_stream->stateInternal() == ReadableStream::Readable; +} + +bool BodyStreamBuffer::isStreamClosed() const +{ + return m_stream->stateInternal() == ReadableStream::Closed; +} + +bool BodyStreamBuffer::isStreamErrored() const +{ + return m_stream->stateInternal() == ReadableStream::Errored; +} + +bool BodyStreamBuffer::isStreamLocked() const +{ + return m_stream->isLocked(); +} + +bool BodyStreamBuffer::isStreamDisturbed() const +{ + return m_stream->isDisturbed(); +} + void BodyStreamBuffer::close() { m_reader = nullptr;
diff --git a/third_party/WebKit/Source/modules/fetch/BodyStreamBuffer.h b/third_party/WebKit/Source/modules/fetch/BodyStreamBuffer.h index 197f882e..eb8e1b4 100644 --- a/third_party/WebKit/Source/modules/fetch/BodyStreamBuffer.h +++ b/third_party/WebKit/Source/modules/fetch/BodyStreamBuffer.h
@@ -55,6 +55,12 @@ // WebDataConsumerHandle::Client void didGetReadable() override; + bool isStreamReadable() const; + bool isStreamClosed() const; + bool isStreamErrored() const; + bool isStreamLocked() const; + bool isStreamDisturbed() const; + DEFINE_INLINE_TRACE() { visitor->trace(m_stream);
diff --git a/third_party/WebKit/Source/modules/fetch/BodyStreamBufferTest.cpp b/third_party/WebKit/Source/modules/fetch/BodyStreamBufferTest.cpp index ffe1121..5156c3d 100644 --- a/third_party/WebKit/Source/modules/fetch/BodyStreamBufferTest.cpp +++ b/third_party/WebKit/Source/modules/fetch/BodyStreamBufferTest.cpp
@@ -45,16 +45,16 @@ BodyStreamBuffer* buffer = new BodyStreamBuffer(handle.release()); EXPECT_FALSE(buffer->hasPendingActivity()); - EXPECT_FALSE(buffer->stream()->isLocked()); - EXPECT_FALSE(buffer->stream()->isDisturbed()); - EXPECT_EQ(ReadableStream::Readable, buffer->stream()->stateInternal()); + EXPECT_FALSE(buffer->isStreamLocked()); + EXPECT_FALSE(buffer->isStreamDisturbed()); + EXPECT_TRUE(buffer->isStreamReadable()); OwnPtr<FetchDataConsumerHandle> handle2 = buffer->releaseHandle(getExecutionContext()); ASSERT_EQ(rawHandle, handle2.get()); - EXPECT_TRUE(buffer->stream()->isLocked()); - EXPECT_TRUE(buffer->stream()->isDisturbed()); - EXPECT_EQ(ReadableStream::Closed, buffer->stream()->stateInternal()); + EXPECT_TRUE(buffer->isStreamLocked()); + EXPECT_TRUE(buffer->isStreamDisturbed()); + EXPECT_TRUE(buffer->isStreamClosed()); } TEST_F(BodyStreamBufferTest, LoadBodyStreamBufferAsArrayBuffer) @@ -74,16 +74,16 @@ BodyStreamBuffer* buffer = new BodyStreamBuffer(createFetchDataConsumerHandleFromWebHandle(handle.release())); buffer->startLoading(getExecutionContext(), FetchDataLoader::createLoaderAsArrayBuffer(), client); - EXPECT_TRUE(buffer->stream()->isLocked()); - EXPECT_TRUE(buffer->stream()->isDisturbed()); + EXPECT_TRUE(buffer->isStreamLocked()); + EXPECT_TRUE(buffer->isStreamDisturbed()); EXPECT_TRUE(buffer->hasPendingActivity()); checkpoint.Call(1); testing::runPendingTasks(); checkpoint.Call(2); - EXPECT_TRUE(buffer->stream()->isLocked()); - EXPECT_TRUE(buffer->stream()->isDisturbed()); + EXPECT_TRUE(buffer->isStreamLocked()); + EXPECT_TRUE(buffer->isStreamDisturbed()); EXPECT_FALSE(buffer->hasPendingActivity()); ASSERT_TRUE(arrayBuffer); EXPECT_EQ("hello", String(static_cast<const char*>(arrayBuffer->data()), arrayBuffer->byteLength())); @@ -106,16 +106,16 @@ BodyStreamBuffer* buffer = new BodyStreamBuffer(createFetchDataConsumerHandleFromWebHandle(handle.release())); buffer->startLoading(getExecutionContext(), FetchDataLoader::createLoaderAsBlobHandle("text/plain"), client); - EXPECT_TRUE(buffer->stream()->isLocked()); - EXPECT_TRUE(buffer->stream()->isDisturbed()); + EXPECT_TRUE(buffer->isStreamLocked()); + EXPECT_TRUE(buffer->isStreamDisturbed()); EXPECT_TRUE(buffer->hasPendingActivity()); checkpoint.Call(1); testing::runPendingTasks(); checkpoint.Call(2); - EXPECT_TRUE(buffer->stream()->isLocked()); - EXPECT_TRUE(buffer->stream()->isDisturbed()); + EXPECT_TRUE(buffer->isStreamLocked()); + EXPECT_TRUE(buffer->isStreamDisturbed()); EXPECT_FALSE(buffer->hasPendingActivity()); EXPECT_EQ(5u, blobDataHandle->size()); } @@ -136,16 +136,16 @@ BodyStreamBuffer* buffer = new BodyStreamBuffer(createFetchDataConsumerHandleFromWebHandle(handle.release())); buffer->startLoading(getExecutionContext(), FetchDataLoader::createLoaderAsString(), client); - EXPECT_TRUE(buffer->stream()->isLocked()); - EXPECT_TRUE(buffer->stream()->isDisturbed()); + EXPECT_TRUE(buffer->isStreamLocked()); + EXPECT_TRUE(buffer->isStreamDisturbed()); EXPECT_TRUE(buffer->hasPendingActivity()); checkpoint.Call(1); testing::runPendingTasks(); checkpoint.Call(2); - EXPECT_TRUE(buffer->stream()->isLocked()); - EXPECT_TRUE(buffer->stream()->isDisturbed()); + EXPECT_TRUE(buffer->isStreamLocked()); + EXPECT_TRUE(buffer->isStreamDisturbed()); EXPECT_FALSE(buffer->hasPendingActivity()); } @@ -153,18 +153,18 @@ { BodyStreamBuffer* buffer = new BodyStreamBuffer(createFetchDataConsumerHandleFromWebHandle(createDoneDataConsumerHandle())); - EXPECT_EQ(ReadableStream::Readable, buffer->stream()->stateInternal()); + EXPECT_TRUE(buffer->isStreamReadable()); testing::runPendingTasks(); - EXPECT_EQ(ReadableStream::Closed, buffer->stream()->stateInternal()); + EXPECT_TRUE(buffer->isStreamClosed()); - EXPECT_FALSE(buffer->stream()->isLocked()); - EXPECT_FALSE(buffer->stream()->isDisturbed()); + EXPECT_FALSE(buffer->isStreamLocked()); + EXPECT_FALSE(buffer->isStreamDisturbed()); EXPECT_FALSE(buffer->hasPendingActivity()); OwnPtr<FetchDataConsumerHandle> handle = buffer->releaseHandle(getExecutionContext()); EXPECT_TRUE(handle); - EXPECT_TRUE(buffer->stream()->isLocked()); - EXPECT_TRUE(buffer->stream()->isDisturbed()); + EXPECT_TRUE(buffer->isStreamLocked()); + EXPECT_TRUE(buffer->isStreamDisturbed()); EXPECT_FALSE(buffer->hasPendingActivity()); } @@ -180,25 +180,25 @@ BodyStreamBuffer* buffer = new BodyStreamBuffer(createFetchDataConsumerHandleFromWebHandle(createDoneDataConsumerHandle())); - EXPECT_EQ(ReadableStream::Readable, buffer->stream()->stateInternal()); + EXPECT_TRUE(buffer->isStreamReadable()); testing::runPendingTasks(); - EXPECT_EQ(ReadableStream::Closed, buffer->stream()->stateInternal()); + EXPECT_TRUE(buffer->isStreamClosed()); - EXPECT_FALSE(buffer->stream()->isLocked()); - EXPECT_FALSE(buffer->stream()->isDisturbed()); + EXPECT_FALSE(buffer->isStreamLocked()); + EXPECT_FALSE(buffer->isStreamDisturbed()); EXPECT_FALSE(buffer->hasPendingActivity()); buffer->startLoading(getExecutionContext(), FetchDataLoader::createLoaderAsString(), client); - EXPECT_TRUE(buffer->stream()->isLocked()); - EXPECT_TRUE(buffer->stream()->isDisturbed()); + EXPECT_TRUE(buffer->isStreamLocked()); + EXPECT_TRUE(buffer->isStreamDisturbed()); EXPECT_TRUE(buffer->hasPendingActivity()); checkpoint.Call(1); testing::runPendingTasks(); checkpoint.Call(2); - EXPECT_TRUE(buffer->stream()->isLocked()); - EXPECT_TRUE(buffer->stream()->isDisturbed()); + EXPECT_TRUE(buffer->isStreamLocked()); + EXPECT_TRUE(buffer->isStreamDisturbed()); EXPECT_FALSE(buffer->hasPendingActivity()); } @@ -206,17 +206,17 @@ { BodyStreamBuffer* buffer = new BodyStreamBuffer(createFetchDataConsumerHandleFromWebHandle(createUnexpectedErrorDataConsumerHandle())); - EXPECT_EQ(ReadableStream::Readable, buffer->stream()->stateInternal()); + EXPECT_TRUE(buffer->isStreamReadable()); testing::runPendingTasks(); - EXPECT_EQ(ReadableStream::Errored, buffer->stream()->stateInternal()); + EXPECT_TRUE(buffer->isStreamErrored()); - EXPECT_FALSE(buffer->stream()->isLocked()); - EXPECT_FALSE(buffer->stream()->isDisturbed()); + EXPECT_FALSE(buffer->isStreamLocked()); + EXPECT_FALSE(buffer->isStreamDisturbed()); EXPECT_FALSE(buffer->hasPendingActivity()); OwnPtr<FetchDataConsumerHandle> handle = buffer->releaseHandle(getExecutionContext()); EXPECT_TRUE(handle); - EXPECT_TRUE(buffer->stream()->isLocked()); - EXPECT_TRUE(buffer->stream()->isDisturbed()); + EXPECT_TRUE(buffer->isStreamLocked()); + EXPECT_TRUE(buffer->isStreamDisturbed()); EXPECT_FALSE(buffer->hasPendingActivity()); } @@ -232,24 +232,24 @@ BodyStreamBuffer* buffer = new BodyStreamBuffer(createFetchDataConsumerHandleFromWebHandle(createUnexpectedErrorDataConsumerHandle())); - EXPECT_EQ(ReadableStream::Readable, buffer->stream()->stateInternal()); + EXPECT_TRUE(buffer->isStreamReadable()); testing::runPendingTasks(); - EXPECT_EQ(ReadableStream::Errored, buffer->stream()->stateInternal()); + EXPECT_TRUE(buffer->isStreamErrored()); - EXPECT_FALSE(buffer->stream()->isLocked()); - EXPECT_FALSE(buffer->stream()->isDisturbed()); + EXPECT_FALSE(buffer->isStreamLocked()); + EXPECT_FALSE(buffer->isStreamDisturbed()); EXPECT_FALSE(buffer->hasPendingActivity()); buffer->startLoading(getExecutionContext(), FetchDataLoader::createLoaderAsString(), client); - EXPECT_TRUE(buffer->stream()->isLocked()); - EXPECT_TRUE(buffer->stream()->isDisturbed()); + EXPECT_TRUE(buffer->isStreamLocked()); + EXPECT_TRUE(buffer->isStreamDisturbed()); EXPECT_TRUE(buffer->hasPendingActivity()); checkpoint.Call(1); testing::runPendingTasks(); checkpoint.Call(2); - EXPECT_TRUE(buffer->stream()->isLocked()); - EXPECT_TRUE(buffer->stream()->isDisturbed()); + EXPECT_TRUE(buffer->isStreamLocked()); + EXPECT_TRUE(buffer->isStreamDisturbed()); EXPECT_FALSE(buffer->hasPendingActivity()); }
diff --git a/third_party/WebKit/Source/modules/fetch/Response.cpp b/third_party/WebKit/Source/modules/fetch/Response.cpp index 2b060f8..930084fe 100644 --- a/third_party/WebKit/Source/modules/fetch/Response.cpp +++ b/third_party/WebKit/Source/modules/fetch/Response.cpp
@@ -408,7 +408,7 @@ bool Response::bodyUsed() { - return internalBodyBuffer() && internalBodyBuffer()->stream()->isDisturbed(); + return internalBodyBuffer() && internalBodyBuffer()->isStreamDisturbed(); } String Response::mimeType() const
diff --git a/third_party/WebKit/Source/modules/mediasource/SourceBuffer.cpp b/third_party/WebKit/Source/modules/mediasource/SourceBuffer.cpp index bbb8739..5466c5a 100644 --- a/third_party/WebKit/Source/modules/mediasource/SourceBuffer.cpp +++ b/third_party/WebKit/Source/modules/mediasource/SourceBuffer.cpp
@@ -502,7 +502,7 @@ return trackList.getTrackById(id); } -std::vector<WebMediaPlayer::TrackId> SourceBuffer::initializationSegmentReceived(const std::vector<MediaTrackInfo>& newTracks) +WebVector<WebMediaPlayer::TrackId> SourceBuffer::initializationSegmentReceived(const WebVector<MediaTrackInfo>& newTracks) { WTF_LOG(Media, "SourceBuffer::initializationSegmentReceived %p tracks=%zu", this, newTracks.size()); ASSERT(m_source); @@ -511,54 +511,49 @@ // TODO(servolk): Implement proper 'initialization segment received' algorithm according to MSE spec: // https://w3c.github.io/media-source/#sourcebuffer-init-segment-received - std::vector<WebMediaPlayer::TrackId> result; + WebVector<WebMediaPlayer::TrackId> result(newTracks.size()); + unsigned resultIdx = 0; for (const auto& trackInfo : newTracks) { - const auto& trackType = std::get<0>(trackInfo); - const auto& id = std::get<1>(trackInfo); - const auto& kind = std::get<2>(trackInfo); - const auto& label = std::get<3>(trackInfo); - const auto& language = std::get<4>(trackInfo); - if (!RuntimeEnabledFeatures::audioVideoTracksEnabled()) { static WebMediaPlayer::TrackId nextTrackId = 0; - result.push_back(++nextTrackId); + result[resultIdx++] = ++nextTrackId; continue; } const TrackBase* trackBase = nullptr; - if (trackType == WebMediaPlayer::AudioTrack) { + if (trackInfo.trackType == WebMediaPlayer::AudioTrack) { AudioTrack* audioTrack = nullptr; if (!m_firstInitializationSegmentReceived) { - audioTrack = AudioTrack::create(id, kind, label, language, false); + audioTrack = AudioTrack::create(trackInfo.byteStreamTrackId, trackInfo.kind, trackInfo.label, trackInfo.language, false); SourceBufferTrackBaseSupplement::setSourceBuffer(*audioTrack, this); audioTracks().add(audioTrack); m_source->mediaElement()->audioTracks().add(audioTrack); } else { - audioTrack = findExistingTrackById(audioTracks(), id); + audioTrack = findExistingTrackById(audioTracks(), trackInfo.byteStreamTrackId); ASSERT(audioTrack); } trackBase = audioTrack; - result.push_back(audioTrack->trackId()); - } else if (trackType == WebMediaPlayer::VideoTrack) { + result[resultIdx++] = audioTrack->trackId(); + } else if (trackInfo.trackType == WebMediaPlayer::VideoTrack) { VideoTrack* videoTrack = nullptr; if (!m_firstInitializationSegmentReceived) { - videoTrack = VideoTrack::create(id, kind, label, language, false); + videoTrack = VideoTrack::create(trackInfo.byteStreamTrackId, trackInfo.kind, trackInfo.label, trackInfo.language, false); SourceBufferTrackBaseSupplement::setSourceBuffer(*videoTrack, this); videoTracks().add(videoTrack); m_source->mediaElement()->videoTracks().add(videoTrack); } else { - videoTrack = findExistingTrackById(videoTracks(), id); + videoTrack = findExistingTrackById(videoTracks(), trackInfo.byteStreamTrackId); ASSERT(videoTrack); } trackBase = videoTrack; - result.push_back(videoTrack->trackId()); + result[resultIdx++] = videoTrack->trackId(); } else { NOTREACHED(); } (void)trackBase; #if !LOG_DISABLED const char* logActionStr = m_firstInitializationSegmentReceived ? "using existing" : "added"; - const char* logTrackTypeStr = (trackType == WebMediaPlayer::AudioTrack) ? "audio" : "video"; + const char* logTrackTypeStr = (trackInfo.trackType == WebMediaPlayer::AudioTrack) ? "audio" : "video"; WTF_LOG(Media, "Tracks (sb=%p): %s %sTrack %p trackId=%d id=%s label=%s lang=%s", this, logActionStr, logTrackTypeStr, trackBase, trackBase->trackId(), trackBase->id().utf8().data(), trackBase->label().utf8().data(), trackBase->language().utf8().data()); #endif }
diff --git a/third_party/WebKit/Source/modules/mediasource/SourceBuffer.h b/third_party/WebKit/Source/modules/mediasource/SourceBuffer.h index c373bfc..07404b03 100644 --- a/third_party/WebKit/Source/modules/mediasource/SourceBuffer.h +++ b/third_party/WebKit/Source/modules/mediasource/SourceBuffer.h
@@ -110,7 +110,7 @@ const AtomicString& interfaceName() const override; // WebSourceBufferClient interface - std::vector<WebMediaPlayer::TrackId> initializationSegmentReceived(const std::vector<MediaTrackInfo>&) override; + WebVector<WebMediaPlayer::TrackId> initializationSegmentReceived(const WebVector<MediaTrackInfo>&) override; DECLARE_VIRTUAL_TRACE();
diff --git a/third_party/WebKit/Source/modules/mediastream/MediaStreamTrack.idl b/third_party/WebKit/Source/modules/mediastream/MediaStreamTrack.idl index fe2c68a..e313580 100644 --- a/third_party/WebKit/Source/modules/mediastream/MediaStreamTrack.idl +++ b/third_party/WebKit/Source/modules/mediastream/MediaStreamTrack.idl
@@ -31,7 +31,7 @@ readonly attribute DOMString label; attribute boolean enabled; readonly attribute boolean muted; - readonly attribute boolean remote; + [MeasureAs=MediaStreamTrackRemote] readonly attribute boolean remote; readonly attribute DOMString readyState; [CallWith=ExecutionContext, RaisesException, DeprecateAs=MediaStreamTrackGetSources] static void getSources(MediaStreamTrackSourcesCallback callback);
diff --git a/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp b/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp index 5a7ac66..fbc8b051 100644 --- a/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp +++ b/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp
@@ -672,6 +672,22 @@ return promise; } + // Check if |keygenAlgorithm| contains the optional DOMTimeStamp |expires| attribute. + Nullable<DOMTimeStamp> expires; + if (keygenAlgorithm.isDictionary()) { + Dictionary keygenAlgorithmDict = keygenAlgorithm.getAsDictionary(); + if (keygenAlgorithmDict.hasProperty("expires")) { + v8::Local<v8::Value> expiresValue; + keygenAlgorithmDict.get("expires", expiresValue); + if (expiresValue->IsNumber()) { + double expiresDouble = expiresValue->ToNumber(scriptState->isolate()->GetCurrentContext()).ToLocalChecked()->Value(); + if (expiresDouble >= 0) { + expires.set(static_cast<DOMTimeStamp>(expiresDouble)); + } + } + } + } + // Convert from WebCrypto representation to recognized WebRTCKeyParams. WebRTC supports a small subset of what are valid AlgorithmIdentifiers. const char* unsupportedParamsString = "The 1st argument provided is an AlgorithmIdentifier with a supported algorithm name, but the parameters are not supported."; Nullable<WebRTCKeyParams> keyParams; @@ -718,11 +734,20 @@ // Generate certificate. The |certificateObserver| will resolve the promise asynchronously upon completion. // The observer will manage its own destruction as well as the resolver's destruction. - certificateGenerator->generateCertificate( - keyParams.get(), - toDocument(scriptState->getExecutionContext())->url(), - toDocument(scriptState->getExecutionContext())->firstPartyForCookies(), - std::move(certificateObserver)); + if (expires.isNull()) { + certificateGenerator->generateCertificate( + keyParams.get(), + toDocument(scriptState->getExecutionContext())->url(), + toDocument(scriptState->getExecutionContext())->firstPartyForCookies(), + std::move(certificateObserver)); + } else { + certificateGenerator->generateCertificateWithExpiration( + keyParams.get(), + toDocument(scriptState->getExecutionContext())->url(), + toDocument(scriptState->getExecutionContext())->firstPartyForCookies(), + expires.get(), + std::move(certificateObserver)); + } return promise; }
diff --git a/third_party/WebKit/Source/modules/modules.gypi b/third_party/WebKit/Source/modules/modules.gypi index 77879ff..c761fbf 100644 --- a/third_party/WebKit/Source/modules/modules.gypi +++ b/third_party/WebKit/Source/modules/modules.gypi
@@ -1324,9 +1324,13 @@ 'notifications/NotificationData.h', 'notifications/NotificationEvent.cpp', 'notifications/NotificationEvent.h', + 'notifications/NotificationImageLoader.cpp', + 'notifications/NotificationImageLoader.h', 'notifications/NotificationPermissionCallback.h', 'notifications/NotificationPermissionClient.cpp', 'notifications/NotificationPermissionClient.h', + 'notifications/NotificationResourcesLoader.cpp', + 'notifications/NotificationResourcesLoader.h', 'notifications/ServiceWorkerGlobalScopeNotifications.h', 'notifications/ServiceWorkerRegistrationNotifications.cpp', 'notifications/ServiceWorkerRegistrationNotifications.h', @@ -1991,6 +1995,7 @@ 'mediastream/MediaConstraintsTest.cpp', 'mediastream/RTCDataChannelTest.cpp', 'notifications/NotificationDataTest.cpp', + 'notifications/NotificationResourcesLoaderTest.cpp', 'payments/PaymentDetailsTestHelper.cpp', 'payments/PaymentRequestTest.cpp', 'payments/PaymentRequestDetailsTest.cpp',
diff --git a/third_party/WebKit/Source/modules/notifications/Notification.cpp b/third_party/WebKit/Source/modules/notifications/Notification.cpp index 571912de..a874cbe 100644 --- a/third_party/WebKit/Source/modules/notifications/Notification.cpp +++ b/third_party/WebKit/Source/modules/notifications/Notification.cpp
@@ -43,13 +43,16 @@ #include "modules/notifications/NotificationData.h" #include "modules/notifications/NotificationOptions.h" #include "modules/notifications/NotificationPermissionClient.h" +#include "modules/notifications/NotificationResourcesLoader.h" #include "platform/RuntimeEnabledFeatures.h" #include "platform/UserGestureIndicator.h" #include "public/platform/Platform.h" #include "public/platform/WebSecurityOrigin.h" #include "public/platform/WebString.h" #include "public/platform/modules/notifications/WebNotificationAction.h" +#include "public/platform/modules/notifications/WebNotificationConstants.h" #include "public/platform/modules/notifications/WebNotificationManager.h" +#include "wtf/Functional.h" namespace blink { namespace { @@ -99,7 +102,7 @@ return nullptr; Notification* notification = new Notification(context, data); - notification->scheduleShow(); + notification->schedulePrepareShow(); notification->suspendIfNeeded(); return notification; @@ -121,7 +124,7 @@ , m_data(data) , m_persistentId(kInvalidPersistentId) , m_state(NotificationStateIdle) - , m_asyncRunner(AsyncMethodRunner<Notification>::create(this, &Notification::show)) + , m_prepareShowMethodRunner(AsyncMethodRunner<Notification>::create(this, &Notification::prepareShow)) { ASSERT(notificationManager()); } @@ -130,26 +133,35 @@ { } -void Notification::scheduleShow() +void Notification::schedulePrepareShow() { ASSERT(m_state == NotificationStateIdle); - ASSERT(!m_asyncRunner->isActive()); + ASSERT(!m_prepareShowMethodRunner->isActive()); - m_asyncRunner->runAsync(); + m_prepareShowMethodRunner->runAsync(); } -void Notification::show() +void Notification::prepareShow() { ASSERT(m_state == NotificationStateIdle); - if (Notification::checkPermission(getExecutionContext()) != WebNotificationPermissionAllowed) { + if (Notification::checkPermission(getExecutionContext()) != mojom::PermissionStatus::GRANTED) { dispatchErrorEvent(); return; } + m_loader = new NotificationResourcesLoader(bind<NotificationResourcesLoader*>(&Notification::didLoadResources, WeakPersistentThisPointer<Notification>(this))); + m_loader->start(getExecutionContext(), m_data); +} + +void Notification::didLoadResources(NotificationResourcesLoader* loader) +{ + DCHECK_EQ(loader, m_loader.get()); + SecurityOrigin* origin = getExecutionContext()->getSecurityOrigin(); ASSERT(origin); - notificationManager()->show(WebSecurityOrigin(origin), m_data, this); + notificationManager()->show(WebSecurityOrigin(origin), m_data, loader->getResources(), this); + m_loader.clear(); m_state = NotificationStateShowing; } @@ -321,14 +333,14 @@ return actions; } -String Notification::permissionString(WebNotificationPermission permission) +String Notification::permissionString(mojom::PermissionStatus permission) { switch (permission) { - case WebNotificationPermissionAllowed: + case mojom::PermissionStatus::GRANTED: return "granted"; - case WebNotificationPermissionDenied: + case mojom::PermissionStatus::DENIED: return "denied"; - case WebNotificationPermissionDefault: + case mojom::PermissionStatus::ASK: return "default"; } @@ -341,7 +353,7 @@ return permissionString(checkPermission(context)); } -WebNotificationPermission Notification::checkPermission(ExecutionContext* context) +mojom::PermissionStatus Notification::checkPermission(ExecutionContext* context) { SecurityOrigin* origin = context->getSecurityOrigin(); ASSERT(origin); @@ -362,11 +374,7 @@ size_t Notification::maxActions() { - // Returns a fixed number for unit tests, which run without the availability of the Platform object. - if (!notificationManager()) - return 2; - - return notificationManager()->maxActions(); + return kWebNotificationMaxActions; } DispatchEventResult Notification::dispatchEventInternal(Event* event) @@ -386,17 +394,21 @@ m_state = NotificationStateClosed; - m_asyncRunner->stop(); + m_prepareShowMethodRunner->stop(); + + if (m_loader) + m_loader->stop(); } bool Notification::hasPendingActivity() const { - return m_state == NotificationStateShowing || m_asyncRunner->isActive(); + return m_state == NotificationStateShowing || m_prepareShowMethodRunner->isActive() || m_loader; } DEFINE_TRACE(Notification) { - visitor->trace(m_asyncRunner); + visitor->trace(m_prepareShowMethodRunner); + visitor->trace(m_loader); EventTargetWithInlineData::trace(visitor); ActiveDOMObject::trace(visitor); }
diff --git a/third_party/WebKit/Source/modules/notifications/Notification.h b/third_party/WebKit/Source/modules/notifications/Notification.h index 771751f..cf5c627 100644 --- a/third_party/WebKit/Source/modules/notifications/Notification.h +++ b/third_party/WebKit/Source/modules/notifications/Notification.h
@@ -46,7 +46,7 @@ #include "public/platform/WebVector.h" #include "public/platform/modules/notifications/WebNotificationData.h" #include "public/platform/modules/notifications/WebNotificationDelegate.h" -#include "public/platform/modules/notifications/WebNotificationPermission.h" +#include "public/platform/modules/permissions/permission_status.mojom.h" namespace blink { @@ -54,6 +54,7 @@ class NotificationAction; class NotificationOptions; class NotificationPermissionCallback; +class NotificationResourcesLoader; class ScriptState; class MODULES_EXPORT Notification final : public EventTargetWithInlineData, public ActiveScriptWrappable, public ActiveDOMObject, public WebNotificationDelegate { @@ -98,9 +99,9 @@ ScriptValue data(ScriptState*); HeapVector<NotificationAction> actions() const; - static String permissionString(WebNotificationPermission); + static String permissionString(mojom::PermissionStatus); static String permission(ExecutionContext*); - static WebNotificationPermission checkPermission(ExecutionContext*); + static mojom::PermissionStatus checkPermission(ExecutionContext*); static ScriptPromise requestPermission(ScriptState*, NotificationPermissionCallback*); static size_t maxActions(); @@ -124,14 +125,17 @@ private: Notification(ExecutionContext*, const WebNotificationData&); - void scheduleShow(); + // Schedules an asynchronous call to |prepareShow|, allowing the constructor + // to return so that events can be fired on the notification object. + void schedulePrepareShow(); - // Calling show() may start asynchronous operation. If this object has - // a V8 wrapper, hasPendingActivity() prevents the wrapper from being - // collected while m_state is Showing, and so this instance stays alive - // until the operation completes. Otherwise, you need to hold a ref on this - // instance until the operation completes. - void show(); + // Checks permission and loads any necessary resources (this may be async) + // before showing the notification. + void prepareShow(); + + // Shows the notification, using the resources loaded by the + // NotificationResourcesLoader. + void didLoadResources(NotificationResourcesLoader*); void setPersistentId(int64_t persistentId) { m_persistentId = persistentId; } @@ -158,7 +162,9 @@ NotificationState m_state; - Member<AsyncMethodRunner<Notification>> m_asyncRunner; + Member<AsyncMethodRunner<Notification>> m_prepareShowMethodRunner; + + Member<NotificationResourcesLoader> m_loader; }; } // namespace blink
diff --git a/third_party/WebKit/Source/modules/notifications/NotificationAction.idl b/third_party/WebKit/Source/modules/notifications/NotificationAction.idl index 5de51f9..4f0ec6c 100644 --- a/third_party/WebKit/Source/modules/notifications/NotificationAction.idl +++ b/third_party/WebKit/Source/modules/notifications/NotificationAction.idl
@@ -13,6 +13,6 @@ [RuntimeEnabled=NotificationInlineReplies] NotificationActionType type = "button"; required DOMString action; required DOMString title; - [RuntimeEnabled=NotificationActionIcons] USVString icon; + USVString icon; [RuntimeEnabled=NotificationInlineReplies] DOMString? placeholder = null; };
diff --git a/third_party/WebKit/Source/modules/notifications/NotificationImageLoader.cpp b/third_party/WebKit/Source/modules/notifications/NotificationImageLoader.cpp new file mode 100644 index 0000000..dbd0919 --- /dev/null +++ b/third_party/WebKit/Source/modules/notifications/NotificationImageLoader.cpp
@@ -0,0 +1,120 @@ +// 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 "modules/notifications/NotificationImageLoader.h" + +#include "core/dom/ExecutionContext.h" +#include "core/fetch/ResourceLoaderOptions.h" +#include "platform/image-decoders/ImageDecoder.h" +#include "platform/image-decoders/ImageFrame.h" +#include "platform/network/ResourceError.h" +#include "platform/network/ResourceLoadPriority.h" +#include "platform/network/ResourceRequest.h" +#include "platform/weborigin/KURL.h" +#include "public/platform/WebURLRequest.h" +#include "third_party/skia/include/core/SkBitmap.h" + +namespace blink { + +NotificationImageLoader::NotificationImageLoader() + : m_stopped(false) +{ +} + +NotificationImageLoader::~NotificationImageLoader() +{ +} + +void NotificationImageLoader::start(ExecutionContext* executionContext, const KURL& url, PassOwnPtr<ImageCallback> imageCallback) +{ + DCHECK(!m_stopped); + + m_imageCallback = imageCallback; + + // TODO(mvanouwerkerk): Add a timeout mechanism: crbug.com/579137. + ThreadableLoaderOptions threadableLoaderOptions; + threadableLoaderOptions.preflightPolicy = PreventPreflight; + threadableLoaderOptions.crossOriginRequestPolicy = AllowCrossOriginRequests; + + // TODO(mvanouwerkerk): Add an entry for notifications to FetchInitiatorTypeNames and use it. + ResourceLoaderOptions resourceLoaderOptions; + resourceLoaderOptions.allowCredentials = AllowStoredCredentials; + if (executionContext->isWorkerGlobalScope()) + resourceLoaderOptions.requestInitiatorContext = WorkerContext; + + ResourceRequest resourceRequest(url); + resourceRequest.setRequestContext(WebURLRequest::RequestContextImage); + resourceRequest.setPriority(ResourceLoadPriorityMedium); + resourceRequest.setRequestorOrigin(executionContext->getSecurityOrigin()); + + m_threadableLoader = ThreadableLoader::create(*executionContext, this, threadableLoaderOptions, resourceLoaderOptions); + m_threadableLoader->start(resourceRequest); +} + +void NotificationImageLoader::stop() +{ + if (m_stopped) + return; + + m_stopped = true; + if (m_threadableLoader) { + m_threadableLoader->cancel(); + // WorkerThreadableLoader keeps a Persistent<WorkerGlobalScope> to the + // ExecutionContext it received in |create|. Kill it to prevent + // reference cycles involving a mix of GC and non-GC types that fail to + // clear in ThreadState::cleanup. + m_threadableLoader.clear(); + } +} + +void NotificationImageLoader::didReceiveData(const char* data, unsigned length) +{ + if (!m_data) + m_data = SharedBuffer::create(); + m_data->append(data, length); +} + +void NotificationImageLoader::didFinishLoading(unsigned long resourceIdentifier, double finishTime) +{ + // If this has been stopped it is not desirable to trigger further work, + // there is a shutdown of some sort in progress. + if (m_stopped) + return; + + if (m_data) { + OwnPtr<ImageDecoder> decoder = ImageDecoder::create(*m_data.get(), ImageDecoder::AlphaPremultiplied, ImageDecoder::GammaAndColorProfileApplied); + if (decoder) { + decoder->setData(m_data.get(), true /* allDataReceived */); + // The |ImageFrame*| is owned by the decoder. + ImageFrame* imageFrame = decoder->frameBufferAtIndex(0); + if (imageFrame) { + (*m_imageCallback)(imageFrame->bitmap()); + return; + } + } + } + runCallbackWithEmptyBitmap(); +} + +void NotificationImageLoader::didFail(const ResourceError& error) +{ + runCallbackWithEmptyBitmap(); +} + +void NotificationImageLoader::didFailRedirectCheck() +{ + runCallbackWithEmptyBitmap(); +} + +void NotificationImageLoader::runCallbackWithEmptyBitmap() +{ + // If this has been stopped it is not desirable to trigger further work, + // there is a shutdown of some sort in progress. + if (m_stopped) + return; + + (*m_imageCallback)(SkBitmap()); +} + +} // namespace blink
diff --git a/third_party/WebKit/Source/modules/notifications/NotificationImageLoader.h b/third_party/WebKit/Source/modules/notifications/NotificationImageLoader.h new file mode 100644 index 0000000..5fde3bd --- /dev/null +++ b/third_party/WebKit/Source/modules/notifications/NotificationImageLoader.h
@@ -0,0 +1,63 @@ +// 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 NotificationImageLoader_h +#define NotificationImageLoader_h + +#include "core/loader/ThreadableLoader.h" +#include "core/loader/ThreadableLoaderClient.h" +#include "platform/SharedBuffer.h" +#include "platform/heap/Handle.h" +#include "wtf/Functional.h" +#include "wtf/OwnPtr.h" +#include "wtf/PassOwnPtr.h" +#include "wtf/RefPtr.h" + +class SkBitmap; + +namespace blink { + +class ExecutionContext; +class KURL; +class ResourceError; + +// Asynchronously downloads an image when given a url, decodes the loaded data, +// and passes the bitmap to the given callback. +class NotificationImageLoader final : public GarbageCollectedFinalized<NotificationImageLoader>, public ThreadableLoaderClient { +public: + // The bitmap may be empty if the request failed or the image data could not + // be decoded. + using ImageCallback = Function<void(const SkBitmap&)>; + + NotificationImageLoader(); + ~NotificationImageLoader() override; + + // Asynchronously downloads an image from the given url, decodes the loaded + // data, and passes the bitmap to the callback. + void start(ExecutionContext*, const KURL&, PassOwnPtr<ImageCallback>); + + // Cancels the pending load, if there is one. The |m_imageCallback| will not + // be run. + void stop(); + + // ThreadableLoaderClient interface. + void didReceiveData(const char* data, unsigned length) override; + void didFinishLoading(unsigned long resourceIdentifier, double finishTime) override; + void didFail(const ResourceError&) override; + void didFailRedirectCheck() override; + + DEFINE_INLINE_TRACE() {} + +private: + void runCallbackWithEmptyBitmap(); + + bool m_stopped; + RefPtr<SharedBuffer> m_data; + OwnPtr<ImageCallback> m_imageCallback; + OwnPtr<ThreadableLoader> m_threadableLoader; +}; + +} // namespace blink + +#endif // NotificationImageLoader_h
diff --git a/third_party/WebKit/Source/modules/notifications/NotificationResourcesLoader.cpp b/third_party/WebKit/Source/modules/notifications/NotificationResourcesLoader.cpp new file mode 100644 index 0000000..6e59fd3 --- /dev/null +++ b/third_party/WebKit/Source/modules/notifications/NotificationResourcesLoader.cpp
@@ -0,0 +1,121 @@ +// 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 "modules/notifications/NotificationResourcesLoader.h" + +#include "platform/weborigin/KURL.h" +#include "public/platform/modules/notifications/WebNotificationConstants.h" +#include "public/platform/modules/notifications/WebNotificationData.h" +#include "public/platform/modules/notifications/WebNotificationResources.h" +#include "skia/ext/image_operations.h" +#include "third_party/skia/include/core/SkBitmap.h" + +namespace blink { + +namespace { + +// Scales down |image| to fit within |maxSizePx| if its width or height is +// larger than |maxSizePx| and returns the result. Otherwise does nothing and +// returns |image| unchanged. +// TODO(mvanouwerkerk): Explore doing the scaling on a background thread. +SkBitmap scaleDownIfNeeded(const SkBitmap& image, int maxSizePx) +{ + if (image.width() > maxSizePx || image.height() > maxSizePx) + return skia::ImageOperations::Resize(image, skia::ImageOperations::RESIZE_BEST, std::min(image.width(), maxSizePx), std::min(image.height(), maxSizePx)); + return image; +} + +} // namespace + +NotificationResourcesLoader::NotificationResourcesLoader(PassOwnPtr<CompletionCallback> completionCallback) + : m_started(false), m_completionCallback(completionCallback), m_pendingRequestCount(0) +{ + ThreadState::current()->registerPreFinalizer(this); + DCHECK(m_completionCallback); +} + +NotificationResourcesLoader::~NotificationResourcesLoader() +{ +} + +void NotificationResourcesLoader::start(ExecutionContext* executionContext, const WebNotificationData& notificationData) +{ + DCHECK(!m_started); + m_started = true; + + size_t numActions = notificationData.actions.size(); + m_pendingRequestCount = 2 /* icon and badge */ + numActions; + + loadImage(executionContext, notificationData.icon, bind<const SkBitmap&>(&NotificationResourcesLoader::didLoadIcon, WeakPersistentThisPointer<NotificationResourcesLoader>(this))); + loadImage(executionContext, notificationData.badge, bind<const SkBitmap&>(&NotificationResourcesLoader::didLoadBadge, WeakPersistentThisPointer<NotificationResourcesLoader>(this))); + + m_actionIcons.resize(numActions); + for (size_t i = 0; i < numActions; i++) + loadImage(executionContext, notificationData.actions[i].icon, bind<const SkBitmap&>(&NotificationResourcesLoader::didLoadActionIcon, WeakPersistentThisPointer<NotificationResourcesLoader>(this), i)); +} + +std::unique_ptr<WebNotificationResources> NotificationResourcesLoader::getResources() const +{ + std::unique_ptr<WebNotificationResources> resources(new WebNotificationResources()); + resources->icon = m_icon; + resources->badge = m_badge; + resources->actionIcons = m_actionIcons; + return resources; +} + +void NotificationResourcesLoader::stop() +{ + for (auto imageLoader : m_imageLoaders) + imageLoader->stop(); +} + +DEFINE_TRACE(NotificationResourcesLoader) +{ + visitor->trace(m_imageLoaders); +} + +void NotificationResourcesLoader::loadImage(ExecutionContext* executionContext, const KURL& url, PassOwnPtr<NotificationImageLoader::ImageCallback> imageCallback) +{ + if (url.isNull() || url.isEmpty() || !url.isValid()) { + didFinishRequest(); + return; + } + + NotificationImageLoader* imageLoader = new NotificationImageLoader(); + m_imageLoaders.append(imageLoader); + imageLoader->start(executionContext, url, imageCallback); +} + +void NotificationResourcesLoader::didLoadIcon(const SkBitmap& image) +{ + m_icon = scaleDownIfNeeded(image, kWebNotificationMaxIconSizePx); + didFinishRequest(); +} + +void NotificationResourcesLoader::didLoadBadge(const SkBitmap& image) +{ + m_badge = scaleDownIfNeeded(image, kWebNotificationMaxBadgeSizePx); + didFinishRequest(); +} + +void NotificationResourcesLoader::didLoadActionIcon(size_t actionIndex, const SkBitmap& image) +{ + DCHECK_LT(actionIndex, m_actionIcons.size()); + + m_actionIcons[actionIndex] = scaleDownIfNeeded(image, kWebNotificationMaxActionIconSizePx); + didFinishRequest(); +} + +void NotificationResourcesLoader::didFinishRequest() +{ + DCHECK_GT(m_pendingRequestCount, 0); + m_pendingRequestCount--; + if (!m_pendingRequestCount) { + stop(); + (*m_completionCallback)(this); + // The |this| pointer may have been deleted now. + } +} + +} // namespace blink
diff --git a/third_party/WebKit/Source/modules/notifications/NotificationResourcesLoader.h b/third_party/WebKit/Source/modules/notifications/NotificationResourcesLoader.h new file mode 100644 index 0000000..4e34409 --- /dev/null +++ b/third_party/WebKit/Source/modules/notifications/NotificationResourcesLoader.h
@@ -0,0 +1,78 @@ +// 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 NotificationResourcesLoader_h +#define NotificationResourcesLoader_h + +#include "modules/ModulesExport.h" +#include "modules/notifications/NotificationImageLoader.h" +#include "platform/heap/GarbageCollected.h" +#include "platform/heap/Handle.h" +#include "platform/heap/HeapAllocator.h" +#include "platform/heap/ThreadState.h" +#include "third_party/skia/include/core/SkBitmap.h" +#include "wtf/Functional.h" +#include "wtf/OwnPtr.h" +#include "wtf/PassOwnPtr.h" +#include "wtf/Vector.h" +#include <memory> + +namespace blink { + +class ExecutionContext; +struct WebNotificationData; +struct WebNotificationResources; + +// Fetches the resources specified in a given WebNotificationData. Uses a +// callback to notify the caller when all fetches have finished. +class MODULES_EXPORT NotificationResourcesLoader final : public GarbageCollectedFinalized<NotificationResourcesLoader> { + USING_PRE_FINALIZER(NotificationResourcesLoader, stop); +public: + // Called when all fetches have finished. Passes a pointer to the + // NotificationResourcesLoader so callers that use multiple loaders can use + // the same function to handle the callbacks. + using CompletionCallback = Function<void(NotificationResourcesLoader*)>; + + explicit NotificationResourcesLoader(PassOwnPtr<CompletionCallback>); + ~NotificationResourcesLoader(); + + // Starts fetching the resources specified in the given WebNotificationData. + // If all the urls for the resources are empty or invalid, + // |m_completionCallback| will be run synchronously, otherwise it will be + // run asynchronously when all fetches have finished. Should not be called + // more than once. + void start(ExecutionContext*, const WebNotificationData&); + + // Returns a new WebNotificationResources populated with the resources that + // have been fetched. + std::unique_ptr<WebNotificationResources> getResources() const; + + // Stops every loader in |m_imageLoaders|. This is also used as the + // pre-finalizer. + void stop(); + + DECLARE_VIRTUAL_TRACE(); + +private: + void loadImage(ExecutionContext*, const KURL&, PassOwnPtr<NotificationImageLoader::ImageCallback>); + void didLoadIcon(const SkBitmap& image); + void didLoadBadge(const SkBitmap& image); + void didLoadActionIcon(size_t actionIndex, const SkBitmap& image); + + // Decrements |m_pendingRequestCount| and runs |m_completionCallback| if + // there are no more pending requests. + void didFinishRequest(); + + bool m_started; + OwnPtr<CompletionCallback> m_completionCallback; + int m_pendingRequestCount; + HeapVector<Member<NotificationImageLoader>> m_imageLoaders; + SkBitmap m_icon; + SkBitmap m_badge; + Vector<SkBitmap> m_actionIcons; +}; + +} // namespace blink + +#endif // NotificationResourcesLoader_h
diff --git a/third_party/WebKit/Source/modules/notifications/NotificationResourcesLoaderTest.cpp b/third_party/WebKit/Source/modules/notifications/NotificationResourcesLoaderTest.cpp new file mode 100644 index 0000000..cd82f45d --- /dev/null +++ b/third_party/WebKit/Source/modules/notifications/NotificationResourcesLoaderTest.cpp
@@ -0,0 +1,240 @@ +// 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 "modules/notifications/NotificationResourcesLoader.h" + +#include "core/fetch/MemoryCache.h" +#include "core/testing/DummyPageHolder.h" +#include "platform/heap/Heap.h" +#include "platform/testing/URLTestHelpers.h" +#include "platform/weborigin/KURL.h" +#include "public/platform/Platform.h" +#include "public/platform/WebURL.h" +#include "public/platform/WebURLLoaderMockFactory.h" +#include "public/platform/WebURLResponse.h" +#include "public/platform/modules/notifications/WebNotificationData.h" +#include "public/platform/modules/notifications/WebNotificationResources.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "wtf/Functional.h" +#include "wtf/text/WTFString.h" +#include <memory> + +namespace blink { +namespace { + +const char kBaseUrl[] = "http://test.com/"; +const char kIcon48x48[] = "48x48.png"; +const char kIcon100x100[] = "100x100.png"; +const char kIcon110x110[] = "110x110.png"; +const char kIcon120x120[] = "120x120.png"; +const char kIcon500x500[] = "500x500.png"; + +const int kMaxIconSizePx = 320; +const int kMaxBadgeSizePx = 96; +const int kMaxActionIconSizePx = 128; + +class NotificationResourcesLoaderTest : public ::testing::Test { +public: + NotificationResourcesLoaderTest() + : m_page(DummyPageHolder::create()), m_loader(new NotificationResourcesLoader(bind<NotificationResourcesLoader*>(&NotificationResourcesLoaderTest::didFetchResources, this))) + { + } + + ~NotificationResourcesLoaderTest() override + { + m_loader->stop(); + Platform::current()->getURLLoaderMockFactory()->unregisterAllURLs(); + memoryCache()->evictResources(); + } + +protected: + ExecutionContext* executionContext() const { return &m_page->document(); } + + NotificationResourcesLoader* loader() const { return m_loader.get(); } + + WebNotificationResources* resources() const { return m_resources.get(); } + + void didFetchResources(NotificationResourcesLoader* loader) + { + m_resources = loader->getResources(); + } + + // Registers a mocked url. When fetched, |fileName| will be loaded from the + // test data directory. + WebURL registerMockedURL(const String& fileName) + { + WebURL url(KURL(ParsedURLString, kBaseUrl + fileName)); + + WebURLResponse response(url); + response.setMIMEType("image/png"); + response.setHTTPStatusCode(200); + + URLTestHelpers::registerMockedURLLoadWithCustomResponse(url, fileName, "notifications/", response); + + return url; + } + + // Registers a mocked url that will fail to be fetched, with a 404 error. + WebURL registerMockedErrorURL(const String& fileName) + { + WebURL url(KURL(ParsedURLString, kBaseUrl + fileName)); + URLTestHelpers::registerMockedErrorURLLoad(url); + return url; + } + +private: + OwnPtr<DummyPageHolder> m_page; + Persistent<NotificationResourcesLoader> m_loader; + std::unique_ptr<WebNotificationResources> m_resources; +}; + +TEST_F(NotificationResourcesLoaderTest, LoadMultipleResources) +{ + WebNotificationData notificationData; + notificationData.icon = registerMockedURL(kIcon100x100); + notificationData.badge = registerMockedURL(kIcon48x48); + notificationData.actions = WebVector<WebNotificationAction>(static_cast<size_t>(2)); + notificationData.actions[0].icon = registerMockedURL(kIcon110x110); + notificationData.actions[1].icon = registerMockedURL(kIcon120x120); + + ASSERT_FALSE(resources()); + + loader()->start(executionContext(), notificationData); + Platform::current()->getURLLoaderMockFactory()->serveAsynchronousRequests(); + + ASSERT_TRUE(resources()); + + ASSERT_FALSE(resources()->icon.drawsNothing()); + ASSERT_EQ(100, resources()->icon.width()); + + ASSERT_FALSE(resources()->badge.drawsNothing()); + ASSERT_EQ(48, resources()->badge.width()); + + ASSERT_EQ(2u, resources()->actionIcons.size()); + ASSERT_FALSE(resources()->actionIcons[0].drawsNothing()); + ASSERT_EQ(110, resources()->actionIcons[0].width()); + ASSERT_FALSE(resources()->actionIcons[1].drawsNothing()); + ASSERT_EQ(120, resources()->actionIcons[1].width()); +} + +TEST_F(NotificationResourcesLoaderTest, LargeIconsAreScaledDown) +{ + WebNotificationData notificationData; + notificationData.icon = registerMockedURL(kIcon500x500); + notificationData.badge = notificationData.icon; + notificationData.actions = WebVector<WebNotificationAction>(static_cast<size_t>(1)); + notificationData.actions[0].icon = notificationData.icon; + + ASSERT_FALSE(resources()); + + loader()->start(executionContext(), notificationData); + Platform::current()->getURLLoaderMockFactory()->serveAsynchronousRequests(); + + ASSERT_TRUE(resources()); + + ASSERT_FALSE(resources()->icon.drawsNothing()); + ASSERT_EQ(kMaxIconSizePx, resources()->icon.width()); + ASSERT_EQ(kMaxIconSizePx, resources()->icon.height()); + + ASSERT_FALSE(resources()->badge.drawsNothing()); + ASSERT_EQ(kMaxBadgeSizePx, resources()->badge.width()); + ASSERT_EQ(kMaxBadgeSizePx, resources()->badge.height()); + + ASSERT_EQ(1u, resources()->actionIcons.size()); + ASSERT_FALSE(resources()->actionIcons[0].drawsNothing()); + ASSERT_EQ(kMaxActionIconSizePx, resources()->actionIcons[0].width()); + ASSERT_EQ(kMaxActionIconSizePx, resources()->actionIcons[0].height()); +} + + +TEST_F(NotificationResourcesLoaderTest, EmptyDataYieldsEmptyResources) +{ + WebNotificationData notificationData; + + ASSERT_FALSE(resources()); + + loader()->start(executionContext(), notificationData); + Platform::current()->getURLLoaderMockFactory()->serveAsynchronousRequests(); + + ASSERT_TRUE(resources()); + + ASSERT_TRUE(resources()->icon.drawsNothing()); + ASSERT_TRUE(resources()->badge.drawsNothing()); + ASSERT_EQ(0u, resources()->actionIcons.size()); +} + +TEST_F(NotificationResourcesLoaderTest, EmptyResourcesIfAllImagesFailToLoad) +{ + WebNotificationData notificationData; + notificationData.icon = registerMockedErrorURL(kIcon100x100); + notificationData.badge = notificationData.icon; + notificationData.actions = WebVector<WebNotificationAction>(static_cast<size_t>(1)); + notificationData.actions[0].icon = notificationData.icon; + + ASSERT_FALSE(resources()); + + loader()->start(executionContext(), notificationData); + Platform::current()->getURLLoaderMockFactory()->serveAsynchronousRequests(); + + ASSERT_TRUE(resources()); + + // The test received resources but they are all empty. This ensures that a + // notification can still be shown even if the images fail to load. + ASSERT_TRUE(resources()->icon.drawsNothing()); + ASSERT_TRUE(resources()->badge.drawsNothing()); + ASSERT_EQ(1u, resources()->actionIcons.size()); + ASSERT_TRUE(resources()->actionIcons[0].drawsNothing()); +} + +TEST_F(NotificationResourcesLoaderTest, OneImageFailsToLoad) +{ + WebNotificationData notificationData; + notificationData.icon = registerMockedURL(kIcon100x100); + notificationData.badge = registerMockedErrorURL(kIcon48x48); + + ASSERT_FALSE(resources()); + + loader()->start(executionContext(), notificationData); + Platform::current()->getURLLoaderMockFactory()->serveAsynchronousRequests(); + + ASSERT_TRUE(resources()); + + // The test received resources even though one image failed to load. This + // ensures that a notification can still be shown, though slightly degraded. + ASSERT_FALSE(resources()->icon.drawsNothing()); + ASSERT_EQ(100, resources()->icon.width()); + ASSERT_TRUE(resources()->badge.drawsNothing()); + ASSERT_EQ(0u, resources()->actionIcons.size()); +} + +TEST_F(NotificationResourcesLoaderTest, StopYieldsNoResources) +{ + WebNotificationData notificationData; + notificationData.icon = registerMockedURL(kIcon100x100); + notificationData.badge = registerMockedURL(kIcon48x48); + notificationData.actions = WebVector<WebNotificationAction>(static_cast<size_t>(2)); + notificationData.actions[0].icon = registerMockedURL(kIcon110x110); + notificationData.actions[1].icon = registerMockedURL(kIcon120x120); + + ASSERT_FALSE(resources()); + + loader()->start(executionContext(), notificationData); + + // Check that starting the loader did not synchronously fail, providing + // empty resources. The requests should be pending now. + ASSERT_FALSE(resources()); + + // The loader would stop e.g. when the execution context is destroyed or + // when the loader is about to be destroyed, as a pre-finalizer. + loader()->stop(); + Platform::current()->getURLLoaderMockFactory()->serveAsynchronousRequests(); + + // Loading should have been cancelled when |stop| was called so no resources + // should have been received by the test even though + // |serveAsynchronousRequests| was called. + ASSERT_FALSE(resources()); +} + +} // namespace +} // namespace blink
diff --git a/third_party/WebKit/Source/modules/notifications/ServiceWorkerRegistrationNotifications.cpp b/third_party/WebKit/Source/modules/notifications/ServiceWorkerRegistrationNotifications.cpp index db1353d..47a5566 100644 --- a/third_party/WebKit/Source/modules/notifications/ServiceWorkerRegistrationNotifications.cpp +++ b/third_party/WebKit/Source/modules/notifications/ServiceWorkerRegistrationNotifications.cpp
@@ -12,12 +12,14 @@ #include "modules/notifications/Notification.h" #include "modules/notifications/NotificationData.h" #include "modules/notifications/NotificationOptions.h" +#include "modules/notifications/NotificationResourcesLoader.h" #include "modules/serviceworkers/ServiceWorkerRegistration.h" #include "platform/Histogram.h" +#include "platform/heap/Handle.h" #include "public/platform/Platform.h" #include "public/platform/WebSecurityOrigin.h" #include "public/platform/modules/notifications/WebNotificationData.h" -#include "public/platform/modules/notifications/WebNotificationManager.h" +#include "wtf/RefPtr.h" namespace blink { namespace { @@ -43,16 +45,25 @@ } // namespace -ScriptPromise ServiceWorkerRegistrationNotifications::showNotification(ScriptState* scriptState, ServiceWorkerRegistration& serviceWorkerRegistration, const String& title, const NotificationOptions& options, ExceptionState& exceptionState) +ServiceWorkerRegistrationNotifications::ServiceWorkerRegistrationNotifications(ExecutionContext* executionContext, ServiceWorkerRegistration* registration) + : ContextLifecycleObserver(executionContext), m_registration(registration) +{ +} + +ServiceWorkerRegistrationNotifications::~ServiceWorkerRegistrationNotifications() +{ +} + +ScriptPromise ServiceWorkerRegistrationNotifications::showNotification(ScriptState* scriptState, ServiceWorkerRegistration& registration, const String& title, const NotificationOptions& options, ExceptionState& exceptionState) { ExecutionContext* executionContext = scriptState->getExecutionContext(); // If context object's active worker is null, reject promise with a TypeError exception. - if (!serviceWorkerRegistration.active()) + if (!registration.active()) return ScriptPromise::reject(scriptState, V8ThrowException::createTypeError(scriptState->isolate(), "No active registration available on the ServiceWorkerRegistration.")); // If permission for notification's origin is not "granted", reject promise with a TypeError exception, and terminate these substeps. - if (Notification::checkPermission(executionContext) != WebNotificationPermissionAllowed) + if (Notification::checkPermission(executionContext) != mojom::PermissionStatus::GRANTED) return ScriptPromise::reject(scriptState, V8ThrowException::createTypeError(scriptState->isolate(), "No notification permission has been granted for this origin.")); // Validate the developer-provided values to get a WebNotificationData object. @@ -67,17 +78,13 @@ ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState); ScriptPromise promise = resolver->promise(); - WebNotificationShowCallbacks* callbacks = new CallbackPromiseAdapter<void, void>(resolver); + OwnPtr<WebNotificationShowCallbacks> callbacks = adoptPtr(new CallbackPromiseAdapter<void, void>(resolver)); + ServiceWorkerRegistrationNotifications::from(executionContext, registration).prepareShow(data, callbacks.release()); - SecurityOrigin* origin = executionContext->getSecurityOrigin(); - WebNotificationManager* notificationManager = Platform::current()->notificationManager(); - ASSERT(notificationManager); - - notificationManager->showPersistent(WebSecurityOrigin(origin), data, serviceWorkerRegistration.webRegistration(), callbacks); return promise; } -ScriptPromise ServiceWorkerRegistrationNotifications::getNotifications(ScriptState* scriptState, ServiceWorkerRegistration& serviceWorkerRegistration, const GetNotificationOptions& options) +ScriptPromise ServiceWorkerRegistrationNotifications::getNotifications(ScriptState* scriptState, ServiceWorkerRegistration& registration, const GetNotificationOptions& options) { ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState); ScriptPromise promise = resolver->promise(); @@ -87,8 +94,56 @@ WebNotificationManager* notificationManager = Platform::current()->notificationManager(); ASSERT(notificationManager); - notificationManager->getNotifications(options.tag(), serviceWorkerRegistration.webRegistration(), callbacks); + notificationManager->getNotifications(options.tag(), registration.webRegistration(), callbacks); return promise; } +void ServiceWorkerRegistrationNotifications::contextDestroyed() +{ + for (auto loader : m_loaders) + loader->stop(); +} + +DEFINE_TRACE(ServiceWorkerRegistrationNotifications) +{ + visitor->trace(m_registration); + visitor->trace(m_loaders); + Supplement<ServiceWorkerRegistration>::trace(visitor); + ContextLifecycleObserver::trace(visitor); +} + +const char* ServiceWorkerRegistrationNotifications::supplementName() +{ + return "ServiceWorkerRegistrationNotifications"; +} + +ServiceWorkerRegistrationNotifications& ServiceWorkerRegistrationNotifications::from(ExecutionContext* executionContext, ServiceWorkerRegistration& registration) +{ + ServiceWorkerRegistrationNotifications* supplement = static_cast<ServiceWorkerRegistrationNotifications*>(Supplement<ServiceWorkerRegistration>::from(registration, supplementName())); + if (!supplement) { + supplement = new ServiceWorkerRegistrationNotifications(executionContext, ®istration); + provideTo(registration, supplementName(), supplement); + } + return *supplement; +} + +void ServiceWorkerRegistrationNotifications::prepareShow(const WebNotificationData& data, PassOwnPtr<WebNotificationShowCallbacks> callbacks) +{ + RefPtr<SecurityOrigin> origin = getExecutionContext()->getSecurityOrigin(); + NotificationResourcesLoader* loader = new NotificationResourcesLoader(bind<NotificationResourcesLoader*>(&ServiceWorkerRegistrationNotifications::didLoadResources, WeakPersistentThisPointer<ServiceWorkerRegistrationNotifications>(this), origin.release(), data, callbacks)); + m_loaders.add(loader); + loader->start(getExecutionContext(), data); +} + +void ServiceWorkerRegistrationNotifications::didLoadResources(PassRefPtr<SecurityOrigin> origin, const WebNotificationData& data, PassOwnPtr<WebNotificationShowCallbacks> callbacks, NotificationResourcesLoader* loader) +{ + DCHECK(m_loaders.contains(loader)); + + WebNotificationManager* notificationManager = Platform::current()->notificationManager(); + DCHECK(notificationManager); + + notificationManager->showPersistent(WebSecurityOrigin(origin.get()), data, loader->getResources(), m_registration->webRegistration(), callbacks.leakPtr()); + m_loaders.remove(loader); +} + } // namespace blink
diff --git a/third_party/WebKit/Source/modules/notifications/ServiceWorkerRegistrationNotifications.h b/third_party/WebKit/Source/modules/notifications/ServiceWorkerRegistrationNotifications.h index a256622..391e789 100644 --- a/third_party/WebKit/Source/modules/notifications/ServiceWorkerRegistrationNotifications.h +++ b/third_party/WebKit/Source/modules/notifications/ServiceWorkerRegistrationNotifications.h
@@ -6,20 +6,54 @@ #define ServiceWorkerRegistrationNotifications_h #include "bindings/core/v8/ScriptPromise.h" +#include "core/dom/ContextLifecycleObserver.h" +#include "platform/Supplementable.h" +#include "platform/heap/GarbageCollected.h" +#include "platform/heap/Handle.h" +#include "platform/heap/HeapAllocator.h" +#include "platform/heap/Visitor.h" +#include "public/platform/modules/notifications/WebNotificationManager.h" +#include "wtf/Noncopyable.h" +#include "wtf/OwnPtr.h" +#include "wtf/PassOwnPtr.h" +#include "wtf/PassRefPtr.h" namespace blink { +class ExecutionContext; class ExceptionState; class GetNotificationOptions; class NotificationOptions; +class NotificationResourcesLoader; class ScriptState; +class SecurityOrigin; class ServiceWorkerRegistration; +struct WebNotificationData; -class ServiceWorkerRegistrationNotifications { - STATIC_ONLY(ServiceWorkerRegistrationNotifications); +class ServiceWorkerRegistrationNotifications final : public GarbageCollectedFinalized<ServiceWorkerRegistrationNotifications>, public Supplement<ServiceWorkerRegistration>, public ContextLifecycleObserver { + USING_GARBAGE_COLLECTED_MIXIN(ServiceWorkerRegistrationNotifications); + WTF_MAKE_NONCOPYABLE(ServiceWorkerRegistrationNotifications); public: + ~ServiceWorkerRegistrationNotifications(); static ScriptPromise showNotification(ScriptState*, ServiceWorkerRegistration&, const String& title, const NotificationOptions&, ExceptionState&); static ScriptPromise getNotifications(ScriptState*, ServiceWorkerRegistration&, const GetNotificationOptions&); + + // ContextLifecycleObserver interface. + void contextDestroyed() override; + + DECLARE_VIRTUAL_TRACE(); + +private: + ServiceWorkerRegistrationNotifications(ExecutionContext*, ServiceWorkerRegistration*); + + static const char* supplementName(); + static ServiceWorkerRegistrationNotifications& from(ExecutionContext*, ServiceWorkerRegistration&); + + void prepareShow(const WebNotificationData&, PassOwnPtr<WebNotificationShowCallbacks>); + void didLoadResources(PassRefPtr<SecurityOrigin>, const WebNotificationData&, PassOwnPtr<WebNotificationShowCallbacks>, NotificationResourcesLoader*); + + Member<ServiceWorkerRegistration> m_registration; + HeapHashSet<Member<NotificationResourcesLoader>> m_loaders; }; } // namespace blink
diff --git a/third_party/WebKit/Source/modules/push_messaging/PushEvent.idl b/third_party/WebKit/Source/modules/push_messaging/PushEvent.idl index aa6d1169..c11714b 100644 --- a/third_party/WebKit/Source/modules/push_messaging/PushEvent.idl +++ b/third_party/WebKit/Source/modules/push_messaging/PushEvent.idl
@@ -9,5 +9,5 @@ Exposed=ServiceWorker, RuntimeEnabled=PushMessaging, ] interface PushEvent : ExtendableEvent { - [RuntimeEnabled=PushMessagingData] readonly attribute PushMessageData data; + readonly attribute PushMessageData data; };
diff --git a/third_party/WebKit/Source/modules/push_messaging/PushMessageData.idl b/third_party/WebKit/Source/modules/push_messaging/PushMessageData.idl index b1f716c..d0cd7ee1 100644 --- a/third_party/WebKit/Source/modules/push_messaging/PushMessageData.idl +++ b/third_party/WebKit/Source/modules/push_messaging/PushMessageData.idl
@@ -8,7 +8,6 @@ [ Exposed=ServiceWorker, - RuntimeEnabled=PushMessagingData, ] interface PushMessageData { ArrayBuffer arrayBuffer(); Blob blob();
diff --git a/third_party/WebKit/Source/modules/push_messaging/PushSubscription.cpp b/third_party/WebKit/Source/modules/push_messaging/PushSubscription.cpp index b50912b..d9d0a718 100644 --- a/third_party/WebKit/Source/modules/push_messaging/PushSubscription.cpp +++ b/third_party/WebKit/Source/modules/push_messaging/PushSubscription.cpp
@@ -9,7 +9,6 @@ #include "bindings/core/v8/V8ObjectBuilder.h" #include "modules/push_messaging/PushError.h" #include "modules/serviceworkers/ServiceWorkerRegistration.h" -#include "platform/RuntimeEnabledFeatures.h" #include "public/platform/Platform.h" #include "public/platform/modules/push_messaging/WebPushProvider.h" #include "public/platform/modules/push_messaging/WebPushSubscription.h" @@ -72,18 +71,15 @@ ScriptValue PushSubscription::toJSONForBinding(ScriptState* scriptState) { + ASSERT(m_p256dh); + V8ObjectBuilder result(scriptState); result.addString("endpoint", endpoint()); - if (RuntimeEnabledFeatures::pushMessagingDataEnabled()) { - ASSERT(m_p256dh); - - V8ObjectBuilder keys(scriptState); - keys.add("p256dh", WTF::base64URLEncode(static_cast<const char*>(m_p256dh->data()), m_p256dh->byteLength())); - keys.add("auth", WTF::base64URLEncode(static_cast<const char*>(m_auth->data()), m_auth->byteLength())); - - result.add("keys", keys); - } + V8ObjectBuilder keys(scriptState); + keys.add("p256dh", WTF::base64URLEncode(static_cast<const char*>(m_p256dh->data()), m_p256dh->byteLength())); + keys.add("auth", WTF::base64URLEncode(static_cast<const char*>(m_auth->data()), m_auth->byteLength())); + result.add("keys", keys); return result.scriptValue(); }
diff --git a/third_party/WebKit/Source/modules/push_messaging/PushSubscription.idl b/third_party/WebKit/Source/modules/push_messaging/PushSubscription.idl index 313d033..ccfb827 100644 --- a/third_party/WebKit/Source/modules/push_messaging/PushSubscription.idl +++ b/third_party/WebKit/Source/modules/push_messaging/PushSubscription.idl
@@ -15,7 +15,7 @@ ] interface PushSubscription { readonly attribute USVString endpoint; - [RuntimeEnabled=PushMessagingData] ArrayBuffer? getKey(PushEncryptionKeyName name); + ArrayBuffer? getKey(PushEncryptionKeyName name); [CallWith=ScriptState] Promise<boolean> unsubscribe(); serializer;
diff --git a/third_party/WebKit/Source/modules/quota/WorkerNavigatorStorageQuota.cpp b/third_party/WebKit/Source/modules/quota/WorkerNavigatorStorageQuota.cpp index f5cd7d8..bd600348 100644 --- a/third_party/WebKit/Source/modules/quota/WorkerNavigatorStorageQuota.cpp +++ b/third_party/WebKit/Source/modules/quota/WorkerNavigatorStorageQuota.cpp
@@ -54,35 +54,11 @@ return *supplement; } -DeprecatedStorageQuota* WorkerNavigatorStorageQuota::webkitTemporaryStorage(WorkerNavigator& navigator) -{ - return WorkerNavigatorStorageQuota::from(navigator).webkitTemporaryStorage(); -} - -DeprecatedStorageQuota* WorkerNavigatorStorageQuota::webkitPersistentStorage(WorkerNavigator& navigator) -{ - return WorkerNavigatorStorageQuota::from(navigator).webkitPersistentStorage(); -} - StorageManager* WorkerNavigatorStorageQuota::storage(WorkerNavigator& navigator) { return WorkerNavigatorStorageQuota::from(navigator).storage(); } -DeprecatedStorageQuota* WorkerNavigatorStorageQuota::webkitTemporaryStorage() const -{ - if (!m_temporaryStorage) - m_temporaryStorage = DeprecatedStorageQuota::create(DeprecatedStorageQuota::Temporary); - return m_temporaryStorage.get(); -} - -DeprecatedStorageQuota* WorkerNavigatorStorageQuota::webkitPersistentStorage() const -{ - if (!m_persistentStorage) - m_persistentStorage = DeprecatedStorageQuota::create(DeprecatedStorageQuota::Persistent); - return m_persistentStorage.get(); -} - StorageManager* WorkerNavigatorStorageQuota::storage() const { if (!m_storageManager) @@ -92,8 +68,6 @@ DEFINE_TRACE(WorkerNavigatorStorageQuota) { - visitor->trace(m_temporaryStorage); - visitor->trace(m_persistentStorage); visitor->trace(m_storageManager); Supplement<WorkerNavigator>::trace(visitor); }
diff --git a/third_party/WebKit/Source/modules/quota/WorkerNavigatorStorageQuota.h b/third_party/WebKit/Source/modules/quota/WorkerNavigatorStorageQuota.h index 81206e5..46eb523 100644 --- a/third_party/WebKit/Source/modules/quota/WorkerNavigatorStorageQuota.h +++ b/third_party/WebKit/Source/modules/quota/WorkerNavigatorStorageQuota.h
@@ -46,12 +46,8 @@ public: static WorkerNavigatorStorageQuota& from(WorkerNavigator&); - static DeprecatedStorageQuota* webkitTemporaryStorage(WorkerNavigator&); - static DeprecatedStorageQuota* webkitPersistentStorage(WorkerNavigator&); static StorageManager* storage(WorkerNavigator&); - DeprecatedStorageQuota* webkitTemporaryStorage() const; - DeprecatedStorageQuota* webkitPersistentStorage() const; StorageManager* storage() const; DECLARE_VIRTUAL_TRACE(); @@ -60,8 +56,6 @@ explicit WorkerNavigatorStorageQuota(); static const char* supplementName(); - mutable Member<DeprecatedStorageQuota> m_temporaryStorage; - mutable Member<DeprecatedStorageQuota> m_persistentStorage; mutable Member<StorageManager> m_storageManager; };
diff --git a/third_party/WebKit/Source/modules/quota/WorkerNavigatorStorageQuota.idl b/third_party/WebKit/Source/modules/quota/WorkerNavigatorStorageQuota.idl index cb14bb6c..04c09ce 100644 --- a/third_party/WebKit/Source/modules/quota/WorkerNavigatorStorageQuota.idl +++ b/third_party/WebKit/Source/modules/quota/WorkerNavigatorStorageQuota.idl
@@ -17,13 +17,7 @@ * Boston, MA 02110-1301, USA. */ -// This partial interface is a merge of two different partial interfaces -// related to storage. partial interface WorkerNavigator { - // http://www.w3.org/TR/2012/WD-quota-api-20120703/#idl-def-StorageQuotaEnvironment - [MeasureAs=PrefixedStorageQuota] readonly attribute DeprecatedStorageQuota webkitTemporaryStorage; - [MeasureAs=PrefixedStorageQuota] readonly attribute DeprecatedStorageQuota webkitPersistentStorage; - // https://storage.spec.whatwg.org/#api [RuntimeEnabled=DurableStorage] readonly attribute StorageManager storage; };
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ExtendableMessageEvent.idl b/third_party/WebKit/Source/modules/serviceworkers/ExtendableMessageEvent.idl index 6da6bbf..d8b5b13 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/ExtendableMessageEvent.idl +++ b/third_party/WebKit/Source/modules/serviceworkers/ExtendableMessageEvent.idl
@@ -11,7 +11,6 @@ // Constructor(DOMString type, optional ExtendableMessageEventInit eventInitDict), CustomConstructor, Exposed=ServiceWorker, - RuntimeEnabled=ServiceWorkerExtendableMessageEvent, ] interface ExtendableMessageEvent : ExtendableEvent { [Custom=Getter] readonly attribute any data; readonly attribute DOMString origin;
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ExtendableMessageEventInit.idl b/third_party/WebKit/Source/modules/serviceworkers/ExtendableMessageEventInit.idl index 9d3bbe0..dfac8b7 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/ExtendableMessageEventInit.idl +++ b/third_party/WebKit/Source/modules/serviceworkers/ExtendableMessageEventInit.idl
@@ -4,9 +4,7 @@ // https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#extendablemessage-event-section -[ - RuntimeEnabled=ServiceWorkerExtendableMessageEvent, -] dictionary ExtendableMessageEventInit : ExtendableEventInit { +dictionary ExtendableMessageEventInit : ExtendableEventInit { any data; DOMString origin; DOMString lastEventId;
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioParam.cpp b/third_party/WebKit/Source/modules/webaudio/AudioParam.cpp index 3c31385..9e49429 100644 --- a/third_party/WebKit/Source/modules/webaudio/AudioParam.cpp +++ b/third_party/WebKit/Source/modules/webaudio/AudioParam.cpp
@@ -237,13 +237,14 @@ AudioParam* AudioParam::linearRampToValueAtTime(float value, double time, ExceptionState& exceptionState) { - handler().timeline().linearRampToValueAtTime(value, time, exceptionState); + handler().timeline().linearRampToValueAtTime( + value, time, handler().intrinsicValue(), context()->currentTime(), exceptionState); return this; } AudioParam* AudioParam::exponentialRampToValueAtTime(float value, double time, ExceptionState& exceptionState) { - handler().timeline().exponentialRampToValueAtTime(value, time, exceptionState); + handler().timeline().exponentialRampToValueAtTime(value, time, handler().intrinsicValue(), context()->currentTime(), exceptionState); return this; }
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioParam.h b/third_party/WebKit/Source/modules/webaudio/AudioParam.h index 9f8a0b6..496fd96 100644 --- a/third_party/WebKit/Source/modules/webaudio/AudioParam.h +++ b/third_party/WebKit/Source/modules/webaudio/AudioParam.h
@@ -100,6 +100,7 @@ void connect(AudioNodeOutput&); void disconnect(AudioNodeOutput&); + float intrinsicValue() const { return noBarrierLoad(&m_intrinsicValue); } private: AudioParamHandler(AbstractAudioContext& context, double defaultValue) : AudioSummingJunction(context.deferredTaskHandler()) @@ -114,7 +115,6 @@ // Intrinsic value float m_intrinsicValue; - float intrinsicValue() const { return noBarrierLoad(&m_intrinsicValue); } void setIntrinsicValue(float newValue) { noBarrierStore(&m_intrinsicValue, newValue); } float m_defaultValue;
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioParamTimeline.cpp b/third_party/WebKit/Source/modules/webaudio/AudioParamTimeline.cpp index 58646b6..18a6716 100644 --- a/third_party/WebKit/Source/modules/webaudio/AudioParamTimeline.cpp +++ b/third_party/WebKit/Source/modules/webaudio/AudioParamTimeline.cpp
@@ -114,14 +114,14 @@ return ParamEvent(ParamEvent::SetValue, value, time, 0, 0, nullptr); } -AudioParamTimeline::ParamEvent AudioParamTimeline::ParamEvent::createLinearRampEvent(float value, double time) +AudioParamTimeline::ParamEvent AudioParamTimeline::ParamEvent::createLinearRampEvent(float value, double time, float initialValue, double callTime) { - return ParamEvent(ParamEvent::LinearRampToValue, value, time, 0, 0, nullptr); + return ParamEvent(ParamEvent::LinearRampToValue, value, time, 0, 0, nullptr, initialValue, callTime); } -AudioParamTimeline::ParamEvent AudioParamTimeline::ParamEvent::createExponentialRampEvent(float value, double time) +AudioParamTimeline::ParamEvent AudioParamTimeline::ParamEvent::createExponentialRampEvent(float value, double time, float initialValue, double callTime) { - return ParamEvent(ParamEvent::ExponentialRampToValue, value, time, 0, 0, nullptr); + return ParamEvent(ParamEvent::ExponentialRampToValue, value, time, 0, 0, nullptr, initialValue, callTime); } AudioParamTimeline::ParamEvent AudioParamTimeline::ParamEvent::createSetTargetEvent(float value, double time, double timeConstant) @@ -144,17 +144,17 @@ insertEvent(ParamEvent::createSetValueEvent(value, time), exceptionState); } -void AudioParamTimeline::linearRampToValueAtTime(float value, double time, ExceptionState& exceptionState) +void AudioParamTimeline::linearRampToValueAtTime(float value, double time, float initialValue, double callTime, ExceptionState& exceptionState) { ASSERT(isMainThread()); if (!isNonNegativeAudioParamTime(time, exceptionState)) return; - insertEvent(ParamEvent::createLinearRampEvent(value, time), exceptionState); + insertEvent(ParamEvent::createLinearRampEvent(value, time, initialValue, callTime), exceptionState); } -void AudioParamTimeline::exponentialRampToValueAtTime(float value, double time, ExceptionState& exceptionState) +void AudioParamTimeline::exponentialRampToValueAtTime(float value, double time, float initialValue, double callTime, ExceptionState& exceptionState) { ASSERT(isMainThread()); @@ -171,7 +171,7 @@ return; } - insertEvent(ParamEvent::createExponentialRampEvent(value, time), exceptionState); + insertEvent(ParamEvent::createExponentialRampEvent(value, time, initialValue, callTime), exceptionState); } void AudioParamTimeline::setTargetAtTime(float target, double time, double timeConstant, ExceptionState& exceptionState) @@ -219,6 +219,15 @@ unsigned i = 0; double insertTime = event.time(); + if (!m_events.size() + && (event.getType() == ParamEvent::LinearRampToValue + || event.getType() == ParamEvent::ExponentialRampToValue)) { + // There are no events preceding these ramps. Insert a new setValueAtTime event to set the + // starting point for these events. + m_events.insert(0, + AudioParamTimeline::ParamEvent::createSetValueEvent(event.initialValue(), event.callTime())); + } + for (i = 0; i < m_events.size(); ++i) { if (event.getType() == ParamEvent::SetValueCurve) { // If this event is a SetValueCurve, make sure it doesn't overlap any existing
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioParamTimeline.h b/third_party/WebKit/Source/modules/webaudio/AudioParamTimeline.h index f80cc69..4b7c533 100644 --- a/third_party/WebKit/Source/modules/webaudio/AudioParamTimeline.h +++ b/third_party/WebKit/Source/modules/webaudio/AudioParamTimeline.h
@@ -45,8 +45,8 @@ } void setValueAtTime(float value, double time, ExceptionState&); - void linearRampToValueAtTime(float value, double time, ExceptionState&); - void exponentialRampToValueAtTime(float value, double time, ExceptionState&); + void linearRampToValueAtTime(float value, double time, float initialValue, double callTime, ExceptionState&); + void exponentialRampToValueAtTime(float value, double time, float initialValue, double callTime, ExceptionState&); void setTargetAtTime(float target, double time, double timeConstant, ExceptionState&); void setValueCurveAtTime(DOMFloat32Array* curve, double time, double duration, ExceptionState&); void cancelScheduledValues(double startTime, ExceptionState&); @@ -78,8 +78,8 @@ LastType }; - static ParamEvent createLinearRampEvent(float value, double time); - static ParamEvent createExponentialRampEvent(float value, double time); + static ParamEvent createLinearRampEvent(float value, double time, float initialValue, double callTime); + static ParamEvent createExponentialRampEvent(float value, double time, float initialValue, double callTime); static ParamEvent createSetValueEvent(float value, double time); static ParamEvent createSetTargetEvent(float value, double time, double timeConstant); static ParamEvent createSetValueCurveEvent(DOMFloat32Array* curve, double time, double duration); @@ -90,15 +90,21 @@ double timeConstant() const { return m_timeConstant; } double duration() const { return m_duration; } DOMFloat32Array* curve() { return m_curve.get(); } + float initialValue() const { return m_initialValue; } + double callTime() const { return m_callTime; } private: - ParamEvent(Type type, float value, double time, double timeConstant, double duration, DOMFloat32Array* curve) + ParamEvent(Type type, float value, double time, + double timeConstant, double duration, DOMFloat32Array* curve, + float initialValue = 0, double callTime = 0) : m_type(type) , m_value(value) , m_time(time) , m_timeConstant(timeConstant) , m_duration(duration) , m_curve(curve) + , m_initialValue(initialValue) + , m_callTime(callTime) { } @@ -110,6 +116,10 @@ // Only used for SetValueCurve events. double m_duration; CrossThreadPersistent<DOMFloat32Array> m_curve; + // Initial value and time to use for linear and exponential ramps that don't have a + // preceding event. + float m_initialValue; + double m_callTime; }; void insertEvent(const ParamEvent&, ExceptionState&);
diff --git a/third_party/WebKit/Source/modules/webdatabase/InspectorDatabaseAgent.cpp b/third_party/WebKit/Source/modules/webdatabase/InspectorDatabaseAgent.cpp index cf8cf30..804de09 100644 --- a/third_party/WebKit/Source/modules/webdatabase/InspectorDatabaseAgent.cpp +++ b/third_party/WebKit/Source/modules/webdatabase/InspectorDatabaseAgent.cpp
@@ -259,6 +259,12 @@ { } +void InspectorDatabaseAgent::discardAgent() +{ + if (DatabaseClient* client = DatabaseClient::fromPage(m_page)) + client->setInspectorAgent(nullptr); +} + void InspectorDatabaseAgent::enable(ErrorString*) { if (m_enabled)
diff --git a/third_party/WebKit/Source/modules/webdatabase/InspectorDatabaseAgent.h b/third_party/WebKit/Source/modules/webdatabase/InspectorDatabaseAgent.h index fed8196..ca61813 100644 --- a/third_party/WebKit/Source/modules/webdatabase/InspectorDatabaseAgent.h +++ b/third_party/WebKit/Source/modules/webdatabase/InspectorDatabaseAgent.h
@@ -58,6 +58,7 @@ void disable(ErrorString*) override; void restore() override; void didCommitLoadForLocalFrame(LocalFrame*) override; + void discardAgent() override; // Called from the front-end. void enable(ErrorString*) override;
diff --git a/third_party/WebKit/Source/platform/PODRedBlackTree.h b/third_party/WebKit/Source/platform/PODRedBlackTree.h index f449469..bd739a8 100644 --- a/third_party/WebKit/Source/platform/PODRedBlackTree.h +++ b/third_party/WebKit/Source/platform/PODRedBlackTree.h
@@ -158,7 +158,7 @@ bool isInitialized() const { - return m_arena; + return m_arena.get(); } void initIfNeeded()
diff --git a/third_party/WebKit/Source/platform/PlatformEvent.h b/third_party/WebKit/Source/platform/PlatformEvent.h index 62b6cd2..e011adf 100644 --- a/third_party/WebKit/Source/platform/PlatformEvent.h +++ b/third_party/WebKit/Source/platform/PlatformEvent.h
@@ -74,6 +74,7 @@ TouchMove, TouchEnd, TouchCancel, + TouchScrollStarted, }; // These values are direct mappings of the values in WebInputEvent so the values can be cast between the
diff --git a/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in b/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in index d29e1d56..4b5ac83 100644 --- a/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in +++ b/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in
@@ -104,6 +104,7 @@ InputDeviceCapabilities status=stable InputEvent status=experimental InputModeAttribute status=experimental +InputMultipleFieldsUI status=stable InstalledApp status=experimental IntersectionObserver status=stable KeyboardEventCode status=stable @@ -134,7 +135,6 @@ NewMediaPlaybackUi NotificationConstructor status=stable NotificationExperimental status=test -NotificationActionIcons status=stable NotificationBadge status=experimental NotificationInlineReplies status=experimental Notifications status=stable @@ -159,7 +159,6 @@ PresentationReceiver status=test PromiseRejectionEvent status=stable PushMessaging status=stable -PushMessagingData status=stable PushSubscriptionRestrictions status=experimental QuotaPromise status=experimental ReducedReferrerGranularity @@ -179,7 +178,6 @@ // as per the spec, matching other Web engines. ScrollTopLeftInterop status=experimental ServiceWorkerClientAttributes status=stable -ServiceWorkerExtendableMessageEvent status=stable ServiceWorkerClientsGetID status=stable ServiceWorkerWindowClientNavigate status=stable ShadowDOMV1 status=experimental
diff --git a/third_party/WebKit/Source/platform/animation/AnimationTranslationUtil.cpp b/third_party/WebKit/Source/platform/animation/AnimationTranslationUtil.cpp index e0be8ec..2582de6 100644 --- a/third_party/WebKit/Source/platform/animation/AnimationTranslationUtil.cpp +++ b/third_party/WebKit/Source/platform/animation/AnimationTranslationUtil.cpp
@@ -115,8 +115,7 @@ void toCompositorFilterOperations(const FilterOperations& inOperations, CompositorFilterOperations* outOperations) { - SkiaImageFilterBuilder builder; - builder.buildFilterOperations(inOperations, outOperations); + SkiaImageFilterBuilder::buildFilterOperations(inOperations, outOperations); } } // namespace blink
diff --git a/third_party/WebKit/Source/platform/exported/WebURLLoadTiming.cpp b/third_party/WebKit/Source/platform/exported/WebURLLoadTiming.cpp index ac2345e..c74674c 100644 --- a/third_party/WebKit/Source/platform/exported/WebURLLoadTiming.cpp +++ b/third_party/WebKit/Source/platform/exported/WebURLLoadTiming.cpp
@@ -190,6 +190,26 @@ m_private->setSslEnd(end); } +double WebURLLoadTiming::pushStart() const +{ + return m_private->pushStart(); +} + +void WebURLLoadTiming::setPushStart(double start) +{ + m_private->setPushStart(start); +} + +double WebURLLoadTiming::pushEnd() const +{ + return m_private->pushEnd(); +} + +void WebURLLoadTiming::setPushEnd(double end) +{ + m_private->setPushEnd(end); +} + WebURLLoadTiming::WebURLLoadTiming(const PassRefPtr<ResourceLoadTiming>& value) : m_private(value) {
diff --git a/third_party/WebKit/Source/platform/fonts/FontDataForRangeSet.h b/third_party/WebKit/Source/platform/fonts/FontDataForRangeSet.h index 42091042..8ce6dca 100644 --- a/third_party/WebKit/Source/platform/fonts/FontDataForRangeSet.h +++ b/third_party/WebKit/Source/platform/fonts/FontDataForRangeSet.h
@@ -68,7 +68,7 @@ bool contains(UChar32 testChar) const { return m_rangeSet->contains(testChar); } bool isEntireRange() const { return m_rangeSet->isEntireRange(); } PassRefPtr<UnicodeRangeSet> ranges() const { return m_rangeSet; } - bool hasFontData() const { return fontData(); } + bool hasFontData() const { return m_fontData.get(); } PassRefPtr<SimpleFontData> fontData() const { return m_fontData; } private:
diff --git a/third_party/WebKit/Source/platform/fonts/SimpleFontData.h b/third_party/WebKit/Source/platform/fonts/SimpleFontData.h index eed56b4..b13d353e 100644 --- a/third_party/WebKit/Source/platform/fonts/SimpleFontData.h +++ b/third_party/WebKit/Source/platform/fonts/SimpleFontData.h
@@ -111,7 +111,7 @@ Glyph glyphForCharacter(UChar32) const; - bool isCustomFont() const override { return m_customFontData; } + bool isCustomFont() const override { return m_customFontData.get(); } bool isLoading() const override { return m_customFontData ? m_customFontData->isLoading() : false; } bool isLoadingFallback() const override { return m_customFontData ? m_customFontData->isLoadingFallback() : false; } bool isSegmented() const override;
diff --git a/third_party/WebKit/Source/platform/fonts/shaping/CachingWordShapeIterator.h b/third_party/WebKit/Source/platform/fonts/shaping/CachingWordShapeIterator.h index 4a351248..40cf7b05 100644 --- a/third_party/WebKit/Source/platform/fonts/shaping/CachingWordShapeIterator.h +++ b/third_party/WebKit/Source/platform/fonts/shaping/CachingWordShapeIterator.h
@@ -65,7 +65,7 @@ return false; *wordResult = shapeWord(m_textRun, m_font); m_startIndex = 1; - return *wordResult; + return wordResult->get(); } return nextWord(wordResult); @@ -105,8 +105,7 @@ static bool isWordDelimiter(UChar ch) { - return ch == spaceCharacter || ch == tabulationCharacter - || ch == '.' || ch == ','; + return ch == spaceCharacter || ch == tabulationCharacter; } unsigned nextWordEndIndex() @@ -175,7 +174,7 @@ *result = shapeWord(subRun, m_font); } m_startIndex = endIndex; - return *result; + return result->get(); } unsigned endIndexUntil(UChar ch)
diff --git a/third_party/WebKit/Source/platform/fonts/shaping/CachingWordShaperTest.cpp b/third_party/WebKit/Source/platform/fonts/shaping/CachingWordShaperTest.cpp index 15ddda5..a8623c6 100644 --- a/third_party/WebKit/Source/platform/fonts/shaping/CachingWordShaperTest.cpp +++ b/third_party/WebKit/Source/platform/fonts/shaping/CachingWordShaperTest.cpp
@@ -65,15 +65,9 @@ ASSERT_TRUE(iterator.next(&result)); ASSERT_TRUE(testInfo(result)->runInfoForTesting(0, startIndex, numGlyphs, script)); EXPECT_EQ(0u, startIndex); - EXPECT_EQ(3u, numGlyphs); + EXPECT_EQ(4u, numGlyphs); EXPECT_EQ(HB_SCRIPT_LATIN, script); - ASSERT_TRUE(iterator.next(&result)); - ASSERT_TRUE(testInfo(result)->runInfoForTesting(0, startIndex, numGlyphs, script)); - EXPECT_EQ(0u, startIndex); - EXPECT_EQ(1u, numGlyphs); - EXPECT_EQ(HB_SCRIPT_COMMON, script); - ASSERT_FALSE(iterator.next(&result)); } @@ -88,14 +82,7 @@ ASSERT_TRUE(iterator.next(&result)); ASSERT_TRUE(testInfo(result)->runInfoForTesting(0, startIndex, numGlyphs, script)); EXPECT_EQ(0u, offset + startIndex); - EXPECT_EQ(2u, numGlyphs); - EXPECT_EQ(HB_SCRIPT_COMMON, script); - offset += result->numCharacters(); - - ASSERT_TRUE(iterator.next(&result)); - ASSERT_TRUE(testInfo(result)->runInfoForTesting(0, startIndex, numGlyphs, script)); - EXPECT_EQ(2u, offset + startIndex); - EXPECT_EQ(1u, numGlyphs); + EXPECT_EQ(3u, numGlyphs); EXPECT_EQ(HB_SCRIPT_COMMON, script); offset += result->numCharacters();
diff --git a/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp b/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp index fad71475..78511f3 100644 --- a/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp +++ b/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp
@@ -116,8 +116,8 @@ m_frames[i].clear(false); } - size_t frameBytesCleared = m_source.clearCacheExceptFrame(destroyAll ? kNotFound : m_currentFrame); - notifyMemoryChanged(-safeCast<int>(frameBytesCleared)); + m_source.clearCacheExceptFrame(destroyAll ? kNotFound : m_currentFrame); + notifyMemoryChanged(); } void BitmapImage::destroyDecodedDataIfNecessary() @@ -134,19 +134,19 @@ } } -void BitmapImage::notifyMemoryChanged(int delta) +void BitmapImage::notifyMemoryChanged() { - if (delta && getImageObserver()) - getImageObserver()->decodedSizeChanged(this, delta); + if (getImageObserver()) + getImageObserver()->decodedSizeChangedTo(this, totalFrameBytes()); } -int BitmapImage::totalFrameBytes() +size_t BitmapImage::totalFrameBytes() { const size_t numFrames = frameCount(); size_t totalBytes = 0; for (size_t i = 0; i < numFrames; ++i) totalBytes += m_source.frameBytesAtIndex(i); - return safeCast<int>(totalBytes); + return totalBytes; } void BitmapImage::cacheFrame(size_t index) @@ -155,8 +155,6 @@ if (m_frames.size() < numFrames) m_frames.grow(numFrames); - int deltaBytes = totalFrameBytes(); - // We are caching frame snapshots. This is OK even for partially decoded frames, // as they are cleared by dataChanged() when new data arrives. m_frames[index].m_frame = m_source.createFrameAtIndex(index); @@ -173,11 +171,7 @@ if (frameSize != m_size) m_hasUniformFrameSize = false; - // We need to check the total bytes before and after the decode call, not - // just the current frame size, because some multi-frame images may require - // decoding multiple frames to decode the current frame. - deltaBytes = totalFrameBytes() - deltaBytes; - notifyMemoryChanged(deltaBytes); + notifyMemoryChanged(); } void BitmapImage::updateSize() const
diff --git a/third_party/WebKit/Source/platform/graphics/BitmapImage.h b/third_party/WebKit/Source/platform/graphics/BitmapImage.h index 5275168..2a650a89 100644 --- a/third_party/WebKit/Source/platform/graphics/BitmapImage.h +++ b/third_party/WebKit/Source/platform/graphics/BitmapImage.h
@@ -129,10 +129,8 @@ bool ensureFrameIsCached(size_t index); // Returns the total number of bytes allocated for all framebuffers, i.e. - // the sum of m_source.frameBytesAtIndex(...) for all frames. This is - // returned as an int for caller convenience, to allow safely subtracting - // the values from successive calls as signed expressions. - int totalFrameBytes(); + // the sum of m_source.frameBytesAtIndex(...) for all frames. + size_t totalFrameBytes(); // Called to invalidate cached data. When |destroyAll| is true, we wipe out // the entire frame buffer cache and tell the image source to destroy @@ -147,7 +145,7 @@ void destroyDecodedDataIfNecessary(); // Notifies observers that the memory footprint has changed. - void notifyMemoryChanged(int delta); + void notifyMemoryChanged(); // Whether or not size is available yet. bool isSizeAvailable();
diff --git a/third_party/WebKit/Source/platform/graphics/BitmapImageTest.cpp b/third_party/WebKit/Source/platform/graphics/BitmapImageTest.cpp index 44c76f9..ec8e2d948 100644 --- a/third_party/WebKit/Source/platform/graphics/BitmapImageTest.cpp +++ b/third_party/WebKit/Source/platform/graphics/BitmapImageTest.cpp
@@ -37,6 +37,7 @@ #include "platform/testing/HistogramTester.h" #include "platform/testing/UnitTestHelpers.h" #include "testing/gtest/include/gtest/gtest.h" +#include "wtf/StdLibExtras.h" namespace blink { @@ -45,11 +46,14 @@ class FakeImageObserver : public GarbageCollectedFinalized<FakeImageObserver>, public ImageObserver { USING_GARBAGE_COLLECTED_MIXIN(FakeImageObserver); public: - FakeImageObserver() : m_lastDecodedSizeChangedDelta(0) { } + FakeImageObserver() + : m_lastDecodedSize(0) + , m_lastDecodedSizeChangedDelta(0) { } - virtual void decodedSizeChanged(const Image*, int delta) + virtual void decodedSizeChangedTo(const Image*, size_t newSize) { - m_lastDecodedSizeChangedDelta = delta; + m_lastDecodedSizeChangedDelta = safeCast<int>(newSize) - safeCast<int>(m_lastDecodedSize); + m_lastDecodedSize = newSize; } void didDraw(const Image*) override { } bool shouldPauseAnimation(const Image*) override { return false; } @@ -57,6 +61,7 @@ virtual void changedInRect(const Image*, const IntRect&) { } + size_t m_lastDecodedSize; int m_lastDecodedSizeChangedDelta; };
diff --git a/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp b/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp index aac5c704..d273a9a 100644 --- a/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp +++ b/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp
@@ -731,7 +731,7 @@ m_imageBuffer->notifySurfaceInvalid(); CanvasMetrics::countCanvasContextUsage(CanvasMetrics::Accelerated2DCanvasGPUContextLost); } - return m_surface; + return m_surface.get(); } bool Canvas2DLayerBridge::restoreSurface() @@ -766,7 +766,7 @@ if (m_imageBuffer) m_imageBuffer->updateGPUMemoryUsage(); - return m_surface; + return m_surface.get(); } bool Canvas2DLayerBridge::prepareMailbox(WebExternalTextureMailbox* outMailbox, WebExternalBitmap* bitmap)
diff --git a/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.h b/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.h index 0dd0ade..1770b24a 100644 --- a/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.h +++ b/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.h
@@ -115,7 +115,7 @@ void beginDestruction(); void hibernate(); - bool isHibernating() const { return m_hibernationImage; } + bool isHibernating() const { return m_hibernationImage.get(); } PassRefPtr<SkImage> newImageSnapshot(AccelerationHint, SnapshotReason);
diff --git a/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp b/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp index 40d36946..d685919 100644 --- a/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp +++ b/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp
@@ -1124,17 +1124,15 @@ void GraphicsLayer::setFilters(const FilterOperations& filters) { - SkiaImageFilterBuilder builder; OwnPtr<CompositorFilterOperations> webFilters = adoptPtr(CompositorFactory::current().createFilterOperations()); - builder.buildFilterOperations(filters, webFilters.get()); + SkiaImageFilterBuilder::buildFilterOperations(filters, webFilters.get()); m_layer->layer()->setFilters(webFilters->asFilterOperations()); } void GraphicsLayer::setBackdropFilters(const FilterOperations& filters) { - SkiaImageFilterBuilder builder; OwnPtr<CompositorFilterOperations> webFilters = adoptPtr(CompositorFactory::current().createFilterOperations()); - builder.buildFilterOperations(filters, webFilters.get()); + SkiaImageFilterBuilder::buildFilterOperations(filters, webFilters.get()); m_layer->layer()->setBackgroundFilters(webFilters->asFilterOperations()); }
diff --git a/third_party/WebKit/Source/platform/graphics/Image.cpp b/third_party/WebKit/Source/platform/graphics/Image.cpp index 0feceb6..471b7ee4 100644 --- a/third_party/WebKit/Source/platform/graphics/Image.cpp +++ b/third_party/WebKit/Source/platform/graphics/Image.cpp
@@ -51,6 +51,7 @@ Image::Image(ImageObserver* observer) : m_imageObserver(observer) + , m_imageObserverDisabled(false) { }
diff --git a/third_party/WebKit/Source/platform/graphics/Image.h b/third_party/WebKit/Source/platform/graphics/Image.h index 88851568..412b355d 100644 --- a/third_party/WebKit/Source/platform/graphics/Image.h +++ b/third_party/WebKit/Source/platform/graphics/Image.h
@@ -129,8 +129,10 @@ virtual void advanceAnimationForTesting() { } // Typically the ImageResource that owns us. - ImageObserver* getImageObserver() const { return m_imageObserver; } - void setImageObserver(ImageObserver* observer) { m_imageObserver = observer; } + ImageObserver* getImageObserver() const { return m_imageObserverDisabled ? nullptr : m_imageObserver; } + void clearImageObserver() { m_imageObserver = nullptr; } + // Do not call setImageObserverDisabled() other than from ImageObserverDisabler to avoid interleaved accesses to |m_imageObserverDisabled|. + void setImageObserverDisabled(bool disabled) { m_imageObserverDisabled = disabled; } enum TileRule { StretchTile, RoundTile, SpaceTile, RepeatTile }; @@ -163,6 +165,7 @@ // The observer (an ImageResource) is an untraced member, with the ImageResource // being responsible of clearing itself out. UntracedMember<ImageObserver> m_imageObserver; + bool m_imageObserverDisabled; }; #define DEFINE_IMAGE_TYPE_CASTS(typeName) \
diff --git a/third_party/WebKit/Source/platform/graphics/ImageObserver.h b/third_party/WebKit/Source/platform/graphics/ImageObserver.h index 0b585c02..cad7b4b 100644 --- a/third_party/WebKit/Source/platform/graphics/ImageObserver.h +++ b/third_party/WebKit/Source/platform/graphics/ImageObserver.h
@@ -40,7 +40,7 @@ protected: virtual ~ImageObserver(); public: - virtual void decodedSizeChanged(const Image*, int delta) = 0; + virtual void decodedSizeChangedTo(const Image*, size_t newSize) = 0; virtual void didDraw(const Image*) = 0; virtual bool shouldPauseAnimation(const Image*) = 0;
diff --git a/third_party/WebKit/Source/platform/graphics/filters/FEBlend.cpp b/third_party/WebKit/Source/platform/graphics/filters/FEBlend.cpp index db6ffe23..a3f0db1 100644 --- a/third_party/WebKit/Source/platform/graphics/filters/FEBlend.cpp +++ b/third_party/WebKit/Source/platform/graphics/filters/FEBlend.cpp
@@ -55,10 +55,10 @@ return true; } -sk_sp<SkImageFilter> FEBlend::createImageFilter(SkiaImageFilterBuilder& builder) +sk_sp<SkImageFilter> FEBlend::createImageFilter() { - sk_sp<SkImageFilter> foreground(builder.build(inputEffect(0), operatingColorSpace())); - sk_sp<SkImageFilter> background(builder.build(inputEffect(1), operatingColorSpace())); + sk_sp<SkImageFilter> foreground(SkiaImageFilterBuilder::build(inputEffect(0), operatingColorSpace())); + sk_sp<SkImageFilter> background(SkiaImageFilterBuilder::build(inputEffect(1), operatingColorSpace())); sk_sp<SkXfermode> mode(SkXfermode::Make(WebCoreCompositeToSkiaComposite(CompositeSourceOver, m_mode))); SkImageFilter::CropRect cropRect = getCropRect(); return SkXfermodeImageFilter::Make(std::move(mode), std::move(background), std::move(foreground), &cropRect);
diff --git a/third_party/WebKit/Source/platform/graphics/filters/FEBlend.h b/third_party/WebKit/Source/platform/graphics/filters/FEBlend.h index 3cf9bdb32..33d741b 100644 --- a/third_party/WebKit/Source/platform/graphics/filters/FEBlend.h +++ b/third_party/WebKit/Source/platform/graphics/filters/FEBlend.h
@@ -40,7 +40,7 @@ private: FEBlend(Filter*, WebBlendMode); - sk_sp<SkImageFilter> createImageFilter(SkiaImageFilterBuilder&) override; + sk_sp<SkImageFilter> createImageFilter() override; WebBlendMode m_mode; };
diff --git a/third_party/WebKit/Source/platform/graphics/filters/FEBoxReflect.cpp b/third_party/WebKit/Source/platform/graphics/filters/FEBoxReflect.cpp index fcba0d7..824c04f 100644 --- a/third_party/WebKit/Source/platform/graphics/filters/FEBoxReflect.cpp +++ b/third_party/WebKit/Source/platform/graphics/filters/FEBoxReflect.cpp
@@ -34,9 +34,9 @@ return ts; } -sk_sp<SkImageFilter> FEBoxReflect::createImageFilter(SkiaImageFilterBuilder& builder) +sk_sp<SkImageFilter> FEBoxReflect::createImageFilter() { - return SkiaImageFilterBuilder().buildBoxReflectFilter(m_reflection, builder.build(inputEffect(0), operatingColorSpace())); + return SkiaImageFilterBuilder::buildBoxReflectFilter(m_reflection, SkiaImageFilterBuilder::build(inputEffect(0), operatingColorSpace())); } } // namespace blink
diff --git a/third_party/WebKit/Source/platform/graphics/filters/FEBoxReflect.h b/third_party/WebKit/Source/platform/graphics/filters/FEBoxReflect.h index 75d92ee..7d04495 100644 --- a/third_party/WebKit/Source/platform/graphics/filters/FEBoxReflect.h +++ b/third_party/WebKit/Source/platform/graphics/filters/FEBoxReflect.h
@@ -22,7 +22,7 @@ // FilterEffect implementation FloatRect mapRect(const FloatRect&, bool forward = true) const final; TextStream& externalRepresentation(TextStream&, int indentation) const final; - sk_sp<SkImageFilter> createImageFilter(SkiaImageFilterBuilder&) final; + sk_sp<SkImageFilter> createImageFilter() final; private: FEBoxReflect(Filter*, const BoxReflection&);
diff --git a/third_party/WebKit/Source/platform/graphics/filters/FEColorMatrix.cpp b/third_party/WebKit/Source/platform/graphics/filters/FEColorMatrix.cpp index 1d8da7f3..8554cc88 100644 --- a/third_party/WebKit/Source/platform/graphics/filters/FEColorMatrix.cpp +++ b/third_party/WebKit/Source/platform/graphics/filters/FEColorMatrix.cpp
@@ -160,9 +160,9 @@ return m_type == FECOLORMATRIX_TYPE_MATRIX && m_values.size() >= kColorMatrixSize && m_values[19] > 0; } -sk_sp<SkImageFilter> FEColorMatrix::createImageFilter(SkiaImageFilterBuilder& builder) +sk_sp<SkImageFilter> FEColorMatrix::createImageFilter() { - sk_sp<SkImageFilter> input(builder.build(inputEffect(0), operatingColorSpace())); + sk_sp<SkImageFilter> input(SkiaImageFilterBuilder::build(inputEffect(0), operatingColorSpace())); sk_sp<SkColorFilter> filter = createColorFilter(m_type, m_values); SkImageFilter::CropRect rect = getCropRect(); return SkColorFilterImageFilter::Make(std::move(filter), std::move(input), &rect);
diff --git a/third_party/WebKit/Source/platform/graphics/filters/FEColorMatrix.h b/third_party/WebKit/Source/platform/graphics/filters/FEColorMatrix.h index 942db9f..649bb1d 100644 --- a/third_party/WebKit/Source/platform/graphics/filters/FEColorMatrix.h +++ b/third_party/WebKit/Source/platform/graphics/filters/FEColorMatrix.h
@@ -54,7 +54,7 @@ private: FEColorMatrix(Filter*, ColorMatrixType, const Vector<float>&); - sk_sp<SkImageFilter> createImageFilter(SkiaImageFilterBuilder&) override; + sk_sp<SkImageFilter> createImageFilter() override; bool affectsTransparentPixels() override;
diff --git a/third_party/WebKit/Source/platform/graphics/filters/FEComponentTransfer.cpp b/third_party/WebKit/Source/platform/graphics/filters/FEComponentTransfer.cpp index 9fc272f..97b99577 100644 --- a/third_party/WebKit/Source/platform/graphics/filters/FEComponentTransfer.cpp +++ b/third_party/WebKit/Source/platform/graphics/filters/FEComponentTransfer.cpp
@@ -128,9 +128,9 @@ return 255 * intercept >= 1; } -sk_sp<SkImageFilter> FEComponentTransfer::createImageFilter(SkiaImageFilterBuilder& builder) +sk_sp<SkImageFilter> FEComponentTransfer::createImageFilter() { - sk_sp<SkImageFilter> input(builder.build(inputEffect(0), operatingColorSpace())); + sk_sp<SkImageFilter> input(SkiaImageFilterBuilder::build(inputEffect(0), operatingColorSpace())); unsigned char rValues[256], gValues[256], bValues[256], aValues[256]; getValues(rValues, gValues, bValues, aValues);
diff --git a/third_party/WebKit/Source/platform/graphics/filters/FEComponentTransfer.h b/third_party/WebKit/Source/platform/graphics/filters/FEComponentTransfer.h index 0706fad5..35ec40a 100644 --- a/third_party/WebKit/Source/platform/graphics/filters/FEComponentTransfer.h +++ b/third_party/WebKit/Source/platform/graphics/filters/FEComponentTransfer.h
@@ -71,7 +71,7 @@ FEComponentTransfer(Filter*, const ComponentTransferFunction& redFunc, const ComponentTransferFunction& greenFunc, const ComponentTransferFunction& blueFunc, const ComponentTransferFunction& alphaFunc); - sk_sp<SkImageFilter> createImageFilter(SkiaImageFilterBuilder&) override; + sk_sp<SkImageFilter> createImageFilter() override; bool affectsTransparentPixels() override;
diff --git a/third_party/WebKit/Source/platform/graphics/filters/FEComposite.cpp b/third_party/WebKit/Source/platform/graphics/filters/FEComposite.cpp index 4101427..6fd915b 100644 --- a/third_party/WebKit/Source/platform/graphics/filters/FEComposite.cpp +++ b/third_party/WebKit/Source/platform/graphics/filters/FEComposite.cpp
@@ -191,20 +191,20 @@ } } -sk_sp<SkImageFilter> FEComposite::createImageFilter(SkiaImageFilterBuilder& builder) +sk_sp<SkImageFilter> FEComposite::createImageFilter() { - return createImageFilterInternal(builder, true); + return createImageFilterInternal(true); } -sk_sp<SkImageFilter> FEComposite::createImageFilterWithoutValidation(SkiaImageFilterBuilder& builder) +sk_sp<SkImageFilter> FEComposite::createImageFilterWithoutValidation() { - return createImageFilterInternal(builder, false); + return createImageFilterInternal(false); } -sk_sp<SkImageFilter> FEComposite::createImageFilterInternal(SkiaImageFilterBuilder& builder, bool requiresPMColorValidation) +sk_sp<SkImageFilter> FEComposite::createImageFilterInternal(bool requiresPMColorValidation) { - sk_sp<SkImageFilter> foreground(builder.build(inputEffect(0), operatingColorSpace(), !mayProduceInvalidPreMultipliedPixels())); - sk_sp<SkImageFilter> background(builder.build(inputEffect(1), operatingColorSpace(), !mayProduceInvalidPreMultipliedPixels())); + sk_sp<SkImageFilter> foreground(SkiaImageFilterBuilder::build(inputEffect(0), operatingColorSpace(), !mayProduceInvalidPreMultipliedPixels())); + sk_sp<SkImageFilter> background(SkiaImageFilterBuilder::build(inputEffect(1), operatingColorSpace(), !mayProduceInvalidPreMultipliedPixels())); SkImageFilter::CropRect cropRect = getCropRect(); sk_sp<SkXfermode> mode; if (m_type == FECOMPOSITE_OPERATOR_ARITHMETIC)
diff --git a/third_party/WebKit/Source/platform/graphics/filters/FEComposite.h b/third_party/WebKit/Source/platform/graphics/filters/FEComposite.h index 8ea1e33..5a2477a 100644 --- a/third_party/WebKit/Source/platform/graphics/filters/FEComposite.h +++ b/third_party/WebKit/Source/platform/graphics/filters/FEComposite.h
@@ -68,9 +68,9 @@ private: FEComposite(Filter*, const CompositeOperationType&, float, float, float, float); - sk_sp<SkImageFilter> createImageFilter(SkiaImageFilterBuilder&) override; - sk_sp<SkImageFilter> createImageFilterWithoutValidation(SkiaImageFilterBuilder&) override; - sk_sp<SkImageFilter> createImageFilterInternal(SkiaImageFilterBuilder&, bool requiresPMColorValidation); + sk_sp<SkImageFilter> createImageFilter() override; + sk_sp<SkImageFilter> createImageFilterWithoutValidation() override; + sk_sp<SkImageFilter> createImageFilterInternal(bool requiresPMColorValidation); CompositeOperationType m_type; float m_k1;
diff --git a/third_party/WebKit/Source/platform/graphics/filters/FEConvolveMatrix.cpp b/third_party/WebKit/Source/platform/graphics/filters/FEConvolveMatrix.cpp index fd9b8c6..0101f44 100644 --- a/third_party/WebKit/Source/platform/graphics/filters/FEConvolveMatrix.cpp +++ b/third_party/WebKit/Source/platform/graphics/filters/FEConvolveMatrix.cpp
@@ -136,12 +136,12 @@ return true; } -sk_sp<SkImageFilter> FEConvolveMatrix::createImageFilter(SkiaImageFilterBuilder& builder) +sk_sp<SkImageFilter> FEConvolveMatrix::createImageFilter() { if (!parametersValid()) - return createTransparentBlack(builder); + return createTransparentBlack(); - sk_sp<SkImageFilter> input(builder.build(inputEffect(0), operatingColorSpace())); + sk_sp<SkImageFilter> input(SkiaImageFilterBuilder::build(inputEffect(0), operatingColorSpace())); SkISize kernelSize(SkISize::Make(m_kernelSize.width(), m_kernelSize.height())); // parametersValid() above checks that the kernel area fits in int. int numElements = safeCast<int>(m_kernelSize.area());
diff --git a/third_party/WebKit/Source/platform/graphics/filters/FEConvolveMatrix.h b/third_party/WebKit/Source/platform/graphics/filters/FEConvolveMatrix.h index fe20ebc..e12509b 100644 --- a/third_party/WebKit/Source/platform/graphics/filters/FEConvolveMatrix.h +++ b/third_party/WebKit/Source/platform/graphics/filters/FEConvolveMatrix.h
@@ -58,7 +58,7 @@ FEConvolveMatrix(Filter*, const IntSize&, float, float, const IntPoint&, EdgeModeType, bool, const Vector<float>&); - sk_sp<SkImageFilter> createImageFilter(SkiaImageFilterBuilder&) override; + sk_sp<SkImageFilter> createImageFilter() override; bool parametersValid() const;
diff --git a/third_party/WebKit/Source/platform/graphics/filters/FEDisplacementMap.cpp b/third_party/WebKit/Source/platform/graphics/filters/FEDisplacementMap.cpp index ba6ca9b0..cf58054 100644 --- a/third_party/WebKit/Source/platform/graphics/filters/FEDisplacementMap.cpp +++ b/third_party/WebKit/Source/platform/graphics/filters/FEDisplacementMap.cpp
@@ -109,10 +109,10 @@ } } -sk_sp<SkImageFilter> FEDisplacementMap::createImageFilter(SkiaImageFilterBuilder& builder) +sk_sp<SkImageFilter> FEDisplacementMap::createImageFilter() { - sk_sp<SkImageFilter> color = builder.build(inputEffect(0), operatingColorSpace()); - sk_sp<SkImageFilter> displ = builder.build(inputEffect(1), operatingColorSpace()); + sk_sp<SkImageFilter> color = SkiaImageFilterBuilder::build(inputEffect(0), operatingColorSpace()); + sk_sp<SkImageFilter> displ = SkiaImageFilterBuilder::build(inputEffect(1), operatingColorSpace()); SkDisplacementMapEffect::ChannelSelectorType typeX = toSkiaMode(m_xChannelSelector); SkDisplacementMapEffect::ChannelSelectorType typeY = toSkiaMode(m_yChannelSelector); SkImageFilter::CropRect cropRect = getCropRect();
diff --git a/third_party/WebKit/Source/platform/graphics/filters/FEDisplacementMap.h b/third_party/WebKit/Source/platform/graphics/filters/FEDisplacementMap.h index 0e76ef24..40def309 100644 --- a/third_party/WebKit/Source/platform/graphics/filters/FEDisplacementMap.h +++ b/third_party/WebKit/Source/platform/graphics/filters/FEDisplacementMap.h
@@ -57,7 +57,7 @@ private: FEDisplacementMap(Filter*, ChannelSelectorType xChannelSelector, ChannelSelectorType yChannelSelector, float); - sk_sp<SkImageFilter> createImageFilter(SkiaImageFilterBuilder&) override; + sk_sp<SkImageFilter> createImageFilter() override; ChannelSelectorType m_xChannelSelector; ChannelSelectorType m_yChannelSelector;
diff --git a/third_party/WebKit/Source/platform/graphics/filters/FEDropShadow.cpp b/third_party/WebKit/Source/platform/graphics/filters/FEDropShadow.cpp index 60b44e08..919b39e 100644 --- a/third_party/WebKit/Source/platform/graphics/filters/FEDropShadow.cpp +++ b/third_party/WebKit/Source/platform/graphics/filters/FEDropShadow.cpp
@@ -65,9 +65,9 @@ return result; } -sk_sp<SkImageFilter> FEDropShadow::createImageFilter(SkiaImageFilterBuilder& builder) +sk_sp<SkImageFilter> FEDropShadow::createImageFilter() { - sk_sp<SkImageFilter> input(builder.build(inputEffect(0), operatingColorSpace())); + sk_sp<SkImageFilter> input(SkiaImageFilterBuilder::build(inputEffect(0), operatingColorSpace())); float dx = getFilter()->applyHorizontalScale(m_dx); float dy = getFilter()->applyVerticalScale(m_dy); float stdX = getFilter()->applyHorizontalScale(m_stdX);
diff --git a/third_party/WebKit/Source/platform/graphics/filters/FEDropShadow.h b/third_party/WebKit/Source/platform/graphics/filters/FEDropShadow.h index d4c4913c..84fd98a6 100644 --- a/third_party/WebKit/Source/platform/graphics/filters/FEDropShadow.h +++ b/third_party/WebKit/Source/platform/graphics/filters/FEDropShadow.h
@@ -33,7 +33,7 @@ FloatRect mapRect(const FloatRect&, bool forward = true) const final; TextStream& externalRepresentation(TextStream&, int indention) const override; - sk_sp<SkImageFilter> createImageFilter(SkiaImageFilterBuilder&) override; + sk_sp<SkImageFilter> createImageFilter() override; private: FEDropShadow(Filter*, float, float, float, float, const Color&, float);
diff --git a/third_party/WebKit/Source/platform/graphics/filters/FEFlood.cpp b/third_party/WebKit/Source/platform/graphics/filters/FEFlood.cpp index dd3af72..c6f4fa1 100644 --- a/third_party/WebKit/Source/platform/graphics/filters/FEFlood.cpp +++ b/third_party/WebKit/Source/platform/graphics/filters/FEFlood.cpp
@@ -25,7 +25,6 @@ #include "SkColorFilter.h" #include "SkColorFilterImageFilter.h" -#include "platform/graphics/filters/SkiaImageFilterBuilder.h" #include "platform/text/TextStream.h" namespace blink { @@ -69,10 +68,9 @@ return true; } -sk_sp<SkImageFilter> FEFlood::createImageFilter(SkiaImageFilterBuilder& builder) +sk_sp<SkImageFilter> FEFlood::createImageFilter() { Color color = floodColor().combineWithAlpha(floodOpacity()); - SkImageFilter::CropRect rect = getCropRect(); return SkColorFilterImageFilter::Make(SkColorFilter::MakeModeFilter(color.rgb(), SkXfermode::kSrc_Mode), 0, &rect); }
diff --git a/third_party/WebKit/Source/platform/graphics/filters/FEFlood.h b/third_party/WebKit/Source/platform/graphics/filters/FEFlood.h index 5eb969d9..4feacb8 100644 --- a/third_party/WebKit/Source/platform/graphics/filters/FEFlood.h +++ b/third_party/WebKit/Source/platform/graphics/filters/FEFlood.h
@@ -47,7 +47,7 @@ private: FEFlood(Filter*, const Color&, float); - sk_sp<SkImageFilter> createImageFilter(SkiaImageFilterBuilder&) override; + sk_sp<SkImageFilter> createImageFilter() override; Color m_floodColor; float m_floodOpacity;
diff --git a/third_party/WebKit/Source/platform/graphics/filters/FEGaussianBlur.cpp b/third_party/WebKit/Source/platform/graphics/filters/FEGaussianBlur.cpp index 87f6518..c7f5e5f 100644 --- a/third_party/WebKit/Source/platform/graphics/filters/FEGaussianBlur.cpp +++ b/third_party/WebKit/Source/platform/graphics/filters/FEGaussianBlur.cpp
@@ -107,9 +107,9 @@ return outputRect; } -sk_sp<SkImageFilter> FEGaussianBlur::createImageFilter(SkiaImageFilterBuilder& builder) +sk_sp<SkImageFilter> FEGaussianBlur::createImageFilter() { - sk_sp<SkImageFilter> input(builder.build(inputEffect(0), operatingColorSpace())); + sk_sp<SkImageFilter> input(SkiaImageFilterBuilder::build(inputEffect(0), operatingColorSpace())); float stdX = getFilter()->applyHorizontalScale(m_stdX); float stdY = getFilter()->applyVerticalScale(m_stdY); SkImageFilter::CropRect rect = getCropRect();
diff --git a/third_party/WebKit/Source/platform/graphics/filters/FEGaussianBlur.h b/third_party/WebKit/Source/platform/graphics/filters/FEGaussianBlur.h index f026ce2..c68634a 100644 --- a/third_party/WebKit/Source/platform/graphics/filters/FEGaussianBlur.h +++ b/third_party/WebKit/Source/platform/graphics/filters/FEGaussianBlur.h
@@ -41,7 +41,7 @@ private: FEGaussianBlur(Filter*, float, float); - sk_sp<SkImageFilter> createImageFilter(SkiaImageFilterBuilder&) override; + sk_sp<SkImageFilter> createImageFilter() override; float m_stdX; float m_stdY;
diff --git a/third_party/WebKit/Source/platform/graphics/filters/FELighting.cpp b/third_party/WebKit/Source/platform/graphics/filters/FELighting.cpp index dc925dc7..70d588f4 100644 --- a/third_party/WebKit/Source/platform/graphics/filters/FELighting.cpp +++ b/third_party/WebKit/Source/platform/graphics/filters/FELighting.cpp
@@ -58,14 +58,14 @@ return result; } -sk_sp<SkImageFilter> FELighting::createImageFilter(SkiaImageFilterBuilder& builder) +sk_sp<SkImageFilter> FELighting::createImageFilter() { if (!m_lightSource) - return createTransparentBlack(builder); + return createTransparentBlack(); SkImageFilter::CropRect rect = getCropRect(); Color lightColor = adaptColorToOperatingColorSpace(m_lightingColor); - sk_sp<SkImageFilter> input(builder.build(inputEffect(0), operatingColorSpace())); + sk_sp<SkImageFilter> input(SkiaImageFilterBuilder::build(inputEffect(0), operatingColorSpace())); switch (m_lightSource->type()) { case LS_DISTANT: { DistantLightSource* distantLightSource = static_cast<DistantLightSource*>(m_lightSource.get());
diff --git a/third_party/WebKit/Source/platform/graphics/filters/FELighting.h b/third_party/WebKit/Source/platform/graphics/filters/FELighting.h index 649116c..4ce52481 100644 --- a/third_party/WebKit/Source/platform/graphics/filters/FELighting.h +++ b/third_party/WebKit/Source/platform/graphics/filters/FELighting.h
@@ -44,7 +44,7 @@ SpecularLighting }; - sk_sp<SkImageFilter> createImageFilter(SkiaImageFilterBuilder&) override; + sk_sp<SkImageFilter> createImageFilter() override; FloatRect mapPaintRect(const FloatRect&, bool forward = true) const final; bool affectsTransparentPixels() override { return true; }
diff --git a/third_party/WebKit/Source/platform/graphics/filters/FEMerge.cpp b/third_party/WebKit/Source/platform/graphics/filters/FEMerge.cpp index e9381a8..3b1cccd 100644 --- a/third_party/WebKit/Source/platform/graphics/filters/FEMerge.cpp +++ b/third_party/WebKit/Source/platform/graphics/filters/FEMerge.cpp
@@ -39,13 +39,13 @@ return new FEMerge(filter); } -sk_sp<SkImageFilter> FEMerge::createImageFilter(SkiaImageFilterBuilder& builder) +sk_sp<SkImageFilter> FEMerge::createImageFilter() { unsigned size = numberOfEffectInputs(); OwnPtr<sk_sp<SkImageFilter>[]> inputRefs = adoptArrayPtr(new sk_sp<SkImageFilter>[size]); for (unsigned i = 0; i < size; ++i) - inputRefs[i] = builder.build(inputEffect(i), operatingColorSpace()); + inputRefs[i] = SkiaImageFilterBuilder::build(inputEffect(i), operatingColorSpace()); SkImageFilter::CropRect rect = getCropRect(); return SkMergeImageFilter::Make(inputRefs.get(), size, 0, &rect); }
diff --git a/third_party/WebKit/Source/platform/graphics/filters/FEMerge.h b/third_party/WebKit/Source/platform/graphics/filters/FEMerge.h index 4b88677b..2dc84cd 100644 --- a/third_party/WebKit/Source/platform/graphics/filters/FEMerge.h +++ b/third_party/WebKit/Source/platform/graphics/filters/FEMerge.h
@@ -36,7 +36,7 @@ private: explicit FEMerge(Filter*); - sk_sp<SkImageFilter> createImageFilter(SkiaImageFilterBuilder&) override; + sk_sp<SkImageFilter> createImageFilter() override; }; } // namespace blink
diff --git a/third_party/WebKit/Source/platform/graphics/filters/FEMorphology.cpp b/third_party/WebKit/Source/platform/graphics/filters/FEMorphology.cpp index 3e13fe84..c63c6db3 100644 --- a/third_party/WebKit/Source/platform/graphics/filters/FEMorphology.cpp +++ b/third_party/WebKit/Source/platform/graphics/filters/FEMorphology.cpp
@@ -93,9 +93,9 @@ return result; } -sk_sp<SkImageFilter> FEMorphology::createImageFilter(SkiaImageFilterBuilder& builder) +sk_sp<SkImageFilter> FEMorphology::createImageFilter() { - sk_sp<SkImageFilter> input(builder.build(inputEffect(0), operatingColorSpace())); + sk_sp<SkImageFilter> input(SkiaImageFilterBuilder::build(inputEffect(0), operatingColorSpace())); SkScalar radiusX = SkFloatToScalar(getFilter()->applyHorizontalScale(m_radiusX)); SkScalar radiusY = SkFloatToScalar(getFilter()->applyVerticalScale(m_radiusY)); SkImageFilter::CropRect rect = getCropRect();
diff --git a/third_party/WebKit/Source/platform/graphics/filters/FEMorphology.h b/third_party/WebKit/Source/platform/graphics/filters/FEMorphology.h index 8cb82be..9dbddc0 100644 --- a/third_party/WebKit/Source/platform/graphics/filters/FEMorphology.h +++ b/third_party/WebKit/Source/platform/graphics/filters/FEMorphology.h
@@ -52,7 +52,7 @@ private: FEMorphology(Filter*, MorphologyOperatorType, float radiusX, float radiusY); - sk_sp<SkImageFilter> createImageFilter(SkiaImageFilterBuilder&) override; + sk_sp<SkImageFilter> createImageFilter() override; MorphologyOperatorType m_type; float m_radiusX;
diff --git a/third_party/WebKit/Source/platform/graphics/filters/FEOffset.cpp b/third_party/WebKit/Source/platform/graphics/filters/FEOffset.cpp index e5ccfd7..35090177 100644 --- a/third_party/WebKit/Source/platform/graphics/filters/FEOffset.cpp +++ b/third_party/WebKit/Source/platform/graphics/filters/FEOffset.cpp
@@ -73,11 +73,15 @@ return result; } -sk_sp<SkImageFilter> FEOffset::createImageFilter(SkiaImageFilterBuilder& builder) +sk_sp<SkImageFilter> FEOffset::createImageFilter() { Filter* filter = this->getFilter(); SkImageFilter::CropRect cropRect = getCropRect(); - return SkOffsetImageFilter::Make(SkFloatToScalar(filter->applyHorizontalScale(m_dx)), SkFloatToScalar(filter->applyVerticalScale(m_dy)), builder.build(inputEffect(0), operatingColorSpace()), &cropRect); + return SkOffsetImageFilter::Make( + SkFloatToScalar(filter->applyHorizontalScale(m_dx)), + SkFloatToScalar(filter->applyVerticalScale(m_dy)), + SkiaImageFilterBuilder::build(inputEffect(0), operatingColorSpace()), + &cropRect); } TextStream& FEOffset::externalRepresentation(TextStream& ts, int indent) const
diff --git a/third_party/WebKit/Source/platform/graphics/filters/FEOffset.h b/third_party/WebKit/Source/platform/graphics/filters/FEOffset.h index 9b8adcf..17d1bcb 100644 --- a/third_party/WebKit/Source/platform/graphics/filters/FEOffset.h +++ b/third_party/WebKit/Source/platform/graphics/filters/FEOffset.h
@@ -44,7 +44,7 @@ private: FEOffset(Filter*, float dx, float dy); - sk_sp<SkImageFilter> createImageFilter(SkiaImageFilterBuilder&) override; + sk_sp<SkImageFilter> createImageFilter() override; float m_dx; float m_dy;
diff --git a/third_party/WebKit/Source/platform/graphics/filters/FETile.cpp b/third_party/WebKit/Source/platform/graphics/filters/FETile.cpp index 9136fd45..8677ed9 100644 --- a/third_party/WebKit/Source/platform/graphics/filters/FETile.cpp +++ b/third_party/WebKit/Source/platform/graphics/filters/FETile.cpp
@@ -43,9 +43,9 @@ return forward ? maxEffectRect() : inputEffect(0)->maxEffectRect(); } -sk_sp<SkImageFilter> FETile::createImageFilter(SkiaImageFilterBuilder& builder) +sk_sp<SkImageFilter> FETile::createImageFilter() { - sk_sp<SkImageFilter> input(builder.build(inputEffect(0), operatingColorSpace())); + sk_sp<SkImageFilter> input(SkiaImageFilterBuilder::build(inputEffect(0), operatingColorSpace())); FloatRect srcRect = inputEffect(0)->filterPrimitiveSubregion(); FloatRect dstRect = applyEffectBoundaries(getFilter()->filterRegion()); return SkTileImageFilter::Make(srcRect, dstRect, std::move(input));
diff --git a/third_party/WebKit/Source/platform/graphics/filters/FETile.h b/third_party/WebKit/Source/platform/graphics/filters/FETile.h index 99acef0..6569bb5 100644 --- a/third_party/WebKit/Source/platform/graphics/filters/FETile.h +++ b/third_party/WebKit/Source/platform/graphics/filters/FETile.h
@@ -40,7 +40,7 @@ private: FETile(Filter*); - sk_sp<SkImageFilter> createImageFilter(SkiaImageFilterBuilder&) override; + sk_sp<SkImageFilter> createImageFilter() override; }; } // namespace blink
diff --git a/third_party/WebKit/Source/platform/graphics/filters/FETurbulence.cpp b/third_party/WebKit/Source/platform/graphics/filters/FETurbulence.cpp index f307f51..3a60a1d 100644 --- a/third_party/WebKit/Source/platform/graphics/filters/FETurbulence.cpp +++ b/third_party/WebKit/Source/platform/graphics/filters/FETurbulence.cpp
@@ -28,7 +28,6 @@ #include "SkPaintImageFilter.h" #include "SkPerlinNoiseShader.h" #include "platform/graphics/filters/Filter.h" -#include "platform/graphics/filters/SkiaImageFilterBuilder.h" #include "platform/text/TextStream.h" namespace blink { @@ -146,10 +145,10 @@ stitchTiles() ? &size : 0); } -sk_sp<SkImageFilter> FETurbulence::createImageFilter(SkiaImageFilterBuilder& builder) +sk_sp<SkImageFilter> FETurbulence::createImageFilter() { if (m_baseFrequencyX < 0 || m_baseFrequencyY < 0) - return createTransparentBlack(builder); + return createTransparentBlack(); SkPaint paint; paint.setShader(createShader());
diff --git a/third_party/WebKit/Source/platform/graphics/filters/FETurbulence.h b/third_party/WebKit/Source/platform/graphics/filters/FETurbulence.h index 7a06648..a149f83 100644 --- a/third_party/WebKit/Source/platform/graphics/filters/FETurbulence.h +++ b/third_party/WebKit/Source/platform/graphics/filters/FETurbulence.h
@@ -64,7 +64,7 @@ private: FETurbulence(Filter*, TurbulenceType, float, float, int, float, bool); - sk_sp<SkImageFilter> createImageFilter(SkiaImageFilterBuilder&) override; + sk_sp<SkImageFilter> createImageFilter() override; sk_sp<SkShader> createShader() const; TurbulenceType m_type;
diff --git a/third_party/WebKit/Source/platform/graphics/filters/FilterEffect.cpp b/third_party/WebKit/Source/platform/graphics/filters/FilterEffect.cpp index c92c651c..c47d9d99 100644 --- a/third_party/WebKit/Source/platform/graphics/filters/FilterEffect.cpp +++ b/third_party/WebKit/Source/platform/graphics/filters/FilterEffect.cpp
@@ -189,14 +189,14 @@ return subregion; } -sk_sp<SkImageFilter> FilterEffect::createImageFilter(SkiaImageFilterBuilder&) +sk_sp<SkImageFilter> FilterEffect::createImageFilter() { return nullptr; } -sk_sp<SkImageFilter> FilterEffect::createImageFilterWithoutValidation(SkiaImageFilterBuilder& builder) +sk_sp<SkImageFilter> FilterEffect::createImageFilterWithoutValidation() { - return createImageFilter(builder); + return createImageFilter(); } bool FilterEffect::inputsTaintOrigin() const @@ -208,7 +208,7 @@ return false; } -sk_sp<SkImageFilter> FilterEffect::createTransparentBlack(SkiaImageFilterBuilder& builder) const +sk_sp<SkImageFilter> FilterEffect::createTransparentBlack() const { SkImageFilter::CropRect rect = getCropRect(); sk_sp<SkColorFilter> colorFilter = SkColorFilter::MakeModeFilter(0, SkXfermode::kClear_Mode);
diff --git a/third_party/WebKit/Source/platform/graphics/filters/FilterEffect.h b/third_party/WebKit/Source/platform/graphics/filters/FilterEffect.h index 0c9f24c3..4e3d9053 100644 --- a/third_party/WebKit/Source/platform/graphics/filters/FilterEffect.h +++ b/third_party/WebKit/Source/platform/graphics/filters/FilterEffect.h
@@ -41,8 +41,6 @@ class FilterEffect; class TextStream; -class SkiaImageFilterBuilder; - typedef HeapVector<Member<FilterEffect>> FilterEffectVector; enum FilterEffectType { @@ -82,8 +80,8 @@ FloatRect maxEffectRect() const { return m_maxEffectRect; } void setMaxEffectRect(const FloatRect& maxEffectRect) { m_maxEffectRect = maxEffectRect; } - virtual sk_sp<SkImageFilter> createImageFilter(SkiaImageFilterBuilder&); - virtual sk_sp<SkImageFilter> createImageFilterWithoutValidation(SkiaImageFilterBuilder&); + virtual sk_sp<SkImageFilter> createImageFilter(); + virtual sk_sp<SkImageFilter> createImageFilterWithoutValidation(); // Mapping a rect forwards determines which which destination pixels a // given source rect would affect. Mapping a rect backwards determines @@ -156,7 +154,7 @@ protected: FilterEffect(Filter*); - sk_sp<SkImageFilter> createTransparentBlack(SkiaImageFilterBuilder&) const; + sk_sp<SkImageFilter> createTransparentBlack() const; Color adaptColorToOperatingColorSpace(const Color& deviceColor);
diff --git a/third_party/WebKit/Source/platform/graphics/filters/ImageFilterBuilderTest.cpp b/third_party/WebKit/Source/platform/graphics/filters/ImageFilterBuilderTest.cpp index 8700e1e5..3762ae7 100644 --- a/third_party/WebKit/Source/platform/graphics/filters/ImageFilterBuilderTest.cpp +++ b/third_party/WebKit/Source/platform/graphics/filters/ImageFilterBuilderTest.cpp
@@ -71,8 +71,7 @@ referenceFilter->setLastEffect(mergeEffect); // Get SkImageFilter resulting tree - SkiaImageFilterBuilder builder; - sk_sp<SkImageFilter> filter = builder.build(referenceFilter->lastEffect(), ColorSpaceDeviceRGB); + sk_sp<SkImageFilter> filter = SkiaImageFilterBuilder::build(referenceFilter->lastEffect(), ColorSpaceDeviceRGB); // Let's check that the resulting tree looks like this : // ColorSpace (Linear->Device) : CS (L->D)
diff --git a/third_party/WebKit/Source/platform/graphics/filters/PaintFilterEffect.cpp b/third_party/WebKit/Source/platform/graphics/filters/PaintFilterEffect.cpp index 4a8997a..21f2d6971 100644 --- a/third_party/WebKit/Source/platform/graphics/filters/PaintFilterEffect.cpp +++ b/third_party/WebKit/Source/platform/graphics/filters/PaintFilterEffect.cpp
@@ -26,7 +26,7 @@ return new PaintFilterEffect(filter, paint); } -sk_sp<SkImageFilter> PaintFilterEffect::createImageFilter(SkiaImageFilterBuilder&) +sk_sp<SkImageFilter> PaintFilterEffect::createImageFilter() { return SkPaintImageFilter::Make(m_paint, nullptr); }
diff --git a/third_party/WebKit/Source/platform/graphics/filters/PaintFilterEffect.h b/third_party/WebKit/Source/platform/graphics/filters/PaintFilterEffect.h index fdee14dc4..cde2cd26 100644 --- a/third_party/WebKit/Source/platform/graphics/filters/PaintFilterEffect.h +++ b/third_party/WebKit/Source/platform/graphics/filters/PaintFilterEffect.h
@@ -18,7 +18,7 @@ FilterEffectType getFilterEffectType() const override { return FilterEffectTypeSourceInput; } TextStream& externalRepresentation(TextStream&, int indention) const override; - sk_sp<SkImageFilter> createImageFilter(SkiaImageFilterBuilder&) override; + sk_sp<SkImageFilter> createImageFilter() override; private: PaintFilterEffect(Filter*, const SkPaint&);
diff --git a/third_party/WebKit/Source/platform/graphics/filters/SkiaImageFilterBuilder.cpp b/third_party/WebKit/Source/platform/graphics/filters/SkiaImageFilterBuilder.cpp index 8c6bde0..31c9bb7a 100644 --- a/third_party/WebKit/Source/platform/graphics/filters/SkiaImageFilterBuilder.cpp +++ b/third_party/WebKit/Source/platform/graphics/filters/SkiaImageFilterBuilder.cpp
@@ -31,6 +31,7 @@ #include "SkTableColorFilter.h" #include "platform/geometry/IntPoint.h" #include "platform/graphics/BoxReflection.h" +#include "platform/graphics/CompositorFilterOperations.h" #include "platform/graphics/filters/FilterEffect.h" #include "platform/graphics/filters/FilterOperations.h" #include "platform/graphics/filters/SourceGraphic.h" @@ -39,12 +40,9 @@ #include "third_party/skia/include/effects/SkXfermodeImageFilter.h" namespace blink { +namespace SkiaImageFilterBuilder { -SkiaImageFilterBuilder::~SkiaImageFilterBuilder() -{ -} - -sk_sp<SkImageFilter> SkiaImageFilterBuilder::build(FilterEffect* effect, ColorSpace colorSpace, bool destinationRequiresValidPreMultipliedPixels) +sk_sp<SkImageFilter> build(FilterEffect* effect, ColorSpace colorSpace, bool destinationRequiresValidPreMultipliedPixels) { if (!effect) return nullptr; @@ -55,7 +53,7 @@ return sk_ref_sp(filter); // Note that we may still need the color transform even if the filter is null - sk_sp<SkImageFilter> origFilter = requiresPMColorValidation ? effect->createImageFilter(*this) : effect->createImageFilterWithoutValidation(*this); + sk_sp<SkImageFilter> origFilter = requiresPMColorValidation ? effect->createImageFilter() : effect->createImageFilterWithoutValidation(); sk_sp<SkImageFilter> filter = transformColorSpace(origFilter, effect->operatingColorSpace(), colorSpace); effect->setImageFilter(colorSpace, requiresPMColorValidation, filter); if (filter.get() != origFilter.get()) @@ -63,9 +61,8 @@ return filter; } -sk_sp<SkImageFilter> SkiaImageFilterBuilder::transformColorSpace( - sk_sp<SkImageFilter> input, ColorSpace srcColorSpace, ColorSpace dstColorSpace) { - +sk_sp<SkImageFilter> transformColorSpace(sk_sp<SkImageFilter> input, ColorSpace srcColorSpace, ColorSpace dstColorSpace) +{ sk_sp<SkColorFilter> colorFilter = toSkSp(ColorSpaceUtilities::createColorSpaceFilter(srcColorSpace, dstColorSpace)); if (!colorFilter) return input; @@ -73,7 +70,7 @@ return SkColorFilterImageFilter::Make(std::move(colorFilter), std::move(input)); } -void SkiaImageFilterBuilder::buildFilterOperations(const FilterOperations& operations, CompositorFilterOperations* filters) +void buildFilterOperations(const FilterOperations& operations, CompositorFilterOperations* filters) { ColorSpace currentColorSpace = ColorSpaceDeviceRGB; @@ -178,12 +175,12 @@ } } -sk_sp<SkImageFilter> SkiaImageFilterBuilder::buildTransform(const AffineTransform& transform, sk_sp<SkImageFilter> input) +sk_sp<SkImageFilter> buildTransform(const AffineTransform& transform, sk_sp<SkImageFilter> input) { return SkImageFilter::MakeMatrixFilter(affineTransformToSkMatrix(transform), kHigh_SkFilterQuality, std::move(input)); } -sk_sp<SkImageFilter> SkiaImageFilterBuilder::buildBoxReflectFilter(const BoxReflection& reflection, sk_sp<SkImageFilter> input) +sk_sp<SkImageFilter> buildBoxReflectFilter(const BoxReflection& reflection, sk_sp<SkImageFilter> input) { sk_sp<SkImageFilter> maskedInput = input; // TODO(jbroman): If a mask image is provided, mask! @@ -193,4 +190,5 @@ return SkXfermodeImageFilter::Make(nullptr, std::move(flipImageFilter), std::move(input), nullptr); } +} // namespace SkiaImageFilterBuilder } // namespace blink
diff --git a/third_party/WebKit/Source/platform/graphics/filters/SkiaImageFilterBuilder.h b/third_party/WebKit/Source/platform/graphics/filters/SkiaImageFilterBuilder.h index f8e15440..def22c4 100644 --- a/third_party/WebKit/Source/platform/graphics/filters/SkiaImageFilterBuilder.h +++ b/third_party/WebKit/Source/platform/graphics/filters/SkiaImageFilterBuilder.h
@@ -27,11 +27,8 @@ #define SkiaImageFilterBuilder_h #include "platform/PlatformExport.h" -#include "platform/geometry/FloatSize.h" #include "platform/graphics/ColorSpace.h" -#include "platform/graphics/CompositorFilterOperations.h" -#include "platform/graphics/GraphicsTypes.h" -#include "platform/heap/Handle.h" +#include "third_party/skia/include/core/SkRefCnt.h" class SkImageFilter; @@ -39,25 +36,23 @@ class AffineTransform; class BoxReflection; +class CompositorFilterOperations; class FilterEffect; class FilterOperations; class Image; -class PLATFORM_EXPORT SkiaImageFilterBuilder { - STACK_ALLOCATED(); -public: - ~SkiaImageFilterBuilder(); +namespace SkiaImageFilterBuilder { - sk_sp<SkImageFilter> build(FilterEffect*, ColorSpace, bool requiresPMColorValidation = true); - void buildFilterOperations(const FilterOperations&, CompositorFilterOperations*); - sk_sp<SkImageFilter> buildTransform(const AffineTransform&, sk_sp<SkImageFilter> input); +PLATFORM_EXPORT sk_sp<SkImageFilter> build(FilterEffect*, ColorSpace, bool requiresPMColorValidation = true); +PLATFORM_EXPORT void buildFilterOperations(const FilterOperations&, CompositorFilterOperations*); +PLATFORM_EXPORT sk_sp<SkImageFilter> buildTransform(const AffineTransform&, sk_sp<SkImageFilter> input); - sk_sp<SkImageFilter> transformColorSpace( - sk_sp<SkImageFilter> input, ColorSpace srcColorSpace, ColorSpace dstColorSpace); +PLATFORM_EXPORT sk_sp<SkImageFilter> transformColorSpace( + sk_sp<SkImageFilter> input, ColorSpace srcColorSpace, ColorSpace dstColorSpace); - sk_sp<SkImageFilter> buildBoxReflectFilter(const BoxReflection&, sk_sp<SkImageFilter> input); -}; +PLATFORM_EXPORT sk_sp<SkImageFilter> buildBoxReflectFilter(const BoxReflection&, sk_sp<SkImageFilter> input); +} // namespace SkiaImageFilterBuilder } // namespace blink #endif
diff --git a/third_party/WebKit/Source/platform/graphics/filters/SourceAlpha.cpp b/third_party/WebKit/Source/platform/graphics/filters/SourceAlpha.cpp index 9d84f3b9..50e211f 100644 --- a/third_party/WebKit/Source/platform/graphics/filters/SourceAlpha.cpp +++ b/third_party/WebKit/Source/platform/graphics/filters/SourceAlpha.cpp
@@ -46,9 +46,9 @@ return inputEffect(0)->determineAbsolutePaintRect(requestedRect); } -sk_sp<SkImageFilter> SourceAlpha::createImageFilter(SkiaImageFilterBuilder& builder) +sk_sp<SkImageFilter> SourceAlpha::createImageFilter() { - sk_sp<SkImageFilter> sourceGraphic(builder.build(inputEffect(0), operatingColorSpace())); + sk_sp<SkImageFilter> sourceGraphic(SkiaImageFilterBuilder::build(inputEffect(0), operatingColorSpace())); SkScalar matrix[20] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
diff --git a/third_party/WebKit/Source/platform/graphics/filters/SourceAlpha.h b/third_party/WebKit/Source/platform/graphics/filters/SourceAlpha.h index 47e4c57..9286af7 100644 --- a/third_party/WebKit/Source/platform/graphics/filters/SourceAlpha.h +++ b/third_party/WebKit/Source/platform/graphics/filters/SourceAlpha.h
@@ -34,7 +34,7 @@ FilterEffectType getFilterEffectType() const override { return FilterEffectTypeSourceInput; } TextStream& externalRepresentation(TextStream&, int indention) const override; - sk_sp<SkImageFilter> createImageFilter(SkiaImageFilterBuilder&) override; + sk_sp<SkImageFilter> createImageFilter() override; private: explicit SourceAlpha(FilterEffect*);
diff --git a/third_party/WebKit/Source/platform/graphics/filters/SourceGraphic.cpp b/third_party/WebKit/Source/platform/graphics/filters/SourceGraphic.cpp index 8725011..0bb57bc 100644 --- a/third_party/WebKit/Source/platform/graphics/filters/SourceGraphic.cpp +++ b/third_party/WebKit/Source/platform/graphics/filters/SourceGraphic.cpp
@@ -59,7 +59,7 @@ m_sourceRect = sourceRect; } -sk_sp<SkImageFilter> SourceGraphic::createImageFilter(SkiaImageFilterBuilder&) +sk_sp<SkImageFilter> SourceGraphic::createImageFilter() { if (!m_picture) return nullptr;
diff --git a/third_party/WebKit/Source/platform/graphics/filters/SourceGraphic.h b/third_party/WebKit/Source/platform/graphics/filters/SourceGraphic.h index 3aec12e..63dd82d 100644 --- a/third_party/WebKit/Source/platform/graphics/filters/SourceGraphic.h +++ b/third_party/WebKit/Source/platform/graphics/filters/SourceGraphic.h
@@ -39,7 +39,7 @@ FilterEffectType getFilterEffectType() const override { return FilterEffectTypeSourceInput; } TextStream& externalRepresentation(TextStream&, int indention) const override; - sk_sp<SkImageFilter> createImageFilter(SkiaImageFilterBuilder&) override; + sk_sp<SkImageFilter> createImageFilter() override; void setPicture(sk_sp<SkPicture>); void setSourceRect(const IntRect&);
diff --git a/third_party/WebKit/Source/platform/graphics/paint/DrawingDisplayItem.cpp b/third_party/WebKit/Source/platform/graphics/paint/DrawingDisplayItem.cpp index c291fdac..626fffb 100644 --- a/third_party/WebKit/Source/platform/graphics/paint/DrawingDisplayItem.cpp +++ b/third_party/WebKit/Source/platform/graphics/paint/DrawingDisplayItem.cpp
@@ -30,7 +30,7 @@ bool DrawingDisplayItem::drawsContent() const { - return m_picture; + return m_picture.get(); } #ifndef NDEBUG
diff --git a/third_party/WebKit/Source/platform/network/ResourceLoadTiming.cpp b/third_party/WebKit/Source/platform/network/ResourceLoadTiming.cpp index 4dabcad..41f97e9 100644 --- a/third_party/WebKit/Source/platform/network/ResourceLoadTiming.cpp +++ b/third_party/WebKit/Source/platform/network/ResourceLoadTiming.cpp
@@ -23,6 +23,8 @@ , m_receiveHeadersEnd(0) , m_sslStart(0) , m_sslEnd(0) + , m_pushStart(0) + , m_pushEnd(0) { } @@ -48,6 +50,8 @@ timing->m_receiveHeadersEnd = m_receiveHeadersEnd; timing->m_sslStart = m_sslStart; timing->m_sslEnd = m_sslEnd; + timing->m_pushStart = m_pushStart; + timing->m_pushEnd = m_pushEnd; return timing.release(); } @@ -66,7 +70,9 @@ && m_sendEnd == other.m_sendEnd && m_receiveHeadersEnd == other.m_receiveHeadersEnd && m_sslStart == other.m_sslStart - && m_sslEnd == other.m_sslEnd; + && m_sslEnd == other.m_sslEnd + && m_pushStart == other.m_pushStart + && m_pushEnd == other.m_pushEnd; } bool ResourceLoadTiming::operator!=(const ResourceLoadTiming& other) const @@ -145,6 +151,16 @@ m_sslEnd = sslEnd; } +void ResourceLoadTiming::setPushStart(double pushStart) +{ + m_pushStart = pushStart; +} + +void ResourceLoadTiming::setPushEnd(double pushEnd) +{ + m_pushEnd = pushEnd; +} + double ResourceLoadTiming::calculateMillisecondDelta(double time) const { return time ? (time - m_requestTime) * 1000 : -1;
diff --git a/third_party/WebKit/Source/platform/network/ResourceLoadTiming.h b/third_party/WebKit/Source/platform/network/ResourceLoadTiming.h index 9e0d613c..834f18d 100644 --- a/third_party/WebKit/Source/platform/network/ResourceLoadTiming.h +++ b/third_party/WebKit/Source/platform/network/ResourceLoadTiming.h
@@ -55,6 +55,8 @@ void setReceiveHeadersEnd(double); void setSslStart(double); void setSslEnd(double); + void setPushStart(double); + void setPushEnd(double); double dnsStart() const { return m_dnsStart; } double requestTime() const { return m_requestTime; } @@ -70,6 +72,8 @@ double receiveHeadersEnd() const { return m_receiveHeadersEnd; } double sslStart() const { return m_sslStart; } double sslEnd() const { return m_sslEnd; } + double pushStart() const { return m_pushStart; } + double pushEnd() const { return m_pushEnd; } double calculateMillisecondDelta(double) const; @@ -97,6 +101,8 @@ double m_receiveHeadersEnd; double m_sslStart; double m_sslEnd; + double m_pushStart; + double m_pushEnd; }; } // namespace blink
diff --git a/third_party/WebKit/Source/platform/testing/WebLayerTreeViewImplForTesting.h b/third_party/WebKit/Source/platform/testing/WebLayerTreeViewImplForTesting.h index eb3657d8..648c033 100644 --- a/third_party/WebKit/Source/platform/testing/WebLayerTreeViewImplForTesting.h +++ b/third_party/WebKit/Source/platform/testing/WebLayerTreeViewImplForTesting.h
@@ -88,10 +88,6 @@ void DidCommitAndDrawFrame() override {} void DidCompleteSwapBuffers() override {} void DidCompletePageScaleAnimation() override {} - void RecordFrameTimingEvents( - std::unique_ptr<cc::FrameTimingTracker::CompositeTimingSet> compositeEvents, - std::unique_ptr<cc::FrameTimingTracker::MainFrameTimingSet> mainFrameEvents) - override {} // cc::LayerTreeHostSingleThreadClient implementation. void DidPostSwapBuffers() override {}
diff --git a/third_party/WebKit/Source/platform/text/Character.cpp b/third_party/WebKit/Source/platform/text/Character.cpp index d59ae41b..50932bd 100644 --- a/third_party/WebKit/Source/platform/text/Character.cpp +++ b/third_party/WebKit/Source/platform/text/Character.cpp
@@ -37,7 +37,7 @@ #include <unicode/uscript.h> #if defined(USING_SYSTEM_ICU) -#include "platform/fonts/CharacterPropertyDataGenerator.h" +#include "platform/text/CharacterPropertyDataGenerator.h" #include <unicode/uniset.h> #else #define MUTEX_H // Prevent compile failure of utrie2.h on Windows
diff --git a/third_party/WebKit/Source/platform/text/DateTimeFormatTest.cpp b/third_party/WebKit/Source/platform/text/DateTimeFormatTest.cpp index 11c1bd48..cacbd786 100644 --- a/third_party/WebKit/Source/platform/text/DateTimeFormatTest.cpp +++ b/third_party/WebKit/Source/platform/text/DateTimeFormatTest.cpp
@@ -25,9 +25,6 @@ #include "platform/text/DateTimeFormat.h" -#include "wtf/build_config.h" - -#if ENABLE(INPUT_MULTIPLE_FIELDS_UI) #include "testing/gtest/include/gtest/gtest.h" #include "wtf/text/CString.h" #include "wtf/text/StringBuilder.h" @@ -336,5 +333,3 @@ } } // namespace blink - -#endif
diff --git a/third_party/WebKit/Source/platform/text/LocaleICUTest.cpp b/third_party/WebKit/Source/platform/text/LocaleICUTest.cpp index 10a9305..729f0b2 100644 --- a/third_party/WebKit/Source/platform/text/LocaleICUTest.cpp +++ b/third_party/WebKit/Source/platform/text/LocaleICUTest.cpp
@@ -87,7 +87,6 @@ return Labels(labels); } -#if ENABLE(INPUT_MULTIPLE_FIELDS_UI) String monthFormat(const char* localeString) { OwnPtr<LocaleICU> locale = LocaleICU::create(localeString); @@ -135,7 +134,6 @@ OwnPtr<LocaleICU> locale = LocaleICU::create(localeString); return locale->isRTL(); } -#endif }; std::ostream& operator<<(std::ostream& os, const LocaleICUTest::Labels& labels) @@ -143,7 +141,6 @@ return os << labels.toString().utf8().data(); } -#if ENABLE(INPUT_MULTIPLE_FIELDS_UI) TEST_F(LocaleICUTest, isRTL) { EXPECT_TRUE(isRTL("ar-EG")); @@ -249,7 +246,6 @@ EXPECT_EQ(String("."), testDecimalSeparator("en_US")); EXPECT_EQ(String(","), testDecimalSeparator("fr")); } -#endif void testNumberIsReversible(const AtomicString& localeIdentifier, const char* original, const char* shouldHave = 0) {
diff --git a/third_party/WebKit/Source/platform/text/LocaleMacTest.cpp b/third_party/WebKit/Source/platform/text/LocaleMacTest.cpp index 8152bc9c..06fc799d 100644 --- a/third_party/WebKit/Source/platform/text/LocaleMacTest.cpp +++ b/third_party/WebKit/Source/platform/text/LocaleMacTest.cpp
@@ -132,7 +132,6 @@ return locale->isRTL(); } -#if ENABLE(INPUT_MULTIPLE_FIELDS_UI) String monthFormat(const String& localeString) { OwnPtr<LocaleMac> locale = LocaleMac::create(localeString); @@ -180,7 +179,6 @@ OwnPtr<LocaleMac> locale = LocaleMac::create(localeString); return locale->localizedDecimalSeparator(); } -#endif }; TEST_F(LocaleMacTest, formatWeek) @@ -274,7 +272,6 @@ EXPECT_FALSE(isRTL("**invalid**")); } -#if ENABLE(INPUT_MULTIPLE_FIELDS_UI) TEST_F(LocaleMacTest, monthFormat) { EXPECT_STREQ("MMMM yyyy", monthFormat("en_US").utf8().data()); @@ -355,7 +352,6 @@ EXPECT_STREQ(".", decimalSeparator("en_US").utf8().data()); EXPECT_STREQ(",", decimalSeparator("fr_FR").utf8().data()); } -#endif TEST_F(LocaleMacTest, invalidLocale) {
diff --git a/third_party/WebKit/Source/platform/text/LocaleWinTest.cpp b/third_party/WebKit/Source/platform/text/LocaleWinTest.cpp index a4ebc278..898fe5b 100644 --- a/third_party/WebKit/Source/platform/text/LocaleWinTest.cpp +++ b/third_party/WebKit/Source/platform/text/LocaleWinTest.cpp
@@ -112,7 +112,6 @@ return locale->isRTL(); } -#if ENABLE(INPUT_MULTIPLE_FIELDS_UI) String monthFormat(LCID lcid) { OwnPtr<LocaleWin> locale = LocaleWin::create(lcid, true /* defaultsForLocale */); @@ -148,7 +147,6 @@ OwnPtr<LocaleWin> locale = LocaleWin::create(lcid, true /* defaultsForLocale */); return locale->localizedDecimalSeparator(); } -#endif }; TEST_F(LocaleWinTest, formatDate) @@ -201,7 +199,6 @@ EXPECT_FALSE(isRTL(EnglishUS)); } -#if ENABLE(INPUT_MULTIPLE_FIELDS_UI) TEST_F(LocaleWinTest, dateFormat) { EXPECT_STREQ("y-M-d", LocaleWin::dateFormat("y-M-d").utf8().data()); @@ -261,7 +258,6 @@ EXPECT_STREQ(".", decimalSeparator(EnglishUS).utf8().data()); EXPECT_STREQ(",", decimalSeparator(FrenchFR).utf8().data()); } -#endif static void testNumberIsReversible(LCID lcid, const char* original, const char* shouldHave = 0) {
diff --git a/third_party/WebKit/Source/platform/text/PlatformLocale.cpp b/third_party/WebKit/Source/platform/text/PlatformLocale.cpp index 782e18c1..99b7fd7c 100644 --- a/third_party/WebKit/Source/platform/text/PlatformLocale.cpp +++ b/third_party/WebKit/Source/platform/text/PlatformLocale.cpp
@@ -413,13 +413,11 @@ return builder.toString(); } -#if ENABLE(INPUT_MULTIPLE_FIELDS_UI) String Locale::localizedDecimalSeparator() { initializeLocaleData(); return m_decimalSymbols[DecimalSeparatorIndex]; } -#endif String Locale::formatDateTime(const DateComponents& date, FormatType formatType) {
diff --git a/third_party/WebKit/Source/platform/text/PlatformLocale.h b/third_party/WebKit/Source/platform/text/PlatformLocale.h index 4bcc4e9..d9189bb8f 100644 --- a/third_party/WebKit/Source/platform/text/PlatformLocale.h +++ b/third_party/WebKit/Source/platform/text/PlatformLocale.h
@@ -65,10 +65,8 @@ // locale-specific number characters and |standardChars|. String stripInvalidNumberCharacters(const String& input, const String& standardChars) const; -#if ENABLE(INPUT_MULTIPLE_FIELDS_UI) // Returns localized decimal separator, e.g. "." for English, "," for French. String localizedDecimalSeparator(); -#endif // Returns date format in Unicode TR35 LDML[1] containing day of month, // month, and year, e.g. "dd/mm/yyyy"
diff --git a/third_party/WebKit/Source/web/BUILD.gn b/third_party/WebKit/Source/web/BUILD.gn index 149c162..7ac3456 100644 --- a/third_party/WebKit/Source/web/BUILD.gn +++ b/third_party/WebKit/Source/web/BUILD.gn
@@ -103,7 +103,7 @@ "//third_party/WebKit/Source/modules", "//third_party/WebKit/Source/platform:test_support", "//third_party/WebKit/Source/wtf", - "//third_party/WebKit/public:mojo_bindings_blink", + "//third_party/WebKit/public:mojo_bindings_wtf", "//third_party/libwebp", "//third_party/zlib", "//url",
diff --git a/third_party/WebKit/Source/web/WorkerGlobalScopeProxyProviderImpl.cpp b/third_party/WebKit/Source/web/DedicatedWorkerGlobalScopeProxyProviderImpl.cpp similarity index 94% rename from third_party/WebKit/Source/web/WorkerGlobalScopeProxyProviderImpl.cpp rename to third_party/WebKit/Source/web/DedicatedWorkerGlobalScopeProxyProviderImpl.cpp index e99962e..c9a6881 100644 --- a/third_party/WebKit/Source/web/WorkerGlobalScopeProxyProviderImpl.cpp +++ b/third_party/WebKit/Source/web/DedicatedWorkerGlobalScopeProxyProviderImpl.cpp
@@ -28,7 +28,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "web/WorkerGlobalScopeProxyProviderImpl.h" +#include "web/DedicatedWorkerGlobalScopeProxyProviderImpl.h" #include "core/dom/Document.h" #include "core/workers/DedicatedWorkerMessagingProxy.h" @@ -46,7 +46,7 @@ namespace blink { -WorkerGlobalScopeProxy* WorkerGlobalScopeProxyProviderImpl::createWorkerGlobalScopeProxy(Worker* worker) +InProcessWorkerGlobalScopeProxy* DedicatedWorkerGlobalScopeProxyProviderImpl::createWorkerGlobalScopeProxy(Worker* worker) { if (worker->getExecutionContext()->isDocument()) { Document* document = toDocument(worker->getExecutionContext());
diff --git a/third_party/WebKit/Source/web/WorkerGlobalScopeProxyProviderImpl.h b/third_party/WebKit/Source/web/DedicatedWorkerGlobalScopeProxyProviderImpl.h similarity index 63% rename from third_party/WebKit/Source/web/WorkerGlobalScopeProxyProviderImpl.h rename to third_party/WebKit/Source/web/DedicatedWorkerGlobalScopeProxyProviderImpl.h index d24ef060..8ed01a7 100644 --- a/third_party/WebKit/Source/web/WorkerGlobalScopeProxyProviderImpl.h +++ b/third_party/WebKit/Source/web/DedicatedWorkerGlobalScopeProxyProviderImpl.h
@@ -28,36 +28,35 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef WorkerGlobalScopeProxyProviderImpl_h -#define WorkerGlobalScopeProxyProviderImpl_h +#ifndef DedicatedWorkerGlobalScopeProxyProviderImpl_h +#define DedicatedWorkerGlobalScopeProxyProviderImpl_h -#include "core/workers/WorkerGlobalScopeProxyProvider.h" +#include "core/workers/DedicatedWorkerGlobalScopeProxyProvider.h" #include "wtf/Noncopyable.h" #include "wtf/PassOwnPtr.h" namespace blink { -class Worker; -class WorkerGlobalScopeProxy; - -class WorkerGlobalScopeProxyProviderImpl final : public GarbageCollectedFinalized<WorkerGlobalScopeProxyProviderImpl>, public WorkerGlobalScopeProxyProvider { - USING_GARBAGE_COLLECTED_MIXIN(WorkerGlobalScopeProxyProviderImpl); - WTF_MAKE_NONCOPYABLE(WorkerGlobalScopeProxyProviderImpl); +class DedicatedWorkerGlobalScopeProxyProviderImpl final + : public GarbageCollectedFinalized<DedicatedWorkerGlobalScopeProxyProviderImpl> + , public DedicatedWorkerGlobalScopeProxyProvider { + USING_GARBAGE_COLLECTED_MIXIN(DedicatedWorkerGlobalScopeProxyProviderImpl); + WTF_MAKE_NONCOPYABLE(DedicatedWorkerGlobalScopeProxyProviderImpl); public: - static WorkerGlobalScopeProxyProviderImpl* create() + static DedicatedWorkerGlobalScopeProxyProviderImpl* create() { - return new WorkerGlobalScopeProxyProviderImpl(); + return new DedicatedWorkerGlobalScopeProxyProviderImpl(); } - ~WorkerGlobalScopeProxyProviderImpl() override { } - WorkerGlobalScopeProxy* createWorkerGlobalScopeProxy(Worker*) override; + ~DedicatedWorkerGlobalScopeProxyProviderImpl() override { } + InProcessWorkerGlobalScopeProxy* createWorkerGlobalScopeProxy(Worker*) override; - DEFINE_INLINE_VIRTUAL_TRACE() { WorkerGlobalScopeProxyProvider::trace(visitor); } + DEFINE_INLINE_VIRTUAL_TRACE() { DedicatedWorkerGlobalScopeProxyProvider::trace(visitor); } private: - WorkerGlobalScopeProxyProviderImpl() { } + DedicatedWorkerGlobalScopeProxyProviderImpl() { } }; } // namespace blink -#endif // WorkerGlobalScopeProxyProviderImpl_h +#endif // DedicatedWorkerGlobalScopeProxyProviderImpl_h
diff --git a/third_party/WebKit/Source/web/InspectorOverlay.cpp b/third_party/WebKit/Source/web/InspectorOverlay.cpp index 33b55338..7f1d166 100644 --- a/third_party/WebKit/Source/web/InspectorOverlay.cpp +++ b/third_party/WebKit/Source/web/InspectorOverlay.cpp
@@ -589,6 +589,11 @@ m_inspectMode = InspectorDOMAgent::NotSearching; m_timer.stop(); hideHighlight(); + + m_debuggerAgent.clear(); + m_domAgent.clear(); + m_cssAgent.clear(); + m_overlayHost->setListener(nullptr); } void InspectorOverlay::overlayResumed()
diff --git a/third_party/WebKit/Source/web/NotificationPermissionClientImpl.cpp b/third_party/WebKit/Source/web/NotificationPermissionClientImpl.cpp index 2a9c7f1..b26b3d8 100644 --- a/third_party/WebKit/Source/web/NotificationPermissionClientImpl.cpp +++ b/third_party/WebKit/Source/web/NotificationPermissionClientImpl.cpp
@@ -28,9 +28,9 @@ ~WebNotificationPermissionCallbackImpl() override { } - void permissionRequestComplete(WebNotificationPermission permission) override + void permissionRequestComplete(mojom::PermissionStatus permissionStatus) override { - String permissionString = Notification::permissionString(permission); + String permissionString = Notification::permissionString(permissionStatus); if (m_deprecatedCallback) m_deprecatedCallback->handleEvent(permissionString);
diff --git a/third_party/WebKit/Source/web/PageWidgetDelegate.cpp b/third_party/WebKit/Source/web/PageWidgetDelegate.cpp index 65a6501..6c7ff73b 100644 --- a/third_party/WebKit/Source/web/PageWidgetDelegate.cpp +++ b/third_party/WebKit/Source/web/PageWidgetDelegate.cpp
@@ -169,6 +169,7 @@ case WebInputEvent::TouchMove: case WebInputEvent::TouchEnd: case WebInputEvent::TouchCancel: + case WebInputEvent::TouchScrollStarted: if (!root || !root->view()) return WebInputEventResult::NotHandled; return handler.handleTouchEvent(*root, static_cast<const WebTouchEvent&>(event)); @@ -253,6 +254,7 @@ WEBINPUT_EVENT_CASE(TouchMove) WEBINPUT_EVENT_CASE(TouchEnd) WEBINPUT_EVENT_CASE(TouchCancel) + WEBINPUT_EVENT_CASE(TouchScrollStarted) default: NOTREACHED(); return "";
diff --git a/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp b/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp index 90d9d19..04cf53e 100644 --- a/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp +++ b/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp
@@ -35,7 +35,6 @@ #include "core/dom/Document.h" #include "core/dom/ExecutionContext.h" #include "core/dom/MessagePort.h" -#include "core/events/MessageEvent.h" #include "core/inspector/ConsoleMessage.h" #include "core/workers/WorkerGlobalScope.h" #include "core/workers/WorkerThread.h" @@ -103,8 +102,6 @@ void ServiceWorkerGlobalScopeProxy::dispatchExtendableMessageEvent(int eventID, const WebString& message, const WebSecurityOrigin& sourceOrigin, const WebMessagePortChannelArray& webChannels, const WebServiceWorkerClientInfo& client) { - DCHECK(RuntimeEnabledFeatures::serviceWorkerExtendableMessageEventEnabled()); - WebSerializedScriptValue value = WebSerializedScriptValue::fromString(message); MessagePortArray* ports = MessagePort::toMessagePortArray(m_workerGlobalScope, webChannels); String origin; @@ -123,8 +120,6 @@ void ServiceWorkerGlobalScopeProxy::dispatchExtendableMessageEvent(int eventID, const WebString& message, const WebSecurityOrigin& sourceOrigin, const WebMessagePortChannelArray& webChannels, std::unique_ptr<WebServiceWorker::Handle> handle) { - DCHECK(RuntimeEnabledFeatures::serviceWorkerExtendableMessageEventEnabled()); - WebSerializedScriptValue value = WebSerializedScriptValue::fromString(message); MessagePortArray* ports = MessagePort::toMessagePortArray(m_workerGlobalScope, webChannels); String origin; @@ -182,13 +177,6 @@ workerGlobalScope()->dispatchExtendableEvent(event, observer); } -void ServiceWorkerGlobalScopeProxy::dispatchMessageEvent(const WebString& message, const WebMessagePortChannelArray& webChannels) -{ - MessagePortArray* ports = MessagePort::toMessagePortArray(workerGlobalScope(), webChannels); - WebSerializedScriptValue value = WebSerializedScriptValue::fromString(message); - workerGlobalScope()->dispatchEvent(MessageEvent::create(ports, value)); -} - void ServiceWorkerGlobalScopeProxy::dispatchNotificationClickEvent(int eventID, int64_t notificationID, const WebNotificationData& data, int actionIndex) { WaitUntilObserver* observer = WaitUntilObserver::create(workerGlobalScope(), WaitUntilObserver::NotificationClick, eventID);
diff --git a/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.h b/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.h index 33c7301..ae3c79ac 100644 --- a/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.h +++ b/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.h
@@ -78,7 +78,6 @@ void dispatchForeignFetchEvent(int, const WebServiceWorkerRequest&) override; void dispatchGeofencingEvent(int, WebGeofencingEventType, const WebString& regionID, const WebCircularGeofencingRegion&) override; void dispatchInstallEvent(int) override; - void dispatchMessageEvent(const WebString& message, const WebMessagePortChannelArray&) override; void dispatchNotificationClickEvent(int, int64_t notificationID, const WebNotificationData&, int actionIndex) override; void dispatchNotificationCloseEvent(int, int64_t notificationID, const WebNotificationData&) override; void dispatchPushEvent(int, const WebString& data) override;
diff --git a/third_party/WebKit/Source/web/WebDevToolsAgentImpl.cpp b/third_party/WebKit/Source/web/WebDevToolsAgentImpl.cpp index fd0200af..6418cacd 100644 --- a/third_party/WebKit/Source/web/WebDevToolsAgentImpl.cpp +++ b/third_party/WebKit/Source/web/WebDevToolsAgentImpl.cpp
@@ -315,7 +315,6 @@ , m_layerTreeAgent(nullptr) , m_tracingAgent(nullptr) , m_agents(m_instrumentingAgents.get()) - , m_deferredAgentsInitialized(false) , m_includeViewAgents(includeViewAgents) , m_sessionId(0) , m_stateMuted(false) @@ -384,12 +383,8 @@ m_v8Session.clear(); } -void WebDevToolsAgentImpl::initializeDeferredAgents() +void WebDevToolsAgentImpl::initializeAgents() { - if (m_deferredAgentsInitialized) - return; - m_deferredAgentsInitialized = true; - ClientMessageLoopAdapter::ensureMainThreadDebuggerCreated(m_client); MainThreadDebugger* mainThreadDebugger = MainThreadDebugger::instance(); v8::Isolate* isolate = V8PerIsolateData::mainThreadIsolate(); @@ -469,6 +464,22 @@ m_overlay->init(cssAgent, debuggerAgent, m_domAgent); } +void WebDevToolsAgentImpl::destroyAgents() +{ + if (m_overlay) + m_overlay->clear(); + + m_tracingAgent.clear(); + m_layerTreeAgent.clear(); + m_resourceAgent.clear(); + m_pageAgent.clear(); + m_domAgent.clear(); + + m_agents.discardAgents(); + m_instrumentingAgents->reset(); + m_v8Session.clear(); +} + void WebDevToolsAgentImpl::attach(const WebString& hostId, int sessionId) { if (m_attached) @@ -478,7 +489,7 @@ m_attached = true; m_sessionId = sessionId; - initializeDeferredAgents(); + initializeAgents(); m_resourceAgent->setHostId(hostId); m_inspectorFrontend = adoptPtr(new protocol::Frontend(this)); @@ -520,9 +531,7 @@ m_agents.clearFrontend(); m_inspectorFrontend.clear(); - // Release overlay resources. - if (m_overlay) - m_overlay->clear(); + destroyAgents(); InspectorInstrumentation::frontendDeleted(); InspectorInstrumentation::unregisterInstrumentingAgents(m_instrumentingAgents.get());
diff --git a/third_party/WebKit/Source/web/WebDevToolsAgentImpl.h b/third_party/WebKit/Source/web/WebDevToolsAgentImpl.h index e3917c7..e2c9d26 100644 --- a/third_party/WebKit/Source/web/WebDevToolsAgentImpl.h +++ b/third_party/WebKit/Source/web/WebDevToolsAgentImpl.h
@@ -137,7 +137,8 @@ void willProcessTask() override; void didProcessTask() override; - void initializeDeferredAgents(); + void initializeAgents(); + void destroyAgents(); friend class WebDevToolsAgent; static void runDebuggerTask(int sessionId, PassOwnPtr<WebDevToolsAgent::MessageDescriptor>); @@ -165,7 +166,6 @@ OwnPtr<protocol::Dispatcher> m_inspectorBackendDispatcher; OwnPtr<protocol::Frontend> m_inspectorFrontend; InspectorAgentRegistry m_agents; - bool m_deferredAgentsInitialized; bool m_includeViewAgents; typedef Vector<std::pair<int, OwnPtr<protocol::Value>>> NotificationQueue;
diff --git a/third_party/WebKit/Source/web/WebInputEventConversion.cpp b/third_party/WebKit/Source/web/WebInputEventConversion.cpp index b020b0f..cb365e1 100644 --- a/third_party/WebKit/Source/web/WebInputEventConversion.cpp +++ b/third_party/WebKit/Source/web/WebInputEventConversion.cpp
@@ -393,6 +393,8 @@ return PlatformEvent::TouchEnd; case WebInputEvent::TouchCancel: return PlatformEvent::TouchCancel; + case WebInputEvent::TouchScrollStarted: + return PlatformEvent::TouchScrollStarted; default: NOTREACHED(); }
diff --git a/third_party/WebKit/Source/web/WebRuntimeFeatures.cpp b/third_party/WebKit/Source/web/WebRuntimeFeatures.cpp index ee3184d0..9ef95f3 100644 --- a/third_party/WebKit/Source/web/WebRuntimeFeatures.cpp +++ b/third_party/WebKit/Source/web/WebRuntimeFeatures.cpp
@@ -145,6 +145,11 @@ RuntimeEnabledFeatures::setImageColorProfilesEnabled(enable); } +void WebRuntimeFeatures::enableInputMultipleFieldsUI(bool enable) +{ + RuntimeEnabledFeatures::setInputMultipleFieldsUIEnabled(enable); +} + void WebRuntimeFeatures::enableMediaCapture(bool enable) { RuntimeEnabledFeatures::setMediaCaptureEnabled(enable); @@ -155,11 +160,6 @@ RuntimeEnabledFeatures::setMediaDocumentDownloadButtonEnabled(enable); } -void WebRuntimeFeatures::enableNotificationActionIcons(bool enable) -{ - RuntimeEnabledFeatures::setNotificationActionIconsEnabled(enable); -} - void WebRuntimeFeatures::enableNotificationConstructor(bool enable) { RuntimeEnabledFeatures::setNotificationConstructorEnabled(enable); @@ -310,9 +310,4 @@ RuntimeEnabledFeatures::setRenderingPipelineThrottlingEnabled(enable); } -bool WebRuntimeFeatures::isServiceWorkerExtendableMessageEventEnabled() -{ - return RuntimeEnabledFeatures::serviceWorkerExtendableMessageEventEnabled(); -} - } // namespace blink
diff --git a/third_party/WebKit/Source/web/WebViewFrameWidget.cpp b/third_party/WebKit/Source/web/WebViewFrameWidget.cpp index 6e2e03c..d586d10 100644 --- a/third_party/WebKit/Source/web/WebViewFrameWidget.cpp +++ b/third_party/WebKit/Source/web/WebViewFrameWidget.cpp
@@ -121,11 +121,6 @@ return m_webView->applyViewportDeltas(visualViewportDelta, layoutViewportDelta, elasticOverscrollDelta, scaleFactor, topControlsShownRatioDelta); } -void WebViewFrameWidget::recordFrameTimingEvent(FrameTimingEventType eventType, int64_t rectId, const WebVector<WebFrameTimingEvent>& events) -{ - return m_webView->recordFrameTimingEvent(eventType, rectId, events); -} - void WebViewFrameWidget::mouseCaptureLost() { return m_webView->mouseCaptureLost();
diff --git a/third_party/WebKit/Source/web/WebViewFrameWidget.h b/third_party/WebKit/Source/web/WebViewFrameWidget.h index a8a76efb..ccf3bcb 100644 --- a/third_party/WebKit/Source/web/WebViewFrameWidget.h +++ b/third_party/WebKit/Source/web/WebViewFrameWidget.h
@@ -60,7 +60,6 @@ const WebFloatSize& elasticOverscrollDelta, float scaleFactor, float topControlsShownRatioDelta) override; - void recordFrameTimingEvent(FrameTimingEventType, int64_t rectId, const WebVector<WebFrameTimingEvent>& events) override; void mouseCaptureLost() override; void setFocus(bool) override; bool setComposition(
diff --git a/third_party/WebKit/Source/web/WebViewImpl.cpp b/third_party/WebKit/Source/web/WebViewImpl.cpp index 358c0455..8487e6d 100644 --- a/third_party/WebKit/Source/web/WebViewImpl.cpp +++ b/third_party/WebKit/Source/web/WebViewImpl.cpp
@@ -155,6 +155,7 @@ #include "web/ContextFeaturesClientImpl.h" #include "web/ContextMenuAllowedScope.h" #include "web/DatabaseClientImpl.h" +#include "web/DedicatedWorkerGlobalScopeProxyProviderImpl.h" #include "web/DevToolsEmulator.h" #include "web/FullscreenController.h" #include "web/InspectorOverlay.h" @@ -174,7 +175,6 @@ #include "web/WebPluginContainerImpl.h" #include "web/WebRemoteFrameImpl.h" #include "web/WebSettingsImpl.h" -#include "web/WorkerGlobalScopeProxyProviderImpl.h" #include "wtf/CurrentTime.h" #include "wtf/RefPtr.h" #include "wtf/TemporaryChange.h" @@ -459,7 +459,7 @@ provideStorageQuotaClientTo(*m_page, StorageQuotaClientImpl::create()); m_page->setValidationMessageClient(ValidationMessageClientImpl::create(*this)); - provideWorkerGlobalScopeProxyProviderTo(*m_page, WorkerGlobalScopeProxyProviderImpl::create()); + provideDedicatedWorkerGlobalScopeProxyProviderTo(*m_page, DedicatedWorkerGlobalScopeProxyProviderImpl::create()); StorageNamespaceController::provideStorageNamespaceTo(*m_page, &m_storageClientImpl); if (m_client) { @@ -4382,27 +4382,6 @@ } } -void WebViewImpl::recordFrameTimingEvent(FrameTimingEventType eventType, int64_t FrameId, const WebVector<WebFrameTimingEvent>& events) -{ - Frame* frame = m_page ? m_page->mainFrame() : 0; - - while (frame && frame->frameID() != FrameId) { - frame = frame->tree().traverseNext(); - } - - if (!frame || !frame->domWindow() || !frame->domWindow()->document()) - return; // Can't find frame, it may have been cleaned up from the DOM. - - blink::DOMWindow* domWindow = frame->domWindow(); - blink::Performance* performance = DOMWindowPerformance::performance(*domWindow); - for (size_t i = 0; i < events.size(); ++i) { - if (eventType == CompositeEvent) - performance->addCompositeTiming(domWindow->document(), events[i].sourceFrame, events[i].startTime); - else if (eventType == RenderEvent) - performance->addRenderTiming(domWindow->document(), events[i].sourceFrame, events[i].startTime, events[i].finishTime); - } -} - void WebViewImpl::updateLayerTreeViewport() { if (!page() || !m_layerTreeView)
diff --git a/third_party/WebKit/Source/web/WebViewImpl.h b/third_party/WebKit/Source/web/WebViewImpl.h index 7f1d23c..0518f16 100644 --- a/third_party/WebKit/Source/web/WebViewImpl.h +++ b/third_party/WebKit/Source/web/WebViewImpl.h
@@ -130,7 +130,6 @@ const WebFloatSize& elasticOverscrollDelta, float pageScaleDelta, float topControlsShownRatioDelta) override; - void recordFrameTimingEvent(enum FrameTimingEventType, int64_t, const WebVector<WebFrameTimingEvent>&) override; void mouseCaptureLost() override; void setFocus(bool enable) override; bool setComposition( @@ -435,7 +434,7 @@ WebViewScheduler* scheduler() const override; void setVisibilityState(WebPageVisibilityState, bool) override; - bool hasOpenedPopup() const { return m_pagePopup; } + bool hasOpenedPopup() const { return m_pagePopup.get(); } // Returns true if the event leads to scrolling. static bool mapKeyCodeForScroll(
diff --git a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp index fe584f14..7b6d43fb 100644 --- a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp +++ b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
@@ -8136,6 +8136,7 @@ event.windowX = windowX; event.windowY = windowY; event.canScroll = true; + event.hasPreciseScrollingDeltas = true; webViewHelper->webViewImpl()->handleInputEvent(event); } @@ -8399,6 +8400,43 @@ Mock::VerifyAndClearExpectations(&client); } +TEST_P(WebFrameOverscrollTest, ScrollPageWithBodyExplicitlyOverflowing) +{ + RuntimeEnabledFeatures::setScrollTopLeftInteropEnabled(false); + + OverscrollWebViewClient client; + registerMockedHttpURLLoad("mouse-wheel-overflow-body.html"); + FrameTestHelpers::WebViewHelper webViewHelper; + webViewHelper.initializeAndLoad(m_baseURL + "mouse-wheel-overflow-body.html", true, 0, &client, configureAndroid); + webViewHelper.resize(WebSize(800, 600)); + + FrameView* view = webViewHelper.webViewImpl()->mainFrameImpl()->frameView(); + Document* document = toWebLocalFrameImpl(webViewHelper.webViewImpl()->mainFrame())->frame()->document(); + + { + EXPECT_CALL(client, didOverscroll(_, _, _, _)).Times(0); + ScrollByWheel(&webViewHelper, 100, 100, 0, -450); + + LayoutBox* layoutBody = toLayoutBox(document->body()->layoutObject()); + ASSERT_EQ(400, layoutBody->getScrollableArea()->scrollPosition().y()); + ASSERT_EQ(400, layoutBody->getScrollableArea()->maximumScrollPosition().y()); + + Mock::VerifyAndClearExpectations(&client); + } + + view->setScrollPosition(DoublePoint(0, 0), ProgrammaticScroll); + + { + EXPECT_CALL(client, didOverscroll(WebFloatSize(0, 200), WebFloatSize(0, 200), WebFloatPoint(), WebFloatSize())); + ScrollByWheel(&webViewHelper, 100, 100, 0, -300); + + ASSERT_EQ(100, view->getScrollableArea()->scrollPosition().y()); + ASSERT_EQ(100, view->getScrollableArea()->maximumScrollPosition().y()); + + Mock::VerifyAndClearExpectations(&client); + } +} + TEST_F(WebFrameTest, OrientationFrameDetach) { RuntimeEnabledFeatures::setOrientationEventEnabled(true);
diff --git a/third_party/WebKit/Source/web/tests/WebViewTest.cpp b/third_party/WebKit/Source/web/tests/WebViewTest.cpp index b9c613e..805e58a2c 100644 --- a/third_party/WebKit/Source/web/tests/WebViewTest.cpp +++ b/third_party/WebKit/Source/web/tests/WebViewTest.cpp
@@ -2994,249 +2994,6 @@ m_webViewHelper.reset(); // Remove dependency on locally scoped client. } -// Test 3 frames, all on the same layer (i.e. [1 2 3]) -TEST_F(WebViewTest, TestPushFrameTimingRequestRectsToGraphicsLayer1) -{ - std::string url = m_baseURL + "frame_timing_inner.html?100px:100px"; - registerMockedURLLoad(toKURL(url), "frame_timing_inner.html"); - url = m_baseURL + "frame_timing_inner.html?200px:200px"; - registerMockedURLLoad(toKURL(url), "frame_timing_inner.html"); - url = m_baseURL + "frame_timing_inner.html?300px:300px"; - registerMockedURLLoad(toKURL(url), "frame_timing_inner.html"); - url = m_baseURL + "frame_timing_1.html"; - registerMockedURLLoad(toKURL(url), "frame_timing_1.html"); - - WebView* webView = m_webViewHelper.initialize(true); - loadFrame(webView->mainFrame(), url); - - webView->resize(WebSize(800, 600)); - webView->updateAllLifecyclePhases(); - - WebViewImpl* webViewImpl = toWebViewImpl(webView); - - Frame* frame = webViewImpl->page()->mainFrame(); - int64_t id = frame->frameID(); - - EXPECT_EQ(3u, frame->tree().childCount()); - - WebVector<std::pair<int64_t, WebRect>> frameTimingRequests = - toLocalFrame(frame)->document() - ->layoutView()->enclosingLayer() - ->enclosingLayerForPaintInvalidationCrossingFrameBoundaries() - ->graphicsLayerBacking()->platformLayer()->frameTimingRequests(); - - EXPECT_EQ(4u, frameTimingRequests.size()); - EXPECT_EQ(id + 0, frameTimingRequests[0].first); - EXPECT_EQ(WebRect(0, 0, 800, 600), frameTimingRequests[0].second); - EXPECT_EQ(id + 1, frameTimingRequests[1].first); - EXPECT_EQ(WebRect(2, 2, 100, 100), frameTimingRequests[1].second); - EXPECT_EQ(id + 2, frameTimingRequests[2].first); - EXPECT_EQ(WebRect(106, 2, 200, 200), frameTimingRequests[2].second); - EXPECT_EQ(id + 3, frameTimingRequests[3].first); - EXPECT_EQ(WebRect(310, 2, 300, 300), frameTimingRequests[3].second); -} - -// Test 3 frames, where frame 2 is on a different GraphicsLayer (i.e. [1 2' 3]) -TEST_F(WebViewTest, TestPushFrameTimingRequestRectsToGraphicsLayer2) -{ - std::string url = m_baseURL + "frame_timing_inner.html?100px:100px"; - registerMockedURLLoad(toKURL(url), "frame_timing_inner.html"); - url = m_baseURL + "frame_timing_inner.html?200px:200px"; - registerMockedURLLoad(toKURL(url), "frame_timing_inner.html"); - url = m_baseURL + "frame_timing_inner.html?300px:300px"; - registerMockedURLLoad(toKURL(url), "frame_timing_inner.html"); - url = m_baseURL + "frame_timing_2.html"; - registerMockedURLLoad(toKURL(url), "frame_timing_2.html"); - - WebView* webView = m_webViewHelper.initialize(true); - loadFrame(webView->mainFrame(), url); - - webView->resize(WebSize(800, 600)); - webView->updateAllLifecyclePhases(); - - WebViewImpl* webViewImpl = toWebViewImpl(webView); - - Frame* frame = webViewImpl->page()->mainFrame(); - int64_t id = frame->frameID(); - - EXPECT_EQ(3u, frame->tree().childCount()); - - const WebLayer* graphicsLayer1 = - toLocalFrame(webViewImpl->page()->mainFrame())->document() - ->layoutView()->enclosingLayer() - ->enclosingLayerForPaintInvalidationCrossingFrameBoundaries() - ->graphicsLayerBacking()->platformLayer(); - WebVector<std::pair<int64_t, WebRect>> frameTimingRequests1 = - graphicsLayer1->frameTimingRequests(); - - EXPECT_EQ(3u, frameTimingRequests1.size()); - EXPECT_EQ(id + 0, frameTimingRequests1[0].first); - EXPECT_EQ(WebRect(0, 0, 800, 600), frameTimingRequests1[0].second); - EXPECT_EQ(id + 1, frameTimingRequests1[1].first); - EXPECT_EQ(WebRect(2, 2, 100, 100), frameTimingRequests1[1].second); - EXPECT_EQ(id + 3, frameTimingRequests1[2].first); - EXPECT_EQ(WebRect(310, 2, 300, 300), frameTimingRequests1[2].second); - - const WebLayer* graphicsLayer2 = nullptr; - for (Frame* frame = webViewImpl->page()->mainFrame(); frame; - frame = frame->tree().traverseNext()) { - graphicsLayer2 = toLocalFrame(frame)->document()->layoutView() - ->enclosingLayer() - ->enclosingLayerForPaintInvalidationCrossingFrameBoundaries() - ->graphicsLayerBacking()->platformLayer(); - if (graphicsLayer2 != graphicsLayer1) - break; - } - WebVector<std::pair<int64_t, WebRect>> frameTimingRequests2 = - graphicsLayer2->frameTimingRequests(); - EXPECT_EQ(1u, frameTimingRequests2.size()); - EXPECT_EQ(id + 2, frameTimingRequests2[0].first); - EXPECT_EQ(WebRect(2, 2, 200, 200), frameTimingRequests2[0].second); -} - - -// Test nested frames (i.e. [1 2'[4 5'] 3]) -TEST_F(WebViewTest, TestPushFrameTimingRequestRectsToGraphicsLayer3) -{ - std::string url = m_baseURL + "frame_timing_inner.html?100px:100px"; - registerMockedURLLoad(toKURL(url), "frame_timing_inner.html"); - url = m_baseURL + "frame_timing_inner.html?200px:200px"; - registerMockedURLLoad(toKURL(url), "frame_timing_inner.html"); - url = m_baseURL + "frame_timing_inner.html?300px:300px"; - registerMockedURLLoad(toKURL(url), "frame_timing_inner.html"); - url = m_baseURL + "frame_timing_b.html"; - registerMockedURLLoad(toKURL(url), "frame_timing_b.html"); - url = m_baseURL + "frame_timing_3.html"; - registerMockedURLLoad(toKURL(url), "frame_timing_3.html"); - - WebView* webView = m_webViewHelper.initialize(true); - loadFrame(webView->mainFrame(), url); - - webView->resize(WebSize(800, 600)); - webView->updateAllLifecyclePhases(); - - WebViewImpl* webViewImpl = toWebViewImpl(webView); - - Frame* frame = webViewImpl->page()->mainFrame(); - int64_t id = frame->frameID(); - - EXPECT_EQ(3u, frame->tree().childCount()); - - const WebLayer* graphicsLayer1 = - toLocalFrame(webViewImpl->page()->mainFrame())->document() - ->layoutView()->enclosingLayer() - ->enclosingLayerForPaintInvalidationCrossingFrameBoundaries() - ->graphicsLayerBacking()->platformLayer(); - WebVector<std::pair<int64_t, WebRect>> frameTimingRequests1 = - graphicsLayer1->frameTimingRequests(); - - EXPECT_EQ(3u, frameTimingRequests1.size()); - EXPECT_EQ(id + 0, frameTimingRequests1[0].first); - EXPECT_EQ(WebRect(0, 0, 800, 600), frameTimingRequests1[0].second); - EXPECT_EQ(WebRect(2, 2, 100, 100), frameTimingRequests1[1].second); - EXPECT_EQ(WebRect(410, 2, 200, 200), frameTimingRequests1[2].second); - - const WebLayer* graphicsLayer2 = nullptr; - for (Frame* frame = webViewImpl->page()->mainFrame(); frame; - frame = frame->tree().traverseNext()) { - graphicsLayer2 = toLocalFrame(frame)->document()->layoutView() - ->enclosingLayer() - ->enclosingLayerForPaintInvalidationCrossingFrameBoundaries() - ->graphicsLayerBacking()->platformLayer(); - if (graphicsLayer2 != graphicsLayer1) - break; - } - WebVector<std::pair<int64_t, WebRect>> frameTimingRequests2 = - graphicsLayer2->frameTimingRequests(); - EXPECT_EQ(2u, frameTimingRequests2.size()); - EXPECT_EQ(WebRect(0, 0, 300, 300), frameTimingRequests2[0].second); - EXPECT_EQ(WebRect(2, 2, 100, 100), frameTimingRequests2[1].second); - - const WebLayer* graphicsLayer3 = nullptr; - for (Frame* frame = webViewImpl->page()->mainFrame(); frame; - frame = frame->tree().traverseNext()) { - graphicsLayer3 = toLocalFrame(frame)->document()->layoutView() - ->enclosingLayer() - ->enclosingLayerForPaintInvalidationCrossingFrameBoundaries() - ->graphicsLayerBacking()->platformLayer(); - if (graphicsLayer3 != graphicsLayer1 && graphicsLayer3 != graphicsLayer2) - break; - } - WebVector<std::pair<int64_t, WebRect>> frameTimingRequests3 = - graphicsLayer3->frameTimingRequests(); - EXPECT_EQ(1u, frameTimingRequests3.size()); - EXPECT_EQ(WebRect(2, 2, 100, 100), frameTimingRequests3[0].second); -} - -// Test 3 frames, all on the same layer (i.e. [1 2 3]) -// Fails on android, see crbug.com/488381. -#if OS(ANDROID) -TEST_F(WebViewTest, DISABLED_TestRecordFrameTimingEvents) -#else -TEST_F(WebViewTest, TestRecordFrameTimingEvents) -#endif -{ - std::string url = m_baseURL + "frame_timing_inner.html?100px:100px"; - registerMockedURLLoad(toKURL(url), "frame_timing_inner.html"); - url = m_baseURL + "frame_timing_inner.html?200px:200px"; - registerMockedURLLoad(toKURL(url), "frame_timing_inner.html"); - url = m_baseURL + "frame_timing_inner.html?300px:300px"; - registerMockedURLLoad(toKURL(url), "frame_timing_inner.html"); - url = m_baseURL + "frame_timing_1.html"; - registerMockedURLLoad(toKURL(url), "frame_timing_1.html"); - - WebView* webView = m_webViewHelper.initialize(true); - loadFrame(webView->mainFrame(), url); - - webView->resize(WebSize(800, 600)); - webView->updateAllLifecyclePhases(); - - WebViewImpl* webViewImpl = toWebViewImpl(webView); - - Frame* frame = webViewImpl->page()->mainFrame(); - int64_t id = frame->frameID(); - - Vector<WebFrameTimingEvent> compositePairs; - compositePairs.append(WebFrameTimingEvent(1, 2.0)); - compositePairs.append(WebFrameTimingEvent(2, 3.0)); - compositePairs.append(WebFrameTimingEvent(3, 4.0)); - WebVector<WebFrameTimingEvent> compositeEvents(compositePairs); - webViewImpl->recordFrameTimingEvent(WebView::CompositeEvent, id, compositeEvents); - PerformanceEntryVector composites = DOMWindowPerformance::performance(*frame->domWindow())->getEntriesByType("composite"); - PerformanceEntryVector renders = DOMWindowPerformance::performance(*frame->domWindow())->getEntriesByType("render"); - ASSERT_EQ(3ul, composites.size()); - ASSERT_EQ(0ul, renders.size()); - for (size_t i = 0; i < composites.size(); ++i) { - double docTime = frame->domWindow()->document()->loader()->timing().monotonicTimeToZeroBasedDocumentTime(compositePairs[i].startTime) * 1000.0; - ASSERT_EQ(docTime, composites[i]->startTime()); - } - - // Skip ahead to subframe 2. - frame = frame->tree().traverseNext(); - frame = frame->tree().traverseNext(); - id += 2; - - Vector<WebFrameTimingEvent> renderPairs; - renderPairs.append(WebFrameTimingEvent(4, 5.0, 6.0)); - renderPairs.append(WebFrameTimingEvent(5, 6.0, 7.0)); - renderPairs.append(WebFrameTimingEvent(6, 7.0, 8.0)); - renderPairs.append(WebFrameTimingEvent(7, 8.0, 9.0)); - WebVector<WebFrameTimingEvent> renderEvents(renderPairs); - webViewImpl->recordFrameTimingEvent(WebView::RenderEvent, id, renderEvents); - composites = DOMWindowPerformance::performance(*frame->domWindow())->getEntriesByType("composite"); - renders = DOMWindowPerformance::performance(*frame->domWindow())->getEntriesByType("render"); - ASSERT_EQ(0ul, composites.size()); - ASSERT_EQ(4ul, renders.size()); - for (size_t i = 0; i < renders.size(); ++i) { - double docStartTime = frame->domWindow()->document()->loader()->timing().monotonicTimeToZeroBasedDocumentTime(renderPairs[i].startTime) * 1000.0; - ASSERT_DOUBLE_EQ(docStartTime, renders[i]->startTime()); - double docFinishTime = frame->domWindow()->document()->loader()->timing().monotonicTimeToZeroBasedDocumentTime(renderPairs[i].finishTime) * 1000.0; - double docDuration = docFinishTime - docStartTime; - ASSERT_DOUBLE_EQ(docDuration, renders[i]->duration()); - } -} - - TEST_F(WebViewTest, StopLoadingIfJavaScriptURLReturnsNoStringResult) { ViewCreatingWebViewClient client;
diff --git a/third_party/WebKit/Source/web/tests/data/mouse-wheel-overflow-body.html b/third_party/WebKit/Source/web/tests/data/mouse-wheel-overflow-body.html new file mode 100644 index 0000000..3585102 --- /dev/null +++ b/third_party/WebKit/Source/web/tests/data/mouse-wheel-overflow-body.html
@@ -0,0 +1,20 @@ +<!DOCTYPE HTML> +<head> + <style> + html { + height: 100%; + width: 100%; + overflow-y: scroll; + } + + body { + height: 100%; + width: 50%; + margin: 0px 0px 100px 0px; + overflow-y: scroll; + } + </style> +</head> +<body> + <div style="height:1000px"></div> +</body>
diff --git a/content/test/data/notifications/100x100.png b/third_party/WebKit/Source/web/tests/data/notifications/100x100.png similarity index 100% rename from content/test/data/notifications/100x100.png rename to third_party/WebKit/Source/web/tests/data/notifications/100x100.png Binary files differ
diff --git a/content/test/data/notifications/110x110.png b/third_party/WebKit/Source/web/tests/data/notifications/110x110.png similarity index 100% rename from content/test/data/notifications/110x110.png rename to third_party/WebKit/Source/web/tests/data/notifications/110x110.png Binary files differ
diff --git a/content/test/data/notifications/120x120.png b/third_party/WebKit/Source/web/tests/data/notifications/120x120.png similarity index 100% rename from content/test/data/notifications/120x120.png rename to third_party/WebKit/Source/web/tests/data/notifications/120x120.png Binary files differ
diff --git a/content/test/data/notifications/48x48.png b/third_party/WebKit/Source/web/tests/data/notifications/48x48.png similarity index 100% rename from content/test/data/notifications/48x48.png rename to third_party/WebKit/Source/web/tests/data/notifications/48x48.png Binary files differ
diff --git a/content/test/data/notifications/500x500.png b/third_party/WebKit/Source/web/tests/data/notifications/500x500.png similarity index 100% rename from content/test/data/notifications/500x500.png rename to third_party/WebKit/Source/web/tests/data/notifications/500x500.png Binary files differ
diff --git a/third_party/WebKit/Source/web/web.gypi b/third_party/WebKit/Source/web/web.gypi index a0d5546f..52fd488 100644 --- a/third_party/WebKit/Source/web/web.gypi +++ b/third_party/WebKit/Source/web/web.gypi
@@ -25,6 +25,8 @@ 'DatabaseClientImpl.h', 'DateTimeChooserImpl.cpp', 'DateTimeChooserImpl.h', + 'DedicatedWorkerGlobalScopeProxyProviderImpl.cpp', + 'DedicatedWorkerGlobalScopeProxyProviderImpl.h', 'DevToolsEmulator.cpp', 'DevToolsEmulator.h', 'EditorClientImpl.cpp', @@ -225,8 +227,6 @@ 'WebViewImpl.h', 'WorkerContentSettingsClient.cpp', 'WorkerContentSettingsClient.h', - 'WorkerGlobalScopeProxyProviderImpl.cpp', - 'WorkerGlobalScopeProxyProviderImpl.h', 'default/WebRenderTheme.cpp', 'linux/WebFontRendering.cpp', 'mac/WebScrollbarTheme.mm',
diff --git a/third_party/WebKit/Source/wtf/PassRefPtr.h b/third_party/WebKit/Source/wtf/PassRefPtr.h index 38dd9c9..7285b6cc 100644 --- a/third_party/WebKit/Source/wtf/PassRefPtr.h +++ b/third_party/WebKit/Source/wtf/PassRefPtr.h
@@ -81,11 +81,7 @@ T* operator->() const { return m_ptr; } bool operator!() const { return !m_ptr; } - - // This conversion operator allows implicit conversion to bool but not to - // other integer types. - typedef T* (PassRefPtr::*UnspecifiedBoolType); - operator UnspecifiedBoolType() const { return m_ptr ? &PassRefPtr::m_ptr : 0; } + explicit operator bool() const { return m_ptr; } friend PassRefPtr adoptRef<T>(T*); @@ -142,6 +138,16 @@ return a == b.get(); } +template <typename T> inline bool operator==(const PassRefPtr<T>& a, std::nullptr_t) +{ + return !a.get(); +} + +template <typename T> inline bool operator==(std::nullptr_t, const PassRefPtr<T>& b) +{ + return !b.get(); +} + template <typename T, typename U> inline bool operator!=(const PassRefPtr<T>& a, const PassRefPtr<U>& b) { return a.get() != b.get(); @@ -167,6 +173,16 @@ return a != b.get(); } +template <typename T> inline bool operator!=(const PassRefPtr<T>& a, std::nullptr_t) +{ + return a.get(); +} + +template <typename T> inline bool operator!=(std::nullptr_t, const PassRefPtr<T>& b) +{ + return b.get(); +} + template <typename T> PassRefPtr<T> adoptRef(T* p) { adopted(p);
diff --git a/third_party/WebKit/Source/wtf/RefPtr.h b/third_party/WebKit/Source/wtf/RefPtr.h index 4ed3ea5..1660f88 100644 --- a/third_party/WebKit/Source/wtf/RefPtr.h +++ b/third_party/WebKit/Source/wtf/RefPtr.h
@@ -70,11 +70,7 @@ ALWAYS_INLINE T* operator->() const { return m_ptr; } bool operator!() const { return !m_ptr; } - - // This conversion operator allows implicit conversion to bool but not to - // other integer types. - typedef T* (RefPtr::*UnspecifiedBoolType); - operator UnspecifiedBoolType() const { return m_ptr ? &RefPtr::m_ptr : 0; } + explicit operator bool() const { return m_ptr; } RefPtr& operator=(RefPtr o) { swap(o); return *this; } RefPtr& operator=(std::nullptr_t) { clear(); return *this; } @@ -135,6 +131,16 @@ return a == b.get(); } +template <typename T> inline bool operator==(const RefPtr<T>& a, std::nullptr_t) +{ + return !a.get(); +} + +template <typename T> inline bool operator==(std::nullptr_t, const RefPtr<T>& b) +{ + return !b.get(); +} + template <typename T, typename U> inline bool operator!=(const RefPtr<T>& a, const RefPtr<U>& b) { return a.get() != b.get(); @@ -150,6 +156,16 @@ return a != b.get(); } +template <typename T> inline bool operator!=(const RefPtr<T>& a, std::nullptr_t) +{ + return a.get(); +} + +template <typename T> inline bool operator!=(std::nullptr_t, const RefPtr<T>& b) +{ + return b.get(); +} + template <typename T, typename U> inline RefPtr<T> static_pointer_cast(const RefPtr<U>& p) { return RefPtr<T>(static_cast<T*>(p.get()));
diff --git a/third_party/WebKit/Source/wtf/typed_arrays/ArrayBufferBuilder.h b/third_party/WebKit/Source/wtf/typed_arrays/ArrayBufferBuilder.h index b37f1cfa..7c60f1a7 100644 --- a/third_party/WebKit/Source/wtf/typed_arrays/ArrayBufferBuilder.h +++ b/third_party/WebKit/Source/wtf/typed_arrays/ArrayBufferBuilder.h
@@ -60,7 +60,7 @@ bool isValid() const { - return m_buffer; + return m_buffer.get(); } // Appending empty data is not allowed.
diff --git a/third_party/WebKit/Source/wtf/typed_arrays/ArrayBufferView.h b/third_party/WebKit/Source/wtf/typed_arrays/ArrayBufferView.h index 03c27610..54c87b3 100644 --- a/third_party/WebKit/Source/wtf/typed_arrays/ArrayBufferView.h +++ b/third_party/WebKit/Source/wtf/typed_arrays/ArrayBufferView.h
@@ -52,9 +52,9 @@ virtual ViewType type() const = 0; const char* typeName(); - PassRefPtr<ArrayBuffer> buffer() const + ArrayBuffer* buffer() const { - return m_buffer; + return m_buffer.get(); } void* baseAddress() const
diff --git a/third_party/WebKit/public/BUILD.gn b/third_party/WebKit/public/BUILD.gn index b44ddd7..8063677 100644 --- a/third_party/WebKit/public/BUILD.gn +++ b/third_party/WebKit/public/BUILD.gn
@@ -177,22 +177,8 @@ ] } -# GYP version: WebKit/public/blink.gyp:mojo_bindings_blink_mojom -mojom("mojo_bindings_blink") { - sources = [ - "platform/modules/bluetooth/web_bluetooth.mojom", - "platform/modules/geolocation/geolocation.mojom", - "platform/modules/notifications/notification.mojom", - "platform/modules/payments/payment_request.mojom", - "platform/modules/permissions/permission.mojom", - "platform/modules/permissions/permission_status.mojom", - "platform/modules/wake_lock/wake_lock_service.mojom", - ] - for_blink = true - variant = "wtf" -} - -# GYP version: WebKit/public/blink.gyp:mojo_bindings_mojom +# GYP versions: WebKit/public/blink.gyp:mojo_bindings_mojom, +# WebKit/public/blink.gyp:mojo_bindings_blink_mojom mojom("mojo_bindings") { sources = [ "platform/modules/bluetooth/web_bluetooth.mojom", @@ -202,20 +188,21 @@ "platform/modules/permissions/permission_status.mojom", "platform/modules/wake_lock/wake_lock_service.mojom", ] + public_deps = [ + ":android_mojo_bindings", + ] } -if (is_android) { - # GYP version: WebKit/public/blink.gyp:android_mojo_bindings_java - mojom("android_mojo_bindings") { - sources = [ - "platform/modules/payments/payment_request.mojom", - ] - } +# GYP version: WebKit/public/blink.gyp:android_mojo_bindings_java +mojom("android_mojo_bindings") { + sources = [ + "platform/modules/payments/payment_request.mojom", + ] } group("generate_mojo_bindings") { deps = [ ":mojo_bindings__generator", - ":mojo_bindings_blink__generator", + ":mojo_bindings_wtf__generator", ] }
diff --git a/third_party/WebKit/public/blink.gyp b/third_party/WebKit/public/blink.gyp index be6c65e..631d6464 100644 --- a/third_party/WebKit/public/blink.gyp +++ b/third_party/WebKit/public/blink.gyp
@@ -97,7 +97,8 @@ ], }, { - # GN version: //third_party/WebKit/public:mojo_bindings_blink + # GN version: //third_party/WebKit/public:mojo_bindings_wtf + # (generated by //third_party/WebKit/public:mojo_bindings) 'target_name': 'mojo_bindings_blink_mojom', 'type': 'none', 'variables': {
diff --git a/third_party/WebKit/public/blink_headers.gypi b/third_party/WebKit/public/blink_headers.gypi index 535d7b2..d8f53a3 100644 --- a/third_party/WebKit/public/blink_headers.gypi +++ b/third_party/WebKit/public/blink_headers.gypi
@@ -92,7 +92,6 @@ "platform/WebFont.h", "platform/WebFontDescription.h", "platform/WebFrameScheduler.h", - "platform/WebFrameTimingEvent.h", "platform/WebGamepad.h", "platform/WebGamepadListener.h", "platform/WebGamepads.h", @@ -271,7 +270,7 @@ "platform/modules/notifications/WebNotificationData.h", "platform/modules/notifications/WebNotificationDelegate.h", "platform/modules/notifications/WebNotificationManager.h", - "platform/modules/notifications/WebNotificationPermission.h", + "platform/modules/notifications/WebNotificationResources.h", "platform/modules/permissions/WebPermissionClient.h", "platform/modules/permissions/WebPermissionObserver.h", "platform/modules/permissions/WebPermissionStatus.h",
diff --git a/third_party/WebKit/public/platform/WebFrameTimingEvent.h b/third_party/WebKit/public/platform/WebFrameTimingEvent.h deleted file mode 100644 index 341ab03..0000000 --- a/third_party/WebKit/public/platform/WebFrameTimingEvent.h +++ /dev/null
@@ -1,42 +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 WebFrameTimingEvent_h -#define WebFrameTimingEvent_h - -namespace blink { - -// A struct to pass PerformanceRenderEvent or PerformanceCompositeEvent info -// to Blink. -struct WebFrameTimingEvent { - WebFrameTimingEvent(unsigned sourceFrame, double startTime, double finishTime) - : sourceFrame(sourceFrame) - , startTime(startTime) - , finishTime(finishTime) - { - } - - WebFrameTimingEvent(unsigned sourceFrame, double startTime) - : sourceFrame(sourceFrame) - , startTime(startTime) - { - } - - WebFrameTimingEvent() { } - - WebFrameTimingEvent& operator=(const WebFrameTimingEvent& rhs) - { - sourceFrame = rhs.sourceFrame; - startTime = rhs.startTime; - finishTime = rhs.finishTime; - return *this; - } - unsigned sourceFrame; - double startTime; - double finishTime; -}; - -} // namespace blink - -#endif
diff --git a/third_party/WebKit/public/platform/WebLayer.h b/third_party/WebKit/public/platform/WebLayer.h index 1542ca1..818d75d 100644 --- a/third_party/WebKit/public/platform/WebLayer.h +++ b/third_party/WebKit/public/platform/WebLayer.h
@@ -175,11 +175,6 @@ virtual void setTouchEventHandlerRegion(const WebVector<WebRect>&) = 0; virtual WebVector<WebRect> touchEventHandlerRegion() const = 0; - // Setter and getter for Frame Timing rects. - // See http://w3c.github.io/frame-timing/ for definition of terms. - virtual void setFrameTimingRequests(const WebVector<std::pair<int64_t, WebRect>>&) = 0; - virtual WebVector<std::pair<int64_t, WebRect>> frameTimingRequests() const = 0; - virtual void setIsContainerForFixedPositionLayers(bool) = 0; virtual bool isContainerForFixedPositionLayers() const = 0;
diff --git a/third_party/WebKit/public/platform/WebRTCCertificateGenerator.h b/third_party/WebKit/public/platform/WebRTCCertificateGenerator.h index 653039f..2f35700 100644 --- a/third_party/WebKit/public/platform/WebRTCCertificateGenerator.h +++ b/third_party/WebKit/public/platform/WebRTCCertificateGenerator.h
@@ -53,8 +53,13 @@ const WebRTCKeyParams&, const WebURL&, const WebURL& firstPartyForCookies, - std::unique_ptr<WebRTCCertificateCallback> observer) - = 0; + std::unique_ptr<WebRTCCertificateCallback> observer) = 0; + virtual void generateCertificateWithExpiration( + const WebRTCKeyParams&, + const WebURL&, + const WebURL& firstPartyForCookies, + uint64_t expiresMs, + std::unique_ptr<WebRTCCertificateCallback> observer) = 0; // Determines if the parameters are supported by generateCertificate. // For example, if the number of bits of some parameter is too small or too large we
diff --git a/third_party/WebKit/public/platform/WebSourceBufferClient.h b/third_party/WebKit/public/platform/WebSourceBufferClient.h index dccfcc8..2b5066971 100644 --- a/third_party/WebKit/public/platform/WebSourceBufferClient.h +++ b/third_party/WebKit/public/platform/WebSourceBufferClient.h
@@ -7,9 +7,7 @@ #include "WebMediaPlayer.h" #include "WebString.h" - -#include <tuple> -#include <vector> +#include "WebVector.h" namespace blink { @@ -18,12 +16,18 @@ virtual ~WebSourceBufferClient() { } // Complete media track info: track type, bytestream id, kind, label, language. - typedef std::tuple<WebMediaPlayer::TrackType, WebString, WebString, WebString, WebString> MediaTrackInfo; + struct MediaTrackInfo { + WebMediaPlayer::TrackType trackType; + WebString byteStreamTrackId; + WebString kind; + WebString label; + WebString language; + }; // Notifies SourceBuffer that parsing of a new init segment has been completed successfully. The input parameter is a collection // of information about media tracks found in the new init segment. The return value is a vector of blink WebMediaPlayer track ids // assigned to each track of the input collection (the order of output track ids must match the input track information). - virtual std::vector<WebMediaPlayer::TrackId> initializationSegmentReceived(const std::vector<MediaTrackInfo>& tracks) = 0; + virtual WebVector<WebMediaPlayer::TrackId> initializationSegmentReceived(const WebVector<MediaTrackInfo>& tracks) = 0; }; } // namespace blink
diff --git a/third_party/WebKit/public/platform/WebURLLoadTiming.h b/third_party/WebKit/public/platform/WebURLLoadTiming.h index 8193c21..fc48965 100644 --- a/third_party/WebKit/public/platform/WebURLLoadTiming.h +++ b/third_party/WebKit/public/platform/WebURLLoadTiming.h
@@ -98,6 +98,12 @@ BLINK_PLATFORM_EXPORT double sslEnd() const; BLINK_PLATFORM_EXPORT void setSSLEnd(double); + BLINK_PLATFORM_EXPORT double pushStart() const; + BLINK_PLATFORM_EXPORT void setPushStart(double); + + BLINK_PLATFORM_EXPORT double pushEnd() const; + BLINK_PLATFORM_EXPORT void setPushEnd(double); + #if INSIDE_BLINK BLINK_PLATFORM_EXPORT WebURLLoadTiming(const WTF::PassRefPtr<ResourceLoadTiming>&); BLINK_PLATFORM_EXPORT WebURLLoadTiming& operator=(const WTF::PassRefPtr<ResourceLoadTiming>&);
diff --git a/third_party/WebKit/public/platform/modules/notifications/WebNotificationConstants.h b/third_party/WebKit/public/platform/modules/notifications/WebNotificationConstants.h new file mode 100644 index 0000000..01714058 --- /dev/null +++ b/third_party/WebKit/public/platform/modules/notifications/WebNotificationConstants.h
@@ -0,0 +1,33 @@ +// 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 WebNotificationConstants_h +#define WebNotificationConstants_h + +namespace blink { + +// TODO(johnme): The maximum number of actions is platform-specific and should +// be indicated by the embedder. + +// Maximum number of actions on a Platform Notification. +static const size_t kWebNotificationMaxActions = 2; + +// TODO(mvanouwerkerk): Update the notification resource loader to get the +// appropriate image sizes from the embedder. + +// The maximum reasonable notification icon size, scaled from dip units to +// pixels using the largest supported scaling factor. +static const int kWebNotificationMaxIconSizePx = 320; // 80 dip * 4 + +// The maximum reasonable badge size, scaled from dip units to pixels using the +// largest supported scaling factor. +static const int kWebNotificationMaxBadgeSizePx = 96; // 24 dip * 4 + +// The maximum reasonable action icon size, scaled from dip units to +// pixels using the largest supported scaling factor. +static const int kWebNotificationMaxActionIconSizePx = 128; // 32 dip * 4 + +} // namespace blink + +#endif // WebNotificationConstants_h
diff --git a/third_party/WebKit/public/platform/modules/notifications/WebNotificationManager.h b/third_party/WebKit/public/platform/modules/notifications/WebNotificationManager.h index dd5387f..1e6ced9 100644 --- a/third_party/WebKit/public/platform/modules/notifications/WebNotificationManager.h +++ b/third_party/WebKit/public/platform/modules/notifications/WebNotificationManager.h
@@ -9,11 +9,16 @@ #include "public/platform/WebString.h" #include "public/platform/WebVector.h" #include "public/platform/modules/notifications/WebNotificationData.h" -#include "public/platform/modules/notifications/WebNotificationPermission.h" +#include "public/platform/modules/notifications/WebNotificationResources.h" +#include <memory> #include <stdint.h> namespace blink { +namespace mojom { +enum class PermissionStatus; +} + class WebNotificationDelegate; class WebSecurityOrigin; class WebServiceWorkerRegistration; @@ -34,12 +39,12 @@ // Shows a page notification on the user's system. These notifications will have their // events delivered to the delegate specified in this call. - virtual void show(const WebSecurityOrigin&, const WebNotificationData&, WebNotificationDelegate*) = 0; + virtual void show(const WebSecurityOrigin&, const WebNotificationData&, std::unique_ptr<WebNotificationResources>, WebNotificationDelegate*) = 0; // Shows a persistent notification on the user's system. These notifications will have // their events delivered to a Service Worker rather than the object's delegate. Will // take ownership of the WebNotificationShowCallbacks object. - virtual void showPersistent(const WebSecurityOrigin&, const WebNotificationData&, WebServiceWorkerRegistration*, WebNotificationShowCallbacks*) = 0; + virtual void showPersistent(const WebSecurityOrigin&, const WebNotificationData&, std::unique_ptr<WebNotificationResources>, WebServiceWorkerRegistration*, WebNotificationShowCallbacks*) = 0; // Asynchronously gets the persistent notifications belonging to the Service Worker Registration. // If |filterTag| is not an empty string, only the notification with the given tag will be @@ -57,10 +62,7 @@ virtual void notifyDelegateDestroyed(WebNotificationDelegate*) = 0; // Synchronously checks the permission level for the given origin. - virtual WebNotificationPermission checkPermission(const WebSecurityOrigin&) = 0; - - // Returns the maximum number of actions supported by the embedder. - virtual size_t maxActions() = 0; + virtual mojom::PermissionStatus checkPermission(const WebSecurityOrigin&) = 0; }; } // namespace blink
diff --git a/third_party/WebKit/public/platform/modules/notifications/WebNotificationPermission.h b/third_party/WebKit/public/platform/modules/notifications/WebNotificationPermission.h deleted file mode 100644 index 424f4b1..0000000 --- a/third_party/WebKit/public/platform/modules/notifications/WebNotificationPermission.h +++ /dev/null
@@ -1,20 +0,0 @@ -// Copyright 2014 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 WebNotificationPermission_h -#define WebNotificationPermission_h - -namespace blink { - -enum WebNotificationPermission { - WebNotificationPermissionAllowed = 0, - WebNotificationPermissionDefault, - WebNotificationPermissionDenied, - - WebNotificationPermissionLast = WebNotificationPermissionDenied -}; - -} // namespace blink - -#endif // WebNotificationPermission_h
diff --git a/third_party/WebKit/public/platform/modules/notifications/WebNotificationResources.h b/third_party/WebKit/public/platform/modules/notifications/WebNotificationResources.h new file mode 100644 index 0000000..d34e72a8 --- /dev/null +++ b/third_party/WebKit/public/platform/modules/notifications/WebNotificationResources.h
@@ -0,0 +1,30 @@ +// 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 WebNotificationResources_h +#define WebNotificationResources_h + +#include "public/platform/WebVector.h" +#include "third_party/skia/include/core/SkBitmap.h" + +namespace blink { + +// Structure representing the resources associated with a Web Notification. +struct WebNotificationResources { + // Main icon for the notification. The bitmap may be empty if the developer + // did not provide an icon, or fetching of the icon failed. + SkBitmap icon; + + // Badge for the notification. The bitmap may be empty if the developer + // did not provide a badge, or fetching of the badge failed. + SkBitmap badge; + + // Icons for the actions. A bitmap may be empty if the developer did not + // provide an icon, or fetching of the icon failed. + WebVector<SkBitmap> actionIcons; +}; + +} // namespace blink + +#endif // WebNotificationResources_h
diff --git a/third_party/WebKit/public/web/WebInputEvent.h b/third_party/WebKit/public/web/WebInputEvent.h index d2e24f8..d4148b67 100644 --- a/third_party/WebKit/public/web/WebInputEvent.h +++ b/third_party/WebKit/public/web/WebInputEvent.h
@@ -139,7 +139,8 @@ TouchMove, TouchEnd, TouchCancel, - TouchTypeLast = TouchCancel, + TouchScrollStarted, + TouchTypeLast = TouchScrollStarted, TypeLast = TouchTypeLast };
diff --git a/third_party/WebKit/public/web/WebRuntimeFeatures.h b/third_party/WebKit/public/web/WebRuntimeFeatures.h index b7c0094f..37f04e8 100644 --- a/third_party/WebKit/public/web/WebRuntimeFeatures.h +++ b/third_party/WebKit/public/web/WebRuntimeFeatures.h
@@ -78,12 +78,12 @@ BLINK_EXPORT static void enableFastMobileScrolling(bool); BLINK_EXPORT static void enableFileSystem(bool); BLINK_EXPORT static void enableImageColorProfiles(bool); + BLINK_EXPORT static void enableInputMultipleFieldsUI(bool); BLINK_EXPORT static void enableMediaCapture(bool); BLINK_EXPORT static void enableMediaDocumentDownloadButton(bool); BLINK_EXPORT static void enableNavigatorContentUtils(bool); BLINK_EXPORT static void enableNetworkInformation(bool); BLINK_EXPORT static void enableNewMediaPlaybackUi(bool); - BLINK_EXPORT static void enableNotificationActionIcons(bool); BLINK_EXPORT static void enableNotificationConstructor(bool); BLINK_EXPORT static void enableNotifications(bool); BLINK_EXPORT static void enableOrientationEvent(bool); @@ -113,10 +113,6 @@ BLINK_EXPORT static void enableXSLT(bool); BLINK_EXPORT static void forceOverlayFullscreenVideo(bool); - // TODO(nhiroki): Remove after ExtendableMessageEvent is shipped - // (crbug.com/543198). - BLINK_EXPORT static bool isServiceWorkerExtendableMessageEventEnabled(); - private: WebRuntimeFeatures(); };
diff --git a/third_party/WebKit/public/web/WebWidget.h b/third_party/WebKit/public/web/WebWidget.h index 946ab3f5..8b3609c3 100644 --- a/third_party/WebKit/public/web/WebWidget.h +++ b/third_party/WebKit/public/web/WebWidget.h
@@ -34,7 +34,6 @@ #include "../platform/WebCanvas.h" #include "../platform/WebCommon.h" #include "../platform/WebFloatSize.h" -#include "../platform/WebFrameTimingEvent.h" #include "../platform/WebInputEventResult.h" #include "../platform/WebPoint.h" #include "../platform/WebRect.h" @@ -129,14 +128,6 @@ float scaleFactor, float topControlsShownRatioDelta) { } - // Records composite or render events for the Performance Timeline. - // See http://w3c.github.io/frame-timing/ for definition of terms. - enum FrameTimingEventType { - CompositeEvent, - RenderEvent, - }; - virtual void recordFrameTimingEvent(FrameTimingEventType eventType, int64_t RectId, const WebVector<WebFrameTimingEvent>& events) { } - // Called to inform the WebWidget that mouse capture was lost. virtual void mouseCaptureLost() { }
diff --git a/third_party/WebKit/public/web/modules/notifications/WebNotificationPermissionCallback.h b/third_party/WebKit/public/web/modules/notifications/WebNotificationPermissionCallback.h index 59b0745..0699fd7 100644 --- a/third_party/WebKit/public/web/modules/notifications/WebNotificationPermissionCallback.h +++ b/third_party/WebKit/public/web/modules/notifications/WebNotificationPermissionCallback.h
@@ -31,7 +31,7 @@ #ifndef WebNotificationPermissionCallback_h #define WebNotificationPermissionCallback_h -#include "public/platform/modules/notifications/WebNotificationPermission.h" +#include "public/platform/modules/permissions/permission_status.mojom.h" namespace blink { @@ -42,7 +42,7 @@ // Method to be invoked when the asynchronous permission request for the // ability to display Web Notifications has been completed. - virtual void permissionRequestComplete(WebNotificationPermission) = 0; + virtual void permissionRequestComplete(mojom::PermissionStatus) = 0; }; } // namespace blink
diff --git a/third_party/WebKit/public/web/modules/serviceworker/WebServiceWorkerContextProxy.h b/third_party/WebKit/public/web/modules/serviceworker/WebServiceWorkerContextProxy.h index d1e44db..fa46ac4 100644 --- a/third_party/WebKit/public/web/modules/serviceworker/WebServiceWorkerContextProxy.h +++ b/third_party/WebKit/public/web/modules/serviceworker/WebServiceWorkerContextProxy.h
@@ -61,11 +61,6 @@ virtual void dispatchFetchEvent(int eventID, const WebServiceWorkerRequest& webRequest) = 0; virtual void dispatchForeignFetchEvent(int eventID, const WebServiceWorkerRequest& webRequest) = 0; virtual void dispatchGeofencingEvent(int eventID, WebGeofencingEventType, const WebString& regionID, const WebCircularGeofencingRegion&) = 0; - - // TODO(nhiroki): Remove this after ExtendableMessageEvent is enabled by - // default (crbug.com/543198). - virtual void dispatchMessageEvent(const WebString& message, const WebMessagePortChannelArray&) = 0; - virtual void dispatchNotificationClickEvent(int eventID, int64_t notificationID, const WebNotificationData&, int actionIndex) = 0; virtual void dispatchNotificationCloseEvent(int eventID, int64_t notificationID, const WebNotificationData&) = 0; virtual void dispatchPushEvent(int eventID, const WebString& data) = 0;
diff --git a/third_party/closure_compiler/externs/system_display.js b/third_party/closure_compiler/externs/system_display.js index 0b5b631..60a492a 100644 --- a/third_party/closure_compiler/externs/system_display.js +++ b/third_party/closure_compiler/externs/system_display.js
@@ -45,6 +45,21 @@ /** * @typedef {{ + * width: number, + * height: number, + * widthInNativePixels: number, + * heightInNativePixels: number, + * uiScale: number, + * deviceScaleFactor: number, + * isNative: boolean, + * isSelected: boolean + * }} + * @see https://developer.chrome.com/extensions/system.display#type-DisplayMode + */ +chrome.system.display.DisplayMode; + +/** + * @typedef {{ * id: string, * name: string, * mirroringSourceId: string, @@ -56,7 +71,8 @@ * rotation: number, * bounds: !chrome.system.display.Bounds, * overscan: !chrome.system.display.Insets, - * workArea: !chrome.system.display.Bounds + * workArea: !chrome.system.display.Bounds, + * modes: !Array<!chrome.system.display.DisplayMode> * }} * @see https://developer.chrome.com/extensions/system.display#type-DisplayUnitInfo */ @@ -69,7 +85,8 @@ * overscan: (!chrome.system.display.Insets|undefined), * rotation: (number|undefined), * boundsOriginX: (number|undefined), - * boundsOriginY: (number|undefined) + * boundsOriginY: (number|undefined), + * displayMode: (!chrome.system.display.DisplayMode|undefined) * }} * @see https://developer.chrome.com/extensions/system.display#type-DisplayProperties */ @@ -86,7 +103,7 @@ /** * Updates the properties for the display specified by |id|, according to the * information provided in |info|. On failure, $(ref:runtime.lastError) will be - * set. + * set. NOTE: This is only available to Chrome OS Kiosk apps and Web UI. * @param {string} id The display's unique identifier. * @param {!chrome.system.display.DisplayProperties} info The information about * display properties that should be changed. A property will be changed @@ -101,8 +118,9 @@ /** * Enables/disables the unified desktop feature. Note that this simply enables * the feature, but will not change the actual desktop mode. (That is, if the - * desktop is in mirror mode, it will stay in mirror mode) - * @param {boolean} enabled + * desktop is in mirror mode, it will stay in mirror mode) NOTE: This is only + * available to Chrome OS Kiosk apps and Web UI. + * @param {boolean} enabled True if unified desktop should be enabled. * @see https://developer.chrome.com/extensions/system.display#method-enableUnifiedDesktop */ chrome.system.display.enableUnifiedDesktop = function(enabled) {};
diff --git a/third_party/closure_compiler/interfaces/system_display_interface.js b/third_party/closure_compiler/interfaces/system_display_interface.js index cadc73b..23c9615 100644 --- a/third_party/closure_compiler/interfaces/system_display_interface.js +++ b/third_party/closure_compiler/interfaces/system_display_interface.js
@@ -26,7 +26,7 @@ /** * Updates the properties for the display specified by |id|, according to the * information provided in |info|. On failure, $(ref:runtime.lastError) will - * be set. + * be set. NOTE: This is only available to Chrome OS Kiosk apps and Web UI. * @param {string} id The display's unique identifier. * @param {!chrome.system.display.DisplayProperties} info The information * about display properties that should be changed. A property will be @@ -41,8 +41,9 @@ /** * Enables/disables the unified desktop feature. Note that this simply enables * the feature, but will not change the actual desktop mode. (That is, if the - * desktop is in mirror mode, it will stay in mirror mode) - * @param {boolean} enabled + * desktop is in mirror mode, it will stay in mirror mode) NOTE: This is only + * available to Chrome OS Kiosk apps and Web UI. + * @param {boolean} enabled True if unified desktop should be enabled. * @see https://developer.chrome.com/extensions/system.display#method-enableUnifiedDesktop */ enableUnifiedDesktop: assertNotReached,
diff --git a/third_party/khronos/EGL/egl.h b/third_party/khronos/EGL/egl.h index 99ea342..30ce840 100644 --- a/third_party/khronos/EGL/egl.h +++ b/third_party/khronos/EGL/egl.h
@@ -1,11 +1,12 @@ -/* -*- mode: c; tab-width: 8; -*- */ -/* vi: set sw=4 ts=8: */ -/* Reference version of egl.h for EGL 1.4. - * $Revision: 9356 $ on $Date: 2009-10-21 02:52:25 -0700 (Wed, 21 Oct 2009) $ - */ +#ifndef __egl_h_ +#define __egl_h_ 1 + +#ifdef __cplusplus +extern "C" { +#endif /* -** Copyright (c) 2007-2009 The Khronos Group Inc. +** Copyright (c) 2013-2016 The Khronos Group Inc. ** ** Permission is hereby granted, free of charge, to any person obtaining a ** copy of this software and/or associated documentation files (the @@ -26,304 +27,277 @@ ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. */ +/* +** This header is generated from the Khronos OpenGL / OpenGL ES XML +** API Registry. The current version of the Registry, generator scripts +** used to make the header, and the header can be found at +** http://www.opengl.org/registry/ +** +** Khronos $Revision: 32543 $ on $Date: 2016-03-16 19:41:06 -0700 (Wed, 16 Mar 2016) $ +*/ -#ifndef __egl_h_ -#define __egl_h_ - -/* All platform-dependent types and macro boilerplate (such as EGLAPI - * and EGLAPIENTRY) should go in eglplatform.h. - */ #include <EGL/eglplatform.h> -#ifdef __cplusplus -extern "C" { -#endif +/* Generated on date 20160316 */ -/* EGL Types */ -/* EGLint is defined in eglplatform.h */ +/* Generated C header for: + * API: egl + * Versions considered: .* + * Versions emitted: .* + * Default extensions included: None + * Additional extensions included: _nomatch_^ + * Extensions removed: _nomatch_^ + */ + +#ifndef EGL_VERSION_1_0 +#define EGL_VERSION_1_0 1 typedef unsigned int EGLBoolean; -typedef unsigned int EGLenum; -typedef void *EGLConfig; -typedef void *EGLContext; typedef void *EGLDisplay; +#include <KHR/khrplatform.h> +#include <EGL/eglplatform.h> +typedef void *EGLConfig; typedef void *EGLSurface; -typedef void *EGLClientBuffer; - -/* EGL Versioning */ -#define EGL_VERSION_1_0 1 -#define EGL_VERSION_1_1 1 -#define EGL_VERSION_1_2 1 -#define EGL_VERSION_1_3 1 -#define EGL_VERSION_1_4 1 - -/* EGL Enumerants. Bitmasks and other exceptional cases aside, most - * enums are assigned unique values starting at 0x3000. - */ - -/* EGL aliases */ -#define EGL_FALSE 0 -#define EGL_TRUE 1 - -/* Out-of-band handle values */ -#define EGL_DEFAULT_DISPLAY ((EGLNativeDisplayType)0) -#define EGL_NO_CONTEXT ((EGLContext)0) -#define EGL_NO_DISPLAY ((EGLDisplay)0) -#define EGL_NO_SURFACE ((EGLSurface)0) - -/* Out-of-band attribute value */ -#define EGL_DONT_CARE ((EGLint)-1) - -/* Errors / GetError return values */ -#define EGL_SUCCESS 0x3000 -#define EGL_NOT_INITIALIZED 0x3001 -#define EGL_BAD_ACCESS 0x3002 -#define EGL_BAD_ALLOC 0x3003 -#define EGL_BAD_ATTRIBUTE 0x3004 -#define EGL_BAD_CONFIG 0x3005 -#define EGL_BAD_CONTEXT 0x3006 -#define EGL_BAD_CURRENT_SURFACE 0x3007 -#define EGL_BAD_DISPLAY 0x3008 -#define EGL_BAD_MATCH 0x3009 -#define EGL_BAD_NATIVE_PIXMAP 0x300A -#define EGL_BAD_NATIVE_WINDOW 0x300B -#define EGL_BAD_PARAMETER 0x300C -#define EGL_BAD_SURFACE 0x300D -#define EGL_CONTEXT_LOST 0x300E /* EGL 1.1 - IMG_power_management */ - -/* Reserved 0x300F-0x301F for additional errors */ - -/* Config attributes */ -#define EGL_BUFFER_SIZE 0x3020 -#define EGL_ALPHA_SIZE 0x3021 -#define EGL_BLUE_SIZE 0x3022 -#define EGL_GREEN_SIZE 0x3023 -#define EGL_RED_SIZE 0x3024 -#define EGL_DEPTH_SIZE 0x3025 -#define EGL_STENCIL_SIZE 0x3026 -#define EGL_CONFIG_CAVEAT 0x3027 -#define EGL_CONFIG_ID 0x3028 -#define EGL_LEVEL 0x3029 -#define EGL_MAX_PBUFFER_HEIGHT 0x302A -#define EGL_MAX_PBUFFER_PIXELS 0x302B -#define EGL_MAX_PBUFFER_WIDTH 0x302C -#define EGL_NATIVE_RENDERABLE 0x302D -#define EGL_NATIVE_VISUAL_ID 0x302E -#define EGL_NATIVE_VISUAL_TYPE 0x302F -#define EGL_SAMPLES 0x3031 -#define EGL_SAMPLE_BUFFERS 0x3032 -#define EGL_SURFACE_TYPE 0x3033 -#define EGL_TRANSPARENT_TYPE 0x3034 -#define EGL_TRANSPARENT_BLUE_VALUE 0x3035 -#define EGL_TRANSPARENT_GREEN_VALUE 0x3036 -#define EGL_TRANSPARENT_RED_VALUE 0x3037 -#define EGL_NONE 0x3038 /* Attrib list terminator */ -#define EGL_BIND_TO_TEXTURE_RGB 0x3039 -#define EGL_BIND_TO_TEXTURE_RGBA 0x303A -#define EGL_MIN_SWAP_INTERVAL 0x303B -#define EGL_MAX_SWAP_INTERVAL 0x303C -#define EGL_LUMINANCE_SIZE 0x303D -#define EGL_ALPHA_MASK_SIZE 0x303E -#define EGL_COLOR_BUFFER_TYPE 0x303F -#define EGL_RENDERABLE_TYPE 0x3040 -#define EGL_MATCH_NATIVE_PIXMAP 0x3041 /* Pseudo-attribute (not queryable) */ -#define EGL_CONFORMANT 0x3042 - -/* Reserved 0x3041-0x304F for additional config attributes */ - -/* Config attribute values */ -#define EGL_SLOW_CONFIG 0x3050 /* EGL_CONFIG_CAVEAT value */ -#define EGL_NON_CONFORMANT_CONFIG 0x3051 /* EGL_CONFIG_CAVEAT value */ -#define EGL_TRANSPARENT_RGB 0x3052 /* EGL_TRANSPARENT_TYPE value */ -#define EGL_RGB_BUFFER 0x308E /* EGL_COLOR_BUFFER_TYPE value */ -#define EGL_LUMINANCE_BUFFER 0x308F /* EGL_COLOR_BUFFER_TYPE value */ - -/* More config attribute values, for EGL_TEXTURE_FORMAT */ -#define EGL_NO_TEXTURE 0x305C -#define EGL_TEXTURE_RGB 0x305D -#define EGL_TEXTURE_RGBA 0x305E -#define EGL_TEXTURE_2D 0x305F - -/* Config attribute mask bits */ -#define EGL_PBUFFER_BIT 0x0001 /* EGL_SURFACE_TYPE mask bits */ -#define EGL_PIXMAP_BIT 0x0002 /* EGL_SURFACE_TYPE mask bits */ -#define EGL_WINDOW_BIT 0x0004 /* EGL_SURFACE_TYPE mask bits */ -#define EGL_VG_COLORSPACE_LINEAR_BIT 0x0020 /* EGL_SURFACE_TYPE mask bits */ -#define EGL_VG_ALPHA_FORMAT_PRE_BIT 0x0040 /* EGL_SURFACE_TYPE mask bits */ -#define EGL_MULTISAMPLE_RESOLVE_BOX_BIT 0x0200 /* EGL_SURFACE_TYPE mask bits */ -#define EGL_SWAP_BEHAVIOR_PRESERVED_BIT 0x0400 /* EGL_SURFACE_TYPE mask bits */ - -#define EGL_OPENGL_ES_BIT 0x0001 /* EGL_RENDERABLE_TYPE mask bits */ -#define EGL_OPENVG_BIT 0x0002 /* EGL_RENDERABLE_TYPE mask bits */ -#define EGL_OPENGL_ES2_BIT 0x0004 /* EGL_RENDERABLE_TYPE mask bits */ -#define EGL_OPENGL_BIT 0x0008 /* EGL_RENDERABLE_TYPE mask bits */ - -/* QueryString targets */ -#define EGL_VENDOR 0x3053 -#define EGL_VERSION 0x3054 -#define EGL_EXTENSIONS 0x3055 -#define EGL_CLIENT_APIS 0x308D - -/* QuerySurface / SurfaceAttrib / CreatePbufferSurface targets */ -#define EGL_HEIGHT 0x3056 -#define EGL_WIDTH 0x3057 -#define EGL_LARGEST_PBUFFER 0x3058 -#define EGL_TEXTURE_FORMAT 0x3080 -#define EGL_TEXTURE_TARGET 0x3081 -#define EGL_MIPMAP_TEXTURE 0x3082 -#define EGL_MIPMAP_LEVEL 0x3083 -#define EGL_RENDER_BUFFER 0x3086 -#define EGL_VG_COLORSPACE 0x3087 -#define EGL_VG_ALPHA_FORMAT 0x3088 -#define EGL_HORIZONTAL_RESOLUTION 0x3090 -#define EGL_VERTICAL_RESOLUTION 0x3091 -#define EGL_PIXEL_ASPECT_RATIO 0x3092 -#define EGL_SWAP_BEHAVIOR 0x3093 -#define EGL_MULTISAMPLE_RESOLVE 0x3099 - -/* EGL_RENDER_BUFFER values / BindTexImage / ReleaseTexImage buffer targets */ -#define EGL_BACK_BUFFER 0x3084 -#define EGL_SINGLE_BUFFER 0x3085 - -/* OpenVG color spaces */ -#define EGL_VG_COLORSPACE_sRGB 0x3089 /* EGL_VG_COLORSPACE value */ -#define EGL_VG_COLORSPACE_LINEAR 0x308A /* EGL_VG_COLORSPACE value */ - -/* OpenVG alpha formats */ -#define EGL_VG_ALPHA_FORMAT_NONPRE 0x308B /* EGL_ALPHA_FORMAT value */ -#define EGL_VG_ALPHA_FORMAT_PRE 0x308C /* EGL_ALPHA_FORMAT value */ - -/* Constant scale factor by which fractional display resolutions & - * aspect ratio are scaled when queried as integer values. - */ -#define EGL_DISPLAY_SCALING 10000 - -/* Unknown display resolution/aspect ratio */ -#define EGL_UNKNOWN ((EGLint)-1) - -/* Back buffer swap behaviors */ -#define EGL_BUFFER_PRESERVED 0x3094 /* EGL_SWAP_BEHAVIOR value */ -#define EGL_BUFFER_DESTROYED 0x3095 /* EGL_SWAP_BEHAVIOR value */ - -/* CreatePbufferFromClientBuffer buffer types */ -#define EGL_OPENVG_IMAGE 0x3096 - -/* QueryContext targets */ -#define EGL_CONTEXT_CLIENT_TYPE 0x3097 - -/* CreateContext attributes */ -#define EGL_CONTEXT_CLIENT_VERSION 0x3098 - -/* Multisample resolution behaviors */ -#define EGL_MULTISAMPLE_RESOLVE_DEFAULT 0x309A /* EGL_MULTISAMPLE_RESOLVE value */ -#define EGL_MULTISAMPLE_RESOLVE_BOX 0x309B /* EGL_MULTISAMPLE_RESOLVE value */ - -/* BindAPI/QueryAPI targets */ -#define EGL_OPENGL_ES_API 0x30A0 -#define EGL_OPENVG_API 0x30A1 -#define EGL_OPENGL_API 0x30A2 - -/* GetCurrentSurface targets */ -#define EGL_DRAW 0x3059 -#define EGL_READ 0x305A - -/* WaitNative engines */ -#define EGL_CORE_NATIVE_ENGINE 0x305B - -/* EGL 1.2 tokens renamed for consistency in EGL 1.3 */ -#define EGL_COLORSPACE EGL_VG_COLORSPACE -#define EGL_ALPHA_FORMAT EGL_VG_ALPHA_FORMAT -#define EGL_COLORSPACE_sRGB EGL_VG_COLORSPACE_sRGB -#define EGL_COLORSPACE_LINEAR EGL_VG_COLORSPACE_LINEAR -#define EGL_ALPHA_FORMAT_NONPRE EGL_VG_ALPHA_FORMAT_NONPRE -#define EGL_ALPHA_FORMAT_PRE EGL_VG_ALPHA_FORMAT_PRE - -/* EGL extensions must request enum blocks from the Khronos - * API Registrar, who maintains the enumerant registry. Submit - * a bug in Khronos Bugzilla against task "Registry". - */ - - - -/* EGL Functions */ - -EGLAPI EGLint EGLAPIENTRY eglGetError(void); - -EGLAPI EGLDisplay EGLAPIENTRY eglGetDisplay(EGLNativeDisplayType display_id); -EGLAPI EGLBoolean EGLAPIENTRY eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor); -EGLAPI EGLBoolean EGLAPIENTRY eglTerminate(EGLDisplay dpy); - -EGLAPI const char * EGLAPIENTRY eglQueryString(EGLDisplay dpy, EGLint name); - -EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigs(EGLDisplay dpy, EGLConfig *configs, - EGLint config_size, EGLint *num_config); -EGLAPI EGLBoolean EGLAPIENTRY eglChooseConfig(EGLDisplay dpy, const EGLint *attrib_list, - EGLConfig *configs, EGLint config_size, - EGLint *num_config); -EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config, - EGLint attribute, EGLint *value); - -EGLAPI EGLSurface EGLAPIENTRY eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config, - EGLNativeWindowType win, - const EGLint *attrib_list); -EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferSurface(EGLDisplay dpy, EGLConfig config, - const EGLint *attrib_list); -EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurface(EGLDisplay dpy, EGLConfig config, - EGLNativePixmapType pixmap, - const EGLint *attrib_list); -EGLAPI EGLBoolean EGLAPIENTRY eglDestroySurface(EGLDisplay dpy, EGLSurface surface); -EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurface(EGLDisplay dpy, EGLSurface surface, - EGLint attribute, EGLint *value); - -EGLAPI EGLBoolean EGLAPIENTRY eglBindAPI(EGLenum api); -EGLAPI EGLenum EGLAPIENTRY eglQueryAPI(void); - -EGLAPI EGLBoolean EGLAPIENTRY eglWaitClient(void); - -EGLAPI EGLBoolean EGLAPIENTRY eglReleaseThread(void); - -EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferFromClientBuffer( - EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, - EGLConfig config, const EGLint *attrib_list); - -EGLAPI EGLBoolean EGLAPIENTRY eglSurfaceAttrib(EGLDisplay dpy, EGLSurface surface, - EGLint attribute, EGLint value); -EGLAPI EGLBoolean EGLAPIENTRY eglBindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer); -EGLAPI EGLBoolean EGLAPIENTRY eglReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer); - - -EGLAPI EGLBoolean EGLAPIENTRY eglSwapInterval(EGLDisplay dpy, EGLint interval); - - -EGLAPI EGLContext EGLAPIENTRY eglCreateContext(EGLDisplay dpy, EGLConfig config, - EGLContext share_context, - const EGLint *attrib_list); -EGLAPI EGLBoolean EGLAPIENTRY eglDestroyContext(EGLDisplay dpy, EGLContext ctx); -EGLAPI EGLBoolean EGLAPIENTRY eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, - EGLSurface read, EGLContext ctx); - -EGLAPI EGLContext EGLAPIENTRY eglGetCurrentContext(void); -EGLAPI EGLSurface EGLAPIENTRY eglGetCurrentSurface(EGLint readdraw); -EGLAPI EGLDisplay EGLAPIENTRY eglGetCurrentDisplay(void); -EGLAPI EGLBoolean EGLAPIENTRY eglQueryContext(EGLDisplay dpy, EGLContext ctx, - EGLint attribute, EGLint *value); - -EGLAPI EGLBoolean EGLAPIENTRY eglWaitGL(void); -EGLAPI EGLBoolean EGLAPIENTRY eglWaitNative(EGLint engine); -EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surface); -EGLAPI EGLBoolean EGLAPIENTRY eglCopyBuffers(EGLDisplay dpy, EGLSurface surface, - EGLNativePixmapType target); - -/* This is a generic function pointer type, whose name indicates it must - * be cast to the proper type *and calling convention* before use. - */ +typedef void *EGLContext; typedef void (*__eglMustCastToProperFunctionPointerType)(void); +#define EGL_ALPHA_SIZE 0x3021 +#define EGL_BAD_ACCESS 0x3002 +#define EGL_BAD_ALLOC 0x3003 +#define EGL_BAD_ATTRIBUTE 0x3004 +#define EGL_BAD_CONFIG 0x3005 +#define EGL_BAD_CONTEXT 0x3006 +#define EGL_BAD_CURRENT_SURFACE 0x3007 +#define EGL_BAD_DISPLAY 0x3008 +#define EGL_BAD_MATCH 0x3009 +#define EGL_BAD_NATIVE_PIXMAP 0x300A +#define EGL_BAD_NATIVE_WINDOW 0x300B +#define EGL_BAD_PARAMETER 0x300C +#define EGL_BAD_SURFACE 0x300D +#define EGL_BLUE_SIZE 0x3022 +#define EGL_BUFFER_SIZE 0x3020 +#define EGL_CONFIG_CAVEAT 0x3027 +#define EGL_CONFIG_ID 0x3028 +#define EGL_CORE_NATIVE_ENGINE 0x305B +#define EGL_DEPTH_SIZE 0x3025 +#define EGL_DONT_CARE ((EGLint)-1) +#define EGL_DRAW 0x3059 +#define EGL_EXTENSIONS 0x3055 +#define EGL_FALSE 0 +#define EGL_GREEN_SIZE 0x3023 +#define EGL_HEIGHT 0x3056 +#define EGL_LARGEST_PBUFFER 0x3058 +#define EGL_LEVEL 0x3029 +#define EGL_MAX_PBUFFER_HEIGHT 0x302A +#define EGL_MAX_PBUFFER_PIXELS 0x302B +#define EGL_MAX_PBUFFER_WIDTH 0x302C +#define EGL_NATIVE_RENDERABLE 0x302D +#define EGL_NATIVE_VISUAL_ID 0x302E +#define EGL_NATIVE_VISUAL_TYPE 0x302F +#define EGL_NONE 0x3038 +#define EGL_NON_CONFORMANT_CONFIG 0x3051 +#define EGL_NOT_INITIALIZED 0x3001 +#define EGL_NO_CONTEXT ((EGLContext)0) +#define EGL_NO_DISPLAY ((EGLDisplay)0) +#define EGL_NO_SURFACE ((EGLSurface)0) +#define EGL_PBUFFER_BIT 0x0001 +#define EGL_PIXMAP_BIT 0x0002 +#define EGL_READ 0x305A +#define EGL_RED_SIZE 0x3024 +#define EGL_SAMPLES 0x3031 +#define EGL_SAMPLE_BUFFERS 0x3032 +#define EGL_SLOW_CONFIG 0x3050 +#define EGL_STENCIL_SIZE 0x3026 +#define EGL_SUCCESS 0x3000 +#define EGL_SURFACE_TYPE 0x3033 +#define EGL_TRANSPARENT_BLUE_VALUE 0x3035 +#define EGL_TRANSPARENT_GREEN_VALUE 0x3036 +#define EGL_TRANSPARENT_RED_VALUE 0x3037 +#define EGL_TRANSPARENT_RGB 0x3052 +#define EGL_TRANSPARENT_TYPE 0x3034 +#define EGL_TRUE 1 +#define EGL_VENDOR 0x3053 +#define EGL_VERSION 0x3054 +#define EGL_WIDTH 0x3057 +#define EGL_WINDOW_BIT 0x0004 +EGLAPI EGLBoolean EGLAPIENTRY eglChooseConfig (EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config); +EGLAPI EGLBoolean EGLAPIENTRY eglCopyBuffers (EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target); +EGLAPI EGLContext EGLAPIENTRY eglCreateContext (EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list); +EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferSurface (EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list); +EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurface (EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, const EGLint *attrib_list); +EGLAPI EGLSurface EGLAPIENTRY eglCreateWindowSurface (EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint *attrib_list); +EGLAPI EGLBoolean EGLAPIENTRY eglDestroyContext (EGLDisplay dpy, EGLContext ctx); +EGLAPI EGLBoolean EGLAPIENTRY eglDestroySurface (EGLDisplay dpy, EGLSurface surface); +EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigAttrib (EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value); +EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigs (EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config); +EGLAPI EGLDisplay EGLAPIENTRY eglGetCurrentDisplay (void); +EGLAPI EGLSurface EGLAPIENTRY eglGetCurrentSurface (EGLint readdraw); +EGLAPI EGLDisplay EGLAPIENTRY eglGetDisplay (EGLNativeDisplayType display_id); +EGLAPI EGLint EGLAPIENTRY eglGetError (void); +EGLAPI __eglMustCastToProperFunctionPointerType EGLAPIENTRY eglGetProcAddress (const char *procname); +EGLAPI EGLBoolean EGLAPIENTRY eglInitialize (EGLDisplay dpy, EGLint *major, EGLint *minor); +EGLAPI EGLBoolean EGLAPIENTRY eglMakeCurrent (EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx); +EGLAPI EGLBoolean EGLAPIENTRY eglQueryContext (EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value); +EGLAPI const char *EGLAPIENTRY eglQueryString (EGLDisplay dpy, EGLint name); +EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurface (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value); +EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers (EGLDisplay dpy, EGLSurface surface); +EGLAPI EGLBoolean EGLAPIENTRY eglTerminate (EGLDisplay dpy); +EGLAPI EGLBoolean EGLAPIENTRY eglWaitGL (void); +EGLAPI EGLBoolean EGLAPIENTRY eglWaitNative (EGLint engine); +#endif /* EGL_VERSION_1_0 */ -/* Now, define eglGetProcAddress using the generic function ptr. type */ -EGLAPI __eglMustCastToProperFunctionPointerType EGLAPIENTRY - eglGetProcAddress(const char *procname); +#ifndef EGL_VERSION_1_1 +#define EGL_VERSION_1_1 1 +#define EGL_BACK_BUFFER 0x3084 +#define EGL_BIND_TO_TEXTURE_RGB 0x3039 +#define EGL_BIND_TO_TEXTURE_RGBA 0x303A +#define EGL_CONTEXT_LOST 0x300E +#define EGL_MIN_SWAP_INTERVAL 0x303B +#define EGL_MAX_SWAP_INTERVAL 0x303C +#define EGL_MIPMAP_TEXTURE 0x3082 +#define EGL_MIPMAP_LEVEL 0x3083 +#define EGL_NO_TEXTURE 0x305C +#define EGL_TEXTURE_2D 0x305F +#define EGL_TEXTURE_FORMAT 0x3080 +#define EGL_TEXTURE_RGB 0x305D +#define EGL_TEXTURE_RGBA 0x305E +#define EGL_TEXTURE_TARGET 0x3081 +EGLAPI EGLBoolean EGLAPIENTRY eglBindTexImage (EGLDisplay dpy, EGLSurface surface, EGLint buffer); +EGLAPI EGLBoolean EGLAPIENTRY eglReleaseTexImage (EGLDisplay dpy, EGLSurface surface, EGLint buffer); +EGLAPI EGLBoolean EGLAPIENTRY eglSurfaceAttrib (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value); +EGLAPI EGLBoolean EGLAPIENTRY eglSwapInterval (EGLDisplay dpy, EGLint interval); +#endif /* EGL_VERSION_1_1 */ + +#ifndef EGL_VERSION_1_2 +#define EGL_VERSION_1_2 1 +typedef unsigned int EGLenum; +typedef void *EGLClientBuffer; +#define EGL_ALPHA_FORMAT 0x3088 +#define EGL_ALPHA_FORMAT_NONPRE 0x308B +#define EGL_ALPHA_FORMAT_PRE 0x308C +#define EGL_ALPHA_MASK_SIZE 0x303E +#define EGL_BUFFER_PRESERVED 0x3094 +#define EGL_BUFFER_DESTROYED 0x3095 +#define EGL_CLIENT_APIS 0x308D +#define EGL_COLORSPACE 0x3087 +#define EGL_COLORSPACE_sRGB 0x3089 +#define EGL_COLORSPACE_LINEAR 0x308A +#define EGL_COLOR_BUFFER_TYPE 0x303F +#define EGL_CONTEXT_CLIENT_TYPE 0x3097 +#define EGL_DISPLAY_SCALING 10000 +#define EGL_HORIZONTAL_RESOLUTION 0x3090 +#define EGL_LUMINANCE_BUFFER 0x308F +#define EGL_LUMINANCE_SIZE 0x303D +#define EGL_OPENGL_ES_BIT 0x0001 +#define EGL_OPENVG_BIT 0x0002 +#define EGL_OPENGL_ES_API 0x30A0 +#define EGL_OPENVG_API 0x30A1 +#define EGL_OPENVG_IMAGE 0x3096 +#define EGL_PIXEL_ASPECT_RATIO 0x3092 +#define EGL_RENDERABLE_TYPE 0x3040 +#define EGL_RENDER_BUFFER 0x3086 +#define EGL_RGB_BUFFER 0x308E +#define EGL_SINGLE_BUFFER 0x3085 +#define EGL_SWAP_BEHAVIOR 0x3093 +#define EGL_UNKNOWN ((EGLint)-1) +#define EGL_VERTICAL_RESOLUTION 0x3091 +EGLAPI EGLBoolean EGLAPIENTRY eglBindAPI (EGLenum api); +EGLAPI EGLenum EGLAPIENTRY eglQueryAPI (void); +EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferFromClientBuffer (EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list); +EGLAPI EGLBoolean EGLAPIENTRY eglReleaseThread (void); +EGLAPI EGLBoolean EGLAPIENTRY eglWaitClient (void); +#endif /* EGL_VERSION_1_2 */ + +#ifndef EGL_VERSION_1_3 +#define EGL_VERSION_1_3 1 +#define EGL_CONFORMANT 0x3042 +#define EGL_CONTEXT_CLIENT_VERSION 0x3098 +#define EGL_MATCH_NATIVE_PIXMAP 0x3041 +#define EGL_OPENGL_ES2_BIT 0x0004 +#define EGL_VG_ALPHA_FORMAT 0x3088 +#define EGL_VG_ALPHA_FORMAT_NONPRE 0x308B +#define EGL_VG_ALPHA_FORMAT_PRE 0x308C +#define EGL_VG_ALPHA_FORMAT_PRE_BIT 0x0040 +#define EGL_VG_COLORSPACE 0x3087 +#define EGL_VG_COLORSPACE_sRGB 0x3089 +#define EGL_VG_COLORSPACE_LINEAR 0x308A +#define EGL_VG_COLORSPACE_LINEAR_BIT 0x0020 +#endif /* EGL_VERSION_1_3 */ + +#ifndef EGL_VERSION_1_4 +#define EGL_VERSION_1_4 1 +#define EGL_DEFAULT_DISPLAY ((EGLNativeDisplayType)0) +#define EGL_MULTISAMPLE_RESOLVE_BOX_BIT 0x0200 +#define EGL_MULTISAMPLE_RESOLVE 0x3099 +#define EGL_MULTISAMPLE_RESOLVE_DEFAULT 0x309A +#define EGL_MULTISAMPLE_RESOLVE_BOX 0x309B +#define EGL_OPENGL_API 0x30A2 +#define EGL_OPENGL_BIT 0x0008 +#define EGL_SWAP_BEHAVIOR_PRESERVED_BIT 0x0400 +EGLAPI EGLContext EGLAPIENTRY eglGetCurrentContext (void); +#endif /* EGL_VERSION_1_4 */ + +#ifndef EGL_VERSION_1_5 +#define EGL_VERSION_1_5 1 +typedef void *EGLSync; +typedef intptr_t EGLAttrib; +typedef khronos_utime_nanoseconds_t EGLTime; +typedef void *EGLImage; +#define EGL_CONTEXT_MAJOR_VERSION 0x3098 +#define EGL_CONTEXT_MINOR_VERSION 0x30FB +#define EGL_CONTEXT_OPENGL_PROFILE_MASK 0x30FD +#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY 0x31BD +#define EGL_NO_RESET_NOTIFICATION 0x31BE +#define EGL_LOSE_CONTEXT_ON_RESET 0x31BF +#define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT 0x00000001 +#define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT 0x00000002 +#define EGL_CONTEXT_OPENGL_DEBUG 0x31B0 +#define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE 0x31B1 +#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS 0x31B2 +#define EGL_OPENGL_ES3_BIT 0x00000040 +#define EGL_CL_EVENT_HANDLE 0x309C +#define EGL_SYNC_CL_EVENT 0x30FE +#define EGL_SYNC_CL_EVENT_COMPLETE 0x30FF +#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE 0x30F0 +#define EGL_SYNC_TYPE 0x30F7 +#define EGL_SYNC_STATUS 0x30F1 +#define EGL_SYNC_CONDITION 0x30F8 +#define EGL_SIGNALED 0x30F2 +#define EGL_UNSIGNALED 0x30F3 +#define EGL_SYNC_FLUSH_COMMANDS_BIT 0x0001 +#define EGL_FOREVER 0xFFFFFFFFFFFFFFFFull +#define EGL_TIMEOUT_EXPIRED 0x30F5 +#define EGL_CONDITION_SATISFIED 0x30F6 +#define EGL_NO_SYNC ((EGLSync)0) +#define EGL_SYNC_FENCE 0x30F9 +#define EGL_GL_COLORSPACE 0x309D +#define EGL_GL_COLORSPACE_SRGB 0x3089 +#define EGL_GL_COLORSPACE_LINEAR 0x308A +#define EGL_GL_RENDERBUFFER 0x30B9 +#define EGL_GL_TEXTURE_2D 0x30B1 +#define EGL_GL_TEXTURE_LEVEL 0x30BC +#define EGL_GL_TEXTURE_3D 0x30B2 +#define EGL_GL_TEXTURE_ZOFFSET 0x30BD +#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x30B3 +#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x30B4 +#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x30B5 +#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x30B6 +#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x30B7 +#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x30B8 +#define EGL_IMAGE_PRESERVED 0x30D2 +#define EGL_NO_IMAGE ((EGLImage)0) +EGLAPI EGLSync EGLAPIENTRY eglCreateSync (EGLDisplay dpy, EGLenum type, const EGLAttrib *attrib_list); +EGLAPI EGLBoolean EGLAPIENTRY eglDestroySync (EGLDisplay dpy, EGLSync sync); +EGLAPI EGLint EGLAPIENTRY eglClientWaitSync (EGLDisplay dpy, EGLSync sync, EGLint flags, EGLTime timeout); +EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttrib (EGLDisplay dpy, EGLSync sync, EGLint attribute, EGLAttrib *value); +EGLAPI EGLImage EGLAPIENTRY eglCreateImage (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLAttrib *attrib_list); +EGLAPI EGLBoolean EGLAPIENTRY eglDestroyImage (EGLDisplay dpy, EGLImage image); +EGLAPI EGLDisplay EGLAPIENTRY eglGetPlatformDisplay (EGLenum platform, void *native_display, const EGLAttrib *attrib_list); +EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformWindowSurface (EGLDisplay dpy, EGLConfig config, void *native_window, const EGLAttrib *attrib_list); +EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformPixmapSurface (EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLAttrib *attrib_list); +EGLAPI EGLBoolean EGLAPIENTRY eglWaitSync (EGLDisplay dpy, EGLSync sync, EGLint flags); +#endif /* EGL_VERSION_1_5 */ #ifdef __cplusplus } #endif -#endif /* __egl_h_ */ +#endif
diff --git a/third_party/khronos/README.chromium b/third_party/khronos/README.chromium index 85ff60a..3d9c6c1 100644 --- a/third_party/khronos/README.chromium +++ b/third_party/khronos/README.chromium
@@ -2,7 +2,7 @@ Short Name: khronos_headers URL: http://www.khronos.org/registry Version: unknown -Date: 2014-11-26 +Date: 2016-04-18 License: MIT/X11, SGI Free Software License B Security Critical: no
diff --git a/third_party/libxml/README.chromium b/third_party/libxml/README.chromium index d445e715..ba26d094 100644 --- a/third_party/libxml/README.chromium +++ b/third_party/libxml/README.chromium
@@ -16,6 +16,8 @@ - Include fix for runtime blowups on larger xpath expressions, https://bugzilla.gnome.org/show_bug.cgi?id=760325 - Fix printf format specifiers, https://chromium.googlesource.com/chromium/src/+/d31995076e55f1aac2f935c53b585a90ece27a11 - Add workaround for VS 2015 Update 2 code-gen bug - crbug.com/599427 +- Add patch from https://bugzilla.gnome.org/show_bug.cgi?id=758588 for + https://crbug.com/595262#c16 To import a new snapshot:
diff --git a/third_party/libxml/src/parser.c b/third_party/libxml/src/parser.c index 0677030c..71315cff 100644 --- a/third_party/libxml/src/parser.c +++ b/third_party/libxml/src/parser.c
@@ -9825,8 +9825,9 @@ } SKIP(2); - if ((tlen > 0) && (xmlStrncmp(ctxt->input->cur, ctxt->name, tlen) == 0)) { - if (ctxt->input->cur[tlen] == '>') { + size_t curLength = ctxt->input->end - ctxt->input->cur; + if ((tlen > 0) && (curLength >= (size_t)tlen) && (xmlStrncmp(ctxt->input->cur, ctxt->name, tlen) == 0)) { + if ((curLength >= (size_t)(tlen + 1)) && (ctxt->input->cur[tlen] == '>')) { ctxt->input->cur += tlen + 1; ctxt->input->col += tlen + 1; goto done;
diff --git a/tools/android/audio_focus_grabber/java/src/org/chromium/tools/audio_focus_grabber/AudioFocusGrabberActivity.java b/tools/android/audio_focus_grabber/java/src/org/chromium/tools/audio_focus_grabber/AudioFocusGrabberActivity.java index 7030b8f..d8e36969 100644 --- a/tools/android/audio_focus_grabber/java/src/org/chromium/tools/audio_focus_grabber/AudioFocusGrabberActivity.java +++ b/tools/android/audio_focus_grabber/java/src/org/chromium/tools/audio_focus_grabber/AudioFocusGrabberActivity.java
@@ -38,6 +38,8 @@ case R.id.button_hide_notification: intent.setAction(AudioFocusGrabberListenerService.ACTION_HIDE_NOTIFICATION); break; + default: + break; } startService(intent); }
diff --git a/tools/android/audio_focus_grabber/java/src/org/chromium/tools/audio_focus_grabber/AudioFocusGrabberListenerService.java b/tools/android/audio_focus_grabber/java/src/org/chromium/tools/audio_focus_grabber/AudioFocusGrabberListenerService.java index 9981fd8..44b9806b9 100644 --- a/tools/android/audio_focus_grabber/java/src/org/chromium/tools/audio_focus_grabber/AudioFocusGrabberListenerService.java +++ b/tools/android/audio_focus_grabber/java/src/org/chromium/tools/audio_focus_grabber/AudioFocusGrabberListenerService.java
@@ -144,6 +144,8 @@ mMediaPlayer.setVolume(0.1f, 0.1f); mIsDucking = true; break; + default: + break; } } };
diff --git a/tools/android/loading/PRESUBMIT.py b/tools/android/loading/PRESUBMIT.py index b9bcc191..cd740ef 100644 --- a/tools/android/loading/PRESUBMIT.py +++ b/tools/android/loading/PRESUBMIT.py
@@ -11,7 +11,7 @@ def CommonChecks(input_api, output_api): output = [] - blacklist = [] + blacklist = [r'cloud/frontend/lib/*'] output.extend(input_api.canned_checks.RunPylint( input_api, output_api, black_list=blacklist)) output.extend(input_api.canned_checks.RunUnitTests(
diff --git a/tools/android/loading/cloud/__init__.py b/tools/android/loading/cloud/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/android/loading/cloud/__init__.py
diff --git a/tools/android/loading/gce/README.md b/tools/android/loading/cloud/backend/README.md similarity index 64% rename from tools/android/loading/gce/README.md rename to tools/android/loading/cloud/backend/README.md index 2bbd06b7..5f534f22 100644 --- a/tools/android/loading/gce/README.md +++ b/tools/android/loading/cloud/backend/README.md
@@ -20,7 +20,7 @@ # CLOUD_STORAGE_PATH is the path in Google Cloud Storage under which the # Clovis deployment will be uploaded. -./tools/android/loading/gce/deploy.sh $BUILD_DIR $CLOUD_STORAGE_PATH +./tools/android/loading/cloud/backend/deploy.sh $BUILD_DIR $CLOUD_STORAGE_PATH ``` ## Start the app in the cloud @@ -32,15 +32,15 @@ --machine-type n1-standard-1 \ --image ubuntu-14-04 \ --zone europe-west1-c \ - --scopes cloud-platform \ - --metadata cloud-storage-path=$CLOUD_STORAGE_PATH,auto-start=true \ + --scopes cloud-platform,https://www.googleapis.com/auth/cloud-taskqueue \ + --metadata cloud-storage-path=$CLOUD_STORAGE_PATH,taskqueue_tag=some_tag \ --metadata-from-file \ - startup-script=$CHROMIUM_SRC/tools/android/loading/gce/startup-script.sh + startup-script=$CHROMIUM_SRC/tools/android/loading/cloud/backend/startup-script.sh ``` **Note:** To start an instance without automatically starting the app on it, -remove the `--metadata auto-start=true` argument. This can be useful when doing -iterative development on the instance, to be able to restart the app manually. +add a `auto-start=false` metadata. This can be useful when doing iterative +development on the instance, to be able to restart the app manually. This should output the IP address of the instance. Otherwise the IP address can be retrieved by doing: @@ -60,24 +60,9 @@ ## Use the app -Check that `http://<instance-ip>:8080/test` prints `hello` when opened in a -browser. - -To send a list of URLs to process: - -```shell -curl -X POST -d @urls.json http://<instance-ip>:8080/set_tasks -``` - -where `urls.json` is a JSON dictionary with the keys: - -* `urls`: array of URLs -* `repeat_count`: Number of times each URL will be loaded. Each load of a URL - generates a separate trace file. Optional. -* `emulate_device`: Name of the device to emulate. Optional. -* `emulate_network`: Type of network emulation. Optional. - -You can follow the progress at `http://<instance-ip>:8080/status`. +Create tasks from the associated AppEngine application, see [documentation][3]. +Make sure the `taskqueue_tag` of the AppEngine request matches the one of the +ComputeEngine instances. ## Stop the app in the cloud @@ -98,7 +83,16 @@ ```shell virtualenv env source env/bin/activate -pip install -r $CHROMIUM_SRC/tools/android/loading/gce/pip_requirements.txt +pip install -r \ + $CHROMIUM_SRC/tools/android/loading/cloud/backend/pip_requirements.txt +``` + +The first time, you may need to get more access tokens: + +```shell +gcloud beta auth application-default login --scopes \ + https://www.googleapis.com/auth/cloud-taskqueue \ + https://www.googleapis.com/auth/cloud-platform ``` Create a JSON file describing the deployment configuration: @@ -115,7 +109,8 @@ "project_name" : "$PROJECT_NAME", "cloud_storage_path" : "$CLOUD_STORAGE_PATH", "chrome_path" : "$CHROME_PATH", - "src_path" : "$CHROMIUM_SRC" + "src_path" : "$CHROMIUM_SRC", + "taskqueue_tag" : "some_tag" } EOF ``` @@ -123,12 +118,11 @@ Launch the app, passing the path to the deployment configuration file: ```shell -gunicorn --workers=1 --bind 127.0.0.1:8080 \ - --pythonpath $CHROMIUM_SRC/tools/android/loading/gce \ - 'main:StartApp('\"$CONFIG_FILE\"')' +python $CHROMIUM_SRC/tools/android/loading/cloud/backend/worker.py \ + --config $CONFIG_FILE ``` -You can now [use the app][2], which is located at http://localhost:8080. +You can now [use the app][2]. Tear down the local environment: @@ -138,3 +132,4 @@ [1]: https://cloud.google.com/sdk [2]: #Use-the-app +[3]: ../frontend/README.md
diff --git a/tools/android/loading/gce/deploy.sh b/tools/android/loading/cloud/backend/deploy.sh similarity index 87% rename from tools/android/loading/gce/deploy.sh rename to tools/android/loading/cloud/backend/deploy.sh index 2362414b..cbab438 100755 --- a/tools/android/loading/gce/deploy.sh +++ b/tools/android/loading/cloud/backend/deploy.sh
@@ -21,9 +21,13 @@ tmp_src_dir=$tmpdir/$src_suffix # Copy files from tools/android/loading. -mkdir -p $tmp_src_dir/tools/android/loading +mkdir -p $tmp_src_dir/tools/android/loading/cloud +cp -r tools/android/loading/cloud/backend \ + $tmp_src_dir/tools/android/loading/cloud/ +cp -r tools/android/loading/cloud/common \ + $tmp_src_dir/tools/android/loading/cloud/ cp tools/android/loading/*.py $tmp_src_dir/tools/android/loading -cp -r tools/android/loading/gce $tmp_src_dir/tools/android/loading +cp tools/android/loading/cloud/*.py $tmp_src_dir/tools/android/loading/cloud # Copy other dependencies. mkdir $tmp_src_dir/third_party
diff --git a/tools/android/loading/gce/google_storage_accessor.py b/tools/android/loading/cloud/backend/google_storage_accessor.py similarity index 91% rename from tools/android/loading/gce/google_storage_accessor.py rename to tools/android/loading/cloud/backend/google_storage_accessor.py index 59c47da..86e238e8 100644 --- a/tools/android/loading/gce/google_storage_accessor.py +++ b/tools/android/loading/cloud/backend/google_storage_accessor.py
@@ -3,17 +3,16 @@ # found in the LICENSE file. from gcloud import storage -from oauth2client.client import GoogleCredentials class GoogleStorageAccessor(object): """Utility class providing helpers for Google Cloud Storage. """ - def __init__(self, project_name, bucket_name): + def __init__(self, credentials, project_name, bucket_name): """project_name is the name of the Google Cloud project. bucket_name is the name of the bucket that is used for Cloud Storage calls. """ - self._credentials = GoogleCredentials.get_application_default() + self._credentials = credentials self._project_name = project_name self._bucket_name = bucket_name
diff --git a/tools/android/loading/cloud/backend/pip_requirements.txt b/tools/android/loading/cloud/backend/pip_requirements.txt new file mode 100644 index 0000000..390863a2 --- /dev/null +++ b/tools/android/loading/cloud/backend/pip_requirements.txt
@@ -0,0 +1,3 @@ +gcloud==0.10.1 +google-api-python-client==1.5.0 +psutil==4.1.0
diff --git a/tools/android/loading/gce/startup-script.sh b/tools/android/loading/cloud/backend/startup-script.sh similarity index 85% rename from tools/android/loading/gce/startup-script.sh rename to tools/android/loading/cloud/backend/startup-script.sh index 94edb22..e429c1e 100644 --- a/tools/android/loading/gce/startup-script.sh +++ b/tools/android/loading/cloud/backend/startup-script.sh
@@ -38,7 +38,7 @@ # Download the Clovis deployment from Google Cloud Storage and unzip it. # It is expected that the contents of the deployment have been generated using -# the tools/android/loading/gce/deploy.sh script. +# the tools/android/loading/cloud/backend/deploy.sh script. CLOUD_STORAGE_PATH=`get_instance_metadata cloud-storage-path` DEPLOYMENT_PATH=$CLOUD_STORAGE_PATH/deployment @@ -49,8 +49,8 @@ # Install app dependencies virtualenv /opt/app/clovis/env -/opt/app/clovis/env/bin/pip install \ - -r /opt/app/clovis/src/tools/android/loading/gce/pip_requirements.txt +/opt/app/clovis/env/bin/pip install -r \ + /opt/app/clovis/src/tools/android/loading/cloud/backend/pip_requirements.txt mkdir /opt/app/clovis/binaries gsutil cp gs://$DEPLOYMENT_PATH/binaries/* /opt/app/clovis/binaries/ @@ -66,12 +66,14 @@ # Create the configuration file for this deployment. DEPLOYMENT_CONFIG_PATH=/opt/app/clovis/deployment_config.json +TASKQUEUE_TAG=`get_instance_metadata taskqueue_tag` cat >$DEPLOYMENT_CONFIG_PATH << EOF { "project_name" : "$PROJECTID", "cloud_storage_path" : "$CLOUD_STORAGE_PATH", "chrome_path" : "/opt/app/clovis/binaries/chrome", - "src_path" : "/opt/app/clovis/src" + "src_path" : "/opt/app/clovis/src", + "taskqueue_tag" : "$TASKQUEUE_TAG" } EOF @@ -79,17 +81,15 @@ AUTO_START=`get_instance_metadata auto-start` # Exit early if auto start is not enabled. -if [ "$AUTO_START" != "true" ]; then +if [ "$AUTO_START" == "false" ]; then exit 1 fi -# Configure supervisor to start gunicorn inside of our virtualenv and run the -# applicaiton. +# Configure supervisor to start the worker inside of our virtualenv. cat >/etc/supervisor/conf.d/python-app.conf << EOF [program:pythonapp] -directory=/opt/app/clovis/src/tools/android/loading/gce -command=/opt/app/clovis/env/bin/gunicorn --workers=1 --bind 0.0.0.0:8080 \ - 'main:StartApp('\"$DEPLOYMENT_CONFIG_PATH\"')' +directory=/opt/app/clovis/src/tools/android/loading/cloud/backend +command=python worker.py --config $DEPLOYMENT_CONFIG_PATH autostart=true autorestart=true user=pythonapp
diff --git a/tools/android/loading/cloud/backend/worker.py b/tools/android/loading/cloud/backend/worker.py new file mode 100644 index 0000000..b9900cec --- /dev/null +++ b/tools/android/loading/cloud/backend/worker.py
@@ -0,0 +1,254 @@ +# 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 argparse +import json +import logging +import os +import re +import sys +import time + +from googleapiclient import discovery +from oauth2client.client import GoogleCredentials + +# NOTE: The parent directory needs to be first in sys.path to avoid conflicts +# with catapult modules that have colliding names, as catapult inserts itself +# into the path as the second element. This is an ugly and fragile hack. +sys.path.insert(0, + os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir, + os.pardir)) +import controller +from cloud.common.clovis_task import ClovisTask +from google_storage_accessor import GoogleStorageAccessor +import loading_trace +from loading_trace_database import LoadingTraceDatabase +import options + + +class Worker(object): + def __init__(self, config, logger): + """See README.md for the config format.""" + self._project_name = config['project_name'] + self._taskqueue_tag = config['taskqueue_tag'] + self._credentials = GoogleCredentials.get_application_default() + self._logger = logger + + # Separate the cloud storage path into the bucket and the base path under + # the bucket. + storage_path_components = config['cloud_storage_path'].split('/') + self._bucket_name = storage_path_components[0] + self._base_path_in_bucket = '' + if len(storage_path_components) > 1: + self._base_path_in_bucket = '/'.join(storage_path_components[1:]) + if not self._base_path_in_bucket.endswith('/'): + self._base_path_in_bucket += '/' + + # TODO: improve the trace database to support concurrent access. + self._traces_dir = self._base_path_in_bucket + 'traces/' + self._trace_database = LoadingTraceDatabase({}) + + self._src_path = config['src_path'] + self._google_storage_accessor = GoogleStorageAccessor( + credentials=self._credentials, project_name=self._project_name, + bucket_name=self._bucket_name) + + # Initialize the global options that will be used during trace generation. + options.OPTIONS.ParseArgs([]) + options.OPTIONS.local_binary = config['chrome_path'] + + def Start(self): + """Main worker loop. + + Repeatedly pulls tasks from the task queue and processes them. Returns when + the queue is empty. + """ + task_api = discovery.build('taskqueue', 'v1beta2', + credentials=self._credentials) + queue_name = 'clovis-queue' + # Workaround for + # https://code.google.com/p/googleappengine/issues/detail?id=10199 + project = 's~' + self._project_name + + while True: + self._logger.debug('Fetching new task.') + (clovis_task, task_id) = self._FetchClovisTask(project, task_api, + queue_name) + if not clovis_task: + if self._trace_database.ToJsonDict(): + self._logger.info('No remaining tasks in the queue.') + break + else: + delay_seconds = 60 + self._logger.info( + 'Nothing in the queue, retrying in %i seconds.' % delay_seconds) + time.sleep(delay_seconds) + continue + + self._logger.info('Processing task %s' % task_id) + self._ProcessClovisTask(clovis_task) + self._logger.debug('Deleting task %s' % task_id) + task_api.tasks().delete(project=project, taskqueue=queue_name, + task=task_id).execute() + self._logger.info('Finished task %s' % task_id) + self._Finalize() + + def _FetchClovisTask(self, project_name, task_api, queue_name): + """Fetches a ClovisTask from the task queue. + + Params: + project_name(str): The name of the Google Cloud project. + task_api: The TaskQueue service. + queue_name(str): The name of the task queue. + + Returns: + (ClovisTask, str): The fetched ClovisTask and its task ID, or (None, None) + if no tasks are found. + """ + response = task_api.tasks().lease( + project=project_name, taskqueue=queue_name, numTasks=1, leaseSecs=180, + groupByTag=True, tag=self._taskqueue_tag).execute() + if (not response.get('items')) or (len(response['items']) < 1): + return (None, None) + + google_task = response['items'][0] + task_id = google_task['id'] + clovis_task = ClovisTask.FromBase64(google_task['payloadBase64']) + return (clovis_task, task_id) + + def _Finalize(self): + """Called before exiting.""" + self._logger.info('Uploading trace database') + self._google_storage_accessor.UploadString( + json.dumps(self._trace_database.ToJsonDict(), indent=2), + self._traces_dir + 'trace_database.json') + # TODO(droger): Implement automatic instance destruction. + self._logger.info('Done') + + + def _GenerateTrace(self, url, emulate_device, emulate_network, filename, + log_filename): + """ Generates a trace. + + Args: + url: URL as a string. + emulate_device: Name of the device to emulate. Empty for no emulation. + emulate_network: Type of network emulation. Empty for no emulation. + filename: Name of the file where the trace is saved. + log_filename: Name of the file where standard output and errors are + logged. + + Returns: + A dictionary of metadata about the trace, including a 'succeeded' field + indicating whether the trace was successfully generated. + """ + try: + os.remove(filename) # Remove any existing trace for this URL. + except OSError: + pass # Nothing to remove. + + if not url.startswith('http') and not url.startswith('file'): + url = 'http://' + url + + old_stdout = sys.stdout + old_stderr = sys.stderr + + trace_metadata = { 'succeeded' : False, 'url' : url } + trace = None + with open(log_filename, 'w') as sys.stdout: + try: + sys.stderr = sys.stdout + + # Set up the controller. + chrome_ctl = controller.LocalChromeController() + chrome_ctl.SetHeadless(True) + if emulate_device: + chrome_ctl.SetDeviceEmulation(emulate_device) + if emulate_network: + chrome_ctl.SetNetworkEmulation(emulate_network) + + # Record and write the trace. + with chrome_ctl.OpenWithRedirection(sys.stdout, + sys.stderr) as connection: + connection.ClearCache() + trace = loading_trace.LoadingTrace.RecordUrlNavigation( + url, connection, chrome_ctl.ChromeMetadata()) + trace_metadata['succeeded'] = True + trace_metadata.update(trace.ToJsonDict()[trace._METADATA_KEY]) + except Exception as e: + sys.stderr.write(str(e)) + + if trace: + with open(filename, 'w') as f: + json.dump(trace.ToJsonDict(), f, sort_keys=True, indent=2) + + sys.stdout = old_stdout + sys.stderr = old_stderr + + return trace_metadata + + def _ProcessClovisTask(self, clovis_task): + """Processes one clovis_task.""" + if clovis_task.Action() != 'trace': + self._logger.error('Unsupported task action: %s' % clovis_task.Action()) + return + + # Extract the task parameters. + params = clovis_task.Params() + urls = params['urls'] + repeat_count = params.get('repeat_count', 1) + emulate_device = params.get('emulate_device') + emulate_network = params.get('emulate_network') + + failures_dir = self._base_path_in_bucket + 'failures/' + # TODO(blundell): Fix this up. + logs_dir = self._base_path_in_bucket + 'analyze_logs/' + log_filename = 'analyze.log' + # Avoid special characters in storage object names + pattern = re.compile(r"[#\?\[\]\*/]") + + while len(urls) > 0: + url = urls.pop() + local_filename = pattern.sub('_', url) + for repeat in range(repeat_count): + self._logger.debug('Generating trace for URL: %s' % url) + remote_filename = local_filename + '/' + str(repeat) + trace_metadata = self._GenerateTrace( + url, emulate_device, emulate_network, local_filename, log_filename) + if trace_metadata['succeeded']: + self._logger.debug('Uploading: %s' % remote_filename) + remote_trace_location = self._traces_dir + remote_filename + self._google_storage_accessor.UploadFile(local_filename, + remote_trace_location) + full_cloud_storage_path = ('gs://' + self._bucket_name + '/' + + remote_trace_location) + self._trace_database.AddTrace(full_cloud_storage_path, trace_metadata) + else: + self._logger.warning('Trace generation failed for URL: %s' % url) + # TODO: upload the failure + if os.path.isfile(local_filename): + self._google_storage_accessor.UploadFile(local_filename, + failures_dir + remote_filename) + self._logger.debug('Uploading log') + self._google_storage_accessor.UploadFile(log_filename, + logs_dir + remote_filename) + + +if __name__ == '__main__': + parser = argparse.ArgumentParser( + description='ComputeEngine Worker for Clovis') + parser.add_argument('--config', required=True, + help='Path to the configuration file.') + args = parser.parse_args() + + # Configure logging. + logging.basicConfig(level=logging.WARNING) + worker_logger = logging.getLogger('worker') + worker_logger.setLevel(logging.INFO) + + worker_logger.info('Reading configuration') + with open(args.config) as config_json: + worker = Worker(json.load(config_json), worker_logger) + worker.Start() +
diff --git a/tools/android/loading/cloud/common/__init__.py b/tools/android/loading/cloud/common/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/android/loading/cloud/common/__init__.py
diff --git a/tools/android/loading/cloud/common/clovis_task.py b/tools/android/loading/cloud/common/clovis_task.py new file mode 100644 index 0000000..8bc3127a --- /dev/null +++ b/tools/android/loading/cloud/common/clovis_task.py
@@ -0,0 +1,66 @@ +# 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 base64 +import json + +class ClovisTask(object): + """Generic task, generated by the AppEngine frontend and consumed by the + ComputeEngine backend. + """ + + def __init__(self, action, params, taskqueue_tag): + """Params: + action(str): Action accomplished by this task. + params(dict): Parameters of task. + taskqueue_tag(str): Tag of the task. Optional. + """ + self._action = action + self._params = params + self._taskqueue_tag = taskqueue_tag + + @classmethod + def FromJsonDict(cls, json_dict): + """Loads a ClovisTask from a JSON string. + + Returns: + ClovisTask: The task, or None if the string is invalid. + """ + try: + data = json.loads(json_dict) + action = data['action'] + params = data['params'] + tag = data.get('taskqueue_tag') + # Vaidate the format. + if action == 'trace': + urls = params['urls'] + if (type(urls) is not list) or (len(urls) == 0): + return None + else: + # When more actions are supported, check that they are valid here. + return None + return cls(action, params, tag) + except Exception: + return None + + @classmethod + def FromBase64(cls, base64_string): + """Loads a ClovisTask from a base 64 string.""" + return ClovisTask.FromJsonDict(base64.b64decode(base64_string)) + + def ToJsonDict(self): + """Returns the JSON representation of the task.""" + task_dict = { 'action': self._action, 'params': self._params } + if self._taskqueue_tag: + task_dict['taskqueue_tag'] = self._taskqueue_tag + return json.dumps(task_dict) + + def Action(self): + return self._action + + def Params(self): + return self._params + + def TaskqueueTag(self): + return self._taskqueue_tag
diff --git a/tools/android/loading/cloud/frontend/.gitignore b/tools/android/loading/cloud/frontend/.gitignore new file mode 100644 index 0000000..c3af857 --- /dev/null +++ b/tools/android/loading/cloud/frontend/.gitignore
@@ -0,0 +1 @@ +lib/
diff --git a/tools/android/loading/cloud/frontend/README.md b/tools/android/loading/cloud/frontend/README.md new file mode 100644 index 0000000..f6f6f5f --- /dev/null +++ b/tools/android/loading/cloud/frontend/README.md
@@ -0,0 +1,91 @@ +# Appengine Frontend for Clovis + +[TOC] + +## Usage + +Visit the application URL in your browser, and upload a JSON dictionary with the +following keys: + +- `action` (string): the action to perform. Only `trace` is supported. +- `params` (dictionary): the parameters associated to the action. See below + for more details. +- `taskqueue_tag` (string, optional): the [TaskQueue][2] tag internally used + to send the work from AppEngine to ComputeEngine. If this parameter is not + specified, a unique tag will be created. + +### Parameters for the `trace` action. + +- `urls` (list of strings): the list of URLs to process. +- `repeat_count` (integer, optional): the number of traces to be generated + for each URL. Defaults to 1. +- `emulate_device` (string, optional): the device to emulate (e.g. `Nexus 4`). +- `emulate_network` (string, optional): the network to emulate. + +## Development + +### Design overview + +- Appengine configuration: + - `app.yaml` defines the handlers. There is a static handler for all URLs + in the `static/` directory, and all other URLs are handled by the + `clovis_frontend.py` script. + - `queue.yaml` defines the task queues associated with the application. In + particular, the `clovis-queue` is a pull-queue where tasks are added by + the AppEngine frontend and consummed by the ComputeEngine backend. + See the [TaskQueue documentation][2] for more details. +- `static/form.html` is a static HTML document allowing the user to upload a + JSON file. `clovis_frontend.py` is then invoked with the contents of the + file (see the `/form_sent` handler). +- `clovis_task.py` defines a task to be run by the backend. It is sent through + the `clovis-queue` task queue. +- `clovis_frontend.py` is the script that processes the file uploaded by the + form, creates the tasks and enqueues them in `clovis-queue`. + +### Prerequisites + +- Install the gcloud [tool][1] +- Add a `queue.yaml` file in the application directory (i.e. next to + `app.yaml`) defining a `clovis-queue` pull queue that can be accessed by the + ComputeEngine service worker associated to the project. Add your email too + if you want to run the application locally. See the [TaskQueue configuration + documentation][3] for more details. Example: + +``` +# queue.yaml +- name: clovis-queue + mode: pull + acl: + - user_email: me@address.com + - user_email: 123456789-compute@developer.gserviceaccount.com +``` + +### Run Locally + +```shell +# Install dependencies in the lib/ directory. Note that this will pollute your +# Chromium checkout, see the cleanup intructions below. +pip install -r requirements.txt -t lib +# Start the local server. +dev_appserver.py . +``` + +Visit the application [http://localhost:8080](http://localhost:8080). + +After you are done, cleanup your Chromium checkout: +```shell +rm -rf $CHROMIUM_SRC/tools/android/loading/frontend/lib +``` + +### Deploy + +````shell +# Install dependencies in the lib/ directory. +pip install -r requirements.txt -t lib +# Deploy. +gcloud preview app deploy app.yaml +``` + +[1]: https://cloud.google.com/sdk +[2]: https://cloud.google.com/appengine/docs/python/taskqueue +[3]: https://cloud.google.com/appengine/docs/python/config/queue
diff --git a/tools/android/loading/cloud/frontend/app.yaml b/tools/android/loading/cloud/frontend/app.yaml new file mode 100644 index 0000000..7dcc1d6 --- /dev/null +++ b/tools/android/loading/cloud/frontend/app.yaml
@@ -0,0 +1,10 @@ +runtime: python27 +api_version: 1 +threadsafe: yes + +handlers: +- url: /static + static_dir: static + +- url: .* + script: clovis_frontend.app
diff --git a/tools/android/loading/cloud/frontend/appengine_config.py b/tools/android/loading/cloud/frontend/appengine_config.py new file mode 100644 index 0000000..608cd73 --- /dev/null +++ b/tools/android/loading/cloud/frontend/appengine_config.py
@@ -0,0 +1,6 @@ +# 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. + +from google.appengine.ext import vendor +vendor.add('lib')
diff --git a/tools/android/loading/cloud/frontend/clovis_frontend.py b/tools/android/loading/cloud/frontend/clovis_frontend.py new file mode 100644 index 0000000..8eeee35f --- /dev/null +++ b/tools/android/loading/cloud/frontend/clovis_frontend.py
@@ -0,0 +1,109 @@ +# 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 flask +from google.appengine.api import taskqueue +import json +import os +import sys +import uuid + +from common.clovis_task import ClovisTask + + +app = flask.Flask(__name__) + + +def StartFromJson(http_body_str): + """Creates a new batch of tasks from its JSON representation.""" + task = ClovisTask.FromJsonDict(http_body_str) + if not task: + return 'Invalid JSON task:\n%s\n' % http_body_str + + task_tag = task.TaskqueueTag() + if not task_tag: + task_tag = uuid.uuid1() + + sub_tasks = [] + if task.Action() == 'trace': + sub_tasks = SplitTraceTask(task) + else: + return 'Unsupported action: %s\n' % task.Action() + + return EnqueueTasks(sub_tasks, task_tag) + + +def SplitTraceTask(task): + """Split a tracing task with potentially many URLs into several tracing tasks + with few URLs. + """ + params = task.Params() + urls = params['urls'] + + # Split the task in smaller tasks with fewer URLs each. + urls_per_task = 1 + sub_tasks = [] + for i in range(0, len(urls), urls_per_task): + sub_task_params = params.copy() + sub_task_params['urls'] = [url for url in urls[i:i+urls_per_task]] + sub_tasks.append(ClovisTask(task.Action(), sub_task_params, + task.TaskqueueTag())) + return sub_tasks + + +def EnqueueTasks(tasks, task_tag): + """Enqueues a list of tasks in the Google Cloud task queue, for consumption by + Google Compute Engine. + """ + q = taskqueue.Queue('clovis-queue') + retry_options = taskqueue.TaskRetryOptions(task_retry_limit=3) + # Add tasks to the queue by groups. + # TODO(droger): This support to thousands of tasks, but maybe not millions. + # Defer the enqueuing if it times out. + # is too large. + group_size = 100 + callbacks = [] + try: + for i in range(0, len(tasks), group_size): + group = tasks[i:i+group_size] + taskqueue_tasks = [ + taskqueue.Task(payload=task.ToJsonDict(), method='PULL', tag=task_tag, + retry_options=retry_options) + for task in group] + rpc = taskqueue.create_rpc() + q.add_async(task=taskqueue_tasks, rpc=rpc) + callbacks.append(rpc) + for callback in callbacks: + callback.get_result() + except Exception as e: + return 'Exception:' + type(e).__name__ + ' ' + str(e.args) + '\n' + return 'pushed %i tasks with tag: %s\n' % (len(tasks), task_tag) + + +@app.route('/') +def Root(): + """Home page: redirect to the static form.""" + return flask.redirect('/static/form.html') + + +@app.route('/form_sent', methods=['POST']) +def StartFromForm(): + """HTML form endpoint""" + data_stream = flask.request.files.get('json_task') + if not data_stream: + return 'failed' + http_body_str = data_stream.read() + return StartFromJson(http_body_str) + + +@app.errorhandler(404) +def PageNotFound(e): # pylint: disable=unused-argument + """Return a custom 404 error.""" + return 'Sorry, Nothing at this URL.', 404 + + +@app.errorhandler(500) +def ApplicationError(e): + """Return a custom 500 error.""" + return 'Sorry, unexpected error: {}'.format(e), 499
diff --git a/tools/android/loading/cloud/frontend/common b/tools/android/loading/cloud/frontend/common new file mode 120000 index 0000000..60d3b0a --- /dev/null +++ b/tools/android/loading/cloud/frontend/common
@@ -0,0 +1 @@ +../common \ No newline at end of file
diff --git a/tools/android/loading/cloud/frontend/lib/common b/tools/android/loading/cloud/frontend/lib/common new file mode 120000 index 0000000..dc879abe --- /dev/null +++ b/tools/android/loading/cloud/frontend/lib/common
@@ -0,0 +1 @@ +../../common \ No newline at end of file
diff --git a/tools/android/loading/cloud/frontend/requirements.txt b/tools/android/loading/cloud/frontend/requirements.txt new file mode 100644 index 0000000..880a7bc --- /dev/null +++ b/tools/android/loading/cloud/frontend/requirements.txt
@@ -0,0 +1 @@ +Flask==0.10
diff --git a/tools/android/loading/cloud/frontend/static/form.html b/tools/android/loading/cloud/frontend/static/form.html new file mode 100644 index 0000000..927cf2b6 --- /dev/null +++ b/tools/android/loading/cloud/frontend/static/form.html
@@ -0,0 +1,17 @@ +<!DOCTYPE html> +<html> + +<head> +<meta charset="utf-8"> +<title>Submmit</title> +</head> + +<body> +<p> Select JSON file </p> +<form action="/form_sent" method="POST" enctype="multipart/form-data"> +<input type="file" name="json_task"/> +<input type="submit" name="submit" value="Upload"/> +</form> +</body> + +</html>
diff --git a/tools/android/loading/gce/main.py b/tools/android/loading/gce/main.py deleted file mode 100644 index 0ef2caec..0000000 --- a/tools/android/loading/gce/main.py +++ /dev/null
@@ -1,280 +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 json -import os -import re -import threading -import time -import subprocess -import sys - -# NOTE: The parent directory needs to be first in sys.path to avoid conflicts -# with catapult modules that have colliding names, as catapult inserts itself -# into the path as the second element. This is an ugly and fragile hack. -sys.path.insert(0, - os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir)) -import controller -from google_storage_accessor import GoogleStorageAccessor -import loading_trace -from loading_trace_database import LoadingTraceDatabase -import options - - -class ServerApp(object): - """Simple web server application, collecting traces and writing them in - Google Cloud Storage. - """ - - def __init__(self, configuration_file): - """|configuration_file| is a path to a file containing JSON as described in - README.md. - """ - self._tasks = [] # List of remaining tasks, only modified by _thread. - self._failed_tasks = [] # Failed tasks, only modified by _thread. - self._thread = None - self._tasks_lock = threading.Lock() # Protects _tasks and _failed_tasks. - self._initial_task_count = -1 - self._start_time = None - print 'Reading configuration' - with open(configuration_file) as config_json: - config = json.load(config_json) - - # Separate the cloud storage path into the bucket and the base path under - # the bucket. - storage_path_components = config['cloud_storage_path'].split('/') - self._bucket_name = storage_path_components[0] - self._base_path_in_bucket = '' - if len(storage_path_components) > 1: - self._base_path_in_bucket = '/'.join(storage_path_components[1:]) - if not self._base_path_in_bucket.endswith('/'): - self._base_path_in_bucket += '/' - - self._src_path = config['src_path'] - self._google_storage_accessor = GoogleStorageAccessor( - project_name=config['project_name'], bucket_name=self._bucket_name) - - # Initialize the global options that will be used during trace generation. - options.OPTIONS.ParseArgs([]) - options.OPTIONS.local_binary = config['chrome_path'] - - def _IsProcessingTasks(self): - """Returns True if the application is currently processing tasks.""" - return self._thread is not None and self._thread.is_alive() - - def _GenerateTrace(self, url, emulate_device, emulate_network, filename, - log_filename): - """ Generates a trace on _thread. - - Args: - url: URL as a string. - emulate_device: Name of the device to emulate. Empty for no emulation. - emulate_network: Type of network emulation. Empty for no emulation. - filename: Name of the file where the trace is saved. - log_filename: Name of the file where standard output and errors are logged - - Returns: - A dictionary of metadata about the trace, including a 'succeeded' field - indicating whether the trace was successfully generated. - """ - try: - os.remove(filename) # Remove any existing trace for this URL. - except OSError: - pass # Nothing to remove. - - if not url.startswith('http') and not url.startswith('file'): - url = 'http://' + url - - old_stdout = sys.stdout - old_stderr = sys.stderr - - trace_metadata = { 'succeeded' : False, 'url' : url } - trace = None - with open(log_filename, 'w') as sys.stdout: - try: - sys.stderr = sys.stdout - - # Set up the controller. - chrome_ctl = controller.LocalChromeController() - chrome_ctl.SetHeadless(True) - if emulate_device: - chrome_ctl.SetDeviceEmulation(emulate_device) - if emulate_network: - chrome_ctl.SetNetworkEmulation(emulate_network) - - # Record and write the trace. - with chrome_ctl.OpenWithRedirection(sys.stdout, - sys.stderr) as connection: - connection.ClearCache() - trace = loading_trace.LoadingTrace.RecordUrlNavigation( - url, connection, chrome_ctl.ChromeMetadata()) - trace_metadata['succeeded'] = True - trace_metadata.update(trace.ToJsonDict()[trace._METADATA_KEY]) - except Exception as e: - sys.stderr.write(str(e)) - - if trace: - with open(filename, 'w') as f: - json.dump(trace.ToJsonDict(), f, sort_keys=True, indent=2) - - sys.stdout = old_stdout - sys.stderr = old_stderr - - return trace_metadata - - def _GetCurrentTaskCount(self): - """Returns the number of remaining tasks. Thread safe.""" - self._tasks_lock.acquire() - task_count = len(self._tasks) - self._tasks_lock.release() - return task_count - - def _ProcessTasks(self, tasks, repeat_count, emulate_device, emulate_network): - """Iterates over _task, generating a trace for each of them. Uploads the - resulting traces to Google Cloud Storage. Runs on _thread. - - Args: - tasks: The list of URLs to process. - repeat_count: The number of traces generated for each URL. - emulate_device: Name of the device to emulate. Empty for no emulation. - emulate_network: Type of network emulation. Empty for no emulation. - """ - # The main thread might be reading the task lists, take the lock to modify. - self._tasks_lock.acquire() - self._tasks = tasks - self._failed_tasks = [] - self._tasks_lock.release() - failures_dir = self._base_path_in_bucket + 'failures/' - traces_dir = self._base_path_in_bucket + 'traces/' - - trace_database = LoadingTraceDatabase({}) - - # TODO(blundell): Fix this up. - logs_dir = self._base_path_in_bucket + 'analyze_logs/' - log_filename = 'analyze.log' - # Avoid special characters in storage object names - pattern = re.compile(r"[#\?\[\]\*/]") - while len(self._tasks) > 0: - url = self._tasks[-1] - local_filename = pattern.sub('_', url) - for repeat in range(repeat_count): - print 'Generating trace for URL: %s' % url - remote_filename = local_filename + '/' + str(repeat) - trace_metadata = self._GenerateTrace( - url, emulate_device, emulate_network, local_filename, log_filename) - if trace_metadata['succeeded']: - print 'Uploading: %s' % remote_filename - remote_trace_location = traces_dir + remote_filename - self._google_storage_accessor.UploadFile(local_filename, - remote_trace_location) - full_cloud_storage_path = ('gs://' + self._bucket_name + '/' + - remote_trace_location) - trace_database.AddTrace(full_cloud_storage_path, trace_metadata) - else: - print 'Trace generation failed for URL: %s' % url - self._tasks_lock.acquire() - self._failed_tasks.append({ "url": url, "repeat": repeat}) - self._tasks_lock.release() - if os.path.isfile(local_filename): - self._google_storage_accessor.UploadFile(local_filename, - failures_dir + remote_filename) - print 'Uploading log' - self._google_storage_accessor.UploadFile(log_filename, - logs_dir + remote_filename) - # Pop once task is finished, for accurate status tracking. - self._tasks_lock.acquire() - url = self._tasks.pop() - self._tasks_lock.release() - - self._google_storage_accessor.UploadString( - json.dumps(trace_database.ToJsonDict(), indent=2), - traces_dir + 'trace_database.json') - - if len(self._failed_tasks) > 0: - print 'Uploading failing URLs' - self._google_storage_accessor.UploadString( - json.dumps(self._failed_tasks, indent=2), - failures_dir + 'failures.json') - - def _SetTaskList(self, http_body): - """Sets the list of tasks and starts processing them - - Args: - http_body: JSON dictionary. See README.md for a description of the format. - - Returns: - A string to be sent back to the client, describing the success status of - the request. - """ - if self._IsProcessingTasks(): - return 'Error: Already running\n' - - load_parameters = json.loads(http_body) - try: - tasks = load_parameters['urls'] - except KeyError: - return 'Error: invalid urls\n' - # Optional parameters. - try: - repeat_count = int(load_parameters.get('repeat_count', '1')) - except ValueError: - return 'Error: invalid repeat_count\n' - emulate_device = load_parameters.get('emulate_device', '') - emulate_network = load_parameters.get('emulate_network', '') - - if len(tasks) == 0: - return 'Error: Empty task list\n' - else: - self._initial_task_count = len(tasks) - self._start_time = time.time() - self._thread = threading.Thread( - target = self._ProcessTasks, - args = (tasks, repeat_count, emulate_device, emulate_network)) - self._thread.start() - return 'Starting generation of %s tasks\n' % str(self._initial_task_count) - - def __call__(self, environ, start_response): - path = environ['PATH_INFO'] - - if path == '/set_tasks': - # Get the tasks from the HTTP body. - try: - body_size = int(environ.get('CONTENT_LENGTH', 0)) - except (ValueError): - body_size = 0 - body = environ['wsgi.input'].read(body_size) - data = self._SetTaskList(body) - elif path == '/test': - data = 'hello\n' - elif path == '/status': - if not self._IsProcessingTasks(): - data = 'Idle\n' - else: - task_count = self._GetCurrentTaskCount() - if task_count == 0: - data = '%s tasks complete. Finalizing.\n' % self._initial_task_count - else: - data = 'Remaining tasks: %s / %s\n' % ( - task_count, self._initial_task_count) - elapsed = time.time() - self._start_time - data += 'Elapsed time: %s seconds\n' % str(elapsed) - self._tasks_lock.acquire() - failed_tasks = self._failed_tasks - self._tasks_lock.release() - data += '%s failed tasks:\n' % len(failed_tasks) - data += json.dumps(failed_tasks, indent=2) - else: - start_response('404 NOT FOUND', [('Content-Length', '0')]) - return iter(['']) - - response_headers = [ - ('Content-type','text/plain'), - ('Content-Length', str(len(data))) - ] - start_response('200 OK', response_headers) - return iter([data]) - - -def StartApp(configuration_file): - return ServerApp(configuration_file)
diff --git a/tools/android/loading/gce/pip_requirements.txt b/tools/android/loading/gce/pip_requirements.txt deleted file mode 100644 index 7d97e12..0000000 --- a/tools/android/loading/gce/pip_requirements.txt +++ /dev/null
@@ -1,3 +0,0 @@ -gunicorn==19.4.5 -gcloud==0.10.1 -psutil==4.1.0
diff --git a/tools/android/loading/tracing.py b/tools/android/loading/tracing.py index c8db1dfd..4891d3e3 100644 --- a/tools/android/loading/tracing.py +++ b/tools/android/loading/tracing.py
@@ -50,6 +50,7 @@ self._events = [] self._base_msec = None self._interval_tree = None + self._main_frame_id = None def Handle(self, method, event): for e in event['params']['value']: @@ -61,6 +62,16 @@ # update. self._interval_tree = None + def _GetMainFrameID(self): + """Returns the main frame ID.""" + if not self._main_frame_id: + navigation_start_events = [e for e in self.GetEvents() + if e.Matches('blink.user_timing', 'navigationStart')] + first_event = min(navigation_start_events, key=lambda e: e.start_msec) + self._main_frame_id = first_event.args['frame'] + + return self._main_frame_id + def GetFirstEventMillis(self): """Find the canonical start time for this track. @@ -72,6 +83,17 @@ def GetEvents(self): return self._events + def GetMatchingEvents(self, category, name): + """Gets events matching |category| and |name|.""" + return [e for e in self.GetEvents() if e.Matches(category, name)] + + def GetMatchingMainFrameEvents(self, category, name): + """Gets events matching |category| and |name| that occur in the main frame. + Assumes that the events in question have a 'frame' key in their |args|.""" + matching_events = self.GetMatchingEvents(category, name) + return [e for e in matching_events + if e.args['frame'] == self._GetMainFrameID()] + def EventsAt(self, msec): """Gets events active at a timestamp.
diff --git a/tools/android/loading/tracing_unittest.py b/tools/android/loading/tracing_unittest.py index 1bf0273..0d7ba27e 100644 --- a/tools/android/loading/tracing_unittest.py +++ b/tools/android/loading/tracing_unittest.py
@@ -295,6 +295,48 @@ tracing_track = self.track.Filter(2, 42) self.assertEquals(0, len(tracing_track.GetEvents())) + def testGetMainFrameID(self): + _MAIN_FRAME_ID = 0xffff + _SUBFRAME_ID = 0xaaaa + events = [ + {'ts': 7, 'ph': 'X', 'dur': 10, 'pid': 2, 'tid': 1, 'id': '0x123', + 'name': 'navigationStart', 'cat': 'blink.user_timing', + 'args': {'frame': _SUBFRAME_ID}}, + {'ts': 8, 'ph': 'X', 'dur': 2, 'pid': 2, 'tid': 1, 'id': '0x12343', + 'name': 'A'}, + {'ts': 3, 'ph': 'X', 'dur': 10, 'pid': 2, 'tid': 1, 'id': '0x125', + 'name': 'navigationStart', 'cat': 'blink.user_timing', + 'args': {'frame': _MAIN_FRAME_ID}}, + ] + self._HandleEvents(events) + self.assertEquals(_MAIN_FRAME_ID, self.track._GetMainFrameID()) + + def testGetMatchingEvents(self): + _MAIN_FRAME_ID = 0xffff + _SUBFRAME_ID = 0xaaaa + events = [ + {'ts': 7, 'ph': 'X', 'dur': 10, 'pid': 2, 'tid': 1, 'id': '0x123', + 'name': 'navigationStart', 'cat': 'blink.user_timing', + 'args': {'frame': _SUBFRAME_ID}}, + {'ts': 8, 'ph': 'X', 'dur': 2, 'pid': 2, 'tid': 1, 'id': '0x12343', + 'name': 'A'}, + {'ts': 3, 'ph': 'X', 'dur': 10, 'pid': 2, 'tid': 1, 'id': '0x125', + 'name': 'navigationStart', 'cat': 'blink.user_timing', + 'args': {'frame': _MAIN_FRAME_ID}}, + ] + self._HandleEvents(events) + matching_events = self.track.GetMatchingEvents('blink.user_timing', + 'navigationStart') + self.assertEquals(2, len(matching_events)) + self.assertListEqual([self.track.GetEvents()[0], + self.track.GetEvents()[2]], matching_events) + + matching_main_frame_events = self.track.GetMatchingMainFrameEvents( + 'blink.user_timing', 'navigationStart') + self.assertEquals(1, len(matching_main_frame_events)) + self.assertListEqual([self.track.GetEvents()[2]], + matching_main_frame_events) + def testFilterCategories(self): events = [ {'ts': 5, 'ph': 'X', 'dur': 10, 'pid': 2, 'tid': 1, 'cat': 'A'},
diff --git a/tools/checklicenses/checklicenses.py b/tools/checklicenses/checklicenses.py index 944c577f..df507b3 100755 --- a/tools/checklicenses/checklicenses.py +++ b/tools/checklicenses/checklicenses.py
@@ -76,6 +76,7 @@ 'LGPL (v3 or later)', 'MIT/X11 (BSD like) LGPL (v2.1 or later)', 'MIT/X11 (BSD like)', + 'MIT/X11 (BSD like) Public domain MIT/X11 (BSD like)', 'MPL (v1.0) LGPL (v2 or later)', 'MPL (v1.1) BSD (3 clause) GPL (v2) LGPL (v2.1 or later)', 'MPL (v1.1) BSD (3 clause) LGPL (v2.1 or later)',
diff --git a/tools/clang/blink_gc_plugin/BlinkGCPlugin.cpp b/tools/clang/blink_gc_plugin/BlinkGCPlugin.cpp index b8d0a44..85140bb3 100644 --- a/tools/clang/blink_gc_plugin/BlinkGCPlugin.cpp +++ b/tools/clang/blink_gc_plugin/BlinkGCPlugin.cpp
@@ -34,12 +34,16 @@ bool parsed = true; for (size_t i = 0; i < args.size() && parsed; ++i) { - if (args[i] == "enable-oilpan") { - options_.enable_oilpan = true; - } else if (args[i] == "dump-graph") { + // TODO(sof): remove this case once a version of the GC plugin + // has rolled which has enable-oilpan-always baked in _and_ + // Blink no longer passes in the option (cf. Source/config.gyp) + if (args[i] == "enable-oilpan") + continue; + // TODO(sof): same for warn-raw-ptr + if (args[i] == "warn-raw-ptr") + continue; + if (args[i] == "dump-graph") { options_.dump_graph = true; - } else if (args[i] == "warn-raw-ptr") { - options_.warn_raw_ptr = true; } else if (args[i] == "warn-unneeded-finalizer") { options_.warn_unneeded_finalizer = true; } else {
diff --git a/tools/clang/blink_gc_plugin/BlinkGCPluginConsumer.cpp b/tools/clang/blink_gc_plugin/BlinkGCPluginConsumer.cpp index 7c90ddd..5c277a4 100644 --- a/tools/clang/blink_gc_plugin/BlinkGCPluginConsumer.cpp +++ b/tools/clang/blink_gc_plugin/BlinkGCPluginConsumer.cpp
@@ -213,8 +213,6 @@ diagnostic_.getCustomDiagID(getErrorLevel(), kFieldsRequireTracing); diag_class_contains_invalid_fields_ = diagnostic_.getCustomDiagID( getErrorLevel(), kClassContainsInvalidFields); - diag_class_contains_invalid_fields_warning_ = diagnostic_.getCustomDiagID( - getErrorLevel(), kClassContainsInvalidFields); diag_class_contains_gc_root_ = diagnostic_.getCustomDiagID(getErrorLevel(), kClassContainsGCRoot); diag_class_requires_finalization_ = diagnostic_.getCustomDiagID( @@ -964,25 +962,19 @@ void BlinkGCPluginConsumer::ReportClassContainsInvalidFields( RecordInfo* info, const CheckFieldsVisitor::Errors& errors) { - bool only_warnings = options_.warn_raw_ptr; - for (auto& error : errors) - if (!CheckFieldsVisitor::IsWarning(error.second)) - only_warnings = false; ReportDiagnostic(info->record()->getLocStart(), - only_warnings ? - diag_class_contains_invalid_fields_warning_ : diag_class_contains_invalid_fields_) << info->record(); for (auto& error : errors) { unsigned note; - if (CheckFieldsVisitor::IsRawPtrError(error.second)) { + if (error.second == CheckFieldsVisitor::kRawPtrToGCManaged) { note = diag_raw_ptr_to_gc_managed_class_note_; - } else if (CheckFieldsVisitor::IsReferencePtrError(error.second)) { - note = diag_reference_ptr_to_gc_managed_class_note_; } else if (error.second == CheckFieldsVisitor::kRefPtrToGCManaged) { note = diag_ref_ptr_to_gc_managed_class_note_; + } else if (error.second == CheckFieldsVisitor::kReferencePtrToGCManaged) { + note = diag_reference_ptr_to_gc_managed_class_note_; } else if (error.second == CheckFieldsVisitor::kOwnPtrToGCManaged) { note = diag_own_ptr_to_gc_managed_class_note_; } else if (error.second == CheckFieldsVisitor::kMemberToGCUnmanaged) {
diff --git a/tools/clang/blink_gc_plugin/BlinkGCPluginConsumer.h b/tools/clang/blink_gc_plugin/BlinkGCPluginConsumer.h index d0b49d8..e05bd82 100644 --- a/tools/clang/blink_gc_plugin/BlinkGCPluginConsumer.h +++ b/tools/clang/blink_gc_plugin/BlinkGCPluginConsumer.h
@@ -147,7 +147,6 @@ unsigned diag_base_requires_tracing_; unsigned diag_fields_require_tracing_; unsigned diag_class_contains_invalid_fields_; - unsigned diag_class_contains_invalid_fields_warning_; unsigned diag_class_contains_gc_root_; unsigned diag_class_requires_finalization_; unsigned diag_class_does_not_require_finalization_;
diff --git a/tools/clang/blink_gc_plugin/BlinkGCPluginOptions.h b/tools/clang/blink_gc_plugin/BlinkGCPluginOptions.h index 812d3a6..b941f08 100644 --- a/tools/clang/blink_gc_plugin/BlinkGCPluginOptions.h +++ b/tools/clang/blink_gc_plugin/BlinkGCPluginOptions.h
@@ -11,13 +11,9 @@ struct BlinkGCPluginOptions { BlinkGCPluginOptions() - : enable_oilpan(false), - dump_graph(false), - warn_raw_ptr(false), + : dump_graph(false), warn_unneeded_finalizer(false) {} - bool enable_oilpan; bool dump_graph; - bool warn_raw_ptr; bool warn_unneeded_finalizer; std::set<std::string> ignored_classes; std::set<std::string> checked_namespaces;
diff --git a/tools/clang/blink_gc_plugin/CheckFieldsVisitor.cpp b/tools/clang/blink_gc_plugin/CheckFieldsVisitor.cpp index 558637c..f08710f8 100644 --- a/tools/clang/blink_gc_plugin/CheckFieldsVisitor.cpp +++ b/tools/clang/blink_gc_plugin/CheckFieldsVisitor.cpp
@@ -85,38 +85,19 @@ if (!Parent() || !edge->value()->IsGCAllocated()) return; - // In transition mode, disallow OwnPtr<T>, RawPtr<T> to GC allocated T's, - // also disallow T* in stack-allocated types. - if (options_.enable_oilpan) { - if (Parent()->IsOwnPtr() || - Parent()->IsRawPtrClass() || - (stack_allocated_host_ && Parent()->IsRawPtr())) { - invalid_fields_.push_back(std::make_pair( - current_, InvalidSmartPtr(Parent()))); - return; - } - if (options_.warn_raw_ptr && Parent()->IsRawPtr()) { - if (static_cast<RawPtr*>(Parent())->HasReferenceType()) { - invalid_fields_.push_back(std::make_pair( - current_, kReferencePtrToGCManagedWarning)); - } else { - invalid_fields_.push_back(std::make_pair( - current_, kRawPtrToGCManagedWarning)); - } - } - return; - } - - if (Parent()->IsRawPtr() || Parent()->IsOwnPtr()) { + // Disallow OwnPtr<T>, RefPtr<T> and T* to stack-allocated types. + if (Parent()->IsOwnPtr() || + (Parent()->IsRefPtr() && !edge->value()->IsGCRefCounted()) || + (stack_allocated_host_ && Parent()->IsRawPtr())) { invalid_fields_.push_back(std::make_pair( current_, InvalidSmartPtr(Parent()))); return; } - - if (Parent()->IsRefPtr() && !edge->value()->IsGCRefCounted()) { - invalid_fields_.push_back(std::make_pair( - current_, InvalidSmartPtr(Parent()))); - return; + if (Parent()->IsRawPtr()) { + RawPtr* rawPtr = static_cast<RawPtr*>(Parent()); + Error error = rawPtr->HasReferenceType() ? + kReferencePtrToGCManaged : kRawPtrToGCManaged; + invalid_fields_.push_back(std::make_pair(current_, error)); } } @@ -125,24 +106,6 @@ invalid_fields_.push_back(std::make_pair(current_, kOwnPtrToGCManaged)); } -bool CheckFieldsVisitor::IsWarning(Error error) { - if (error == kRawPtrToGCManagedWarning) - return true; - if (error == kReferencePtrToGCManagedWarning) - return true; - return false; -} - -bool CheckFieldsVisitor::IsRawPtrError(Error error) { - return (error == kRawPtrToGCManaged || - error == kRawPtrToGCManagedWarning); -} - -bool CheckFieldsVisitor::IsReferencePtrError(Error error) { - return (error == kReferencePtrToGCManaged || - error == kReferencePtrToGCManagedWarning); -} - CheckFieldsVisitor::Error CheckFieldsVisitor::InvalidSmartPtr(Edge* ptr) { if (ptr->IsRawPtr()) { if (static_cast<RawPtr*>(ptr)->HasReferenceType())
diff --git a/tools/clang/blink_gc_plugin/CheckFieldsVisitor.h b/tools/clang/blink_gc_plugin/CheckFieldsVisitor.h index e0c36a2d..d700be2 100644 --- a/tools/clang/blink_gc_plugin/CheckFieldsVisitor.h +++ b/tools/clang/blink_gc_plugin/CheckFieldsVisitor.h
@@ -13,8 +13,8 @@ class FieldPoint; // This visitor checks that the fields of a class are "well formed". -// - OwnPtr, RefPtr and RawPtr must not point to a GC derived types. -// - Part objects must not be GC derived types. +// - OwnPtr and RefPtr must not point to a GC derived type. +// - Part objects must not be a GC derived type. // - An on-heap class must never contain GC roots. // - Only stack-allocated types may point to stack-allocated types. @@ -22,10 +22,8 @@ public: enum Error { kRawPtrToGCManaged, - kRawPtrToGCManagedWarning, kRefPtrToGCManaged, kReferencePtrToGCManaged, - kReferencePtrToGCManagedWarning, kOwnPtrToGCManaged, kMemberToGCUnmanaged, kMemberInUnmanaged, @@ -45,10 +43,6 @@ void AtValue(Value* edge) override; void AtCollection(Collection* edge) override; - static bool IsWarning(Error error); - static bool IsRawPtrError(Error error); - static bool IsReferencePtrError(Error error); - private: Error InvalidSmartPtr(Edge* ptr);
diff --git a/tools/clang/blink_gc_plugin/Edge.h b/tools/clang/blink_gc_plugin/Edge.h index eca3158..91e5698 100644 --- a/tools/clang/blink_gc_plugin/Edge.h +++ b/tools/clang/blink_gc_plugin/Edge.h
@@ -87,7 +87,6 @@ virtual bool IsValue() { return false; } virtual bool IsRawPtr() { return false; } - virtual bool IsRawPtrClass() { return false; } virtual bool IsRefPtr() { return false; } virtual bool IsOwnPtr() { return false; } virtual bool IsMember() { return false; } @@ -126,16 +125,13 @@ class RawPtr : public PtrEdge { public: - RawPtr(Edge* ptr, bool is_ptr_class, bool is_ref_type) + RawPtr(Edge* ptr, bool is_ref_type) : PtrEdge(ptr) - , is_ptr_class_(is_ptr_class) , is_ref_type_(is_ref_type) { - assert(!(is_ptr_class_ && is_ref_type_)); } bool IsRawPtr() { return true; } - bool IsRawPtrClass() { return is_ptr_class_; } LivenessKind Kind() { return kWeak; } bool NeedsFinalization() { return false; } TracingStatus NeedsTracing(NeedsTracingOption) { @@ -145,7 +141,6 @@ bool HasReferenceType() { return is_ref_type_; } private: - bool is_ptr_class_; bool is_ref_type_; };
diff --git a/tools/clang/blink_gc_plugin/RecordInfo.cpp b/tools/clang/blink_gc_plugin/RecordInfo.cpp index b4937abd..2f17234 100644 --- a/tools/clang/blink_gc_plugin/RecordInfo.cpp +++ b/tools/clang/blink_gc_plugin/RecordInfo.cpp
@@ -584,7 +584,7 @@ if (type->isPointerType() || type->isReferenceType()) { if (Edge* ptr = CreateEdge(type->getPointeeType().getTypePtrOrNull())) - return new RawPtr(ptr, false, type->isReferenceType()); + return new RawPtr(ptr, type->isReferenceType()); return 0; } @@ -597,12 +597,6 @@ TemplateArgs args; - if (Config::IsRawPtr(info->name()) && info->GetTemplateArgs(1, &args)) { - if (Edge* ptr = CreateEdge(args[0])) - return new RawPtr(ptr, true, false); - return 0; - } - if (Config::IsRefPtr(info->name()) && info->GetTemplateArgs(1, &args)) { if (Edge* ptr = CreateEdge(args[0])) return new RefPtr(ptr);
diff --git a/tools/clang/blink_gc_plugin/tests/raw_ptr_to_gc_managed_class.h b/tools/clang/blink_gc_plugin/tests/raw_ptr_to_gc_managed_class.h index eab38c2a..987001d 100644 --- a/tools/clang/blink_gc_plugin/tests/raw_ptr_to_gc_managed_class.h +++ b/tools/clang/blink_gc_plugin/tests/raw_ptr_to_gc_managed_class.h
@@ -16,7 +16,6 @@ private: PartObject(); - RawPtr<HeapObject> m_obj; HeapObject* m_rawObj; HeapObject& m_refObj; };
diff --git a/tools/clang/blink_gc_plugin/tests/raw_ptr_to_gc_managed_class.txt b/tools/clang/blink_gc_plugin/tests/raw_ptr_to_gc_managed_class.txt index 463e9ae..98f5abe8 100644 --- a/tools/clang/blink_gc_plugin/tests/raw_ptr_to_gc_managed_class.txt +++ b/tools/clang/blink_gc_plugin/tests/raw_ptr_to_gc_managed_class.txt
@@ -2,19 +2,16 @@ ./raw_ptr_to_gc_managed_class.h:14:1: warning: [blink-gc] Class 'PartObject' contains invalid fields. class PartObject { ^ -./raw_ptr_to_gc_managed_class.h:19:5: note: [blink-gc] Raw pointer field 'm_obj' to a GC managed class declared here: - RawPtr<HeapObject> m_obj; - ^ -./raw_ptr_to_gc_managed_class.h:20:5: note: [blink-gc] Raw pointer field 'm_rawObj' to a GC managed class declared here: +./raw_ptr_to_gc_managed_class.h:19:5: note: [blink-gc] Raw pointer field 'm_rawObj' to a GC managed class declared here: HeapObject* m_rawObj; ^ -./raw_ptr_to_gc_managed_class.h:21:5: note: [blink-gc] Reference pointer field 'm_refObj' to a GC managed class declared here: +./raw_ptr_to_gc_managed_class.h:20:5: note: [blink-gc] Reference pointer field 'm_refObj' to a GC managed class declared here: HeapObject& m_refObj; ^ -./raw_ptr_to_gc_managed_class.h:24:1: warning: [blink-gc] Class 'HeapObject' contains invalid fields. +./raw_ptr_to_gc_managed_class.h:23:1: warning: [blink-gc] Class 'HeapObject' contains invalid fields. class HeapObject : public GarbageCollected<HeapObject> { ^ -./raw_ptr_to_gc_managed_class.h:29:5: note: [blink-gc] Raw pointer field 'm_objs' to a GC managed class declared here: +./raw_ptr_to_gc_managed_class.h:28:5: note: [blink-gc] Raw pointer field 'm_objs' to a GC managed class declared here: HeapVector<HeapObject*> m_objs; ^ 2 warnings generated.
diff --git a/tools/clang/blink_gc_plugin/tests/raw_ptr_to_gc_managed_class_error.flags b/tools/clang/blink_gc_plugin/tests/raw_ptr_to_gc_managed_class_error.flags index 26591e9..2f41be66 100644 --- a/tools/clang/blink_gc_plugin/tests/raw_ptr_to_gc_managed_class_error.flags +++ b/tools/clang/blink_gc_plugin/tests/raw_ptr_to_gc_managed_class_error.flags
@@ -1 +1 @@ --Werror -Xclang -plugin-arg-blink-gc-plugin -Xclang warn-raw-ptr +-Werror
diff --git a/tools/clang/blink_gc_plugin/tests/raw_ptr_to_gc_managed_class_error.h b/tools/clang/blink_gc_plugin/tests/raw_ptr_to_gc_managed_class_error.h index 038a70fa..2fa73a2 100644 --- a/tools/clang/blink_gc_plugin/tests/raw_ptr_to_gc_managed_class_error.h +++ b/tools/clang/blink_gc_plugin/tests/raw_ptr_to_gc_managed_class_error.h
@@ -16,7 +16,6 @@ private: PartObject(); - RawPtr<HeapObject> m_obj; HeapObject* m_rawObj; HeapObject& m_refObj; };
diff --git a/tools/clang/blink_gc_plugin/tests/raw_ptr_to_gc_managed_class_error.txt b/tools/clang/blink_gc_plugin/tests/raw_ptr_to_gc_managed_class_error.txt index be92ee3..c21c8172 100644 --- a/tools/clang/blink_gc_plugin/tests/raw_ptr_to_gc_managed_class_error.txt +++ b/tools/clang/blink_gc_plugin/tests/raw_ptr_to_gc_managed_class_error.txt
@@ -2,19 +2,16 @@ ./raw_ptr_to_gc_managed_class_error.h:14:1: error: [blink-gc] Class 'PartObject' contains invalid fields. class PartObject { ^ -./raw_ptr_to_gc_managed_class_error.h:19:5: note: [blink-gc] Raw pointer field 'm_obj' to a GC managed class declared here: - RawPtr<HeapObject> m_obj; - ^ -./raw_ptr_to_gc_managed_class_error.h:20:5: note: [blink-gc] Raw pointer field 'm_rawObj' to a GC managed class declared here: +./raw_ptr_to_gc_managed_class_error.h:19:5: note: [blink-gc] Raw pointer field 'm_rawObj' to a GC managed class declared here: HeapObject* m_rawObj; ^ -./raw_ptr_to_gc_managed_class_error.h:21:5: note: [blink-gc] Reference pointer field 'm_refObj' to a GC managed class declared here: +./raw_ptr_to_gc_managed_class_error.h:20:5: note: [blink-gc] Reference pointer field 'm_refObj' to a GC managed class declared here: HeapObject& m_refObj; ^ -./raw_ptr_to_gc_managed_class_error.h:24:1: error: [blink-gc] Class 'HeapObject' contains invalid fields. +./raw_ptr_to_gc_managed_class_error.h:23:1: error: [blink-gc] Class 'HeapObject' contains invalid fields. class HeapObject : public GarbageCollected<HeapObject> { ^ -./raw_ptr_to_gc_managed_class_error.h:29:5: note: [blink-gc] Raw pointer field 'm_objs' to a GC managed class declared here: +./raw_ptr_to_gc_managed_class_error.h:28:5: note: [blink-gc] Raw pointer field 'm_objs' to a GC managed class declared here: HeapVector<HeapObject*> m_objs; ^ 2 errors generated.
diff --git a/tools/gn/config_values.h b/tools/gn/config_values.h index 823f1df..b6f153b 100644 --- a/tools/gn/config_values.h +++ b/tools/gn/config_values.h
@@ -30,6 +30,7 @@ const std::vector<SourceDir>& name() const { return name##_; } \ std::vector<SourceDir>& name() { return name##_; } + STRING_VALUES_ACCESSOR(arflags) STRING_VALUES_ACCESSOR(asmflags) STRING_VALUES_ACCESSOR(cflags) STRING_VALUES_ACCESSOR(cflags_c) @@ -65,6 +66,7 @@ } private: + std::vector<std::string> arflags_; std::vector<std::string> asmflags_; std::vector<std::string> cflags_; std::vector<std::string> cflags_c_;
diff --git a/tools/gn/config_values_generator.cc b/tools/gn/config_values_generator.cc index 3cc8235f..e92f0913 100644 --- a/tools/gn/config_values_generator.cc +++ b/tools/gn/config_values_generator.cc
@@ -67,6 +67,7 @@ GetDirList(scope_, #name, config_values_, input_dir_, \ &ConfigValues::name, err_); + FILL_STRING_CONFIG_VALUE(arflags) FILL_STRING_CONFIG_VALUE(asmflags) FILL_STRING_CONFIG_VALUE(cflags) FILL_STRING_CONFIG_VALUE(cflags_c)
diff --git a/tools/gn/docs/reference.md b/tools/gn/docs/reference.md index 38e8ce7..600daea9 100644 --- a/tools/gn/docs/reference.md +++ b/tools/gn/docs/reference.md
@@ -3003,6 +3003,7 @@ Example: "gen/base/test" Linker tools have multiple inputs and (potentially) multiple outputs + The static library tool ("alink") is not considered a linker tool. The following expansions are available: {{inputs}} @@ -3062,6 +3063,9 @@ These should generally be treated the same as libs by your tool. Example: "libfoo.so libbar.so" + The static library ("alink") tool allows {{arflags}} plus the common + tool substitutions. + The copy tool allows the common compiler/linker substitutions, plus {{source}} which is the source of the copy. The stamp tool allows only the common tool substitutions. @@ -3725,6 +3729,42 @@ ``` +## **arflags**: Arguments passed to static_library archiver. + +``` + A list of flags passed to the archive/lib command that creates static + libraries. + + arflags are NOT pushed to dependents, so applying arflags to source + sets or any other target type will be a no-op. As with ldflags, + you could put the arflags in a config and set that as a public or + "all dependent" config, but that will likely not be what you want. + If you have a chain of static libraries dependent on each other, + this can cause the flags to propagate up to other static libraries. + Due to the nature of how arflags are typically used, you will normally + want to apply them directly on static_library targets themselves. + +``` + +### **Ordering of flags and values** + +``` + 1. Those set on the current target (not in a config). + 2. Those set on the "configs" on the target in order that the + configs appear in the list. + 3. Those set on the "all_dependent_configs" on the target in order + that the configs appear in the list. + 4. Those set on the "public_configs" on the target in order that + those configs appear in the list. + 5. all_dependent_configs pulled from dependencies, in the order of + the "deps" list. This is done recursively. If a config appears + more than once, only the first occurance will be used. + 6. public_configs pulled from dependencies, in the order of the + "deps" list. If a dependency is public, they will be applied + recursively. + + +``` ## **args**: Arguments passed to an action. ```
diff --git a/tools/gn/function_toolchain.cc b/tools/gn/function_toolchain.cc index bdf53859..aaa9b7e 100644 --- a/tools/gn/function_toolchain.cc +++ b/tools/gn/function_toolchain.cc
@@ -194,8 +194,8 @@ } bool IsLinkerTool(Toolchain::ToolType type) { - return type == Toolchain::TYPE_ALINK || - type == Toolchain::TYPE_SOLINK || + // "alink" is not counted as in the generic "linker" tool list. + return type == Toolchain::TYPE_SOLINK || type == Toolchain::TYPE_SOLINK_MODULE || type == Toolchain::TYPE_LINK; } @@ -690,6 +690,7 @@ " Example: \"gen/base/test\"\n" "\n" " Linker tools have multiple inputs and (potentially) multiple outputs\n" + " The static library tool (\"alink\") is not considered a linker tool.\n" " The following expansions are available:\n" "\n" " {{inputs}}\n" @@ -749,6 +750,9 @@ " These should generally be treated the same as libs by your tool.\n" " Example: \"libfoo.so libbar.so\"\n" "\n" + " The static library (\"alink\") tool allows {{arflags}} plus the common\n" + " tool substitutions.\n" + "\n" " The copy tool allows the common compiler/linker substitutions, plus\n" " {{source}} which is the source of the copy. The stamp tool allows\n" " only the common tool substitutions.\n" @@ -859,6 +863,10 @@ } else if (IsLinkerTool(tool_type)) { subst_validator = &IsValidLinkerSubstitution; subst_output_validator = &IsValidLinkerOutputsSubstitution; + } else if (tool_type == Toolchain::TYPE_ALINK) { + subst_validator = &IsValidALinkSubstitution; + // ALink uses the standard output file patterns as other linker tools. + subst_output_validator = &IsValidLinkerOutputsSubstitution; } else if (tool_type == Toolchain::TYPE_COPY || tool_type == Toolchain::TYPE_COPY_BUNDLE_DATA) { subst_validator = &IsValidCopySubstitution;
diff --git a/tools/gn/ninja_binary_target_writer.cc b/tools/gn/ninja_binary_target_writer.cc index 4a923c3..cb48688 100644 --- a/tools/gn/ninja_binary_target_writer.cc +++ b/tools/gn/ninja_binary_target_writer.cc
@@ -785,6 +785,11 @@ target_->output_type() == Target::LOADABLE_MODULE) { WriteLinkerFlags(optional_def_file); WriteLibs(); + } else if (target_->output_type() == Target::STATIC_LIBRARY) { + out_ << " arflags ="; + RecursiveTargetConfigStringsToStream(target_, &ConfigValues::arflags, + GetFlagOptions(), out_); + out_ << std::endl; } WriteOutputSubstitutions(); WriteSolibs(solibs); @@ -795,9 +800,8 @@ out_ << " ldflags ="; // First the ldflags from the target and its config. - EscapeOptions flag_options = GetFlagOptions(); RecursiveTargetConfigStringsToStream(target_, &ConfigValues::ldflags, - flag_options, out_); + GetFlagOptions(), out_); // Followed by library search paths that have been recursively pushed // through the dependency tree.
diff --git a/tools/gn/ninja_binary_target_writer_unittest.cc b/tools/gn/ninja_binary_target_writer_unittest.cc index d620f94..ab8b641c 100644 --- a/tools/gn/ninja_binary_target_writer_unittest.cc +++ b/tools/gn/ninja_binary_target_writer_unittest.cc
@@ -111,6 +111,7 @@ // There are no sources so there are no params to alink. (In practice // this will probably fail in the archive tool.) "build obj/foo/libstlib.a: alink || obj/foo/bar.stamp\n" + " arflags =\n" " output_extension = \n" " output_dir = \n"; std::string out_str = out.str(); @@ -138,6 +139,7 @@ "build obj/foo/libstlib.a: alink obj/foo/bar.input1.o " "obj/foo/bar.input2.o ../../foo/input3.o ../../foo/input4.obj " "|| obj/foo/bar.stamp\n" + " arflags =\n" " output_extension = \n" " output_dir = \n"; std::string out_str = out.str(); @@ -145,6 +147,38 @@ } } +TEST(NinjaBinaryTargetWriter, StaticLibrary) { + TestWithScope setup; + Err err; + + TestTarget target(setup, "//foo:bar", Target::STATIC_LIBRARY); + target.sources().push_back(SourceFile("//foo/input1.cc")); + target.config_values().arflags().push_back("--asdf"); + ASSERT_TRUE(target.OnResolved(&err)); + + std::ostringstream out; + NinjaBinaryTargetWriter writer(&target, out); + writer.Run(); + + const char expected[] = + "defines =\n" + "include_dirs =\n" + "cflags =\n" + "cflags_cc =\n" + "root_out_dir = .\n" + "target_out_dir = obj/foo\n" + "target_output_name = libbar\n" + "\n" + "build obj/foo/libbar.input1.o: cxx ../../foo/input1.cc\n" + "\n" + "build obj/foo/libbar.a: alink obj/foo/libbar.input1.o\n" + " arflags = --asdf\n" + " output_extension = \n" + " output_dir = \n"; + std::string out_str = out.str(); + EXPECT_EQ(expected, out_str); +} + // This tests that output extension and output dir overrides apply, and input // dependencies are applied. TEST(NinjaBinaryTargetWriter, OutputExtensionAndInputDeps) {
diff --git a/tools/gn/substitution_type.cc b/tools/gn/substitution_type.cc index 75d8b7a..fcca19da 100644 --- a/tools/gn/substitution_type.cc +++ b/tools/gn/substitution_type.cc
@@ -47,6 +47,8 @@ "{{output_extension}}", // SUBSTITUTION_OUTPUT_EXTENSION "{{solibs}}", // SUBSTITUTION_SOLIBS + "{{arflags}}", // SUBSTITUTION_ARFLAGS + "{{bundle_root_dir}}", // SUBSTITUTION_BUNDLE_ROOT_DIR "{{bundle_resources_dir}}", // SUBSTITUTION_BUNDLE_RESOURCES_DIR "{{bundle_executable_dir}}", // SUBSTITUTION_BUNDLE_EXECUTABLE_DIR @@ -96,6 +98,8 @@ "output_extension", // SUBSTITUTION_OUTPUT_EXTENSION "solibs", // SUBSTITUTION_SOLIBS + "arflags", // SUBSTITUTION_ARFLAGS + "bundle_root_dir", // SUBSTITUTION_BUNDLE_ROOT_DIR "bundle_resources_dir", // SUBSTITUTION_BUNDLE_RESOURCES_DIR "bundle_executable_dir", // SUBSTITUTION_BUNDLE_EXECUTABLE_DIR @@ -207,6 +211,15 @@ type == SUBSTITUTION_OUTPUT_EXTENSION; } +bool IsValidALinkSubstitution(SubstitutionType type) { + return IsValidToolSubstitution(type) || + type == SUBSTITUTION_LINKER_INPUTS || + type == SUBSTITUTION_LINKER_INPUTS_NEWLINE || + type == SUBSTITUTION_ARFLAGS || + type == SUBSTITUTION_OUTPUT_DIR || + type == SUBSTITUTION_OUTPUT_EXTENSION; +} + bool IsValidCopySubstitution(SubstitutionType type) { return IsValidToolSubstitution(type) || type == SUBSTITUTION_SOURCE;
diff --git a/tools/gn/substitution_type.h b/tools/gn/substitution_type.h index 2e63373..e82ecd6 100644 --- a/tools/gn/substitution_type.h +++ b/tools/gn/substitution_type.h
@@ -60,6 +60,9 @@ SUBSTITUTION_OUTPUT_EXTENSION, // {{output_extension}} SUBSTITUTION_SOLIBS, // {{solibs}} + // Valid for alink only. + SUBSTITUTION_ARFLAGS, // {{arflags}} + // Valid for bundle_data targets. SUBSTITUTION_BUNDLE_ROOT_DIR, // {{bundle_root_dir}} SUBSTITUTION_BUNDLE_RESOURCES_DIR, // {{bundle_resources_dir}} @@ -117,6 +120,7 @@ bool IsValidCompilerOutputsSubstitution(SubstitutionType type); bool IsValidLinkerSubstitution(SubstitutionType type); bool IsValidLinkerOutputsSubstitution(SubstitutionType type); +bool IsValidALinkSubstitution(SubstitutionType type); bool IsValidCopySubstitution(SubstitutionType type); bool IsValidCompileXCassetsSubstitution(SubstitutionType type);
diff --git a/tools/gn/variables.cc b/tools/gn/variables.cc index 46cd57e..dc0316b 100644 --- a/tools/gn/variables.cc +++ b/tools/gn/variables.cc
@@ -418,6 +418,25 @@ " public_deps = [ \":c\" ]\n" " }\n"; +const char kArflags[] = "arflags"; +const char kArflags_HelpShort[] = + "arflags: [string list] Arguments passed to static_library archiver."; +const char kArflags_Help[] = + "arflags: Arguments passed to static_library archiver.\n" + "\n" + " A list of flags passed to the archive/lib command that creates static\n" + " libraries.\n" + "\n" + " arflags are NOT pushed to dependents, so applying arflags to source\n" + " sets or any other target type will be a no-op. As with ldflags,\n" + " you could put the arflags in a config and set that as a public or\n" + " \"all dependent\" config, but that will likely not be what you want.\n" + " If you have a chain of static libraries dependent on each other,\n" + " this can cause the flags to propagate up to other static libraries.\n" + " Due to the nature of how arflags are typically used, you will normally\n" + " want to apply them directly on static_library targets themselves.\n" + COMMON_ORDERING_HELP; + const char kArgs[] = "args"; const char kArgs_HelpShort[] = "args: [string list] Arguments passed to an action."; @@ -1638,6 +1657,7 @@ if (info_map.empty()) { INSERT_VARIABLE(AllDependentConfigs) INSERT_VARIABLE(AllowCircularIncludesFrom) + INSERT_VARIABLE(Arflags) INSERT_VARIABLE(Args) INSERT_VARIABLE(Asmflags) INSERT_VARIABLE(AssertNoDeps)
diff --git a/tools/gn/variables.h b/tools/gn/variables.h index 2dafdee0..2523c1f 100644 --- a/tools/gn/variables.h +++ b/tools/gn/variables.h
@@ -79,6 +79,10 @@ extern const char kAllowCircularIncludesFrom_HelpShort[]; extern const char kAllowCircularIncludesFrom_Help[]; +extern const char kArflags[]; +extern const char kArflags_HelpShort[]; +extern const char kArflags_Help[]; + extern const char kArgs[]; extern const char kArgs_HelpShort[]; extern const char kArgs_Help[];
diff --git a/tools/mb/mb.py b/tools/mb/mb.py index 2eba40e..b2d0851d 100755 --- a/tools/mb/mb.py +++ b/tools/mb/mb.py
@@ -23,6 +23,7 @@ import sys import subprocess import tempfile +import traceback import urllib2 from collections import OrderedDict @@ -62,9 +63,11 @@ except KeyboardInterrupt: self.Print('interrupted, exiting', stream=sys.stderr) return 130 - except Exception as e: + except Exception: self.DumpInputFiles() - self.Print(str(e)) + s = traceback.format_exc() + for l in s.splitlines(): + self.Print(l) return 1 def ParseArgs(self, argv): @@ -468,6 +471,8 @@ config = self.masters[master][builder] if config == 'tbd': tbd.add(builder) + elif config.startswith('//'): + done.add(builder) else: # TODO(dpranke): Check if MB is actually running? vals = self.FlattenConfig(config) @@ -487,7 +492,7 @@ PrintBuilders(STAT_TBD, tbd, notes) PrintBuilders(STAT_GYP, gyp, notes) else: - self.Print(' ... done') + self.Print(' All GN!') stats[STAT_DONE] += len(done)
diff --git a/tools/mb/mb_config.pyl b/tools/mb/mb_config.pyl index 7fc178d0..00599b9 100644 --- a/tools/mb/mb_config.pyl +++ b/tools/mb/mb_config.pyl
@@ -66,10 +66,9 @@ }, 'chromium.chromiumos': { - 'ChromiumOS amd64-generic Compile': 'tbd', - 'ChromiumOS daisy Compile': 'tbd', - 'ChromiumOS x86-generic Compile': 'tbd', - + 'ChromiumOS amd64-generic Compile': 'cros_chrome_sdk_gyp', + 'ChromiumOS daisy Compile': 'cros_chrome_sdk_gyp', + 'ChromiumOS x86-generic Compile': 'cros_chrome_sdk_gyp', 'Linux ChromiumOS Builder': 'swarming_chromeos_gyp_release_bot', 'Linux ChromiumOS Builder (dbg)': 'swarming_chromeos_gyp_debug_bot', 'Linux ChromiumOS Full': 'swarming_chromeos_gyp_release_bot', @@ -246,28 +245,26 @@ }, 'chromium.gpu.fyi': { - 'GPU Mac Builder': 'tbd', - 'GPU Mac Builder (dbg)': 'tbd', - 'GPU Win Clang Builder (dbg)': 'tbd', - 'Linux Audio': 'tbd', - 'Win7 Audio': 'tbd', - 'GPU Linux Builder (dbg)': 'swarming_gpu_fyi_tests_gn_debug_bot', 'GPU Linux Builder': 'swarming_gpu_fyi_tests_gn_release_bot', + 'GPU Mac Builder': 'swarming_gpu_fyi_tests_gyp_release_bot', + 'GPU Mac Builder (dbg)': 'swarming_gpu_fyi_tests_gyp_debug_bot', 'GPU Win Builder': 'swarming_gpu_tests_deqp_gles_gyp_release_bot_minimal_symbols_x86', 'GPU Win Builder (dbg)': 'swarming_gpu_tests_deqp_gles_gyp_debug_bot_minimal_symbols_x86', + 'GPU Win Clang Builder (dbg)': + 'swarming_gpu_fyi_tests_gyp_clang_debug_bot_x86', 'GPU Win x64 Builder': 'swarming_gpu_tests_deqp_gles_gyp_release_bot_minimal_symbols_x64', 'GPU Win x64 Builder (dbg)': 'swarming_gpu_tests_deqp_gles_gyp_debug_bot_minimal_symbols_x64', + 'Linux Audio': 'release_static_gyp', 'Linux ChromiumOS Builder': 'swarming_gpu_fyi_tests_chromeos_gyp_release_bot', 'Linux Debug (NVIDIA)': 'none', 'Linux Debug (New Intel)': 'none', 'Linux Release (ATI)': 'none', - 'Linux Release (Intel Graphics Stack)': 'none', 'Linux Release (NVIDIA GeForce 730)': 'none', 'Linux Release (NVIDIA)': 'none', 'Linux Release (New Intel)': 'none', @@ -279,11 +276,11 @@ 'Mac 10.10 Retina Release (AMD)': 'none', 'Mac Retina Debug': 'none', 'Mac Retina Release': 'none', + 'Win7 Audio': 'release_static_gyp_minimal_symbols_x86', 'Win7 Debug (ATI)': 'none', 'Win7 Debug (NVIDIA)': 'none', 'Win7 Debug (New Intel)': 'none', 'Win7 Release (ATI)': 'none', - 'Win7 Release (Intel)': 'none', 'Win7 Release (NVIDIA GeForce 730)': 'none', 'Win7 Release (NVIDIA)': 'none', 'Win7 Release (New Intel)': 'none', @@ -367,11 +364,14 @@ }, 'chromium.memory.fyi': { - 'Chromium Linux ChromeOS MSan Builder': 'tbd', - 'Chromium Linux MSan Builder': 'tbd', - 'Chromium Linux TSan Builder': 'tbd', 'Chromium Linux Builder (valgrind)': 'gyp_valgrind_release_bot', + 'Chromium Linux ChromeOS MSan Builder': + 'swarming_gyp_chromeos_msan_release_bot', + 'Chromium Linux MSan Builder': + 'swarming_gyp_msan_release_bot', + 'Chromium Linux TSan Builder': + 'swarming_gyp_tsan_disable_nacl_release_bot', 'Chromium OS (valgrind)(1)': 'none', 'Chromium OS (valgrind)(2)': 'none', 'Chromium OS (valgrind)(3)': 'none', @@ -540,8 +540,8 @@ }, 'chromium.webkit': { - 'Android Builder': 'gyp_release_bot_android', - 'WebKit Android (Nexus4)': 'gyp_release_bot_android', + 'Android Builder': 'android_gn_release_bot_minimal_symbols', + 'WebKit Android (Nexus4)': 'none', 'WebKit Linux (dbg)': 'swarming_gn_debug_bot_x64', 'WebKit Linux ASAN': 'swarming_gn_asan_lsan_release_bot_x64', 'WebKit Linux Leak': 'swarming_gn_release_bot_x64', @@ -566,11 +566,10 @@ }, 'chromium.webrtc.fyi': { - 'Android Builder (dbg)': 'tbd', - 'Android Builder ARM64 (dbg)': 'tbd', - 'Mac Builder': 'tbd', - 'Win Builder': 'tbd', - + 'Android Builder (dbg)': + 'android_blink_logging_gyp_debug_static_bot', + 'Android Builder ARM64 (dbg)': + 'android_blink_logging_gyp_debug_static_bot_arm64', 'Android GN (dbg)': 'android_gn_debug_bot', 'Android GN': 'android_gn_release_bot', 'Android Tests (dbg) (K Nexus5)': 'none', @@ -580,9 +579,11 @@ 'Android Tests (dbg) (L Nexus9)': 'none', 'Linux Builder': 'gn_release_bot_chrome_with_codecs', 'Linux Tester': 'none', + 'Mac Builder': 'chrome_with_codecs_blink_logging_gyp_release_trybot', 'Mac GN (dbg)': 'gn_debug_static_bot_chrome_with_codecs', 'Mac GN': 'gn_release_bot_chrome_with_codecs', 'Mac Tester': 'none', + 'Win Builder': 'chrome_with_codecs_blink_logging_gyp_release_trybot_x86', 'Win x64 GN (dbg)': 'gn_debug_bot_minimal_symbols_chrome_with_codecs', 'Win x64 GN': 'gn_release_bot_minimal_symbols_chrome_with_codecs', 'Win10 Tester': 'none', @@ -658,8 +659,6 @@ 'tryserver.chromium.android': { 'android_archive_rel_ng': 'android_gn_release_trybot', - 'android_coverage': 'android_gn_debug_trybot_java_coverage', - 'android_swarming_rel': 'swarming_android_gn_release_trybot', 'android_arm64_dbg_recipe': 'swarming_android_gyp_debug_trybot_arm64', 'android_blink_rel': 'swarming_android_gyp_release_trybot', 'android_chromium_gn_compile_dbg': 'android_gn_debug_trybot', @@ -678,20 +677,21 @@ 'android_compile_rel': 'swarming_android_gyp_release_trybot', 'android_compile_x64_dbg': 'android_gn_debug_trybot_x64', 'android_compile_x86_dbg': 'android_gn_debug_trybot_x86', + 'android_coverage': 'android_gn_debug_trybot_java_coverage', # TODO(crbug/597596): Switch this back to debug_trybot when cronet's # shared library loading is fixed. 'android_cronet_tester': 'android_cronet_gn_debug_static_bot', + 'android_swarming_rel': 'swarming_android_gn_release_trybot', 'cast_shell_android': 'android_cast_gn_debug_static_bot', 'linux_android_dbg_ng': 'swarming_android_gyp_debug_trybot', 'linux_android_rel_ng': 'swarming_android_gyp_release_trybot', }, 'tryserver.chromium.angle': { - 'mac_angle_dbg_ng': 'tbd', - 'mac_angle_rel_ng': 'tbd', - 'linux_angle_dbg_ng': 'swarming_gpu_fyi_tests_gn_debug_trybot', 'linux_angle_rel_ng': 'swarming_gpu_fyi_tests_gn_release_trybot', + 'mac_angle_dbg_ng': 'swarming_gpu_fyi_tests_gyp_debug_trybot', + 'mac_angle_rel_ng': 'swarming_gpu_fyi_tests_gyp_release_trybot', 'win_angle_dbg_ng': 'swarming_gpu_tests_deqp_gles_gyp_debug_bot_minimal_symbols_x86', 'win_angle_rel_ng': @@ -703,17 +703,14 @@ }, 'tryserver.chromium.linux': { - 'Chromium Linux Codesearch Builder': 'tbd', - 'ChromiumOS Codesearch Builder': 'tbd', - 'chromeos_amd64-generic_chromium_compile_only_ng': 'tbd', - 'chromeos_daisy_chromium_compile_only_ng': 'tbd', - 'chromeos_x86-generic_chromium_compile_only_ng': 'tbd', - 'linux_chromium_chromeos_asan_rel_ng': 'tbd', - 'linux_chromium_chromeos_msan_rel_ng': 'tbd', - + 'Chromium Linux Codesearch Builder': 'gyp_debug_trybot', + 'ChromiumOS Codesearch Builder': 'gyp_debug_trybot', 'cast_shell_linux': 'cast_gn_release_trybot', 'chromeos_amd64-generic_variable': 'findit', + 'chromeos_amd64-generic_chromium_compile_only_ng': 'cros_chrome_sdk_gyp', + 'chromeos_daisy_chromium_compile_only_ng': 'cros_chrome_sdk_gyp', 'chromeos_daisy_variable': 'findit', + 'chromeos_x86-generic_chromium_compile_only_ng': 'cros_chrome_sdk_gyp', 'chromeos_x86-generic_variable': 'findit', 'chromium_presubmit': 'none', 'linux_arm': 'swarming_gyp_release_trybot_arm', @@ -723,6 +720,8 @@ 'linux_chromium_browser_side_navigation_rel': 'gyp_release_trybot', 'linux_chromium_cast_variable': 'findit', 'linux_chromium_cfi_rel_ng': 'gn_cfi_release_trybot', + 'linux_chromium_chromeos_asan_rel_ng': + 'swarming_asan_lsan_chromeos_gyp_release_trybot', 'linux_chromium_chromeos_asan_variable': 'findit', 'linux_chromium_chromeos_compile_dbg_ng': 'swarming_chromeos_gyp_debug_trybot', @@ -730,6 +729,8 @@ 'swarming_chromeos_gn_release_trybot', 'linux_chromium_chromeos_dbg_ng': 'swarming_chromeos_gyp_debug_trybot', + 'linux_chromium_chromeos_msan_rel_ng': + 'swarming_msan_gyp_release_trybot', 'linux_chromium_chromeos_ozone_rel_ng': 'swarming_chromeos_gyp_ozone_release_trybot', 'linux_chromium_chromeos_rel_ng': 'swarming_chromeos_gyp_release_trybot', @@ -749,6 +750,8 @@ 'linux_chromium_practice_rel_ng': 'gyp_release_trybot', 'linux_chromium_rel_ng': 'swarming_gpu_tests_gn_release_trybot', 'linux_chromium_tsan_rel_ng': 'swarming_tsan_gyp_release_trybot', + 'linux_chromium_tsan_rel_ng': + 'swarming_gyp_tsan_disable_nacl_release_trybot', 'linux_chromium_variable': 'findit', 'linux_chromium_variable_32': 'findit', 'linux_chromium_variable_chrome': 'findit', @@ -771,10 +774,6 @@ }, 'tryserver.chromium.mac': { - 'mac_chromium_archive_rel_ng': 'tbd', - 'mac_chromium_asan_rel_ng': 'tbd', - 'mac_optional_gpu_tests_rel': 'tbd', - 'ios_dbg_simulator': 'ios_gyp', 'ios_dbg_simulator_gn': 'ios_gn', 'ios_dbg_simulator_ninja': 'ios_gyp', @@ -782,6 +781,8 @@ 'ios_rel_device_gn': 'ios_gn', 'ios_rel_device_ninja': 'ios_gyp', 'mac_chromium_10.10_rel_ng': 'swarming_gpu_tests_gyp_release_trybot', + 'mac_chromium_archive_rel_ng': 'noswarming_gyp_release_trybot', + 'mac_chromium_asan_rel_ng': 'swarming_asan_dcheck_gyp_release_bot', 'mac_chromium_asan_variable': 'findit', 'mac_chromium_compile_dbg_ng': 'swarming_gyp_debug_trybot', 'mac_chromium_compile_rel_ng': 'swarming_gpu_tests_gyp_release_trybot', @@ -799,6 +800,8 @@ 'mac_chromium_variable_layout': 'findit', 'mac_nacl_sdk': 'nacl_annotator', 'mac_nacl_sdk_build': 'nacl_annotator', + 'mac_optional_gpu_tests_rel': + 'swarming_gpu_fyi_tests_gyp_release_trybot', 'mac_upload_clang': 'gn_release_bot', }, @@ -910,6 +913,14 @@ 'android', 'cast', 'gn', 'clang', 'debug_static_bot', ], + 'android_blink_logging_gyp_debug_static_bot': [ + 'android', 'blink_logging', 'gyp', 'debug_static_bot', + ], + + 'android_blink_logging_gyp_debug_static_bot_arm64': [ + 'android', 'blink_logging', 'gyp', 'debug_static_bot', 'arm64', + ], + 'android_clang_no_chrome_plugins_asan_gn_debug_bot_minimal_symbols': [ 'android', 'clang_no_chrome_plugins', 'asan', 'gn', 'debug_bot_minimal_symbols', @@ -1041,6 +1052,14 @@ 'cast', 'gn', 'release_trybot', ], + 'chrome_with_codecs_blink_logging_gyp_release_trybot': [ + 'chrome_with_codecs', 'blink_logging', 'gyp', 'release_trybot', + ], + + 'chrome_with_codecs_blink_logging_gyp_release_trybot_x86': [ + 'chrome_with_codecs', 'blink_logging', 'gyp', 'release_trybot', 'x86', + ], + 'chromeos_gn_debug_bot': [ 'chromeos', 'gn', 'debug_bot', ], @@ -1053,6 +1072,13 @@ 'chromeos', 'ozone', 'gn', 'release_trybot', ], + # The 'cros_chrome_sdk_* configs are placeholders that indicate + # that the GYP_DEFINES (or GN args) are set by the `cros chrome-sdk` + # wrapper and need to be looked at specially. + 'cros_chrome_sdk_gyp': [ + 'gyp', 'error', + ], + 'embedded_gyp_debug_bot': [ 'embedded', 'gyp', 'debug_bot', ], @@ -1176,6 +1202,10 @@ 'release_bot', ], + 'gyp_debug_trybot': [ + 'gyp', 'debug_trybot', + ], + 'gyp_msan_edge_release_bot': [ 'gyp', 'msan', 'edge', 'release_bot', ], @@ -1267,10 +1297,6 @@ 'gyp', 'official', 'x64', ], - 'gyp_release_bot_android': [ - 'gyp', 'release_bot', 'android', - ], - 'gyp_release_trybot': [ 'gyp', 'release_trybot', ], @@ -1352,10 +1378,22 @@ 'noswarming', 'gyp', 'release_bot', 'minimal_symbols', 'x86', ], + 'noswarming_gyp_release_trybot': [ + 'noswarming', 'gyp', 'release_trybot', + ], + 'noswarming_gyp_release_trybot_minimal_symbols_x86': [ 'noswarming', 'gyp', 'release_trybot', 'minimal_symbols', 'x86', ], + 'release_static_gyp': [ + 'release', 'static', 'gyp', + ], + + 'release_static_gyp_minimal_symbols_x86': [ + 'release', 'static', 'gyp', 'minimal_symbols', 'x86', + ], + 'swarming_android_gn_release_bot_minimal_symbols': [ 'swarming', 'android', 'gn', 'release_bot_minimal_symbols', ], @@ -1388,10 +1426,18 @@ 'swarming', 'android', 'gyp', 'release_trybot', ], + 'swarming_asan_dcheck_gyp_release_bot': [ + 'swarming', 'asan', 'dcheck_always_on', 'gyp', 'release_bot', + ], + 'swarming_asan_lsan_gyp_release_trybot': [ 'swarming', 'asan', 'lsan', 'release_trybot', ], + 'swarming_asan_lsan_chromeos_gyp_release_trybot': [ + 'swarming', 'asan', 'lsan', 'chromeos', 'release_trybot', + ], + 'swarming_chromeos_gn_release_trybot': [ 'swarming', 'chromeos_with_codecs', 'gn', 'release_trybot', ], @@ -1465,6 +1511,31 @@ 'release_bot', 'angle_deqp_tests', ], + 'swarming_gpu_fyi_tests_gyp_debug_bot': [ + 'swarming', 'gpu_tests', 'internal_gles2_conform_tests', 'gyp', + 'debug_bot', + ], + + 'swarming_gpu_fyi_tests_gyp_debug_trybot': [ + 'swarming', 'gpu_tests', 'internal_gles2_conform_tests', 'gyp', + 'debug_trybot', + ], + + 'swarming_gpu_fyi_tests_gyp_release_bot': [ + 'swarming', 'gpu_tests', 'internal_gles2_conform_tests', 'gyp', + 'release_bot', + ], + + 'swarming_gpu_fyi_tests_gyp_release_trybot': [ + 'swarming', 'gpu_tests', 'internal_gles2_conform_tests', 'gyp', + 'release_trybot', + ], + + 'swarming_gpu_fyi_tests_gyp_clang_debug_bot_x86': [ + 'swarming', 'gpu_tests', 'internal_gles2_conform_tests', 'gyp', + 'clang', 'debug_bot', 'x86', + ], + 'swarming_gpu_tests_deqp_gles_gyp_debug_bot_minimal_symbols_x64': [ 'swarming', 'gpu_tests', 'angle_deqp_tests', 'internal_gles2_conform_tests', 'gyp', 'debug_bot', @@ -1570,6 +1641,10 @@ 'swarming', 'gn', 'release_trybot', 'minimal_symbols', 'x64', ], + 'swarming_gyp_chromeos_msan_release_bot': [ + 'swarming', 'gyp', 'chromeos', 'msan', 'release_bot', + ], + 'swarming_gyp_clang_debug_bot_minimal_symbols_x86': [ 'swarming', 'gyp', 'clang', 'debug_bot', 'minimal_symbols', 'x86', ], @@ -1619,6 +1694,10 @@ 'swarming', 'gyp', 'debug_trybot', 'x86', ], + 'swarming_gyp_msan_release_bot': [ + 'swarming', 'gyp', 'msan', 'release_bot', + ], + 'swarming_gyp_release_bot': [ 'swarming', 'gyp', 'release_bot', ], @@ -1656,8 +1735,12 @@ 'x86', ], - 'swarming_tsan_gyp_release_trybot': [ - 'swarming', 'disable_nacl', 'tsan', 'gyp', 'release_trybot', + 'swarming_gyp_tsan_disable_nacl_release_bot': [ + 'swarming', 'gyp', 'tsan', 'disable_nacl', 'release_bot', + ], + + 'swarming_gyp_tsan_disable_nacl_release_trybot': [ + 'swarming', 'gyp', 'tsan', 'disable_nacl', 'release_trybot', ], 'gn_debug_bot_minimal_symbols_chrome_with_codecs': [ @@ -1733,6 +1816,11 @@ 'gyp_defines': 'asan=1', }, + 'blink_logging': { + 'gn_args': 'blink_logging_always_on=true', + 'gyp_defines': 'blink_logging_always_on=1', + }, + 'ffmpeg_branding_chrome': { 'gn_args': 'ffmpeg_branding="Chrome"', 'gyp_defines': 'ffmpeg_branding=Chrome',
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml index 8c2e443..ddb181d 100644 --- a/tools/metrics/histograms/histograms.xml +++ b/tools/metrics/histograms/histograms.xml
@@ -1550,21 +1550,21 @@ </histogram> <histogram name="AsyncDNS.AttemptCountFail"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Count of DnsAttempts before DnsTransaction completes with failure. </summary> </histogram> <histogram name="AsyncDNS.AttemptCountSuccess"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Count of DnsAttempts before DnsTransaction completes successfully. </summary> </histogram> <histogram name="AsyncDNS.ConfigChange" enum="BooleanSuccess"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Whether DnsConfigService::OnConfigChange actually corresponded to a change in DnsConfig. @@ -1572,45 +1572,45 @@ </histogram> <histogram name="AsyncDNS.ConfigNotifyInterval" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Duration of time between calls to DnsConfigService::InvalidateConfig. </summary> </histogram> <histogram name="AsyncDNS.ConfigParseDuration" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary>Duration of time spent parsing DnsConfig.</summary> </histogram> <histogram name="AsyncDNS.ConfigParsePosix" enum="AsyncDNSConfigParsePosix"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Counts of results of parsing DnsConfig in DnsConfigServicePosix. </summary> </histogram> <histogram name="AsyncDNS.ConfigParseResult" enum="BooleanSuccess"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary>Whether DnsConfig was parsed successfully.</summary> </histogram> <histogram name="AsyncDNS.ConfigParseWin" enum="AsyncDNSConfigParseWin"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Counts of results of parsing DnsConfig in DnsConfigServiceWin. </summary> </histogram> <histogram name="AsyncDNS.DNSChangerDetected" enum="BooleanSuccess"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Whether the first valid DnsConfig included a rogue nameserver. </summary> </histogram> <histogram name="AsyncDNS.DnsClientDisabledReason" enum="NetErrorCodes"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Counts of specific error codes returned by DnsTask if a subsequent ProcTask succeeded, at the end of a streak of failures after which the DnsClient was @@ -1619,7 +1619,7 @@ </histogram> <histogram name="AsyncDNS.DnsClientEnabled" enum="BooleanSuccess"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> TRUE counts the events when a valid DnsConfig is received and used to enable DnsClient, while FALSE counts the events when DnsClient is disabled after a @@ -1628,21 +1628,21 @@ </histogram> <histogram name="AsyncDNS.FallbackFail" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Duration of time spent by ProcTask in failing fallback resolutions. </summary> </histogram> <histogram name="AsyncDNS.FallbackSuccess" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Duration of time spent by ProcTask in successful fallback resolutions. </summary> </histogram> <histogram name="AsyncDNS.HaveDnsConfig" enum="BooleanSuccess"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Whether there was a valid DNS configuration at the start of a job which eventually completed successfully. @@ -1650,12 +1650,12 @@ </histogram> <histogram name="AsyncDNS.HostParseResult" enum="BooleanSuccess"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary>Whether DnsHosts were parsed successfully.</summary> </histogram> <histogram name="AsyncDNS.HostsChange" enum="BooleanSuccess"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Whether DnsConfigService::OnHostsChange actually corresponded to a change in DnsHosts. @@ -1663,33 +1663,33 @@ </histogram> <histogram name="AsyncDNS.HostsNotifyInterval" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Duration of time between calls to DnsConfigService::InvalidateHosts. </summary> </histogram> <histogram name="AsyncDNS.HostsParseDuration" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary>Duration of time spent parsing DnsHosts.</summary> </histogram> <histogram name="AsyncDNS.HostsParseWin" enum="AsyncDNSHostsParseWin"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Counts of results of parsing DnsHosts in DnsConfigServiceWin. </summary> </histogram> <histogram name="AsyncDNS.HostsSize" units="bytes"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> The size of the HOSTS file observed before each attempt to parse it. </summary> </histogram> <histogram name="AsyncDNS.JobQueueTime" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Time elapsed between the time the HostResolverImpl::Job was created and the time the Job was started (using DnsClient). @@ -1697,7 +1697,7 @@ </histogram> <histogram name="AsyncDNS.JobQueueTime_HIGHEST" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Time elapsed between the time the HostResolverImpl::Job was created and the time the Job was started (using DnsClient). Includes only Jobs which had @@ -1706,7 +1706,7 @@ </histogram> <histogram name="AsyncDNS.JobQueueTime_IDLE" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Time elapsed between the time the HostResolverImpl::Job was created and the time the Job was started (using DnsClient). Includes only Jobs which had @@ -1715,7 +1715,7 @@ </histogram> <histogram name="AsyncDNS.JobQueueTime_LOW" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Time elapsed between the time the HostResolverImpl::Job was created and the time the Job was started (using DnsClient). Includes only Jobs which had @@ -1724,7 +1724,7 @@ </histogram> <histogram name="AsyncDNS.JobQueueTime_LOWEST" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Time elapsed between the time the HostResolverImpl::Job was created and the time the Job was started (using DnsClient). Includes only Jobs which had @@ -1733,7 +1733,7 @@ </histogram> <histogram name="AsyncDNS.JobQueueTime_MEDIUM" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Time elapsed between the time the HostResolverImpl::Job was created and the time the Job was started (using DnsClient). Includes only Jobs which had @@ -1742,7 +1742,7 @@ </histogram> <histogram name="AsyncDNS.JobQueueTimeAfterChange" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Time elapsed between the last time the priority of a HostResolverImpl::Job changed (when a Request was attached or detached) and the time the Job was @@ -1751,7 +1751,7 @@ </histogram> <histogram name="AsyncDNS.JobQueueTimeAfterChange_HIGHEST" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Time elapsed between the last time the priority of a HostResolverImpl::Job changed (when a Request was attached or detached) and the time the Job was @@ -1761,7 +1761,7 @@ </histogram> <histogram name="AsyncDNS.JobQueueTimeAfterChange_IDLE" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Time elapsed between the last time the priority of a HostResolverImpl::Job changed (when a Request was attached or detached) and the time the Job was @@ -1771,7 +1771,7 @@ </histogram> <histogram name="AsyncDNS.JobQueueTimeAfterChange_LOW" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Time elapsed between the last time the priority of a HostResolverImpl::Job changed (when a Request was attached or detached) and the time the Job was @@ -1781,7 +1781,7 @@ </histogram> <histogram name="AsyncDNS.JobQueueTimeAfterChange_LOWEST" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Time elapsed between the last time the priority of a HostResolverImpl::Job changed (when a Request was attached or detached) and the time the Job was @@ -1791,7 +1791,7 @@ </histogram> <histogram name="AsyncDNS.JobQueueTimeAfterChange_MEDIUM" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Time elapsed between the last time the priority of a HostResolverImpl::Job changed (when a Request was attached or detached) and the time the Job was @@ -1804,7 +1804,7 @@ <obsolete> Deprecated as of 4/2016. </obsolete> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Type of nameservers in the DNS config, recorded each time the config is read by the DNSConfigService. @@ -1812,7 +1812,7 @@ </histogram> <histogram name="AsyncDNS.ParseToAddressList" enum="AsyncDNSParseResult"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Counts of results of parsing addresses out of DNS responses in successful DnsTransactions. @@ -1820,7 +1820,7 @@ </histogram> <histogram name="AsyncDNS.PrefDefaultSource" enum="AsyncDNSPrefDefaultSource"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> The source of the async DNS preference's default. Logged at startup, when the IO thread is created. @@ -1828,7 +1828,7 @@ </histogram> <histogram name="AsyncDNS.PrefSource" enum="AsyncDNSPrefSource"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> The source of the async DNS preference's value. Logged at startup, when the IO thread is created. @@ -1836,7 +1836,7 @@ </histogram> <histogram name="AsyncDNS.ResolveError" enum="NetErrorCodes"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Counts of specific error codes returned by DnsTask if a subsequent ProcTask succeeded. @@ -1844,7 +1844,7 @@ </histogram> <histogram name="AsyncDNS.ResolveFail" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Duration of time taken by DnsTask in resolutions that failed. Excludes time spent in the subsequent fallback. @@ -1852,7 +1852,7 @@ </histogram> <histogram name="AsyncDNS.ResolveStatus" enum="AsyncDNSResolveStatus"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Counts of the overall results of using asynchronous DNS in HostResolverImpl. This only includes jobs started with valid DNS configuration and excludes @@ -1861,35 +1861,35 @@ </histogram> <histogram name="AsyncDNS.ResolveSuccess" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Duration of time taken by DnsTask in resolutions that succeeded. </summary> </histogram> <histogram name="AsyncDNS.ResolveSuccess_FAMILY_IPV4" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Same as AsyncDNS.ResolveSuccess, but limited to pure IPv4 lookups. </summary> </histogram> <histogram name="AsyncDNS.ResolveSuccess_FAMILY_IPV6" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Same as AsyncDNS.ResolveSuccess, but limited to pure IPv6 lookups. </summary> </histogram> <histogram name="AsyncDNS.ResolveSuccess_FAMILY_UNSPEC" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Same as AsyncDNS.ResolveSuccess, but limited to IPv4/IPv6 lookups. </summary> </histogram> <histogram name="AsyncDNS.ServerCount"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Count of servers in DnsConfig. Recorded on every new DnsSession, which is created on DNS change. @@ -1897,14 +1897,14 @@ </histogram> <histogram name="AsyncDNS.ServerFailureIndex"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Index in DnsConfig of the failing server, recorded at the time of failure. </summary> </histogram> <histogram name="AsyncDNS.ServerFailuresAfterNetworkChange"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Count of server failures after network change before first success in the DnsSession. Recorded at the time of first success. @@ -1912,7 +1912,7 @@ </histogram> <histogram name="AsyncDNS.ServerFailuresAfterSuccess"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Count of server failures after success until the end of the session. Server has reported success at some point during the session. Recorded at the end @@ -1921,7 +1921,7 @@ </histogram> <histogram name="AsyncDNS.ServerFailuresBeforeSuccess"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Count of server failures before success. This is NOT the first success in the DnsSession. Recorded at the time of success. @@ -1929,7 +1929,7 @@ </histogram> <histogram name="AsyncDNS.ServerFailuresWithoutSuccess"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Count of server failures without success until the end of the session. Server has never reported success during the DnsSession. Recorded at the end @@ -1938,14 +1938,14 @@ </histogram> <histogram name="AsyncDNS.ServerIsGood" enum="BooleanSuccess"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> The current server is "good" and does not have to be skipped. </summary> </histogram> <histogram name="AsyncDNS.SortFailure" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Duration of time taken in failing calls to AddressSorter in dual-stack resolutions using DnsTask. @@ -1953,7 +1953,7 @@ </histogram> <histogram name="AsyncDNS.SortSuccess" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Duration of time taken in successful calls to AddressSorter in dual-stack resolutions using DnsTask. @@ -1961,7 +1961,7 @@ </histogram> <histogram name="AsyncDNS.SuffixSearchDone"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> The number of names from the search name list consumed during a successful transaction (QTYPE A only). @@ -1969,7 +1969,7 @@ </histogram> <histogram name="AsyncDNS.SuffixSearchRemain"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> The number of names left on the search name list at the end of a successful transaction (QTYPE A only). @@ -1977,7 +1977,7 @@ </histogram> <histogram name="AsyncDNS.SuffixSearchStart"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> The number of names on the search name list at the start of a transaction (QTYPE A only). @@ -1985,7 +1985,7 @@ </histogram> <histogram name="AsyncDNS.TCPAttemptFail" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Duration of time taken by DnsTCPAttempt in failed attempts. Excludes timeouts. @@ -1993,42 +1993,42 @@ </histogram> <histogram name="AsyncDNS.TCPAttemptSuccess" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Duration of time taken by DnsTCPAttempt in successful attempts. </summary> </histogram> <histogram name="AsyncDNS.TimeoutErrorHistogram" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Difference between RTT and timeout calculated using Histogram algorithm. </summary> </histogram> <histogram name="AsyncDNS.TimeoutErrorHistogramUnder" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Difference between timeout calculated using Histogram algorithm and RTT. </summary> </histogram> <histogram name="AsyncDNS.TimeoutErrorJacobson" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Difference between RTT and timeout calculated using Jacobson algorithm. </summary> </histogram> <histogram name="AsyncDNS.TimeoutErrorJacobsonUnder" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Difference between timeout calculated using Jacobson algorithm and RTT. </summary> </histogram> <histogram name="AsyncDNS.TimeoutSpentHistogram" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Duration of time that would be spent waiting for lost request using Histogram algorithm. @@ -2036,7 +2036,7 @@ </histogram> <histogram name="AsyncDNS.TimeoutSpentJacobson" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Duration of time that would be spent waiting for lost request using Jacobson algorithm. @@ -2044,7 +2044,7 @@ </histogram> <histogram name="AsyncDNS.TotalTime" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Duration of time since a HostResolverImpl::Resolve request to the time a result is posted. Excludes canceled, evicted, and aborted requests. Includes @@ -2053,7 +2053,7 @@ </histogram> <histogram name="AsyncDNS.TotalTime_speculative" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Duration of time since a HostResolverImpl::Resolve request to the time a result is posted. Excludes canceled, evicted, and aborted requests. Includes @@ -2062,7 +2062,7 @@ </histogram> <histogram name="AsyncDNS.TransactionFailure" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Duration of time taken in failing DnsTransactions. This includes server failures, timeouts and NXDOMAIN results. @@ -2070,7 +2070,7 @@ </histogram> <histogram name="AsyncDNS.TransactionSuccess" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Duration of time taken in successful DnsTransactions. This includes all NOERROR answers, even if they indicate the name has no addresses or they @@ -2079,21 +2079,21 @@ </histogram> <histogram name="AsyncDNS.TransactionSuccess_A" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Same as AsyncDNS.TransactionSuccess but limited to A query type. </summary> </histogram> <histogram name="AsyncDNS.TransactionSuccess_AAAA" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Same as AsyncDNS.TransactionSuccess but limited to AAAA query type. </summary> </histogram> <histogram name="AsyncDNS.TTL" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> TTL of the resolved addresses, as in the response received from the server. For results served from local cache, the TTL is from the original response. @@ -2101,7 +2101,7 @@ </histogram> <histogram name="AsyncDNS.UDPAttemptFail" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Duration of time taken by DnsUDPAttempt in failed attempts. Excludes timeouts. @@ -2109,7 +2109,7 @@ </histogram> <histogram name="AsyncDNS.UDPAttemptSuccess" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Duration of time taken by DnsUDPAttempt in successful attempts. Includes responses arriving after timeout, if multiple attempts are allowed. @@ -2117,7 +2117,7 @@ </histogram> <histogram name="AsyncDNS.UnchangedConfigInterval" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Duration of time since the last empty config result to the time a non-change OnConfigChange is received. @@ -2125,7 +2125,7 @@ </histogram> <histogram name="AsyncDNS.UnchangedHostsInterval" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Duration of time since the last empty config result to the time a non-change OnHostsChange is received. @@ -2133,7 +2133,7 @@ </histogram> <histogram name="AsyncDNS.WatchStatus" enum="AsyncDNSWatchStatus"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> The result of DnsConfigService watch. Counts STARTED on every initialization and FAILED_* on any failure. @@ -6756,6 +6756,9 @@ enum="DataReductionProxyAutoLoFiAccuracy"> <owner>bengr@chromium.org</owner> <owner>tbansal@chromium.org</owner> + <obsolete> + Replaced by DataReductionProxy.LoFi.Accuracy. + </obsolete> <summary> Counts the accuracy of estimated network quality when using Lo-Fi. Counters are incremented when a main frame URL request is handled by Data Reduction @@ -7116,6 +7119,19 @@ <summary>Size of Data Reduction Proxy LevelDB measured at startup.</summary> </histogram> +<histogram name="DataReductionProxy.LoFi.Accuracy" + enum="DataReductionProxyAutoLoFiAccuracy"> + <owner>bengr@chromium.org</owner> + <owner>tbansal@chromium.org</owner> + <summary> + Records the accuracy of estimated network quality when using Lo-Fi. Network + quality predicted at the time of navigation start is compared with the + network quality observed during the specified time interval following the + start of the navigation. This metric is recorded only when the session is in + Lo-Fi enabled field trial. + </summary> +</histogram> + <histogram name="DataReductionProxy.LoFi.ImplicitOptOutAction" enum="DataReductionProxyLoFiImplicitOptOutAction"> <owner>bengr@chromium.org</owner> @@ -8505,14 +8521,14 @@ </histogram> <histogram name="DNS.AttemptCancelled"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> The attempt which completed after the job was already cancelled. </summary> </histogram> <histogram name="DNS.AttemptDiscarded"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> The attempt which completed after the job was already cancelled OR the attempt that has finished after host resolution was already completed by an @@ -8521,7 +8537,7 @@ </histogram> <histogram name="DNS.AttemptFailDuration" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Duration of time taken in OS resolutions for actual navigations. These attempts which completed after the job was already canceled OR after the job @@ -8531,12 +8547,12 @@ </histogram> <histogram name="DNS.AttemptFailure"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary>The attempt that has not resolved the host successfully.</summary> </histogram> <histogram name="DNS.AttemptFirstFailure"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> The attempt that resolved the host first and the resolution was not successful. @@ -8544,19 +8560,19 @@ </histogram> <histogram name="DNS.AttemptFirstSuccess"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> The attempt that resolved the host first and the resolution was successful. </summary> </histogram> <histogram name="DNS.AttemptSuccess"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary>The attempt that has resolved the host successfully.</summary> </histogram> <histogram name="DNS.AttemptSuccessDuration" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Duration of time taken in OS resolutions that succeeded and were requested for actual navigations. These attempts which completed after the job was @@ -8567,7 +8583,7 @@ </histogram> <histogram name="DNS.AttemptTimeSavedByRetry" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> This histogram shows the time saved by having spawned an extra attempt, when the first attempt didn't finish before retry attempt. @@ -8575,7 +8591,7 @@ </histogram> <histogram name="DNS.CacheEvicted" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> The time left to expiration of an entry when it is removed while compacting the HostCache. @@ -8583,7 +8599,7 @@ </histogram> <histogram name="DNS.CacheExpired" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> The time since expiration of an entry when it is removed while compacting the HostCache. @@ -8591,7 +8607,7 @@ </histogram> <histogram name="DNS.CacheExpiredOnGet" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> The time since expiration of an entry when it is removed on lookup. </summary> @@ -8599,14 +8615,14 @@ <histogram name="DNS.EmptyAddressListAndNoError" enum="DNSEmptyAddressListAndNoError"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Error status when an empty address list was found in OnLookupComplete(). </summary> </histogram> <histogram name="DNS.IndependentFailedNavigation" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> When either a pre-resolution was not done recently enough to provide benefit, or the corresponding pre-resolution is still pending, this @@ -8619,7 +8635,7 @@ </histogram> <histogram name="DNS.IndependentNavigation" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> When either a pre-resolution was not done recently enough to provide benefit, or the corresponding pre-resolution is still pending, this @@ -8632,7 +8648,7 @@ </histogram> <histogram name="DNS.JobQueueTime" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Time elapsed between the time the HostResolverImpl::Job was created and the time the Job was started (a getaddrinfo call was dispatched to the thread @@ -8641,7 +8657,7 @@ </histogram> <histogram name="DNS.JobQueueTime_HIGHEST" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Time elapsed between the time the HostResolverImpl::Job was created and the time the Job was started (a getaddrinfo call was dispatched to the thread @@ -8650,7 +8666,7 @@ </histogram> <histogram name="DNS.JobQueueTime_IDLE" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Time elapsed between the time the HostResolverImpl::Job was created and the time the Job was started (a getaddrinfo call was dispatched to the thread @@ -8659,7 +8675,7 @@ </histogram> <histogram name="DNS.JobQueueTime_LOW" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Time elapsed between the time the HostResolverImpl::Job was created and the time the Job was started (a getaddrinfo call was dispatched to the thread @@ -8668,7 +8684,7 @@ </histogram> <histogram name="DNS.JobQueueTime_LOWEST" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Time elapsed between the time the HostResolverImpl::Job was created and the time the Job was started (a getaddrinfo call was dispatched to the thread @@ -8677,7 +8693,7 @@ </histogram> <histogram name="DNS.JobQueueTime_MEDIUM" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Time elapsed between the time the HostResolverImpl::Job was created and the time the Job was started (a getaddrinfo call was dispatched to the thread @@ -8686,7 +8702,7 @@ </histogram> <histogram name="DNS.JobQueueTimeAfterChange" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Time elapsed between the last time the priority of a HostResolverImpl::Job changed (when a Request was attached or detached) and the time the Job was @@ -8695,7 +8711,7 @@ </histogram> <histogram name="DNS.JobQueueTimeAfterChange_HIGHEST" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Time elapsed between the last time the priority of a HostResolverImpl::Job changed (when a Request was attached or detached) and the time the Job was @@ -8705,7 +8721,7 @@ </histogram> <histogram name="DNS.JobQueueTimeAfterChange_IDLE" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Time elapsed between the last time the priority of a HostResolverImpl::Job changed (when a Request was attached or detached) and the time the Job was @@ -8715,7 +8731,7 @@ </histogram> <histogram name="DNS.JobQueueTimeAfterChange_LOW" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Time elapsed between the last time the priority of a HostResolverImpl::Job changed (when a Request was attached or detached) and the time the Job was @@ -8725,7 +8741,7 @@ </histogram> <histogram name="DNS.JobQueueTimeAfterChange_LOWEST" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Time elapsed between the last time the priority of a HostResolverImpl::Job changed (when a Request was attached or detached) and the time the Job was @@ -8735,7 +8751,7 @@ </histogram> <histogram name="DNS.JobQueueTimeAfterChange_MEDIUM" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Time elapsed between the last time the priority of a HostResolverImpl::Job changed (when a Request was attached or detached) and the time the Job was @@ -8745,7 +8761,7 @@ </histogram> <histogram name="DNS.PrefetchCacheEviction" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@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 @@ -8755,7 +8771,7 @@ </histogram> <histogram name="DNS.PrefetchCacheEvictionL" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@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 @@ -8765,12 +8781,12 @@ </histogram> <histogram name="DNS.PrefetchFoundName"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary>Replaced by DNS.PrefetchFoundNameL.</summary> </histogram> <histogram name="DNS.PrefetchFoundNameL" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <obsolete> Deprecated 2/2010, and replaced by DNS.PrefetchResolution </obsolete> @@ -8787,12 +8803,12 @@ </histogram> <histogram name="DNS.PrefetchNegativeHit"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary>Replaced by DNS.PrefetchNegativeHitL.</summary> </histogram> <histogram name="DNS.PrefetchNegativeHitL" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@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 @@ -8810,12 +8826,12 @@ </histogram> <histogram name="DNS.PrefetchPositiveHit"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary>Replaced by DNS.PrefetchPositiveHitL.</summary> </histogram> <histogram name="DNS.PrefetchPositiveHitL" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> The duration of time saved due to DNS pre-resolving in the "name was found" case, and induced by either a page scan for a link or an omnibox @@ -8831,7 +8847,7 @@ </histogram> <histogram name="DNS.PrefetchQueue" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@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 @@ -8840,7 +8856,7 @@ </histogram> <histogram name="DNS.PrefetchReferredPositiveHit" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> The duration of time saved due to DNS pre-resolving in the "name was found" case, and induced by predicting (using referrer lists) that a @@ -8856,7 +8872,7 @@ </histogram> <histogram name="DNS.PrefetchResolution" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@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 @@ -8870,7 +8886,7 @@ </histogram> <histogram name="DNS.QueueRecycledDeltaOver2"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> When, due to congestion avoidance, a queued pre-resolution is abandoned (recycled) without actually being resolved, this histograms records the age @@ -8880,7 +8896,7 @@ </histogram> <histogram name="DNS.QueueRecycledUnder2"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> When, due to congestion avoidance, a queued pre-resolution is abandoned (recycled) without actually being resolved, this histograms records the age @@ -8890,14 +8906,14 @@ </histogram> <histogram name="DNS.ResolveCategory" enum="ResolutionCategory"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Counts of successes and failures of OS resolutions in various categories. </summary> </histogram> <histogram name="DNS.ResolveFail" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Duration of time taken in OS resolutions for actual navigations. Note that cached OS resolutions may provide low (0ms?) resolution times. @@ -8905,22 +8921,22 @@ </histogram> <histogram name="DNS.ResolveFail_FAMILY_IPV4" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary>Same as DNS.ResolveFail, but limited to pure IPv4 lookups.</summary> </histogram> <histogram name="DNS.ResolveFail_FAMILY_IPV6" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary>Same as DNS.ResolveFail, but limited to pure IPv6 lookups.</summary> </histogram> <histogram name="DNS.ResolveFail_FAMILY_UNSPEC" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary>Same as DNS.ResolveFail, but limited to IPv4/IPv6 lookups.</summary> </histogram> <histogram name="DNS.ResolveSpeculativeFail" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Duration of time taken in speculative OS resolutions. Note that cached OS resolutions may provide low (0ms?) resolution times. @@ -8928,7 +8944,7 @@ </histogram> <histogram name="DNS.ResolveSpeculativeSuccess" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Duration of time taken in speculative OS resolution that succeeded. Note that cached resolutions may provide low (0ms?) resolution times. @@ -8936,7 +8952,7 @@ </histogram> <histogram name="DNS.ResolveSuccess" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@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?) @@ -8945,28 +8961,28 @@ </histogram> <histogram name="DNS.ResolveSuccess_FAMILY_IPV4" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Same as DNS.ResolveSuccess, but limited to pure IPv4 lookups. </summary> </histogram> <histogram name="DNS.ResolveSuccess_FAMILY_IPV6" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Same as DNS.ResolveSuccess, but limited to pure IPv6 lookups. </summary> </histogram> <histogram name="DNS.ResolveSuccess_FAMILY_UNSPEC" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Same as DNS.ResolveSuccess, but limited to IPv4/IPv6 lookups. </summary> </histogram> <histogram name="DNS.ResolveUnspecWaste" enum="ResolutionUnspecWasteCategory"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <obsolete> Deprecated as of 5/2013. </obsolete> @@ -8978,7 +8994,7 @@ </histogram> <histogram name="DNS.TotalTime" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Duration of time since a HostResolverImpl::Resolve request to the time a result is posted. Excludes canceled, evicted, and aborted requests. Includes @@ -8987,7 +9003,7 @@ </histogram> <histogram name="DNS.TotalTime_speculative" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Duration of time since a HostResolverImpl::Resolve request to the time a result is posted. Excludes canceled, evicted, and aborted requests. Includes @@ -8996,7 +9012,7 @@ </histogram> <histogram name="DNS.UnexpectedResolution"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <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 @@ -9014,7 +9030,7 @@ </histogram> <histogram name="DNS.UnexpectedResolutionL"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> 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 @@ -9033,12 +9049,12 @@ </histogram> <histogram name="DnsProbe.ErrorPageUpdateStatus" enum="DnsProbe.ProbeStatus"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary>Status of DNS probe updates sent to a DNS error page.</summary> </histogram> <histogram name="DnsProbe.Probe.Elapsed" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <obsolete> Renamed 7/2013 to DnsProbe.ProbeDuration. </obsolete> @@ -9046,7 +9062,7 @@ </histogram> <histogram name="DnsProbe.Probe.NcnOffline.Elapsed" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <obsolete> Removed 7/2013. </obsolete> @@ -9057,7 +9073,7 @@ <histogram name="DnsProbe.Probe.NcnOffline.Result" enum="DnsProbe.ObsoleteProbeResult"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <obsolete> Removed 7/2013. </obsolete> @@ -9067,7 +9083,7 @@ </histogram> <histogram name="DnsProbe.Probe.NcnOnline.Elapsed" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <obsolete> Removed 7/2013. </obsolete> @@ -9078,7 +9094,7 @@ <histogram name="DnsProbe.Probe.NcnOnline.Result" enum="DnsProbe.ObsoleteProbeResult"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <obsolete> Removed 7/2013. </obsolete> @@ -9088,7 +9104,7 @@ </histogram> <histogram name="DnsProbe.Probe.Result" enum="DnsProbe.ObsoleteProbeResult"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <obsolete> Renamed 7/2013 to DnsProbe.ProbeResult. (Also switched to the full DnsProbe.ProbeStatus enum.) @@ -9097,7 +9113,7 @@ </histogram> <histogram name="DnsProbe.Probe.ResultBadConfig.Elapsed" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <obsolete> Removed 7/2013. </obsolete> @@ -9106,7 +9122,7 @@ <histogram name="DnsProbe.Probe.ResultBadConfig.SystemIsLocalhost" enum="DnsProbe.SystemIsLocalhost"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <obsolete> Removed 7/2013. </obsolete> @@ -9118,7 +9134,7 @@ <histogram name="DnsProbe.Probe.ResultBadConfig.SystemJobResult" enum="DnsProbe.JobResult"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <obsolete> Removed 7/2013. </obsolete> @@ -9129,7 +9145,7 @@ </histogram> <histogram name="DnsProbe.Probe.ResultBadConfig.SystemNameserverCount"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <obsolete> Removed 7/2013. </obsolete> @@ -9140,7 +9156,7 @@ </histogram> <histogram name="DnsProbe.Probe.ResultNoInternet.Elapsed" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <obsolete> Removed 7/2013. </obsolete> @@ -9148,7 +9164,7 @@ </histogram> <histogram name="DnsProbe.Probe.ResultNxdomain.Elapsed" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <obsolete> Removed 7/2013. </obsolete> @@ -9156,7 +9172,7 @@ </histogram> <histogram name="DnsProbe.Probe.ResultUnknown.Elapsed" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <obsolete> Removed 7/2013. </obsolete> @@ -9164,12 +9180,12 @@ </histogram> <histogram name="DnsProbe.ProbeDuration" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary>Time between starting and finishing DNS probe.</summary> </histogram> <histogram name="DnsProbe.ProbeResult" enum="DnsProbe.ProbeStatus"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary>Result of DNS probes sent by the probe service.</summary> </histogram> @@ -9279,7 +9295,7 @@ </histogram> <histogram name="DomainReliability.BeaconReported" enum="BooleanReported"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Whether a beacon added to a Domain Reliability context was saved to be uploaded to the collector. @@ -9287,7 +9303,7 @@ </histogram> <histogram name="DomainReliability.OnBeaconDidEvict" enum="BooleanDidEvict"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Whether adding a beacon to a Domain Reliability context caused it to evict an older beacon to stay within memory limits. @@ -9295,7 +9311,7 @@ </histogram> <histogram name="DomainReliability.ReportedBeaconError" enum="NetErrorCodes"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> The Chrome error code included in a beacon saved to be uploaded to the collector. @@ -9304,7 +9320,7 @@ <histogram name="DomainReliability.ReportedBeaconError_HasServerIP" enum="NetErrorCodes"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> The Chrome error code included in a beacon with a non-empty server_ip field saved to be uploaded to the collector. @@ -9312,7 +9328,7 @@ </histogram> <histogram name="DomainReliability.UploadCollectorIndex"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> The index of the collector that a Domain Reliability upload was sent to. (Later collectors are only used when earlier collectors have failed.) @@ -9320,7 +9336,7 @@ </histogram> <histogram name="DomainReliability.UploadCollectorRetryDelay" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> After an upload to a collector finishes (successfully or not), the delay before the scheduler can send another upload to that collector. (If recent @@ -9330,7 +9346,7 @@ </histogram> <histogram name="DomainReliability.UploadDuration" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> The elapsed time between starting and finishing a Domain Reliability upload. </summary> @@ -9338,7 +9354,7 @@ <histogram name="DomainReliability.UploadFailover" enum="DomainReliability.BooleanFailover"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <obsolete> Deprecated 11/2014; see UploadCollectorIndex </obsolete> @@ -9350,7 +9366,7 @@ </histogram> <histogram name="DomainReliability.UploadInterval" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> The time between successive Domain Reliability uploads being started in the same context. (Can be arbitrarily long if no beacons are reported in a @@ -9359,7 +9375,7 @@ </histogram> <histogram name="DomainReliability.UploadLatency" units="ms"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> The time from the first beacon in a Domain Reliability upload being recorded and that upload completing successfully. (Note that if some beacons are @@ -9369,7 +9385,7 @@ </histogram> <histogram name="DomainReliability.UploadNetError" enum="NetErrorCodes"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> The network error code (or OK if none) returned by the URLFetcher when a Domain Reliability report is uploaded. @@ -9377,7 +9393,7 @@ </histogram> <histogram name="DomainReliability.UploadResponseCode" enum="HttpResponseCode"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> The HTTP response code returned by the Domain Reliability collector when a report is uploaded. @@ -9385,7 +9401,7 @@ </histogram> <histogram name="DomainReliability.UploadSuccess" enum="BooleanSuccess"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary>Whether a Domain Reliability upload succeeded.</summary> </histogram> @@ -26176,28 +26192,28 @@ </histogram> <histogram name="Net.HttpAuthCacheAddEvicted" enum="BooleanDidEvict"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Whether adding an entry to the HTTP auth cache evicted another entry. </summary> </histogram> <histogram name="Net.HttpAuthCacheAddEvictedCreation"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> When an HTTP auth cache entry is evicted, the time since it was created. </summary> </histogram> <histogram name="Net.HttpAuthCacheAddEvictedLastUse"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> When an HTTP auth cache entry is evicted, the time since it was last used. </summary> </histogram> <histogram name="Net.HttpAuthCacheAddPathEvicted" enum="BooleanDidEvict"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Whether adding a path to an entry in the HTTP auth cache evicted another path. @@ -26205,7 +26221,7 @@ </histogram> <histogram name="Net.HttpAuthCacheLookupByPathPosition"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> When looking up an HTTP auth cache entry by path, the position (1-indexed) of the entry on a hit, or 0 on a miss. @@ -26213,7 +26229,7 @@ </histogram> <histogram name="Net.HttpAuthCacheLookupPosition"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> When looking up an HTTP auth cache entry by realm, the position (1-indexed) of the entry on a hit, or 0 on a miss. @@ -28481,7 +28497,7 @@ </histogram> <histogram name="Net.ResponseSizeByProcess.Browser" units="KB"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Count of (post-SSL/proxy, pre-filter) kilobytes received per request made by the browser process. @@ -28489,7 +28505,7 @@ </histogram> <histogram name="Net.ResponseSizeByProcess.Renderer" units="KB"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Count of (post-SSL/proxy, pre-filter) kilobytes received per request made by a renderer process. @@ -28497,7 +28513,7 @@ </histogram> <histogram name="Net.ResponseSizeByProcess.Unknown" units="KB"> - <owner>ttuttle@chromium.org</owner> + <owner>juliatuttle@chromium.org</owner> <summary> Count of (post-SSL/proxy, pre-filter) kilobytes received per request made by a process not covered by one of the other ResponseSizeByProcess histograms. @@ -47132,6 +47148,15 @@ </summary> </histogram> +<histogram name="ServiceWorker.ExtendableMessageEvent.Time" units="ms"> + <owner>nhiroki@chromium.org</owner> + <summary> + The time taken between dispatching an ExtendableMessageEvent to a Service + Worker and receiving a message that it finished handling the event. Includes + the time for the waitUntil() promise to settle. + </summary> +</histogram> + <histogram name="ServiceWorker.FetchEvent.Fallback.Time" units="ms"> <owner>jeremyarcher@chromium.org</owner> <summary> @@ -47238,6 +47263,9 @@ <histogram name="ServiceWorker.MessageEvent.Time" units="ms"> <owner>shimazu@chromium.org</owner> + <obsolete> + Deprecated 2016-04 in favor of ServiceWorker.ExtendableMessageEvent.Time. + </obsolete> <summary>Execution time of ServiceWorkerGlobalScope.onmessage.</summary> </histogram> @@ -67132,6 +67160,7 @@ <int value="324" label="Suppress the unsupported OS warning"/> <int value="325" label="Enable queries to Quirks Server"/> <int value="326" label="Configure the automatic timezone detection method"/> + <int value="327" label="Enable ending processes in Task Manager"/> </enum> <enum name="EnterprisePolicyInvalidations" type="int"> @@ -70988,6 +71017,10 @@ <int value="1303" label="V8Document_Anchors_AttributeGetter"/> <int value="1304" label="V8Document_Applets_AttributeGetter"/> <int value="1305" label="XMLHttpRequestCrossOriginWithCredentials"/> + <int value="1306" label="MediaStreamTrackRemote"/> + <int value="1307" label="V8Node_IsConnected_AttributeGetter"/> + <int value="1308" label="ShadowRootDelegatesFocus"/> + <int value="1309" label="MixedShadowRootV0AndV1"/> </enum> <enum name="FetchRequestMode" type="int"> @@ -81702,7 +81735,10 @@ <int value="82" label="CONNECTION_MIGRATION_TOO_MANY_CHANGES"/> <int value="83" label="CONNECTION_MIGRATION_NO_NEW_NETWORK"/> <int value="84" label="CONNECTION_MIGRATION_NON_MIGRATABLE_STREAM"/> - <int value="85" label="CONNECTION_MIGRATION_DISABLED"/> + <int value="85" label="QUIC_TOO_MANY_RTOS"/> + <int value="86" label="QUIC_ERROR_MIGRATING_PORT"/> + <int value="87" label="QUIC_OVERLAPPING_STREAM_DATA"/> + <int value="88" label="QUIC_ATTEMPT_TO_SEND_UNENCRYPTED_STREAM_DATA"/> </enum> <enum name="QuicHandshakeFailureReason" type="int"> @@ -84028,6 +84064,7 @@ <!-- More SpdyFramer::SpdyErrors --> <int value="37" label="Invalid control frame size."/> + <int value="38" label="Invalid stream ID."/> </enum> <enum name="SpdyProtocolVersion" type="int"> @@ -88384,6 +88421,18 @@ <affected-histogram name="PLT.PT_StartToFinish"/> </histogram_suffixes> +<histogram_suffixes + name="DataReductionProxy.LoFi.Accuracy.DifferentRecordingIntervals" + separator="."> + <suffix name="15" + label="Recorded approximately 15 seconds after navigation start"/> + <suffix name="30" + label="Recorded approximately 30 seconds after navigation start"/> + <suffix name="60" + label="Recorded approximately 60 seconds after navigation start"/> + <affected-histogram name="DataReductionProxy.LoFi.Accuracy"/> +</histogram_suffixes> + <histogram_suffixes name="DataReductionProxy.MimeType"> <suffix name="Application" label="Application mime-type"/> <suffix name="Unknown" @@ -88414,7 +88463,13 @@ <suffix name="None" label="With no detected network"/> <suffix name="Bluetooth" label="On Bluetooth network"/> <affected-histogram name="DataReductionProxy.AutoLoFiAccuracy"/> + <obsolete> + Replaced by DataReductionProxy.LoFi.Accuracy. + </obsolete> <affected-histogram name="DataReductionProxy.AutoLoFiRequestHeaderState"/> + <affected-histogram name="DataReductionProxy.LoFi.Accuracy.15"/> + <affected-histogram name="DataReductionProxy.LoFi.Accuracy.30"/> + <affected-histogram name="DataReductionProxy.LoFi.Accuracy.60"/> <affected-histogram name="DataReductionProxy.LoFi.ImplicitOptOutAction"/> </histogram_suffixes> @@ -91386,6 +91441,13 @@ ordering="prefix"> <suffix name="Clients.FromGWS" label="PageLoadMetrics that are a result of a navigation from a Google + web search"> + <obsolete> + Deprecated in favor of Clients.FromGWS2. + </obsolete> + </suffix> + <suffix name="Clients.FromGWS2" + label="PageLoadMetrics that are a result of a navigation from a Google web search"/> <suffix name="Clients.DocWrite.Evaluator" label="PageLoadMetrics from a page that could have been evaluated by @@ -93233,6 +93295,14 @@ label="Video codec: VP8. QP range: 0-127. Spatial index 1."/> <suffix name="Vp8.S2" label="Video codec: VP8. QP range: 0-127. Spatial index 2."/> + <suffix name="Vp9" + label="Video codec: VP9. QP range: 0-255. No spatial layers."/> + <suffix name="Vp9.S0" + label="Video codec: VP9. QP range: 0-255. Spatial layer 0."/> + <suffix name="Vp9.S1" + label="Video codec: VP9. QP range: 0-255. Spatial layer 1."/> + <suffix name="Vp9.S2" + label="Video codec: VP9. QP range: 0-255. Spatial layer 2."/> <affected-histogram name="WebRTC.Video.Encoded.Qp"/> </histogram_suffixes>
diff --git a/tools/perf/measurements/memory_multi_tab.py b/tools/perf/measurements/memory_multi_tab.py deleted file mode 100644 index de307a8..0000000 --- a/tools/perf/measurements/memory_multi_tab.py +++ /dev/null
@@ -1,46 +0,0 @@ -# Copyright 2013 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. - -"""Multi tab memory test. - -This test is a multi tab test, but we're interested in measurements for -the entire test rather than each single page. -""" - -from telemetry.page import page_test - -from metrics import memory - - -class MemoryMultiTab(page_test.PageTest): - - def __init__(self): - super(MemoryMultiTab, self).__init__() - self._memory_metric = None - # _first_tab is used to make memory measurements - self._first_tab = None - - def DidStartBrowser(self, browser): - self._memory_metric = memory.MemoryMetric(browser) - - def CustomizeBrowserOptions(self, options): - memory.MemoryMetric.CustomizeBrowserOptions(options) - # Since this is a memory benchmark, we want to sample memory histograms at - # a high frequency. - options.AppendExtraBrowserArgs('--memory-metrics') - - def TabForPage(self, page, browser): - return browser.tabs.New() - - def DidNavigateToPage(self, page, tab): - # Start measurement on the first tab. - if not self._first_tab: - self._memory_metric.Start(page, tab) - self._first_tab = tab - - def ValidateAndMeasurePage(self, page, tab, results): - # Finalize measurement on the last tab. - if len(tab.browser.tabs) == len(page.story_set.stories): - self._memory_metric.Stop(page, self._first_tab) - self._memory_metric.AddResults(self._first_tab, results)
diff --git a/tools/perf/page_sets/tough_memory_multi_tab.py b/tools/perf/page_sets/tough_memory_multi_tab.py deleted file mode 100644 index bffaa096..0000000 --- a/tools/perf/page_sets/tough_memory_multi_tab.py +++ /dev/null
@@ -1,33 +0,0 @@ -# Copyright 2014 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. -from telemetry.page import page as page_module -from telemetry.page import shared_page_state -from telemetry import story - - -class ToughMemoryMultiTabPage(page_module.Page): - - def __init__(self, url, page_set): - super(ToughMemoryMultiTabPage, self).__init__( - url=url, page_set=page_set, credentials_path = 'data/credentials.json', - shared_page_state_class=shared_page_state.SharedMobilePageState) - self.archive_data_file = 'data/key_mobile_sites.json' - - -class ToughMemoryMultiTabPageSet(story.StorySet): - - """ Mobile sites for exercising multi-tab memory issues """ - - def __init__(self): - super(ToughMemoryMultiTabPageSet, self).__init__( - archive_data_file='data/key_mobile_sites.json') - - urls_list = [ - 'https://www.google.co.uk/search?hl=en&q=barack+obama&cad=h', - 'http://theverge.com', - 'http://techcrunch.com' - ] - - for url in urls_list: - self.AddStory(ToughMemoryMultiTabPage(url, self))
diff --git a/tools/valgrind/gtest_exclude/net_unittests.gtest-drmemory_win32.txt b/tools/valgrind/gtest_exclude/net_unittests.gtest-drmemory_win32.txt index c865baf0..5fb8578a 100644 --- a/tools/valgrind/gtest_exclude/net_unittests.gtest-drmemory_win32.txt +++ b/tools/valgrind/gtest_exclude/net_unittests.gtest-drmemory_win32.txt
@@ -34,3 +34,6 @@ # https://crbug.com/598953 *QuicConnectionTest.TooManyReceivedPackets* + +# https://crbug.com/604611 +BidirectionalStreamTest.*
diff --git a/tools/valgrind/memcheck/suppressions.txt b/tools/valgrind/memcheck/suppressions.txt index 2996ceb9..f5df2d9 100644 --- a/tools/valgrind/memcheck/suppressions.txt +++ b/tools/valgrind/memcheck/suppressions.txt
@@ -576,6 +576,12 @@ fun:_ZN4base12_GLOBAL__N_114WorkerPoolImpl8PostTaskERKN15tracked_objects8LocationERKNS_8CallbackIF* fun:_ZN4base10WorkerPool8PostTaskERKN15tracked_objects8LocationERKNS_8CallbackIF* } +{ + bug_341477 + Memcheck:Leak + fun:_Znw* + fun:_ZN7options22PasswordManagerHandler20HandlePassword* +} #-----------------------------------------------------------------------
diff --git a/ui/app_list/views/app_list_view.cc b/ui/app_list/views/app_list_view.cc index d622401..87e4298 100644 --- a/ui/app_list/views/app_list_view.cc +++ b/ui/app_list/views/app_list_view.cc
@@ -262,10 +262,10 @@ params.delegate = this; widget->Init(params); widget->SetBounds(bounds); - // This needs to be set *after* Widget::Init() because BubbleDelegateView sets - // its own background at OnNativeThemeChanged(), which is called in - // View::AddChildView() which is called at Widget::SetContentsView() to build - // the views hierarchy in the widget. + // This needs to be set *after* Widget::Init() because + // BubbleDialogDelegateView sets its own background at OnNativeThemeChanged(), + // which is called in View::AddChildView() which is called at + // Widget::SetContentsView() to build the views hierarchy in the widget. set_background(new AppListBackground(0)); InitChildWidgets(); @@ -290,7 +290,7 @@ app_list_main_view_->ShowAppListWhenReady(); } -void AppListView::Close() { +void AppListView::CloseAppList() { app_list_main_view_->Close(); delegate_->Dismiss(); } @@ -347,7 +347,7 @@ } void AppListView::OnPaint(gfx::Canvas* canvas) { - views::BubbleDelegateView::OnPaint(canvas); + views::BubbleDialogDelegateView::OnPaint(canvas); if (!next_paint_callback_.is_null()) { next_paint_callback_.Run(); next_paint_callback_.Reset(); @@ -376,8 +376,8 @@ ->GetCollapsedLauncherPageBounds() .Contains(location); - return views::BubbleDelegateView::ShouldDescendIntoChildForEventHandling( - child, location); + return views::BubbleDialogDelegateView:: + ShouldDescendIntoChildForEventHandling(child, location); } void AppListView::Prerender() { @@ -518,11 +518,11 @@ InitContents(parent, initial_apps_page); + AddAccelerator(ui::Accelerator(ui::VKEY_ESCAPE, ui::EF_NONE)); set_color(kContentsBackgroundColor); set_margins(gfx::Insets()); set_parent_window(parent); set_close_on_deactivate(false); - set_close_on_esc(false); set_anchor_view_insets(gfx::Insets(kArrowOffset + anchor_offset.y(), kArrowOffset + anchor_offset.x(), kArrowOffset - anchor_offset.y(), @@ -535,11 +535,11 @@ // TODO(tapted): Remove ScopedTracker below once crbug.com/431326 is fixed. tracked_objects::ScopedTracker tracking_profile( FROM_HERE_WITH_EXPLICIT_FUNCTION( - "431326 views::BubbleDelegateView::CreateBubble()")); + "431326 views::BubbleDialogDelegateView::CreateBubble()")); // This creates the app list widget. (Before this, child widgets cannot be // created.) - views::BubbleDelegateView::CreateBubble(this); + views::BubbleDialogDelegateView::CreateBubble(this); } SetBubbleArrow(arrow); @@ -616,6 +616,10 @@ #endif } +int AppListView::GetDialogButtons() const { + return ui::DIALOG_BUTTON_NONE; +} + views::View* AppListView::GetInitiallyFocusedView() { return app_list_main_view_->search_box_view()->search_box(); } @@ -633,36 +637,29 @@ } bool AppListView::AcceleratorPressed(const ui::Accelerator& accelerator) { - // The accelerator is added by BubbleDelegateView. - if (accelerator.key_code() == ui::VKEY_ESCAPE) { - if (switches::IsExperimentalAppListEnabled()) { - // If the ContentsView does not handle the back action, then this is the - // top level, so we close the app list. - if (!app_list_main_view_->contents_view()->Back()) { - GetWidget()->Deactivate(); - Close(); - } - return true; - } - - if (app_list_main_view_->search_box_view()->HasSearch()) { - app_list_main_view_->search_box_view()->ClearSearch(); - } else if (app_list_main_view_->contents_view() - ->apps_container_view() - ->IsInFolderView()) { - app_list_main_view_->contents_view() - ->apps_container_view() - ->app_list_folder_view() - ->CloseFolderPage(); - return true; - } else { + DCHECK_EQ(ui::VKEY_ESCAPE, accelerator.key_code()); + if (switches::IsExperimentalAppListEnabled()) { + // If the ContentsView does not handle the back action, then this is the + // top level, so we close the app list. + if (!app_list_main_view_->contents_view()->Back()) { GetWidget()->Deactivate(); - Close(); + CloseAppList(); } - return true; + } else if (app_list_main_view_->search_box_view()->HasSearch()) { + app_list_main_view_->search_box_view()->ClearSearch(); + } else if (app_list_main_view_->contents_view() + ->apps_container_view() + ->IsInFolderView()) { + app_list_main_view_->contents_view() + ->apps_container_view() + ->app_list_folder_view() + ->CloseFolderPage(); + } else { + GetWidget()->Deactivate(); + CloseAppList(); } - - return false; + // Don't let DialogClientView handle the accelerator. + return true; } void AppListView::Layout() { @@ -689,13 +686,13 @@ } void AppListView::SchedulePaintInRect(const gfx::Rect& rect) { - BubbleDelegateView::SchedulePaintInRect(rect); + BubbleDialogDelegateView::SchedulePaintInRect(rect); if (GetBubbleFrameView()) GetBubbleFrameView()->SchedulePaint(); } void AppListView::OnWidgetDestroying(views::Widget* widget) { - BubbleDelegateView::OnWidgetDestroying(widget); + BubbleDialogDelegateView::OnWidgetDestroying(widget); if (delegate_ && widget == GetWidget()) delegate_->ViewClosing(); } @@ -711,7 +708,7 @@ void AppListView::OnWidgetVisibilityChanged(views::Widget* widget, bool visible) { - BubbleDelegateView::OnWidgetVisibilityChanged(widget, visible); + BubbleDialogDelegateView::OnWidgetVisibilityChanged(widget, visible); if (widget != GetWidget()) return;
diff --git a/ui/app_list/views/app_list_view.h b/ui/app_list/views/app_list_view.h index 6aea578d..1499ce1e 100644 --- a/ui/app_list/views/app_list_view.h +++ b/ui/app_list/views/app_list_view.h
@@ -14,7 +14,7 @@ #include "ui/app_list/app_list_export.h" #include "ui/app_list/app_list_view_delegate_observer.h" #include "ui/app_list/speech_ui_model_observer.h" -#include "ui/views/bubble/bubble_delegate.h" +#include "ui/views/bubble/bubble_dialog_delegate.h" #include "ui/views/widget/widget.h" namespace base { @@ -42,7 +42,7 @@ // AppListView is the top-level view and controller of app list UI. It creates // and hosts a AppsGridView and passes AppListModel to it for display. -class APP_LIST_EXPORT AppListView : public views::BubbleDelegateView, +class APP_LIST_EXPORT AppListView : public views::BubbleDialogDelegateView, public AppListViewDelegateObserver, public SpeechUIModelObserver { public: @@ -87,7 +87,7 @@ // timer to show the UI when a maximum allowed wait time has expired. void ShowWhenReady(); - void Close(); + void CloseAppList(); void UpdateBounds(); @@ -152,9 +152,10 @@ bool border_accepts_events, const gfx::Vector2d& anchor_offset); - // Overridden from views::BubbleDelegateView: + // Overridden from views::BubbleDialogDelegateView: void OnBeforeBubbleWidgetInit(views::Widget::InitParams* params, views::Widget* widget) const override; + int GetDialogButtons() const override; // Overridden from views::WidgetDelegateView: views::View* GetInitiallyFocusedView() override;
diff --git a/ui/aura/BUILD.gn b/ui/aura/BUILD.gn index b1b3228..4162a15 100644 --- a/ui/aura/BUILD.gn +++ b/ui/aura/BUILD.gn
@@ -236,6 +236,7 @@ "//ui/base", "//ui/compositor", "//ui/compositor:test_support", + "//ui/display", "//ui/events", "//ui/gfx", "//ui/gfx/geometry",
diff --git a/ui/aura/aura.gyp b/ui/aura/aura.gyp index 3020e2d..2e6ff1a 100644 --- a/ui/aura/aura.gyp +++ b/ui/aura/aura.gyp
@@ -213,6 +213,7 @@ '../base/ui_base.gyp:ui_base', '../compositor/compositor.gyp:compositor', '../compositor/compositor.gyp:compositor_test_support', + '../display/display.gyp:display', '../events/events.gyp:events', '../gfx/gfx.gyp:gfx', '../gfx/gfx.gyp:gfx_geometry',
diff --git a/ui/aura/demo/DEPS b/ui/aura/demo/DEPS index 07d8243..04a064d 100644 --- a/ui/aura/demo/DEPS +++ b/ui/aura/demo/DEPS
@@ -1,3 +1,4 @@ include_rules = [ + "+ui/display", # Windows DPI Initialization. "+ui/gl/gl_surface.h", # To initialize GL bindings. ]
diff --git a/ui/aura/demo/demo_main.cc b/ui/aura/demo/demo_main.cc index 13ead0e..649bfb6 100644 --- a/ui/aura/demo/demo_main.cc +++ b/ui/aura/demo/demo_main.cc
@@ -36,7 +36,7 @@ #endif #if defined(OS_WIN) -#include "ui/gfx/win/dpi.h" +#include "ui/display/win/dpi.h" #endif namespace { @@ -133,7 +133,7 @@ gfx::GLSurface::InitializeOneOff(); #if defined(OS_WIN) - gfx::SetDefaultDeviceScaleFactor(1.0f); + display::win::SetDefaultDeviceScaleFactor(1.0f); #endif // The ContextFactory must exist before any Compositors are created.
diff --git a/ui/base/BUILD.gn b/ui/base/BUILD.gn index d229003..6390bd4e 100644 --- a/ui/base/BUILD.gn +++ b/ui/base/BUILD.gn
@@ -371,6 +371,7 @@ "//net", "//third_party/icu", "//ui/base:ui_data_pack", + "//ui/display", "//ui/events", "//ui/events/devices", "//ui/resources", @@ -826,6 +827,7 @@ "//ui/base", "//ui/base:test_support", "//ui/base:ui_data_pack", + "//ui/display", "//ui/events:events_base", "//ui/events:test_support", "//ui/gfx:test_support", @@ -871,7 +873,7 @@ "//chrome:resources", "//ui/android:ui_java", ] - isolate_file = "ui_base_unittests.isolate" + isolate_file = "ui_base_tests.isolate" } if (use_pango) {
diff --git a/ui/base/l10n/l10n_util_win.cc b/ui/base/l10n/l10n_util_win.cc index d86e02f..1e1da3b 100644 --- a/ui/base/l10n/l10n_util_win.cc +++ b/ui/base/l10n/l10n_util_win.cc
@@ -17,8 +17,8 @@ #include "base/win/i18n.h" #include "base/win/windows_version.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/display/win/dpi.h" #include "ui/gfx/display.h" -#include "ui/gfx/win/dpi.h" #include "ui/strings/grit/app_locale_settings.h" namespace { @@ -155,7 +155,7 @@ } void AdjustUIFont(LOGFONT* logfont) { - float dpi_scale = gfx::GetDPIScale(); + float dpi_scale = display::win::GetDPIScale(); if (gfx::Display::HasForceDeviceScaleFactor()) { // If the scale is forced, we don't need to adjust it here. dpi_scale = 1.0f;
diff --git a/ui/base/l10n/l10n_util_win_unittest.cc b/ui/base/l10n/l10n_util_win_unittest.cc index 8ebe1e52..2f1da59 100644 --- a/ui/base/l10n/l10n_util_win_unittest.cc +++ b/ui/base/l10n/l10n_util_win_unittest.cc
@@ -9,7 +9,6 @@ #include "base/win/win_util.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/platform_test.h" -#include "ui/gfx/win/dpi.h" typedef PlatformTest L10nUtilWinTest; @@ -34,4 +33,4 @@ lf.lfHeight = static_cast<int>(1.8 * size + rounding); l10n_util::AdjustUIFontForDIP(1.8f, &lf); EXPECT_NEAR(size, lf.lfHeight, 1); -} \ No newline at end of file +}
diff --git a/ui/base/resource/resource_bundle.cc b/ui/base/resource/resource_bundle.cc index 5a51430..54ff7ead 100644 --- a/ui/base/resource/resource_bundle.cc +++ b/ui/base/resource/resource_bundle.cc
@@ -52,7 +52,7 @@ #endif #if defined(OS_WIN) -#include "ui/gfx/win/dpi.h" +#include "ui/display/win/dpi.h" #endif #if defined(OS_MACOSX) && !defined(OS_IOS) @@ -392,7 +392,9 @@ ui::ScaleFactor scale_factor_to_load = GetMaxScaleFactor(); #elif defined(OS_WIN) ui::ScaleFactor scale_factor_to_load = - gfx::GetDPIScale() > 1.25 ? GetMaxScaleFactor() : ui::SCALE_FACTOR_100P; + display::win::GetDPIScale() > 1.25 + ? GetMaxScaleFactor() + : ui::SCALE_FACTOR_100P; #else ui::ScaleFactor scale_factor_to_load = ui::SCALE_FACTOR_100P; #endif
diff --git a/ui/base/resource/resource_bundle_unittest.cc b/ui/base/resource/resource_bundle_unittest.cc index cee14d3..8abb5525 100644 --- a/ui/base/resource/resource_bundle_unittest.cc +++ b/ui/base/resource/resource_bundle_unittest.cc
@@ -29,7 +29,7 @@ #include "ui/strings/grit/app_locale_settings.h" #if defined(OS_WIN) -#include "ui/gfx/win/dpi.h" +#include "ui/display/win/dpi.h" #endif using ::testing::_; @@ -461,7 +461,7 @@ // via ResourceBundle::GetImageNamed(). TEST_F(ResourceBundleImageTest, GetImageNamed) { #if defined(OS_WIN) - gfx::SetDefaultDeviceScaleFactor(2.0); + display::win::SetDefaultDeviceScaleFactor(2.0); #endif std::vector<ScaleFactor> supported_factors; supported_factors.push_back(SCALE_FACTOR_100P);
diff --git a/ui/base/resource/resource_bundle_win.cc b/ui/base/resource/resource_bundle_win.cc index 4546b66..f962e057 100644 --- a/ui/base/resource/resource_bundle_win.cc +++ b/ui/base/resource/resource_bundle_win.cc
@@ -14,7 +14,6 @@ #include "ui/gfx/geometry/size_conversions.h" #include "ui/gfx/image/image_skia.h" #include "ui/gfx/image/image_skia_source.h" -#include "ui/gfx/win/dpi.h" namespace ui {
diff --git a/ui/base/test/run_all_unittests.cc b/ui/base/test/run_all_unittests.cc index 26ebad4..d778f41 100644 --- a/ui/base/test/run_all_unittests.cc +++ b/ui/base/test/run_all_unittests.cc
@@ -24,7 +24,7 @@ #endif #if defined(OS_WIN) -#include "ui/gfx/win/dpi.h" +#include "ui/display/win/dpi.h" #endif namespace { @@ -49,7 +49,7 @@ base::TestSuite::Initialize(); #if defined(OS_WIN) - gfx::SetDefaultDeviceScaleFactor(1.0); + display::win::SetDefaultDeviceScaleFactor(1.0); #endif #if defined(OS_ANDROID)
diff --git a/ui/base/ui_base.gyp b/ui/base/ui_base.gyp index 1eda3ca1..c8c369d 100644 --- a/ui/base/ui_base.gyp +++ b/ui/base/ui_base.gyp
@@ -67,6 +67,7 @@ '../../third_party/icu/icu.gyp:icui18n', '../../third_party/icu/icu.gyp:icuuc', '../../url/url.gyp:url_lib', + '../display/display.gyp:display', '../events/events.gyp:events', '../events/events.gyp:events_base', '../events/platform/events_platform.gyp:events_platform',
diff --git a/ui/base/ui_base_tests.gyp b/ui/base/ui_base_tests.gyp index bf2027a..6746323f 100644 --- a/ui/base/ui_base_tests.gyp +++ b/ui/base/ui_base_tests.gyp
@@ -21,6 +21,7 @@ '../../third_party/icu/icu.gyp:icui18n', '../../third_party/icu/icu.gyp:icuuc', '../../url/url.gyp:url_lib', + '../display/display.gyp:display', '../events/events.gyp:events_base', '../gfx/gfx.gyp:gfx_test_support', '../resources/ui_resources.gyp:ui_resources',
diff --git a/ui/base/win/hwnd_subclass.cc b/ui/base/win/hwnd_subclass.cc index 7cc235a..705a0f1 100644 --- a/ui/base/win/hwnd_subclass.cc +++ b/ui/base/win/hwnd_subclass.cc
@@ -11,7 +11,6 @@ #include "base/memory/scoped_vector.h" #include "base/memory/singleton.h" #include "base/stl_util.h" -#include "ui/gfx/win/dpi.h" #include "ui/gfx/win/hwnd_util.h" namespace {
diff --git a/ui/chromeos/ime/candidate_window_view.cc b/ui/chromeos/ime/candidate_window_view.cc index 1bbdb55..00f7982 100644 --- a/ui/chromeos/ime/candidate_window_view.cc +++ b/ui/chromeos/ime/candidate_window_view.cc
@@ -191,7 +191,7 @@ } views::Widget* CandidateWindowView::InitWidget() { - views::Widget* widget = BubbleDelegateView::CreateBubble(this); + views::Widget* widget = BubbleDialogDelegateView::CreateBubble(this); wm::SetWindowVisibilityAnimationType( widget->GetNativeView(), @@ -399,6 +399,10 @@ return "CandidateWindowView"; } +int CandidateWindowView::GetDialogButtons() const { + return ui::DIALOG_BUTTON_NONE; +} + void CandidateWindowView::ButtonPressed(views::Button* sender, const ui::Event& event) { for (size_t i = 0; i < candidate_views_.size(); ++i) {
diff --git a/ui/chromeos/ime/candidate_window_view.h b/ui/chromeos/ime/candidate_window_view.h index a7ec7ec..5260518 100644 --- a/ui/chromeos/ime/candidate_window_view.h +++ b/ui/chromeos/ime/candidate_window_view.h
@@ -8,7 +8,7 @@ #include "base/macros.h" #include "ui/base/ime/candidate_window.h" #include "ui/chromeos/ui_chromeos_export.h" -#include "ui/views/bubble/bubble_delegate.h" +#include "ui/views/bubble/bubble_dialog_delegate.h" #include "ui/views/controls/button/button.h" namespace ui { @@ -18,8 +18,9 @@ class InformationTextArea; // CandidateWindowView is the main container of the candidate window UI. -class UI_CHROMEOS_EXPORT CandidateWindowView : public views::BubbleDelegateView, - public views::ButtonListener { +class UI_CHROMEOS_EXPORT CandidateWindowView + : public views::BubbleDialogDelegateView, + public views::ButtonListener { public: // The object can be monitored by the observer. class Observer { @@ -74,8 +75,9 @@ private: friend class CandidateWindowViewTest; - // views::BubbleDelegateView: + // views::BubbleDialogDelegateView: const char* GetClassName() const override; + int GetDialogButtons() const override; // Overridden from views::ButtonListener: void ButtonPressed(views::Button* sender, const ui::Event& event) override;
diff --git a/ui/chromeos/ime/infolist_window.cc b/ui/chromeos/ime/infolist_window.cc index 1085a5ea..2dde013c 100644 --- a/ui/chromeos/ime/infolist_window.cc +++ b/ui/chromeos/ime/infolist_window.cc
@@ -171,10 +171,11 @@ InfolistWindow::InfolistWindow(views::View* candidate_window, const std::vector<ui::InfolistEntry>& entries) - : views::BubbleDelegateView(candidate_window, views::BubbleBorder::NONE), + : views::BubbleDialogDelegateView(candidate_window, + views::BubbleBorder::NONE), title_font_list_(gfx::Font(kJapaneseFontName, kFontSizeDelta + 15)), - description_font_list_(gfx::Font(kJapaneseFontName, - kFontSizeDelta + 11)) { + description_font_list_( + gfx::Font(kJapaneseFontName, kFontSizeDelta + 11)) { set_can_activate(false); set_accept_events(false); set_margins(gfx::Insets()); @@ -214,7 +215,7 @@ } void InfolistWindow::InitWidget() { - views::Widget* widget = views::BubbleDelegateView::CreateBubble(this); + views::Widget* widget = views::BubbleDialogDelegateView::CreateBubble(this); wm::SetWindowVisibilityAnimationType( widget->GetNativeView(), wm::WINDOW_VISIBILITY_ANIMATION_TYPE_FADE); @@ -279,6 +280,10 @@ return "InfolistWindow"; } +int InfolistWindow::GetDialogButtons() const { + return ui::DIALOG_BUTTON_NONE; +} + void InfolistWindow::WindowClosing() { show_hide_timer_.Stop(); }
diff --git a/ui/chromeos/ime/infolist_window.h b/ui/chromeos/ime/infolist_window.h index ef4f8ce..31ce18b 100644 --- a/ui/chromeos/ime/infolist_window.h +++ b/ui/chromeos/ime/infolist_window.h
@@ -15,7 +15,7 @@ #include "ui/base/ime/infolist_entry.h" #include "ui/chromeos/ui_chromeos_export.h" #include "ui/gfx/font_list.h" -#include "ui/views/bubble/bubble_delegate.h" +#include "ui/views/bubble/bubble_dialog_delegate.h" namespace ui { namespace ime { @@ -23,7 +23,8 @@ class InfolistEntryView; // A widget delegate representing the infolist window UI. -class UI_CHROMEOS_EXPORT InfolistWindow : public views::BubbleDelegateView { +class UI_CHROMEOS_EXPORT InfolistWindow + : public views::BubbleDialogDelegateView { public: InfolistWindow(views::View* candidate_window, const std::vector<ui::InfolistEntry>& entries); @@ -42,8 +43,9 @@ void HideImmediately(); private: - // views::BubbleDelegateView: + // views::BubbleDialogDelegateView: const char* GetClassName() const override; + int GetDialogButtons() const override; // views::WidgetDelegate implementation. void WindowClosing() override;
diff --git a/ui/chromeos/ime/mode_indicator_view.cc b/ui/chromeos/ime/mode_indicator_view.cc index 862ed08..fcae94a5 100644 --- a/ui/chromeos/ime/mode_indicator_view.cc +++ b/ui/chromeos/ime/mode_indicator_view.cc
@@ -81,6 +81,10 @@ return "ModeIndicatorView"; } +int ModeIndicatorView::GetDialogButtons() const { + return ui::DIALOG_BUTTON_NONE; +} + void ModeIndicatorView::Init() { SetLayoutManager(new views::FillLayout()); AddChildView(label_view_); @@ -91,7 +95,7 @@ views::NonClientFrameView* ModeIndicatorView::CreateNonClientFrameView( views::Widget* widget) { views::BubbleFrameView* frame = new ModeIndicatorFrameView(margins()); - // arrow adjustment in BubbleDelegateView is unnecessary because arrow + // arrow adjustment in BubbleDialogDelegateView is unnecessary because arrow // of this bubble is always center. frame->SetBubbleBorder(std::unique_ptr<views::BubbleBorder>( new views::BubbleBorder(arrow(), shadow(), color())));
diff --git a/ui/chromeos/ime/mode_indicator_view.h b/ui/chromeos/ime/mode_indicator_view.h index 24cab4d..81f4b99 100644 --- a/ui/chromeos/ime/mode_indicator_view.h +++ b/ui/chromeos/ime/mode_indicator_view.h
@@ -11,7 +11,7 @@ #include "ui/chromeos/ui_chromeos_export.h" #include "ui/gfx/geometry/rect.h" #include "ui/gfx/native_widget_types.h" -#include "ui/views/bubble/bubble_delegate.h" +#include "ui/views/bubble/bubble_dialog_delegate.h" namespace views { class Label; @@ -21,7 +21,8 @@ namespace ui { namespace ime { -class UI_CHROMEOS_EXPORT ModeIndicatorView : public views::BubbleDelegateView { +class UI_CHROMEOS_EXPORT ModeIndicatorView + : public views::BubbleDialogDelegateView { public: ModeIndicatorView(gfx::NativeView parent, const gfx::Rect& cursor_bounds, @@ -31,14 +32,13 @@ // Show the mode indicator then hide with fading animation. void ShowAndFadeOut(); - // views::BubbleDelegateView override: + // views::BubbleDialogDelegateView override: gfx::Size GetPreferredSize() const override; - - protected: - // views::BubbleDelegateView override: const char* GetClassName() const override; + int GetDialogButtons() const override; void Init() override; + protected: // views::WidgetDelegateView overrides: views::NonClientFrameView* CreateNonClientFrameView( views::Widget* widget) override;
diff --git a/ui/compositor/BUILD.gn b/ui/compositor/BUILD.gn index 69285e8..d1175ea 100644 --- a/ui/compositor/BUILD.gn +++ b/ui/compositor/BUILD.gn
@@ -111,6 +111,9 @@ "test/layer_animation_observer_test_api.h", "test/layer_animator_test_controller.cc", "test/layer_animator_test_controller.h", + "test/multi_layer_animator_test_controller.cc", + "test/multi_layer_animator_test_controller.h", + "test/multi_layer_animator_test_controller_delegate.h", "test/test_compositor_host.h", "test/test_compositor_host_android.cc", "test/test_compositor_host_mac.mm", @@ -143,6 +146,7 @@ "//skia", "//testing/gtest", "//ui/base", + "//ui/display", "//ui/gfx", "//ui/gfx/geometry", "//ui/gl:test_support",
diff --git a/ui/compositor/compositor.gyp b/ui/compositor/compositor.gyp index cfbf91c0..5a0f68c 100644 --- a/ui/compositor/compositor.gyp +++ b/ui/compositor/compositor.gyp
@@ -111,6 +111,7 @@ '<(DEPTH)/testing/gtest.gyp:gtest', '<(DEPTH)/third_party/WebKit/public/blink.gyp:blink_minimal', '<(DEPTH)/ui/base/ui_base.gyp:ui_base', + '<(DEPTH)/ui/display/display.gyp:display', '<(DEPTH)/ui/gfx/gfx.gyp:gfx', '<(DEPTH)/ui/gfx/gfx.gyp:gfx_geometry', '<(DEPTH)/ui/gl/gl.gyp:gl', @@ -129,6 +130,9 @@ 'test/layer_animation_observer_test_api.h', 'test/layer_animator_test_controller.cc', 'test/layer_animator_test_controller.h', + 'test/multi_layer_animator_test_controller.cc', + 'test/multi_layer_animator_test_controller.h', + 'test/multi_layer_animator_test_controller_delegate.h', 'test/test_compositor_host.h', 'test/test_compositor_host_android.cc', 'test/test_compositor_host_mac.mm',
diff --git a/ui/compositor/compositor.h b/ui/compositor/compositor.h index 778fbdae..d41a1d7f2 100644 --- a/ui/compositor/compositor.h +++ b/ui/compositor/compositor.h
@@ -298,11 +298,6 @@ void DidCommitAndDrawFrame() override; void DidCompleteSwapBuffers() override; void DidCompletePageScaleAnimation() override {} - void RecordFrameTimingEvents( - std::unique_ptr<cc::FrameTimingTracker::CompositeTimingSet> - composite_events, - std::unique_ptr<cc::FrameTimingTracker::MainFrameTimingSet> - main_frame_events) override {} // cc::LayerTreeHostSingleThreadClient implementation. void DidPostSwapBuffers() override;
diff --git a/ui/compositor/test/DEPS b/ui/compositor/test/DEPS index bc87fe1b..9b50213 100644 --- a/ui/compositor/test/DEPS +++ b/ui/compositor/test/DEPS
@@ -3,4 +3,5 @@ "+gpu/command_buffer/common", "+gpu/skia_bindings", "+skia/ext", + "+ui/display", ]
diff --git a/ui/compositor/test/OWNERS b/ui/compositor/test/OWNERS new file mode 100644 index 0000000..d4038c0 --- /dev/null +++ b/ui/compositor/test/OWNERS
@@ -0,0 +1,2 @@ +# Animation +per-file *animat*=ajuma@chromium.org
diff --git a/ui/compositor/test/multi_layer_animator_test_controller.cc b/ui/compositor/test/multi_layer_animator_test_controller.cc new file mode 100644 index 0000000..a7a6669 --- /dev/null +++ b/ui/compositor/test/multi_layer_animator_test_controller.cc
@@ -0,0 +1,66 @@ +// 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 "ui/compositor/test/multi_layer_animator_test_controller.h" + +#include "base/time/time.h" +#include "ui/compositor/layer.h" +#include "ui/compositor/layer_animator.h" +#include "ui/compositor/test/layer_animator_test_controller.h" +#include "ui/compositor/test/multi_layer_animator_test_controller_delegate.h" + +namespace ui { +namespace test { + +MultiLayerAnimatorTestController::MultiLayerAnimatorTestController( + MultiLayerAnimatorTestControllerDelegate* delegate) + : delegate_(delegate) {} + +MultiLayerAnimatorTestController::~MultiLayerAnimatorTestController() {} + +void MultiLayerAnimatorTestController::SetDisableAnimationTimers( + bool disable_timers) { + for (LayerAnimator* animator : GetLayerAnimators()) + animator->set_disable_timer_for_test(disable_timers); +} + +bool MultiLayerAnimatorTestController::HasActiveAnimations() const { + for (LayerAnimator* animator : GetLayerAnimators()) { + if (animator->is_animating()) + return true; + } + return false; +} + +void MultiLayerAnimatorTestController::CompleteAnimations() { + while (HasActiveAnimations()) { + // StepAnimations() will only progress the current running animations. Thus + // each queued animation will require at least one 'Step' call and we cannot + // just use a large duration here. + StepAnimations(base::TimeDelta::FromMilliseconds(20)); + } +} + +std::vector<LayerAnimator*> +MultiLayerAnimatorTestController::GetLayerAnimators() { + return static_cast<const MultiLayerAnimatorTestController*>(this) + ->GetLayerAnimators(); +} + +std::vector<LayerAnimator*> +MultiLayerAnimatorTestController::GetLayerAnimators() const { + return delegate_->GetLayerAnimators(); +} + +void MultiLayerAnimatorTestController::StepAnimations( + const base::TimeDelta& duration) { + for (ui::LayerAnimator* animator : GetLayerAnimators()) { + LayerAnimatorTestController controller(animator); + controller.StartThreadedAnimationsIfNeeded(); + controller.Step(duration); + } +} + +} // namespace test +} // namespace ui
diff --git a/ui/compositor/test/multi_layer_animator_test_controller.h b/ui/compositor/test/multi_layer_animator_test_controller.h new file mode 100644 index 0000000..d12c11c --- /dev/null +++ b/ui/compositor/test/multi_layer_animator_test_controller.h
@@ -0,0 +1,54 @@ +// 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 UI_COMPOSITOR_TEST_MULTI_LAYER_ANIMATOR_TEST_CONTROLLER_H_ +#define UI_COMPOSITOR_TEST_MULTI_LAYER_ANIMATOR_TEST_CONTROLLER_H_ + +#include <vector> + +#include "base/macros.h" +#include "base/time/time.h" + +namespace ui { +class LayerAnimator; + +namespace test { +class MultiLayerAnimatorTestControllerDelegate; + +// Test API class to control multiple LayerAnimators. +class MultiLayerAnimatorTestController { + public: + explicit MultiLayerAnimatorTestController( + MultiLayerAnimatorTestControllerDelegate* delegate); + virtual ~MultiLayerAnimatorTestController(); + + // Disables the animation timers when |disable_timers| is true. + void SetDisableAnimationTimers(bool disable_timers); + + // Returns true if any animations are active. + bool HasActiveAnimations() const; + + // Completes all running animations. + void CompleteAnimations(); + + private: + // Get a list of all the LayerAnimator's used. Delegates to |delegate_|. + std::vector<LayerAnimator*> GetLayerAnimators(); + std::vector<LayerAnimator*> GetLayerAnimators() const; + + // Progresses all running LayerAnimationSequences by the given |duration|. + // + // NOTE: This function will NOT progress LayerAnimationSequences that are + // queued, only the running ones will be progressed. + void StepAnimations(const base::TimeDelta& duration); + + MultiLayerAnimatorTestControllerDelegate* delegate_; + + DISALLOW_COPY_AND_ASSIGN(MultiLayerAnimatorTestController); +}; + +} // namespace test +} // namespace ui + +#endif // UI_COMPOSITOR_TEST_MULTI_LAYER_ANIMATOR_TEST_CONTROLLER_H_
diff --git a/ui/compositor/test/multi_layer_animator_test_controller_delegate.h b/ui/compositor/test/multi_layer_animator_test_controller_delegate.h new file mode 100644 index 0000000..f3522203 --- /dev/null +++ b/ui/compositor/test/multi_layer_animator_test_controller_delegate.h
@@ -0,0 +1,34 @@ +// 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 UI_COMPOSITOR_TEST_MULTI_LAYER_ANIMATOR_TEST_CONTROLLER_DELEGATE_H_ +#define UI_COMPOSITOR_TEST_MULTI_LAYER_ANIMATOR_TEST_CONTROLLER_DELEGATE_H_ + +#include <vector> + +#include "base/macros.h" +#include "base/time/time.h" + +namespace ui { +class LayerAnimator; + +namespace test { + +class MultiLayerAnimatorTestControllerDelegate { + public: + // Get a list of all the LayerAnimator's used by the animation. + virtual std::vector<ui::LayerAnimator*> GetLayerAnimators() = 0; + + protected: + MultiLayerAnimatorTestControllerDelegate() {} + virtual ~MultiLayerAnimatorTestControllerDelegate() {} + + private: + DISALLOW_COPY_AND_ASSIGN(MultiLayerAnimatorTestControllerDelegate); +}; + +} // namespace test +} // namespace ui + +#endif // UI_COMPOSITOR_TEST_MULTI_LAYER_ANIMATOR_TEST_CONTROLLER_DELEGATE_H_
diff --git a/ui/compositor/test/test_suite.cc b/ui/compositor/test/test_suite.cc index 40e14d9a..04e6daf7 100644 --- a/ui/compositor/test/test_suite.cc +++ b/ui/compositor/test/test_suite.cc
@@ -14,7 +14,7 @@ #include "ui/gl/test/gl_surface_test_support.h" #if defined(OS_WIN) -#include "ui/gfx/win/dpi.h" +#include "ui/display/win/dpi.h" #endif namespace ui { @@ -32,7 +32,7 @@ gfx::RegisterPathProvider(); #if defined(OS_WIN) - gfx::SetDefaultDeviceScaleFactor(1.0f); + display::win::SetDefaultDeviceScaleFactor(1.0f); #endif message_loop_.reset(new base::MessageLoopForUI);
diff --git a/ui/display/BUILD.gn b/ui/display/BUILD.gn index 1cda6272..25032964 100644 --- a/ui/display/BUILD.gn +++ b/ui/display/BUILD.gn
@@ -41,6 +41,8 @@ "manager/display_layout_builder.h", "win/display_info.cc", "win/display_info.h", + "win/dpi.cc", + "win/dpi.h", "win/screen_win.cc", "win/screen_win.h", "win/screen_win_display.cc",
diff --git a/ui/display/display.gyp b/ui/display/display.gyp index 0cb05e3b..8274c91 100644 --- a/ui/display/display.gyp +++ b/ui/display/display.gyp
@@ -80,6 +80,8 @@ 'manager/display_layout_builder.h', 'win/display_info.cc', 'win/display_info.h', + 'win/dpi.cc', + 'win/dpi.h', 'win/screen_win.cc', 'win/screen_win.h', 'win/screen_win_display.cc',
diff --git a/ui/display/types/display_snapshot.h b/ui/display/types/display_snapshot.h index d7106916..ef0f19e5 100644 --- a/ui/display/types/display_snapshot.h +++ b/ui/display/types/display_snapshot.h
@@ -53,6 +53,7 @@ const DisplayMode* current_mode() const { return current_mode_; } const DisplayMode* native_mode() const { return native_mode_; } int64_t product_id() const { return product_id_; } + const gfx::Size& maximum_cursor_size() const { return maximum_cursor_size_; } const std::vector<const DisplayMode*>& modes() const { return modes_; } const std::vector<uint8_t>& edid() const { return edid_; } @@ -108,6 +109,9 @@ // Combination of manufacturer and product code. int64_t product_id_; + // Maximum supported cursor size on this display. + gfx::Size maximum_cursor_size_; + DISALLOW_COPY_AND_ASSIGN(DisplaySnapshot); };
diff --git a/ui/gfx/win/dpi.cc b/ui/display/win/dpi.cc similarity index 84% rename from ui/gfx/win/dpi.cc rename to ui/display/win/dpi.cc index 7d961d7..31c1940 100644 --- a/ui/gfx/win/dpi.cc +++ b/ui/display/win/dpi.cc
@@ -1,10 +1,11 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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 "ui/gfx/win/dpi.h" +#include "ui/display/win/dpi.h" #include <windows.h> + #include "base/win/scoped_hdc.h" #include "ui/gfx/display.h" @@ -17,19 +18,20 @@ float GetUnforcedDeviceScaleFactor() { return g_device_scale_factor ? g_device_scale_factor : - static_cast<float>(gfx::GetDPI().width()) / kDefaultDPI; + static_cast<float>(display::win::GetDPI().width()) / kDefaultDPI; } } // namespace -namespace gfx { +namespace display { +namespace win { void SetDefaultDeviceScaleFactor(float scale) { DCHECK_NE(0.f, scale); g_device_scale_factor = scale; } -Size GetDPI() { +gfx::Size GetDPI() { static int dpi_x = 0; static int dpi_y = 0; static bool should_initialize = true; @@ -43,7 +45,7 @@ dpi_x = GetDeviceCaps(screen_dc, LOGPIXELSX); dpi_y = GetDeviceCaps(screen_dc, LOGPIXELSY); } - return Size(dpi_x, dpi_y); + return gfx::Size(dpi_x, dpi_y); } float GetDPIScale() { @@ -53,8 +55,6 @@ return (dpi_scale <= 1.25f) ? 1.f : dpi_scale; } -namespace win { - int GetSystemMetricsInDIP(int metric) { // The system metrics always reflect the system DPI, not whatever scale we've // forced or decided to use. @@ -63,4 +63,4 @@ } } // namespace win -} // namespace gfx +} // namespace display
diff --git a/ui/gfx/win/dpi.h b/ui/display/win/dpi.h similarity index 66% rename from ui/gfx/win/dpi.h rename to ui/display/win/dpi.h index f6deab1..fa513ec 100644 --- a/ui/gfx/win/dpi.h +++ b/ui/display/win/dpi.h
@@ -1,36 +1,35 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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 UI_GFX_DPI_WIN_H_ -#define UI_GFX_DPI_WIN_H_ +#ifndef UI_DISPLAY_WIN_DPI_H_ +#define UI_DISPLAY_WIN_DPI_H_ +#include "ui/display/display_export.h" #include "ui/gfx/geometry/size.h" -#include "ui/gfx/gfx_export.h" -namespace gfx { +namespace display { +namespace win { // Sets the device scale factor that will be used unless overridden on the // command line by --force-device-scale-factor. If this is not called, and that // flag is not used, the scale factor used by the DIP conversion functions below // will be that returned by GetDPIScale(). -GFX_EXPORT void SetDefaultDeviceScaleFactor(float scale); +DISPLAY_EXPORT void SetDefaultDeviceScaleFactor(float scale); -GFX_EXPORT Size GetDPI(); +DISPLAY_EXPORT gfx::Size GetDPI(); // Gets the scale factor of the display. For example, if the display DPI is // 96 then the scale factor is 1.0. This clamps scale factors <= 1.25 to 1.0 to // maintain previous (non-DPI-aware) behavior where only the font size was // boosted. -GFX_EXPORT float GetDPIScale(); - -namespace win { +DISPLAY_EXPORT float GetDPIScale(); // Win32's GetSystemMetrics uses pixel measures. This function calls // GetSystemMetrics for the given |metric|, then converts the result to DIP. -GFX_EXPORT int GetSystemMetricsInDIP(int metric); +DISPLAY_EXPORT int GetSystemMetricsInDIP(int metric); } // namespace win -} // namespace gfx +} // namespace display -#endif // UI_GFX_DPI_WIN_H_ +#endif // UI_DISPLAY_WIN_DPI_H_
diff --git a/ui/display/win/screen_win.cc b/ui/display/win/screen_win.cc index 6e4423b08..6552936d 100644 --- a/ui/display/win/screen_win.cc +++ b/ui/display/win/screen_win.cc
@@ -9,6 +9,7 @@ #include "base/bind.h" #include "base/bind_helpers.h" #include "ui/display/win/display_info.h" +#include "ui/display/win/dpi.h" #include "ui/display/win/screen_win_display.h" #include "ui/gfx/display.h" #include "ui/gfx/geometry/point.h" @@ -16,7 +17,6 @@ #include "ui/gfx/geometry/rect.h" #include "ui/gfx/geometry/rect_conversions.h" #include "ui/gfx/geometry/size_conversions.h" -#include "ui/gfx/win/dpi.h" namespace display { namespace win { @@ -57,7 +57,7 @@ reinterpret_cast<std::vector<DisplayInfo>*>(data); DCHECK(display_infos); display_infos->push_back(DisplayInfo(MonitorInfoFromHMONITOR(monitor), - gfx::GetDPIScale())); + GetDPIScale())); return TRUE; } @@ -80,12 +80,12 @@ // static gfx::Point ScreenWin::ScreenToDIPPoint(const gfx::Point& pixel_point) { - return ScaleToFlooredPoint(pixel_point, 1.0f / gfx::GetDPIScale()); + return ScaleToFlooredPoint(pixel_point, 1.0f / GetDPIScale()); } // static gfx::Point ScreenWin::DIPToScreenPoint(const gfx::Point& dip_point) { - return ScaleToFlooredPoint(dip_point, gfx::GetDPIScale()); + return ScaleToFlooredPoint(dip_point, GetDPIScale()); } // static @@ -134,14 +134,14 @@ const gfx::Size& size_in_pixels) { // Always ceil sizes. Otherwise we may be leaving off part of the bounds. // TODO(robliao): Get the scale factor from |hwnd|. - return ScaleToCeiledSize(size_in_pixels, 1.0f / gfx::GetDPIScale()); + return ScaleToCeiledSize(size_in_pixels, 1.0f / GetDPIScale()); } // static gfx::Size ScreenWin::DIPToScreenSize(HWND hwnd, const gfx::Size& dip_size) { // Always ceil sizes. Otherwise we may be leaving off part of the bounds. // TODO(robliao): Get the scale factor from |hwnd|. - return ScaleToCeiledSize(dip_size, gfx::GetDPIScale()); + return ScaleToCeiledSize(dip_size, GetDPIScale()); } HWND ScreenWin::GetHWNDFromNativeView(gfx::NativeView window) const {
diff --git a/ui/display/win/screen_win_display.cc b/ui/display/win/screen_win_display.cc index c991b8ee2..2a9f941 100644 --- a/ui/display/win/screen_win_display.cc +++ b/ui/display/win/screen_win_display.cc
@@ -6,7 +6,6 @@ #include "ui/display/win/display_info.h" #include "ui/display/win/screen_win.h" -#include "ui/gfx/win/dpi.h" namespace display { namespace win {
diff --git a/ui/display/win/screen_win_unittest.cc b/ui/display/win/screen_win_unittest.cc index adb1dc4..003ce829 100644 --- a/ui/display/win/screen_win_unittest.cc +++ b/ui/display/win/screen_win_unittest.cc
@@ -17,12 +17,12 @@ #include "base/macros.h" #include "testing/gtest/include/gtest/gtest.h" #include "ui/display/win/display_info.h" +#include "ui/display/win/dpi.h" #include "ui/display/win/screen_win_display.h" #include "ui/gfx/display.h" #include "ui/gfx/geometry/rect.h" #include "ui/gfx/screen.h" #include "ui/gfx/test/display_util.h" -#include "ui/gfx/win/dpi.h" namespace display { namespace win { @@ -198,7 +198,7 @@ void SetUp() override { testing::Test::SetUp(); - gfx::SetDefaultDeviceScaleFactor(1.0); + display::win::SetDefaultDeviceScaleFactor(1.0); screen_win_initializer_.reset(new TestScreenWinManager()); SetUpScreen(screen_win_initializer_.get()); screen_win_initializer_->InitializeScreenWin(); @@ -206,7 +206,7 @@ void TearDown() override { screen_win_initializer_.reset(); - gfx::SetDefaultDeviceScaleFactor(1.0); + display::win::SetDefaultDeviceScaleFactor(1.0); testing::Test::TearDown(); } @@ -297,8 +297,8 @@ ScreenWinTestSingleDisplay1_25x() = default; void SetUpScreen(TestScreenWinInitializer* initializer) override { - gfx::SetDefaultDeviceScaleFactor(1.25); - // Add Monitor of Scale Factor 1.0 since gfx::GetDPIScale performs the + display::win::SetDefaultDeviceScaleFactor(1.25); + // Add Monitor of Scale Factor 1.0 since display::GetDPIScale performs the // clamping and not ScreenWin. initializer->AddMonitor(gfx::Rect(0, 0, 1920, 1200), gfx::Rect(0, 0, 1920, 1100), @@ -358,7 +358,7 @@ ScreenWinTestSingleDisplay1_5x() = default; void SetUpScreen(TestScreenWinInitializer* initializer) override { - gfx::SetDefaultDeviceScaleFactor(1.5); + display::win::SetDefaultDeviceScaleFactor(1.5); initializer->AddMonitor(gfx::Rect(0, 0, 1920, 1200), gfx::Rect(0, 0, 1920, 1100), L"primary", @@ -417,7 +417,7 @@ ScreenWinTestSingleDisplay2x() = default; void SetUpScreen(TestScreenWinInitializer* initializer) override { - gfx::SetDefaultDeviceScaleFactor(2.0); + display::win::SetDefaultDeviceScaleFactor(2.0); initializer->AddMonitor(gfx::Rect(0, 0, 1920, 1200), gfx::Rect(0, 0, 1920, 1100), L"primary", @@ -575,7 +575,7 @@ ScreenWinTestTwoDisplays2x() = default; void SetUpScreen(TestScreenWinInitializer* initializer) override { - gfx::SetDefaultDeviceScaleFactor(2.0); + display::win::SetDefaultDeviceScaleFactor(2.0); initializer->AddMonitor(gfx::Rect(0, 0, 1920, 1200), gfx::Rect(0, 0, 1920, 1100), L"primary", @@ -678,7 +678,7 @@ ScreenWinTestTwoDisplays2x1xVirtualized() = default; void SetUpScreen(TestScreenWinInitializer* initializer) override { - gfx::SetDefaultDeviceScaleFactor(2.0); + display::win::SetDefaultDeviceScaleFactor(2.0); initializer->AddMonitor(gfx::Rect(0, 0, 3200, 1600), gfx::Rect(0, 0, 3200, 1500), L"primary",
diff --git a/ui/events/BUILD.gn b/ui/events/BUILD.gn index 30500e4..a7fc9af 100644 --- a/ui/events/BUILD.gn +++ b/ui/events/BUILD.gn
@@ -26,8 +26,11 @@ deps = [ "//base", - "//ipc:param_traits", ] + + if (!is_ios) { + deps += [ "//ipc:param_traits" ] + } } component("events_base") { @@ -55,6 +58,8 @@ "keycodes/keyboard_code_conversion_win.cc", "keycodes/keyboard_code_conversion_win.h", "keycodes/keyboard_codes.h", + "latency_info.cc", + "latency_info.h", ] defines = [ "EVENTS_BASE_IMPLEMENTATION" ] @@ -150,7 +155,6 @@ "//skia", "//ui/gfx", "//ui/gfx/geometry", - "//ui/latency_info", ] if (use_x11) { @@ -368,6 +372,7 @@ "keycodes/dom/keycode_converter_unittest.cc", "keycodes/keyboard_code_conversion_unittest.cc", "keycodes/platform_key_map_win_unittest.cc", + "latency_info_unittest.cc", "platform/platform_event_source_unittest.cc", "scoped_target_handler_unittest.cc", "win/event_utils_win_unittest.cc", @@ -388,7 +393,6 @@ "//ui/events/devices", "//ui/events/platform", "//ui/gfx:test_support", - "//ui/latency_info", ] if (!is_ios) { @@ -396,6 +400,7 @@ "blink/input_handler_proxy_unittest.cc", "blink/input_scroll_elasticity_controller_unittest.cc", "gestures/blink/web_gesture_curve_impl_unittest.cc", + "ipc/latency_info_param_traits_unittest.cc", ] deps += [ "//cc", @@ -403,6 +408,7 @@ "//third_party/WebKit/public:blink_headers", "//ui/events/blink", "//ui/events/gestures/blink", + "//ui/events/ipc", ] }
diff --git a/ui/events/DEPS b/ui/events/DEPS index 8a18605..b273ae3 100644 --- a/ui/events/DEPS +++ b/ui/events/DEPS
@@ -1,4 +1,3 @@ include_rules = [ "+ui/gfx", - "+ui/latency_info", ]
diff --git a/ui/events/OWNERS b/ui/events/OWNERS index 1c0edbda..f14df80fd 100644 --- a/ui/events/OWNERS +++ b/ui/events/OWNERS
@@ -1,4 +1,7 @@ sadrul@chromium.org +per-file latency_info*=tdresser@chromium.org +per-file latency_info*=jbauman@chromium.org +per-file latency_info*=miletus@chromium.org # If you're doing structural changes get a review from one of the OWNERS. per-file *.gyp*=*
diff --git a/ui/events/blink/BUILD.gn b/ui/events/blink/BUILD.gn index d73e279..37dbd98 100644 --- a/ui/events/blink/BUILD.gn +++ b/ui/events/blink/BUILD.gn
@@ -20,6 +20,6 @@ "//ui/events", "//ui/events:gesture_detection", "//ui/gfx/geometry", - "//ui/latency_info", + "//ui/events:events_base", ] }
diff --git a/ui/events/blink/events_blink.gyp b/ui/events/blink/events_blink.gyp index c347d9b..8b1b8fa 100644 --- a/ui/events/blink/events_blink.gyp +++ b/ui/events/blink/events_blink.gyp
@@ -15,7 +15,6 @@ '../../../cc/cc.gyp:cc', '../../../third_party/WebKit/public/blink_headers.gyp:blink_headers', '../../gfx/gfx.gyp:gfx_geometry', - '../../latency_info/latency_info.gyp:latency_info', '../events.gyp:events', '../events.gyp:gesture_detection', ], @@ -32,4 +31,4 @@ ], }, ], -} +} \ No newline at end of file
diff --git a/ui/events/blink/input_handler_proxy.cc b/ui/events/blink/input_handler_proxy.cc index 1b12e52e..fb9f9ca 100644 --- a/ui/events/blink/input_handler_proxy.cc +++ b/ui/events/blink/input_handler_proxy.cc
@@ -20,8 +20,8 @@ #include "third_party/WebKit/public/web/WebInputEvent.h" #include "ui/events/blink/input_handler_proxy_client.h" #include "ui/events/blink/input_scroll_elasticity_controller.h" +#include "ui/events/latency_info.h" #include "ui/gfx/geometry/point_conversions.h" -#include "ui/latency_info/latency_info.h" using blink::WebFloatPoint; using blink::WebFloatSize;
diff --git a/ui/events/blink/input_handler_proxy_unittest.cc b/ui/events/blink/input_handler_proxy_unittest.cc index 51f3be2..86cf6625 100644 --- a/ui/events/blink/input_handler_proxy_unittest.cc +++ b/ui/events/blink/input_handler_proxy_unittest.cc
@@ -18,9 +18,9 @@ #include "third_party/WebKit/public/platform/WebPoint.h" #include "third_party/WebKit/public/web/WebInputEvent.h" #include "ui/events/blink/input_handler_proxy_client.h" +#include "ui/events/latency_info.h" #include "ui/gfx/geometry/scroll_offset.h" #include "ui/gfx/geometry/size_f.h" -#include "ui/latency_info/latency_info.h" using blink::WebActiveWheelFlingParameters; using blink::WebFloatPoint;
diff --git a/ui/events/devices/x11/device_data_manager_x11.cc b/ui/events/devices/x11/device_data_manager_x11.cc index dedafac..9d83afe 100644 --- a/ui/events/devices/x11/device_data_manager_x11.cc +++ b/ui/events/devices/x11/device_data_manager_x11.cc
@@ -218,7 +218,6 @@ void DeviceDataManagerX11::UpdateDeviceList(Display* display) { cmt_devices_.reset(); touchpads_.reset(); - scrollclass_devices_.reset(); master_pointers_.clear(); for (int i = 0; i < kMaxDeviceNum; ++i) { valuator_count_[i] = 0; @@ -424,14 +423,13 @@ XIDeviceEvent* xievent = static_cast<XIDeviceEvent*>(xev.xcookie.data); if (xievent->sourceid >= kMaxDeviceNum) return SCROLL_TYPE_NO_SCROLL; - if (!scrollclass_devices_[xievent->sourceid]) - return SCROLL_TYPE_NO_SCROLL; int horizontal_id = scroll_data_[xievent->sourceid].horizontal.number; int vertical_id = scroll_data_[xievent->sourceid].vertical.number; - return (XIMaskIsSet(xievent->valuators.mask, horizontal_id) + return (horizontal_id != -1 && + XIMaskIsSet(xievent->valuators.mask, horizontal_id) ? SCROLL_TYPE_HORIZONTAL : 0) | - (XIMaskIsSet(xievent->valuators.mask, vertical_id) + (vertical_id != -1 && XIMaskIsSet(xievent->valuators.mask, vertical_id) ? SCROLL_TYPE_VERTICAL : 0); } @@ -787,7 +785,6 @@ info.horizontal.seen = false; break; } - scrollclass_devices_[deviceid] = true; } double DeviceDataManagerX11::ExtractAndUpdateScrollOffset(
diff --git a/ui/events/devices/x11/device_data_manager_x11.h b/ui/events/devices/x11/device_data_manager_x11.h index d2a3a88..d09cf34 100644 --- a/ui/events/devices/x11/device_data_manager_x11.h +++ b/ui/events/devices/x11/device_data_manager_x11.h
@@ -340,7 +340,6 @@ // should be processed. std::bitset<kMaxDeviceNum> cmt_devices_; std::bitset<kMaxDeviceNum> touchpads_; - std::bitset<kMaxDeviceNum> scrollclass_devices_; // List of the master pointer devices. std::vector<int> master_pointers_;
diff --git a/ui/events/event.h b/ui/events/event.h index 870cdc67..34944fd7 100644 --- a/ui/events/event.h +++ b/ui/events/event.h
@@ -20,9 +20,9 @@ #include "ui/events/gestures/gesture_types.h" #include "ui/events/keycodes/dom/dom_key.h" #include "ui/events/keycodes/keyboard_codes.h" +#include "ui/events/latency_info.h" #include "ui/gfx/geometry/point.h" #include "ui/gfx/geometry/point_conversions.h" -#include "ui/latency_info/latency_info.h" namespace gfx { class Transform;
diff --git a/ui/events/events.gyp b/ui/events/events.gyp index 8c814d3..c8d994f 100644 --- a/ui/events/events.gyp +++ b/ui/events/events.gyp
@@ -66,6 +66,8 @@ 'keycodes/keyboard_code_conversion_x.cc', 'keycodes/keyboard_code_conversion_x.h', 'keycodes/keyboard_codes.h', + 'latency_info.cc', + 'latency_info.h', 'x/keysym_to_unicode.cc', 'x/keysym_to_unicode.h', ], @@ -98,7 +100,6 @@ '<(DEPTH)/skia/skia.gyp:skia', '../gfx/gfx.gyp:gfx', '../gfx/gfx.gyp:gfx_geometry', - '../latency_info/latency_info.gyp:latency_info', 'dom_keycode_converter', 'events_base', 'gesture_detection', @@ -300,6 +301,24 @@ ], }, { + # GN version: //ui/events/ipc:events_ipc + 'target_name': 'events_ipc', + 'type': '<(component)', + 'dependencies': [ + '<(DEPTH)/base/base.gyp:base', + '<(DEPTH)/ipc/ipc.gyp:ipc', + 'events_base', + ], + 'defines': [ + 'EVENTS_IPC_IMPLEMENTATION', + ], + 'sources': [ + 'ipc/latency_info_param_traits.cc', + 'ipc/latency_info_param_traits.h', + 'ipc/latency_info_param_traits_macros.h', + ], + }, + { # GN version: //ui/events:test_support 'target_name': 'events_test_support', 'type': 'static_library',
diff --git a/ui/events/events_unittests.gyp b/ui/events/events_unittests.gyp index 0665b33..f5a5d01c 100644 --- a/ui/events/events_unittests.gyp +++ b/ui/events/events_unittests.gyp
@@ -26,6 +26,7 @@ 'events.gyp:dom_keycode_converter', 'events.gyp:events', 'events.gyp:events_base', + 'events.gyp:events_ipc', 'events.gyp:events_test_support', 'events.gyp:gesture_detection', 'events.gyp:gestures_blink', @@ -53,9 +54,11 @@ 'gestures/fling_curve_unittest.cc', 'gestures/gesture_provider_aura_unittest.cc', 'gestures/motion_event_aura_unittest.cc', + 'ipc/latency_info_param_traits_unittest.cc', 'keycodes/dom/keycode_converter_unittest.cc', 'keycodes/keyboard_code_conversion_unittest.cc', 'keycodes/platform_key_map_win_unittest.cc', + 'latency_info_unittest.cc', 'platform/platform_event_source_unittest.cc', 'scoped_target_handler_unittest.cc', 'win/event_utils_win_unittest.cc',
diff --git a/ui/latency_info/ipc/BUILD.gn b/ui/events/ipc/BUILD.gn similarity index 68% rename from ui/latency_info/ipc/BUILD.gn rename to ui/events/ipc/BUILD.gn index 411305d..b6ccbf5 100644 --- a/ui/latency_info/ipc/BUILD.gn +++ b/ui/events/ipc/BUILD.gn
@@ -2,23 +2,21 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import("//build/config/ui.gni") + component("ipc") { - output_name = "latency_info_ipc" + output_name = "events_ipc" sources = [ - "latency_info_ipc_export.h", "latency_info_param_traits.cc", "latency_info_param_traits.h", "latency_info_param_traits_macros.h", ] - defines = [ "LATENCY_INFO_IPC_IMPLEMENTATION" ] - - public_deps = [ - "//ui/latency_info", - ] + defines = [ "EVENTS_IPC_IMPLEMENTATION" ] deps = [ "//base", "//ipc", + "//ui/events:events_base", ] }
diff --git a/ui/events/ipc/OWNERS b/ui/events/ipc/OWNERS new file mode 100644 index 0000000..6732300 --- /dev/null +++ b/ui/events/ipc/OWNERS
@@ -0,0 +1,12 @@ +set noparent +dcheng@chromium.org +inferno@chromium.org +jln@chromium.org +jschuh@chromium.org +kenrb@chromium.org +nasko@chromium.org +palmer@chromium.org +tsepez@chromium.org + +per-file *.gyp*=* +per-file BUILD.gn=*
diff --git a/ui/events/ipc/events_ipc_export.h b/ui/events/ipc/events_ipc_export.h new file mode 100644 index 0000000..a02d669 --- /dev/null +++ b/ui/events/ipc/events_ipc_export.h
@@ -0,0 +1,29 @@ +// Copyright (c) 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 UI_EVENTS_EVENTS_IPC_EXPORT_H_ +#define UI_EVENTS_EVENTS_IPC_EXPORT_H_ + +#if defined(COMPONENT_BUILD) +#if defined(WIN32) + +#if defined(EVENTS_IPC_IMPLEMENTATION) +#define EVENTS_IPC_EXPORT __declspec(dllexport) +#else +#define EVENTS_IPC_EXPORT __declspec(dllimport) +#endif // defined(EVENTS_IPC_IMPLEMENTATION) + +#else // defined(WIN32) +#if defined(EVENTS_IPC_IMPLEMENTATION) +#define EVENTS_IPC_EXPORT __attribute__((visibility("default"))) +#else +#define EVENTS_IPC_EXPORT +#endif +#endif + +#else // defined(COMPONENT_BUILD) +#define EVENTS_IPC_EXPORT +#endif + +#endif // UI_EVENTS_EVENTS_IPC_EXPORT_H_
diff --git a/ui/latency_info/ipc/latency_info_param_traits.cc b/ui/events/ipc/latency_info_param_traits.cc similarity index 77% rename from ui/latency_info/ipc/latency_info_param_traits.cc rename to ui/events/ipc/latency_info_param_traits.cc index 22785fcf..a4723074 100644 --- a/ui/latency_info/ipc/latency_info_param_traits.cc +++ b/ui/events/ipc/latency_info_param_traits.cc
@@ -2,31 +2,31 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ui/latency_info/ipc/latency_info_param_traits_macros.h" +#include "ui/events/ipc/latency_info_param_traits_macros.h" // Generate param traits write methods. #include "ipc/param_traits_write_macros.h" namespace IPC { -#undef UI_LATENCY_INFO_IPC_LATENCY_INFO_PARAM_TRAITS_MACROS_H_ -#include "ui/latency_info/ipc/latency_info_param_traits_macros.h" +#undef UI_EVENTS_IPC_LATENCY_INFO_PARAM_TRAITS_MACROS_H_ +#include "ui/events/ipc/latency_info_param_traits_macros.h" } // namespace IPC // Generate param traits read methods. #include "ipc/param_traits_read_macros.h" namespace IPC { -#undef UI_LATENCY_INFO_IPC_LATENCY_INFO_PARAM_TRAITS_MACROS_H_ -#include "ui/latency_info/ipc/latency_info_param_traits_macros.h" +#undef UI_EVENTS_IPC_LATENCY_INFO_PARAM_TRAITS_MACROS_H_ +#include "ui/events/ipc/latency_info_param_traits_macros.h" } // namespace IPC // Generate param traits log methods. #include "ipc/param_traits_log_macros.h" namespace IPC { -#undef UI_LATENCY_INFO_IPC_LATENCY_INFO_PARAM_TRAITS_MACROS_H_ -#include "ui/latency_info/ipc/latency_info_param_traits_macros.h" +#undef UI_EVENTS_IPC_LATENCY_INFO_PARAM_TRAITS_MACROS_H_ +#include "ui/events/ipc/latency_info_param_traits_macros.h" } // namespace IPC // Implemetation for ParamTraits<ui::LatencyInfo>. -#include "ui/latency_info/ipc/latency_info_param_traits.h" +#include "ui/events/ipc/latency_info_param_traits.h" namespace IPC { void ParamTraits<ui::LatencyInfo>::Write(base::Pickle* m, const param_type& p) { @@ -54,7 +54,7 @@ return false; for (size_t i = 0; i < input_coordinates_size; i++) { if (!ReadParam(m, iter, &input_coordinates)) - return false; + return false; if (!p->AddInputCoordinate(input_coordinates)) return false; } @@ -67,7 +67,8 @@ return true; } -void ParamTraits<ui::LatencyInfo>::Log(const param_type& p, std::string* l) { +void ParamTraits<ui::LatencyInfo>::Log(const param_type& p, + std::string* l) { LogParam(p.trace_name_, l); l->append(" "); LogParam(p.latency_components_, l);
diff --git a/ui/events/ipc/latency_info_param_traits.h b/ui/events/ipc/latency_info_param_traits.h new file mode 100644 index 0000000..9e11104 --- /dev/null +++ b/ui/events/ipc/latency_info_param_traits.h
@@ -0,0 +1,23 @@ +// Copyright 2014 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 UI_EVENTS_IPC_LATENCY_INFO_PARAM_TRAITS_H_ +#define UI_EVENTS_IPC_LATENCY_INFO_PARAM_TRAITS_H_ + +#include "ui/events/ipc/events_ipc_export.h" +#include "ui/events/latency_info.h" + +namespace IPC { +template <> +struct EVENTS_IPC_EXPORT ParamTraits<ui::LatencyInfo> { + typedef ui::LatencyInfo param_type; + static void Write(base::Pickle* m, const param_type& p); + static bool Read(const base::Pickle* m, + base::PickleIterator* iter, + param_type* p); + static void Log(const param_type& p, std::string* l); +}; +} // namespace IPC + +#endif // UI_EVENTS_IPC_LATENCY_INFO_PARAM_TRAITS_H_
diff --git a/ui/latency_info/ipc/latency_info_param_traits_macros.h b/ui/events/ipc/latency_info_param_traits_macros.h similarity index 66% rename from ui/latency_info/ipc/latency_info_param_traits_macros.h rename to ui/events/ipc/latency_info_param_traits_macros.h index 2539d92..40bf738 100644 --- a/ui/latency_info/ipc/latency_info_param_traits_macros.h +++ b/ui/events/ipc/latency_info_param_traits_macros.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 UI_LATENCY_INFO_IPC_LATENCY_INFO_PARAM_TRAITS_MACROS_H_ -#define UI_LATENCY_INFO_IPC_LATENCY_INFO_PARAM_TRAITS_MACROS_H_ +#ifndef UI_EVENTS_IPC_LATENCY_INFO_PARAM_TRAITS_MACROS_H_ +#define UI_EVENTS_IPC_LATENCY_INFO_PARAM_TRAITS_MACROS_H_ #include "ipc/ipc_message_macros.h" -#include "ui/latency_info/ipc/latency_info_ipc_export.h" -#include "ui/latency_info/latency_info.h" +#include "ui/events/ipc/events_ipc_export.h" +#include "ui/events/latency_info.h" #undef IPC_MESSAGE_EXPORT -#define IPC_MESSAGE_EXPORT LATENCY_INFO_IPC_EXPORT +#define IPC_MESSAGE_EXPORT EVENTS_IPC_EXPORT IPC_ENUM_TRAITS_MAX_VALUE(ui::LatencyComponentType, ui::LATENCY_COMPONENT_TYPE_LAST) @@ -26,4 +26,4 @@ IPC_STRUCT_TRAITS_MEMBER(y) IPC_STRUCT_TRAITS_END() -#endif // UI_LATENCY_INFO_IPC_LATENCY_INFO_PARAM_TRAITS_MACROS_H_ +#endif // UI_EVENTS_IPC_LATENCY_INFO_PARAM_TRAITS_MACROS_H_
diff --git a/ui/latency_info/ipc/latency_info_param_traits_unittest.cc b/ui/events/ipc/latency_info_param_traits_unittest.cc similarity index 84% rename from ui/latency_info/ipc/latency_info_param_traits_unittest.cc rename to ui/events/ipc/latency_info_param_traits_unittest.cc index 4a1f8dc..69224dac 100644 --- a/ui/latency_info/ipc/latency_info_param_traits_unittest.cc +++ b/ui/events/ipc/latency_info_param_traits_unittest.cc
@@ -7,8 +7,8 @@ #include "ipc/ipc_message_macros.h" #include "testing/gtest/include/gtest/gtest.h" -#include "ui/latency_info/ipc/latency_info_param_traits.h" -#include "ui/latency_info/ipc/latency_info_param_traits_macros.h" +#include "ui/events/ipc/latency_info_param_traits.h" +#include "ui/events/ipc/latency_info_param_traits_macros.h" namespace ui { @@ -20,13 +20,13 @@ latency.AddLatencyNumber(INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, 1234, 100); latency.AddLatencyNumber(INPUT_EVENT_LATENCY_TERMINATED_FRAME_SWAP_COMPONENT, 1234, 0); - EXPECT_TRUE( - latency.AddInputCoordinate(LatencyInfo::InputCoordinate(100, 200))); - EXPECT_TRUE( - latency.AddInputCoordinate(LatencyInfo::InputCoordinate(101, 201))); + EXPECT_TRUE(latency.AddInputCoordinate( + LatencyInfo::InputCoordinate(100, 200))); + EXPECT_TRUE(latency.AddInputCoordinate( + LatencyInfo::InputCoordinate(101, 201))); // Up to 2 InputCoordinate is allowed. - EXPECT_FALSE( - latency.AddInputCoordinate(LatencyInfo::InputCoordinate(102, 202))); + EXPECT_FALSE(latency.AddInputCoordinate( + LatencyInfo::InputCoordinate(102, 202))); EXPECT_EQ(100, latency.trace_id()); EXPECT_TRUE(latency.terminated()); @@ -48,11 +48,13 @@ output.input_coordinates()[i].y); } - EXPECT_TRUE(output.FindLatency(INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, 1234, + EXPECT_TRUE(output.FindLatency(INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, + 1234, nullptr)); LatencyInfo::LatencyComponent rwh_comp; - EXPECT_TRUE(output.FindLatency(INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, 1234, + EXPECT_TRUE(output.FindLatency(INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, + 1234, &rwh_comp)); EXPECT_EQ(100, rwh_comp.sequence_number); EXPECT_EQ(1u, rwh_comp.event_count);
diff --git a/ui/events/keycodes/dom/dom_key.h b/ui/events/keycodes/dom/dom_key.h index 810f8213..e96656a 100644 --- a/ui/events/keycodes/dom/dom_key.h +++ b/ui/events/keycodes/dom/dom_key.h
@@ -8,7 +8,11 @@ #include <stdint.h> #include "base/logging.h" -#include "ipc/ipc_param_traits.h" +#include "build/build_config.h" + +#if !defined(OS_IOS) +#include "ipc/ipc_param_traits.h" // nogncheck +#endif namespace ui { @@ -148,7 +152,9 @@ }; private: +#if !defined(OS_IOS) friend struct IPC::ParamTraits<ui::DomKey>; +#endif Base value_; };
diff --git a/ui/latency_info/latency_info.cc b/ui/events/latency_info.cc similarity index 81% rename from ui/latency_info/latency_info.cc rename to ui/events/latency_info.cc index 66e3748..b5d9954 100644 --- a/ui/latency_info/latency_info.cc +++ b/ui/events/latency_info.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ui/latency_info/latency_info.h" +#include "ui/events/latency_info.h" #include <stddef.h> @@ -20,9 +20,7 @@ const size_t kMaxLatencyInfoNumber = 100; const char* GetComponentName(ui::LatencyComponentType type) { -#define CASE_TYPE(t) \ - case ui::t: \ - return #t +#define CASE_TYPE(t) case ui::t: return #t switch (type) { CASE_TYPE(INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT); CASE_TYPE(LATENCY_BEGIN_SCROLL_LISTENER_UPDATE_MAIN_COMPONENT); @@ -106,7 +104,8 @@ new LatencyInfoTracedValue(value.release())); } -LatencyInfoTracedValue::~LatencyInfoTracedValue() {} +LatencyInfoTracedValue::~LatencyInfoTracedValue() { +} void LatencyInfoTracedValue::AppendAsTraceFormat(std::string* out) const { std::string tmp; @@ -115,28 +114,32 @@ } LatencyInfoTracedValue::LatencyInfoTracedValue(base::Value* value) - : value_(value) {} + : value_(value) { +} const char kTraceCategoriesForAsyncEvents[] = "benchmark,latencyInfo"; struct LatencyInfoEnabledInitializer { - LatencyInfoEnabledInitializer() - : latency_info_enabled(TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED( - kTraceCategoriesForAsyncEvents)) {} + LatencyInfoEnabledInitializer() : + latency_info_enabled(TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED( + kTraceCategoriesForAsyncEvents)) { + } const unsigned char* latency_info_enabled; }; static base::LazyInstance<LatencyInfoEnabledInitializer>::Leaky - g_latency_info_enabled = LAZY_INSTANCE_INITIALIZER; + g_latency_info_enabled = LAZY_INSTANCE_INITIALIZER; } // namespace namespace ui { -LatencyInfo::InputCoordinate::InputCoordinate() : x(0), y(0) {} +LatencyInfo::InputCoordinate::InputCoordinate() : x(0), y(0) { +} -LatencyInfo::InputCoordinate::InputCoordinate(float x, float y) : x(x), y(y) {} +LatencyInfo::InputCoordinate::InputCoordinate(float x, float y) : x(x), y(y) { +} LatencyInfo::LatencyInfo() : input_coordinates_size_(0), @@ -159,7 +162,8 @@ LOG(ERROR) << referring_msg << ", LatencyInfo vector size " << latency_info.size() << " is too big."; TRACE_EVENT_INSTANT1("input,benchmark", "LatencyInfo::Verify Fails", - TRACE_EVENT_SCOPE_GLOBAL, "size", latency_info.size()); + TRACE_EVENT_SCOPE_GLOBAL, + "size", latency_info.size()); return false; } return true; @@ -169,9 +173,11 @@ LatencyComponentType type) { for (const auto& lc : other.latency_components()) { if (lc.first.first == type) { - AddLatencyNumberWithTimestamp( - lc.first.first, lc.first.second, lc.second.sequence_number, - lc.second.event_time, lc.second.event_count); + AddLatencyNumberWithTimestamp(lc.first.first, + lc.first.second, + lc.second.sequence_number, + lc.second.event_time, + lc.second.event_count); } } } @@ -179,9 +185,11 @@ void LatencyInfo::AddNewLatencyFrom(const LatencyInfo& other) { for (const auto& lc : other.latency_components()) { if (!FindLatency(lc.first.first, lc.first.second, NULL)) { - AddLatencyNumberWithTimestamp( - lc.first.first, lc.first.second, lc.second.sequence_number, - lc.second.event_time, lc.second.event_count); + AddLatencyNumberWithTimestamp(lc.first.first, + lc.first.second, + lc.second.sequence_number, + lc.second.event_time, + lc.second.event_count); } } } @@ -235,9 +243,12 @@ // not when we actually issue the ASYNC_BEGIN trace event. LatencyComponent begin_component; int64_t ts = 0; - if (FindLatency(INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, 0, + if (FindLatency(INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, + 0, &begin_component) || - FindLatency(INPUT_EVENT_LATENCY_UI_COMPONENT, 0, &begin_component)) { + FindLatency(INPUT_EVENT_LATENCY_UI_COMPONENT, + 0, + &begin_component)) { ts = begin_component.event_time.ToInternalValue(); } else { ts = base::TimeTicks::Now().ToInternalValue(); @@ -251,13 +262,17 @@ } TRACE_EVENT_COPY_ASYNC_BEGIN_WITH_TIMESTAMP0( - kTraceCategoriesForAsyncEvents, trace_name_.c_str(), - TRACE_ID_DONT_MANGLE(trace_id_), ts); + kTraceCategoriesForAsyncEvents, + trace_name_.c_str(), + TRACE_ID_DONT_MANGLE(trace_id_), + ts); } - TRACE_EVENT_WITH_FLOW1("input,benchmark", "LatencyInfo.Flow", + TRACE_EVENT_WITH_FLOW1("input,benchmark", + "LatencyInfo.Flow", TRACE_ID_DONT_MANGLE(trace_id_), - TRACE_EVENT_FLAG_FLOW_OUT, "trace_id", trace_id_); + TRACE_EVENT_FLAG_FLOW_OUT, + "trace_id", trace_id_); } LatencyMap::key_type key = std::make_pair(component, id); @@ -266,15 +281,15 @@ LatencyComponent info = {component_sequence_number, time, event_count}; latency_components_[key] = info; } else { - it->second.sequence_number = - std::max(component_sequence_number, it->second.sequence_number); + it->second.sequence_number = std::max(component_sequence_number, + it->second.sequence_number); uint32_t new_count = event_count + it->second.event_count; if (event_count > 0 && new_count != 0) { // Do a weighted average, so that the new event_time is the average of // the times of events currently in this structure with the time passed // into this method. - it->second.event_time += - (time - it->second.event_time) * event_count / new_count; + it->second.event_time += (time - it->second.event_time) * event_count / + new_count; it->second.event_count = new_count; } } @@ -285,13 +300,15 @@ terminated_ = true; if (*latency_info_enabled) { - TRACE_EVENT_COPY_ASYNC_END2( - kTraceCategoriesForAsyncEvents, trace_name_.c_str(), - TRACE_ID_DONT_MANGLE(trace_id_), "data", AsTraceableData(), - "coordinates", CoordinatesAsTraceableData()); + TRACE_EVENT_COPY_ASYNC_END2(kTraceCategoriesForAsyncEvents, + trace_name_.c_str(), + TRACE_ID_DONT_MANGLE(trace_id_), + "data", AsTraceableData(), + "coordinates", CoordinatesAsTraceableData()); } - TRACE_EVENT_WITH_FLOW0("input,benchmark", "LatencyInfo.Flow", + TRACE_EVENT_WITH_FLOW0("input,benchmark", + "LatencyInfo.Flow", TRACE_ID_DONT_MANGLE(trace_id_), TRACE_EVENT_FLAG_FLOW_IN); } @@ -306,9 +323,11 @@ new base::DictionaryValue()); component_info->SetDouble("comp_id", static_cast<double>(lc.first.second)); component_info->SetDouble( - "time", static_cast<double>(lc.second.event_time.ToInternalValue())); + "time", + static_cast<double>(lc.second.event_time.ToInternalValue())); component_info->SetDouble("count", lc.second.event_count); - component_info->SetDouble("sequence_number", lc.second.sequence_number); + component_info->SetDouble("sequence_number", + lc.second.sequence_number); record_data->Set(GetComponentName(lc.first.first), std::move(component_info)); } @@ -332,8 +351,8 @@ bool LatencyInfo::FindLatency(LatencyComponentType type, int64_t id, LatencyComponent* output) const { - LatencyMap::const_iterator it = - latency_components_.find(std::make_pair(type, id)); + LatencyMap::const_iterator it = latency_components_.find( + std::make_pair(type, id)); if (it == latency_components_.end()) return false; if (output)
diff --git a/ui/latency_info/latency_info.dot b/ui/events/latency_info.dot similarity index 100% rename from ui/latency_info/latency_info.dot rename to ui/events/latency_info.dot
diff --git a/ui/latency_info/latency_info.h b/ui/events/latency_info.h similarity index 95% rename from ui/latency_info/latency_info.h rename to ui/events/latency_info.h index 880b4adf..22e1ab4 100644 --- a/ui/latency_info/latency_info.h +++ b/ui/events/latency_info.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef UI_LATENCY_INFO_LATENCY_INFO_H_ -#define UI_LATENCY_INFO_LATENCY_INFO_H_ +#ifndef UI_EVENTS_LATENCY_INFO_H_ +#define UI_EVENTS_LATENCY_INFO_H_ #include <stdint.h> @@ -15,7 +15,7 @@ #include "base/containers/small_map.h" #include "base/time/time.h" #include "base/trace_event/trace_event.h" -#include "ui/latency_info/latency_info_export.h" +#include "ui/events/events_base_export.h" #if !defined(OS_IOS) #include "ipc/ipc_param_traits.h" // nogncheck @@ -97,10 +97,10 @@ // but the swap failed. INPUT_EVENT_LATENCY_TERMINATED_SWAP_FAILED_COMPONENT, LATENCY_COMPONENT_TYPE_LAST = - INPUT_EVENT_LATENCY_TERMINATED_SWAP_FAILED_COMPONENT, + INPUT_EVENT_LATENCY_TERMINATED_SWAP_FAILED_COMPONENT, }; -class LATENCY_INFO_EXPORT LatencyInfo { +class EVENTS_BASE_EXPORT LatencyInfo { public: struct LatencyComponent { // Nondecreasing number that can be used to determine what events happened @@ -113,7 +113,7 @@ uint32_t event_count; }; - struct LATENCY_INFO_EXPORT InputCoordinate { + struct EVENTS_BASE_EXPORT InputCoordinate { InputCoordinate(); InputCoordinate(float x, float y); @@ -130,8 +130,7 @@ // component info. typedef base::SmallMap< std::map<std::pair<LatencyComponentType, int64_t>, LatencyComponent>, - kTypicalMaxComponentsPerLatencyInfo> - LatencyMap; + kTypicalMaxComponentsPerLatencyInfo> LatencyMap; LatencyInfo(); LatencyInfo(const LatencyInfo& other); @@ -241,4 +240,4 @@ } // namespace ui -#endif // UI_LATENCY_INFO_LATENCY_INFO_H_ +#endif // UI_EVENTS_LATENCY_INFO_H_
diff --git a/ui/latency_info/latency_info_unittest.cc b/ui/events/latency_info_unittest.cc similarity index 98% rename from ui/latency_info/latency_info_unittest.cc rename to ui/events/latency_info_unittest.cc index 1d17863a..e279863 100644 --- a/ui/latency_info/latency_info_unittest.cc +++ b/ui/events/latency_info_unittest.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ui/latency_info/latency_info.h" +#include "ui/events/latency_info.h" #include <stddef.h>
diff --git a/ui/events/platform/x11/x11_event_source.cc b/ui/events/platform/x11/x11_event_source.cc index f450227..e1bc15e 100644 --- a/ui/events/platform/x11/x11_event_source.cc +++ b/ui/events/platform/x11/x11_event_source.cc
@@ -111,7 +111,9 @@ void X11EventSource::PostDispatchEvent(XEvent* xevent) { if (xevent->type == GenericEvent && (xevent->xgeneric.evtype == XI_HierarchyChanged || - xevent->xgeneric.evtype == XI_DeviceChanged)) { + (xevent->xgeneric.evtype == XI_DeviceChanged && + static_cast<XIDeviceChangedEvent*>(xevent->xcookie.data)->reason == + XIDeviceChange))) { ui::UpdateDeviceList(); hotplug_event_handler_->OnHotplugEvent(); }
diff --git a/ui/gfx/BUILD.gn b/ui/gfx/BUILD.gn index bdff3e3..ffabe80 100644 --- a/ui/gfx/BUILD.gn +++ b/ui/gfx/BUILD.gn
@@ -209,8 +209,6 @@ "win/direct_manipulation.h", "win/direct_write.cc", "win/direct_write.h", - "win/dpi.cc", - "win/dpi.h", "win/hwnd_util.cc", "win/hwnd_util.h", "win/physical_size.cc", @@ -691,17 +689,6 @@ } } -bundle_data("gfx_unittests_bundle_data") { - testonly = true - sources = [ - "test/data", - ] - outputs = [ - "{{bundle_resources_dir}}/" + - "{{source_root_relative_dir}}/{{source_file_part}}", - ] -} - test("gfx_unittests") { sources = [ "font_render_params_linux_unittest.cc", @@ -784,7 +771,6 @@ deps = [ ":gfx", - ":gfx_unittests_bundle_data", ":test_support", "//base", "//base/test:test_support",
diff --git a/ui/gfx/display.h b/ui/gfx/display.h index 33db48b..838a25f 100644 --- a/ui/gfx/display.h +++ b/ui/gfx/display.h
@@ -148,6 +148,12 @@ // True if there is an internal display. static bool HasInternalDisplay(); + // Maximum cursor size in native pixels. + const Size& maximum_cursor_size() const { return maximum_cursor_size_; } + void set_maximum_cursor_size(const Size& size) { + maximum_cursor_size_ = size; + } + private: int64_t id_; Rect bounds_; @@ -155,6 +161,7 @@ float device_scale_factor_; Rotation rotation_; TouchSupport touch_support_; + Size maximum_cursor_size_; }; // This is declared here for use in gtest-based unit tests but is defined in
diff --git a/ui/gfx/gfx.gyp b/ui/gfx/gfx.gyp index e7936ce..c648d303 100644 --- a/ui/gfx/gfx.gyp +++ b/ui/gfx/gfx.gyp
@@ -310,8 +310,6 @@ 'win/direct_manipulation.h', 'win/direct_write.cc', 'win/direct_write.h', - 'win/dpi.cc', - 'win/dpi.h', 'win/hwnd_util.cc', 'win/hwnd_util.h', "win/physical_size.cc",
diff --git a/ui/gl/gl_surface.cc b/ui/gl/gl_surface.cc index da08315..a312cf5 100644 --- a/ui/gl/gl_surface.cc +++ b/ui/gl/gl_surface.cc
@@ -217,7 +217,8 @@ bool is_clipped, const RectF& clip_rect, const Transform& transform, - int sorting_content_id) { + int sorting_content_id, + unsigned filter) { NOTIMPLEMENTED(); return false; }
diff --git a/ui/gl/gl_surface.h b/ui/gl/gl_surface.h index 6fa6947..64906f6 100644 --- a/ui/gl/gl_surface.h +++ b/ui/gl/gl_surface.h
@@ -189,7 +189,8 @@ bool is_clipped, const RectF& clip_rect, const Transform& transform, - int sorting_content_id); + int sorting_content_id, + unsigned filter); virtual bool IsSurfaceless() const;
diff --git a/ui/latency_info/BUILD.gn b/ui/latency_info/BUILD.gn deleted file mode 100644 index ad8f8c152..0000000 --- a/ui/latency_info/BUILD.gn +++ /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("//testing/test.gni") - -component("latency_info") { - sources = [ - "latency_info.cc", - "latency_info.h", - "latency_info_export.h", - ] - - defines = [ "LATENCY_INFO_IMPLEMENTATION" ] - - deps = [ - "//base", - ] -} - -test("latency_info_unittests") { - sources = [ - "latency_info_unittest.cc", - ] - - deps = [ - ":latency_info", - "//base", - "//base/test:run_all_unittests", - "//base/test:test_support", - "//testing/gmock", - "//testing/gtest", - ] - - if (!is_ios) { - sources += [ "ipc/latency_info_param_traits_unittest.cc" ] - deps += [ - "//ipc:test_support", - "//ui/latency_info/ipc", - ] - } -}
diff --git a/ui/latency_info/OWNERS b/ui/latency_info/OWNERS deleted file mode 100644 index b29cc1a..0000000 --- a/ui/latency_info/OWNERS +++ /dev/null
@@ -1 +0,0 @@ -tdresser@chromium.org
diff --git a/ui/latency_info/ipc/OWNERS b/ui/latency_info/ipc/OWNERS deleted file mode 100644 index 107c401..0000000 --- a/ui/latency_info/ipc/OWNERS +++ /dev/null
@@ -1,13 +0,0 @@ -# Changes to IPCs require a security review to avoid introducing -# new sandbox escapes. -set noparent -dcheng@chromium.org -inferno@chromium.org -jln@chromium.org -jschuh@chromium.org -kenrb@chromium.org -mkwst@chromium.org -nasko@chromium.org -palmer@chromium.org -tsepez@chromium.org -wfh@chromium.org
diff --git a/ui/latency_info/ipc/latency_info_ipc_export.h b/ui/latency_info/ipc/latency_info_ipc_export.h deleted file mode 100644 index cf80d5fd..0000000 --- a/ui/latency_info/ipc/latency_info_ipc_export.h +++ /dev/null
@@ -1,29 +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 UI_LATENCY_INFO_LATENCY_INFO_IPC_EXPORT_H_ -#define UI_LATENCY_INFO_LATENCY_INFO_IPC_EXPORT_H_ - -#if defined(COMPONENT_BUILD) -#if defined(WIN32) - -#if defined(LATENCY_INFO_IPC_IMPLEMENTATION) -#define LATENCY_INFO_IPC_EXPORT __declspec(dllexport) -#else -#define LATENCY_INFO_IPC_EXPORT __declspec(dllimport) -#endif // defined(LATENCY_INFO_IPC_IMPLEMENTATION) - -#else // defined(WIN32) -#if defined(LATENCY_INFO_IPC_IMPLEMENTATION) -#define LATENCY_INFO_IPC_EXPORT __attribute__((visibility("default"))) -#else -#define LATENCY_INFO_IPC_EXPORT -#endif -#endif - -#else // defined(COMPONENT_BUILD) -#define LATENCY_INFO_IPC_EXPORT -#endif - -#endif // UI_LATENCY_INFO_LATENCY_INFO_IPC_EXPORT_H_
diff --git a/ui/latency_info/ipc/latency_info_param_traits.h b/ui/latency_info/ipc/latency_info_param_traits.h deleted file mode 100644 index 4bfdc6e..0000000 --- a/ui/latency_info/ipc/latency_info_param_traits.h +++ /dev/null
@@ -1,23 +0,0 @@ -// Copyright 2014 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 UI_LATENCY_INFO_IPC_LATENCY_INFO_PARAM_TRAITS_H_ -#define UI_LATENCY_INFO_IPC_LATENCY_INFO_PARAM_TRAITS_H_ - -#include "ui/latency_info/ipc/latency_info_ipc_export.h" -#include "ui/latency_info/latency_info.h" - -namespace IPC { -template <> -struct LATENCY_INFO_IPC_EXPORT ParamTraits<ui::LatencyInfo> { - typedef ui::LatencyInfo param_type; - static void Write(base::Pickle* m, const param_type& p); - static bool Read(const base::Pickle* m, - base::PickleIterator* iter, - param_type* p); - static void Log(const param_type& p, std::string* l); -}; -} // namespace IPC - -#endif // UI_LATENCY_INFO_IPC_LATENCY_INFO_PARAM_TRAITS_H_
diff --git a/ui/latency_info/latency_info.gyp b/ui/latency_info/latency_info.gyp deleted file mode 100644 index ce7f05f..0000000 --- a/ui/latency_info/latency_info.gyp +++ /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. - -{ - 'variables': { - 'chromium_code': 1, - }, - 'targets': [ - { - # GN version: //ui/latency_info:latency_info - 'target_name': 'latency_info', - 'type': '<(component)', - 'dependencies': [ - '<(DEPTH)/base/base.gyp:base', - ], - 'defines': [ - 'LATENCY_INFO_IMPLEMENTATION', - ], - 'sources': [ - 'latency_info.cc', - 'latency_info.h', - 'latency_info_export.h', - ], - }, - { - # GN version: //ui/latency_info/ipc:latency_info_ipc - 'target_name': 'latency_info_ipc', - 'type': '<(component)', - 'dependencies': [ - '<(DEPTH)/base/base.gyp:base', - '<(DEPTH)/ipc/ipc.gyp:ipc', - 'latency_info', - ], - 'defines': [ - 'LATENCY_INFO_IPC_IMPLEMENTATION', - ], - 'sources': [ - 'ipc/latency_info_ipc_export.h', - 'ipc/latency_info_param_traits.cc', - 'ipc/latency_info_param_traits.h', - 'ipc/latency_info_param_traits_macros.h', - ], - }, - ], -}
diff --git a/ui/latency_info/latency_info_export.h b/ui/latency_info/latency_info_export.h deleted file mode 100644 index 864c966..0000000 --- a/ui/latency_info/latency_info_export.h +++ /dev/null
@@ -1,29 +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 UI_LATENCY_INFO_LATENCY_INFO_EXPORT_H_ -#define UI_LATENCY_INFO_LATENCY_INFO_EXPORT_H_ - -#if defined(COMPONENT_BUILD) -#if defined(WIN32) - -#if defined(LATENCY_INFO_IMPLEMENTATION) -#define LATENCY_INFO_EXPORT __declspec(dllexport) -#else -#define LATENCY_INFO_EXPORT __declspec(dllimport) -#endif // defined(LATENCY_INFO_IMPLEMENTATION) - -#else // defined(WIN32) -#if defined(LATENCY_INFO_IMPLEMENTATION) -#define LATENCY_INFO_EXPORT __attribute__((visibility("default"))) -#else -#define LATENCY_INFO_EXPORT -#endif -#endif - -#else // defined(COMPONENT_BUILD) -#define LATENCY_INFO_EXPORT -#endif - -#endif // UI_LATENCY_INFO_LATENCY_INFO_EXPORT_H_
diff --git a/ui/latency_info/latency_info_unittests.gyp b/ui/latency_info/latency_info_unittests.gyp deleted file mode 100644 index d2c9d54..0000000 --- a/ui/latency_info/latency_info_unittests.gyp +++ /dev/null
@@ -1,33 +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. - -{ - 'variables': { - 'chromium_code': 1, - }, - 'targets': [ - { - # GN version: //ui/latency_info:latency_info_unittests - 'target_name': 'latency_info_unittests', - 'type': '<(gtest_target_type)', - 'dependencies': [ - '<(DEPTH)/base/base.gyp:base', - '<(DEPTH)/base/base.gyp:run_all_unittests', - '<(DEPTH)/base/base.gyp:test_support_base', - '<(DEPTH)/ipc/ipc.gyp:test_support_ipc', - '<(DEPTH)/testing/gtest.gyp:gtest', - 'latency_info.gyp:latency_info', - 'latency_info.gyp:latency_info_ipc', - ], - 'sources': [ - # Note: sources list duplicated in GN build. - 'latency_info_unittest.cc', - 'ipc/latency_info_param_traits_unittest.cc', - ], - 'include_dirs': [ - '../../testing/gmock/include', - ], - }, - ], -}
diff --git a/ui/login/display_manager.js b/ui/login/display_manager.js index b44e359a..e0d6f92 100644 --- a/ui/login/display_manager.js +++ b/ui/login/display_manager.js
@@ -572,6 +572,9 @@ $('step-logo').hidden = newStep.classList.contains('no-logo'); + $('oobe').dispatchEvent( + new CustomEvent('screenchanged', + {detail: this.currentScreen.id})); chrome.send('updateCurrentScreen', [this.currentScreen.id]); },
diff --git a/ui/message_center/views/notification_view.cc b/ui/message_center/views/notification_view.cc index 23f298a7..3c20438a2 100644 --- a/ui/message_center/views/notification_view.cc +++ b/ui/message_center/views/notification_view.cc
@@ -532,9 +532,9 @@ const GURL url = notification.origin_url(); DCHECK(url.is_valid()); return gfx::ElideText( - url_formatter::FormatUrlForSecurityDisplayOmitScheme(url), - views::Label().font_list(), kContextMessageViewWidth, - gfx::ELIDE_HEAD); + url_formatter::FormatUrlForSecurityDisplay( + url, url_formatter::SchemeDisplay::OMIT_HTTP_AND_HTTPS), + views::Label().font_list(), kContextMessageViewWidth, gfx::ELIDE_HEAD); } return gfx::TruncateString(notification.context_message(),
diff --git a/ui/native_theme/BUILD.gn b/ui/native_theme/BUILD.gn index cf45563..02642a8 100644 --- a/ui/native_theme/BUILD.gn +++ b/ui/native_theme/BUILD.gn
@@ -49,6 +49,7 @@ "//base/third_party/dynamic_annotations", "//skia", "//ui/base", + "//ui/display", "//ui/gfx", "//ui/gfx/geometry", "//ui/resources",
diff --git a/ui/native_theme/DEPS b/ui/native_theme/DEPS index 79d347c..6108065 100644 --- a/ui/native_theme/DEPS +++ b/ui/native_theme/DEPS
@@ -2,6 +2,7 @@ "+skia/ext", "+third_party/skia", "+ui/base", + "+ui/display", "+ui/gfx", "+ui/resources/grit/ui_resources.h", ]
diff --git a/ui/native_theme/native_theme.gyp b/ui/native_theme/native_theme.gyp index 4c06d76d..e78432b 100644 --- a/ui/native_theme/native_theme.gyp +++ b/ui/native_theme/native_theme.gyp
@@ -15,6 +15,7 @@ '../../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations', '../../skia/skia.gyp:skia', '../base/ui_base.gyp:ui_base', + '../display/display.gyp:display', '../gfx/gfx.gyp:gfx', '../gfx/gfx.gyp:gfx_geometry', '../resources/ui_resources.gyp:ui_resources',
diff --git a/ui/native_theme/native_theme_win.cc b/ui/native_theme/native_theme_win.cc index da3ae0c..f10db7e 100644 --- a/ui/native_theme/native_theme_win.cc +++ b/ui/native_theme/native_theme_win.cc
@@ -24,13 +24,13 @@ #include "third_party/skia/include/core/SkColorPriv.h" #include "third_party/skia/include/core/SkShader.h" #include "ui/base/material_design/material_design_controller.h" +#include "ui/display/win/dpi.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/color_utils.h" #include "ui/gfx/gdi_util.h" #include "ui/gfx/geometry/rect.h" #include "ui/gfx/geometry/rect_conversions.h" #include "ui/gfx/skia_util.h" -#include "ui/gfx/win/dpi.h" #include "ui/native_theme/common_theme.h" // This was removed from Winvers.h but is still used. @@ -203,7 +203,7 @@ case kScrollbarVerticalThumb: case kScrollbarHorizontalTrack: case kScrollbarVerticalTrack: { - int size = gfx::win::GetSystemMetricsInDIP(SM_CXVSCROLL); + int size = display::win::GetSystemMetricsInDIP(SM_CXVSCROLL); if (size == 0) size = 17; return gfx::Size(size, size);
diff --git a/ui/ozone/common/display_snapshot_proxy.cc b/ui/ozone/common/display_snapshot_proxy.cc index e057599c..0496166 100644 --- a/ui/ozone/common/display_snapshot_proxy.cc +++ b/ui/ozone/common/display_snapshot_proxy.cc
@@ -48,6 +48,7 @@ } product_id_ = params.product_id; + maximum_cursor_size_ = params.maximum_cursor_size; } DisplaySnapshotProxy::~DisplaySnapshotProxy() {
diff --git a/ui/ozone/common/display_util.cc b/ui/ozone/common/display_util.cc index 254f320..ea1dd1c0 100644 --- a/ui/ozone/common/display_util.cc +++ b/ui/ozone/common/display_util.cc
@@ -67,6 +67,7 @@ params.product_id = display.product_id(); params.string_representation = display.ToString(); + params.maximum_cursor_size = display.maximum_cursor_size(); return params; }
diff --git a/ui/ozone/common/gpu/ozone_gpu_message_params.h b/ui/ozone/common/gpu/ozone_gpu_message_params.h index afb0b07..0cbcf04 100644 --- a/ui/ozone/common/gpu/ozone_gpu_message_params.h +++ b/ui/ozone/common/gpu/ozone_gpu_message_params.h
@@ -51,6 +51,7 @@ DisplayMode_Params native_mode; int64_t product_id = 0; std::string string_representation; + gfx::Size maximum_cursor_size; }; struct OverlayCheck_Params {
diff --git a/ui/ozone/common/gpu/ozone_gpu_messages.h b/ui/ozone/common/gpu/ozone_gpu_messages.h index fab2f18..d64c53e 100644 --- a/ui/ozone/common/gpu/ozone_gpu_messages.h +++ b/ui/ozone/common/gpu/ozone_gpu_messages.h
@@ -59,6 +59,7 @@ IPC_STRUCT_TRAITS_MEMBER(native_mode) IPC_STRUCT_TRAITS_MEMBER(product_id) IPC_STRUCT_TRAITS_MEMBER(string_representation) + IPC_STRUCT_TRAITS_MEMBER(maximum_cursor_size) IPC_STRUCT_TRAITS_END() IPC_STRUCT_TRAITS_BEGIN(ui::GammaRampRGBEntry)
diff --git a/ui/ozone/platform/drm/common/drm_util.cc b/ui/ozone/platform/drm/common/drm_util.cc index 586571a1..dae5dd3 100644 --- a/ui/ozone/platform/drm/common/drm_util.cc +++ b/ui/ozone/platform/drm/common/drm_util.cc
@@ -8,6 +8,7 @@ #include <stdint.h> #include <stdlib.h> #include <sys/mman.h> +#include <xf86drm.h> #include <xf86drmMode.h> #include <utility> @@ -17,10 +18,21 @@ #define DRM_MODE_CONNECTOR_DSI 16 #endif +#if !defined(DRM_CAP_CURSOR_WIDTH) +#define DRM_CAP_CURSOR_WIDTH 0x8 +#endif + +#if !defined(DRM_CAP_CURSOR_HEIGHT) +#define DRM_CAP_CURSOR_HEIGHT 0x9 +#endif + namespace ui { namespace { +static const size_t kDefaultCursorWidth = 64; +static const size_t kDefaultCursorHeight = 64; + bool IsCrtcInUse(uint32_t crtc, const ScopedVector<HardwareDisplayControllerInfo>& displays) { for (size_t i = 0; i < displays.size(); ++i) { @@ -172,6 +184,20 @@ } // namespace +gfx::Size GetMaximumCursorSize(int fd) { + uint64_t width = 0, height = 0; + if (drmGetCap(fd, DRM_CAP_CURSOR_WIDTH, &width)) { + PLOG(WARNING) << "Unable to get cursor width capability"; + return gfx::Size(kDefaultCursorWidth, kDefaultCursorHeight); + } + if (drmGetCap(fd, DRM_CAP_CURSOR_HEIGHT, &height)) { + PLOG(WARNING) << "Unable to get cursor height capability"; + return gfx::Size(kDefaultCursorWidth, kDefaultCursorHeight); + } + + return gfx::Size(width, height); +} + HardwareDisplayControllerInfo::HardwareDisplayControllerInfo( ScopedDrmConnectorPtr connector, ScopedDrmCrtcPtr crtc, @@ -244,6 +270,7 @@ IsAspectPreserving(fd, info->connector()); params.has_color_correction_matrix = HasColorCorrectionMatrix(fd, info->crtc()); + params.maximum_cursor_size = GetMaximumCursorSize(fd); ScopedDrmPropertyBlobPtr edid_blob( GetDrmPropertyBlob(fd, info->connector(), "EDID"));
diff --git a/ui/ozone/platform/drm/common/drm_util.h b/ui/ozone/platform/drm/common/drm_util.h index 1929085..17a62bb 100644 --- a/ui/ozone/platform/drm/common/drm_util.h +++ b/ui/ozone/platform/drm/common/drm_util.h
@@ -66,6 +66,8 @@ int GetFourCCFormatForFramebuffer(gfx::BufferFormat format); +gfx::Size GetMaximumCursorSize(int fd); + } // namespace ui #endif // UI_OZONE_PLATFORM_DRM_COMMON_DRM_UTIL_H_
diff --git a/ui/ozone/platform/drm/gpu/drm_window.cc b/ui/ozone/platform/drm/gpu/drm_window.cc index 54de100..3dfc9d6 100644 --- a/ui/ozone/platform/drm/gpu/drm_window.cc +++ b/ui/ozone/platform/drm/gpu/drm_window.cc
@@ -15,6 +15,7 @@ #include "third_party/skia/include/core/SkCanvas.h" #include "third_party/skia/include/core/SkSurface.h" #include "ui/ozone/common/gpu/ozone_gpu_message_params.h" +#include "ui/ozone/platform/drm/common/drm_util.h" #include "ui/ozone/platform/drm/gpu/crtc_controller.h" #include "ui/ozone/platform/drm/gpu/drm_buffer.h" #include "ui/ozone/platform/drm/gpu/drm_device.h" @@ -26,14 +27,6 @@ namespace { -#ifndef DRM_CAP_CURSOR_WIDTH -#define DRM_CAP_CURSOR_WIDTH 0x8 -#endif - -#ifndef DRM_CAP_CURSOR_HEIGHT -#define DRM_CAP_CURSOR_HEIGHT 0x9 -#endif - void UpdateCursorImage(DrmBuffer* cursor, const SkBitmap& image) { SkRect damage; image.getBounds(&damage); @@ -228,19 +221,16 @@ } void DrmWindow::UpdateCursorBuffers() { + TRACE_EVENT0("drm", "DrmWindow::UpdateCursorBuffers"); if (!controller_) { for (size_t i = 0; i < arraysize(cursor_buffers_); ++i) { cursor_buffers_[i] = nullptr; } } else { scoped_refptr<DrmDevice> drm = controller_->GetAllocationDrmDevice(); - - uint64_t cursor_width = 64; - uint64_t cursor_height = 64; - drm->GetCapability(DRM_CAP_CURSOR_WIDTH, &cursor_width); - drm->GetCapability(DRM_CAP_CURSOR_HEIGHT, &cursor_height); - - SkImageInfo info = SkImageInfo::MakeN32Premul(cursor_width, cursor_height); + gfx::Size max_cursor_size = GetMaximumCursorSize(drm->get_fd()); + SkImageInfo info = SkImageInfo::MakeN32Premul(max_cursor_size.width(), + max_cursor_size.height()); for (size_t i = 0; i < arraysize(cursor_buffers_); ++i) { cursor_buffers_[i] = new DrmBuffer(drm); // Don't register a framebuffer for cursors since they are special (they
diff --git a/ui/platform_window/win/win_window.cc b/ui/platform_window/win/win_window.cc index c72670a..e3bf268 100644 --- a/ui/platform_window/win/win_window.cc +++ b/ui/platform_window/win/win_window.cc
@@ -42,10 +42,13 @@ const gfx::Rect& bounds) : delegate_(delegate) { CHECK(delegate_); - if (use_popup_as_root_window_for_test) + DWORD window_style = WS_OVERLAPPEDWINDOW; + if (use_popup_as_root_window_for_test) { set_window_style(WS_POPUP); - gfx::Rect window_bounds = GetWindowBoundsForClientBounds( - WS_OVERLAPPEDWINDOW, window_ex_style(), bounds); + window_style = WS_POPUP; + } + gfx::Rect window_bounds = + GetWindowBoundsForClientBounds(window_style, window_ex_style(), bounds); gfx::WindowImpl::Init(NULL, window_bounds); SetWindowText(hwnd(), L"WinWindow"); }
diff --git a/ui/views/BUILD.gn b/ui/views/BUILD.gn index f88fe268..576c2b72 100644 --- a/ui/views/BUILD.gn +++ b/ui/views/BUILD.gn
@@ -34,7 +34,7 @@ "//skia", "//third_party/icu", "//ui/accessibility", - "//ui/latency_info", + "//ui/display", "//ui/native_theme", "//ui/resources", "//ui/strings",
diff --git a/ui/views/animation/test/flood_fill_ink_drop_animation_test_api.cc b/ui/views/animation/test/flood_fill_ink_drop_animation_test_api.cc index 7378e63..eb7385ed 100644 --- a/ui/views/animation/test/flood_fill_ink_drop_animation_test_api.cc +++ b/ui/views/animation/test/flood_fill_ink_drop_animation_test_api.cc
@@ -31,7 +31,7 @@ } std::vector<ui::LayerAnimator*> -FloodFillInkDropAnimationTestApi::GetLayerAnimators() const { +FloodFillInkDropAnimationTestApi::GetLayerAnimators() { std::vector<ui::LayerAnimator*> animators = InkDropAnimationTestApi::GetLayerAnimators(); animators.push_back(ink_drop_animation()->GetRootLayer()->GetAnimator());
diff --git a/ui/views/animation/test/flood_fill_ink_drop_animation_test_api.h b/ui/views/animation/test/flood_fill_ink_drop_animation_test_api.h index 61446cf..9e3436a9 100644 --- a/ui/views/animation/test/flood_fill_ink_drop_animation_test_api.h +++ b/ui/views/animation/test/flood_fill_ink_drop_animation_test_api.h
@@ -34,7 +34,7 @@ protected: // InkDropAnimationTestApi: - std::vector<ui::LayerAnimator*> GetLayerAnimators() const override; + std::vector<ui::LayerAnimator*> GetLayerAnimators() override; private: FloodFillInkDropAnimation* ink_drop_animation() {
diff --git a/ui/views/animation/test/ink_drop_animation_test_api.cc b/ui/views/animation/test/ink_drop_animation_test_api.cc index a5714ca..86d35a6a7 100644 --- a/ui/views/animation/test/ink_drop_animation_test_api.cc +++ b/ui/views/animation/test/ink_drop_animation_test_api.cc
@@ -15,48 +15,14 @@ InkDropAnimationTestApi::InkDropAnimationTestApi( InkDropAnimation* ink_drop_animation) - : ink_drop_animation_(ink_drop_animation) {} + : ui::test::MultiLayerAnimatorTestController(this), + ink_drop_animation_(ink_drop_animation) {} InkDropAnimationTestApi::~InkDropAnimationTestApi() {} -void InkDropAnimationTestApi::SetDisableAnimationTimers(bool disable_timers) { - for (ui::LayerAnimator* animator : GetLayerAnimators()) - animator->set_disable_timer_for_test(disable_timers); -} - -bool InkDropAnimationTestApi::HasActiveAnimations() const { - for (ui::LayerAnimator* animator : GetLayerAnimators()) { - if (animator->is_animating()) - return true; - } - return false; -} - -void InkDropAnimationTestApi::CompleteAnimations() { - while (HasActiveAnimations()) { - // StepAnimations() will only progress the current running animations. Thus - // each queued animation will require at least one 'Step' call and we cannot - // just use a large duration here. - StepAnimations(base::TimeDelta::FromMilliseconds(20)); - } -} - std::vector<ui::LayerAnimator*> InkDropAnimationTestApi::GetLayerAnimators() { - return static_cast<const InkDropAnimationTestApi*>(this)->GetLayerAnimators(); -} - -std::vector<ui::LayerAnimator*> InkDropAnimationTestApi::GetLayerAnimators() - const { return std::vector<ui::LayerAnimator*>(); } -void InkDropAnimationTestApi::StepAnimations(const base::TimeDelta& duration) { - for (ui::LayerAnimator* animator : GetLayerAnimators()) { - ui::LayerAnimatorTestController controller(animator); - controller.StartThreadedAnimationsIfNeeded(); - controller.Step(duration); - } -} - } // namespace test } // namespace views
diff --git a/ui/views/animation/test/ink_drop_animation_test_api.h b/ui/views/animation/test/ink_drop_animation_test_api.h index 1b64f6e9..b8d44e4 100644 --- a/ui/views/animation/test/ink_drop_animation_test_api.h +++ b/ui/views/animation/test/ink_drop_animation_test_api.h
@@ -9,6 +9,8 @@ #include "base/macros.h" #include "base/time/time.h" +#include "ui/compositor/test/multi_layer_animator_test_controller.h" +#include "ui/compositor/test/multi_layer_animator_test_controller_delegate.h" namespace ui { class LayerAnimator; @@ -21,19 +23,12 @@ // Base Test API used by test fixtures to validate all concrete implementations // of the InkDropAnimation class. -class InkDropAnimationTestApi { +class InkDropAnimationTestApi + : public ui::test::MultiLayerAnimatorTestController, + public ui::test::MultiLayerAnimatorTestControllerDelegate { public: explicit InkDropAnimationTestApi(InkDropAnimation* ink_drop_animation); - virtual ~InkDropAnimationTestApi(); - - // Disables the animation timers when |disable_timers| is true. - void SetDisableAnimationTimers(bool disable_timers); - - // Returns true if any animations are active. - bool HasActiveAnimations() const; - - // Completes all animations for all the Layer's owned by the InkDropAnimation. - void CompleteAnimations(); + ~InkDropAnimationTestApi() override; // Gets the opacity of the ink drop. virtual float GetCurrentOpacity() const = 0; @@ -46,18 +41,10 @@ InkDropAnimation* ink_drop_animation() const { return ink_drop_animation_; } - // Get a list of all the LayerAnimator's used internally by the - // InkDropAnimation. - std::vector<ui::LayerAnimator*> GetLayerAnimators(); - virtual std::vector<ui::LayerAnimator*> GetLayerAnimators() const; + // MultiLayerAnimatorTestControllerDelegate: + std::vector<ui::LayerAnimator*> GetLayerAnimators() override; private: - // Progresses all running LayerAnimationSequences by the given |duration|. - // - // NOTE: This function will NOT progress LayerAnimationSequences that are - // queued, only the running ones will be progressed. - void StepAnimations(const base::TimeDelta& duration); - // The InkDropedAnimation to provide internal access to. InkDropAnimation* ink_drop_animation_;
diff --git a/ui/views/animation/test/square_ink_drop_animation_test_api.cc b/ui/views/animation/test/square_ink_drop_animation_test_api.cc index 2e47eb28..e098aa0 100644 --- a/ui/views/animation/test/square_ink_drop_animation_test_api.cc +++ b/ui/views/animation/test/square_ink_drop_animation_test_api.cc
@@ -39,7 +39,7 @@ } std::vector<ui::LayerAnimator*> -SquareInkDropAnimationTestApi::GetLayerAnimators() const { +SquareInkDropAnimationTestApi::GetLayerAnimators() { std::vector<ui::LayerAnimator*> animators = InkDropAnimationTestApi::GetLayerAnimators(); animators.push_back(ink_drop_animation()->GetRootLayer()->GetAnimator());
diff --git a/ui/views/animation/test/square_ink_drop_animation_test_api.h b/ui/views/animation/test/square_ink_drop_animation_test_api.h index a23c4ce4..d8b1e882 100644 --- a/ui/views/animation/test/square_ink_drop_animation_test_api.h +++ b/ui/views/animation/test/square_ink_drop_animation_test_api.h
@@ -42,7 +42,7 @@ protected: // InkDropAnimationTestApi: - std::vector<ui::LayerAnimator*> GetLayerAnimators() const override; + std::vector<ui::LayerAnimator*> GetLayerAnimators() override; private: SquareInkDropAnimation* ink_drop_animation() {
diff --git a/ui/views/bubble/bubble_window_targeter.cc b/ui/views/bubble/bubble_window_targeter.cc index 19e0c85..8fa0da8 100644 --- a/ui/views/bubble/bubble_window_targeter.cc +++ b/ui/views/bubble/bubble_window_targeter.cc
@@ -7,15 +7,14 @@ #include "ui/aura/window.h" #include "ui/gfx/path.h" #include "ui/gfx/skia_util.h" -#include "ui/views/bubble/bubble_delegate.h" +#include "ui/views/bubble/bubble_dialog_delegate.h" #include "ui/views/bubble/bubble_frame_view.h" namespace views { -BubbleWindowTargeter::BubbleWindowTargeter(BubbleDelegateView* bubble) +BubbleWindowTargeter::BubbleWindowTargeter(BubbleDialogDelegateView* bubble) : wm::MaskedWindowTargeter(bubble->GetWidget()->GetNativeView()), - bubble_(bubble) { -} + bubble_(bubble) {} BubbleWindowTargeter::~BubbleWindowTargeter() { }
diff --git a/ui/views/bubble/bubble_window_targeter.h b/ui/views/bubble/bubble_window_targeter.h index fd9550f..7b7f87b 100644 --- a/ui/views/bubble/bubble_window_targeter.h +++ b/ui/views/bubble/bubble_window_targeter.h
@@ -11,21 +11,22 @@ } namespace views { -class BubbleDelegateView; + +class BubbleDialogDelegateView; // A convenient window-targeter that uses a mask based on the content-bounds of // the bubble-frame. class VIEWS_EXPORT BubbleWindowTargeter : public NON_EXPORTED_BASE(wm::MaskedWindowTargeter) { public: - explicit BubbleWindowTargeter(BubbleDelegateView* bubble); + explicit BubbleWindowTargeter(BubbleDialogDelegateView* bubble); ~BubbleWindowTargeter() override; private: // wm::MaskedWindowTargeter: bool GetHitTestMask(aura::Window* window, gfx::Path* mask) const override; - views::BubbleDelegateView* bubble_; + views::BubbleDialogDelegateView* bubble_; DISALLOW_COPY_AND_ASSIGN(BubbleWindowTargeter); };
diff --git a/ui/views/bubble/bubble_window_targeter_unittest.cc b/ui/views/bubble/bubble_window_targeter_unittest.cc index cf65e4b..3533ad2 100644 --- a/ui/views/bubble/bubble_window_targeter_unittest.cc +++ b/ui/views/bubble/bubble_window_targeter_unittest.cc
@@ -9,7 +9,7 @@ #include "ui/aura/window_event_dispatcher.h" #include "ui/events/event_utils.h" #include "ui/views/bubble/bubble_border.h" -#include "ui/views/bubble/bubble_delegate.h" +#include "ui/views/bubble/bubble_dialog_delegate.h" #include "ui/views/test/views_test_base.h" #include "ui/views/widget/widget.h" @@ -17,16 +17,15 @@ namespace { -class WidgetOwnsNativeBubble : public BubbleDelegateView { +class WidgetOwnsNativeBubble : public BubbleDialogDelegateView { public: WidgetOwnsNativeBubble(View* content, BubbleBorder::Arrow arrow) - : BubbleDelegateView(content, arrow) { - } + : BubbleDialogDelegateView(content, arrow) {} ~WidgetOwnsNativeBubble() override {} private: - // BubbleDelegateView: + // BubbleDialogDelegateView: void OnBeforeBubbleWidgetInit(Widget::InitParams* params, Widget* widget) const override { params->ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; @@ -62,7 +61,7 @@ Widget* anchor_widget() { return anchor_.get(); } Widget* bubble_widget() { return bubble_widget_.get(); } - BubbleDelegateView* bubble_delegate() { return bubble_delegate_; } + BubbleDialogDelegateView* bubble_delegate() { return bubble_delegate_; } private: void CreateAnchorWidget() { @@ -76,12 +75,13 @@ bubble_delegate_ = new WidgetOwnsNativeBubble( anchor_->GetContentsView(), BubbleBorder::NONE); bubble_delegate_->set_color(SK_ColorGREEN); - bubble_widget_.reset(BubbleDelegateView::CreateBubble(bubble_delegate_)); + bubble_widget_.reset( + BubbleDialogDelegateView::CreateBubble(bubble_delegate_)); } std::unique_ptr<Widget> anchor_; std::unique_ptr<Widget> bubble_widget_; - BubbleDelegateView* bubble_delegate_; + BubbleDialogDelegateView* bubble_delegate_; DISALLOW_COPY_AND_ASSIGN(BubbleWindowTargeterTest); };
diff --git a/ui/views/bubble/tray_bubble_view.cc b/ui/views/bubble/tray_bubble_view.cc index 3d6e648..0303ea5c 100644 --- a/ui/views/bubble/tray_bubble_view.cc +++ b/ui/views/bubble/tray_bubble_view.cc
@@ -320,7 +320,7 @@ View* anchor, Delegate* delegate, const InitParams& init_params) - : BubbleDelegateView(anchor, init_params.arrow), + : BubbleDialogDelegateView(anchor, init_params.arrow), params_(init_params), delegate_(delegate), preferred_width_(init_params.min_width), @@ -346,7 +346,7 @@ } void TrayBubbleView::InitializeAndShowBubble() { - // Must occur after call to BubbleDelegateView::CreateBubble(). + // Must occur after call to BubbleDialogDelegateView::CreateBubble(). SetAlignment(params_.arrow_alignment); bubble_border_->UpdateArrowOffset(); @@ -391,6 +391,10 @@ return bubble_border_->GetInsets(); } +int TrayBubbleView::GetDialogButtons() const { + return ui::DIALOG_BUTTON_NONE; +} + void TrayBubbleView::Init() { BoxLayout* layout = new BottomAlignedBoxLayout(this); layout->SetDefaultFlex(1); @@ -411,7 +415,7 @@ NonClientFrameView* TrayBubbleView::CreateNonClientFrameView(Widget* widget) { BubbleFrameView* frame = static_cast<BubbleFrameView*>( - BubbleDelegateView::CreateNonClientFrameView(widget)); + BubbleDialogDelegateView::CreateNonClientFrameView(widget)); frame->SetBubbleBorder(std::move(owned_bubble_border_)); return frame; }
diff --git a/ui/views/bubble/tray_bubble_view.h b/ui/views/bubble/tray_bubble_view.h index 28696a8f..b24a2e9 100644 --- a/ui/views/bubble/tray_bubble_view.h +++ b/ui/views/bubble/tray_bubble_view.h
@@ -8,7 +8,7 @@ #include <memory> #include "base/macros.h" -#include "ui/views/bubble/bubble_delegate.h" +#include "ui/views/bubble/bubble_dialog_delegate.h" #include "ui/views/mouse_watcher.h" #include "ui/views/views_export.h" @@ -32,7 +32,7 @@ // Ash status area). Mostly this handles custom anchor location and arrow and // border rendering. This also has its own delegate for handling mouse events // and other implementation specific details. -class VIEWS_EXPORT TrayBubbleView : public views::BubbleDelegateView, +class VIEWS_EXPORT TrayBubbleView : public views::BubbleDialogDelegateView, public views::MouseWatcherListener { public: // AnchorType differentiates between bubbles that are anchored on a tray @@ -74,7 +74,7 @@ // accessible name for the bubble. virtual base::string16 GetAccessibleNameForBubble() = 0; - // Passes responsibility for BubbleDelegateView::GetAnchorRect to the + // Passes responsibility for BubbleDialogDelegateView::GetAnchorRect to the // delegate. virtual gfx::Rect GetAnchorRect( views::Widget* anchor_widget, @@ -155,7 +155,7 @@ bool WidgetHasHitTestMask() const override; void GetWidgetHitTestMask(gfx::Path* mask) const override; - // Overridden from views::BubbleDelegateView. + // Overridden from views::BubbleDialogDelegateView. gfx::Rect GetAnchorRect() const override; // Overridden from views::View. @@ -175,7 +175,8 @@ Delegate* delegate, const InitParams& init_params); - // Overridden from views::BubbleDelegateView. + // Overridden from views::BubbleDialogDelegateView. + int GetDialogButtons() const override; void Init() override; // Overridden from views::View.
diff --git a/ui/views/controls/button/custom_button.cc b/ui/views/controls/button/custom_button.cc index c1193420..68a86b30 100644 --- a/ui/views/controls/button/custom_button.cc +++ b/ui/views/controls/button/custom_button.cc
@@ -48,6 +48,9 @@ MdFocusRing() { SetPaintToLayer(true); layer()->SetFillsBoundsOpaquely(false); + + // Don't accept input events. + SetEnabled(false); } ~MdFocusRing() override {}
diff --git a/ui/views/controls/menu/menu_separator_win.cc b/ui/views/controls/menu/menu_separator_win.cc index 182cc2b..2ecabdb 100644 --- a/ui/views/controls/menu/menu_separator_win.cc +++ b/ui/views/controls/menu/menu_separator_win.cc
@@ -8,9 +8,9 @@ #include <uxtheme.h> #include <Vssym32.h> +#include "ui/display/win/dpi.h" #include "ui/gfx/canvas.h" #include "ui/gfx/geometry/rect.h" -#include "ui/gfx/win/dpi.h" #include "ui/native_theme/native_theme.h" #include "ui/native_theme/native_theme_aura.h" #include "ui/views/controls/menu/menu_item_view.h" @@ -29,7 +29,7 @@ // Hack to get the separator to display correctly on Windows where we may // have fractional scales. We move the separator 1 pixel down to ensure that // it falls within the clipping rect which is scaled up. - float device_scale = gfx::GetDPIScale(); + float device_scale = display::win::GetDPIScale(); bool is_fractional_scale = (device_scale - static_cast<int>(device_scale) != 0); if (is_fractional_scale && separator_bounds.y() == 0)
diff --git a/ui/views/examples/bubble_example.cc b/ui/views/examples/bubble_example.cc index 597b7ad..6aa4790 100644 --- a/ui/views/examples/bubble_example.cc +++ b/ui/views/examples/bubble_example.cc
@@ -6,7 +6,7 @@ #include "base/macros.h" #include "base/strings/utf_string_conversions.h" -#include "ui/views/bubble/bubble_delegate.h" +#include "ui/views/bubble/bubble_dialog_delegate.h" #include "ui/views/controls/button/label_button.h" #include "ui/views/controls/label.h" #include "ui/views/layout/box_layout.h" @@ -49,12 +49,14 @@ return ASCIIToUTF16("INVALID"); } -class ExampleBubble : public BubbleDelegateView { +class ExampleBubble : public BubbleDialogDelegateView { public: - ExampleBubble(View* anchor, BubbleBorder::Arrow arrow) - : BubbleDelegateView(anchor, arrow) {} + ExampleBubble(View* anchor, BubbleBorder::Arrow arrow) + : BubbleDialogDelegateView(anchor, arrow) {} protected: + int GetDialogButtons() const override { return ui::DIALOG_BUTTON_NONE; } + void Init() override { SetLayoutManager(new BoxLayout(BoxLayout::kVertical, 50, 50, 0)); AddChildView(new Label(GetArrowName(arrow()))); @@ -117,7 +119,7 @@ if (sender == persistent_) bubble->set_close_on_deactivate(false); - BubbleDelegateView::CreateBubble(bubble); + BubbleDialogDelegateView::CreateBubble(bubble); if (sender == align_to_edge_) bubble->SetAlignment(BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE);
diff --git a/ui/views/examples/examples_main.cc b/ui/views/examples/examples_main.cc index 8efd1efd..b1a00218 100644 --- a/ui/views/examples/examples_main.cc +++ b/ui/views/examples/examples_main.cc
@@ -16,6 +16,7 @@ #include "base/run_loop.h" #include "build/build_config.h" #include "ui/base/ime/input_method_initializer.h" +#include "ui/base/material_design/material_design_controller.h" #include "ui/base/resource/resource_bundle.h" #include "ui/base/ui_base_paths.h" #include "ui/compositor/test/in_process_context_factory.h" @@ -88,6 +89,7 @@ aura::Env::GetInstance()->set_context_factory(context_factory.get()); #endif ui::InitializeInputMethodForTesting(); + ui::MaterialDesignController::Initialize(); { views::DesktopTestViewsDelegate views_delegate;
diff --git a/ui/views/touchui/touch_selection_menu_runner_views.cc b/ui/views/touchui/touch_selection_menu_runner_views.cc index d5928a3..55d146d 100644 --- a/ui/views/touchui/touch_selection_menu_runner_views.cc +++ b/ui/views/touchui/touch_selection_menu_runner_views.cc
@@ -16,7 +16,7 @@ #include "ui/gfx/geometry/size.h" #include "ui/gfx/text_utils.h" #include "ui/strings/grit/ui_strings.h" -#include "ui/views/bubble/bubble_delegate.h" +#include "ui/views/bubble/bubble_dialog_delegate.h" #include "ui/views/controls/button/button.h" #include "ui/views/controls/button/label_button.h" #include "ui/views/layout/box_layout.h" @@ -37,8 +37,8 @@ } // namespace // A bubble that contains actions available for the selected text. An object of -// this type, as a BubbleDelegateView, manages its own lifetime. -class TouchSelectionMenuRunnerViews::Menu : public BubbleDelegateView, +// this type, as a BubbleDialogDelegateView, manages its own lifetime. +class TouchSelectionMenuRunnerViews::Menu : public BubbleDialogDelegateView, public ButtonListener { public: Menu(TouchSelectionMenuRunnerViews* owner, @@ -51,7 +51,7 @@ static bool IsMenuAvailable(const ui::TouchSelectionMenuClient* client); // Closes the menu. This will eventually self-destroy the object. - void Close(); + void CloseMenu(); private: friend class TouchSelectionMenuRunnerViews::TestApi; @@ -68,9 +68,10 @@ // Helper to disconnect this menu object from its owning menu runner. void DisconnectOwner(); - // BubbleDelegateView: + // BubbleDialogDelegateView: void OnPaint(gfx::Canvas* canvas) override; void WindowClosing() override; + int GetDialogButtons() const override; // ButtonListener: void ButtonPressed(Button* sender, const ui::Event& event) override; @@ -86,7 +87,7 @@ const gfx::Rect& anchor_rect, const gfx::Size& handle_image_size, aura::Window* context) - : BubbleDelegateView(nullptr, BubbleBorder::BOTTOM_CENTER), + : BubbleDialogDelegateView(nullptr, BubbleBorder::BOTTOM_CENTER), owner_(owner), client_(client) { DCHECK(owner_); @@ -117,7 +118,7 @@ adjusted_anchor_rect.Inset(0, 0, 0, -handle_image_size.height()); SetAnchorRect(adjusted_anchor_rect); - BubbleDelegateView::CreateBubble(this); + BubbleDialogDelegateView::CreateBubble(this); GetWidget()->Show(); } @@ -170,7 +171,7 @@ return button; } -void TouchSelectionMenuRunnerViews::Menu::Close() { +void TouchSelectionMenuRunnerViews::Menu::CloseMenu() { DisconnectOwner(); // Closing the widget will self-destroy this object. Widget* widget = GetWidget(); @@ -185,7 +186,7 @@ } void TouchSelectionMenuRunnerViews::Menu::OnPaint(gfx::Canvas* canvas) { - BubbleDelegateView::OnPaint(canvas); + BubbleDialogDelegateView::OnPaint(canvas); // Draw separator bars. for (int i = 0; i < child_count() - 1; ++i) { @@ -198,15 +199,19 @@ void TouchSelectionMenuRunnerViews::Menu::WindowClosing() { DCHECK(!owner_ || owner_->menu_ == this); - BubbleDelegateView::WindowClosing(); + BubbleDialogDelegateView::WindowClosing(); if (owner_) DisconnectOwner(); } +int TouchSelectionMenuRunnerViews::Menu::GetDialogButtons() const { + return ui::DIALOG_BUTTON_NONE; +} + void TouchSelectionMenuRunnerViews::Menu::ButtonPressed( Button* sender, const ui::Event& event) { - Close(); + CloseMenu(); if (sender->tag() != kEllipsesButtonTag) client_->ExecuteCommand(sender->tag(), event.flags()); else @@ -264,7 +269,7 @@ return; // Closing the menu sets |menu_| to nullptr and eventually deletes the object. - menu_->Close(); + menu_->CloseMenu(); DCHECK(!menu_); }
diff --git a/ui/views/views.gyp b/ui/views/views.gyp index 83288d8b..dc89d3c 100644 --- a/ui/views/views.gyp +++ b/ui/views/views.gyp
@@ -673,7 +673,6 @@ '../gfx/gfx.gyp:gfx', '../gfx/gfx.gyp:gfx_geometry', '../gfx/gfx.gyp:gfx_vector_icons', - '../latency_info/latency_info.gyp:latency_info', '../native_theme/native_theme.gyp:native_theme', '../resources/ui_resources.gyp:ui_resources', '../strings/ui_strings.gyp:ui_strings', @@ -881,7 +880,6 @@ '../events/events.gyp:events_test_support', '../gfx/gfx.gyp:gfx', '../gfx/gfx.gyp:gfx_geometry', - '../latency_info/latency_info.gyp:latency_info', '../native_theme/native_theme.gyp:native_theme', '../resources/ui_resources.gyp:ui_resources', '../resources/ui_resources.gyp:ui_test_pak',
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc index 4dcceb3..e98f9a99 100644 --- a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc +++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
@@ -17,13 +17,13 @@ #include "ui/base/win/shell.h" #include "ui/compositor/compositor_constants.h" #include "ui/compositor/paint_context.h" +#include "ui/display/win/dpi.h" #include "ui/display/win/screen_win.h" #include "ui/gfx/geometry/insets.h" #include "ui/gfx/geometry/vector2d.h" #include "ui/gfx/native_widget_types.h" #include "ui/gfx/path.h" #include "ui/gfx/path_win.h" -#include "ui/gfx/win/dpi.h" #include "ui/native_theme/native_theme_aura.h" #include "ui/native_theme/native_theme_win.h" #include "ui/views/corewm/tooltip_win.h" @@ -306,9 +306,9 @@ // See crbug.com/410593. SkRegion* shape = native_region; SkRegion device_region; - if (gfx::GetDPIScale() > 1.0) { + if (display::win::GetDPIScale() > 1.0) { shape = &device_region; - const float& scale = gfx::GetDPIScale(); + const float& scale = display::win::GetDPIScale(); std::vector<SkIRect> rects; for (SkRegion::Iterator it(*native_region); !it.done(); it.next()) { const SkIRect& rect = it.rect();
diff --git a/ui/views/widget/native_widget_mac_unittest.mm b/ui/views/widget/native_widget_mac_unittest.mm index 73664e5..17825a08b 100644 --- a/ui/views/widget/native_widget_mac_unittest.mm +++ b/ui/views/widget/native_widget_mac_unittest.mm
@@ -22,7 +22,7 @@ #import "ui/events/test/cocoa_test_event_utils.h" #include "ui/events/test/event_generator.h" #import "ui/gfx/mac/coordinate_conversion.h" -#include "ui/views/bubble/bubble_delegate.h" +#include "ui/views/bubble/bubble_dialog_delegate.h" #import "ui/views/cocoa/bridged_native_widget.h" #import "ui/views/cocoa/native_widget_mac_nswindow.h" #include "ui/views/controls/button/label_button.h" @@ -236,6 +236,17 @@ DISALLOW_COPY_AND_ASSIGN(NativeHostHolder); }; +// This class gives public access to the protected ctor of +// BubbleDialogDelegateView. +class SimpleBubbleView : public BubbleDialogDelegateView { + public: + SimpleBubbleView() {} + ~SimpleBubbleView() override {} + + private: + DISALLOW_COPY_AND_ASSIGN(SimpleBubbleView); +}; + // Test visibility states triggered externally. TEST_F(NativeWidgetMacTest, HideAndShowExternally) { Widget* widget = CreateTopLevelPlatformWidget(); @@ -1075,15 +1086,15 @@ EXPECT_FALSE([dialog_widget->GetNativeWindow() canBecomeMainWindow]); // Create a bubble widget with a parent: also shouldn't get main. - BubbleDelegateView* bubble_view = new BubbleDelegateView(); + BubbleDialogDelegateView* bubble_view = new SimpleBubbleView(); bubble_view->set_parent_window(regular_widget->GetNativeView()); - Widget* bubble_widget = BubbleDelegateView::CreateBubble(bubble_view); + Widget* bubble_widget = BubbleDialogDelegateView::CreateBubble(bubble_view); EXPECT_TRUE([bubble_widget->GetNativeWindow() canBecomeKeyWindow]); EXPECT_FALSE([bubble_widget->GetNativeWindow() canBecomeMainWindow]); // But a bubble without a parent should still be able to become main. Widget* toplevel_bubble_widget = - BubbleDelegateView::CreateBubble(new BubbleDelegateView()); + BubbleDialogDelegateView::CreateBubble(new SimpleBubbleView()); EXPECT_TRUE([toplevel_bubble_widget->GetNativeWindow() canBecomeKeyWindow]); EXPECT_TRUE([toplevel_bubble_widget->GetNativeWindow() canBecomeMainWindow]);
diff --git a/ui/views/widget/widget_unittest.cc b/ui/views/widget/widget_unittest.cc index ebadeb2..e17efd67 100644 --- a/ui/views/widget/widget_unittest.cc +++ b/ui/views/widget/widget_unittest.cc
@@ -21,7 +21,7 @@ #include "ui/events/test/event_generator.h" #include "ui/gfx/geometry/point.h" #include "ui/gfx/native_widget_types.h" -#include "ui/views/bubble/bubble_delegate.h" +#include "ui/views/bubble/bubble_dialog_delegate.h" #include "ui/views/controls/textfield/textfield.h" #include "ui/views/test/native_widget_factory.h" #include "ui/views/test/test_views.h" @@ -67,6 +67,21 @@ inline void operator()(Widget* widget) const { widget->CloseNow(); } }; +class TestBubbleDialogDelegateView : public BubbleDialogDelegateView { + public: + TestBubbleDialogDelegateView(View* anchor) + : BubbleDialogDelegateView(anchor, BubbleBorder::NONE), + reset_controls_called_(false) {} + ~TestBubbleDialogDelegateView() override {} + + bool ShouldShowCloseButton() const override { + reset_controls_called_ = true; + return true; + } + + mutable bool reset_controls_called_; +}; + using WidgetAutoclosePtr = std::unique_ptr<Widget, WidgetCloser>; } // namespace @@ -835,11 +850,11 @@ WidgetAutoclosePtr anchor(CreateTopLevelPlatformWidget()); anchor->Show(); - BubbleDelegateView* bubble_delegate = - new BubbleDelegateView(anchor->client_view(), BubbleBorder::NONE); + BubbleDialogDelegateView* bubble_delegate = + new TestBubbleDialogDelegateView(anchor->client_view()); { WidgetAutoclosePtr bubble_widget( - BubbleDelegateView::CreateBubble(bubble_delegate)); + BubbleDialogDelegateView::CreateBubble(bubble_delegate)); bubble_widget->Show(); } @@ -1220,10 +1235,10 @@ EXPECT_TRUE(contents_view->HasFocus()); // Show a bubble. - BubbleDelegateView* bubble_delegate_view = - new BubbleDelegateView(contents_view, BubbleBorder::TOP_LEFT); + BubbleDialogDelegateView* bubble_delegate_view = + new TestBubbleDialogDelegateView(contents_view); bubble_delegate_view->SetFocusable(true); - BubbleDelegateView::CreateBubble(bubble_delegate_view)->Show(); + BubbleDialogDelegateView::CreateBubble(bubble_delegate_view)->Show(); bubble_delegate_view->RequestFocus(); // |contents_view_| should no longer have focus. @@ -1236,30 +1251,15 @@ EXPECT_TRUE(contents_view->HasFocus()); } -class TestBubbleDelegateView : public BubbleDelegateView { - public: - TestBubbleDelegateView(View* anchor) - : BubbleDelegateView(anchor, BubbleBorder::NONE), - reset_controls_called_(false) {} - ~TestBubbleDelegateView() override {} - - bool ShouldShowCloseButton() const override { - reset_controls_called_ = true; - return true; - } - - mutable bool reset_controls_called_; -}; - TEST_F(WidgetTest, BubbleControlsResetOnInit) { WidgetAutoclosePtr anchor(CreateTopLevelPlatformWidget()); anchor->Show(); { - TestBubbleDelegateView* bubble_delegate = - new TestBubbleDelegateView(anchor->client_view()); + TestBubbleDialogDelegateView* bubble_delegate = + new TestBubbleDialogDelegateView(anchor->client_view()); WidgetAutoclosePtr bubble_widget( - BubbleDelegateView::CreateBubble(bubble_delegate)); + BubbleDialogDelegateView::CreateBubble(bubble_delegate)); EXPECT_TRUE(bubble_delegate->reset_controls_called_); bubble_widget->Show(); }
diff --git a/url/mojo/BUILD.gn b/url/mojo/BUILD.gn index 8a93f29..7d5e5d69 100644 --- a/url/mojo/BUILD.gn +++ b/url/mojo/BUILD.gn
@@ -8,8 +8,6 @@ sources = [ "url.mojom", ] - - typemaps = [ "gurl.typemap" ] } mojom("url_mojom_origin") { @@ -17,8 +15,6 @@ "origin.mojom", ] - typemaps = [ "origin.typemap" ] - public_deps = [ ":url_mojom_gurl", ] @@ -29,11 +25,6 @@ "url_test.mojom", ] - typemaps = [ - "gurl.typemap", - "origin.typemap", - ] - public_deps = [ ":url_mojom_gurl", ":url_mojom_origin",
diff --git a/url/mojo/gurl.typemap b/url/mojo/gurl.typemap index ddd755b6..5ff7855 100644 --- a/url/mojo/gurl.typemap +++ b/url/mojo/gurl.typemap
@@ -1,17 +1,11 @@ -// 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. +# 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. -{ - "c++": { - "url.mojom.Url": { - "typename": "GURL", - "public_headers": [ - "url/gurl.h" - ], - "traits_headers": [ - "url/mojo/url_gurl_struct_traits.h" - ] - } - } -} +mojom = "//url/mojo/url.mojom" +public_headers = [ "//url/gurl.h" ] +traits_headers = [ "//url/mojo/url_gurl_struct_traits.h" ] +deps = [ + "//url", +] +type_mappings = [ "url.mojom.Url=GURL" ]
diff --git a/url/mojo/origin.typemap b/url/mojo/origin.typemap index e785ae4..f18bd5a 100644 --- a/url/mojo/origin.typemap +++ b/url/mojo/origin.typemap
@@ -1,17 +1,11 @@ -// 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. +# 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. -{ - "c++": { - "url.mojom.Origin": { - "typename": "url::Origin", - "public_headers": [ - "url/origin.h" - ], - "traits_headers": [ - "url/mojo/origin_struct_traits.h" - ] - } - } -} +mojom = "//url/mojo/origin.mojom" +public_headers = [ "//url/origin.h" ] +traits_headers = [ "//url/mojo/origin_struct_traits.h" ] +deps = [ + "//url", +] +type_mappings = [ "url.mojom.Origin=url::Origin" ]
diff --git a/url/mojo/typemaps.gni b/url/mojo/typemaps.gni new file mode 100644 index 0000000..577b028e2 --- /dev/null +++ b/url/mojo/typemaps.gni
@@ -0,0 +1,8 @@ +# 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. + +typemaps = [ + "//url/mojo/origin.typemap", + "//url/mojo/gurl.typemap", +]
diff --git a/url/url.gyp b/url/url.gyp index a1670725..a0c911b 100644 --- a/url/url.gyp +++ b/url/url.gyp
@@ -120,14 +120,14 @@ 'target_name': 'url_interfaces_mojom', 'type': 'none', 'variables': { - 'mojom_extra_generator_args': [ - '--typemap', '<(DEPTH)/url/mojo/origin.typemap', - '--typemap', '<(DEPTH)/url/mojo/gurl.typemap', - ], 'mojom_files': [ 'mojo/origin.mojom', 'mojo/url.mojom', ], + 'mojom_typemaps': [ + 'mojo/gurl.typemap', + 'mojo/origin.typemap', + ], }, 'includes': [ '../mojo/mojom_bindings_generator_explicit.gypi' ], }, @@ -140,24 +140,24 @@ 'dependencies': [ '../mojo/mojo_public.gyp:mojo_cpp_bindings', 'url_interfaces_mojom', + 'url_lib', ], }, { 'target_name': 'url_test_interfaces_mojom', 'type': 'none', 'variables': { - 'mojom_extra_generator_args': [ - '--typemap', '<(DEPTH)/url/mojo/gurl.typemap', - '--typemap', '<(DEPTH)/url/mojo/origin.typemap', - ], 'mojom_files': [ 'mojo/url_test.mojom', ], + 'mojom_typemaps': [ + 'mojo/gurl.typemap', + 'mojo/origin.typemap', + ], }, 'includes': [ '../mojo/mojom_bindings_generator_explicit.gypi' ], 'dependencies': [ '../mojo/mojo_public.gyp:mojo_cpp_bindings', - 'url_interfaces_mojom', ], }, { @@ -168,6 +168,7 @@ ], 'dependencies': [ '../mojo/mojo_public.gyp:mojo_cpp_bindings', + 'url_lib', 'url_mojom', 'url_test_interfaces_mojom', ],